From d53d351b643041adc22a9fcc0b725406555cf366 Mon Sep 17 00:00:00 2001 From: warior4356 Date: Fri, 26 Mar 2021 02:31:21 -0700 Subject: [PATCH 1/5] Initial commit --- code/_onclick/hud/alert.dm | 5 ++++ code/datums/spell.dm | 4 ++++ code/datums/spells/construct_spells.dm | 9 +++++++ code/game/area/ss13_areas.dm | 1 + code/game/gamemodes/cult/blood_magic.dm | 10 ++++++++ code/game/gamemodes/cult/cult_actions.dm | 4 ++++ code/game/gamemodes/cult/cult_items.dm | 16 +++++++++---- code/game/gamemodes/cult/runes.dm | 2 ++ .../gamemodes/miniantags/revenant/revenant.dm | 2 ++ code/game/gamemodes/vampire/vampire_powers.dm | 5 +--- .../items/stacks/sheets/sheet_types.dm | 2 ++ .../mob/living/simple_animal/constructs.dm | 11 +++++++++ code/modules/mob/mob.dm | 24 +++++++++++++++++++ 13 files changed, 87 insertions(+), 8 deletions(-) diff --git a/code/_onclick/hud/alert.dm b/code/_onclick/hud/alert.dm index 35c250abc32..fb5d53f773f 100644 --- a/code/_onclick/hud/alert.dm +++ b/code/_onclick/hud/alert.dm @@ -308,6 +308,11 @@ or shoot a gun to move around via Newton's 3rd Law of Motion." var/mob/living/L = usr return L.resist() +//Constructs +/obj/screen/alert/holy_fire + name = "Holy Fire" + desc = "Your body is crumbling from the holy energies. Get out." + icon_state = "fire" //ALIENS diff --git a/code/datums/spell.dm b/code/datums/spell.dm index db668cd609a..96216c017de 100644 --- a/code/datums/spell.dm +++ b/code/datums/spell.dm @@ -121,6 +121,7 @@ GLOBAL_LIST_INIT(spells, typesof(/obj/effect/proc_holder/spell)) var/critfailchance = 0 var/centcom_cancast = TRUE //Whether or not the spell should be allowed on the admin zlevel + var/holy_cancast = TRUE //Whether or not the spell functions in a holy place var/datum/action/spell_action/action = null var/action_icon = 'icons/mob/actions/actions.dmi' @@ -561,6 +562,9 @@ GLOBAL_LIST_INIT(spells, typesof(/obj/effect/proc_holder/spell)) if(is_admin_level(user.z) && !centcom_cancast) //Certain spells are not allowed on the centcom zlevel return 0 + if(!holy_cancast && user.holy_check()) + return 0 + if(charge_check) switch(charge_type) if("recharge") diff --git a/code/datums/spells/construct_spells.dm b/code/datums/spells/construct_spells.dm index afc91f922ab..d49a2cfb8e6 100644 --- a/code/datums/spells/construct_spells.dm +++ b/code/datums/spells/construct_spells.dm @@ -18,6 +18,7 @@ range = 0 summon_type = list(/turf/simulated/floor/engine/cult) centcom_cancast = FALSE //Stop crashing the server by spawning turfs on transit tiles + holy_cancast = FALSE //Stops cult magic from working on holy ground eg: chapel /obj/effect/proc_holder/spell/aoe_turf/conjure/wall name = "Summon Cult Wall" @@ -32,6 +33,7 @@ range = 0 summon_type = list(/turf/simulated/wall/cult/artificer) //we don't want artificer-based runed metal farms centcom_cancast = FALSE //Stop crashing the server by spawning turfs on transit tiles + holy_cancast = FALSE //Stops cult magic from working on holy ground eg: chapel /obj/effect/proc_holder/spell/aoe_turf/conjure/wall/reinforced name = "Greater Construction" @@ -43,6 +45,7 @@ invocation_type = "none" range = 0 centcom_cancast = FALSE //Stop crashing the server by spawning turfs on transit tiles + holy_cancast = FALSE //Stops cult magic from working on holy ground eg: chapel delay = 50 summon_type = list(/turf/simulated/wall/r_wall) @@ -58,6 +61,7 @@ invocation = "none" invocation_type = "none" range = 0 + holy_cancast = FALSE //Stops cult magic from working on holy ground eg: chapel summon_type = list(/obj/item/soulstone) @@ -77,6 +81,7 @@ invocation = "none" invocation_type = "none" range = 0 + holy_cancast = FALSE //Stops cult magic from working on holy ground eg: chapel summon_type = list(/obj/structure/cult/functional/pylon) @@ -92,6 +97,7 @@ invocation = "none" invocation_type = "none" range = 0 + holy_cancast = FALSE //Stops cult magic from working on holy ground eg: chapel summon_type = list(/obj/effect/forcefield/cult) summon_lifespan = 200 @@ -111,6 +117,7 @@ clothes_req = FALSE invocation = "none" invocation_type = "none" + holy_cancast = FALSE //Stops cult magic from working on holy ground eg: chapel jaunt_in_time = 12 jaunt_in_type = /obj/effect/temp_visual/dir_setting/wraith jaunt_out_type = /obj/effect/temp_visual/dir_setting/wraith/out @@ -132,6 +139,7 @@ clothes_req = FALSE invocation = "none" invocation_type = "none" + holy_cancast = FALSE //Stops cult magic from working on holy ground eg: chapel proj_lifespan = 10 max_targets = 6 @@ -145,6 +153,7 @@ clothes_req = FALSE invocation = "none" invocation_type = "none" + holy_cancast = FALSE //Stops cult magic from working on holy ground eg: chapel range = -1 include_user = 1 cooldown_min = 20 //25 deciseconds reduction per rank diff --git a/code/game/area/ss13_areas.dm b/code/game/area/ss13_areas.dm index 736a6d84447..d3a0659d3a8 100644 --- a/code/game/area/ss13_areas.dm +++ b/code/game/area/ss13_areas.dm @@ -949,6 +949,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station ambientsounds = HOLY_SOUNDS is_haunted = TRUE sound_environment = SOUND_AREA_LARGE_ENCLOSED + valid_territory = FALSE /area/chapel/main name = "\improper Chapel" diff --git a/code/game/gamemodes/cult/blood_magic.dm b/code/game/gamemodes/cult/blood_magic.dm index 2583fd693d3..c34ab872b53 100644 --- a/code/game/gamemodes/cult/blood_magic.dm +++ b/code/game/gamemodes/cult/blood_magic.dm @@ -123,6 +123,8 @@ return ..() /datum/action/innate/cult/blood_spell/Activate() + if(owner.holy_check()) + return if(magic_path) // If this spell flows from the hand if(!hand_magic) // If you don't already have the spell active hand_magic = new magic_path(owner, src) @@ -387,9 +389,13 @@ ..() /obj/item/melee/blood_magic/attack_self(mob/living/user) + if(user.holy_check()) + return afterattack(user, user, TRUE) /obj/item/melee/blood_magic/attack(mob/living/M, mob/living/carbon/user) + if(user.holy_check()) + return if(!iscarbon(user) || !iscultist(user)) uses = 0 qdel(src) @@ -703,6 +709,8 @@ // This should really be split into multiple procs /obj/item/melee/blood_magic/manipulator/afterattack(atom/target, mob/living/carbon/human/user, proximity) + if(user.holy_check()) + return if(proximity) if(ishuman(target)) var/mob/living/carbon/human/H = target @@ -843,6 +851,8 @@ uses += max(1, temp) /obj/item/melee/blood_magic/manipulator/attack_self(mob/living/user) + if(user.holy_check()) + return var/list/options = list("Blood Orb (50)", "Blood Recharge (75)", "Blood Spear (150)", "Blood Bolt Barrage (300)") var/choice = input(user, "Choose a greater blood rite...", "Greater Blood Rites") as null|anything in options switch(choice) diff --git a/code/game/gamemodes/cult/cult_actions.dm b/code/game/gamemodes/cult/cult_actions.dm index ab81f253a32..25a9275f684 100644 --- a/code/game/gamemodes/cult/cult_actions.dm +++ b/code/game/gamemodes/cult/cult_actions.dm @@ -27,6 +27,10 @@ /datum/action/innate/cult/comm/proc/cultist_commune(mob/living/user, message) if(!user || !message) return + + if(user.holy_check()) + return + if(!user.can_speak()) to_chat(user, "You can't speak!") return diff --git a/code/game/gamemodes/cult/cult_items.dm b/code/game/gamemodes/cult/cult_items.dm index ca1938a76ea..74c69140831 100644 --- a/code/game/gamemodes/cult/cult_items.dm +++ b/code/game/gamemodes/cult/cult_items.dm @@ -159,7 +159,7 @@ user.Weaken(5) /obj/item/clothing/suit/hooded/cultrobes/cult_shield/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK) - if(current_charges) + if(current_charges && !owner.holy_check()) owner.visible_message("[attack_text] is deflected in a burst of blood-red sparks!") current_charges-- playsound(loc, "sparks", 100, TRUE, SHORT_RANGE_SOUND_EXTRARANGE) @@ -320,6 +320,7 @@ . = pulled /obj/item/cult_shift/attack_self(mob/user) + if(!uses || !iscarbon(user)) to_chat(user, "[src] is dull and unmoving in your hands.") return @@ -328,7 +329,8 @@ step(src, pick(GLOB.alldirs)) to_chat(user, "[src] flickers out of your hands, too eager to move!") return - + if(user.holy_check()) + return var/outer_tele_radius = 9 var/mob/living/carbon/C = user @@ -443,7 +445,7 @@ * The illusion has a 60% chance to be hostile and attack non-cultists, and a 40% chance to just run away from the user. */ /obj/item/shield/mirror/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK) - if(iscultist(owner)) // Cultist holding the shield + if(iscultist(owner) && !owner.holy_check()) // Cultist holding the shield // Hit by a projectile if(istype(hitby, /obj/item/projectile)) @@ -603,7 +605,7 @@ spear = blood_spear /datum/action/innate/cult/spear/Activate() - if(owner == spear.loc || cooldown > world.time) + if(owner == spear.loc || cooldown > world.time || owner.holy_check()) return var/ST = get_turf(spear) var/OT = get_turf(owner) @@ -629,6 +631,12 @@ fire_sound = 'sound/magic/wand_teleport.ogg' flags = NOBLUDGEON | DROPDEL +/obj/item/gun/projectile/shotgun/boltaction/enchanted/arcane_barrage/blood/afterattack(atom/target, mob/living/user, flag, params) + if(user.holy_check()) + return + ..() + + /obj/item/ammo_box/magazine/internal/boltaction/enchanted/arcane_barrage/blood ammo_type = /obj/item/ammo_casing/magic/arcane_barrage/blood diff --git a/code/game/gamemodes/cult/runes.dm b/code/game/gamemodes/cult/runes.dm index 4c98a3c59d3..96874208e79 100644 --- a/code/game/gamemodes/cult/runes.dm +++ b/code/game/gamemodes/cult/runes.dm @@ -139,6 +139,8 @@ fail_invoke() is called when the rune fails, via not enough people around or oth structure_check() searches for nearby cultist structures required for the invocation. Proper structures are pylons, forges, archives, and altars. */ /obj/effect/rune/proc/can_invoke(mob/living/user) + if(user.holy_check()) + return //This proc determines if the rune can be invoked at the time. If there are multiple required cultists, it will find all nearby cultists. var/list/invokers = list() //people eligible to invoke the rune var/list/chanters = list() //people who will actually chant the rune when passed to invoke() diff --git a/code/game/gamemodes/miniantags/revenant/revenant.dm b/code/game/gamemodes/miniantags/revenant/revenant.dm index fb46533b817..3aa87c78016 100644 --- a/code/game/gamemodes/miniantags/revenant/revenant.dm +++ b/code/game/gamemodes/miniantags/revenant/revenant.dm @@ -234,6 +234,8 @@ /mob/living/simple_animal/revenant/proc/castcheck(essence_cost) if(!src) return + if(holy_check(src)) + return var/turf/T = get_turf(src) if(istype(T, /turf/simulated/wall)) to_chat(src, "You cannot use abilities from inside of a wall.") diff --git a/code/game/gamemodes/vampire/vampire_powers.dm b/code/game/gamemodes/vampire/vampire_powers.dm index 4e06cb02df1..6f61663c972 100644 --- a/code/game/gamemodes/vampire/vampire_powers.dm +++ b/code/game/gamemodes/vampire/vampire_powers.dm @@ -9,6 +9,7 @@ action_background_icon_state = "bg_vampire" var/required_blood = 0 var/gain_desc = null + holy_cancast = FALSE //Stops cult magic from working on holy ground eg: chapel /obj/effect/proc_holder/spell/vampire/New() ..() @@ -39,10 +40,6 @@ if(vampire.bloodusable < required_blood) to_chat(user, "You require at least [required_blood] units of usable blood to do that!") return 0 - //chapel check - if(istype(loc.loc, /area/chapel) && !fullpower) - to_chat(user, "Your powers are useless on this holy ground.") - return 0 return ..() /obj/effect/proc_holder/spell/vampire/can_cast(mob/user = usr, charge_check = TRUE, show_message = FALSE) diff --git a/code/game/objects/items/stacks/sheets/sheet_types.dm b/code/game/objects/items/stacks/sheets/sheet_types.dm index a004cfd0de8..2317c71d72f 100644 --- a/code/game/objects/items/stacks/sheets/sheet_types.dm +++ b/code/game/objects/items/stacks/sheets/sheet_types.dm @@ -380,6 +380,8 @@ GLOBAL_LIST_INIT(cult_recipes, list ( \ if(!iscultist(user)) to_chat(user, "Only one with forbidden knowledge could hope to work this metal...") return + if(user.holy_check()) + return if(!is_level_reachable(user.z)) to_chat(user, "The energies of this place interfere with the metal shaping!") return diff --git a/code/modules/mob/living/simple_animal/constructs.dm b/code/modules/mob/living/simple_animal/constructs.dm index e45f8e311fd..fc1afda7ffb 100644 --- a/code/modules/mob/living/simple_animal/constructs.dm +++ b/code/modules/mob/living/simple_animal/constructs.dm @@ -90,6 +90,17 @@ /mob/living/simple_animal/hostile/construct/electrocute_act(shock_damage, source, siemens_coeff = 1, flags = NONE) return FALSE +/mob/living/simple_animal/hostile/construct/Life(seconds, times_fired) + if(holy_check(src)) + throw_alert("holy_fire", /obj/screen/alert/holy_fire, override = TRUE) + visible_message("[src] slowly crumbles to dust in this holy place!", \ + "Your shell burns as you crumble to dust in this holy place!") + playsound(loc, 'sound/items/welder.ogg', 150, TRUE) + adjustBruteLoss(maxHealth/8) + else + clear_alert("holy_fire", clear_override = TRUE) + return ..() + /////////////////Juggernaut/////////////// diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 95538b18995..55c74e1a6ef 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -1456,3 +1456,27 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \ */ /mob/proc/update_runechat_msg_location() return + +GLOBAL_LIST_INIT(holy_areas, typecacheof(list( + /area/chapel))) + +/mob/proc/holy_check() + if(!is_type_in_typecache(loc.loc, GLOB.holy_areas)) + return FALSE + + //Allows fullpower vampires to bypass holy areas + var/datum/vampire/vampire = mind.vampire + if(vampire && vampire.get_ability(/datum/vampire_passive/full)) + return FALSE + + //Allows cult to bypass holy areas once they summon + var/datum/game_mode/gamemode = SSticker.mode + if(iscultist(src) && gamemode.cult_objs.cult_status == NARSIE_HAS_RISEN) + return FALSE + + //Execption for Holy Constructs + if(istype(src, /mob/living/simple_animal/hostile/construct) && !iscultist(src)) + return FALSE + + to_chat(src, "Your powers are useless on this holy ground.") + return TRUE From 579f8f2e00d35480f1201428ec174c09d2d692b7 Mon Sep 17 00:00:00 2001 From: warior4356 Date: Sat, 27 Mar 2021 03:16:48 -0700 Subject: [PATCH 2/5] Fixes a few more issues --- code/game/gamemodes/cult/blood_magic.dm | 22 +++++++++++++++---- code/game/gamemodes/cult/cult_items.dm | 4 ++++ code/game/gamemodes/cult/cult_structures.dm | 2 ++ .../items/stacks/sheets/sheet_types.dm | 2 +- code/game/objects/items/stacks/stack.dm | 14 ++++++++---- code/modules/mob/mob.dm | 3 +++ 6 files changed, 38 insertions(+), 9 deletions(-) diff --git a/code/game/gamemodes/cult/blood_magic.dm b/code/game/gamemodes/cult/blood_magic.dm index c34ab872b53..a0a7bf8f21c 100644 --- a/code/game/gamemodes/cult/blood_magic.dm +++ b/code/game/gamemodes/cult/blood_magic.dm @@ -180,6 +180,8 @@ ..() /datum/action/innate/cult/blood_spell/emp/Activate() + if(owner.holy_check()) + return owner.visible_message("[owner]'s body flashes a bright blue!", \ "You speak the cursed words, channeling an electromagnetic pulse from your body.") owner.emp_act(2) @@ -281,6 +283,8 @@ if(ranged_ability_user.incapacitated() || !iscultist(user)) user.ranged_ability.remove_ranged_ability(user) return + if(user.holy_check()) + return var/turf/T = get_turf(ranged_ability_user) if(!isturf(T)) return FALSE @@ -307,6 +311,8 @@ var/revealing = FALSE //if it reveals or not /datum/action/innate/cult/blood_spell/veiling/Activate() + if(owner.holy_check()) + return if(!revealing) // Hiding stuff owner.visible_message("Thin grey dust falls from [owner]'s hand!", \ "You invoke the veiling spell, hiding nearby runes and cult structures.") @@ -389,13 +395,9 @@ ..() /obj/item/melee/blood_magic/attack_self(mob/living/user) - if(user.holy_check()) - return afterattack(user, user, TRUE) /obj/item/melee/blood_magic/attack(mob/living/M, mob/living/carbon/user) - if(user.holy_check()) - return if(!iscarbon(user) || !iscultist(user)) uses = 0 qdel(src) @@ -431,6 +433,8 @@ var/mob/living/L = target if(iscultist(target)) return + if(user.holy_check()) + return user.visible_message("[user] holds up [user.p_their()] hand, which explodes in a flash of red light!", \ "You attempt to stun [L] with the spell!") @@ -467,6 +471,8 @@ invocation = "Sas'so c'arta forbici!" /obj/item/melee/blood_magic/teleport/afterattack(atom/target, mob/living/carbon/user, proximity) + if(user.holy_check()) + return var/list/potential_runes = list() var/list/teleportnames = list() var/list/duplicaterunecount = list() @@ -527,6 +533,8 @@ color = "#000000" // black /obj/item/melee/blood_magic/shackles/afterattack(atom/target, mob/living/carbon/user, proximity) + if(user.holy_check()) + return if(iscarbon(target) && proximity) var/mob/living/carbon/C = target if(C.canBeHandcuffed() || C.get_arm_ignore()) @@ -585,6 +593,8 @@ Airlocks into brittle runed airlocks after a delay (harm intent)"} /obj/item/melee/blood_magic/construction/afterattack(atom/target, mob/user, proximity_flag, click_parameters) + if(user.holy_check()) + return if(proximity_flag) if(channeling) to_chat(user, "You are already invoking twisted construction!") @@ -639,6 +649,8 @@ color = "#33cc33" // green /obj/item/melee/blood_magic/armor/afterattack(atom/target, mob/living/carbon/user, proximity) + if(user.holy_check()) + return if(iscarbon(target) && proximity) uses-- var/mob/living/carbon/C = target @@ -662,6 +674,8 @@ has_source = FALSE //special, only availible for a blood cost. /obj/item/melee/blood_magic/empower/afterattack(atom/target, mob/user, proximity_flag, click_parameters) + if(user.holy_check()) + return if(proximity_flag) //Shielded suit diff --git a/code/game/gamemodes/cult/cult_items.dm b/code/game/gamemodes/cult/cult_items.dm index 74c69140831..a0dcdd96035 100644 --- a/code/game/gamemodes/cult/cult_items.dm +++ b/code/game/gamemodes/cult/cult_items.dm @@ -520,6 +520,10 @@ /obj/item/shield/mirror/IsReflect() if(prob(reflect_chance)) + if(istype(loc, /mob)) + var/mob/user = loc + if(user.holy_check()) + return FALSE return TRUE return FALSE diff --git a/code/game/gamemodes/cult/cult_structures.dm b/code/game/gamemodes/cult/cult_structures.dm index b2b4dfa534e..3f81bd6a029 100644 --- a/code/game/gamemodes/cult/cult_structures.dm +++ b/code/game/gamemodes/cult/cult_structures.dm @@ -58,6 +58,8 @@ /obj/structure/cult/functional/attackby(obj/item/I, mob/user, params) if(istype(I, /obj/item/melee/cultblade/dagger) && iscultist(user)) + if(user.holy_check()) + return anchored = !anchored to_chat(user, "You [anchored ? "":"un"]secure [src] [anchored ? "to":"from"] the floor.") if(!anchored) diff --git a/code/game/objects/items/stacks/sheets/sheet_types.dm b/code/game/objects/items/stacks/sheets/sheet_types.dm index 2317c71d72f..3f5ac5315d0 100644 --- a/code/game/objects/items/stacks/sheets/sheet_types.dm +++ b/code/game/objects/items/stacks/sheets/sheet_types.dm @@ -380,7 +380,7 @@ GLOBAL_LIST_INIT(cult_recipes, list ( \ if(!iscultist(user)) to_chat(user, "Only one with forbidden knowledge could hope to work this metal...") return - if(user.holy_check()) + if(usr.holy_check()) return if(!is_level_reachable(user.z)) to_chat(user, "The energies of this place interfere with the metal shaping!") diff --git a/code/game/objects/items/stacks/stack.dm b/code/game/objects/items/stacks/stack.dm index b57c3435132..7f0d25aa6e6 100644 --- a/code/game/objects/items/stacks/stack.dm +++ b/code/game/objects/items/stacks/stack.dm @@ -16,7 +16,7 @@ var/to_transfer = 0 var/max_amount = 50 //also see stack recipes initialisation, param "max_res_amount" must be equal to this max_amount var/merge_type = null // This path and its children should merge with this stack, defaults to src.type - var/recipe_width = 400 //Width of the recipe popup + var/recipe_width = 400 //Width of the recipe popup var/recipe_height = 400 //Height of the recipe popup /obj/item/stack/New(loc, new_amount, merge = TRUE) @@ -186,9 +186,15 @@ to_chat(usr, "\The [R.title] must be constructed on the floor!") return FALSE - if(R.no_cult_structure && (locate(/obj/structure/cult) in usr.drop_location())) - to_chat(usr, "There is a structure here!") - return FALSE + if(R.no_cult_structure) + if(usr.holy_check()) + return + if(!is_level_reachable(usr.z)) + to_chat(usr, "The energies of this place interfere with the metal shaping!") + return + if(locate(/obj/structure/cult) in usr.drop_location()) + to_chat(usr, "There is a structure here!") + return FALSE if(R.time) to_chat(usr, "Building [R.title] ...") diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 55c74e1a6ef..01158a76775 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -1464,6 +1464,9 @@ GLOBAL_LIST_INIT(holy_areas, typecacheof(list( if(!is_type_in_typecache(loc.loc, GLOB.holy_areas)) return FALSE + if(!mind) + return FALSE + //Allows fullpower vampires to bypass holy areas var/datum/vampire/vampire = mind.vampire if(vampire && vampire.get_ability(/datum/vampire_passive/full)) From e1657b68072add714c97a0102244d2350a2b3014 Mon Sep 17 00:00:00 2001 From: warior4356 Date: Sat, 27 Mar 2021 19:41:07 -0700 Subject: [PATCH 3/5] Adds is construct check --- code/modules/mob/mob.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 01158a76775..7be6e3b8d1d 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -1478,7 +1478,7 @@ GLOBAL_LIST_INIT(holy_areas, typecacheof(list( return FALSE //Execption for Holy Constructs - if(istype(src, /mob/living/simple_animal/hostile/construct) && !iscultist(src)) + if(isconstruct(src) && !iscultist(src)) return FALSE to_chat(src, "Your powers are useless on this holy ground.") From 22374acfb431a6e1ecd295e7c5ec1097965f8932 Mon Sep 17 00:00:00 2001 From: warior4356 Date: Thu, 1 Apr 2021 01:33:42 -0700 Subject: [PATCH 4/5] Changing var name --- code/datums/spell.dm | 4 ++-- code/datums/spells/construct_spells.dm | 18 +++++++++--------- code/game/gamemodes/vampire/vampire_powers.dm | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/code/datums/spell.dm b/code/datums/spell.dm index 96216c017de..7e7c187179a 100644 --- a/code/datums/spell.dm +++ b/code/datums/spell.dm @@ -121,7 +121,7 @@ GLOBAL_LIST_INIT(spells, typesof(/obj/effect/proc_holder/spell)) var/critfailchance = 0 var/centcom_cancast = TRUE //Whether or not the spell should be allowed on the admin zlevel - var/holy_cancast = TRUE //Whether or not the spell functions in a holy place + var/holy_area_cancast = TRUE //Whether or not the spell functions in a holy place var/datum/action/spell_action/action = null var/action_icon = 'icons/mob/actions/actions.dmi' @@ -562,7 +562,7 @@ GLOBAL_LIST_INIT(spells, typesof(/obj/effect/proc_holder/spell)) if(is_admin_level(user.z) && !centcom_cancast) //Certain spells are not allowed on the centcom zlevel return 0 - if(!holy_cancast && user.holy_check()) + if(!holy_area_cancast && user.holy_check()) return 0 if(charge_check) diff --git a/code/datums/spells/construct_spells.dm b/code/datums/spells/construct_spells.dm index d49a2cfb8e6..5a05bf773f4 100644 --- a/code/datums/spells/construct_spells.dm +++ b/code/datums/spells/construct_spells.dm @@ -18,7 +18,7 @@ range = 0 summon_type = list(/turf/simulated/floor/engine/cult) centcom_cancast = FALSE //Stop crashing the server by spawning turfs on transit tiles - holy_cancast = FALSE //Stops cult magic from working on holy ground eg: chapel + holy_area_cancast = FALSE //Stops cult magic from working on holy ground eg: chapel /obj/effect/proc_holder/spell/aoe_turf/conjure/wall name = "Summon Cult Wall" @@ -33,7 +33,7 @@ range = 0 summon_type = list(/turf/simulated/wall/cult/artificer) //we don't want artificer-based runed metal farms centcom_cancast = FALSE //Stop crashing the server by spawning turfs on transit tiles - holy_cancast = FALSE //Stops cult magic from working on holy ground eg: chapel + holy_area_cancast = FALSE //Stops cult magic from working on holy ground eg: chapel /obj/effect/proc_holder/spell/aoe_turf/conjure/wall/reinforced name = "Greater Construction" @@ -45,7 +45,7 @@ invocation_type = "none" range = 0 centcom_cancast = FALSE //Stop crashing the server by spawning turfs on transit tiles - holy_cancast = FALSE //Stops cult magic from working on holy ground eg: chapel + holy_area_cancast = FALSE //Stops cult magic from working on holy ground eg: chapel delay = 50 summon_type = list(/turf/simulated/wall/r_wall) @@ -61,7 +61,7 @@ invocation = "none" invocation_type = "none" range = 0 - holy_cancast = FALSE //Stops cult magic from working on holy ground eg: chapel + holy_area_cancast = FALSE //Stops cult magic from working on holy ground eg: chapel summon_type = list(/obj/item/soulstone) @@ -81,7 +81,7 @@ invocation = "none" invocation_type = "none" range = 0 - holy_cancast = FALSE //Stops cult magic from working on holy ground eg: chapel + holy_area_cancast = FALSE //Stops cult magic from working on holy ground eg: chapel summon_type = list(/obj/structure/cult/functional/pylon) @@ -97,7 +97,7 @@ invocation = "none" invocation_type = "none" range = 0 - holy_cancast = FALSE //Stops cult magic from working on holy ground eg: chapel + holy_area_cancast = FALSE //Stops cult magic from working on holy ground eg: chapel summon_type = list(/obj/effect/forcefield/cult) summon_lifespan = 200 @@ -117,7 +117,7 @@ clothes_req = FALSE invocation = "none" invocation_type = "none" - holy_cancast = FALSE //Stops cult magic from working on holy ground eg: chapel + holy_area_cancast = FALSE //Stops cult magic from working on holy ground eg: chapel jaunt_in_time = 12 jaunt_in_type = /obj/effect/temp_visual/dir_setting/wraith jaunt_out_type = /obj/effect/temp_visual/dir_setting/wraith/out @@ -139,7 +139,7 @@ clothes_req = FALSE invocation = "none" invocation_type = "none" - holy_cancast = FALSE //Stops cult magic from working on holy ground eg: chapel + holy_area_cancast = FALSE //Stops cult magic from working on holy ground eg: chapel proj_lifespan = 10 max_targets = 6 @@ -153,7 +153,7 @@ clothes_req = FALSE invocation = "none" invocation_type = "none" - holy_cancast = FALSE //Stops cult magic from working on holy ground eg: chapel + holy_area_cancast = FALSE //Stops cult magic from working on holy ground eg: chapel range = -1 include_user = 1 cooldown_min = 20 //25 deciseconds reduction per rank diff --git a/code/game/gamemodes/vampire/vampire_powers.dm b/code/game/gamemodes/vampire/vampire_powers.dm index 6f61663c972..383a6c4370e 100644 --- a/code/game/gamemodes/vampire/vampire_powers.dm +++ b/code/game/gamemodes/vampire/vampire_powers.dm @@ -9,7 +9,7 @@ action_background_icon_state = "bg_vampire" var/required_blood = 0 var/gain_desc = null - holy_cancast = FALSE //Stops cult magic from working on holy ground eg: chapel + holy_area_cancast = FALSE //Stops cult magic from working on holy ground eg: chapel /obj/effect/proc_holder/spell/vampire/New() ..() From ba8052af3fb4e973a036a14c19d040db78209f6a Mon Sep 17 00:00:00 2001 From: warior4356 Date: Thu, 15 Jul 2021 18:44:23 -0700 Subject: [PATCH 5/5] Apply suggestions from code review Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com> --- code/datums/spell.dm | 5 +++-- code/modules/mob/mob.dm | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/code/datums/spell.dm b/code/datums/spell.dm index 7e7c187179a..edb327582c8 100644 --- a/code/datums/spell.dm +++ b/code/datums/spell.dm @@ -121,7 +121,8 @@ GLOBAL_LIST_INIT(spells, typesof(/obj/effect/proc_holder/spell)) var/critfailchance = 0 var/centcom_cancast = TRUE //Whether or not the spell should be allowed on the admin zlevel - var/holy_area_cancast = TRUE //Whether or not the spell functions in a holy place + /// Whether or not the spell functions in a holy place + var/holy_area_cancast = TRUE var/datum/action/spell_action/action = null var/action_icon = 'icons/mob/actions/actions.dmi' @@ -563,7 +564,7 @@ GLOBAL_LIST_INIT(spells, typesof(/obj/effect/proc_holder/spell)) return 0 if(!holy_area_cancast && user.holy_check()) - return 0 + return FALSE if(charge_check) switch(charge_type) diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 395d4ce7765..3685fca62ac 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -1461,7 +1461,8 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \ return GLOBAL_LIST_INIT(holy_areas, typecacheof(list( - /area/chapel))) + /area/chapel +))) /mob/proc/holy_check() if(!is_type_in_typecache(loc.loc, GLOB.holy_areas))