From 1772364c3f03f831f2de98d0e241e40943b273b2 Mon Sep 17 00:00:00 2001 From: Joan Lung Date: Mon, 4 Jul 2016 18:13:08 -0400 Subject: [PATCH 1/7] Scripture being locked or unlocked is now announced to servants and ghosts --- code/game/gamemodes/clock_cult/clock_cult.dm | 4 +++ .../gamemodes/clock_cult/clock_structures.dm | 8 ++++++ .../gamemodes/clock_cult/clock_unsorted.dm | 25 +++++++++++++++++++ 3 files changed, 37 insertions(+) diff --git a/code/game/gamemodes/clock_cult/clock_cult.dm b/code/game/gamemodes/clock_cult/clock_cult.dm index 5b91c3dffca..4915e8ec1b3 100644 --- a/code/game/gamemodes/clock_cult/clock_cult.dm +++ b/code/game/gamemodes/clock_cult/clock_cult.dm @@ -91,7 +91,9 @@ This file's folder contains: M.visible_message("[M]'s eyes glow a blazing yellow!", \ "Assist your new companions in their righteous efforts. Your goal is theirs, and theirs yours. You serve the Clockwork Justiciar above all else. Perform his every \ whim without hesitation.") + var/list/scripture_states = get_scripture_states() ticker.mode.servants_of_ratvar += M.mind + scripture_unlock_alert(scripture_states) ticker.mode.update_servant_icons_added(M.mind) M.mind.special_role = "Servant of Ratvar" M.languages_spoken |= RATVAR @@ -120,7 +122,9 @@ This file's folder contains: if(!silent) M.visible_message("[M] seems to have remembered their true allegiance!", \ "A cold, cold darkness flows through your mind, extinguishing the Justiciar's light and all of your memories as his servant.") + var/list/scripture_states = get_scripture_states() ticker.mode.servants_of_ratvar -= M.mind + scripture_unlock_alert(scripture_states) ticker.mode.update_servant_icons_removed(M.mind) all_clockwork_mobs -= M M.mind.memory = "" //Not sure if there's a better way to do this diff --git a/code/game/gamemodes/clock_cult/clock_structures.dm b/code/game/gamemodes/clock_cult/clock_structures.dm index d0627ce6ea4..6c4f40b24fb 100644 --- a/code/game/gamemodes/clock_cult/clock_structures.dm +++ b/code/game/gamemodes/clock_cult/clock_structures.dm @@ -24,11 +24,15 @@ /obj/structure/clockwork/New() ..() + var/list/scripture_states = get_scripture_states() clockwork_construction_value += construction_value + scripture_unlock_alert(scripture_states) all_clockwork_objects += src /obj/structure/clockwork/Destroy() + var/list/scripture_states = get_scripture_states() clockwork_construction_value -= construction_value + scripture_unlock_alert(scripture_states) all_clockwork_objects -= src return ..() @@ -155,11 +159,15 @@ /obj/structure/clockwork/cache/New() ..() START_PROCESSING(SSobj, src) + var/list/scripture_states = get_scripture_states() clockwork_caches++ + scripture_unlock_alert(scripture_states) SetLuminosity(2,1) /obj/structure/clockwork/cache/Destroy() + var/list/scripture_states = get_scripture_states() clockwork_caches-- + scripture_unlock_alert(scripture_states) STOP_PROCESSING(SSobj, src) return ..() diff --git a/code/game/gamemodes/clock_cult/clock_unsorted.dm b/code/game/gamemodes/clock_cult/clock_unsorted.dm index 9f8e0707f08..669e8715d4f 100644 --- a/code/game/gamemodes/clock_cult/clock_unsorted.dm +++ b/code/game/gamemodes/clock_cult/clock_unsorted.dm @@ -11,6 +11,19 @@ M << parsed_message return 1 +/proc/generic_hierophant_message(message, servantsonly, atom/target) //sends a generic message to all servants and optionally observers + if(!message || !ticker || !ticker.mode) + return 0 + for(var/M in mob_list) + if(!servantsonly && isobserver(M)) + if(target) + var/link = FOLLOW_LINK(M, target) + M << "[link] [message]" + else + M << message + if(is_servant_of_ratvar(M)) + M << message + //Function Call action: Calls forth a Ratvarian spear. /datum/action/innate/function_call name = "Function Call" @@ -111,6 +124,18 @@ return 1 //12 or more non-brain servants, 5+ clockwork caches, at least 250 CV, and there are no living, non-servant ais return 0 +/proc/scripture_unlock_alert(list/previous_states) //reports to servants when scripture is locked or unlocked + var/list/states = get_scripture_states() + for(var/i in states) + if(states[i] != previous_states[i]) + generic_hierophant_message("[i] Scripture has been [states[i] ? "un":""]locked.") + +/proc/get_scripture_states() //returns the current unlock states of each unlockable scripture tier + . = list("Script" = scripture_unlock_check(SCRIPTURE_SCRIPT), \ + "Application" = scripture_unlock_check(SCRIPTURE_APPLICATION), \ + "Revenant" = scripture_unlock_check(SCRIPTURE_REVENANT), \ + "Judgement" = scripture_unlock_check(SCRIPTURE_JUDGEMENT)) + /proc/generate_cache_component(specific_component_id) //generates a component in the global component cache, either random based on lowest or a specific component if(specific_component_id) clockwork_component_cache[specific_component_id]++ From fb994df5689d4648a373b19ddce712c9737d0259 Mon Sep 17 00:00:00 2001 From: Joan Lung Date: Mon, 4 Jul 2016 18:16:55 -0400 Subject: [PATCH 2/7] wallsnfloors too --- code/game/turfs/simulated/floor/misc_floor.dm | 4 ++++ code/game/turfs/simulated/walls_misc.dm | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/code/game/turfs/simulated/floor/misc_floor.dm b/code/game/turfs/simulated/floor/misc_floor.dm index 98d64b763cb..7bbd4aa8b98 100644 --- a/code/game/turfs/simulated/floor/misc_floor.dm +++ b/code/game/turfs/simulated/floor/misc_floor.dm @@ -123,11 +123,15 @@ ..() PoolOrNew(/obj/effect/overlay/temp/ratvar/floor, src) PoolOrNew(/obj/effect/overlay/temp/ratvar/beam, src) + var/list/scripture_states = get_scripture_states() clockwork_construction_value++ + scripture_unlock_alert(scripture_states) /turf/open/floor/clockwork/Destroy() STOP_PROCESSING(SSobj, src) + var/list/scripture_states = get_scripture_states() clockwork_construction_value-- + scripture_unlock_alert(scripture_states) return ..() /turf/open/floor/clockwork/Entered(atom/movable/AM) diff --git a/code/game/turfs/simulated/walls_misc.dm b/code/game/turfs/simulated/walls_misc.dm index 60c457c86f8..fdb1b7039bc 100644 --- a/code/game/turfs/simulated/walls_misc.dm +++ b/code/game/turfs/simulated/walls_misc.dm @@ -53,11 +53,15 @@ ..() PoolOrNew(/obj/effect/overlay/temp/ratvar/wall, src) PoolOrNew(/obj/effect/overlay/temp/ratvar/beam, src) + var/list/scripture_states = get_scripture_states() clockwork_construction_value += 5 + scripture_unlock_alert(scripture_states) /turf/closed/wall/clockwork/Destroy() + var/list/scripture_states = get_scripture_states() clockwork_construction_value -= 5 - ..() + scripture_unlock_alert(scripture_states) + return ..() /turf/closed/wall/clockwork/attackby(obj/item/I, mob/living/user, params) if(istype(I, /obj/item/weapon/weldingtool)) From 5f6db6e3224573ec1aa6b3b72f918844e794386d Mon Sep 17 00:00:00 2001 From: Joan Lung Date: Mon, 4 Jul 2016 18:24:14 -0400 Subject: [PATCH 3/7] proc --- code/game/gamemodes/clock_cult/clock_structures.dm | 8 ++------ code/game/gamemodes/clock_cult/clock_unsorted.dm | 5 +++++ code/game/turfs/simulated/floor/misc_floor.dm | 8 ++------ code/game/turfs/simulated/walls_misc.dm | 8 ++------ 4 files changed, 11 insertions(+), 18 deletions(-) diff --git a/code/game/gamemodes/clock_cult/clock_structures.dm b/code/game/gamemodes/clock_cult/clock_structures.dm index 6c4f40b24fb..606e802f9de 100644 --- a/code/game/gamemodes/clock_cult/clock_structures.dm +++ b/code/game/gamemodes/clock_cult/clock_structures.dm @@ -24,15 +24,11 @@ /obj/structure/clockwork/New() ..() - var/list/scripture_states = get_scripture_states() - clockwork_construction_value += construction_value - scripture_unlock_alert(scripture_states) + change_construction_value(construction_value) all_clockwork_objects += src /obj/structure/clockwork/Destroy() - var/list/scripture_states = get_scripture_states() - clockwork_construction_value -= construction_value - scripture_unlock_alert(scripture_states) + change_construction_value(-construction_value) all_clockwork_objects -= src return ..() diff --git a/code/game/gamemodes/clock_cult/clock_unsorted.dm b/code/game/gamemodes/clock_cult/clock_unsorted.dm index 669e8715d4f..9a95daec151 100644 --- a/code/game/gamemodes/clock_cult/clock_unsorted.dm +++ b/code/game/gamemodes/clock_cult/clock_unsorted.dm @@ -136,6 +136,11 @@ "Revenant" = scripture_unlock_check(SCRIPTURE_REVENANT), \ "Judgement" = scripture_unlock_check(SCRIPTURE_JUDGEMENT)) +/proc/change_construction_value(amount) + var/list/scripture_states = get_scripture_states() + clockwork_construction_value += amount + scripture_unlock_alert(scripture_states) + /proc/generate_cache_component(specific_component_id) //generates a component in the global component cache, either random based on lowest or a specific component if(specific_component_id) clockwork_component_cache[specific_component_id]++ diff --git a/code/game/turfs/simulated/floor/misc_floor.dm b/code/game/turfs/simulated/floor/misc_floor.dm index 7bbd4aa8b98..e064c9fb223 100644 --- a/code/game/turfs/simulated/floor/misc_floor.dm +++ b/code/game/turfs/simulated/floor/misc_floor.dm @@ -123,15 +123,11 @@ ..() PoolOrNew(/obj/effect/overlay/temp/ratvar/floor, src) PoolOrNew(/obj/effect/overlay/temp/ratvar/beam, src) - var/list/scripture_states = get_scripture_states() - clockwork_construction_value++ - scripture_unlock_alert(scripture_states) + change_construction_value(1) /turf/open/floor/clockwork/Destroy() STOP_PROCESSING(SSobj, src) - var/list/scripture_states = get_scripture_states() - clockwork_construction_value-- - scripture_unlock_alert(scripture_states) + change_construction_value(-1) return ..() /turf/open/floor/clockwork/Entered(atom/movable/AM) diff --git a/code/game/turfs/simulated/walls_misc.dm b/code/game/turfs/simulated/walls_misc.dm index fdb1b7039bc..bd50729b08a 100644 --- a/code/game/turfs/simulated/walls_misc.dm +++ b/code/game/turfs/simulated/walls_misc.dm @@ -53,14 +53,10 @@ ..() PoolOrNew(/obj/effect/overlay/temp/ratvar/wall, src) PoolOrNew(/obj/effect/overlay/temp/ratvar/beam, src) - var/list/scripture_states = get_scripture_states() - clockwork_construction_value += 5 - scripture_unlock_alert(scripture_states) + change_construction_value(5) /turf/closed/wall/clockwork/Destroy() - var/list/scripture_states = get_scripture_states() - clockwork_construction_value -= 5 - scripture_unlock_alert(scripture_states) + change_construction_value(-5) return ..() /turf/closed/wall/clockwork/attackby(obj/item/I, mob/living/user, params) From 03156862355fc1c032b6052608605d2b708103fa Mon Sep 17 00:00:00 2001 From: Joan Lung Date: Mon, 4 Jul 2016 18:40:07 -0400 Subject: [PATCH 4/7] allalerts nobody reviews my stuff anyway so they won't call me on it --- code/modules/mob/living/death.dm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/code/modules/mob/living/death.dm b/code/modules/mob/living/death.dm index fc1bf88240b..70530432c29 100644 --- a/code/modules/mob/living/death.dm +++ b/code/modules/mob/living/death.dm @@ -54,7 +54,9 @@ message_type=DEADCHAT_DEATHRATTLE) if(mind) mind.store_memory("Time of death: [tod]", 0) + var/list/scripture_states = get_scripture_states() living_mob_list -= src + scripture_unlock_alert(scripture_states) if(!gibbed) dead_mob_list += src else if(buckled) From ab2fca0a49cefed870df8912af1ec6c11d1daa4b Mon Sep 17 00:00:00 2001 From: Joan Lung Date: Mon, 4 Jul 2016 20:55:15 -0400 Subject: [PATCH 5/7] does anyone review my shit --- code/game/gamemodes/clock_cult/clock_items.dm | 2 +- .../gamemodes/clock_cult/clock_machines.dm | 2 +- .../gamemodes/clock_cult/clock_unsorted.dm | 18 +++++++----------- code/game/turfs/simulated/floor/misc_floor.dm | 7 +++++++ code/game/turfs/simulated/walls_misc.dm | 8 +++++++- .../friendly/drone/extra_drone_types.dm | 2 +- 6 files changed, 24 insertions(+), 15 deletions(-) diff --git a/code/game/gamemodes/clock_cult/clock_items.dm b/code/game/gamemodes/clock_cult/clock_items.dm index a4d2bd5c0f3..d90421efac0 100644 --- a/code/game/gamemodes/clock_cult/clock_items.dm +++ b/code/game/gamemodes/clock_cult/clock_items.dm @@ -363,7 +363,7 @@ if(!message || !user || !user.canUseTopic(src)) return 0 user.whisper("Freinagf, urne zl jbeqf. [message]") - send_hierophant_message(user, message) + titled_hierophant_message(user, message) return 1 /obj/item/clothing/glasses/wraith_spectacles //Wraith spectacles: Grants night and x-ray vision at the slow cost of the wearer's sight. Nar-Sian cultists are instantly blinded. diff --git a/code/game/gamemodes/clock_cult/clock_machines.dm b/code/game/gamemodes/clock_cult/clock_machines.dm index 8db2ed225b2..7dd3801683f 100644 --- a/code/game/gamemodes/clock_cult/clock_machines.dm +++ b/code/game/gamemodes/clock_cult/clock_machines.dm @@ -579,7 +579,7 @@ user << "The obelisk lacks the power to broadcast!" return clockwork_say(user, "Uvrebcunag Oebnqpnfg, npgvingr!") - send_hierophant_message(user, input, "big_brass", "large_brass") + titled_hierophant_message(user, input, "big_brass", "large_brass") if("Spatial Gateway") if(gateway_active) user << "The obelisk is already sustaining a gateway!" diff --git a/code/game/gamemodes/clock_cult/clock_unsorted.dm b/code/game/gamemodes/clock_cult/clock_unsorted.dm index 9a95daec151..2eb25ec3765 100644 --- a/code/game/gamemodes/clock_cult/clock_unsorted.dm +++ b/code/game/gamemodes/clock_cult/clock_unsorted.dm @@ -1,17 +1,13 @@ //sends messages via hierophant -/proc/send_hierophant_message(mob/user, message, name_span = "heavy_brass", message_span = "brass", user_title = "Servant") +/proc/titled_hierophant_message(mob/user, message, name_span = "heavy_brass", message_span = "brass", user_title = "Servant") if(!user || !message || !ticker || !ticker.mode) return 0 - var/parsed_message = "[user_title ? "[user_title] ":""][findtextEx(user.name, user.real_name) ? user.name : "[user.real_name] (as [user.name])"]: \"[message]\"" - for(var/M in mob_list) - if(isobserver(M)) - var/link = FOLLOW_LINK(M, user) - M << "[link] [parsed_message]" - else if(is_servant_of_ratvar(M)) - M << parsed_message + var/parsed_message = "[user_title ? "[user_title] ":""][findtextEx(user.name, user.real_name) ? user.name : "[user.real_name] (as [user.name])"]: \ + \"[message]\"" + hierophant_message(parsed_message, FALSE, user) return 1 -/proc/generic_hierophant_message(message, servantsonly, atom/target) //sends a generic message to all servants and optionally observers +/proc/hierophant_message(message, servantsonly, atom/target) //sends a generic message to all servants and optionally observers if(!message || !ticker || !ticker.mode) return 0 for(var/M in mob_list) @@ -21,7 +17,7 @@ M << "[link] [message]" else M << message - if(is_servant_of_ratvar(M)) + else if(is_servant_of_ratvar(M)) M << message //Function Call action: Calls forth a Ratvarian spear. @@ -128,7 +124,7 @@ var/list/states = get_scripture_states() for(var/i in states) if(states[i] != previous_states[i]) - generic_hierophant_message("[i] Scripture has been [states[i] ? "un":""]locked.") + hierophant_message("Hierophant Network: [i] Scripture has been [states[i] ? "un":""]locked.") /proc/get_scripture_states() //returns the current unlock states of each unlockable scripture tier . = list("Script" = scripture_unlock_check(SCRIPTURE_SCRIPT), \ diff --git a/code/game/turfs/simulated/floor/misc_floor.dm b/code/game/turfs/simulated/floor/misc_floor.dm index e064c9fb223..5658b335c88 100644 --- a/code/game/turfs/simulated/floor/misc_floor.dm +++ b/code/game/turfs/simulated/floor/misc_floor.dm @@ -130,6 +130,11 @@ change_construction_value(-1) return ..() +/turf/open/floor/clockwork/ChangeTurf(path, defer_change = FALSE) + if(path != type) + change_construction_value(-1) + return ..() + /turf/open/floor/clockwork/Entered(atom/movable/AM) ..() START_PROCESSING(SSobj, src) @@ -160,9 +165,11 @@ /turf/open/floor/clockwork/attackby(obj/item/I, mob/living/user, params) if(istype(I, /obj/item/weapon/crowbar)) user.visible_message("[user] begins slowly prying up [src]...", "You begin painstakingly prying up [src]...") + playsound(src, 'sound/items/Crowbar.ogg', 20, 1) if(!do_after(user, 70 / I.toolspeed, target = src)) return 0 user.visible_message("[user] pries up [src]!", "You pry up [src], destroying it!") + playsound(src, 'sound/items/Crowbar.ogg', 80, 1) make_plating() return 1 return ..() diff --git a/code/game/turfs/simulated/walls_misc.dm b/code/game/turfs/simulated/walls_misc.dm index bd50729b08a..ded0bf46834 100644 --- a/code/game/turfs/simulated/walls_misc.dm +++ b/code/game/turfs/simulated/walls_misc.dm @@ -59,11 +59,17 @@ change_construction_value(-5) return ..() +/turf/closed/wall/clockwork/ChangeTurf(path, defer_change = FALSE) + if(path != type) + change_construction_value(-5) + return ..() + /turf/closed/wall/clockwork/attackby(obj/item/I, mob/living/user, params) if(istype(I, /obj/item/weapon/weldingtool)) var/obj/item/weapon/weldingtool/WT = I - if(!WT.isOn()) + if(!WT.remove_fuel(0,user)) return 0 + playsound(src, 'sound/items/Welder.ogg', 100, 1) user.visible_message("[user] begins slowly breaking down [src]...", "You begin painstakingly destroying [src]...") if(!do_after(user, 120 / WT.toolspeed, target = src)) return 0 diff --git a/code/modules/mob/living/simple_animal/friendly/drone/extra_drone_types.dm b/code/modules/mob/living/simple_animal/friendly/drone/extra_drone_types.dm index 8a5478dedcb..dee327d9de4 100644 --- a/code/modules/mob/living/simple_animal/friendly/drone/extra_drone_types.dm +++ b/code/modules/mob/living/simple_animal/friendly/drone/extra_drone_types.dm @@ -138,4 +138,4 @@ return //we don't get hacked or give a shit about it /mob/living/simple_animal/drone/cogscarab/drone_chat(msg) - send_hierophant_message(src, msg, "heavy_alloy") //HIEROPHANT DRONES + titled_hierophant_message(src, msg, "heavy_alloy") //HIEROPHANT DRONES From 8fe082ac76544f2f251d77c9b60062a5208cbbd7 Mon Sep 17 00:00:00 2001 From: Joan Lung Date: Tue, 5 Jul 2016 07:07:38 -0400 Subject: [PATCH 6/7] stop --- code/game/turfs/simulated/floor/misc_floor.dm | 1 + 1 file changed, 1 insertion(+) diff --git a/code/game/turfs/simulated/floor/misc_floor.dm b/code/game/turfs/simulated/floor/misc_floor.dm index 5658b335c88..79d45dd78f2 100644 --- a/code/game/turfs/simulated/floor/misc_floor.dm +++ b/code/game/turfs/simulated/floor/misc_floor.dm @@ -132,6 +132,7 @@ /turf/open/floor/clockwork/ChangeTurf(path, defer_change = FALSE) if(path != type) + STOP_PROCESSING(SSobj, src) change_construction_value(-1) return ..() From f5a0ef1a1aafd95e6df031d92744d1985bde6204 Mon Sep 17 00:00:00 2001 From: Joan Lung Date: Tue, 5 Jul 2016 15:36:28 -0400 Subject: [PATCH 7/7] - --- code/game/gamemodes/clock_cult/clock_items.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/gamemodes/clock_cult/clock_items.dm b/code/game/gamemodes/clock_cult/clock_items.dm index d90421efac0..afd4a3dc9e0 100644 --- a/code/game/gamemodes/clock_cult/clock_items.dm +++ b/code/game/gamemodes/clock_cult/clock_items.dm @@ -362,7 +362,7 @@ var/message = stripped_input(user, "Enter a message to send to your fellow servants.", "Hierophant") if(!message || !user || !user.canUseTopic(src)) return 0 - user.whisper("Freinagf, urne zl jbeqf. [message]") + user.whisper("Freinagf, urne zl-jbeqf. [message]") titled_hierophant_message(user, message) return 1