* rod form spell

* blind spell

* mutate spell
This commit is contained in:
RinKeeper
2024-08-09 22:10:42 +03:00
committed by GitHub
parent 06f3d92a6f
commit 3acbcaf41e
17 changed files with 354 additions and 0 deletions

View File

@@ -17,6 +17,7 @@ using Content.Server.EUI;
using Content.Server.Lightning;
using Content.Server.Magic;
using Content.Server.Mind;
using Content.Server.Polymorph.Systems;
using Content.Server.Singularity.EntitySystems;
using Content.Server.Standing;
using Content.Server.Weapons.Ranged.Systems;
@@ -33,6 +34,7 @@ using Content.Shared.Cluwne;
using Content.Shared.Coordinates.Helpers;
using Content.Shared.Damage;
using Content.Shared.Damage.Prototypes;
using Content.Shared.Eye.Blinding.Components;
using Content.Shared.Hands.Components;
using Content.Shared.Hands.EntitySystems;
using Content.Shared.Humanoid;
@@ -44,7 +46,10 @@ using Content.Shared.Magic;
using Content.Shared.Maps;
using Content.Shared.Mobs;
using Content.Shared.Mobs.Components;
using Content.Shared.Mobs.Systems;
using Content.Shared.Movement.Components;
using Content.Shared.Physics;
using Content.Shared.Polymorph;
using Content.Shared.Popups;
using Content.Shared.Revolutionary.Components;
using Content.Shared.StatusEffect;
@@ -90,6 +95,8 @@ public sealed class WizardSpellsSystem : EntitySystem
[Dependency] private readonly ActionContainerSystem _actionContainer = default!;
[Dependency] private readonly ChargingSystem _charging = default!;
[Dependency] private readonly SharedStunSystem _stun = default!;
[Dependency] private readonly PolymorphSystem _polymorph = default!;
[Dependency] private readonly MobStateSystem _mobState = default!;
#endregion
@@ -113,6 +120,9 @@ public sealed class WizardSpellsSystem : EntitySystem
SubscribeLocalEvent<FireballSpellEvent>(OnFireballSpell);
SubscribeLocalEvent<ForceSpellEvent>(OnForceSpell);
SubscribeLocalEvent<ArcSpellEvent>(OnArcSpell);
SubscribeLocalEvent<RodFormSpellEvent>(OnRodFormSpell);
SubscribeLocalEvent<BlindSpellEvent>(OnBlindSpell);
SubscribeAllEvent<MutateSpellEvent>(OnMutateSpell);
SubscribeLocalEvent<MagicComponent, BeforeCastSpellEvent>(OnBeforeCastSpell);
}
@@ -838,6 +848,86 @@ public sealed class WizardSpellsSystem : EntitySystem
#endregion
#region Rod Form
private void OnRodFormSpell(RodFormSpellEvent msg)
{
if (!CanCast(msg))
return;
var config = new PolymorphConfiguration
{
Entity = "ImmovableRodWizard",
Duration = 2,
Forced = true,
TransferDamage = true
};
var rod = _polymorph.PolymorphEntity(msg.Performer, config);
var angle = _transformSystem.GetWorldRotation(msg.Performer).ToWorldVec();
if (rod.HasValue)
{
RemComp<InputMoverComponent>(rod.Value);
_throwingSystem.TryThrow(rod.Value, angle, 20, msg.Performer);
}
Cast(msg);
}
#endregion
#region Blind
private void OnBlindSpell(BlindSpellEvent msg)
{
if (!CanCast(msg))
return;
foreach (var e in _lookup.GetEntitiesInRange(msg.Performer, 8))
{
var wizardQuery = GetEntityQuery<WizardComponent>();
var humanoidQuery = GetEntityQuery<HumanoidAppearanceComponent>();
if (!humanoidQuery.HasComponent(e) || !_mobState.IsAlive(e) ||
wizardQuery.HasComponent(e))
continue;
_statusEffectsSystem.TryAddStatusEffect<TemporaryBlindnessComponent>(e, "TemporaryBlindness",
TimeSpan.FromSeconds(5), false);
_chat.TryEmoteWithChat(e, "Scream");
}
Cast(msg);
}
#endregion
#region Mutate
private void OnMutateSpell(MutateSpellEvent msg)
{
if (!CanCast(msg))
return;
var config = new PolymorphConfiguration
{
Entity = "MobHulk",
Duration = 30,
Forced = true,
TransferDamage = true
};
_polymorph.PolymorphEntity(msg.Performer, config);
Cast(msg);
}
#endregion
#region Helpers
private void TurnOffShield(EntityUid uid)