Magic redesign (#594)

* water spell textures

* water creation spell

* mana consume, and mana glove

* remove mana transfer ring

* Update migration.yml

* copy Wizden loadout PR

* add sprite component to all spells

* spell dummy loadouts

* delete spell traits

* really give spells from loadouts

* update crates fill and demiplane spawners

* beer creation spell, fix passivedamage

* Update PassiveDamageSystem.cs
This commit is contained in:
Ed
2024-11-20 00:23:44 +03:00
committed by GitHub
parent ec278dc98f
commit e79b046c4a
50 changed files with 742 additions and 197 deletions

View File

@@ -11,10 +11,14 @@ public sealed class PassiveDamageSystem : EntitySystem
[Dependency] private readonly DamageableSystem _damageable = default!;
[Dependency] private readonly IGameTiming _timing = default!;
private EntityQuery<MobStateComponent> _mobStateQuery; //CP14
public override void Initialize()
{
base.Initialize();
_mobStateQuery = GetEntityQuery<MobStateComponent>(); //CP14
SubscribeLocalEvent<PassiveDamageComponent, MapInitEvent>(OnPendingMapInit);
}
@@ -30,8 +34,8 @@ public sealed class PassiveDamageSystem : EntitySystem
var curTime = _timing.CurTime;
// Go through every entity with the component
var query = EntityQueryEnumerator<PassiveDamageComponent, DamageableComponent, MobStateComponent>();
while (query.MoveNext(out var uid, out var comp, out var damage, out var mobState))
var query = EntityQueryEnumerator<PassiveDamageComponent, DamageableComponent /*, MobStateComponent*/>();
while (query.MoveNext(out var uid, out var comp, out var damage /*, out var mobState*/))
{
// Make sure they're up for a damage tick
if (comp.NextDamage > curTime)
@@ -43,12 +47,27 @@ public sealed class PassiveDamageSystem : EntitySystem
// Set the next time they can take damage
comp.NextDamage = curTime + TimeSpan.FromSeconds(1f);
// Damage them
foreach (var allowedState in comp.AllowedStates)
//CP14 logic replacement
//
//// Damage them
//foreach (var allowedState in comp.AllowedStates)
//{
// if(allowedState == mobState.CurrentState)
// _damageable.TryChangeDamage(uid, comp.Damage, true, false, damage);
//}
if (comp.AllowedStates.Count > 0 && _mobStateQuery.TryComp(uid, out var mobState))
{
if(allowedState == mobState.CurrentState)
_damageable.TryChangeDamage(uid, comp.Damage, true, false, damage);
foreach (var allowedState in comp.AllowedStates)
{
if(allowedState == mobState.CurrentState)
_damageable.TryChangeDamage(uid, comp.Damage, true, false, damage);
}
}
else
{
_damageable.TryChangeDamage(uid, comp.Damage, true, false, damage);
}
//CP14 logic replacement end
}
}
}