Magic types, magic clothing (#539)
* magic types + auto magic spell description * manacost calculation event * manacost ffect clothing * Update orbs.yml * magic type not required
This commit is contained in:
@@ -27,22 +27,22 @@ public sealed partial class CP14MagicSystem : CP14SharedMagicSystem
|
||||
|
||||
private void OnSlowdownCaster(Entity<CP14MagicEffectCastSlowdownComponent> ent, ref CP14StartCastMagicEffectEvent args)
|
||||
{
|
||||
if (!TryComp<CP14MagicCasterSlowdownComponent>(args.Performer, out var caster))
|
||||
if (!TryComp<CP14MagicCasterSlowdownComponent>(args.Caster, out var caster))
|
||||
return;
|
||||
|
||||
caster.SpeedModifiers.Add(ent.Comp.SpeedMultiplier);
|
||||
_movement.RefreshMovementSpeedModifiers(args.Performer);
|
||||
_movement.RefreshMovementSpeedModifiers(args.Caster);
|
||||
}
|
||||
|
||||
private void OnUnslowdownCaster(Entity<CP14MagicEffectCastSlowdownComponent> ent, ref CP14EndCastMagicEffectEvent args)
|
||||
{
|
||||
if (!TryComp<CP14MagicCasterSlowdownComponent>(args.Performer, out var caster))
|
||||
if (!TryComp<CP14MagicCasterSlowdownComponent>(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<CP14MagicCasterSlowdownComponent> ent, ref RefreshMovementSpeedModifiersEvent args)
|
||||
@@ -64,8 +64,8 @@ public sealed partial class CP14MagicSystem : CP14SharedMagicSystem
|
||||
|
||||
private void OnSpawnMagicVisualEffect(Entity<CP14MagicEffectCastingVisualComponent> 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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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<InventoryComponent, CP14MagicEnergyScanEvent>(RelayInventoryEvent);
|
||||
SubscribeLocalEvent<InventoryComponent, CP14CalculateManacostEvent>(RelayInventoryEvent);
|
||||
|
||||
//CP14 End
|
||||
|
||||
SubscribeLocalEvent<InventoryComponent, DamageModifyEvent>(RelayInventoryEvent);
|
||||
SubscribeLocalEvent<InventoryComponent, ElectrocutionAttemptEvent>(RelayInventoryEvent);
|
||||
SubscribeLocalEvent<InventoryComponent, SlipAttemptEvent>(RelayInventoryEvent);
|
||||
@@ -47,7 +54,6 @@ public partial class InventorySystem
|
||||
SubscribeLocalEvent<InventoryComponent, GetEyeProtectionEvent>(RelayInventoryEvent);
|
||||
SubscribeLocalEvent<InventoryComponent, GetBlurEvent>(RelayInventoryEvent);
|
||||
SubscribeLocalEvent<InventoryComponent, SolutionScanEvent>(RelayInventoryEvent);
|
||||
SubscribeLocalEvent<InventoryComponent, CP14MagicEnergyScanEvent>(RelayInventoryEvent); //CP14 Magic scanning
|
||||
|
||||
// ComponentActivatedClientSystems
|
||||
SubscribeLocalEvent<InventoryComponent, RefreshEquipmentHudEvent<ShowJobIconsComponent>>(RelayInventoryEvent);
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
using Content.Shared._CP14.MagicRitual.Prototypes;
|
||||
using Content.Shared.FixedPoint;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Shared._CP14.MagicClothing;
|
||||
|
||||
/// <summary>
|
||||
/// Changes the manacost of spells for the bearer
|
||||
/// </summary>
|
||||
[RegisterComponent, Access(typeof(CP14MagicClothingSystem))]
|
||||
public sealed partial class CP14MagicClothingManacostModifyComponent : Component
|
||||
{
|
||||
[DataField]
|
||||
public Dictionary<ProtoId<CP14MagicTypePrototype>, FixedPoint2> Modifiers = new();
|
||||
|
||||
[DataField]
|
||||
public FixedPoint2 GlobalModifier = 1f;
|
||||
}
|
||||
@@ -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<CP14MagicClothingManacostModifyComponent, InventoryRelayedEvent<CP14CalculateManacostEvent>>(OnCalculateManacost);
|
||||
SubscribeLocalEvent<CP14MagicClothingManacostModifyComponent, GetVerbsEvent<ExamineVerb>>(OnVerbExamine);
|
||||
}
|
||||
|
||||
private void OnVerbExamine(Entity<CP14MagicClothingManacostModifyComponent> ent, ref GetVerbsEvent<ExamineVerb> 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<CP14MagicClothingManacostModifyComponent> ent, ref InventoryRelayedEvent<CP14CalculateManacostEvent> 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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<CP14MagicEffectComponent, MapInitEvent>(OnMagicEffectInit);
|
||||
SubscribeLocalEvent<CP14MagicEffectComponent, CP14BeforeCastMagicEffectEvent>(OnBeforeCastMagicEffect);
|
||||
|
||||
SubscribeLocalEvent<CP14DelayedInstantActionEvent>(OnInstantAction);
|
||||
@@ -43,22 +48,48 @@ public partial class CP14SharedMagicSystem : EntitySystem
|
||||
SubscribeLocalEvent<CP14MagicEffectComponent, CP14AfterCastMagicEffectEvent>(OnAfterCastMagicEffect);
|
||||
}
|
||||
|
||||
private void OnMagicEffectInit(Entity<CP14MagicEffectComponent> 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<CP14MagicEffectComponent> ent, ref CP14BeforeCastMagicEffectEvent args)
|
||||
{
|
||||
if (!TryComp<CP14MagicEnergyContainerComponent>(args.Performer, out var magicContainer))
|
||||
if (!TryComp<CP14MagicEnergyContainerComponent>(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<CP14MagicEffectComponent> 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<CP14MagicEffectComponent> 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<CP14MagicEffectSomaticAspectComponent> ent, ref CP14BeforeCastMagicEffectEvent args)
|
||||
{
|
||||
if (TryComp<HandsComponent>(args.Performer, out var hands) || hands is not null)
|
||||
if (TryComp<HandsComponent>(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<CP14MagicEffectVerbalAspectComponent> ent, ref CP14BeforeCastMagicEffectEvent args)
|
||||
{
|
||||
if (HasComp<MutedComponent>(args.Performer))
|
||||
if (HasComp<MutedComponent>(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<CP14MagicEnergyContainerComponent>(args.Performer))
|
||||
if (!HasComp<CP14MagicEnergyContainerComponent>(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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
namespace Content.Shared._CP14.MagicSpell.Components;
|
||||
|
||||
/// <summary>
|
||||
/// imposes debuffs on excessive use of magic
|
||||
/// apply slowdown effect from casting spells
|
||||
/// </summary>
|
||||
[RegisterComponent, Access(typeof(CP14SharedMagicSystem))]
|
||||
public sealed partial class CP14MagicCasterSlowdownComponent : Component
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
using Content.Shared._CP14.MagicSpell.Spells;
|
||||
using Content.Shared.FixedPoint;
|
||||
|
||||
namespace Content.Shared._CP14.MagicSpell.Components;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -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<CP14MagicTypePrototype>? MagicType = null;
|
||||
|
||||
/// <summary>
|
||||
/// Can the cost of casting this magic effect be changed from clothing or other sources?
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public bool CanModifyManacost = true;
|
||||
|
||||
[DataField]
|
||||
public bool Safe = false;
|
||||
|
||||
|
||||
@@ -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
|
||||
/// <summary>
|
||||
/// The Performer of the event, to check if they meet the requirements.
|
||||
/// </summary>
|
||||
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;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 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;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -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<CP14MagicTypePrototype>? MagicType;
|
||||
|
||||
public CP14CalculateManacostEvent(EntityUid caster, FixedPoint2 initialManacost, ProtoId<CP14MagicTypePrototype>? magicType)
|
||||
{
|
||||
Caster = caster;
|
||||
Manacost = initialManacost;
|
||||
MagicType = magicType;
|
||||
}
|
||||
|
||||
public float GetManacost()
|
||||
{
|
||||
return (float)Manacost * Multiplier;
|
||||
}
|
||||
|
||||
public SlotFlags TargetSlots { get; } = SlotFlags.All;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
using Content.Shared.Damage;
|
||||
using Content.Shared.FixedPoint;
|
||||
|
||||
namespace Content.Shared._CP14.MagicWeakness;
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
cp14-clothing-magic-examine = Changes the manacost of the following magic types:
|
||||
|
||||
cp14-clothing-magic-global = All types
|
||||
@@ -1,2 +1,11 @@
|
||||
cp14-magic-type-creation = Creation
|
||||
cp14-magic-type-destruction = Destruction
|
||||
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
|
||||
@@ -0,0 +1,3 @@
|
||||
cp14-clothing-magic-examine = Изменяет количество затрачиваемой маны на использование заклинаний следующих направлений:
|
||||
|
||||
cp14-clothing-magic-global = Всех направлений
|
||||
@@ -1,2 +1,11 @@
|
||||
cp14-magic-type-creation = Созидание
|
||||
cp14-magic-type-destruction = Разрушение
|
||||
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 = Тип магии
|
||||
@@ -6,6 +6,7 @@
|
||||
- type: CP14MagicEffectCastSlowdown
|
||||
speedMultiplier: -0.5
|
||||
- type: CP14MagicEffect
|
||||
magicType: Evocation
|
||||
manaCost: 20
|
||||
telegraphyEffects:
|
||||
- !type:CP14SpellSpawnEntityOnTarget
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
- type: CP14MagicEffectCastSlowdown
|
||||
speedMultiplier: -0.9
|
||||
- type: CP14MagicEffect
|
||||
magicType: Evocation
|
||||
manaCost: 15
|
||||
telegraphyEffects:
|
||||
- !type:CP14SpellSpawnEntityOnTarget
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
- type: CP14MagicEffectCastSlowdown
|
||||
speedMultiplier: -0.7
|
||||
- type: CP14MagicEffect
|
||||
magicType: Evocation
|
||||
manaCost: 20
|
||||
effects:
|
||||
- !type:CP14SpellSpawnEntityOnUser
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
description: Creates a flash of bright, blinding light.
|
||||
components:
|
||||
- type: CP14MagicEffect
|
||||
magicType: Abjuration
|
||||
manaCost: 10
|
||||
telegraphyEffects:
|
||||
- !type:CP14SpellSpawnEntityOnTarget
|
||||
|
||||
@@ -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"]
|
||||
@@ -6,6 +6,7 @@
|
||||
- type: CP14MagicEffectCastSlowdown
|
||||
speedMultiplier: -0.25
|
||||
- type: CP14MagicEffect
|
||||
magicType: Evocation
|
||||
manaCost: 5
|
||||
effects:
|
||||
- !type:CP14SpellProjectile
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
- type: CP14MagicEffectCastSlowdown
|
||||
speedMultiplier: -0.4
|
||||
- type: CP14MagicEffect
|
||||
magicType: Conjuration
|
||||
manaCost: 20
|
||||
telegraphyEffects:
|
||||
- !type:CP14SpellSpawnEntityOnTarget
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
description: Materialization of a bright and safe light source.
|
||||
components:
|
||||
- type: CP14MagicEffect
|
||||
magicType: Conjuration
|
||||
manaCost: 10
|
||||
effects:
|
||||
- !type:CP14SpellSpawnEntityOnTarget
|
||||
|
||||
@@ -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
|
||||
sprite: _CP14/Clothing/Head/Roles/General/triangularhat_golden.rsi
|
||||
- type: CP14MagicClothingManacostModify
|
||||
globalModifier: 0.8
|
||||
@@ -103,6 +103,7 @@
|
||||
- type: CP14MagicEffectCastSlowdown
|
||||
speedMultiplier: -1.0
|
||||
- type: CP14MagicEffect
|
||||
magicType: Conjuration
|
||||
manaCost: 5
|
||||
telegraphyEffects:
|
||||
- !type:CP14SpellSpawnEntityOnTarget
|
||||
|
||||
@@ -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
|
||||
#- 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
|
||||
@@ -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"
|
||||
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"
|
||||
Reference in New Issue
Block a user