diff --git a/Content.Server/_CP14/MagicSpell/CP14MagicSystem.cs b/Content.Server/_CP14/MagicSpell/CP14MagicSystem.cs index ed0bbca67f..40629cb62a 100644 --- a/Content.Server/_CP14/MagicSpell/CP14MagicSystem.cs +++ b/Content.Server/_CP14/MagicSpell/CP14MagicSystem.cs @@ -27,22 +27,22 @@ public sealed partial class CP14MagicSystem : CP14SharedMagicSystem private void OnSlowdownCaster(Entity ent, ref CP14StartCastMagicEffectEvent args) { - if (!TryComp(args.Performer, out var caster)) + if (!TryComp(args.Caster, out var caster)) return; caster.SpeedModifiers.Add(ent.Comp.SpeedMultiplier); - _movement.RefreshMovementSpeedModifiers(args.Performer); + _movement.RefreshMovementSpeedModifiers(args.Caster); } private void OnUnslowdownCaster(Entity ent, ref CP14EndCastMagicEffectEvent args) { - if (!TryComp(args.Performer, out var caster)) + if (!TryComp(args.Caster, out var caster)) return; if (caster.SpeedModifiers.Contains(ent.Comp.SpeedMultiplier)) caster.SpeedModifiers.Remove(ent.Comp.SpeedMultiplier); - _movement.RefreshMovementSpeedModifiers(args.Performer); + _movement.RefreshMovementSpeedModifiers(args.Caster); } private void OnCasterRefreshMovespeed(Entity ent, ref RefreshMovementSpeedModifiersEvent args) @@ -64,8 +64,8 @@ public sealed partial class CP14MagicSystem : CP14SharedMagicSystem private void OnSpawnMagicVisualEffect(Entity ent, ref CP14StartCastMagicEffectEvent args) { - var vfx = SpawnAttachedTo(ent.Comp.Proto, Transform(args.Performer).Coordinates); - _transform.SetParent(vfx, args.Performer); + var vfx = SpawnAttachedTo(ent.Comp.Proto, Transform(args.Caster).Coordinates); + _transform.SetParent(vfx, args.Caster); ent.Comp.SpawnedEntity = vfx; } diff --git a/Content.Shared/Inventory/InventorySystem.Relay.cs b/Content.Shared/Inventory/InventorySystem.Relay.cs index 2a0b58208c..114e301c05 100644 --- a/Content.Shared/Inventory/InventorySystem.Relay.cs +++ b/Content.Shared/Inventory/InventorySystem.Relay.cs @@ -1,4 +1,5 @@ using Content.Shared._CP14.MagicEnergy; +using Content.Shared._CP14.MagicSpell.Events; using Content.Shared.Chemistry; using Content.Shared.Damage; using Content.Shared.Electrocution; @@ -24,6 +25,12 @@ public partial class InventorySystem { public void InitializeRelay() { + //CP14 Relayed events + SubscribeLocalEvent(RelayInventoryEvent); + SubscribeLocalEvent(RelayInventoryEvent); + + //CP14 End + SubscribeLocalEvent(RelayInventoryEvent); SubscribeLocalEvent(RelayInventoryEvent); SubscribeLocalEvent(RelayInventoryEvent); @@ -47,7 +54,6 @@ public partial class InventorySystem SubscribeLocalEvent(RelayInventoryEvent); SubscribeLocalEvent(RelayInventoryEvent); SubscribeLocalEvent(RelayInventoryEvent); - SubscribeLocalEvent(RelayInventoryEvent); //CP14 Magic scanning // ComponentActivatedClientSystems SubscribeLocalEvent>(RelayInventoryEvent); diff --git a/Content.Shared/_CP14/MagicClothing/CP14MagicClothingManacostModifyComponent.cs b/Content.Shared/_CP14/MagicClothing/CP14MagicClothingManacostModifyComponent.cs new file mode 100644 index 0000000000..1af9dc95fd --- /dev/null +++ b/Content.Shared/_CP14/MagicClothing/CP14MagicClothingManacostModifyComponent.cs @@ -0,0 +1,18 @@ +using Content.Shared._CP14.MagicRitual.Prototypes; +using Content.Shared.FixedPoint; +using Robust.Shared.Prototypes; + +namespace Content.Shared._CP14.MagicClothing; + +/// +/// Changes the manacost of spells for the bearer +/// +[RegisterComponent, Access(typeof(CP14MagicClothingSystem))] +public sealed partial class CP14MagicClothingManacostModifyComponent : Component +{ + [DataField] + public Dictionary, FixedPoint2> Modifiers = new(); + + [DataField] + public FixedPoint2 GlobalModifier = 1f; +} diff --git a/Content.Shared/_CP14/MagicClothing/CP14MagicClothingSystem.cs b/Content.Shared/_CP14/MagicClothing/CP14MagicClothingSystem.cs new file mode 100644 index 0000000000..d2e7b80a57 --- /dev/null +++ b/Content.Shared/_CP14/MagicClothing/CP14MagicClothingSystem.cs @@ -0,0 +1,77 @@ + +using Content.Shared._CP14.MagicRitual.Prototypes; +using Content.Shared._CP14.MagicSpell.Events; +using Content.Shared.Examine; +using Content.Shared.FixedPoint; +using Content.Shared.Inventory; +using Content.Shared.Verbs; +using Robust.Shared.Prototypes; +using Robust.Shared.Utility; + +namespace Content.Shared._CP14.MagicClothing; + +public sealed partial class CP14MagicClothingSystem : EntitySystem +{ + [Dependency] private readonly ExamineSystemShared _examine = default!; + [Dependency] private readonly IPrototypeManager _proto = default!; + public override void Initialize() + { + base.Initialize(); + + SubscribeLocalEvent>(OnCalculateManacost); + SubscribeLocalEvent>(OnVerbExamine); + } + + private void OnVerbExamine(Entity ent, ref GetVerbsEvent args) + { + if (!args.CanInteract || !args.CanAccess) + return; + + var markup = GetMagicClothingExamine(ent.Comp); + _examine.AddDetailedExamineVerb( + args, + ent.Comp, + markup, + Loc.GetString("armor-examinable-verb-text"), + "/Textures/Interface/VerbIcons/dot.svg.192dpi.png", + Loc.GetString("armor-examinable-verb-message")); + } + + private FormattedMessage GetMagicClothingExamine(CP14MagicClothingManacostModifyComponent comp) + { + var msg = new FormattedMessage(); + msg.AddMarkupOrThrow(Loc.GetString("cp14-clothing-magic-examine")); + + if (comp.GlobalModifier != 1) + { + msg.PushNewline(); + + var plus = (float)comp.GlobalModifier > 1 ? "+" : ""; + msg.AddMarkupOrThrow($"{Loc.GetString("cp14-clothing-magic-global")}: {plus}{((float)comp.GlobalModifier - 1)*100}%"); + } + + foreach (var modifier in comp.Modifiers) + { + if (modifier.Value == 1) + continue; + + msg.PushNewline(); + + var plus = modifier.Value > 1 ? "+" : ""; + var indexedType = _proto.Index(modifier.Key); + msg.AddMarkupOrThrow($"[color={indexedType.Color.ToHex()}]{Loc.GetString(indexedType.Name)}[/color]: {plus}{(modifier.Value - 1)*100}%"); + } + + return msg; + } + + private void OnCalculateManacost(Entity ent, ref InventoryRelayedEvent args) + { + args.Args.Multiplier += (float)ent.Comp.GlobalModifier; + + if (args.Args.MagicType is not null && ent.Comp.Modifiers.TryGetValue(args.Args.MagicType.Value, out var modifier)) + { + args.Args.Multiplier *= (float)modifier; + } + } +} diff --git a/Content.Shared/_CP14/MagicSpell/CP14SharedMagicSystem.cs b/Content.Shared/_CP14/MagicSpell/CP14SharedMagicSystem.cs index 77d8d0d674..bb56d5fc9c 100644 --- a/Content.Shared/_CP14/MagicSpell/CP14SharedMagicSystem.cs +++ b/Content.Shared/_CP14/MagicSpell/CP14SharedMagicSystem.cs @@ -1,3 +1,4 @@ +using System.Text; using Content.Shared._CP14.MagicEnergy; using Content.Shared._CP14.MagicEnergy.Components; using Content.Shared._CP14.MagicSpell.Components; @@ -8,6 +9,7 @@ using Content.Shared.Hands.Components; using Content.Shared.Popups; using Content.Shared.Speech.Muting; using Robust.Shared.Network; +using Robust.Shared.Prototypes; using Robust.Shared.Random; namespace Content.Shared._CP14.MagicSpell; @@ -22,11 +24,14 @@ public partial class CP14SharedMagicSystem : EntitySystem [Dependency] private readonly SharedCP14MagicEnergySystem _magicEnergy = default!; [Dependency] private readonly SharedPopupSystem _popup = default!; [Dependency] private readonly IRobustRandom _random = default!; + [Dependency] private readonly IPrototypeManager _proto = default!; + [Dependency] private readonly MetaDataSystem _meta = default!; public override void Initialize() { base.Initialize(); + SubscribeLocalEvent(OnMagicEffectInit); SubscribeLocalEvent(OnBeforeCastMagicEffect); SubscribeLocalEvent(OnInstantAction); @@ -43,22 +48,48 @@ public partial class CP14SharedMagicSystem : EntitySystem SubscribeLocalEvent(OnAfterCastMagicEffect); } + private void OnMagicEffectInit(Entity ent, ref MapInitEvent args) + { + + var meta = MetaData(ent); + var sb = new StringBuilder(); + + sb.Append(meta.EntityDescription); + sb.Append($"\n\n {Loc.GetString("cp14-magic-manacost")}: [color=#5da9e8]{ent.Comp.ManaCost}[/color]"); + + if (_proto.TryIndex(ent.Comp.MagicType, out var indexedMagic)) + { + sb.Append($"\n {Loc.GetString("cp14-magic-magic-type")}: [color={indexedMagic.Color.ToHex()}]{Loc.GetString(indexedMagic.Name)}[/color]"); + } + + _meta.SetEntityDescription(ent, sb.ToString()); + } + private void OnBeforeCastMagicEffect(Entity ent, ref CP14BeforeCastMagicEffectEvent args) { - if (!TryComp(args.Performer, out var magicContainer)) + if (!TryComp(args.Caster, out var magicContainer)) { args.Cancel(); return; } - if (!_magicEnergy.HasEnergy(args.Performer, ent.Comp.ManaCost, magicContainer, ent.Comp.Safe)) + var manaCost = ent.Comp.ManaCost; + + if (ent.Comp.CanModifyManacost) + { + var manaEv = new CP14CalculateManacostEvent(args.Caster, ent.Comp.ManaCost, ent.Comp.MagicType); + RaiseLocalEvent(args.Caster, manaEv); + manaCost = manaEv.GetManacost(); + } + + if (!_magicEnergy.HasEnergy(args.Caster, manaCost, magicContainer, ent.Comp.Safe)) { args.PushReason(Loc.GetString("cp14-magic-spell-not-enough-mana")); args.Cancel(); } - else if(!_magicEnergy.HasEnergy(args.Performer, ent.Comp.ManaCost, magicContainer, true) && _net.IsServer) + else if(!_magicEnergy.HasEnergy(args.Caster, manaCost, magicContainer, true) && _net.IsServer) { - _popup.PopupEntity(Loc.GetString("cp14-magic-spell-not-enough-mana-cast-warning-"+_random.Next(5)), args.Performer, args.Performer, PopupType.SmallCaution); + _popup.PopupEntity(Loc.GetString("cp14-magic-spell-not-enough-mana-cast-warning-"+_random.Next(5)), args.Caster, args.Caster, PopupType.SmallCaution); } } @@ -119,7 +150,7 @@ public partial class CP14SharedMagicSystem : EntitySystem BreakOnDamage = delayedEffect.BreakOnDamage, Hidden = delayedEffect.Hidden, BlockDuplicate = true, - DistanceThreshold = 100f, + DistanceThreshold = 100f }; _doAfter.TryStartDoAfter(doAfterEventArgs); @@ -137,7 +168,7 @@ public partial class CP14SharedMagicSystem : EntitySystem private void OnDelayedEntityWorldTargetDoAfter(Entity ent, ref CP14DelayedEntityWorldTargetActionDoAfterEvent args) { - var endEv = new CP14EndCastMagicEffectEvent{Performer = args.User}; + var endEv = new CP14EndCastMagicEffectEvent(args.User); RaiseLocalEvent(ent, ref endEv); if (args.Cancelled || !_net.IsServer) @@ -154,13 +185,13 @@ public partial class CP14SharedMagicSystem : EntitySystem effect.Effect(EntityManager, effectArgs); } - var ev = new CP14AfterCastMagicEffectEvent {Performer = args.User}; + var ev = new CP14AfterCastMagicEffectEvent(args.User); RaiseLocalEvent(ent, ref ev); } private void OnDelayedInstantActionDoAfter(Entity ent, ref CP14DelayedInstantActionDoAfterEvent args) { - var endEv = new CP14EndCastMagicEffectEvent{Performer = args.User}; + var endEv = new CP14EndCastMagicEffectEvent(args.User); RaiseLocalEvent(ent, ref endEv); if (args.Cancelled || !_net.IsServer) @@ -171,13 +202,13 @@ public partial class CP14SharedMagicSystem : EntitySystem effect.Effect(EntityManager, new CP14SpellEffectBaseArgs(args.User, args.User, Transform(args.User).Coordinates)); } - var ev = new CP14AfterCastMagicEffectEvent {Performer = args.User}; + var ev = new CP14AfterCastMagicEffectEvent(args.User); RaiseLocalEvent(ent, ref ev); } private void OnSomaticAspectBeforeCast(Entity ent, ref CP14BeforeCastMagicEffectEvent args) { - if (TryComp(args.Performer, out var hands) || hands is not null) + if (TryComp(args.Caster, out var hands) || hands is not null) { var freeHand = 0; foreach (var hand in hands.Hands) @@ -194,7 +225,7 @@ public partial class CP14SharedMagicSystem : EntitySystem private void OnVerbalAspectBeforeCast(Entity ent, ref CP14BeforeCastMagicEffectEvent args) { - if (HasComp(args.Performer)) + if (HasComp(args.Caster)) { args.PushReason(Loc.GetString("cp14-magic-spell-need-verbal-component")); args.Cancel(); @@ -205,7 +236,7 @@ public partial class CP14SharedMagicSystem : EntitySystem { var ev = new CP14VerbalAspectSpeechEvent { - Performer = args.Performer, + Performer = args.Caster, Speech = ent.Comp.StartSpeech, }; RaiseLocalEvent(ent, ref ev); @@ -220,7 +251,7 @@ public partial class CP14SharedMagicSystem : EntitySystem var ev = new CP14VerbalAspectSpeechEvent { - Performer = args.Performer, + Performer = args.Caster, Speech = ent.Comp.EndSpeech, }; RaiseLocalEvent(ent, ref ev); @@ -228,10 +259,7 @@ public partial class CP14SharedMagicSystem : EntitySystem private bool TryCastSpell(EntityUid spell, EntityUid performer) { - var ev = new CP14BeforeCastMagicEffectEvent - { - Performer = performer, - }; + var ev = new CP14BeforeCastMagicEffectEvent(performer); RaiseLocalEvent(spell, ref ev); if (ev.Reason != string.Empty && _net.IsServer) { @@ -240,10 +268,7 @@ public partial class CP14SharedMagicSystem : EntitySystem if (!ev.Cancelled) { - var evStart = new CP14StartCastMagicEffectEvent() - { - Performer = performer, - }; + var evStart = new CP14StartCastMagicEffectEvent(performer); RaiseLocalEvent(spell, ref evStart); } return !ev.Cancelled; @@ -254,9 +279,19 @@ public partial class CP14SharedMagicSystem : EntitySystem if (_net.IsClient) return; - if (!HasComp(args.Performer)) + if (!HasComp(args.Caster)) return; - _magicEnergy.TryConsumeEnergy(args.Performer.Value, ent.Comp.ManaCost, safe: ent.Comp.Safe); + + var manaCost = ent.Comp.ManaCost; + + if (ent.Comp.CanModifyManacost) + { + var manaEv = new CP14CalculateManacostEvent(args.Caster.Value, ent.Comp.ManaCost, ent.Comp.MagicType); + RaiseLocalEvent(args.Caster.Value, manaEv); + manaCost = manaEv.GetManacost(); + } + + _magicEnergy.TryConsumeEnergy(args.Caster.Value, manaCost, safe: ent.Comp.Safe); } } diff --git a/Content.Shared/_CP14/MagicSpell/Components/CP14MagicCasterSlowdownComponent.cs b/Content.Shared/_CP14/MagicSpell/Components/CP14MagicCasterSlowdownComponent.cs index 1368c0fb37..75679cdf7b 100644 --- a/Content.Shared/_CP14/MagicSpell/Components/CP14MagicCasterSlowdownComponent.cs +++ b/Content.Shared/_CP14/MagicSpell/Components/CP14MagicCasterSlowdownComponent.cs @@ -1,7 +1,7 @@ namespace Content.Shared._CP14.MagicSpell.Components; /// -/// imposes debuffs on excessive use of magic +/// apply slowdown effect from casting spells /// [RegisterComponent, Access(typeof(CP14SharedMagicSystem))] public sealed partial class CP14MagicCasterSlowdownComponent : Component diff --git a/Content.Shared/_CP14/MagicSpell/Components/CP14MagicEffectCastSlowdownComponent.cs b/Content.Shared/_CP14/MagicSpell/Components/CP14MagicEffectCastSlowdownComponent.cs index 1a1dee4a0c..61cdc2d0fc 100644 --- a/Content.Shared/_CP14/MagicSpell/Components/CP14MagicEffectCastSlowdownComponent.cs +++ b/Content.Shared/_CP14/MagicSpell/Components/CP14MagicEffectCastSlowdownComponent.cs @@ -1,6 +1,3 @@ -using Content.Shared._CP14.MagicSpell.Spells; -using Content.Shared.FixedPoint; - namespace Content.Shared._CP14.MagicSpell.Components; /// diff --git a/Content.Shared/_CP14/MagicSpell/Components/CP14MagicEffectComponent.cs b/Content.Shared/_CP14/MagicSpell/Components/CP14MagicEffectComponent.cs index 70ff6eccff..bfbd69b0b6 100644 --- a/Content.Shared/_CP14/MagicSpell/Components/CP14MagicEffectComponent.cs +++ b/Content.Shared/_CP14/MagicSpell/Components/CP14MagicEffectComponent.cs @@ -1,5 +1,7 @@ +using Content.Shared._CP14.MagicRitual.Prototypes; using Content.Shared._CP14.MagicSpell.Spells; using Content.Shared.FixedPoint; +using Robust.Shared.Prototypes; namespace Content.Shared._CP14.MagicSpell.Components; @@ -12,6 +14,15 @@ public sealed partial class CP14MagicEffectComponent : Component [DataField] public FixedPoint2 ManaCost = 0f; + [DataField] + public ProtoId? MagicType = null; + + /// + /// Can the cost of casting this magic effect be changed from clothing or other sources? + /// + [DataField] + public bool CanModifyManacost = true; + [DataField] public bool Safe = false; diff --git a/Content.Shared/_CP14/MagicSpell/Events/CP14CastMagicEffectEvent.cs b/Content.Shared/_CP14/MagicSpell/Events/CP14CastMagicEffectEvent.cs index edbba839c3..b0180fc9f7 100644 --- a/Content.Shared/_CP14/MagicSpell/Events/CP14CastMagicEffectEvent.cs +++ b/Content.Shared/_CP14/MagicSpell/Events/CP14CastMagicEffectEvent.cs @@ -1,3 +1,8 @@ +using Content.Shared._CP14.MagicRitual.Prototypes; +using Content.Shared.FixedPoint; +using Content.Shared.Inventory; +using Robust.Shared.Prototypes; + namespace Content.Shared._CP14.MagicSpell.Events; [ByRefEvent] @@ -6,10 +11,15 @@ public sealed class CP14BeforeCastMagicEffectEvent : CancellableEntityEventArgs /// /// The Performer of the event, to check if they meet the requirements. /// - public EntityUid Performer { get; init; } + public EntityUid Caster { get; init; } public string Reason = string.Empty; + public CP14BeforeCastMagicEffectEvent(EntityUid caster) + { + Caster = caster; + } + public void PushReason(string reason) { Reason += $"{reason}\n"; @@ -19,7 +29,12 @@ public sealed class CP14BeforeCastMagicEffectEvent : CancellableEntityEventArgs [ByRefEvent] public sealed class CP14AfterCastMagicEffectEvent : EntityEventArgs { - public EntityUid? Performer { get; init; } + public EntityUid? Caster { get; init; } + + public CP14AfterCastMagicEffectEvent(EntityUid caster) + { + Caster = caster; + } } /// /// is invoked if all conditions are met and the spell has begun to be cast @@ -27,7 +42,12 @@ public sealed class CP14AfterCastMagicEffectEvent : EntityEventArgs [ByRefEvent] public sealed class CP14StartCastMagicEffectEvent : EntityEventArgs { - public EntityUid Performer { get; init; } + public EntityUid Caster { get; init; } + + public CP14StartCastMagicEffectEvent(EntityUid caster) + { + Caster = caster; + } } /// @@ -36,7 +56,34 @@ public sealed class CP14StartCastMagicEffectEvent : EntityEventArgs [ByRefEvent] public sealed class CP14EndCastMagicEffectEvent : EntityEventArgs { - public EntityUid Performer { get; init; } + public EntityUid Caster { get; init; } + + public CP14EndCastMagicEffectEvent(EntityUid caster) + { + Caster = caster; + } } +public sealed class CP14CalculateManacostEvent : EntityEventArgs, IInventoryRelayEvent +{ + public FixedPoint2 Manacost = 0f; + + public float Multiplier = 1f; + public EntityUid Caster; + public ProtoId? MagicType; + + public CP14CalculateManacostEvent(EntityUid caster, FixedPoint2 initialManacost, ProtoId? magicType) + { + Caster = caster; + Manacost = initialManacost; + MagicType = magicType; + } + + public float GetManacost() + { + return (float)Manacost * Multiplier; + } + + public SlotFlags TargetSlots { get; } = SlotFlags.All; +} diff --git a/Content.Shared/_CP14/MagicWeakness/CP14MagicUnsafeSleepComponent.cs b/Content.Shared/_CP14/MagicWeakness/CP14MagicUnsafeSleepComponent.cs index 6ec14dae43..1b8b1a8c99 100644 --- a/Content.Shared/_CP14/MagicWeakness/CP14MagicUnsafeSleepComponent.cs +++ b/Content.Shared/_CP14/MagicWeakness/CP14MagicUnsafeSleepComponent.cs @@ -1,4 +1,3 @@ -using Content.Shared.Damage; using Content.Shared.FixedPoint; namespace Content.Shared._CP14.MagicWeakness; diff --git a/Resources/Locale/en-US/_CP14/magicTypes/magic-clothing.ftl b/Resources/Locale/en-US/_CP14/magicTypes/magic-clothing.ftl new file mode 100644 index 0000000000..ae2d7687b7 --- /dev/null +++ b/Resources/Locale/en-US/_CP14/magicTypes/magic-clothing.ftl @@ -0,0 +1,3 @@ +cp14-clothing-magic-examine = Changes the manacost of the following magic types: + +cp14-clothing-magic-global = All types \ No newline at end of file diff --git a/Resources/Locale/en-US/_CP14/magicTypes/magic.ftl b/Resources/Locale/en-US/_CP14/magicTypes/magic.ftl index a7b53e0b82..22a556b92d 100644 --- a/Resources/Locale/en-US/_CP14/magicTypes/magic.ftl +++ b/Resources/Locale/en-US/_CP14/magicTypes/magic.ftl @@ -1,2 +1,11 @@ -cp14-magic-type-creation = Creation -cp14-magic-type-destruction = Destruction \ No newline at end of file +cp14-magic-type-abjuration = Abjuration +cp14-magic-type-conjuration = Conjuration +cp14-magic-type-divination = Divination +cp14-magic-type-enchantment = Enchantment +cp14-magic-type-evocation = Evocation +cp14-magic-type-illusion = Illusion +cp14-magic-type-necromancy = Necromancy +cp14-magic-type-transmutation = Transmutation + +cp14-magic-manacost = Manacost +cp14-magic-magic-type = Magic type \ No newline at end of file diff --git a/Resources/Locale/ru-RU/_CP14/magicTypes/magic-clothing.ftl b/Resources/Locale/ru-RU/_CP14/magicTypes/magic-clothing.ftl new file mode 100644 index 0000000000..b23dfb6244 --- /dev/null +++ b/Resources/Locale/ru-RU/_CP14/magicTypes/magic-clothing.ftl @@ -0,0 +1,3 @@ +cp14-clothing-magic-examine = Изменяет количество затрачиваемой маны на использование заклинаний следующих направлений: + +cp14-clothing-magic-global = Всех направлений \ No newline at end of file diff --git a/Resources/Locale/ru-RU/_CP14/magicTypes/magic.ftl b/Resources/Locale/ru-RU/_CP14/magicTypes/magic.ftl index d6909852d2..5cd8146f36 100644 --- a/Resources/Locale/ru-RU/_CP14/magicTypes/magic.ftl +++ b/Resources/Locale/ru-RU/_CP14/magicTypes/magic.ftl @@ -1,2 +1,11 @@ -cp14-magic-type-creation = Созидание -cp14-magic-type-destruction = Разрушение \ No newline at end of file +cp14-magic-type-abjuration = Ограждение +cp14-magic-type-conjuration = Призыв +cp14-magic-type-divination = Прорицание +cp14-magic-type-enchantment = Очарование +cp14-magic-type-evocation = Воплощение +cp14-magic-type-illusion = Иллюзии +cp14-magic-type-necromancy = Некромантия +cp14-magic-type-transmutation = Трансмутация + +cp14-magic-manacost = Затраты маны +cp14-magic-magic-type = Тип магии \ No newline at end of file diff --git a/Resources/Prototypes/_CP14/Entities/Actions/Spells/cure_wounds.yml b/Resources/Prototypes/_CP14/Entities/Actions/Spells/cure_wounds.yml index dad568f99c..e7e776fe1f 100644 --- a/Resources/Prototypes/_CP14/Entities/Actions/Spells/cure_wounds.yml +++ b/Resources/Prototypes/_CP14/Entities/Actions/Spells/cure_wounds.yml @@ -6,6 +6,7 @@ - type: CP14MagicEffectCastSlowdown speedMultiplier: -0.5 - type: CP14MagicEffect + magicType: Evocation manaCost: 20 telegraphyEffects: - !type:CP14SpellSpawnEntityOnTarget diff --git a/Resources/Prototypes/_CP14/Entities/Actions/Spells/earth_wall.yml b/Resources/Prototypes/_CP14/Entities/Actions/Spells/earth_wall.yml index f4b23135d3..abfe0ae370 100644 --- a/Resources/Prototypes/_CP14/Entities/Actions/Spells/earth_wall.yml +++ b/Resources/Prototypes/_CP14/Entities/Actions/Spells/earth_wall.yml @@ -6,6 +6,7 @@ - type: CP14MagicEffectCastSlowdown speedMultiplier: -0.9 - type: CP14MagicEffect + magicType: Evocation manaCost: 15 telegraphyEffects: - !type:CP14SpellSpawnEntityOnTarget diff --git a/Resources/Prototypes/_CP14/Entities/Actions/Spells/fireball.yml b/Resources/Prototypes/_CP14/Entities/Actions/Spells/fireball.yml index 8c425e5a28..e3933d35f4 100644 --- a/Resources/Prototypes/_CP14/Entities/Actions/Spells/fireball.yml +++ b/Resources/Prototypes/_CP14/Entities/Actions/Spells/fireball.yml @@ -6,6 +6,7 @@ - type: CP14MagicEffectCastSlowdown speedMultiplier: -0.7 - type: CP14MagicEffect + magicType: Evocation manaCost: 20 effects: - !type:CP14SpellSpawnEntityOnUser diff --git a/Resources/Prototypes/_CP14/Entities/Actions/Spells/flame_creation.yml b/Resources/Prototypes/_CP14/Entities/Actions/Spells/flame_creation.yml index 1b6e144602..2056b796ef 100644 --- a/Resources/Prototypes/_CP14/Entities/Actions/Spells/flame_creation.yml +++ b/Resources/Prototypes/_CP14/Entities/Actions/Spells/flame_creation.yml @@ -4,6 +4,7 @@ description: A artificial flame forms in your hand, illuminating your surroundings. You can throw it to use it as a disposable weapon. components: - type: CP14MagicEffect + magicType: Conjuration manaCost: 5 effects: - !type:CP14SpellSpawnEntityOnTarget diff --git a/Resources/Prototypes/_CP14/Entities/Actions/Spells/flash_light.yml b/Resources/Prototypes/_CP14/Entities/Actions/Spells/flash_light.yml index aa5e674c66..54881697b2 100644 --- a/Resources/Prototypes/_CP14/Entities/Actions/Spells/flash_light.yml +++ b/Resources/Prototypes/_CP14/Entities/Actions/Spells/flash_light.yml @@ -4,6 +4,7 @@ description: Creates a flash of bright, blinding light. components: - type: CP14MagicEffect + magicType: Abjuration manaCost: 10 telegraphyEffects: - !type:CP14SpellSpawnEntityOnTarget diff --git a/Resources/Prototypes/_CP14/Entities/Actions/Spells/ice_dagger.yml b/Resources/Prototypes/_CP14/Entities/Actions/Spells/ice_dagger.yml index 3698e7e657..205ae9422a 100644 --- a/Resources/Prototypes/_CP14/Entities/Actions/Spells/ice_dagger.yml +++ b/Resources/Prototypes/_CP14/Entities/Actions/Spells/ice_dagger.yml @@ -4,6 +4,7 @@ description: Materialization of a temporary sharp ice throwing dagger components: - type: CP14MagicEffect + magicType: Evocation manaCost: 15 effects: - !type:CP14SpellSpawnEntityOnTarget @@ -89,6 +90,6 @@ behaviors: - !type:PlaySoundBehavior sound: - collection: MetalBreak + collection: GlassBreak - !type:DoActsBehavior acts: ["Destruction"] \ No newline at end of file diff --git a/Resources/Prototypes/_CP14/Entities/Actions/Spells/ice_shards.yml b/Resources/Prototypes/_CP14/Entities/Actions/Spells/ice_shards.yml index 7fd0e4ffe6..0fbdd9a146 100644 --- a/Resources/Prototypes/_CP14/Entities/Actions/Spells/ice_shards.yml +++ b/Resources/Prototypes/_CP14/Entities/Actions/Spells/ice_shards.yml @@ -6,6 +6,7 @@ - type: CP14MagicEffectCastSlowdown speedMultiplier: -0.25 - type: CP14MagicEffect + magicType: Evocation manaCost: 5 effects: - !type:CP14SpellProjectile diff --git a/Resources/Prototypes/_CP14/Entities/Actions/Spells/mana_gift.yml b/Resources/Prototypes/_CP14/Entities/Actions/Spells/mana_gift.yml index b235a903d6..bcd47e7175 100644 --- a/Resources/Prototypes/_CP14/Entities/Actions/Spells/mana_gift.yml +++ b/Resources/Prototypes/_CP14/Entities/Actions/Spells/mana_gift.yml @@ -4,7 +4,9 @@ description: You can transfer a small amount of your magical energy to a target entity or magical object. components: - type: CP14MagicEffect + magicType: Necromancy manaCost: 12 + canModifyManacost: false telegraphyEffects: - !type:CP14SpellSpawnEntityOnTarget spawns: diff --git a/Resources/Prototypes/_CP14/Entities/Actions/Spells/shadow_grab.yml b/Resources/Prototypes/_CP14/Entities/Actions/Spells/shadow_grab.yml index bc22a28b30..0ffd0920eb 100644 --- a/Resources/Prototypes/_CP14/Entities/Actions/Spells/shadow_grab.yml +++ b/Resources/Prototypes/_CP14/Entities/Actions/Spells/shadow_grab.yml @@ -4,6 +4,7 @@ description: You attract a ghostly hand that draws an object or entity to you components: - type: CP14MagicEffect + magicType: Transmutation manaCost: 10 telegraphyEffects: - !type:CP14SpellSpawnEntityOnTarget diff --git a/Resources/Prototypes/_CP14/Entities/Actions/Spells/shadow_step.yml b/Resources/Prototypes/_CP14/Entities/Actions/Spells/shadow_step.yml index 4c1cc49ad8..68b48029ff 100644 --- a/Resources/Prototypes/_CP14/Entities/Actions/Spells/shadow_step.yml +++ b/Resources/Prototypes/_CP14/Entities/Actions/Spells/shadow_step.yml @@ -6,6 +6,7 @@ - type: CP14MagicEffectCastSlowdown speedMultiplier: -0.4 - type: CP14MagicEffect + magicType: Conjuration manaCost: 20 telegraphyEffects: - !type:CP14SpellSpawnEntityOnTarget diff --git a/Resources/Prototypes/_CP14/Entities/Actions/Spells/sphere_of_light.yml b/Resources/Prototypes/_CP14/Entities/Actions/Spells/sphere_of_light.yml index e8fbac597f..d4f6395d0c 100644 --- a/Resources/Prototypes/_CP14/Entities/Actions/Spells/sphere_of_light.yml +++ b/Resources/Prototypes/_CP14/Entities/Actions/Spells/sphere_of_light.yml @@ -4,6 +4,7 @@ description: Materialization of a bright and safe light source. components: - type: CP14MagicEffect + magicType: Conjuration manaCost: 10 effects: - !type:CP14SpellSpawnEntityOnTarget diff --git a/Resources/Prototypes/_CP14/Entities/Clothing/Head/Roles/general.yml b/Resources/Prototypes/_CP14/Entities/Clothing/Head/Roles/general.yml index d3a0c46a99..230c416409 100644 --- a/Resources/Prototypes/_CP14/Entities/Clothing/Head/Roles/general.yml +++ b/Resources/Prototypes/_CP14/Entities/Clothing/Head/Roles/general.yml @@ -125,6 +125,8 @@ sprite: _CP14/Clothing/Head/Roles/General/triangularhat.rsi - type: Clothing sprite: _CP14/Clothing/Head/Roles/General/triangularhat.rsi + - type: CP14MagicClothingManacostModify + globalModifier: 0.8 - type: entity parent: CP14ClothingHeadBase @@ -135,4 +137,6 @@ - type: Sprite sprite: _CP14/Clothing/Head/Roles/General/triangularhat_golden.rsi - type: Clothing - sprite: _CP14/Clothing/Head/Roles/General/triangularhat_golden.rsi \ No newline at end of file + sprite: _CP14/Clothing/Head/Roles/General/triangularhat_golden.rsi + - type: CP14MagicClothingManacostModify + globalModifier: 0.8 \ No newline at end of file diff --git a/Resources/Prototypes/_CP14/Entities/Mobs/NPC/monster.yml b/Resources/Prototypes/_CP14/Entities/Mobs/NPC/monster.yml index 8b8adfdcec..b9f75b0df9 100644 --- a/Resources/Prototypes/_CP14/Entities/Mobs/NPC/monster.yml +++ b/Resources/Prototypes/_CP14/Entities/Mobs/NPC/monster.yml @@ -103,6 +103,7 @@ - type: CP14MagicEffectCastSlowdown speedMultiplier: -1.0 - type: CP14MagicEffect + magicType: Conjuration manaCost: 5 telegraphyEffects: - !type:CP14SpellSpawnEntityOnTarget diff --git a/Resources/Prototypes/_CP14/Entities/Ritual/orbs.yml b/Resources/Prototypes/_CP14/Entities/Ritual/orbs.yml index 88061ae14d..7081a34043 100644 --- a/Resources/Prototypes/_CP14/Entities/Ritual/orbs.yml +++ b/Resources/Prototypes/_CP14/Entities/Ritual/orbs.yml @@ -10,30 +10,30 @@ drawDepth: Mobs noRot: true -- type: entity - parent: CP14BaseRitualOrb - id: CP14RitualOrbCreation - name: creation orb - categories: [ HideSpawnMenu] - components: - - type: CP14MagicRitualOrb - powers: - Creation: 1 - - type: Sprite - layers: - - state: creation - shader: unshaded - -- type: entity - parent: CP14BaseRitualOrb - id: CP14RitualOrbDestruction - name: destruction orb - categories: [ HideSpawnMenu] - components: - - type: CP14MagicRitualOrb - powers: - Destruction: 1 - - type: Sprite - layers: - - state: destruction - shader: unshaded \ No newline at end of file +#- type: entity +# parent: CP14BaseRitualOrb +# id: CP14RitualOrbCreation +# name: creation orb +# categories: [ HideSpawnMenu] +# components: +# - type: CP14MagicRitualOrb +# powers: +# Creation: 1 +# - type: Sprite +# layers: +# - state: creation +# shader: unshaded +# +#- type: entity +# parent: CP14BaseRitualOrb +# id: CP14RitualOrbDestruction +# name: destruction orb +# categories: [ HideSpawnMenu] +# components: +# - type: CP14MagicRitualOrb +# powers: +# Destruction: 1 +# - type: Sprite +# layers: +# - state: destruction +# shader: unshaded \ No newline at end of file diff --git a/Resources/Prototypes/_CP14/MagicTypes/magic.yml b/Resources/Prototypes/_CP14/MagicTypes/magic.yml index c4f36ec62e..42dcd422f7 100644 --- a/Resources/Prototypes/_CP14/MagicTypes/magic.yml +++ b/Resources/Prototypes/_CP14/MagicTypes/magic.yml @@ -1,9 +1,39 @@ - type: magicType - id: Creation - name: cp14-magic-type-creation - color: "#4bcc7d" + id: Abjuration + name: cp14-magic-type-abjuration #Ограждение + color: "#c94328" - type: magicType - id: Destruction - name: cp14-magic-type-destruction - color: "#c94c1a" \ No newline at end of file + id: Conjuration + name: cp14-magic-type-conjuration #Призыв + color: "#8e28c9" + +- type: magicType + id: Divination + name: cp14-magic-type-divination #Прорицание + color: "#81d3e3" + +- type: magicType + id: Enchantment + name: cp14-magic-type-enchantment #Очарование + color: "#7147a1" + +- type: magicType + id: Evocation + name: cp14-magic-type-evocation #Воплощение + color: "#47a14a" + +- type: magicType + id: Illusion + name: cp14-magic-type-illusion #Иллюзия + color: "#cc1275" + +- type: magicType + id: Necromancy + name: cp14-magic-type-necromancy #Некромантия + color: "#4dc4a4" + +- type: magicType + id: Transmutation + name: cp14-magic-type-transmutation #Трансмутация + color: "#3333d4" \ No newline at end of file