Skip to content
This repository was archived by the owner on Dec 23, 2025. It is now read-only.

Commit be52870

Browse files
authored
Merge pull request RonRonstation#231 from imatsoup/potential-wizard-rebalance
Changes to Wizard smite to be less frustrating and round-removey
2 parents a8eaa00 + afd1398 commit be52870

5 files changed

Lines changed: 93 additions & 4 deletions

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
using Content.Shared.Actions;
2+
using Content.Shared.Damage;
3+
4+
namespace Content.Shared.Magic.Events;
5+
6+
public sealed partial class CellularSmiteSpellEvent : EntityTargetActionEvent
7+
{
8+
//<summary>
9+
// Damage that the smite spell will do.
10+
//</summary>
11+
[DataField]
12+
public DamageSpecifier smiteDamage = new();
13+
}

Content.Shared/Magic/SharedMagicSystem.cs

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,23 @@
22
using Content.Shared.Body.Components;
33
using Content.Shared.Body.Systems;
44
using Content.Shared.Coordinates.Helpers;
5+
using Content.Shared.Damage;
6+
using Content.Shared.Damage.Systems;
57
using Content.Shared.Doors.Components;
68
using Content.Shared.Doors.Systems;
79
using Content.Shared.Hands.Components;
810
using Content.Shared.Hands.EntitySystems;
911
using Content.Shared.Interaction;
1012
using Content.Shared.Inventory;
13+
using Content.Shared.Jittering;
1114
using Content.Shared.Lock;
1215
using Content.Shared.Magic.Components;
1316
using Content.Shared.Magic.Events;
1417
using Content.Shared.Maps;
1518
using Content.Shared.Mind;
19+
using Content.Shared.Mobs;
20+
using Content.Shared.Mobs.Components;
21+
using Content.Shared.Mobs.Systems;
1622
using Content.Shared.Physics;
1723
using Content.Shared.Popups;
1824
using Content.Shared.Speech.Muting;
@@ -52,16 +58,19 @@ public abstract class SharedMagicSystem : EntitySystem
5258
[Dependency] private readonly INetManager _net = default!;
5359
[Dependency] private readonly SharedBodySystem _body = default!;
5460
[Dependency] private readonly EntityLookupSystem _lookup = default!;
61+
[Dependency] private readonly DamageableSystem _damageableSystem = default!;
5562
[Dependency] private readonly SharedDoorSystem _door = default!;
5663
[Dependency] private readonly InventorySystem _inventory = default!;
5764
[Dependency] private readonly SharedPopupSystem _popup = default!;
5865
[Dependency] private readonly SharedInteractionSystem _interaction = default!;
66+
[Dependency] private readonly SharedJitteringSystem _jittering = default!;
5967
[Dependency] private readonly LockSystem _lock = default!;
6068
[Dependency] private readonly SharedHandsSystem _hands = default!;
6169
[Dependency] private readonly TagSystem _tag = default!;
6270
[Dependency] private readonly SharedAudioSystem _audio = default!;
6371
[Dependency] private readonly SharedMindSystem _mind = default!;
6472
[Dependency] private readonly SharedStunSystem _stun = default!;
73+
[Dependency] private readonly MobStateSystem _mobStateSystem = default!;
6574

6675
private static readonly ProtoId<TagPrototype> InvalidForGlobalSpawnSpellTag = "InvalidForGlobalSpawnSpell";
6776

@@ -76,6 +85,7 @@ public override void Initialize()
7685
SubscribeLocalEvent<ProjectileSpellEvent>(OnProjectileSpell);
7786
SubscribeLocalEvent<ChangeComponentsSpellEvent>(OnChangeComponentsSpell);
7887
SubscribeLocalEvent<SmiteSpellEvent>(OnSmiteSpell);
88+
SubscribeLocalEvent<CellularSmiteSpellEvent>(OnCellularSmiteSpell);
7989
SubscribeLocalEvent<KnockSpellEvent>(OnKnockSpell);
8090
SubscribeLocalEvent<ChargeSpellEvent>(OnChargeSpell);
8191
SubscribeLocalEvent<RandomGlobalSpawnSpellEvent>(OnRandomGlobalSpawnSpell);
@@ -391,6 +401,31 @@ private void OnSmiteSpell(SmiteSpellEvent ev)
391401
_body.GibBody(ev.Target, true, body);
392402
}
393403

