Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reenable Executions #126

Merged
merged 1 commit into from
Nov 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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

Vaaankas marked this conversation as resolved.
Show resolved Hide resolved
// 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
Loading