Skip to content

Commit

Permalink
executions reenabled
Browse files Browse the repository at this point in the history
  • Loading branch information
vanx committed Nov 12, 2024
1 parent cd020a9 commit fac459c
Showing 1 changed file with 23 additions and 14 deletions.
37 changes: 23 additions & 14 deletions Content.Server/Execution/ExecutionSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public sealed class ExecutionSystem : EntitySystem

private const float MeleeExecutionTimeModifier = 5.0f;
private const float GunExecutionTime = 6.0f;
private const float DamageModifier = 9.0f;
private const float DamageModifier = 20.0f; // WD EDIT

/// <inheritdoc/>
public override void Initialize()
Expand Down Expand Up @@ -133,13 +133,19 @@ private bool CanExecuteWithAny(EntityUid weapon, EntityUid victim, EntityUid att
if (!_actionBlockerSystem.CanAttack(attacker, victim))
return false;

// WD EDIT START
/*
// The victim must be incapacitated to be executed
if (victim != attacker && _actionBlockerSystem.CanInteract(victim, null))
return false;
if (victim == attacker)
return false; // DeltaV - Fucking seriously?
*/
//WD EDIT END

// All checks passed
return true;
}
Expand Down Expand Up @@ -201,6 +207,22 @@ private void TryStartGunExecutionDoafter(EntityUid weapon, EntityUid victim, Ent
if (!CanExecuteWithGun(weapon, victim, attacker))
return;

// WD EDIT START

// Raise an event to see if any system can cancel the shot
var attemptEv = new AttemptShootEvent(attacker, null);
RaiseLocalEvent(weapon, ref attemptEv);

if (attemptEv.Cancelled)
{
if (attemptEv.Message != null)
{
_popupSystem.PopupEntity(attemptEv.Message, weapon, attacker);
return;
}
}
// WD EDIT END

if (attacker == victim)
{
ShowExecutionPopup("suicide-popup-gun-initial-internal", Filter.Entities(attacker), PopupType.Medium, attacker, victim, weapon);
Expand Down Expand Up @@ -292,19 +314,6 @@ private void OnDoafterGun(EntityUid uid, GunComponent component, DoAfterEvent ar
if (prevention.Cancelled)
return;

// Not sure what this is for but gunsystem uses it so ehhh
var attemptEv = new AttemptShootEvent(attacker, null);
RaiseLocalEvent(weapon, ref attemptEv);

if (attemptEv.Cancelled)
{
if (attemptEv.Message != null)
{
_popupSystem.PopupClient(attemptEv.Message, weapon, attacker);
return;
}
}

// Take some ammunition for the shot (one bullet)
var fromCoordinates = Transform(attacker).Coordinates;
var ev = new TakeAmmoEvent(1, new List<(EntityUid? Entity, IShootable Shootable)>(), fromCoordinates, attacker);
Expand Down

0 comments on commit fac459c

Please sign in to comment.