Skip to content

Commit

Permalink
Fixed some heretic spells restarting the cooldown even though they fa…
Browse files Browse the repository at this point in the history
…iled (#10139)

* Fixes up some heretic spells

* Add requested comment
  • Loading branch information
Absolucy authored Nov 8, 2023
1 parent 7cec1ce commit d8eda2b
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 28 deletions.
4 changes: 3 additions & 1 deletion code/modules/antagonists/heretic/magic/blood_cleave.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@
range = 9

/obj/effect/proc_holder/spell/pointed/cleave/cast(list/targets, mob/user)
if(!targets.len)
if(!length(targets))
revert_cast()
user.balloon_alert(user, "No targets")
return FALSE
if(!can_target(targets[1], user))
revert_cast()
return FALSE

for(var/mob/living/carbon/human/nearby_human in range(1, targets[1]))
Expand Down
36 changes: 19 additions & 17 deletions code/modules/antagonists/heretic/magic/blood_siphon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,35 +10,37 @@
clothes_req = FALSE
range = 9

/obj/effect/proc_holder/spell/pointed/blood_siphon/cast(list/targets, mob/user)
if(!isliving(user))
/obj/effect/proc_holder/spell/pointed/blood_siphon/cast(list/targets, mob/living/user)
if(!istype(user))
revert_cast()
return

var/mob/living/real_target = targets[1]
var/mob/living/living_user = user
playsound(user, 'sound/magic/demon_attack1.ogg', 75, TRUE)
if(real_target.anti_magic_check())
var/mob/living/target = targets[1]
if(!istype(target))
user.balloon_alert(user, "Invalid target")
return
playsound(user, 'sound/magic/demon_attack1.ogg', vol = 75, vary = TRUE)
if(target.anti_magic_check())
user.balloon_alert(user, "Spell blocked")
real_target.visible_message(
"<span class='danger'>The spell bounces off of [real_target]!</span>",
target.visible_message(
"<span class='danger'>The spell bounces off of [target]!</span>",
"<span class='danger'>The spell bounces off of you!</span>",
)
return

real_target.visible_message(
"<span class='danger'>[real_target] turns pale as a red glow envelops [real_target.p_them()]!</span>",
target.visible_message(
"<span class='danger'>[target] turns pale as a red glow envelops [target.p_them()]!</span>",
"<span class='danger'>You turn pale as a red glow enevelops you!</span>",
)

real_target.adjustBruteLoss(20)
living_user.adjustBruteLoss(-20)
target.take_overall_damage(brute = 20)
user.heal_overall_damage(brute = 20)

if(!living_user.blood_volume)
if(!user.blood_volume)
return

real_target.blood_volume -= 20
if(living_user.blood_volume < BLOOD_VOLUME_MAXIMUM) // we dont want to explode from casting
living_user.blood_volume += 20
target.blood_volume -= 20
if(user.blood_volume < BLOOD_VOLUME_MAXIMUM) // we dont want to explode from casting
user.blood_volume += 20

/obj/effect/proc_holder/spell/pointed/blood_siphon/can_target(atom/target, mob/user, silent)
if(!isliving(target))
Expand Down
2 changes: 2 additions & 0 deletions code/modules/antagonists/heretic/magic/manse_link.dm
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@
to_chat(originator, "<span class='notice'>You begin linking [target]'s mind to yours...</span>")
to_chat(target, "<span class='warning'>You feel your mind being pulled... connected... intertwined with the very fabric of reality...</span>")
if(!do_after(originator, 6 SECONDS, target = target))
revert_cast()
return
if(!originator.link_mob(target))
revert_cast()
to_chat(originator, "<span class='warning'>You can't seem to link [target]'s mind...</span>")
to_chat(target, "<span class='warning'>The foreign presence leaves your mind.</span>")
return
Expand Down
23 changes: 13 additions & 10 deletions code/modules/antagonists/heretic/magic/nightwatcher_rebirth.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@
action_icon = 'icons/mob/actions/actions_ecult.dmi'
action_icon_state = "smoke"

/obj/effect/proc_holder/spell/targeted/fiery_rebirth/cast(list/targets, mob/user)
if(!ishuman(user))
/obj/effect/proc_holder/spell/targeted/fiery_rebirth/cast(list/targets, mob/living/carbon/human/user)
if(!istype(user))
revert_cast()
return
var/mob/living/carbon/human/human_user = user
human_user.ExtinguishMob()
var/did_something = user.on_fire // This might be a false negative if the user has items on fire but they themselves are not.
user.ExtinguishMob()

for(var/mob/living/carbon/target in view(7, user))
if(!target.mind || !target.client || target.stat == DEAD || !target.on_fire || IS_HERETIC_OR_MONSTER(target))
Expand All @@ -27,13 +28,15 @@
target.investigate_log("has been killed by fiery rebirth.", INVESTIGATE_DEATHS)
target.death()

target.adjustFireLoss(20)
target.take_overall_damage(burn = 20)
new /obj/effect/temp_visual/eldritch_smoke(target.drop_location())
human_user.adjustBruteLoss(-10, FALSE)
human_user.adjustFireLoss(-10, FALSE)
human_user.adjustToxLoss(-10, FALSE)
human_user.adjustOxyLoss(-10, FALSE)
human_user.adjustStaminaLoss(-10)
user.heal_overall_damage(brute = 10, burn = 10, stamina = 10, updating_health = FALSE)
user.adjustToxLoss(-10, updating_health = FALSE, forced = TRUE)
user.adjustOxyLoss(-10)
did_something = TRUE

if(!did_something)
revert_cast()

/obj/effect/temp_visual/eldritch_smoke
icon = 'icons/effects/heretic.dmi'
Expand Down

0 comments on commit d8eda2b

Please sign in to comment.