Some critical cult fixes (#29251)

* cult fixes

* current
This commit is contained in:
DeityLink
2021-04-16 12:27:23 +02:00
committed by GitHub
parent be6caf13f6
commit 76c7b70700
12 changed files with 44 additions and 32 deletions

View File

@@ -626,7 +626,7 @@ var/global/global_anchor_bloodstone // Keeps track of what stone becomes the anc
var/total_accumulated = 0
var/total_needed = amount_needed
if (!tribute && iscultist(user))
var/datum/role/cultist/mycultist = user.mind.GetRole(CULTIST)
var/datum/role/cultist/mycultist = iscultist(user)
if (mycultist in blood_communion)
communion = 1
amount_needed = max(1,round(amount_needed * 4 / 5))//saving 20% blood
@@ -906,8 +906,20 @@ var/global/global_anchor_bloodstone // Keeps track of what stone becomes the anc
var/list/places_to_spawn = list()
for (var/i = 1 to 4)
for (var/j = 10; j > 0; j--)
var/turf/T = get_turf(pick(range(j*3,locate(map.center_x+j*4*(((round(i/2) % 2) == 0) ? -1 : 1 ),map.center_y+j*4*(((i % 2) == 0) ? -1 : 1 ),map.zMainStation))))
if(!is_type_in_list(T,list(/turf/space,/turf/unsimulated,/turf/simulated/shuttle)))
/*
the value of i governs which corner of the map the bloodstone will try to spawn in.
from 1 to 4, the corners will be selected in this order: North-West, South-East, North-East, South-West
the higher j, the further away from the center of the map will the bloodstone be. it tries 10 times per bloodstone, and searches each time closer to the center
*/
var/coordX = map.center_x+j*4*(((round(i/2) % 2) == 0) ? -1 : 1 )
var/coordY = map.center_y+j*4*(((i % 2) == 0) ? -1 : 1 )
var/turf/T = get_turf(pick(range(j*3,locate(coordX,coordY,map.zMainStation))))
if (!T)
message_admins("Blood Cult: !ERROR! spawn_bloodstones() tried to select a null turf at [map.nameLong]. Debug info: i = [i], j = [j]")
log_admin("Blood Cult: !ERROR! spawn_bloodstones() tried to select a null turf at [map.nameLong]. Debug info: i = [i], j = [j]")
else if(!is_type_in_list(T,list(/turf/space,/turf/unsimulated,/turf/simulated/shuttle)))
//Adding some blacklisted areas, specifically solars
if (!istype(T.loc,/area/solar) && is_type_in_list(T.loc,the_station_areas))
places_to_spawn += T
@@ -923,8 +935,8 @@ var/global/global_anchor_bloodstone // Keeps track of what stone becomes the anc
for(var/obj/structure/cult/bloodstone/B in bloodstone_list)
if (!B.loc)
qdel(B)
message_admins("Blood Cult: A blood stone was somehow spawned in nullspace. It has been destroyed.")
log_admin("Blood Cult: A blood stone was somehow spawned in nullspace. It has been destroyed.")
message_admins("Blood Cult: !ERROR! A blood stone was somehow spawned in nullspace. It has been destroyed.")
log_admin("Blood Cult: !ERROR! A blood stone was somehow spawned in nullspace. It has been destroyed.")
/* prepare_cult_holomap
returns: the initialized cult holomap

View File

@@ -278,8 +278,8 @@
for(var/mob/M in observers)
if(!M.client || isantagbanned(M) || jobban_isbanned(M, CULTIST) || M.client.is_afk())
continue
if (M.mind && M.mind.GetRole(CULTIST))
var/datum/role/cultist/cultist = M.mind.GetRole(CULTIST)
if (iscultist(M))
var/datum/role/cultist/cultist = iscultist(M)
if (cultist.second_chance)
to_chat(M, "[bicon(logo_icon)]<span class='recruit'>\The [user] has planted a Soul Blade on an altar, opening a small crack in the veil that allows you to become the blade's resident shade. (<a href='?src=\ref[src];signup=\ref[M]'>Possess now!</a>)</span>[bicon(logo_icon)]")
return 1
@@ -720,7 +720,7 @@
blade.shade = shadeMob
shadeMob.status_flags |= GODMODE
shadeMob.canmove = 0
var/datum/role/cultist/cultist = M.mind.GetRole(CULTIST)
var/datum/role/cultist/cultist = iscultist(M)
cultist.second_chance = 0
shadeMob.real_name = M.mind.name
shadeMob.name = "[shadeMob.real_name] the Shade"
@@ -921,7 +921,7 @@ var/list/cult_spires = list()
return
var/mob/living/carbon/human/H = user
var/datum/role/cultist/C = H.mind.GetRole(CULTIST)
var/datum/role/cultist/C = iscultist(H)
var/list/available_tattoos = list("tier1","tier2","tier3")
for (var/tattoo in C.tattoos)

View File

@@ -513,7 +513,7 @@
cult.cult_reminders += text
for(var/datum/role/cultist/C in cult.members)
var/datum/mind/M = C.antag
if (M.GetRole(CULTIST))//failsafe for cultist brains put in MMIs
if (iscultist(M.current))//failsafe for cultist brains put in MMIs
to_chat(M.current, "<span class='game say'><b>[user.real_name]</b>'s voice echoes in your head, <B><span class='sinister'>[reminder]</span></span>")
to_chat(M.current, "<span class='notice'>This message will be remembered by all current cultists, and by new converts as well.</span>")
M.store_memory("Cult reminder: [text].")
@@ -528,10 +528,10 @@
if(!message)
return
var/datum/faction/bloodcult = find_active_faction_by_member(activator.mind.GetRole(CULTIST))
var/datum/faction/bloodcult = find_active_faction_by_member(iscultist(activator))
for(var/datum/role/cultist/C in bloodcult.members)
var/datum/mind/M = C.antag
if (M.GetRole(CULTIST))//failsafe for cultist brains put in MMIs
if (iscultist(M.current))//failsafe for cultist brains put in MMIs
to_chat(M.current, "<span class='game say'><b>[activator.real_name]</b>'s voice echoes in your head, <B><span class='sinister'>[message]</span></B></span>")
for(var/mob/dead/observer/O in player_list)
@@ -585,12 +585,12 @@
speaker_name = H.real_name
L = speech.speaker
rendered_message = speech.render_message()
var/datum/faction/bloodcult = find_active_faction_by_member(L.mind.GetRole(CULTIST))
var/datum/faction/bloodcult = find_active_faction_by_member(iscultist(L))
for(var/datum/role/cultist/C in bloodcult.members)
var/datum/mind/M = C.antag
if (M.current == speech.speaker)//echoes are annoying
continue
if (M.GetRole(CULTIST))//failsafe for cultist brains put in MMIs
if (iscultist(M.current))//failsafe for cultist brains put in MMIs
to_chat(M.current, "<span class='game say'><b>[speaker_name]</b>'s voice echoes in your head, <B><span class='sinister'>[speech.message]</span></B></span>")
for(var/mob/dead/observer/O in player_list)
to_chat(O, "<span class='game say'><b>[speaker_name]</b> communicates, <span class='sinister'>[speech.message]</span></span>")
@@ -1145,7 +1145,7 @@
var/obj/item/weapon/handcuffs/cult/restraints = new(victim)
victim.handcuffed = restraints
restraints.on_restraint_apply(victim)//a jolt of pain to slow them down
restraints.gaoler = converter.mind.GetRole(CULTIST)
restraints.gaoler = iscultist(converter)
victim.update_inv_handcuffed() //update handcuff overlays
if (success == CONVERSION_NOCHOICE)
@@ -2093,7 +2093,7 @@ var/list/blind_victims = list()
var/list/possible_targets = list()
var/list/prisoners = list()
var/datum/faction/bloodcult/bloodcult = find_active_faction_by_member(activator.mind.GetRole(CULTIST))
var/datum/faction/bloodcult/bloodcult = find_active_faction_by_member(iscultist(activator))
for(var/datum/role/cultist/C in bloodcult.members)
var/datum/mind/M = C.antag
possible_targets.Add(M.current)

View File

@@ -15,7 +15,7 @@
return
if (!iscultist(src))
return
var/datum/role/cultist/C = mind.GetRole(CULTIST)
var/datum/role/cultist/C = iscultist(src)
for (var/tattoo in C.tattoos)
var/datum/cult_tattoo/CT = C.tattoos[tattoo]
if (CT.name == tattoo_name)
@@ -38,7 +38,7 @@ var/list/blood_communion = list()
/datum/cult_tattoo/bloodpool/getTattoo(var/mob/M)
..()
if (iscultist(M))
blood_communion.Add(M.mind.GetRole(CULTIST))
blood_communion.Add(iscultist(M))
/datum/cult_tattoo/silent
name = TATTOO_SILENT
@@ -54,7 +54,7 @@ var/list/blood_communion = list()
/datum/cult_tattoo/dagger/getTattoo(var/mob/M)
..()
if (M.mind && M.mind.GetRole(CULTIST))
if (iscultist(M))
M.add_spell(new /spell/cult/blood_dagger, "cult_spell_ready", /obj/abstract/screen/movable/spell_master/bloodcult)
@@ -78,7 +78,7 @@ var/list/blood_communion = list()
/datum/cult_tattoo/memorize/getTattoo(var/mob/M)
..()
if (M.mind && M.mind.GetRole(CULTIST))
if (iscultist(M))
M.add_spell(new /spell/cult/arcane_dimension, "cult_spell_ready", /obj/abstract/screen/movable/spell_master/bloodcult)
/datum/cult_tattoo/chat

View File

@@ -1,7 +1,7 @@
/proc/DecidePrayerGod(var/mob/H)
if(!H || !H.mind)
return "a voice"
if(H.mind.GetRole(CULTIST))
if(iscultist(H))
return "Nar-Sie"
else if(H.mind.faith) // The user has a faith
var/datum/religion/R = H.mind.faith

View File

@@ -136,7 +136,7 @@
newCultist.conversion["soulstone"] = user
else
if (iscultist(target))
var/datum/role/cultist = target.mind.GetRole(CULTIST)
var/datum/role/cultist = iscultist(target)
to_chat(target, "<span class='userdanger'>Your new master is NOT a cultist, you are henceforth disconnected from the rest of the cult. You are to follow your new master's commands and help them in their goal.</span>")
cultist.Drop()
target.add_language(LANGUAGE_CULT)//re-adding cult languages, as all shades can speak it
@@ -474,7 +474,7 @@
else
if (iscultist(shadeMob))
var/datum/role/cultist = shadeMob.mind.GetRole(CULTIST)
var/datum/role/cultist = iscultist(shadeMob)
to_chat(shadeMob, "<span class='userdanger'>Your new master is NOT a cultist, you are henceforth disconnected from the rest of the cult. You are to follow your new master's commands and help them in their goal.</span>")
cultist.Drop()
shadeMob.add_language(LANGUAGE_CULT)//re-adding cult languages, as all shades can speak it

View File

@@ -80,7 +80,7 @@
return 1
var/datum/role/cultist/cultist
if(iscultist(M))
cultist = M.mind.GetRole(CULTIST)
cultist = iscultist(M)
if (cultist.deconversion)
to_chat(user,"<span class='warning'>There is already a deconversion attempt undergoing!</span>")
return 1
@@ -265,7 +265,7 @@
var/mob/target
deconvertee.overlays += image('icons/effects/effects.dmi',src,"deconversion")
playsound(deconvertee, 'sound/effects/deconversion_start.ogg', 50, 0, -4)
cultist = deconvertee.mind.GetRole(CULTIST)
cultist = iscultist(deconvertee)
cultist.deconversion = src
deconvertee.eye_blurry = max(deconvertee.eye_blurry, 10)

View File

@@ -425,8 +425,8 @@ var/global/list/damage_icon_parts = list()
O.underlays += "coldfirevox_s"
//Cultist tattoos
if (mind && mind.GetRole(CULTIST))
var/datum/role/cultist/C = mind.GetRole(CULTIST)
if (iscultist(src))
var/datum/role/cultist/C = iscultist(src)
add_image = 1
for (var/T in C.tattoos)
var/datum/cult_tattoo/tattoo = C.tattoos[T]

View File

@@ -77,7 +77,7 @@
/mob/living/simple_animal/construct/construct_chat_check(setting)
if(!mind)
return
if(find_active_faction_by_member(mind.GetRole(CULTIST)))
if(find_active_faction_by_member(iscultist(src)))
return 1
if(find_active_faction_by_member(mind.GetRole(LEGACY_CULTIST)))
return 1

View File

@@ -35,7 +35,7 @@
add_spell(new /spell/soulblade/blade_mend, "cult_spell_ready", /obj/abstract/screen/movable/spell_master/bloodcult)
add_spell(new /spell/soulblade/blade_boil, "cult_spell_ready", /obj/abstract/screen/movable/spell_master/bloodcult)
var/datum/role/cultist/C = mind.GetRole(CULTIST)
var/datum/role/cultist/C = iscultist(src)
if (C)
C.logo_state = "shade-blade"
@@ -54,7 +54,7 @@
for(var/spell/soulblade/spell_to_remove in spell_list)
remove_spell(spell_to_remove)
var/datum/role/cultist/C = mind.GetRole(CULTIST)
var/datum/role/cultist/C = iscultist(src)
if (C)
C.logo_state = "cult-logo"

View File

@@ -489,7 +489,7 @@
else
if((T && T.holy) && isobserver(mob))
var/mob/dead/observer/observer = mob
if(observer.invisibility == 0 || observer.mind && (find_active_faction_by_member(observer.mind.GetRole(LEGACY_CULTIST)) || find_active_faction_by_member(observer.mind.GetRole(CULTIST))))
if(observer.invisibility == 0 || observer.mind && (find_active_faction_by_member(observer.mind.GetRole(LEGACY_CULTIST)) || find_active_faction_by_member(iscultist(observer))))
to_chat(mob, "<span class='warning'>You cannot get past holy grounds while you are in this plane of existence!</span>")
else
mob.forceEnter(get_step(mob, direct))

View File

@@ -78,7 +78,7 @@ var/const/BLOOD_VOLUME_SURVIVE = 122
B.volume += 0.1 // regenerate blood VERY slowly
if(M_REGEN in mutations)
B.volume += 0.4 //A big chunky boost. If you have nutriment and iron you can regenerate 4.1 blood per tick
if (iscultist(src) && (mind.GetRole(CULTIST) in blood_communion))//cultists that take on the blood communion tattoo get a slight blood regen bonus
if (iscultist(src) && (iscultist(src) in blood_communion))//cultists that take on the blood communion tattoo get a slight blood regen bonus
if(M_REGEN in mutations)
B.volume += 0.6
else