diff --git a/Content.Server/Execution/ExecutionSystem.cs b/Content.Server/Execution/ExecutionSystem.cs index a22682f558b..25491127b1d 100644 --- a/Content.Server/Execution/ExecutionSystem.cs +++ b/Content.Server/Execution/ExecutionSystem.cs @@ -12,7 +12,6 @@ using Content.Shared.Popups; using Content.Shared.Projectiles; using Content.Shared.Verbs; -using Content.Shared.Weapons.Melee; using Content.Shared.Weapons.Ranged; using Content.Shared.Weapons.Ranged.Components; using Content.Shared.Weapons.Ranged.Events; @@ -41,7 +40,6 @@ public sealed class ExecutionSystem : EntitySystem [Dependency] private readonly SharedAudioSystem _audioSystem = default!; [Dependency] private readonly GunSystem _gunSystem = default!; - private const float MeleeExecutionTimeModifier = 5.0f; private const float GunExecutionTime = 6.0f; private const float DamageModifier = 9.0f; @@ -50,42 +48,11 @@ public override void Initialize() { base.Initialize(); - SubscribeLocalEvent>(OnGetInteractionVerbsMelee); SubscribeLocalEvent>(OnGetInteractionVerbsGun); - SubscribeLocalEvent(OnDoafterMelee); SubscribeLocalEvent(OnDoafterGun); } - private void OnGetInteractionVerbsMelee( - EntityUid uid, - SharpComponent component, - GetVerbsEvent args) - { - if (args.Hands == null || args.Using == null || !args.CanAccess || !args.CanInteract) - return; - - var attacker = args.User; - var weapon = args.Using!.Value; - var victim = args.Target; - - if (!CanExecuteWithMelee(weapon, victim, attacker)) - return; - - UtilityVerb verb = new() - { - Act = () => - { - TryStartMeleeExecutionDoafter(weapon, victim, attacker); - }, - Impact = LogImpact.High, - Text = Loc.GetString("execution-verb-name"), - Message = Loc.GetString("execution-verb-message"), - }; - - args.Verbs.Add(verb); - } - private void OnGetInteractionVerbsGun( EntityUid uid, GunComponent component, @@ -144,17 +111,6 @@ private bool CanExecuteWithAny(EntityUid weapon, EntityUid victim, EntityUid att return true; } - private bool CanExecuteWithMelee(EntityUid weapon, EntityUid victim, EntityUid user) - { - if (!CanExecuteWithAny(weapon, victim, user)) return false; - - // We must be able to actually hurt people with the weapon - if (!TryComp(weapon, out var melee) && melee!.Damage.GetTotal() > 0.0f) - return false; - - return true; - } - private bool CanExecuteWithGun(EntityUid weapon, EntityUid victim, EntityUid user) { if (!CanExecuteWithAny(weapon, victim, user)) return false; @@ -166,35 +122,6 @@ private bool CanExecuteWithGun(EntityUid weapon, EntityUid victim, EntityUid use return true; } - private void TryStartMeleeExecutionDoafter(EntityUid weapon, EntityUid victim, EntityUid attacker) - { - if (!CanExecuteWithMelee(weapon, victim, attacker)) - return; - - var executionTime = (1.0f / Comp(weapon).AttackRate) * MeleeExecutionTimeModifier; - - if (attacker == victim) - { - ShowExecutionPopup("suicide-popup-melee-initial-internal", Filter.Entities(attacker), PopupType.Medium, attacker, victim, weapon); - ShowExecutionPopup("suicide-popup-melee-initial-external", Filter.PvsExcept(attacker), PopupType.MediumCaution, attacker, victim, weapon); - } - else - { - ShowExecutionPopup("execution-popup-melee-initial-internal", Filter.Entities(attacker), PopupType.Medium, attacker, victim, weapon); - ShowExecutionPopup("execution-popup-melee-initial-external", Filter.PvsExcept(attacker), PopupType.MediumCaution, attacker, victim, weapon); - } - - var doAfter = - new DoAfterArgs(EntityManager, attacker, executionTime, new ExecutionDoAfterEvent(), weapon, target: victim, used: weapon) - { - BreakOnMove = true, - BreakOnDamage = true, - NeedHand = true - }; - - _doAfterSystem.TryStartDoAfter(doAfter); - } - private void TryStartGunExecutionDoafter(EntityUid weapon, EntityUid victim, EntityUid attacker) { if (!CanExecuteWithGun(weapon, victim, attacker)) @@ -234,35 +161,6 @@ private bool OnDoafterChecks(EntityUid uid, DoAfterEvent args) return true; } - private void OnDoafterMelee(EntityUid uid, SharpComponent component, DoAfterEvent args) - { - if (args.Handled || args.Cancelled || args.Used == null || args.Target == null) - return; - - var attacker = args.User; - var victim = args.Target!.Value; - var weapon = args.Used!.Value; - - if (!CanExecuteWithMelee(weapon, victim, attacker)) return; - - if (!TryComp(weapon, out var melee) && melee!.Damage.GetTotal() > 0.0f) - return; - - _damageableSystem.TryChangeDamage(victim, melee.Damage * DamageModifier, true); - _audioSystem.PlayEntity(melee.HitSound, Filter.Pvs(weapon), weapon, true, AudioParams.Default); - - if (attacker == victim) - { - ShowExecutionPopup("suicide-popup-melee-complete-internal", Filter.Entities(attacker), PopupType.Medium, attacker, victim, weapon); - ShowExecutionPopup("suicide-popup-melee-complete-external", Filter.PvsExcept(attacker), PopupType.MediumCaution, attacker, victim, weapon); - } - else - { - ShowExecutionPopup("execution-popup-melee-complete-internal", Filter.Entities(attacker), PopupType.Medium, attacker, victim, weapon); - ShowExecutionPopup("execution-popup-melee-complete-external", Filter.PvsExcept(attacker), PopupType.MediumCaution, attacker, victim, weapon); - } - } - // TODO: This repeats a lot of the code of the serverside GunSystem, make it not do that private void OnDoafterGun(EntityUid uid, GunComponent component, DoAfterEvent args) { diff --git a/Content.Shared/Execution/SharedExecutionSystem.cs b/Content.Shared/Execution/SharedExecutionSystem.cs index a1105dd644b..eb9cee1d4ba 100644 --- a/Content.Shared/Execution/SharedExecutionSystem.cs +++ b/Content.Shared/Execution/SharedExecutionSystem.cs @@ -118,6 +118,10 @@ public bool CanBeExecuted(EntityUid victim, EntityUid attacker) if (victim != attacker && _actionBlocker.CanInteract(victim, null)) return false; + // DeltaV: no suicide + if (victim == attacker) + return false; + // All checks passed return true; } diff --git a/Resources/Prototypes/DeltaV/Catalog/Fills/Lockers/cargo.yml b/Resources/Prototypes/DeltaV/Catalog/Fills/Lockers/cargo.yml index 424a9b78201..62f45b5aaf4 100644 --- a/Resources/Prototypes/DeltaV/Catalog/Fills/Lockers/cargo.yml +++ b/Resources/Prototypes/DeltaV/Catalog/Fills/Lockers/cargo.yml @@ -1,10 +1,10 @@ # Added to LockerFillSalvageSpecialist with a nested selector - type: entityTable id: LockerFillSalvageSpecialistDeltaV - table: !AllSelector + table: !type:AllSelector children: - id: SeismicCharge - amount: 2 + - id: SeismicCharge - id: OreBag - id: ClothingShoesBootsWinterMiner - id: JetpackMiniFilled # replaces fire extinguisher