Elf mana spell rework + magic damage popups (#802)
* fix #793 * safe elf mana. Fix #728
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using Content.Shared._CP14.MagicEnergy;
|
||||
using Content.Shared.Bed.Sleep;
|
||||
using Content.Shared.Damage;
|
||||
using Content.Shared.IdentityManagement;
|
||||
using Content.Shared.Popups;
|
||||
using Content.Shared.StatusEffect;
|
||||
|
||||
@@ -26,11 +27,15 @@ public partial class CP14MagicWeaknessSystem : EntitySystem
|
||||
SubscribeLocalEvent<CP14MagicUnsafeSleepComponent, CP14MagicEnergyOverloadEvent>(OnMagicEnergyOverloadSleep);
|
||||
}
|
||||
|
||||
private void OnMagicEnergyBurnOutSleep(Entity<CP14MagicUnsafeSleepComponent> ent, ref CP14MagicEnergyBurnOutEvent args)
|
||||
private void OnMagicEnergyBurnOutSleep(Entity<CP14MagicUnsafeSleepComponent> ent,
|
||||
ref CP14MagicEnergyBurnOutEvent args)
|
||||
{
|
||||
if (args.BurnOutEnergy > ent.Comp.SleepThreshold)
|
||||
{
|
||||
_popup.PopupEntity(Loc.GetString("cp14-magic-energy-damage-burn-out-fall"), ent, ent, PopupType.LargeCaution);
|
||||
_popup.PopupEntity(Loc.GetString("cp14-magic-energy-damage-burn-out-fall"),
|
||||
ent,
|
||||
ent,
|
||||
PopupType.LargeCaution);
|
||||
_statusEffects.TryAddStatusEffect<ForcedSleepingComponent>(ent,
|
||||
StatusEffectKey,
|
||||
TimeSpan.FromSeconds(ent.Comp.SleepPerEnergy * (float)args.BurnOutEnergy),
|
||||
@@ -38,11 +43,15 @@ public partial class CP14MagicWeaknessSystem : EntitySystem
|
||||
}
|
||||
}
|
||||
|
||||
private void OnMagicEnergyOverloadSleep(Entity<CP14MagicUnsafeSleepComponent> ent, ref CP14MagicEnergyOverloadEvent args)
|
||||
private void OnMagicEnergyOverloadSleep(Entity<CP14MagicUnsafeSleepComponent> ent,
|
||||
ref CP14MagicEnergyOverloadEvent args)
|
||||
{
|
||||
if (args.OverloadEnergy > ent.Comp.SleepThreshold)
|
||||
{
|
||||
_popup.PopupEntity(Loc.GetString("cp14-magic-energy-damage-burn-out-fall"), ent, ent, PopupType.LargeCaution);
|
||||
_popup.PopupEntity(Loc.GetString("cp14-magic-energy-damage-burn-out-fall"),
|
||||
ent,
|
||||
ent,
|
||||
PopupType.LargeCaution);
|
||||
_statusEffects.TryAddStatusEffect<ForcedSleepingComponent>(ent,
|
||||
StatusEffectKey,
|
||||
TimeSpan.FromSeconds(ent.Comp.SleepPerEnergy * (float)args.OverloadEnergy),
|
||||
@@ -50,15 +59,43 @@ public partial class CP14MagicWeaknessSystem : EntitySystem
|
||||
}
|
||||
}
|
||||
|
||||
private void OnMagicEnergyBurnOutDamage(Entity<CP14MagicUnsafeDamageComponent> ent, ref CP14MagicEnergyBurnOutEvent args)
|
||||
private void OnMagicEnergyBurnOutDamage(Entity<CP14MagicUnsafeDamageComponent> ent,
|
||||
ref CP14MagicEnergyBurnOutEvent args)
|
||||
{
|
||||
_popup.PopupEntity(Loc.GetString("cp14-magic-energy-damage-burn-out"), ent, ent, PopupType.LargeCaution);
|
||||
//TODO: Idk why this dont popup recipient
|
||||
//Others popup
|
||||
_popup.PopupPredicted(Loc.GetString("cp14-magic-energy-damage-burn-out"),
|
||||
Loc.GetString("cp14-magic-energy-damage-burn-out-other", ("name", Identity.Name(ent, EntityManager))),
|
||||
ent,
|
||||
ent);
|
||||
|
||||
//Local self popup
|
||||
_popup.PopupEntity(
|
||||
Loc.GetString("cp14-magic-energy-damage-burn-out"),
|
||||
ent,
|
||||
ent,
|
||||
PopupType.LargeCaution);
|
||||
|
||||
_damageable.TryChangeDamage(ent, ent.Comp.DamagePerEnergy * args.BurnOutEnergy, interruptsDoAfters: false);
|
||||
}
|
||||
|
||||
private void OnMagicEnergyOverloadDamage(Entity<CP14MagicUnsafeDamageComponent> ent, ref CP14MagicEnergyOverloadEvent args)
|
||||
private void OnMagicEnergyOverloadDamage(Entity<CP14MagicUnsafeDamageComponent> ent,
|
||||
ref CP14MagicEnergyOverloadEvent args)
|
||||
{
|
||||
_popup.PopupEntity(Loc.GetString("cp14-magic-energy-damage-overload"), ent, ent, PopupType.LargeCaution);
|
||||
//TODO: Idk why this dont popup recipient
|
||||
//Others popup
|
||||
_popup.PopupPredicted(Loc.GetString("cp14-magic-energy-damage-overload"),
|
||||
Loc.GetString("cp14-magic-energy-damage-overload-other", ("name", Identity.Name(ent, EntityManager))),
|
||||
ent,
|
||||
ent);
|
||||
|
||||
//Local self popup
|
||||
_popup.PopupEntity(
|
||||
Loc.GetString("cp14-magic-energy-damage-overload"),
|
||||
ent,
|
||||
ent,
|
||||
PopupType.LargeCaution);
|
||||
|
||||
_damageable.TryChangeDamage(ent, ent.Comp.DamagePerEnergy * args.OverloadEnergy, interruptsDoAfters: false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,4 +6,10 @@ cp14-magic-energy-no-crystal = No energy crystal!
|
||||
cp14-magic-energy-insufficient = Not enough energy!
|
||||
cp14-magic-energy-insufficient-unsafe = Crystal cracks from lack of energy!
|
||||
|
||||
cp14-magic-scanner = Polarity of ley lines: {$power}
|
||||
cp14-magic-energy-damage-burn-out = From the lack of mana, pain pierces your body!
|
||||
cp14-magic-energy-damage-burn-out-other = {$name} is destroying itself from lack of mana!
|
||||
|
||||
cp14-magic-energy-damage-overload = You can't hold that much mana!
|
||||
cp14-magic-energy-damage-overload-other = {$name} is destroying itself from excess mana!
|
||||
|
||||
cp14-magic-energy-damage-burn-out-fall = You pass out from the intense pain!
|
||||
@@ -8,10 +8,6 @@ cp14-magic-spell-not-enough-mana-cast-warning-2 = Your hands are shaking...
|
||||
cp14-magic-spell-not-enough-mana-cast-warning-3 = Your throat starts to lump...
|
||||
cp14-magic-spell-not-enough-mana-cast-warning-4 = Your head becomes heavy...
|
||||
|
||||
cp14-magic-energy-damage-burn-out = From the lack of mana, pain pierces your body!
|
||||
cp14-magic-energy-damage-overload = You can't hold that much mana!
|
||||
cp14-magic-energy-damage-burn-out-fall = You pass out from the intense pain!
|
||||
|
||||
cp14-magic-spell-need-verbal-component = You can't cast the spell out loud.
|
||||
cp14-magic-spell-need-somatic-component = You don't have your hands free.
|
||||
|
||||
|
||||
@@ -6,4 +6,10 @@ cp14-magic-energy-no-crystal = Отсутствует энергокристал
|
||||
cp14-magic-energy-insufficient = Не достаточно энергии!
|
||||
cp14-magic-energy-insufficient-unsafe = Кристалл трескается от нехватки энергии!
|
||||
|
||||
cp14-magic-scanner = Полярность лей-линий: {$power}
|
||||
cp14-magic-energy-damage-burn-out = От нехватки маны боль пронзает ваше тело!
|
||||
cp14-magic-energy-damage-burn-out-other = {$name} разрушается от недостатка маны!
|
||||
|
||||
cp14-magic-energy-damage-overload = Вы не можете удержать столько маны!
|
||||
cp14-magic-energy-damage-overload-other = {$name} разрушается от переизбытка маны!
|
||||
|
||||
cp14-magic-energy-damage-burn-out-fall = Вы теряете сознание от сильной боли!
|
||||
@@ -8,10 +8,6 @@ cp14-magic-spell-not-enough-mana-cast-warning-2 = Ваши руки дрожат
|
||||
cp14-magic-spell-not-enough-mana-cast-warning-3 = К горлу подступает ком...
|
||||
cp14-magic-spell-not-enough-mana-cast-warning-4 = Голова наливается свинцом...
|
||||
|
||||
cp14-magic-energy-damage-burn-out = От нехватки маны боль пронзает ваше тело!
|
||||
cp14-magic-energy-damage-overload = Вы не можете удержать столько маны!
|
||||
cp14-magic-energy-damage-burn-out-fall = Вы теряете сознание от сильной боли!
|
||||
|
||||
cp14-magic-spell-need-verbal-component = Вы не можете произнести заклинание вслух.
|
||||
cp14-magic-spell-need-somatic-component = Вам не хватает свободных рук.
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
id: CP14ActionSpellManaConsumeElf
|
||||
parent: CP14ActionSpellManaConsume
|
||||
name: Carefull mana consume
|
||||
description: You absorb a small amount of mana from the target neatly and without loss.
|
||||
description: You absorb mana at a tremendous rate without dealing damage to the mana holder.
|
||||
components:
|
||||
- type: CP14MagicEffect
|
||||
effects:
|
||||
@@ -49,7 +49,8 @@
|
||||
spawns:
|
||||
- CP14ImpactEffectManaConsume
|
||||
- !type:CP14SpellConsumeManaEffect
|
||||
mana: 10
|
||||
safe: true
|
||||
mana: 20
|
||||
lossMultiplier: 1
|
||||
|
||||
- type: entity
|
||||
|
||||
Reference in New Issue
Block a user