* - add: Flash protection for wiz hardsuit helmet.

* - tweak: Cheaper wiz melee weapons.

* - add: Rework alt lightning.

* - fix: Timestop fixes.

* - add: Don't end round on midround wizard death.

* - tweak: Better shield.

* - fix: Some fixes.

* - fix: Fix wizard teleport pulling.

* - add: Improve arc.

* - add: Update knock.

* - add: Update knock desc.

* - add: Arcane Barrage.
This commit is contained in:
Aviu00
2024-06-22 12:55:50 +00:00
committed by GitHub
parent 5137493c4c
commit dccd8aab1a
41 changed files with 394 additions and 52 deletions

View File

@@ -0,0 +1,20 @@
namespace Content.Server._White.Wizard.GravPulseOnStartup;
[RegisterComponent]
public sealed partial class GravPulseOnStartupComponent : Component
{
[DataField]
public float MaxRange;
[DataField]
public float MinRange;
[DataField]
public float BaseRadialAcceleration;
[DataField]
public float BaseTangentialAcceleration;
[DataField]
public float StunTime;
}

View File

@@ -0,0 +1,22 @@
using Content.Server.Singularity.EntitySystems;
namespace Content.Server._White.Wizard.GravPulseOnStartup;
public sealed class GravPulseOnStartupSystem : EntitySystem
{
[Dependency] private readonly GravityWellSystem _gravityWell = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<GravPulseOnStartupComponent, ComponentStartup>(OnStartup);
}
private void OnStartup(Entity<GravPulseOnStartupComponent> ent, ref ComponentStartup args)
{
var (uid, comp) = ent;
_gravityWell.GravPulse(Transform(uid).Coordinates, comp.MaxRange, comp.MinRange, comp.BaseRadialAcceleration,
comp.BaseTangentialAcceleration, comp.StunTime);
}
}

View File

@@ -1,4 +1,8 @@
namespace Content.Server._White.Wizard.Magic.TeslaProjectile;
[RegisterComponent]
public sealed partial class TeslaProjectileComponent : Component {}
public sealed partial class TeslaProjectileComponent : Component
{
[ViewVariables]
public EntityUid? Caster;
}

View File

@@ -16,6 +16,6 @@ public sealed class TeslaProjectileSystem : EntitySystem
private void OnStartCollide(Entity<TeslaProjectileComponent> ent, ref ProjectileHitEvent args)
{
_lightning.ShootRandomLightnings(ent, 2, 4, arcDepth:2);
_lightning.ShootRandomLightnings(ent, 3, 4, "WizardLightning", 2, false, ent.Comp.Caster);
}
}

View File

@@ -4,6 +4,7 @@ using Content.Server._White.Cult;
using Content.Server._White.IncorporealSystem;
using Content.Server._White.Wizard.Magic.Amaterasu;
using Content.Server._White.Wizard.Magic.Other;
using Content.Server._White.Wizard.Magic.TeslaProjectile;
using Content.Server._White.Wizard.Teleport;
using Content.Server.Abilities.Mime;
using Content.Server.Administration.Commands;
@@ -86,6 +87,7 @@ public sealed class WizardSpellsSystem : EntitySystem
{
base.Initialize();
SubscribeLocalEvent<ArcaneBarrageSpellEvent>(OnArcaneBarrage);
SubscribeLocalEvent<StopTimeSpellEvent>(OnTimeStop);
SubscribeLocalEvent<MindswapSpellEvent>(OnMindswapSpell);
SubscribeLocalEvent<TeleportSpellEvent>(OnTeleportSpell);
@@ -105,6 +107,29 @@ public sealed class WizardSpellsSystem : EntitySystem
SubscribeLocalEvent<MagicComponent, BeforeCastSpellEvent>(OnBeforeCastSpell);
}
#region Arcane Barrage
private void OnArcaneBarrage(ArcaneBarrageSpellEvent msg)
{
if (!CanCast(msg))
return;
var uid = msg.Performer;
var entity = Spawn(msg.Prototype, Transform(uid).Coordinates);
if (!_handsSystem.TryPickupAnyHand(uid, entity))
{
_popupSystem.PopupEntity(Loc.GetString("arcane-barrage-no-empty-hand"), uid, uid);
QueueDel(entity);
_actions.SetCooldown(msg.Action, TimeSpan.FromSeconds(1));
return;
}
msg.Handled = true;
}
#endregion
#region Timestop
private void OnTimeStop(StopTimeSpellEvent msg)
@@ -803,6 +828,7 @@ public sealed class WizardSpellsSystem : EntitySystem
userVelocity = physics.LinearVelocity;
var ent = Spawn(msg.Prototype, spawnCoords);
EnsureComp<TeslaProjectileComponent>(ent).Caster = msg.Performer;
var direction = msg.Target.ToMapPos(EntityManager, _transformSystem) -
spawnCoords.ToMapPos(EntityManager, _transformSystem);
_gunSystem.ShootProjectile(ent, direction, userVelocity, msg.Performer, msg.Performer);

