Clockcult component generation will automatically focus on components needed to activate the Ark

This commit is contained in:
CitadelStationBot
2017-05-01 12:50:33 -05:00
parent 1842665af6
commit 5cb2c2152b
2 changed files with 35 additions and 0 deletions
+1
View File
@@ -393,6 +393,7 @@ or shoot a gun to move around via Newton's 3rd Law of Motion."
textlist += "<br>"
else
textlist += "Seconds until Ratvar's arrival: <b>[G.get_arrival_text(TRUE)]</b><br>"
break
if(unconverted_ais_exist)
if(unconverted_ais_exist > 1)
textlist += "<b>[unconverted_ais_exist] unconverted AIs exist!</b><br>"
@@ -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])