Skip to content

Commit

Permalink
Merge branch 'master' into upstream1902
Browse files Browse the repository at this point in the history
  • Loading branch information
Schrodinger71 authored Feb 21, 2025
2 parents 982e2fa + 0a5e79c commit 9017c4e
Show file tree
Hide file tree
Showing 11 changed files with 79 additions and 76 deletions.
2 changes: 1 addition & 1 deletion Content.Shared/ADT/CantShoot/Systems/CantShootSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public override void Initialize()

private void OnShootAttempt(EntityUid uid, CantShootComponent component, ref ShotAttemptedEvent args)
{
if (_whitelist.IsWhitelistPassOrNull(component.Whitelist, args.Used))
if (_whitelist.IsWhitelistPass(component.Whitelist, args.Used))
return;
if (component.Popup != null)
_popup.PopupCursor(Loc.GetString(component.Popup, ("used", args.Used)), args.User);
Expand Down
43 changes: 27 additions & 16 deletions Content.Shared/ADT/Combat/ComboEffects.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ public partial interface IComboEffect
void DoEffect(EntityUid user, EntityUid target, IEntityManager entMan);
}

/// <summary>
/// наносит урон цели, damage - урон
/// </summary>
[Serializable, NetSerializable]
public sealed partial class ComboDamageEffect : IComboEffect
{
Expand All @@ -33,6 +36,9 @@ public void DoEffect(EntityUid user, EntityUid target, IEntityManager entMan)
damageable.TryChangeDamage(target, Damage);
}
}
/// <summary>
/// наносит цели урон про стамине. StaminaDamage надо указывать целым числом
/// </summary>
[Serializable, NetSerializable]
public sealed partial class ComboStaminaDamageEffect : IComboEffect
{
Expand All @@ -45,6 +51,9 @@ public void DoEffect(EntityUid user, EntityUid target, IEntityManager entMan)
stun.TakeStaminaDamage(target, StaminaDamage);
}
}
/// <summary>
/// спавнит на месте цели или пользователя прототип. SpawnOnUser и SpawnOnTarget отвечат за спавн прототипа на юзере и таргете соответственно
/// </summary>
[Serializable, NetSerializable]
public sealed partial class ComboSpawnEffect : IComboEffect
{
Expand All @@ -61,6 +70,9 @@ public void DoEffect(EntityUid user, EntityUid target, IEntityManager entMan)
entMan.SpawnAtPosition(SpawnOnUser, target.ToCoordinates());
}
}
/// <summary>
/// кидает человека на пол. DropItems отвечает за то, будут ли вещи из рук выпадать true - выпадает, false - не выпадает
/// </summary>
[Serializable, NetSerializable]
public sealed partial class ComboFallEffect : IComboEffect
{
Expand All @@ -75,6 +87,9 @@ public void DoEffect(EntityUid user, EntityUid target, IEntityManager entMan)
down.Down(target, dropHeldItems: DropItems);
}
}
/// <summary>
/// добавочный урон по тем, кто лежит на земле. IgnoreResistances отвечает за то, будут ли резисты учитываться при нанесения урона
/// </summary>

