dragon antag refactor (#28217)

* remove dragon system usage of GenericAntag

* add AntagRandomSpawn for making antags spawn at a random tile

* add AntagSpawner to make an antag spawner just spawn an entity

* add antag prototype for dragon since it never had one

* make dragon spawner a GhostRoleAntagSpawner, remove GenericAntag

* make dragon rule use AntagSelection and stuff

* remove dragon GenericAntag rule

* add back to spawn menu

---------

Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
deltanedas
2024-05-31 15:08:26 +00:00
committed by GitHub
parent 6e278a12fb
commit 5da2151924
11 changed files with 110 additions and 45 deletions

View File

@@ -1,4 +1,3 @@
using Content.Server.GenericAntag;
using Content.Server.Objectives.Components;
using Content.Server.Objectives.Systems;
using Content.Server.Popups;
@@ -55,7 +54,6 @@ public sealed partial class DragonSystem : EntitySystem
SubscribeLocalEvent<DragonComponent, DragonSpawnRiftActionEvent>(OnSpawnRift);
SubscribeLocalEvent<DragonComponent, RefreshMovementSpeedModifiersEvent>(OnDragonMove);
SubscribeLocalEvent<DragonComponent, MobStateChangedEvent>(OnMobStateChanged);
SubscribeLocalEvent<DragonComponent, GenericAntagCreatedEvent>(OnCreated);
SubscribeLocalEvent<DragonComponent, EntityZombifiedEvent>(OnZombified);
}
@@ -192,18 +190,6 @@ public sealed partial class DragonSystem : EntitySystem
DeleteRifts(uid, false, component);
}
private void OnCreated(EntityUid uid, DragonComponent comp, ref GenericAntagCreatedEvent args)
{
var mindId = args.MindId;
var mind = args.Mind;
_role.MindAddRole(mindId, new DragonRoleComponent(), mind);
_role.MindAddRole(mindId, new RoleBriefingComponent()
{
Briefing = Loc.GetString("dragon-role-briefing")
}, mind);
}
private void OnZombified(Entity<DragonComponent> ent, ref EntityZombifiedEvent args)
{
// prevent carp attacking zombie dragon