From f5f4e3a9d1833802e109f16c3ff6a088dfa91274 Mon Sep 17 00:00:00 2001 From: LetterJay Date: Sun, 11 Jun 2017 08:26:09 -0500 Subject: [PATCH] upstream-merge-28047 --- code/_onclick/hud/alert.dm | 15 +++---- code/game/gamemodes/clock_cult/clock_cult.dm | 5 +-- .../clock_helpers/scripture_checks.dm | 17 ++++---- .../clock_cult/clock_items/clockwork_slab.dm | 43 ++++++++++++++----- 4 files changed, 50 insertions(+), 30 deletions(-) diff --git a/code/_onclick/hud/alert.dm b/code/_onclick/hud/alert.dm index 7e6f488a47..397eabeb22 100644 --- a/code/_onclick/hud/alert.dm +++ b/code/_onclick/hud/alert.dm @@ -361,7 +361,6 @@ or shoot a gun to move around via Newton's 3rd Law of Motion." name = "Next Tier Requirements" desc = "You shouldn't be seeing this description unless you're very fast. If you're very fast, good job!" icon_state = "no-servants-caches" - var/static/list/scripture_states = list(SCRIPTURE_DRIVER = TRUE, SCRIPTURE_SCRIPT = FALSE, SCRIPTURE_APPLICATION = FALSE, SCRIPTURE_REVENANT = FALSE, SCRIPTURE_JUDGEMENT = FALSE) /obj/screen/alert/clockwork/scripture_reqs/Initialize() . = ..() @@ -374,12 +373,11 @@ or shoot a gun to move around via Newton's 3rd Law of Motion." /obj/screen/alert/clockwork/scripture_reqs/process() if(GLOB.clockwork_gateway_activated) - qdel(src) + mob_viewer.clear_alert("scripturereq") return var/current_state - scripture_states = scripture_unlock_check() - for(var/i in scripture_states) - if(!scripture_states[i]) + for(var/i in SSticker.scripture_states) + if(!SSticker.scripture_states[i]) current_state = i break icon_state = "no" @@ -459,7 +457,6 @@ or shoot a gun to move around via Newton's 3rd Law of Motion." var/servants = 0 var/validservants = 0 var/unconverted_ais_exist = get_unconverted_ais() - var/list/scripture_states = scripture_unlock_check() var/list/textlist for(var/mob/living/L in GLOB.living_mob_list) if(is_servant_of_ratvar(L)) @@ -496,7 +493,7 @@ or shoot a gun to move around via Newton's 3rd Law of Motion." textlist += "[unconverted_ais_exist] unconverted AIs exist!
" else textlist += "An unconverted AI exists!
" - if(scripture_states[SCRIPTURE_REVENANT]) + if(SSticker.scripture_states[SCRIPTURE_REVENANT]) var/inathneq_available = GLOB.clockwork_generals_invoked["inath-neq"] <= world.time var/sevtug_available = GLOB.clockwork_generals_invoked["sevtug"] <= world.time var/nezbere_available = GLOB.clockwork_generals_invoked["nezbere"] <= world.time @@ -508,9 +505,9 @@ or shoot a gun to move around via Newton's 3rd Law of Motion." textlist += "Generals available: NONE
" else textlist += "Generals available: NONE
" - for(var/i in scripture_states) + for(var/i in SSticker.scripture_states) if(i != SCRIPTURE_DRIVER) //ignore the always-unlocked stuff - textlist += "[i] Scripture: [scripture_states[i] ? "UNLOCKED":"LOCKED"]
" + textlist += "[i] Scripture: [SSticker.scripture_states[i] ? "UNLOCKED":"LOCKED"]
" desc = textlist.Join() ..() diff --git a/code/game/gamemodes/clock_cult/clock_cult.dm b/code/game/gamemodes/clock_cult/clock_cult.dm index 48e1ff1957..9bb0d89e5c 100644 --- a/code/game/gamemodes/clock_cult/clock_cult.dm +++ b/code/game/gamemodes/clock_cult/clock_cult.dm @@ -207,10 +207,9 @@ Credit where due: text += "
The servants' objective was:
[CLOCKCULT_OBJECTIVE]" text += "
Ratvar's servants had [GLOB.clockwork_caches] Tinkerer's Caches." text += "
Construction Value(CV) was: [GLOB.clockwork_construction_value]" - var/list/scripture_states = scripture_unlock_check() - for(var/i in scripture_states) + for(var/i in SSticker.scripture_states) if(i != SCRIPTURE_DRIVER) - text += "
[i] scripture was: [scripture_states[i] ? "UN":""]LOCKED" + text += "
[i] scripture was: [SSticker.scripture_states[i] ? "UN":""]LOCKED" if(servants_of_ratvar.len) text += "
Ratvar's servants were:" for(var/datum/mind/M in servants_of_ratvar) diff --git a/code/game/gamemodes/clock_cult/clock_helpers/scripture_checks.dm b/code/game/gamemodes/clock_cult/clock_helpers/scripture_checks.dm index 914804185e..f2aac78a30 100644 --- a/code/game/gamemodes/clock_cult/clock_helpers/scripture_checks.dm +++ b/code/game/gamemodes/clock_cult/clock_helpers/scripture_checks.dm @@ -7,13 +7,17 @@ servants++ . = list(SCRIPTURE_DRIVER = TRUE, SCRIPTURE_SCRIPT = FALSE, SCRIPTURE_APPLICATION = FALSE, SCRIPTURE_REVENANT = FALSE, SCRIPTURE_JUDGEMENT = FALSE) //Drivers: always unlocked - .[SCRIPTURE_SCRIPT] = (servants >= SCRIPT_SERVANT_REQ && GLOB.clockwork_caches >= SCRIPT_CACHE_REQ) + .[SCRIPTURE_SCRIPT] = (SSticker.scripture_states[SCRIPTURE_SCRIPT] || \ + (servants >= SCRIPT_SERVANT_REQ && GLOB.clockwork_caches >= SCRIPT_CACHE_REQ)) //Script: SCRIPT_SERVANT_REQ or more non-brain servants and SCRIPT_CACHE_REQ or more clockwork caches - .[SCRIPTURE_APPLICATION] = (servants >= APPLICATION_SERVANT_REQ && GLOB.clockwork_caches >= APPLICATION_CACHE_REQ && GLOB.clockwork_construction_value >= APPLICATION_CV_REQ) + .[SCRIPTURE_APPLICATION] = (SSticker.scripture_states[SCRIPTURE_APPLICATION] || \ + (servants >= APPLICATION_SERVANT_REQ && GLOB.clockwork_caches >= APPLICATION_CACHE_REQ && GLOB.clockwork_construction_value >= APPLICATION_CV_REQ)) //Application: APPLICATION_SERVANT_REQ or more non-brain servants, APPLICATION_CACHE_REQ or more clockwork caches, and at least APPLICATION_CV_REQ CV - .[SCRIPTURE_REVENANT] = (servants >= REVENANT_SERVANT_REQ && GLOB.clockwork_caches >= REVENANT_CACHE_REQ && GLOB.clockwork_construction_value >= REVENANT_CV_REQ) + .[SCRIPTURE_REVENANT] = (SSticker.scripture_states[SCRIPTURE_REVENANT] || \ + (servants >= REVENANT_SERVANT_REQ && GLOB.clockwork_caches >= REVENANT_CACHE_REQ && GLOB.clockwork_construction_value >= REVENANT_CV_REQ)) //Revenant: REVENANT_SERVANT_REQ or more non-brain servants, REVENANT_CACHE_REQ or more clockwork caches, and at least REVENANT_CV_REQ CV - .[SCRIPTURE_JUDGEMENT] = (servants >= JUDGEMENT_SERVANT_REQ && GLOB.clockwork_caches >= JUDGEMENT_CACHE_REQ && GLOB.clockwork_construction_value >= JUDGEMENT_CV_REQ && !unconverted_ai_exists) + .[SCRIPTURE_JUDGEMENT] = (SSticker.scripture_states[SCRIPTURE_JUDGEMENT] || \ + (servants >= JUDGEMENT_SERVANT_REQ && GLOB.clockwork_caches >= JUDGEMENT_CACHE_REQ && GLOB.clockwork_construction_value >= JUDGEMENT_CV_REQ && !unconverted_ai_exists)) //Judgement: JUDGEMENT_SERVANT_REQ or more non-brain servants, JUDGEMENT_CACHE_REQ or more clockwork caches, at least JUDGEMENT_CV_REQ CV, and there are no living, non-servant ais //reports to servants when scripture is locked or unlocked @@ -21,7 +25,7 @@ . = scripture_unlock_check() for(var/i in .) if(.[i] != previous_states[i]) - hierophant_message("Hierophant Network: [i] Scripture has been [.[i] ? "un":""]locked.") + hierophant_message("Hierophant Network: [i] Scripture has been [.[i] ? "un":""]locked.") //maybe admins fucked with scripture states? update_slab_info() /proc/get_unconverted_ais() @@ -59,6 +63,3 @@ //changes construction value /proc/change_construction_value(amount) GLOB.clockwork_construction_value += amount - -/proc/can_recite_scripture(mob/living/L) - return (is_servant_of_ratvar(L) && L.stat == CONSCIOUS && L.can_speak_vocal() && (GLOB.ratvar_awakens || (ishuman(L) || issilicon(L)))) diff --git a/code/game/gamemodes/clock_cult/clock_items/clockwork_slab.dm b/code/game/gamemodes/clock_cult/clock_items/clockwork_slab.dm index 72dba26bed..10da3c2a10 100644 --- a/code/game/gamemodes/clock_cult/clock_items/clockwork_slab.dm +++ b/code/game/gamemodes/clock_cult/clock_items/clockwork_slab.dm @@ -14,6 +14,7 @@ var/target_component_id //the target component ID to create, if any var/no_cost = FALSE //If the slab is admin-only and needs no components and has no scripture locks var/speed_multiplier = 1 //multiples how fast this slab recites scripture + var/nonhuman_usable = FALSE //if the slab can be used by nonhumans, defaults to off var/produces_components = TRUE //if it produces components at all var/selected_scripture = SCRIPTURE_DRIVER var/recollecting = FALSE //if we're looking at fancy recollection @@ -32,9 +33,13 @@ no_cost = TRUE produces_components = FALSE +/obj/item/clockwork/slab/scarab + nonhuman_usable = TRUE + /obj/item/clockwork/slab/debug speed_multiplier = 0 no_cost = TRUE + nonhuman_usable = TRUE /obj/item/clockwork/slab/debug/attack_hand(mob/living/user) ..() @@ -44,6 +49,7 @@ /obj/item/clockwork/slab/cyborg //three scriptures, plus a spear and proselytizer clockwork_desc = "A divine link to the Celestial Derelict, allowing for limited recital of scripture.\n\ Hitting a slab, a Servant with a slab, or a cache will transfer this slab's components into the target, the target's slab, or the global cache, respectively." + nonhuman_usable = TRUE quickbound = list(/datum/clockwork_scripture/ranged_ability/judicial_marker, /datum/clockwork_scripture/ranged_ability/linked_vanguard, \ /datum/clockwork_scripture/create_object/tinkerers_cache) maximum_quickbound = 6 //we usually have one or two unique scriptures, so if ratvar is up let us bind one more @@ -100,6 +106,12 @@ slab_ability = null return ..() +/obj/item/clockwork/slab/ratvar_act() + if(GLOB.ratvar_awakens) + nonhuman_usable = TRUE + else + nonhuman_usable = initial(nonhuman_usable) + /obj/item/clockwork/slab/dropped(mob/user) . = ..() addtimer(CALLBACK(src, .proc/check_on_mob, user), 1) //dropped is called before the item is out of the slot, so we need to check slightly later @@ -126,7 +138,7 @@ production_time = world.time + SLAB_PRODUCTION_TIME + production_slowdown var/mob/living/L L = get_atom_on_turf(src, /mob/living) - if(istype(L) && can_recite_scripture(L)) + if(istype(L) && is_servant_of_ratvar(L) && (nonhuman_usable || ishuman(L))) var/component_to_generate = target_component_id if(!component_to_generate) component_to_generate = get_weighted_component_id(src) //more likely to generate components that we have less of @@ -256,7 +268,7 @@ if(busy) to_chat(user, "[src] refuses to work, displaying the message: \"[busy]!\"") return 0 - if(!can_recite_scripture(user)) + if(!nonhuman_usable && !ishuman(user)) to_chat(user, "[src] hums fitfully in your hands, but doesn't seem to do anything...") return 0 access_display(user) @@ -276,15 +288,14 @@ ui.open() /obj/item/clockwork/slab/proc/recite_scripture(datum/clockwork_scripture/scripture, mob/living/user) - if(!scripture || !user || !user.canUseTopic(src) || !can_recite_scripture(user)) + if(!scripture || !user || !user.canUseTopic(src) || (!nonhuman_usable && !ishuman(user))) return FALSE if(user.get_active_held_item() != src) to_chat(user, "You need to hold the slab in your active hand to recite scripture!") return FALSE var/initial_tier = initial(scripture.tier) if(initial_tier != SCRIPTURE_PERIPHERAL) - var/list/tiers_of_scripture = scripture_unlock_check() - if(!GLOB.ratvar_awakens && !no_cost && !tiers_of_scripture[initial_tier]) + if(!GLOB.ratvar_awakens && !no_cost && !SSticker.scripture_states[initial_tier]) to_chat(user, "That scripture is not unlocked, and cannot be recited!") return FALSE var/datum/clockwork_scripture/scripture_to_recite = new scripture @@ -401,15 +412,27 @@ switch(selected_scripture) //display info based on selected scripture tier if(SCRIPTURE_DRIVER) - data["tier_info"] = "These scriptures are always unlocked." + data["tier_info"] = "These scriptures are permenantly unlocked." if(SCRIPTURE_SCRIPT) - data["tier_info"] = "These scriptures require at least [SCRIPT_SERVANT_REQ] Servants and [SCRIPT_CACHE_REQ] Tinkerer's Cache." + if(SSticker.scripture_states[SCRIPTURE_SCRIPT]) + data["tier_info"] = "These scriptures are permenantly unlocked." + else + data["tier_info"] = "These scriptures require at least [SCRIPT_SERVANT_REQ] Servants and [SCRIPT_CACHE_REQ] Tinkerer's Cache." if(SCRIPTURE_APPLICATION) - data["tier_info"] = "These scriptures require at least [APPLICATION_SERVANT_REQ] Servants, [APPLICATION_CACHE_REQ] Tinkerer's Caches, and [APPLICATION_CV_REQ]CV." + if(SSticker.scripture_states[SCRIPTURE_APPLICATION]) + data["tier_info"] = "These scriptures are permenantly unlocked." + else + data["tier_info"] = "These scriptures require at least [APPLICATION_SERVANT_REQ] Servants, [APPLICATION_CACHE_REQ] Tinkerer's Caches, and [APPLICATION_CV_REQ]CV." if(SCRIPTURE_REVENANT) - data["tier_info"] = "These scriptures require at least [REVENANT_SERVANT_REQ] Servants, [REVENANT_CACHE_REQ] Tinkerer's Caches, and [REVENANT_CV_REQ]CV." + if(SSticker.scripture_states[SCRIPTURE_REVENANT]) + data["tier_info"] = "These scriptures are permenantly unlocked." + else + data["tier_info"] = "These scriptures require at least [REVENANT_SERVANT_REQ] Servants, [REVENANT_CACHE_REQ] Tinkerer's Caches, and [REVENANT_CV_REQ]CV." if(SCRIPTURE_JUDGEMENT) - data["tier_info"] = "This scripture requires at least [JUDGEMENT_SERVANT_REQ] Servants, [JUDGEMENT_CACHE_REQ] Tinkerer's Caches, and [JUDGEMENT_CV_REQ]CV.
In addition, there may not be any active non-Servant AIs.
" + if(SSticker.scripture_states[SCRIPTURE_JUDGEMENT]) + data["tier_info"] = "This scripture is permenantly unlocked." + else + data["tier_info"] = "This scripture requires at least [JUDGEMENT_SERVANT_REQ] Servants, [JUDGEMENT_CACHE_REQ] Tinkerer's Caches, and [JUDGEMENT_CV_REQ]CV.
In addition, there may not be any active non-Servant AIs.
" data["selected"] = selected_scripture