Add "Mana Wasting" trait (#732)
* add trait * Update Resources/Locale/ru-RU/_CP14/magicEnergy/magic-spells.ftl * fix magic item using --------- Co-authored-by: MetalSage <metalsage.official@gmail.com> Co-authored-by: Ed <96445749+TheShuEd@users.noreply.github.com> Co-authored-by: Ed <edwardxperia2000@gmail.com>
This commit is contained in:
@@ -60,10 +60,9 @@ public sealed partial class CP14MagicSystem : CP14SharedMagicSystem
|
||||
|
||||
if (magicStorage.Energy > 0)
|
||||
{
|
||||
//TODO: FIX THIS SHIT
|
||||
var cashedEnergy = magicStorage.Energy;
|
||||
_magicEnergy.TryConsumeEnergy(magicEffect.SpellStorage.Value, requiredMana, magicStorage, false);
|
||||
requiredMana = MathF.Max(0, (float)(requiredMana - cashedEnergy));
|
||||
if (_magicEnergy.TryConsumeEnergy(magicEffect.SpellStorage.Value, requiredMana, magicStorage, false))
|
||||
requiredMana = MathF.Max(0, (float)(requiredMana - cashedEnergy));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
using Robust.Shared.GameStates;
|
||||
|
||||
namespace Content.Shared._CP14.MagicAttuning;
|
||||
|
||||
/// <summary>
|
||||
/// A mind that can focus on objects
|
||||
/// </summary>
|
||||
[RegisterComponent, Access(typeof(CP14SharedMagicAttuningSystem))]
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
[Access(typeof(CP14SharedMagicAttuningSystem))]
|
||||
public sealed partial class CP14MagicAttuningMindComponent : Component
|
||||
{
|
||||
[DataField]
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
using Content.Shared.Alert;
|
||||
using Content.Shared.FixedPoint;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.GameStates;
|
||||
|
||||
namespace Content.Shared._CP14.MagicEnergy.Components;
|
||||
|
||||
/// <summary>
|
||||
/// Allows an item to store magical energy within itself.
|
||||
/// </summary>
|
||||
[RegisterComponent, Access(typeof(SharedCP14MagicEnergySystem))]
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
[Access(typeof(SharedCP14MagicEnergySystem))]
|
||||
public sealed partial class CP14MagicEnergyContainerComponent : Component
|
||||
{
|
||||
[DataField]
|
||||
|
||||
@@ -26,24 +26,29 @@ public abstract partial class CP14SharedMagicSystem
|
||||
/// </summary>
|
||||
private void OnManaCheck(Entity<CP14MagicEffectManaCostComponent> ent, ref CP14CastMagicEffectAttemptEvent args)
|
||||
{
|
||||
//Total man required
|
||||
var requiredMana = CalculateManacost(ent, args.Performer);
|
||||
|
||||
if (!_magicEffectQuery.TryComp(ent, out var magicEffect))
|
||||
return;
|
||||
|
||||
if (magicEffect.SpellStorage is not null)
|
||||
//First - trying get mana from item
|
||||
if (_magicEffectQuery.TryComp(ent, out var magicEffect))
|
||||
{
|
||||
if (_magicContainerQuery.TryComp(magicEffect.SpellStorage, out var magicContainer)) // We have item that provides this spell
|
||||
if (magicEffect.SpellStorage is not null && _magicContainerQuery.TryComp(magicEffect.SpellStorage, out var magicContainer))
|
||||
requiredMana = MathF.Max(0, (float)(requiredMana - magicContainer.Energy));
|
||||
}
|
||||
|
||||
if (requiredMana > 0 && _magicContainerQuery.TryComp(args.Performer, out var playerMana))
|
||||
if (requiredMana <= 0)
|
||||
return;
|
||||
|
||||
//Second - trying get mana from performer
|
||||
if (!_magicContainerQuery.TryComp(args.Performer, out var playerMana))
|
||||
{
|
||||
if (!_magicEnergy.HasEnergy(args.Performer, requiredMana, playerMana, true) && _net.IsServer)
|
||||
{
|
||||
_popup.PopupEntity(Loc.GetString("cp14-magic-spell-not-enough-mana-cast-warning-"+_random.Next(5)), args.Performer, args.Performer, PopupType.SmallCaution);
|
||||
}
|
||||
args.PushReason(Loc.GetString("cp14-magic-spell-no-mana-component"));
|
||||
args.Cancel();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!_magicEnergy.HasEnergy(args.Performer, requiredMana, playerMana, true) && _net.IsServer)
|
||||
_popup.PopupEntity(Loc.GetString($"cp14-magic-spell-not-enough-mana-cast-warning-{_random.Next(5)}"), args.Performer, args.Performer, PopupType.SmallCaution);
|
||||
}
|
||||
|
||||
private void OnStaminaCheck(Entity<CP14MagicEffectStaminaCostComponent> ent, ref CP14CastMagicEffectAttemptEvent args)
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
using Content.Shared.Damage;
|
||||
using Content.Shared.FixedPoint;
|
||||
using Robust.Shared.GameStates;
|
||||
|
||||
namespace Content.Shared._CP14.MagicWeakness;
|
||||
|
||||
/// <summary>
|
||||
/// imposes damage on excessive use of magic
|
||||
/// </summary>
|
||||
[RegisterComponent, Access(typeof(CP14MagicWeaknessSystem))]
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
[Access(typeof(CP14MagicWeaknessSystem))]
|
||||
public sealed partial class CP14MagicUnsafeDamageComponent : Component
|
||||
{
|
||||
[DataField]
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
using Content.Shared.FixedPoint;
|
||||
using Robust.Shared.GameStates;
|
||||
|
||||
namespace Content.Shared._CP14.MagicWeakness;
|
||||
|
||||
/// <summary>
|
||||
/// imposes debuffs on excessive use of magic
|
||||
/// </summary>
|
||||
[RegisterComponent, Access(typeof(CP14MagicWeaknessSystem))]
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
[Access(typeof(CP14MagicWeaknessSystem))]
|
||||
public sealed partial class CP14MagicUnsafeSleepComponent : Component
|
||||
{
|
||||
[DataField]
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
cp14-magic-spell-not-enough-mana = Not enough mana!
|
||||
|
||||
cp14-magic-spell-no-mana-component = You're not using magical energy.
|
||||
|
||||
cp14-magic-spell-not-enough-mana-cast-warning-0 = Everything inside you starts to whine unpleasantly...
|
||||
cp14-magic-spell-not-enough-mana-cast-warning-1 = Your head starts to buzz...
|
||||
cp14-magic-spell-not-enough-mana-cast-warning-2 = Your hands are shaking...
|
||||
|
||||
@@ -20,10 +20,13 @@ cp14-trait-muted-desc = All you can do is mumble incoherently. The benefits of v
|
||||
cp14-trait-snoring-name = Loud snoring
|
||||
cp14-trait-snoring-desc = It is simply impossible to sleep next to you because you snore terribly loudly at everything.
|
||||
|
||||
cp14-trait-mana-wasting-name = Magical mediocrity.
|
||||
cp14-trait-mana-wasting-desc = Fate has decreed that magic is just an empty sound for you. You are unable to store or use magical energy.
|
||||
|
||||
# Backgrounds
|
||||
|
||||
cp14-trait-bg-entertainer-name = Entertainer
|
||||
cp14-trait-bg-entertainer-desc = You have to thrive in front of an audience. You know the way how to entertain them, entrance them and also even how to inspire them. Your poetics able to stir the hearts like those who awakening grief or joy, anger or laughter. Their spirits can be raised by your music and also it captures their sorrow. Actually, your dance steps are captivate and also your humor will cuts to the quick. Finally, your art is your life whatever the techniques you use.
|
||||
|
||||
cp14-trait-bg-soldier-name = Soldier
|
||||
cp14-trait-bg-soldier-desc = War has been your life for as long as you care to remember. You trained as a youth, studied the use of weapons and armor, learned basic survival techniques, including how to stay alive on the battlefield. You might have been part of a standing national army or a mercenary company, or perhaps a member of a local militia who rose to prominence during a recent war.
|
||||
cp14-trait-bg-soldier-desc = War has been your life for as long as you care to remember. You trained as a youth, studied the use of weapons and armor, learned basic survival techniques, including how to stay alive on the battlefield. You might have been part of a standing national army or a mercenary company, or perhaps a member of a local militia who rose to prominence during a recent war.
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
cp14-magic-spell-not-enough-mana = Недостаточно магической энергии!
|
||||
|
||||
cp14-magic-spell-no-mana-component = Вы не можете пользоваться магией.
|
||||
|
||||
cp14-magic-spell-not-enough-mana-cast-warning-0 = Внутри вас все начинает неприятно ныть...
|
||||
cp14-magic-spell-not-enough-mana-cast-warning-1 = Голова начинает шуметь...
|
||||
cp14-magic-spell-not-enough-mana-cast-warning-2 = Ваши руки дрожат...
|
||||
|
||||
@@ -20,10 +20,13 @@ cp14-trait-muted-desc = Все что вы можете - бессвязно м
|
||||
cp14-trait-snoring-name = Громкий храп
|
||||
cp14-trait-snoring-desc = Спать рядом с вами просто невозможно, потому что во все вы жутко громко храпите.
|
||||
|
||||
cp14-trait-mana-wasting-name = Магическая бездарность
|
||||
cp14-trait-mana-wasting-desc = Судьба распорядилась так, что магия для вас - лишь пустой звук. Вы не способны ни накапливать, ни использовать магическую энергию.
|
||||
|
||||
# Backgrounds
|
||||
|
||||
cp14-trait-bg-entertainer-name = Артист
|
||||
cp14-trait-bg-entertainer-desc = Вам нравится выступать на публике. Вы знаете, как их развлечь, очаровать и даже воодушевить. Ваша поэзия может трогать сердца слушателей, пробуждать в них горе или радость, смех или гнев. Ваша музыка ободряет их или заставляет скорбеть. Ваши танцы захватывают, а шутки всегда смешны. Чем бы вы ни занимались, ваша жизнь тесно связана с искусством.
|
||||
|
||||
cp14-trait-bg-soldier-name = Солдат
|
||||
cp14-trait-bg-soldier-desc = Сколько вы помните, в вашей жизни всегда была война. С молодости вы проходили тренировки, учились использовать оружие и доспехи, изучали технику выживания, включая то, как оставаться живым на поле боя. Вы могли быть частью армии страны или отряда наёмников, а может, были местным ополченцем во время войны.
|
||||
cp14-trait-bg-soldier-desc = Сколько вы помните, в вашей жизни всегда была война. С молодости вы проходили тренировки, учились использовать оружие и доспехи, изучали технику выживания, включая то, как оставаться живым на поле боя. Вы могли быть частью армии страны или отряда наёмников, а может, были местным ополченцем во время войны.
|
||||
|
||||
@@ -440,29 +440,67 @@
|
||||
- CP14ActionSpellBeerCreation
|
||||
- CP14ActionSpellSprint
|
||||
|
||||
- type: loadout
|
||||
id: CP14ActionSpellBase
|
||||
effects:
|
||||
- !type:JobRequirementLoadoutEffect
|
||||
requirement:
|
||||
!type:TraitsRequirement
|
||||
inverted: true
|
||||
traits:
|
||||
- CP14ManaWasting
|
||||
|
||||
- type: loadout
|
||||
id: CP14ActionSpellFlameCreation
|
||||
dummyEntity: CP14ActionSpellFlameCreation
|
||||
actions:
|
||||
- CP14ActionSpellFlameCreation
|
||||
effects:
|
||||
- !type:JobRequirementLoadoutEffect
|
||||
requirement:
|
||||
!type:TraitsRequirement
|
||||
inverted: true
|
||||
traits:
|
||||
- CP14ManaWasting
|
||||
|
||||
- type: loadout
|
||||
id: CP14ActionSpellCureWounds
|
||||
dummyEntity: CP14ActionSpellCureWounds
|
||||
actions:
|
||||
- CP14ActionSpellCureWounds
|
||||
effects:
|
||||
- !type:JobRequirementLoadoutEffect
|
||||
requirement:
|
||||
!type:TraitsRequirement
|
||||
inverted: true
|
||||
traits:
|
||||
- CP14ManaWasting
|
||||
|
||||
- type: loadout
|
||||
id: CP14ActionSpellCureBurn
|
||||
dummyEntity: CP14ActionSpellCureBurn
|
||||
actions:
|
||||
- CP14ActionSpellCureBurn
|
||||
effects:
|
||||
- !type:JobRequirementLoadoutEffect
|
||||
requirement:
|
||||
!type:TraitsRequirement
|
||||
inverted: true
|
||||
traits:
|
||||
- CP14ManaWasting
|
||||
|
||||
- type: loadout
|
||||
id: CP14ActionSpellBloodPurification
|
||||
dummyEntity: CP14ActionSpellBloodPurification
|
||||
actions:
|
||||
- CP14ActionSpellBloodPurification
|
||||
effects:
|
||||
- !type:JobRequirementLoadoutEffect
|
||||
requirement:
|
||||
!type:TraitsRequirement
|
||||
inverted: true
|
||||
traits:
|
||||
- CP14ManaWasting
|
||||
|
||||
- type: loadout
|
||||
id: CP14ActionSpellPlantGrowth
|
||||
@@ -476,12 +514,25 @@
|
||||
species:
|
||||
- CP14Silva
|
||||
inverted: true # Silvas cannot take this spell, they have buffed version by default
|
||||
- !type:JobRequirementLoadoutEffect
|
||||
requirement:
|
||||
!type:TraitsRequirement
|
||||
inverted: true
|
||||
traits:
|
||||
- CP14ManaWasting
|
||||
|
||||
- type: loadout
|
||||
id: CP14ActionSpellSphereOfLight
|
||||
dummyEntity: CP14ActionSpellSphereOfLight
|
||||
actions:
|
||||
- CP14ActionSpellSphereOfLight
|
||||
effects:
|
||||
- !type:JobRequirementLoadoutEffect
|
||||
requirement:
|
||||
!type:TraitsRequirement
|
||||
inverted: true
|
||||
traits:
|
||||
- CP14ManaWasting
|
||||
|
||||
- type: loadout
|
||||
id: CP14ActionSpellManaConsume
|
||||
@@ -495,24 +546,51 @@
|
||||
species:
|
||||
- CP14Elf
|
||||
inverted: true # Elves cannot take this spell, they have buffed version by default
|
||||
- !type:JobRequirementLoadoutEffect
|
||||
requirement:
|
||||
!type:TraitsRequirement
|
||||
inverted: true
|
||||
traits:
|
||||
- CP14ManaWasting
|
||||
|
||||
- type: loadout
|
||||
id: CP14ActionSpellManaGift
|
||||
dummyEntity: CP14ActionSpellManaGift
|
||||
actions:
|
||||
- CP14ActionSpellManaGift
|
||||
effects:
|
||||
- !type:JobRequirementLoadoutEffect
|
||||
requirement:
|
||||
!type:TraitsRequirement
|
||||
inverted: true
|
||||
traits:
|
||||
- CP14ManaWasting
|
||||
|
||||
- type: loadout
|
||||
id: CP14ActionSpellShadowGrab
|
||||
dummyEntity: CP14ActionSpellShadowGrab
|
||||
actions:
|
||||
- CP14ActionSpellShadowGrab
|
||||
effects:
|
||||
- !type:JobRequirementLoadoutEffect
|
||||
requirement:
|
||||
!type:TraitsRequirement
|
||||
inverted: true
|
||||
traits:
|
||||
- CP14ManaWasting
|
||||
|
||||
- type: loadout
|
||||
id: CP14ActionSpellWaterCreation
|
||||
dummyEntity: CP14ActionSpellWaterCreation
|
||||
actions:
|
||||
- CP14ActionSpellWaterCreation
|
||||
effects:
|
||||
- !type:JobRequirementLoadoutEffect
|
||||
requirement:
|
||||
!type:TraitsRequirement
|
||||
inverted: true
|
||||
traits:
|
||||
- CP14ManaWasting
|
||||
|
||||
- type: loadout
|
||||
id: CP14ActionSpellBeerCreation
|
||||
@@ -530,6 +608,12 @@
|
||||
!type:RoleTimeRequirement
|
||||
role: CP14JobInnkeeper
|
||||
time: 7200 # 2 hour
|
||||
- !type:JobRequirementLoadoutEffect
|
||||
requirement:
|
||||
!type:TraitsRequirement
|
||||
inverted: true
|
||||
traits:
|
||||
- CP14ManaWasting
|
||||
|
||||
- type: loadout
|
||||
id: CP14ActionSpellSprint
|
||||
@@ -542,4 +626,4 @@
|
||||
!type:SpeciesRequirement
|
||||
species:
|
||||
- CP14Goblin
|
||||
inverted: true # Goblins cannot take this spell, they have buffed version by default
|
||||
inverted: true # Goblins cannot take this spell, they have buffed version by default
|
||||
|
||||
@@ -13,6 +13,24 @@
|
||||
components:
|
||||
- type: PermanentBlindness
|
||||
|
||||
- type: trait
|
||||
id: CP14ManaWasting
|
||||
name: cp14-trait-mana-wasting-name
|
||||
description: cp14-trait-mana-wasting-desc
|
||||
category: CP14PhysicalTraits
|
||||
cost: -2
|
||||
whitelist:
|
||||
components:
|
||||
- CP14MagicEnergyContainer
|
||||
components:
|
||||
- type: Accentless
|
||||
removes:
|
||||
- type: CP14MagicEnergyContainer
|
||||
- type: CP14MagicEnergyDraw
|
||||
- type: CP14MagicUnsafeDamage
|
||||
- type: CP14MagicUnsafeSleep
|
||||
- type: CP14MagicAttuningMind
|
||||
|
||||
# -1
|
||||
|
||||
- type: trait
|
||||
|
||||
Reference in New Issue
Block a user