Refactor actions to be entities with components (#19900)
This commit is contained in:
@@ -11,7 +11,6 @@ using Content.Server.RoundEnd;
|
||||
using Content.Server.Station.Components;
|
||||
using Content.Server.Station.Systems;
|
||||
using Content.Server.Zombies;
|
||||
using Content.Shared.Actions.ActionTypes;
|
||||
using Content.Shared.CCVar;
|
||||
using Content.Shared.Humanoid;
|
||||
using Content.Shared.Mind;
|
||||
@@ -195,9 +194,7 @@ public sealed class ZombieRuleSystem : GameRuleSystem<ZombieRuleComponent>
|
||||
private void OnZombifySelf(EntityUid uid, ZombifyOnDeathComponent component, ZombifySelfActionEvent args)
|
||||
{
|
||||
_zombie.ZombifyEntity(uid);
|
||||
|
||||
var action = new InstantAction(_prototypeManager.Index<InstantActionPrototype>(ZombieRuleComponent.ZombifySelfActionPrototype));
|
||||
_action.RemoveAction(uid, action);
|
||||
_action.RemoveAction(uid, ZombieRuleComponent.ZombifySelfActionPrototype);
|
||||
}
|
||||
|
||||
private float GetInfectedFraction(bool includeOffStation = true, bool includeDead = false)
|
||||
@@ -325,7 +322,7 @@ public sealed class ZombieRuleSystem : GameRuleSystem<ZombieRuleComponent>
|
||||
EnsureComp<ZombifyOnDeathComponent>(ownedEntity);
|
||||
EnsureComp<IncurableZombieComponent>(ownedEntity);
|
||||
var inCharacterName = MetaData(ownedEntity).EntityName;
|
||||
var action = new InstantAction(_prototypeManager.Index<InstantActionPrototype>(ZombieRuleComponent.ZombifySelfActionPrototype));
|
||||
var action = Spawn(ZombieRuleComponent.ZombifySelfActionPrototype);
|
||||
_action.AddAction(mind.OwnedEntity.Value, action, null);
|
||||
|
||||
var message = Loc.GetString("zombie-patientzero-role-greeting");
|
||||
|
||||
Reference in New Issue
Block a user