Move faction exception and everything it needs to shared (#25154)

* move faction prototype to shared

* move faction exception and member stuff to shared

* fix breaking changes for random stuff

* move pettable friend stuff to shared

* mostly fix

* final fixy

* dragonops

* final fixy II

* use querys and fix warpspeed fish (probably)

* fixer

* Rrrr!

---------

Co-authored-by: deltanedas <@deltanedas:kde.org>
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
deltanedas
2024-03-18 07:23:25 +00:00
committed by GitHub
parent 0493130591
commit 7561bef6a7
29 changed files with 448 additions and 407 deletions

View File

@@ -10,6 +10,8 @@ using Content.Shared.Mind;
using Content.Shared.Mind.Components;
using Content.Shared.Mobs;
using Content.Shared.Movement.Systems;
using Content.Shared.NPC.Systems;
using Content.Shared.Zombies;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.GameStates;
@@ -24,6 +26,7 @@ public sealed partial class DragonSystem : EntitySystem
[Dependency] private readonly IMapManager _mapManager = default!;
[Dependency] private readonly ITileDefinitionManager _tileDef = default!;
[Dependency] private readonly MovementSpeedModifierSystem _movement = default!;
[Dependency] private readonly NpcFactionSystem _faction = default!;
[Dependency] private readonly PopupSystem _popup = default!;
[Dependency] private readonly RoleSystem _role = default!;
[Dependency] private readonly SharedActionsSystem _actions = default!;
@@ -55,6 +58,7 @@ public sealed partial class DragonSystem : EntitySystem
SubscribeLocalEvent<DragonComponent, RefreshMovementSpeedModifiersEvent>(OnDragonMove);
SubscribeLocalEvent<DragonComponent, MobStateChangedEvent>(OnMobStateChanged);
SubscribeLocalEvent<DragonComponent, GenericAntagCreatedEvent>(OnCreated);
SubscribeLocalEvent<DragonComponent, EntityZombifiedEvent>(OnZombified);
}
public override void Update(float frameTime)
@@ -202,6 +206,12 @@ public sealed partial class DragonSystem : EntitySystem
}, mind);
}
private void OnZombified(Entity<DragonComponent> ent, ref EntityZombifiedEvent args)
{
// prevent carp attacking zombie dragon
_faction.AddFaction(ent.Owner, ent.Comp.Faction);
}
private void Roar(EntityUid uid, DragonComponent comp)
{
if (comp.SoundRoar != null)