* Refactor pacified block logic to action system Moved pacified block functionality from magic spell components to the new CP14ActionSystem and related components. Removed CP14MagicEffectPacifiedBlockComponent and its logic, and introduced CP14ActionDangerousComponent for handling pacified checks. Updated examine and checks logic to use the new action-based components, improving separation of concerns between magic and action systems. * finish pacified * mobtargetstate refactor * skillpoint cost refactor * somaticAspect refactor * material cost refactor * mana cost now * stamina cost * SSD + verbal aspect * religion * music tool refactor * vampire * get rid of this event * manacost refac * Remove magicType field from spell definitions Eliminated the 'magicType' property from all CP14MagicEffect components in spell YAML files across Electric, Fire, Life, Light, and Water categories. This streamlines spell configuration and may reflect a change in how magic types are handled in the system. * Remove mana cost reduction effects from skill tiers Eliminated the ModifyManacost effects from tier 2 and tier 3 skills in electromancy, healing, hydrosophistry, illusion, and pyrokinetic. This change standardizes skill progression and may be part of a balance update to mana cost mechanics. * comment out T3 tiers * namespace refactor * fix hands
92 lines
2.6 KiB
C#
92 lines
2.6 KiB
C#
using Content.Shared._CP14.MagicRitual.Prototypes;
|
|
using Content.Shared._CP14.MagicSpell.Components;
|
|
using Content.Shared._CP14.MagicSpell.Spells;
|
|
using Content.Shared.FixedPoint;
|
|
using Content.Shared.Inventory;
|
|
using Robust.Shared.Map;
|
|
using Robust.Shared.Prototypes;
|
|
|
|
namespace Content.Shared._CP14.MagicSpell.Events;
|
|
|
|
/// <summary>
|
|
/// An event that checks all sorts of conditions, and calculates the total cost of casting a spell. Called before the spell is cast.
|
|
/// </summary>
|
|
/// <remarks>TODO: This call is duplicated at the beginning of the cast for checks, and at the end of the cast for mana subtraction.</remarks>
|
|
public sealed class CP14CalculateManacostEvent : EntityEventArgs, IInventoryRelayEvent
|
|
{
|
|
public FixedPoint2 Manacost = 0f;
|
|
|
|
public float Multiplier = 1f;
|
|
public EntityUid? Performer;
|
|
|
|
public CP14CalculateManacostEvent(EntityUid? performer, FixedPoint2 initialManacost)
|
|
{
|
|
Performer = performer;
|
|
Manacost = initialManacost;
|
|
}
|
|
|
|
public float GetManacost()
|
|
{
|
|
return (float)Manacost * Multiplier;
|
|
}
|
|
|
|
public SlotFlags TargetSlots { get; } = SlotFlags.All;
|
|
}
|
|
|
|
/// <summary>
|
|
/// is invoked if all conditions are met and the spell has begun to be cast (doAfter start moment)
|
|
/// </summary>
|
|
[ByRefEvent]
|
|
public sealed class CP14StartCastMagicEffectEvent : EntityEventArgs
|
|
{
|
|
public EntityUid Performer { get; init; }
|
|
|
|
public CP14StartCastMagicEffectEvent(EntityUid performer)
|
|
{
|
|
Performer = performer;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// is invoked on the spell itself when the spell process has been completed or interrupted (doAfter end moment)
|
|
/// </summary>
|
|
[ByRefEvent]
|
|
public sealed class CP14EndCastMagicEffectEvent : EntityEventArgs
|
|
{
|
|
public EntityUid Performer { get; init; }
|
|
|
|
public CP14EndCastMagicEffectEvent(EntityUid performer)
|
|
{
|
|
Performer = performer;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// is invoked only if the spell has been successfully cast
|
|
/// </summary>
|
|
[ByRefEvent]
|
|
public sealed class CP14MagicEffectConsumeResourceEvent : EntityEventArgs
|
|
{
|
|
public EntityUid? Performer { get; init; }
|
|
|
|
public CP14MagicEffectConsumeResourceEvent(EntityUid? performer)
|
|
{
|
|
Performer = performer;
|
|
}
|
|
}
|
|
|
|
[ByRefEvent]
|
|
public sealed class CP14SpellFromSpellStorageUsedEvent : EntityEventArgs
|
|
{
|
|
public EntityUid? Performer { get; init; }
|
|
public Entity<CP14MagicEffectComponent> Action { get; init; }
|
|
public FixedPoint2 Manacost { get; init; }
|
|
|
|
public CP14SpellFromSpellStorageUsedEvent(EntityUid? performer, Entity<CP14MagicEffectComponent> action, FixedPoint2 manacost)
|
|
{
|
|
Performer = performer;
|
|
Action = action;
|
|
Manacost = manacost;
|
|
}
|
|
}
|