404+
private void OnCellularSmiteSpell(CellularSmiteSpellEvent ev)
405+
{
406+
//Stacking genetic damage on people who are already downed or dead is cringe
407+
if (TryComp<DamageableComponent>(ev.Target, out var damageable) &&
408+
HasComp<MobStateComponent>(ev.Target)){
409+
if(_mobStateSystem.IsCritical(ev.Target))
410+
return;
411+
if(_mobStateSystem.IsDead(ev.Target))
412+
return;
413+
}
414+
if (ev.Handled || !PassesSpellPrerequisites(ev.Action, ev.Performer))
415+
return;
416+
417+
ev.Handled = true;
418+
419+
// Given that this was intended to blow gibs everywhere, not suitable for this version of the spell (gets people stuck in walls)
420+
// var direction = _transform.GetMapCoordinates(ev.Target, Transform(ev.Target)).Position - _transform.GetMapCoordinates(ev.Performer, Transform(ev.Performer)).Position;
421+
// var impulseVector = direction * 5000;
422+
423+
//_physics.ApplyLinearImpulse(ev.Target, impulseVector);
424+
425+
_jittering.DoJitter(ev.Target, TimeSpan.FromSeconds(1f), false, 80f, 8f, true);
426+
_damageableSystem.TryChangeDamage(ev.Target, ev.smiteDamage, true);
427+
}
428+
394429
// End Touch Spells
395430
#endregion
396431
#region Knock Spells

Resources/Locale/en-US/store/spellbook-catalog.ftl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ spellbook-animate-description = Bring an inanimate object to life!
4141
spellbook-smite-name = Smite
4242
spellbook-smite-desc = Don't like them? EXPLODE them into giblets! Requires Wizard Robe & Hat.
4343
44+
spellbook-cellular-smite-name = Smite
45+
spellbook-cellular-smite-desc = Don't like them? Smite em! Requires Wizard Robe & Hat.
46+
4447
spellbook-cluwne-name = Cluwne's Curse
4548
spellbook-cluwne-desc = For when you really hate someone and Smite isn't enough. Requires Wizard Robe & Hat.
4649

Resources/Prototypes/Catalog/spellbook_catalog.yml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,24 @@
2626
- !type:ListingLimitedStockCondition
2727
stock: 1
2828

29+
# - type: listing
30+
# id: SpellbookSmite
31+
# name: spellbook-smite-name
32+
# description: spellbook-smite-desc
33+
# productAction: ActionSmite
34+
# cost:
35+
# WizCoin: 3
36+
# categories:
37+
# - SpellbookOffensive
38+
# conditions:
39+
# - !type:ListingLimitedStockCondition
40+
# stock: 1
41+
2942
- type: listing
30-
id: SpellbookSmite
31-
name: spellbook-smite-name
32-
description: spellbook-smite-desc
33-
productAction: ActionSmite
43+
id: SpellbookCellularSmite
44+
name: spellbook-cellular-smite-name
45+
description: spellbook-cellular-smite-desc
46+
productAction: ActionCellularSmite
3447
cost:
3548
WizCoin: 3
3649
categories:

Resources/Prototypes/Magic/touch_spells.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,31 @@
4242
- type: Magic
4343
requiresClothes: true
4444

45+
# Non-Gibbing version of the Smite spell for wizards
46+
- type: entity
47+
id: ActionCellularSmite
48+
name: Smite
49+
description: Puts a target into critical condition
50+
components:
51+
- type: EntityTargetAction
52+
useDelay: 90
53+
itemIconStyle: BigAction
54+
canTargetSelf: false
55+
interactOnMiss: false
56+
sound: !type:SoundPathSpecifier
57+
path: /Audio/Magic/disintegrate.ogg
58+
icon:
59+
sprite: Objects/Magic/magicactions.rsi
60+
state: gib
61+
event: !type:CellularSmiteSpellEvent
62+
smiteDamage:
63+
types:
64+
Cellular: 125
65+
- type: SpeakOnAction
66+
sentence: action-speech-spell-smite
67+
- type: Magic
68+
requiresClothes: true
69+
4570
# For the Snail
4671
- type: entity
4772
parent: ActionSmite

0 commit comments

Comments
 (0)