From 1471ba727c34f39694158ba4f78dac465321c91d Mon Sep 17 00:00:00 2001 From: Cydia Date: Sat, 6 May 2023 19:41:41 +0300 Subject: [PATCH 1/5] main --- code/datums/components/religious_tool.dm | 6 ++++-- code/game/turfs/turf.dm | 8 ++++++++ code/modules/religion/rites.dm | 3 +-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/code/datums/components/religious_tool.dm b/code/datums/components/religious_tool.dm index 2fefd4978aceb..feacd3060d094 100644 --- a/code/datums/components/religious_tool.dm +++ b/code/datums/components/religious_tool.dm @@ -54,8 +54,7 @@ /datum/component/religious_tool/proc/AttemptActions(datum/source, obj/item/the_item, mob/living/user) SIGNAL_HANDLER var/turf/T = get_turf(parent) - var/area/A = T.loc - if(!istype(A, /area/chapel)) + if(!T.is_holy()) to_chat(user, "The [source] can only function in a holy area!") return COMPONENT_NO_AFTERATTACK @@ -242,6 +241,9 @@ if(!can_i_see) return examine_list += ("Use a bible to interact with this.") + if(user.mind?.holy_role != NONE) + var/obj/structure/altar_of_gods/altar = parent + examine_list +=("You can tap this with your holy tool to [altar.anchored ? "un" : ""]anchor it.") if(!easy_access_sect) if(operation_flags & RELIGION_TOOL_SECTSELECT) examine_list += ("This looks like it can be used to select a sect.") diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index caf04ca25f60e..f008c54e25ecc 100644 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -733,3 +733,11 @@ GLOBAL_LIST_EMPTY(created_baseturf_lists) if(turf_to_check.density || LinkBlockedWithAccess(turf_to_check, caller, ID)) continue . += turf_to_check + +/// Checks if the turf was blessed with holy water OR the area its in is Chapel +/turf/proc/is_holy() + if(locate(/obj/effect/blessing) in src) + return TRUE + if(istype(loc, /area/chapel)) + return TRUE + return FALSE diff --git a/code/modules/religion/rites.dm b/code/modules/religion/rites.dm index b251c0adfbf54..2bd1af94234ef 100644 --- a/code/modules/religion/rites.dm +++ b/code/modules/religion/rites.dm @@ -36,8 +36,7 @@ if(!can_afford(user)) return FALSE var/turf/T = get_turf(religious_tool) - var/area/A = T.loc - if(!istype(A, /area/chapel)) + if(!T.is_holy()) to_chat(user, "The altar can only function in a holy area!") return FALSE if(!GLOB.religious_sect.altar_anchored) From 3b4a9214f960701fbdbfdd06f8c7c3d30225d437 Mon Sep 17 00:00:00 2001 From: Cydia Date: Sat, 6 May 2023 19:43:31 +0300 Subject: [PATCH 2/5] text_adjustment --- code/datums/components/religious_tool.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/datums/components/religious_tool.dm b/code/datums/components/religious_tool.dm index feacd3060d094..1498c01bf4848 100644 --- a/code/datums/components/religious_tool.dm +++ b/code/datums/components/religious_tool.dm @@ -243,7 +243,7 @@ examine_list += ("Use a bible to interact with this.") if(user.mind?.holy_role != NONE) var/obj/structure/altar_of_gods/altar = parent - examine_list +=("You can tap this with your holy tool to [altar.anchored ? "un" : ""]anchor it.") + examine_list +=("You can tap this with your holy weapon to [altar.anchored ? "un" : ""]anchor it.") if(!easy_access_sect) if(operation_flags & RELIGION_TOOL_SECTSELECT) examine_list += ("This looks like it can be used to select a sect.") From c35f1c672dec70a2b9aa6facbae2cf79a225d9b1 Mon Sep 17 00:00:00 2001 From: Cydia Date: Wed, 17 May 2023 15:17:30 +0300 Subject: [PATCH 3/5] repathing-and-re-coding --- code/controllers/subsystem/explosion.dm | 2 +- code/game/alternate_appearance.dm | 2 +- code/game/objects/empulse.dm | 2 +- code/modules/antagonists/cult/cult_items.dm | 2 +- code/modules/antagonists/revenant/revenant.dm | 2 +- code/modules/antagonists/revenant/revenant_abilities.dm | 2 +- code/modules/mob/mob_movement.dm | 4 ++-- code/modules/spells/spell_types/ethereal_jaunt.dm | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/code/controllers/subsystem/explosion.dm b/code/controllers/subsystem/explosion.dm index 54953b7317003..9e55d5f8b9dc8 100644 --- a/code/controllers/subsystem/explosion.dm +++ b/code/controllers/subsystem/explosion.dm @@ -323,7 +323,7 @@ SUBSYSTEM_DEF(explosions) var/dist = init_dist //Phew, that was a close one. - if(holy && (locate(/obj/effect/blessing) in T)) + if(holy && T.is_holy()) continue if(reactionary) diff --git a/code/game/alternate_appearance.dm b/code/game/alternate_appearance.dm index 3cb40e62637f7..af9d9d195ef8a 100644 --- a/code/game/alternate_appearance.dm +++ b/code/game/alternate_appearance.dm @@ -170,7 +170,7 @@ GLOBAL_LIST_EMPTY(active_alternate_appearances) add_hud_to(mob) /datum/atom_hud/alternate_appearance/basic/blessedAware/mobShouldSee(mob/M) - if(M.mind && (M.mind.assigned_role == JOB_NAME_CHAPLAIN)) + if(M.mind && M.mind?.holy_role) return TRUE if (istype(M, /mob/living/simple_animal/hostile/construct/wraith)) return TRUE diff --git a/code/game/objects/empulse.dm b/code/game/objects/empulse.dm index 8ccf568bc54ad..242c2acbc863e 100644 --- a/code/game/objects/empulse.dm +++ b/code/game/objects/empulse.dm @@ -19,7 +19,7 @@ for(var/turf/T as() in spiral_range_turfs(light_range, epicenter)) //Blessing protects from holy EMPS - if(holy && (locate(/obj/effect/blessing) in T)) + if(holy && T.is_holy()) continue for(var/atom/A as() in T) //Magic check. diff --git a/code/modules/antagonists/cult/cult_items.dm b/code/modules/antagonists/cult/cult_items.dm index a54d75090ed4b..359cc7144cf8c 100644 --- a/code/modules/antagonists/cult/cult_items.dm +++ b/code/modules/antagonists/cult/cult_items.dm @@ -865,7 +865,7 @@ Striking a noncultist, however, will tear their flesh."} new /obj/effect/temp_visual/dir_setting/cult/phase(user.loc, user.dir) var/turf/temp_target = get_turf_in_angle(set_angle, targets_from, 40) for(var/turf/T in getline(targets_from,temp_target)) - if (locate(/obj/effect/blessing, T)) + if (T.is_holy()) temp_target = T playsound(T, 'sound/machines/clockcult/ark_damage.ogg', 50, 1) new /obj/effect/temp_visual/at_shield(T, T) diff --git a/code/modules/antagonists/revenant/revenant.dm b/code/modules/antagonists/revenant/revenant.dm index f069ed6498d0a..d51d85d3616a0 100644 --- a/code/modules/antagonists/revenant/revenant.dm +++ b/code/modules/antagonists/revenant/revenant.dm @@ -432,7 +432,7 @@ if(stepTurf.flags_1 & NOJAUNT_1) to_chat(src, "Some strange aura is blocking the way.") return - if(locate(/obj/effect/blessing) in stepTurf) + if(stepTurf.is_holy()) to_chat(src, "Holy energies block your path!") return return TRUE diff --git a/code/modules/antagonists/revenant/revenant_abilities.dm b/code/modules/antagonists/revenant/revenant_abilities.dm index e7336367ebbe3..9d134e90bd252 100644 --- a/code/modules/antagonists/revenant/revenant_abilities.dm +++ b/code/modules/antagonists/revenant/revenant_abilities.dm @@ -157,7 +157,7 @@ if(stepTurf.flags_1 & NOJAUNT_1) to_chat(user, "Some strange aura blocks your way to spirit realm.") return - if(locate(/obj/effect/blessing) in stepTurf) + if(stepTurf.is_holy()) to_chat(user, "Holy energies block your way to spirit realm!") return revenant.phase_shift() diff --git a/code/modules/mob/mob_movement.dm b/code/modules/mob/mob_movement.dm index a8ad3206c2c0f..94fa8d9360b58 100644 --- a/code/modules/mob/mob_movement.dm +++ b/code/modules/mob/mob_movement.dm @@ -257,7 +257,7 @@ if(stepTurf.flags_1 & NOJAUNT_1) to_chat(L, "Some strange aura is blocking the way.") return - if(locate(/obj/effect/blessing) in stepTurf) + if(stepTurf.is_holy()) to_chat(L, "Holy energies block your path!") return L.forceMove(stepTurf) @@ -277,7 +277,7 @@ if(!is_reebe(loccheck.z)) to_chat(L, "Some strange aura is blocking the way.") return - if(locate(/obj/effect/blessing) in stepTurf) + if(stepTurf.is_holy()) to_chat(L, "Holy energies block your path!") return L.forceMove(stepTurf) diff --git a/code/modules/spells/spell_types/ethereal_jaunt.dm b/code/modules/spells/spell_types/ethereal_jaunt.dm index e9a2c015f7742..6bb41715c36ef 100644 --- a/code/modules/spells/spell_types/ethereal_jaunt.dm +++ b/code/modules/spells/spell_types/ethereal_jaunt.dm @@ -100,7 +100,7 @@ if(newLoc.flags_1 & NOJAUNT_1) to_chat(user, "Some strange aura is blocking the way.") return - if (locate(/obj/effect/blessing, newLoc)) + if (newLoc.is_holy()) to_chat(user, "Holy energies block your path!") return From 78e3b11b3a0e5e529e50b63970b784b4a36c0569 Mon Sep 17 00:00:00 2001 From: Cydia Date: Thu, 18 May 2023 23:42:31 +0300 Subject: [PATCH 4/5] better_check --- code/game/alternate_appearance.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/alternate_appearance.dm b/code/game/alternate_appearance.dm index af9d9d195ef8a..d004e0f127285 100644 --- a/code/game/alternate_appearance.dm +++ b/code/game/alternate_appearance.dm @@ -170,7 +170,7 @@ GLOBAL_LIST_EMPTY(active_alternate_appearances) add_hud_to(mob) /datum/atom_hud/alternate_appearance/basic/blessedAware/mobShouldSee(mob/M) - if(M.mind && M.mind?.holy_role) + if(M.mind && M.mind?.holy_role != NONE) return TRUE if (istype(M, /mob/living/simple_animal/hostile/construct/wraith)) return TRUE From 79e5ee9243de3fc16e627c97bcf2078a0bae17b0 Mon Sep 17 00:00:00 2001 From: Lamiales <110184118+CydiaLamiales@users.noreply.github.com> Date: Sun, 21 May 2023 10:44:50 +0300 Subject: [PATCH 5/5] Apply suggestions from code review --- code/datums/components/religious_tool.dm | 2 +- code/game/alternate_appearance.dm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/code/datums/components/religious_tool.dm b/code/datums/components/religious_tool.dm index 1498c01bf4848..7ff3ac1282d97 100644 --- a/code/datums/components/religious_tool.dm +++ b/code/datums/components/religious_tool.dm @@ -241,7 +241,7 @@ if(!can_i_see) return examine_list += ("Use a bible to interact with this.") - if(user.mind?.holy_role != NONE) + if(user.mind?.holy_role) var/obj/structure/altar_of_gods/altar = parent examine_list +=("You can tap this with your holy weapon to [altar.anchored ? "un" : ""]anchor it.") if(!easy_access_sect) diff --git a/code/game/alternate_appearance.dm b/code/game/alternate_appearance.dm index d004e0f127285..af9d9d195ef8a 100644 --- a/code/game/alternate_appearance.dm +++ b/code/game/alternate_appearance.dm @@ -170,7 +170,7 @@ GLOBAL_LIST_EMPTY(active_alternate_appearances) add_hud_to(mob) /datum/atom_hud/alternate_appearance/basic/blessedAware/mobShouldSee(mob/M) - if(M.mind && M.mind?.holy_role != NONE) + if(M.mind && M.mind?.holy_role) return TRUE if (istype(M, /mob/living/simple_animal/hostile/construct/wraith)) return TRUE