diff --git a/code/game/gamemodes/cult/runes.dm b/code/game/gamemodes/cult/runes.dm
index ff7e5a9090..44ac937f71 100644
--- a/code/game/gamemodes/cult/runes.dm
+++ b/code/game/gamemodes/cult/runes.dm
@@ -35,6 +35,7 @@ To draw a rune, use an arcane tome.
var/scribe_damage = 0.1 //how much damage you take doing it
var/allow_excess_invokers = FALSE //if we allow excess invokers when being invoked
+ var/invoke_damage = 0 //how much damage invokers take when invoking it
var/construct_invoke = TRUE //if constructs can invoke it
var/req_keyword = 0 //If the rune requires a keyword - go figure amirite
@@ -133,10 +134,13 @@ structure_check() searches for nearby cultist structures required for the invoca
/obj/effect/rune/proc/invoke(var/list/invokers)
//This proc contains the effects of the rune as well as things that happen afterwards. If you want it to spawn an object and then delete itself, have both here.
- if(invocation)
- for(var/M in invokers)
- var/mob/living/L = M
+ for(var/M in invokers)
+ var/mob/living/L = M
+ if(invocation)
L.say(invocation, language = /datum/language/common)
+ if(invoke_damage)
+ L.apply_damage(invoke_damage, BRUTE)
+ to_chat(L, "[src] saps your strength!")
do_invoke_glow()
/obj/effect/rune/proc/do_invoke_glow()
@@ -159,6 +163,7 @@ structure_check() searches for nearby cultist structures required for the invoca
cultist_name = "malformed rune"
cultist_desc = "a senseless rune written in gibberish. No good can come from invoking this."
invocation = "Ra'sha yoka!"
+ invoke_damage = 30
/obj/effect/rune/malformed/Initialize(mapload, set_keyword)
. = ..()
@@ -167,10 +172,6 @@ structure_check() searches for nearby cultist structures required for the invoca
/obj/effect/rune/malformed/invoke(var/list/invokers)
..()
- for(var/M in invokers)
- var/mob/living/L = M
- to_chat(L, "You feel your life force draining. The Geometer is displeased.")
- L.apply_damage(30, BRUTE)
qdel(src)
/mob/proc/null_rod_check() //The null rod, if equipped, will protect the holder from the effects of most runes
@@ -508,9 +509,7 @@ structure_check() searches for nearby cultist structures required for the invoca
/obj/effect/rune/raise_dead/examine(mob/user)
..()
if(iscultist(user) || user.stat == DEAD)
- var/revive_number = 0
- if(GLOB.sacrificed.len)
- revive_number = GLOB.sacrificed.len - revives_used
+ var/revive_number = LAZYLEN(GLOB.sacrificed) - revives_used
to_chat(user, "Revives Remaining: [revive_number]")
/obj/effect/rune/raise_dead/invoke(var/list/invokers)
@@ -520,6 +519,7 @@ structure_check() searches for nearby cultist structures required for the invoca
var/mob/living/user = invokers[1]
if(rune_in_use)
return
+ rune_in_use = TRUE
for(var/mob/living/M in T.contents)
if(iscultist(M) && M.stat == DEAD)
potential_revive_mobs |= M
@@ -527,18 +527,20 @@ structure_check() searches for nearby cultist structures required for the invoca
to_chat(user, "There are no dead cultists on the rune!")
log_game("Raise Dead rune failed - no corpses to revive")
fail_invoke()
+ rune_in_use = FALSE
return
- if(!GLOB.sacrificed.len || GLOB.sacrificed.len <= revives_used)
+ if(LAZYLEN(GLOB.sacrificed) <= revives_used)
to_chat(user, "You have sacrificed too few people to revive a cultist!")
fail_invoke()
+ rune_in_use = FALSE
return
if(potential_revive_mobs.len > 1)
mob_to_revive = input(user, "Choose a cultist to revive.", "Cultist to Revive") as null|anything in potential_revive_mobs
else
mob_to_revive = potential_revive_mobs[1]
if(!src || QDELETED(src) || rune_in_use || !validness_checks(mob_to_revive, user))
+ rune_in_use = FALSE
return
- rune_in_use = 1
if(user.name == "Herbert West")
invocation = "To life, to life, I bring them!"
else
@@ -550,34 +552,34 @@ structure_check() searches for nearby cultist structures required for the invoca
to_chat(mob_to_revive, "\"PASNAR SAVRAE YAM'TOTH. Arise.\"")
mob_to_revive.visible_message("[mob_to_revive] draws in a huge breath, red light shining from [mob_to_revive.p_their()] eyes.", \
"You awaken suddenly from the void. You're alive!")
- rune_in_use = 0
+ rune_in_use = FALSE
/obj/effect/rune/raise_dead/proc/validness_checks(mob/living/target_mob, mob/living/user)
var/turf/T = get_turf(src)
- if(!user)
- return 0
+ if(QDELETED(user))
+ return FALSE
if(!Adjacent(user) || user.incapacitated())
- return 0
- if(!target_mob)
+ return FALSE
+ if(QDELETED(target_mob))
fail_invoke()
- return 0
+ return FALSE
if(!(target_mob in T.contents))
to_chat(user, "The cultist to revive has been moved!")
fail_invoke()
log_game("Raise Dead rune failed - revival target moved")
- return 0
+ return FALSE
var/mob/dead/observer/ghost = target_mob.get_ghost(TRUE)
if(!ghost && (!target_mob.mind || !target_mob.mind.active))
to_chat(user, "The corpse to revive has no spirit!")
fail_invoke()
log_game("Raise Dead rune failed - revival target has no ghost")
- return 0
+ return FALSE
if(!GLOB.sacrificed.len || GLOB.sacrificed.len <= revives_used)
to_chat(user, "You have sacrificed too few people to revive a cultist!")
fail_invoke()
log_game("Raise Dead rune failed - too few sacrificed")
- return 0
- return 1
+ return FALSE
+ return TRUE
/obj/effect/rune/raise_dead/fail_invoke()
..()
@@ -592,7 +594,7 @@ structure_check() searches for nearby cultist structures required for the invoca
cultist_desc = "emits a large electromagnetic pulse, increasing in size for each cultist invoking it, hindering electronics and disabling silicons."
invocation = "Ta'gh fara'qha fel d'amar det!"
icon_state = "5"
- allow_excess_invokers = 1
+ allow_excess_invokers = TRUE
color = RUNE_COLOR_EMP
/obj/effect/rune/emp/invoke(var/list/invokers)
@@ -624,10 +626,14 @@ structure_check() searches for nearby cultist structures required for the invoca
invocation = "Fwe'sh mah erl nyag r'ya!"
icon_state = "7"
color = RUNE_COLOR_DARKRED
- rune_in_use = 0 //One at a time, please!
- construct_invoke = 0
+ rune_in_use = FALSE //One at a time, please!
+ construct_invoke = FALSE
var/mob/living/affecting = null
+/obj/effect/rune/spirit/Destroy()
+ affecting = null
+ return ..()
+
/obj/effect/rune/spirit/examine(mob/user)
..()
if(affecting)
@@ -651,41 +657,33 @@ structure_check() searches for nearby cultist structures required for the invoca
var/turf/T = get_turf(src)
rune_in_use = TRUE
affecting = user
- user.add_atom_colour(RUNE_COLOR_DARKRED, ADMIN_COLOUR_PRIORITY)
- user.visible_message("[user] freezes statue-still, glowing an unearthly red.", \
+ affecting.add_atom_colour(RUNE_COLOR_DARKRED, ADMIN_COLOUR_PRIORITY)
+ affecting.visible_message("[affecting] freezes statue-still, glowing an unearthly red.", \
"You see what lies beyond. All is revealed. While this is a wondrous experience, your physical form will waste away in this state. Hurry...")
- user.ghostize(1)
- while(user)
- if(!affecting)
- visible_message("[src] pulses gently before falling dark.")
- affecting = null //In case it's assigned to a number or something
- rune_in_use = FALSE
- return
+ affecting.ghostize(1)
+ while(!QDELETED(affecting))
affecting.apply_damage(0.1, BRUTE)
- if(!(user in T))
- user.visible_message("A spectral tendril wraps around [user] and pulls [user.p_them()] back to the rune!")
- Beam(user,icon_state="drainbeam",time=2)
- user.forceMove(get_turf(src)) //NO ESCAPE :^)
- if(user.key)
- user.visible_message("[user] slowly relaxes, the glow around [user.p_them()] dimming.", \
+ if(!(affecting in T))
+ user.visible_message("A spectral tendril wraps around [affecting] and pulls [affecting.p_them()] back to the rune!")
+ Beam(affecting, icon_state="drainbeam", time=2)
+ affecting.forceMove(get_turf(src)) //NO ESCAPE :^)
+ if(affecting.key)
+ affecting.visible_message("[affecting] slowly relaxes, the glow around [affecting.p_them()] dimming.", \
"You are re-united with your physical form. [src] releases its hold over you.")
- user.remove_atom_colour(ADMIN_COLOUR_PRIORITY, RUNE_COLOR_DARKRED)
- user.Weaken(3)
- rune_in_use = FALSE
- affecting = null
- return
- if(user.stat == UNCONSCIOUS)
+ affecting.remove_atom_colour(ADMIN_COLOUR_PRIORITY, RUNE_COLOR_DARKRED)
+ affecting.Weaken(3)
+ break
+ if(affecting.stat == UNCONSCIOUS)
if(prob(1))
- var/mob/dead/observer/G = user.get_ghost()
+ var/mob/dead/observer/G = affecting.get_ghost()
to_chat(G, "You feel the link between you and your body weakening... you must hurry!")
- if(user.stat == DEAD)
- user.remove_atom_colour(ADMIN_COLOUR_PRIORITY, RUNE_COLOR_DARKRED)
- rune_in_use = FALSE
- affecting = null
- var/mob/dead/observer/G = user.get_ghost()
+ else if(affecting.stat == DEAD)
+ affecting.remove_atom_colour(ADMIN_COLOUR_PRIORITY, RUNE_COLOR_DARKRED)
+ var/mob/dead/observer/G = affecting.get_ghost()
to_chat(G, "You suddenly feel your physical form pass on. [src]'s exertion has killed you!")
- return
+ break
sleep(1)
+ affecting = null
rune_in_use = FALSE
//Rite of the Corporeal Shield: When invoked, becomes solid and cannot be passed. Invoke again to undo.
@@ -726,9 +724,10 @@ structure_check() searches for nearby cultist structures required for the invoca
update_state()
if(density)
spread_density()
- user.visible_message("[user] [iscarbon(user) ? "places [user.p_their()] hands on":"stares intently at"] [src], and [density ? "the air above it begins to shimmer" : "the shimmer above it fades"].", \
- "You channel your life energy into [src], [density ? "temporarily preventing" : "allowing"] passage above it.")
- if(iscarbon(user))
+ var/carbon_user = iscarbon(user)
+ user.visible_message("[user] [carbon_user ? "places [user.p_their()] hands on":"stares intently at"] [src], and [density ? "the air above it begins to shimmer" : "the shimmer above it fades"].", \
+ "You channel [carbon_user ? "your life ":""]energy into [src], [density ? "temporarily preventing" : "allowing"] passage above it.")
+ if(carbon_user)
var/mob/living/carbon/C = user
C.apply_damage(2, BRUTE, pick("l_arm", "r_arm"))
@@ -775,7 +774,7 @@ structure_check() searches for nearby cultist structures required for the invoca
cultist_desc = "summons a single cultist to the rune. Requires 2 invokers."
invocation = "N'ath reth sh'yro eth d'rekkathnor!"
req_cultists = 2
- allow_excess_invokers = 1
+ invoke_damage = 10
icon_state = "5"
color = RUNE_COLOR_SUMMON
@@ -812,7 +811,6 @@ structure_check() searches for nearby cultist structures required for the invoca
"Overwhelming vertigo consumes you as you are hurled through the air!")
..()
visible_message("A foggy shape materializes atop [src] and solidifes into [cultist_to_summon]!")
- user.apply_damage(10, BRUTE, "head")
cultist_to_summon.forceMove(get_turf(src))
qdel(src)
@@ -825,7 +823,8 @@ structure_check() searches for nearby cultist structures required for the invoca
color = RUNE_COLOR_MEDIUMRED
light_color = LIGHT_COLOR_LAVA
req_cultists = 3
- construct_invoke = 0
+ invoke_damage = 10
+ construct_invoke = FALSE
var/tick_damage = 25
rune_in_use = FALSE
@@ -839,12 +838,8 @@ structure_check() searches for nearby cultist structures required for the invoca
rune_in_use = TRUE
var/turf/T = get_turf(src)
visible_message("[src] turns a bright, glowing orange!")
- set_light(6)
color = "#FC9B54"
- for(var/M in invokers)
- var/mob/living/L = M
- L.apply_damage(10, BRUTE, pick("l_arm", "r_arm"))
- to_chat(L, "[src] saps your strength!")
+ set_light(6, 1, color)
for(var/mob/living/L in viewers(T))
if(!iscultist(L) && L.blood_volume)
var/obj/item/weapon/nullrod/N = L.null_rod_check()
@@ -856,23 +851,24 @@ structure_check() searches for nearby cultist structures required for the invoca
to_chat(L, "You feel an unholy darkness dimming the Justiciar's light!")
animate(src, color = "#FCB56D", time = 4)
sleep(4)
- if(!src)
+ if(QDELETED(src))
return
do_area_burn(T, 0.5)
animate(src, color = "#FFDF80", time = 5)
sleep(5)
- if(!src)
+ if(QDELETED(src))
return
do_area_burn(T, 1)
animate(src, color = "#FFFDF4", time = 6)
sleep(6)
- if(!src)
+ if(QDELETED(src))
return
do_area_burn(T, 1.5)
new /obj/effect/hotspot(T)
qdel(src)
/obj/effect/rune/blood_boil/proc/do_area_burn(turf/T, multiplier)
+ set_light(6, 1, color)
for(var/mob/living/L in viewers(T))
if(!iscultist(L) && L.blood_volume)
var/obj/item/weapon/nullrod/N = L.null_rod_check()
@@ -888,7 +884,8 @@ structure_check() searches for nearby cultist structures required for the invoca
cultist_desc = "manifests a spirit as a servant of the Geometer. The invoker must not move from atop the rune, and will take damage for each summoned spirit."
invocation = "Gal'h'rfikk harfrandid mud'gib!" //how the fuck do you pronounce this
icon_state = "6"
- construct_invoke = 0
+ invoke_damage = 10
+ construct_invoke = FALSE
color = RUNE_COLOR_MEDIUMRED
var/ghost_limit = 5
var/ghosts = 0
@@ -939,7 +936,6 @@ structure_check() searches for nearby cultist structures required for the invoca
..()
ghosts++
playsound(src, 'sound/magic/exit_blood.ogg', 50, 1)
- user.apply_damage(10, BRUTE)
visible_message("A cloud of red mist forms above [src], and from within steps... a [new_human.gender == FEMALE ? "wo":""]man.")
to_chat(user, "Your blood begins flowing into [src]. You must remain in place and conscious to maintain the forms of those summoned. This will hurt you slowly but surely...")
var/turf/T = get_turf(src)