View File

@@ -2,6 +2,8 @@
using Content.Server.Popups;
using Content.Shared._White.Wizard.Teleport;
using Content.Shared.Eui;
using Content.Shared.Movement.Pulling.Components;
using Content.Shared.Movement.Pulling.Systems;
using Robust.Shared.Timing;
namespace Content.Server._White.Wizard.Teleport;
@@ -11,6 +13,7 @@ public sealed class WizardTeleportSpellEui : BaseEui
[Dependency] private readonly EntityManager _entityManager = default!;
private readonly SharedTransformSystem _transformSystem;
private readonly TeleportLocationSystem _teleportLocation;
private readonly PullingSystem _pulling;
private readonly PopupSystem _popupSystem;
private readonly EntityUid _performer;
@@ -22,6 +25,7 @@ public sealed class WizardTeleportSpellEui : BaseEui
IoCManager.InjectDependencies(this);
_transformSystem = _entityManager.System<SharedTransformSystem>();
_pulling = _entityManager.System<PullingSystem>();
_teleportLocation = _entityManager.System<TeleportLocationSystem>();
_popupSystem = _entityManager.System<PopupSystem>();
@@ -82,6 +86,19 @@ public sealed class WizardTeleportSpellEui : BaseEui
_used = true;
// break pulls before portal enter so we dont break shit
if (_entityManager.TryGetComponent<PullableComponent>(_performer, out var pullable) && pullable.BeingPulled)
{
_pulling.TryStopPull(_performer, pullable);
}
if (_entityManager.TryGetComponent<PullerComponent>(_performer, out var pulling)
&& pulling.Pulling != null
&& _entityManager.TryGetComponent<PullableComponent>(pulling.Pulling.Value, out var subjectPulling))
{
_pulling.TryStopPull(pulling.Pulling.Value, subjectPulling);
}
var coords = locationTransform.Coordinates;
_transformSystem.SetCoordinates(_performer, coords);

View File

@@ -4,4 +4,6 @@ namespace Content.Server._White.Wizard;
[RegisterComponent]
public sealed partial class WizardComponent : Component
{
[ViewVariables(VVAccess.ReadWrite)]
public bool EndRoundOnDeath;
}

View File

@@ -125,7 +125,7 @@ public sealed class WizardRuleSystem : GameRuleSystem<WizardRuleComponent>
private void OnMobStateChanged(EntityUid uid, WizardComponent component, MobStateChangedEvent ev)
{
if (ev.NewMobState == MobState.Dead)
if (ev.NewMobState == MobState.Dead && component.EndRoundOnDeath)
CheckAnnouncement();
}
@@ -149,7 +149,7 @@ public sealed class WizardRuleSystem : GameRuleSystem<WizardRuleComponent>
return;
}
SetupWizardEntity(uid, wizardSpawner.Points, gear, profile);
SetupWizardEntity(uid, gear, profile, false);
}
private void OnMindAdded(EntityUid uid, WizardComponent component, MindAddedMessage args)
@@ -280,11 +280,11 @@ public sealed class WizardRuleSystem : GameRuleSystem<WizardRuleComponent>
private void SetupWizardEntity(
EntityUid mob,
int points,
StartingGearPrototype gear,
HumanoidCharacterProfile? profile)
HumanoidCharacterProfile? profile,
bool endRoundOnDeath)
{
EnsureComp<WizardComponent>(mob);
EnsureComp<WizardComponent>(mob).EndRoundOnDeath = endRoundOnDeath;
profile ??= HumanoidCharacterProfile.RandomWithSpecies();
@@ -346,7 +346,7 @@ public sealed class WizardRuleSystem : GameRuleSystem<WizardRuleComponent>
return;
}
SetupWizardEntity(mob, component.Points, gear, profile);
SetupWizardEntity(mob, gear, profile, true);
var newMind = _mind.CreateMind(session.UserId, name);
_mind.SetUserId(newMind, session.UserId);

View File

@@ -10,9 +10,6 @@ public sealed partial class WizardSpawnerComponent : Component
[DataField("name")]
public string Name = "Ololo The Balls' Twister";
[DataField("points")]
public int Points = 10;
[DataField("startingGear")]
public ProtoId<StartingGearPrototype> StartingGear = "WizardGear";