* 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
68 lines
2.5 KiB
C#
68 lines
2.5 KiB
C#
|
|
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.MagicManacostModify;
|
|
|
|
public sealed partial class CP14MagicManacostModifySystem : EntitySystem
|
|
{
|
|
[Dependency] private readonly ExamineSystemShared _examine = default!;
|
|
[Dependency] private readonly IPrototypeManager _proto = default!;
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
|
|
SubscribeLocalEvent<CP14MagicManacostModifyComponent, InventoryRelayedEvent<CP14CalculateManacostEvent>>(OnCalculateManacost);
|
|
SubscribeLocalEvent<CP14MagicManacostModifyComponent, CP14CalculateManacostEvent>(OnCalculateManacost);
|
|
SubscribeLocalEvent<CP14MagicManacostModifyComponent, GetVerbsEvent<ExamineVerb>>(OnVerbExamine);
|
|
}
|
|
|
|
private void OnVerbExamine(Entity<CP14MagicManacostModifyComponent> ent, ref GetVerbsEvent<ExamineVerb> args)
|
|
{
|
|
if (!args.CanInteract || !args.CanAccess || !ent.Comp.Examinable)
|
|
return;
|
|
|
|
var markup = GetManacostModifyMessage(ent.Comp.GlobalModifier);
|
|
_examine.AddDetailedExamineVerb(
|
|
args,
|
|
ent.Comp,
|
|
markup,
|
|
Loc.GetString("cp14-magic-examinable-verb-text"),
|
|
"/Textures/Interface/VerbIcons/bubbles.svg.192dpi.png",
|
|
Loc.GetString("cp14-magic-examinable-verb-message"));
|
|
}
|
|
|
|
public FormattedMessage GetManacostModifyMessage(FixedPoint2 global)
|
|
{
|
|
var msg = new FormattedMessage();
|
|
msg.AddMarkupOrThrow(Loc.GetString("cp14-clothing-magic-examine"));
|
|
|
|
if (global != 1)
|
|
{
|
|
msg.PushNewline();
|
|
|
|
var plus = (float)global > 1 ? "+" : "";
|
|
msg.AddMarkupOrThrow(
|
|
$"{Loc.GetString("cp14-clothing-magic-global")}: {plus}{MathF.Round((float)(global - 1) * 100, MidpointRounding.AwayFromZero)}%");
|
|
}
|
|
|
|
return msg;
|
|
}
|
|
|
|
private void OnCalculateManacost(Entity<CP14MagicManacostModifyComponent> ent, ref InventoryRelayedEvent<CP14CalculateManacostEvent> args)
|
|
{
|
|
OnCalculateManacost(ent, ref args.Args);
|
|
}
|
|
|
|
private void OnCalculateManacost(Entity<CP14MagicManacostModifyComponent> ent, ref CP14CalculateManacostEvent args)
|
|
{
|
|
args.Multiplier *= (float)ent.Comp.GlobalModifier;
|
|
}
|
|
}
|