Skip to content

Commit 384e41a

Browse files
Fix smite ignoring antimagic, also tell the caster what the smite was (#5390)
## About The Pull Request Fixes #5360 this makes it so smite will fail if the target has antimagic (either normal antimagic, or holy antimagic) also makes it so the caster which smite was used. ## Why It's Good For The Game bugfix, and just a minor qol so it doesn't seem like nothing happened with certain smites. ## Changelog :cl: fix: Smite (the spell) is now properly blocked by antimagic. qol: Smite now tells the caster which smite was inflicted. /:cl: --------- Co-authored-by: MichiRecRoom <[email protected]>
1 parent 36c869e commit 384e41a

File tree

1 file changed

+9
-2
lines changed
  • monkestation/code/modules/spells/spell_types/pointed

1 file changed

+9
-2
lines changed

monkestation/code/modules/spells/spell_types/pointed/smite.dm

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
cooldown_time = 40 SECONDS
1212
cooldown_reduction_per_rank = 5 SECONDS
1313
cast_range = 2
14+
antimagic_flags = MAGIC_RESISTANCE|MAGIC_RESISTANCE_HOLY // the gods have mercy upon the holy
1415

1516
invocation = "EI NATH!!"
1617

@@ -34,8 +35,13 @@
3435
return FALSE
3536
return TRUE
3637

37-
/datum/action/cooldown/spell/pointed/smite/cast(atom/cast_on)
38+
/datum/action/cooldown/spell/pointed/smite/cast(mob/living/carbon/cast_on)
3839
. = ..()
40+
if(cast_on.can_block_magic(antimagic_flags))
41+
to_chat(cast_on, span_notice("You feel as if the gods have granted you mercy."))
42+
to_chat(owner, span_warning("The spell had no effect!"))
43+
return FALSE
44+
3945
smite_type = forced_smite_type
4046
if(!smite_type)
4147
if(prob(70))
@@ -68,11 +74,12 @@
6874
else
6975
picked_smite = new picked_smite
7076
do_smite(picked_smite, cast_on)
77+
to_chat(owner, span_notice("You call down a strike from the heavens upon [cast_on], resulting in [picked_smite.name]!"))
7178

7279
/datum/action/cooldown/spell/pointed/smite/after_cast(atom/cast_on)
7380
. = ..()
7481
if(smite_type == LIGHT_SMITE) //these should give a lower cooldown as they dont do as much
75-
next_use_time -= cooldown_time/2
82+
next_use_time -= cooldown_time / 2
7683
smite_type = null
7784

7885
/datum/action/cooldown/spell/pointed/smite/proc/do_smite(datum/smite/real_smite, mob/living/carbon/target)

0 commit comments

Comments
 (0)