[Serializable, NetSerializable]
public sealed partial class ComboMoreDamageToDownedEffect : IComboEffect
Expand All @@ -93,6 +108,9 @@ public void DoEffect(EntityUid user, EntityUid target, IEntityManager entMan)
}
}
}
/// <summary>
/// кидачет человека в стан после комбо. Fall отвечает за падение человека, StunTime - время стана, DropItems - выпадают ли вещи при падении
/// </summary>
[Serializable, NetSerializable]
public sealed partial class ComboStunEffect : IComboEffect
{
Expand All @@ -111,22 +129,9 @@ public void DoEffect(EntityUid user, EntityUid target, IEntityManager entMan)
down.TryParalyze(target, TimeSpan.FromSeconds(StunTime), false, status, dropItems: DropItems, down: Fall);
}
}
[Serializable, NetSerializable]
public sealed partial class ComboDropFromActiveHandEffect : IComboEffect
{
[DataField]
public bool Fall = true;
[DataField]
public TimeSpan StunTime;
[DataField]
public bool DropItems = true;

public void DoEffect(EntityUid user, EntityUid target, IEntityManager entMan)
{
var down = entMan.System<SharedStunSystem>();
down.TryKnockdown(target, StunTime, true, dropItems: DropItems, down: Fall);
}
}
/// <summary>
/// вызывает попаут на таргете. LocaleText - текст. Желательно использоваль локаль, а так же есть параметры для локали target и user
/// </summary>
[Serializable, NetSerializable]
public sealed partial class ComboPopupEffect : IComboEffect
{
Expand All @@ -139,6 +144,9 @@ public void DoEffect(EntityUid user, EntityUid target, IEntityManager entMan)
popup.PopupEntity(Loc.GetString(LocaleText, ("user", Identity.Entity(user, entMan)), ("target", target)), target, PopupType.LargeCaution);
}
}
/// <summary>
/// выбрасывает что угодно из активной руки таргета
/// </summary>
[Serializable, NetSerializable]
public sealed partial class ComboDropFromHandsEffect : IComboEffect
{
Expand All @@ -150,6 +158,9 @@ public void DoEffect(EntityUid user, EntityUid target, IEntityManager entMan)
hands.DoDrop(target, hand.ActiveHand);
}
}
/// <summary>
/// играет любой звук после комбо. Sound - звук, что очевидно
/// </summary>
[Serializable, NetSerializable]
public sealed partial class ComboAudioEffect : IComboEffect
{
Expand Down
77 changes: 29 additions & 48 deletions Content.Shared/ADT/Crawling/Systems/SharedCrawlingSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,13 @@
using Content.Shared.Movement.Systems;
using Content.Shared.Alert;
using Content.Shared.Climbing.Components;
using Content.Shared.Popups;
using Robust.Shared.Physics.Systems;
using Content.Shared.ADT.Grab;
using Content.Shared.Climbing.Systems;
using Content.Shared.CombatMode;
using System.Numerics;
using Content.Shared.ADT.Grab;
using Content.Shared.Database;
using Content.Shared.IdentityManagement;
using Content.Shared.Movement.Pulling.Components;
using Content.Shared.Movement.Pulling.Systems;
using Content.Shared.Popups;
using Content.Shared.Speech;
using Content.Shared.Tag;
using Content.Shared.Throwing;
using Robust.Shared.Audio;
using Robust.Shared.Map;
using Robust.Shared.Physics.Components;
using System.Collections.Generic;
using System.Numerics;
using Robust.Shared.GameObjects;
using Robust.Shared.Map;
using Robust.Shared.Map.Components;
using Robust.Shared.Maths;
using Robust.Shared.Timing;
using Robust.Shared.Utility;
using Content.Shared.Gravity;
using Content.Shared.Coordinates;

namespace Content.Shared.ADT.Crawling;
Expand All @@ -48,7 +29,7 @@ public abstract class SharedCrawlingSystem : EntitySystem
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
[Dependency] private readonly EntityLookupSystem _lookup = default!;
[Dependency] private readonly BonkSystem _bonk = default!;
[Dependency] private readonly SharedTransformSystem _transform = default!;
[Dependency] private readonly SharedGravitySystem _gravity = default!;
[Dependency] private readonly ThrowingSystem _throwing = default!;
public override void Initialize()
{
Expand Down Expand Up @@ -86,6 +67,33 @@ private void ToggleCrawling(EntityUid uid, CrawlerComponent component, CrawlingK
{
case false:
_standing.Down(uid, dropHeldItems: false);
if (!TryComp<CombatModeComponent>(uid, out var combatMode) ||
combatMode.IsInCombatMode)
{
var targetTile = Vector2.Zero;

if (TryComp<PhysicsComponent>(uid, out var physics) && !_gravity.IsWeightless(uid))
{
var velocity = physics.LinearVelocity;

if (velocity.LengthSquared() > 0)
{
var direction = velocity.Normalized();

var currentPosition = uid.ToCoordinates();

var targetTileX = currentPosition.X + direction.X * 1;
var targetTileY = currentPosition.Y + direction.Y * 1;

int tileX = (int)MathF.Round(targetTileX);
int tileY = (int)MathF.Round(targetTileY);

targetTile = new Vector2(tileX, tileY);
}
}
EnsureComp<GrabThrownComponent>(uid);
_throwing.TryThrow(uid, targetTile, 8, animated: false, playSound: false, doSpin: false);
}
break;
case true:
_doAfter.TryStartDoAfter(new DoAfterArgs(EntityManager, uid, component.StandUpTime, new CrawlStandupDoAfterEvent(),
Expand Down Expand Up @@ -125,33 +133,6 @@ private void OnFall(EntityUid uid, CrawlerComponent component, DownAttemptEvent
return;
_alerts.ShowAlert(uid, component.CrawlingAlert);

if (!TryComp<CombatModeComponent>(uid, out var combatMode) ||
combatMode.IsInCombatMode)
{
var targetTile = Vector2.Zero;

if (TryComp<PhysicsComponent>(uid, out var physics))
{
var velocity = physics.LinearVelocity;

if (velocity.LengthSquared() > 0)
{
var direction = velocity.Normalized();

var currentPosition = uid.ToCoordinates();

var targetTileX = currentPosition.X + direction.X * 1;
var targetTileY = currentPosition.Y + direction.Y * 1;

int tileX = (int)MathF.Round(targetTileX);
int tileY = (int)MathF.Round(targetTileY);

targetTile = new Vector2(tileX, tileY);
}
}
EnsureComp<GrabThrownComponent>(uid);
_throwing.TryThrow(uid, targetTile, 8, animated: false, playSound: false, doSpin: false);
}

EnsureComp<CrawlingComponent>(uid);
}
Expand Down
11 changes: 11 additions & 0 deletions Resources/Changelog/1ChangelogADT.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5745,3 +5745,14 @@ Entries:
время!', type: Add}
time: '2025-02-18T19:32:20Z'
id: 726
- author: Шрёдька
changes:
- {message: 'Подтянуты коммиты с Визардов, 10.02.2025.', type: Add}
time: '2025-02-19T05:54:11Z'
id: 727
- author: RaMbUt878
changes:
- {message: Теперь Синдикат убрал ошибку на производстве и вернул фирменному
трость-ружью его дополнительные 2 патрона., type: Fix}
time: '2025-02-20T14:27:09Z'
id: 728
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@
- !type:ComboPopupEffect
localeText: combo-backhit-end
- !type:ComboStunEffect
stunTime: 6
stunTime: 4
dropItems: false
- actionsNeeds:
- Hit
Expand Down Expand Up @@ -206,7 +206,7 @@
types:
Blunt: 5
- !type:ComboStunEffect
stunTime: 6
stunTime: 4
dropItems: false
- actionsNeeds:
- Disarm
Expand Down
5 changes: 2 additions & 3 deletions Resources/Prototypes/ADT/Recipes/Lathes/Packs/robotics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
- type: latheRecipePack
id: ADTModsuitPack
recipes:
- ADTModsuitHelmet #ADT modsuits start
- ADTModsuitHelmet
- ADTModsuitGauntlets
- ADTModsuitChestplate
- ADTModsuitBoots
Expand All @@ -21,10 +21,9 @@
- ADTModsuitPlateCience
- ADTModsuitPlateMining
- ADTModsuitAssembly
- ADTModsuitModDrill
- ADTModsuitModAntigrav
- ADTModsuitModApparatus
- ADTModsuitModDrill
- ADTModsuitModJetpack
- ADTModsuitModJetpack
- ADTModsuitModMagboot
- ADTModsuitModNightVision
Expand Down
4 changes: 3 additions & 1 deletion Resources/Prototypes/ADT/Research/industrial.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
recipeUnlocks:
- ADTModsuitPlateMining
- ADTModsuitPlateEngineering
- ADTModsuitPlateCosmohonk
- ADTModsuitPlateAtmospheric
technologyPrerequisites:
- ADTModsuitBase
Expand All @@ -59,6 +60,7 @@
- ADTModsuitModStorage
- ADTModsuitModMagboot
- ADTModsuitModJetpack
- ADTModsuitModNightVision
- ADTModsuitModDrill
technologyPrerequisites:
- ADTIndustrialMODsuit
- ADTIndustrialMODsuit
2 changes: 1 addition & 1 deletion Resources/Prototypes/Recipes/Lathes/Packs/science.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
- type: latheRecipePack
id: PowerCells
recipes:
- PowerCellMicroreactor
# - PowerCellMicroreactor ADT tweak
- PowerCellHigh

- type: latheRecipePack
Expand Down
3 changes: 3 additions & 0 deletions Resources/Prototypes/Recipes/Lathes/Packs/service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,6 @@
- ReagentGrinderIndustrialMachineCircuitboard
- JukeboxCircuitBoard
- DawInstrumentMachineCircuitboard
- CloningPodMachineCircuitboard #ADT tweak
- CloningConsoleComputerCircuitboard #ADT tweak
- MedicalScannerMachineCircuitboard #ADT tweak
1 change: 0 additions & 1 deletion Resources/Prototypes/Research/industrial.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@
- OreBagOfHolding
- MiningDrillDiamond
- AdvancedMineralScannerEmpty
- SalvageExpeditionsComputerCircuitboard # Corvax-Cringe

# Tier 3

Expand Down
3 changes: 0 additions & 3 deletions Resources/Prototypes/Roles/Jobs/Civilian/chef.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,3 @@
id: ChefPDA
ears: ClothingHeadsetService
belt: ClothingBeltChefFilled
storage: #ADT tweak
back:
- ADTCqcManualWeak

0 comments on commit 9017c4e

Please sign in to comment.