Magic and gamerule tweaks (#363)

* - tweak: Wiz hardsuit tweaks.

* - tweak: Gamemode tweaks.

* - add: Mindswap spell.

* - add: Transfer wizard component on mindswap.

* - add: Wizard is blight immune.
This commit is contained in:
Aviu00
2024-06-18 14:55:21 +00:00
committed by GitHub
parent 99629a2ba3
commit f25ad286b9
23 changed files with 238 additions and 37 deletions

View File

@@ -23,6 +23,7 @@ using Robust.Shared.Prototypes;
using System.Linq;
using Content.Server.Objectives;
using Content.Server.Station.Components;
using Content.Server.StationEvents.Components;
using Content.Shared.Mind;
using Content.Shared.NPC.Components;
using Content.Shared.Objectives.Components;
@@ -62,7 +63,6 @@ public sealed class WizardRuleSystem : GameRuleSystem<WizardRuleComponent>
SubscribeLocalEvent<RoundStartAttemptEvent>(OnStartAttempt);
SubscribeLocalEvent<RulePlayerSpawningEvent>(OnPlayersSpawning);
SubscribeLocalEvent<GameRunLevelChangedEvent>(OnRunLevelChanged);
SubscribeLocalEvent<WizardComponent, ComponentRemove>(OnComponentRemove);
SubscribeLocalEvent<WizardComponent, MobStateChangedEvent>(OnMobStateChanged);
SubscribeLocalEvent<WizardComponent, GhostRoleSpawnerUsedEvent>(OnPlayersGhostSpawning);
SubscribeLocalEvent<WizardComponent, MindAddedMessage>(OnMindAdded);
@@ -123,11 +123,6 @@ public sealed class WizardRuleSystem : GameRuleSystem<WizardRuleComponent>
SpawnWizardGhostRole(uid, component);
}
private void OnComponentRemove(EntityUid uid, WizardComponent component, ComponentRemove args)
{
CheckAnnouncement();
}
private void OnMobStateChanged(EntityUid uid, WizardComponent component, MobStateChangedEvent ev)
{
if (ev.NewMobState == MobState.Dead)
@@ -249,6 +244,10 @@ public sealed class WizardRuleSystem : GameRuleSystem<WizardRuleComponent>
private void CheckAnnouncement()
{
// Check for all at once gamemode
if (GameTicker.GetActiveGameRules().Where(HasComp<RampingStationEventSchedulerComponent>).Any())
return;
var query = QueryActiveRules();
while (query.MoveNext(out _, out _, out var wizard, out _))
{