diff --git a/Content.Server/Magic/MagicSystem.cs b/Content.Server/Magic/MagicSystem.cs index 09f6fd143e4d5..d75f57faa2bf4 100644 --- a/Content.Server/Magic/MagicSystem.cs +++ b/Content.Server/Magic/MagicSystem.cs @@ -1,4 +1,6 @@ +// Modified by Ronstation contributor(s), therefore this file is licensed as MIT sublicensed with AGPL-v3.0. using Content.Server.Chat.Systems; +using Content.Server.Clothing.Systems; // Modification using Content.Server.GameTicking; using Content.Server.GameTicking.Rules.Components; using Content.Shared.Magic; @@ -15,6 +17,7 @@ public sealed class MagicSystem : SharedMagicSystem [Dependency] private readonly GameTicker _gameTicker = default!; [Dependency] private readonly TagSystem _tag = default!; [Dependency] private readonly SharedMindSystem _mind = default!; + [Dependency] private readonly OutfitSystem _outfitSystem = default!; // Modification private static readonly ProtoId InvalidForSurvivorAntagTag = "InvalidForSurvivorAntag"; @@ -51,4 +54,13 @@ protected override void OnRandomGlobalSpawnSpell(RandomGlobalSpawnSpellEvent ev) if (!_gameTicker.IsGameRuleActive()) _gameTicker.StartGameRule(survivorRule); } + // Start of modifications + public override void OnTransformSpell(TransformSpellEvent ev) + { + base.OnTransformSpell(ev); + + if (!ev.Cancelled) + _outfitSystem.SetOutfit(ev.Target, ev.Loadout); + } + // End of modifications } diff --git a/Content.Shared/Magic/SharedMagicSystem.cs b/Content.Shared/Magic/SharedMagicSystem.cs index 72c52178f97df..30c1ded870c8b 100644 --- a/Content.Shared/Magic/SharedMagicSystem.cs +++ b/Content.Shared/Magic/SharedMagicSystem.cs @@ -89,6 +89,7 @@ public override void Initialize() SubscribeLocalEvent(OnChangeComponentsSpell); SubscribeLocalEvent(OnSmiteSpell); SubscribeLocalEvent(OnCellularSmiteSpell); + SubscribeLocalEvent(OnTransformSpell); SubscribeLocalEvent(OnKnockSpell); SubscribeLocalEvent(OnChargeSpell); SubscribeLocalEvent(OnRandomGlobalSpawnSpell); @@ -414,7 +415,7 @@ private void OnSmiteSpell(SmiteSpellEvent ev) _body.GibBody(ev.Target, true, body); } -// start of modifications + // start of modifications private void OnCellularSmiteSpell(CellularSmiteSpellEvent ev) { //Stacking genetic damage on people who are already downed or dead is cringe @@ -444,9 +445,29 @@ private void OnCellularSmiteSpell(CellularSmiteSpellEvent ev) //_physics.ApplyLinearImpulse(ev.Target, impulseVector); _jittering.DoJitter(ev.Target, TimeSpan.FromSeconds(1f), false, 80f, 8f, true); - _damageableSystem.TryChangeDamage(ev.Target, ev.smiteDamage, true); + _damageableSystem.TryChangeDamage(ev.Target, ev.SmiteDamage, true); } -// end of modifications + + public virtual void OnTransformSpell(TransformSpellEvent ev) + { + if (ev.Handled || !PassesSpellPrerequisites(ev.Action, ev.Performer)) + { + ev.Cancelled = true; + return; + } + if (TryComp(ev.Target, out var clumsy)) + { + _popup.PopupClient(Loc.GetString(ev.FailureMessage), ev.Performer, ev.Performer); + ev.Cancelled = true; + return; + } + + ev.Cancelled = false; + ev.Handled = true; + AddComponents(ev.Target, ev.ToAdd); + RemoveComponents(ev.Target, ev.ToRemove); + } + // end of modifications // End Touch Spells #endregion @@ -549,7 +570,7 @@ private void OnMindSwapSpell(MindSwapSpellEvent ev) return; ev.Handled = true; - + // start of modifications // Chaplain immunity check if (HasComp(ev.Target)) diff --git a/Content.Shared/_Ronstation/Magic/Components/WizardTransformationComponent.cs b/Content.Shared/_Ronstation/Magic/Components/WizardTransformationComponent.cs new file mode 100644 index 0000000000000..f1a94e59dd245 --- /dev/null +++ b/Content.Shared/_Ronstation/Magic/Components/WizardTransformationComponent.cs @@ -0,0 +1,7 @@ +using Robust.Shared.GameStates; + +namespace Content.Shared.Magic.Components; + +[RegisterComponent, NetworkedComponent] +[Access(typeof(SharedMagicSystem))] +public sealed partial class WizardTransformationComponent : Component; diff --git a/Content.Shared/_Ronstation/Magic/Events/CellularSmiteSpellEvent.cs b/Content.Shared/_Ronstation/Magic/Events/CellularSmiteSpellEvent.cs index b461641730a18..952d46bd6332b 100644 --- a/Content.Shared/_Ronstation/Magic/Events/CellularSmiteSpellEvent.cs +++ b/Content.Shared/_Ronstation/Magic/Events/CellularSmiteSpellEvent.cs @@ -9,5 +9,5 @@ public sealed partial class CellularSmiteSpellEvent : EntityTargetActionEvent // Damage that the smite spell will do. // [DataField] - public DamageSpecifier smiteDamage = new(); + public DamageSpecifier SmiteDamage = new(); } diff --git a/Content.Shared/_Ronstation/Magic/Events/TransformSpellEvent.cs b/Content.Shared/_Ronstation/Magic/Events/TransformSpellEvent.cs new file mode 100644 index 0000000000000..7fde32b45f258 --- /dev/null +++ b/Content.Shared/_Ronstation/Magic/Events/TransformSpellEvent.cs @@ -0,0 +1,32 @@ +using Content.Shared.Actions; +using Robust.Shared.Prototypes; + +namespace Content.Shared.Magic.Events; + +public sealed partial class TransformSpellEvent : EntityTargetActionEvent +{ + /// + /// Components added or removed from the target + /// + [DataField] + [AlwaysPushInheritance] + public ComponentRegistry ToAdd = new(); + + [DataField] + [AlwaysPushInheritance] + public HashSet ToRemove = new(); + + /// + /// Outfit forced onto the target + /// + [DataField] + public string Loadout; + + /// + /// Whether our event was cancelled or not by invalid targeting etc + /// + public bool Cancelled = false; + + [DataField] + public string FailureMessage = "spell-target-immune-transformed"; +} diff --git a/Resources/Locale/en-US/_Ronstation/magic/magic.ftl b/Resources/Locale/en-US/_Ronstation/magic/magic.ftl index 2877201d41440..7b5e3522301e2 100644 --- a/Resources/Locale/en-US/_Ronstation/magic/magic.ftl +++ b/Resources/Locale/en-US/_Ronstation/magic/magic.ftl @@ -1 +1,4 @@ spell-target-immune = A higher power protects them from your spell! +spell-target-immune-transformed = They're already transformed. + +action-speech-spell-clown = HONK! \ No newline at end of file diff --git a/Resources/Locale/en-US/_Ronstation/store/spellbook-catalog.ftl b/Resources/Locale/en-US/_Ronstation/store/spellbook-catalog.ftl new file mode 100644 index 0000000000000..fe72916cfa54f --- /dev/null +++ b/Resources/Locale/en-US/_Ronstation/store/spellbook-catalog.ftl @@ -0,0 +1,2 @@ +spellbook-clown-name = Banana Touch +spellbook-clown-desc = Curses the target to be a clown. Use it on people you don't like, but for whom death is a bit too merciful. Requires Wizard Robe & Hat. \ No newline at end of file diff --git a/Resources/Prototypes/Catalog/spellbook_catalog.yml b/Resources/Prototypes/Catalog/spellbook_catalog.yml index 9789c52a5812e..d594323e0e554 100644 --- a/Resources/Prototypes/Catalog/spellbook_catalog.yml +++ b/Resources/Prototypes/Catalog/spellbook_catalog.yml @@ -41,7 +41,7 @@ # - !type:ListingLimitedStockCondition # stock: 1 -# Ronstation - Smite fucks you up real bad, but doesn't remove you from the round. +# Ronstation - Modified spells. - type: listing id: SpellbookCellularSmite name: spellbook-cellular-smite-name @@ -54,13 +54,12 @@ conditions: - !type:ListingLimitedStockCondition stock: 1 -# end of modifications - type: listing - id: SpellbookCluwne - name: spellbook-cluwne-name - description: spellbook-cluwne-desc - productAction: ActionCluwne + id: SpellbookClown + name: spellbook-clown-name + description: spellbook-clown-desc + productAction: ActionClown cost: WizCoin: 3 categories: @@ -68,6 +67,20 @@ conditions: - !type:ListingLimitedStockCondition stock: 1 +# end of modifications + +# - type: listing +# id: SpellbookCluwne +# name: spellbook-cluwne-name +# description: spellbook-cluwne-desc +# productAction: ActionCluwne +# cost: +# WizCoin: 3 +# categories: +# - SpellbookOffensive +# conditions: +# - !type:ListingLimitedStockCondition +# stock: 1 - type: listing id: SpellbookSlip diff --git a/Resources/Prototypes/Magic/touch_spells.yml b/Resources/Prototypes/Magic/touch_spells.yml index e29ffc8674b42..22175e1aac241 100644 --- a/Resources/Prototypes/Magic/touch_spells.yml +++ b/Resources/Prototypes/Magic/touch_spells.yml @@ -97,6 +97,33 @@ sentence: action-speech-spell-cluwne - type: Magic requiresClothes: true +# Start of modifications +- type: entity + parent: BaseSmiteAction + id: ActionClown + name: Banana Touch + description: Turns someone into a Clown! + components: + - type: Action + useDelay: 120 + sound: !type:SoundPathSpecifier + path: /Audio/Items/bikehorn.ogg + icon: + sprite: Clothing/Mask/clown.rsi + state: icon + - type: EntityTargetAction + event: !type:TransformSpellEvent + toAdd: + - type: Clumsy + clumsyDefib: false + - type: WizardTransformation + loadout: ClownGear + failureMessage: "They're already clown enough!" + - type: SpeakOnAction + sentence: action-speech-spell-clown + - type: Magic + requiresClothes: true +# End of modifications - type: entity parent: BaseSmiteAction