From 5cb2c2152b6008f57651d094c3f13a9f6ea9bead Mon Sep 17 00:00:00 2001 From: CitadelStationBot Date: Mon, 1 May 2017 12:50:33 -0500 Subject: [PATCH 1/3] Clockcult component generation will automatically focus on components needed to activate the Ark --- code/_onclick/hud/alert.dm | 1 + .../clock_helpers/component_helpers.dm.rej | 34 +++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 code/game/gamemodes/clock_cult/clock_helpers/component_helpers.dm.rej diff --git a/code/_onclick/hud/alert.dm b/code/_onclick/hud/alert.dm index 9c8fe9750a..b376706a42 100644 --- a/code/_onclick/hud/alert.dm +++ b/code/_onclick/hud/alert.dm @@ -393,6 +393,7 @@ or shoot a gun to move around via Newton's 3rd Law of Motion." textlist += "
" else textlist += "Seconds until Ratvar's arrival: [G.get_arrival_text(TRUE)]
" + break if(unconverted_ais_exist) if(unconverted_ais_exist > 1) textlist += "[unconverted_ais_exist] unconverted AIs exist!
" diff --git a/code/game/gamemodes/clock_cult/clock_helpers/component_helpers.dm.rej b/code/game/gamemodes/clock_cult/clock_helpers/component_helpers.dm.rej new file mode 100644 index 0000000000..339ebbc352 --- /dev/null +++ b/code/game/gamemodes/clock_cult/clock_helpers/component_helpers.dm.rej @@ -0,0 +1,34 @@ +diff a/code/game/gamemodes/clock_cult/clock_helpers/component_helpers.dm b/code/game/gamemodes/clock_cult/clock_helpers/component_helpers.dm (rejected hunks) +@@ -2,7 +2,7 @@ + /proc/generate_cache_component(specific_component_id, atom/A) + if(!specific_component_id) + specific_component_id = get_weighted_component_id() +- clockwork_component_cache[specific_component_id]++ ++ GLOB.clockwork_component_cache[specific_component_id]++ + if(A) + var/component_animation_type = get_component_animation_type(specific_component_id) + new component_animation_type(get_turf(A)) +@@ -13,16 +13,16 @@ + /proc/get_weighted_component_id(obj/item/clockwork/slab/storage_slab) + . = list() + if(storage_slab) +- if(clockwork_caches) +- for(var/i in clockwork_component_cache) +- .[i] = max(MAX_COMPONENTS_BEFORE_RAND - LOWER_PROB_PER_COMPONENT*(clockwork_component_cache[i] + storage_slab.stored_components[i]), 1) ++ if(GLOB.clockwork_caches) ++ for(var/i in GLOB.clockwork_component_cache) ++ .[i] = max(MAX_COMPONENTS_BEFORE_RAND - LOWER_PROB_PER_COMPONENT*(GLOB.clockwork_component_cache[i] + storage_slab.stored_components[i]), 1) + else +- for(var/i in clockwork_component_cache) ++ for(var/i in GLOB.clockwork_component_cache) + .[i] = max(MAX_COMPONENTS_BEFORE_RAND - LOWER_PROB_PER_COMPONENT*storage_slab.stored_components[i], 1) + else +- for(var/i in clockwork_component_cache) +- .[i] = max(MAX_COMPONENTS_BEFORE_RAND - LOWER_PROB_PER_COMPONENT*clockwork_component_cache[i], 1) +- for(var/obj/structure/destructible/clockwork/massive/celestial_gateway/G in all_clockwork_objects) ++ for(var/i in GLOB.clockwork_component_cache) ++ .[i] = max(MAX_COMPONENTS_BEFORE_RAND - LOWER_PROB_PER_COMPONENT*GLOB.clockwork_component_cache[i], 1) ++ for(var/obj/structure/destructible/clockwork/massive/celestial_gateway/G in GLOB.all_clockwork_objects) + if(G.still_needs_components()) + for(var/i in G.required_components) + if(!G.required_components[i]) From a7a32e6127efa03401910ba6fe9514762bb7e01d Mon Sep 17 00:00:00 2001 From: LetterJay Date: Fri, 12 May 2017 23:03:27 -0500 Subject: [PATCH 2/3] commit --- .../clock_helpers/component_helpers.dm | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/code/game/gamemodes/clock_cult/clock_helpers/component_helpers.dm b/code/game/gamemodes/clock_cult/clock_helpers/component_helpers.dm index e3c456460c..120ed0ff60 100644 --- a/code/game/gamemodes/clock_cult/clock_helpers/component_helpers.dm +++ b/code/game/gamemodes/clock_cult/clock_helpers/component_helpers.dm @@ -22,6 +22,12 @@ else for(var/i in GLOB.clockwork_component_cache) .[i] = max(MAX_COMPONENTS_BEFORE_RAND - LOWER_PROB_PER_COMPONENT*GLOB.clockwork_component_cache[i], 1) + for(var/obj/structure/destructible/clockwork/massive/celestial_gateway/G in GLOB.all_clockwork_objects) + if(G.still_needs_components()) + for(var/i in G.required_components) + if(!G.required_components[i]) + . -= i + break . = pickweight(.) //returns a component name from a component id @@ -37,6 +43,8 @@ return "Replicant Alloy" if(HIEROPHANT_ANSIBLE) return "Hierophant Ansible" + else + return null //returns a component acronym from a component id /proc/get_component_acronym(id) @@ -51,6 +59,8 @@ return "RA" if(HIEROPHANT_ANSIBLE) return "HA" + else + return null //returns a component id from a component name /proc/get_component_id(name) @@ -65,6 +75,8 @@ return REPLICANT_ALLOY if("Hierophant Ansible") return HIEROPHANT_ANSIBLE + else + return null //returns a component spanclass from a component id /proc/get_component_span(id) @@ -121,6 +133,8 @@ return /obj/effect/overlay/temp/ratvar/component/alloy if(HIEROPHANT_ANSIBLE) return /obj/effect/overlay/temp/ratvar/component/ansible + else + return null //returns a type for a component from a component id /proc/get_component_type(id) @@ -134,4 +148,6 @@ if(REPLICANT_ALLOY) return /obj/item/clockwork/component/replicant_alloy if(HIEROPHANT_ANSIBLE) - return /obj/item/clockwork/component/hierophant_ansible \ No newline at end of file + return /obj/item/clockwork/component/hierophant_ansible + else + return null \ No newline at end of file From 18bb37f34a0918e7cb3c574793249cd021aca306 Mon Sep 17 00:00:00 2001 From: LetterJay Date: Fri, 12 May 2017 23:03:48 -0500 Subject: [PATCH 3/3] rej remove --- .../clock_helpers/component_helpers.dm.rej | 34 ------------------- 1 file changed, 34 deletions(-) delete mode 100644 code/game/gamemodes/clock_cult/clock_helpers/component_helpers.dm.rej diff --git a/code/game/gamemodes/clock_cult/clock_helpers/component_helpers.dm.rej b/code/game/gamemodes/clock_cult/clock_helpers/component_helpers.dm.rej deleted file mode 100644 index 339ebbc352..0000000000 --- a/code/game/gamemodes/clock_cult/clock_helpers/component_helpers.dm.rej +++ /dev/null @@ -1,34 +0,0 @@ -diff a/code/game/gamemodes/clock_cult/clock_helpers/component_helpers.dm b/code/game/gamemodes/clock_cult/clock_helpers/component_helpers.dm (rejected hunks) -@@ -2,7 +2,7 @@ - /proc/generate_cache_component(specific_component_id, atom/A) - if(!specific_component_id) - specific_component_id = get_weighted_component_id() -- clockwork_component_cache[specific_component_id]++ -+ GLOB.clockwork_component_cache[specific_component_id]++ - if(A) - var/component_animation_type = get_component_animation_type(specific_component_id) - new component_animation_type(get_turf(A)) -@@ -13,16 +13,16 @@ - /proc/get_weighted_component_id(obj/item/clockwork/slab/storage_slab) - . = list() - if(storage_slab) -- if(clockwork_caches) -- for(var/i in clockwork_component_cache) -- .[i] = max(MAX_COMPONENTS_BEFORE_RAND - LOWER_PROB_PER_COMPONENT*(clockwork_component_cache[i] + storage_slab.stored_components[i]), 1) -+ if(GLOB.clockwork_caches) -+ for(var/i in GLOB.clockwork_component_cache) -+ .[i] = max(MAX_COMPONENTS_BEFORE_RAND - LOWER_PROB_PER_COMPONENT*(GLOB.clockwork_component_cache[i] + storage_slab.stored_components[i]), 1) - else -- for(var/i in clockwork_component_cache) -+ for(var/i in GLOB.clockwork_component_cache) - .[i] = max(MAX_COMPONENTS_BEFORE_RAND - LOWER_PROB_PER_COMPONENT*storage_slab.stored_components[i], 1) - else -- for(var/i in clockwork_component_cache) -- .[i] = max(MAX_COMPONENTS_BEFORE_RAND - LOWER_PROB_PER_COMPONENT*clockwork_component_cache[i], 1) -- for(var/obj/structure/destructible/clockwork/massive/celestial_gateway/G in all_clockwork_objects) -+ for(var/i in GLOB.clockwork_component_cache) -+ .[i] = max(MAX_COMPONENTS_BEFORE_RAND - LOWER_PROB_PER_COMPONENT*GLOB.clockwork_component_cache[i], 1) -+ for(var/obj/structure/destructible/clockwork/massive/celestial_gateway/G in GLOB.all_clockwork_objects) - if(G.still_needs_components()) - for(var/i in G.required_components) - if(!G.required_components[i])