Melee Executions (#30104)
* melee executions * fix damage bug * cleanup * address reviews hopefully * resistance bypass mechanic * component changes * self executions (not finished yet) * self execs part two * ok i fixed things (still not finished) * finish everything * review stuff * nuke if (kind = special) * more review stuffs * Make suicide system much less hardcoded and make much more use of events * Fix a dumb bug I introduced * self execution popups * Integration tests * Why did they even take 0.5 blunt damage? * More consistent integration tests * Destructive equals true * Allow it to dirty-dispose * IS THIS WHAT YOU WANT? * FRESH AND CLEAN * modifier to multiplier * don't jinx the integration tests * no file-scoped namespace * Move the rest of execution to shared, create SuicideGhostEvent * handled * Get rid of unused code and add a comment * ghost before suicide * stop cat suicides * popup fix + small suicide change * make it a bit better --------- Co-authored-by: Plykiya <58439124+Plykiya@users.noreply.github.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using Content.Server.Chemistry.Containers.EntitySystems;
|
||||
using Content.Server.Chemistry.Containers.EntitySystems;
|
||||
using Content.Server.Fluids.EntitySystems;
|
||||
using Content.Server.GameTicking;
|
||||
using Content.Server.Popups;
|
||||
@@ -48,7 +48,7 @@ public sealed class MaterialReclaimerSystem : SharedMaterialReclaimerSystem
|
||||
SubscribeLocalEvent<MaterialReclaimerComponent, PowerChangedEvent>(OnPowerChanged);
|
||||
SubscribeLocalEvent<MaterialReclaimerComponent, InteractUsingEvent>(OnInteractUsing,
|
||||
before: new []{typeof(WiresSystem), typeof(SolutionTransferSystem)});
|
||||
SubscribeLocalEvent<MaterialReclaimerComponent, SuicideEvent>(OnSuicide);
|
||||
SubscribeLocalEvent<MaterialReclaimerComponent, SuicideByEnvironmentEvent>(OnSuicideByEnvironment);
|
||||
SubscribeLocalEvent<ActiveMaterialReclaimerComponent, PowerChangedEvent>(OnActivePowerChanged);
|
||||
}
|
||||
private void OnStartup(Entity<MaterialReclaimerComponent> entity, ref ComponentStartup args)
|
||||
@@ -86,12 +86,11 @@ public sealed class MaterialReclaimerSystem : SharedMaterialReclaimerSystem
|
||||
args.Handled = TryStartProcessItem(entity.Owner, args.Used, entity.Comp, args.User);
|
||||
}
|
||||
|
||||
private void OnSuicide(Entity<MaterialReclaimerComponent> entity, ref SuicideEvent args)
|
||||
private void OnSuicideByEnvironment(Entity<MaterialReclaimerComponent> entity, ref SuicideByEnvironmentEvent args)
|
||||
{
|
||||
if (args.Handled)
|
||||
return;
|
||||
|
||||
args.SetHandled(SuicideKind.Bloodloss);
|
||||
var victim = args.Victim;
|
||||
if (TryComp(victim, out ActorComponent? actor) &&
|
||||
_mind.TryGetMind(actor.PlayerSession, out var mindId, out var mind))
|
||||
@@ -103,12 +102,15 @@ public sealed class MaterialReclaimerSystem : SharedMaterialReclaimerSystem
|
||||
}
|
||||
}
|
||||
|
||||
_popup.PopupEntity(Loc.GetString("recycler-component-suicide-message-others", ("victim", Identity.Entity(victim, EntityManager))),
|
||||
_popup.PopupEntity(Loc.GetString("recycler-component-suicide-message-others",
|
||||
("victim", Identity.Entity(victim, EntityManager))),
|
||||
victim,
|
||||
Filter.PvsExcept(victim, entityManager: EntityManager), true);
|
||||
Filter.PvsExcept(victim, entityManager: EntityManager),
|
||||
true);
|
||||
|
||||
_body.GibBody(victim, true);
|
||||
_appearance.SetData(entity.Owner, RecyclerVisuals.Bloody, true);
|
||||
args.Handled = true;
|
||||
}
|
||||
|
||||
private void OnActivePowerChanged(Entity<ActiveMaterialReclaimerComponent> entity, ref PowerChangedEvent args)
|
||||
|
||||
Reference in New Issue
Block a user