Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions Content.Server/Magic/MagicSystem.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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<TagPrototype> InvalidForSurvivorAntagTag = "InvalidForSurvivorAntag";

Expand Down Expand Up @@ -51,4 +54,13 @@ protected override void OnRandomGlobalSpawnSpell(RandomGlobalSpawnSpellEvent ev)
if (!_gameTicker.IsGameRuleActive<SurvivorRuleComponent>())
_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
}
29 changes: 25 additions & 4 deletions Content.Shared/Magic/SharedMagicSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ public override void Initialize()
SubscribeLocalEvent<ChangeComponentsSpellEvent>(OnChangeComponentsSpell);
SubscribeLocalEvent<SmiteSpellEvent>(OnSmiteSpell);
SubscribeLocalEvent<CellularSmiteSpellEvent>(OnCellularSmiteSpell);
SubscribeLocalEvent<TransformSpellEvent>(OnTransformSpell);
SubscribeLocalEvent<KnockSpellEvent>(OnKnockSpell);
SubscribeLocalEvent<ChargeSpellEvent>(OnChargeSpell);
SubscribeLocalEvent<RandomGlobalSpawnSpellEvent>(OnRandomGlobalSpawnSpell);
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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<WizardTransformationComponent>(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
Expand Down Expand Up @@ -549,7 +570,7 @@ private void OnMindSwapSpell(MindSwapSpellEvent ev)
return;

ev.Handled = true;

// start of modifications
// Chaplain immunity check
if (HasComp<BibleUserComponent>(ev.Target))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
using Robust.Shared.GameStates;

namespace Content.Shared.Magic.Components;

[RegisterComponent, NetworkedComponent]
[Access(typeof(SharedMagicSystem))]
public sealed partial class WizardTransformationComponent : Component;
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ public sealed partial class CellularSmiteSpellEvent : EntityTargetActionEvent
// Damage that the smite spell will do.
//</summary>
[DataField]
public DamageSpecifier smiteDamage = new();
public DamageSpecifier SmiteDamage = new();
}
32 changes: 32 additions & 0 deletions Content.Shared/_Ronstation/Magic/Events/TransformSpellEvent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using Content.Shared.Actions;
using Robust.Shared.Prototypes;

namespace Content.Shared.Magic.Events;

public sealed partial class TransformSpellEvent : EntityTargetActionEvent
{
/// <summary>
/// Components added or removed from the target
/// </summary>
[DataField]
[AlwaysPushInheritance]
public ComponentRegistry ToAdd = new();

[DataField]
[AlwaysPushInheritance]
public HashSet<string> ToRemove = new();

/// <summary>
/// Outfit forced onto the target
/// </summary>
[DataField]
public string Loadout;

/// <summary>
/// Whether our event was cancelled or not by invalid targeting etc
/// </summary>
public bool Cancelled = false;

[DataField]
public string FailureMessage = "spell-target-immune-transformed";
}
3 changes: 3 additions & 0 deletions Resources/Locale/en-US/_Ronstation/magic/magic.ftl
Original file line number Diff line number Diff line change
@@ -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!
Original file line number Diff line number Diff line change
@@ -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.
25 changes: 19 additions & 6 deletions Resources/Prototypes/Catalog/spellbook_catalog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -54,20 +54,33 @@
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:
- SpellbookOffensive
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
Expand Down
27 changes: 27 additions & 0 deletions Resources/Prototypes/Magic/touch_spells.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading