removes the still unused caches and daemons.

apparently I didn't /actually/ remove the structures fully but here's the rest of them. Oh well, RIP old clockcult buildings, maybe someone will have a use for you in the future.
This commit is contained in:
Keate Senior
2020-07-16 02:34:20 -04:00
parent 287df312e1
commit 17ef5b4742
3 changed files with 1 additions and 312 deletions
@@ -23,7 +23,7 @@
quickbind = TRUE
quickbind_desc = "Creates a Sigil of Transmission, which can drain and will store power for clockwork structures."
/*//Prolonging Prism: Creates a prism that will delay the shuttle at a power cost
//Prolonging Prism: Creates a prism that will delay the shuttle at a power cost
/datum/clockwork_scripture/create_object/prolonging_prism
descname = "Powered Structure, Delay Emergency Shuttles"
name = "Prolonging Prism"
@@ -56,30 +56,6 @@
return ..()
//Tinkerer's Daemon: Creates an efficient machine that rapidly produces components at a power cost.
/datum/clockwork_scripture/create_object/tinkerers_daemon
descname = "Powered Structure, Component Generator"
name = "Tinkerer's Daemon"
desc = "Creates a tinkerer's daemon which can rapidly collect components. It will only function if it has sufficient power, active daemons are outnumbered by Servants by a ratio of 5:1, \
and there is at least one existing cache."
invocations = list("May this generator...", "...collect Engine parts that yet hold greatness!")
channel_time = 80
consumed_components = list(BELLIGERENT_EYE = 2, GEIS_CAPACITOR = 2, REPLICANT_ALLOY = 5)
object_path = /obj/structure/destructible/clockwork/powered/tinkerers_daemon
creator_message = "<span class='brass'>You form a tinkerer's daemon which can rapidly collect components at a power cost.</span>"
invokers_required = 2
multiple_invokers_used = TRUE
usage_tip = "Vital to your success!"
tier = SCRIPTURE_APPLICATION
one_per_tile = TRUE
primary_component = REPLICANT_ALLOY
sort_priority = 9
quickbind = TRUE
quickbind_desc = "Creates a Tinkerer's Daemon, which can rapidly collect components for power."
*/
//Mania Motor: Creates a malevolent transmitter that will broadcast the whispers of Sevtug into the minds of nearby nonservants, causing a variety of mental effects at a power cost.
/datum/clockwork_scripture/create_object/mania_motor
descname = "Powered Structure, Area Denial"
@@ -1,116 +0,0 @@
//Tinkerer's cache: Stores components for later use.
/obj/structure/destructible/clockwork/cache
name = "tinkerer's cache"
desc = "A large brass spire with a flaming hole in its center."
clockwork_desc = "A brass container capable of storing a large amount of components.\n\
Shares components with all other caches and will gradually generate components if near a Clockwork Wall."
icon_state = "tinkerers_cache"
unanchored_icon = "tinkerers_cache_unwrenched"
construction_value = 10
break_message = "<span class='warning'>The cache's fire winks out before it falls in on itself!</span>"
max_integrity = 80
light_color = "#C2852F"
var/wall_generation_cooldown
var/turf/closed/wall/clockwork/linkedwall //if we've got a linked wall and are producing
var/static/linked_caches = 0 //how many caches are linked to walls; affects how fast components are produced
/obj/structure/destructible/clockwork/cache/Initialize()
. = ..()
START_PROCESSING(SSobj, src)
GLOB.clockwork_caches++
update_slab_info()
set_light(2, 0.7)
/obj/structure/destructible/clockwork/cache/Destroy()
GLOB.clockwork_caches--
update_slab_info()
STOP_PROCESSING(SSobj, src)
if(linkedwall)
linked_caches--
linkedwall.linkedcache = null
linkedwall = null
return ..()
/obj/structure/destructible/clockwork/cache/process()
if(!anchored)
if(linkedwall)
linked_caches--
linkedwall.linkedcache = null
linkedwall = null
return
for(var/turf/closed/wall/clockwork/C in range(4, src))
if(!C.linkedcache && !linkedwall)
linked_caches++
C.linkedcache = src
linkedwall = C
wall_generation_cooldown = world.time + get_production_time()
visible_message("<span class='warning'>[src] starts to whirr in the presence of [C]...</span>")
break
if(linkedwall && wall_generation_cooldown <= world.time)
wall_generation_cooldown = world.time + get_production_time()
var/component_id = generate_cache_component(null, src)
playsound(linkedwall, 'sound/magic/clockwork/fellowship_armory.ogg', rand(15, 20), 1, -3, 1, 1)
visible_message("<span class='[get_component_span(component_id)]'>Something</span><span class='warning'> cl[pick("ank", "ink", "unk", "ang")]s around inside of [src]...</span>")
/obj/structure/destructible/clockwork/cache/attackby(obj/item/I, mob/living/user, params)
if(!is_servant_of_ratvar(user))
return ..()
if(istype(I, /obj/item/clockwork/component))
var/obj/item/clockwork/component/C = I
if(!anchored)
to_chat(user, "<span class='warning'>[src] needs to be secured to place [C] into it!</span>")
else
GLOB.clockwork_component_cache[C.component_id]++
update_slab_info()
to_chat(user, "<span class='notice'>You add [C] to [src].</span>")
user.drop_item()
qdel(C)
return 1
else if(istype(I, /obj/item/clockwork/slab))
var/obj/item/clockwork/slab/S = I
if(!anchored)
to_chat(user, "<span class='warning'>[src] needs to be secured to offload your slab's components into it!</span>")
else
for(var/i in S.stored_components)
GLOB.clockwork_component_cache[i] += S.stored_components[i]
S.stored_components[i] = 0
update_slab_info()
user.visible_message("<span class='notice'>[user] empties [S] into [src].</span>", "<span class='notice'>You offload your slab's components into [src].</span>")
return 1
else
return ..()
/obj/structure/destructible/clockwork/cache/update_anchored(mob/user, do_damage)
..()
if(anchored)
set_light(2, 0.7)
else
set_light(0)
/obj/structure/destructible/clockwork/cache/attack_hand(mob/living/user)
..()
if(is_servant_of_ratvar(user))
if(linkedwall)
if(wall_generation_cooldown > world.time)
var/temp_time = (wall_generation_cooldown - world.time) * 0.1
to_chat(user, "<span class='alloy'>[src] will produce a component in <b>[temp_time]</b> second[temp_time == 1 ? "":"s"].</span>")
else
to_chat(user, "<span class='brass'>[src] is about to produce a component!</span>")
else if(anchored)
to_chat(user, "<span class='alloy'>[src] is unlinked! Construct a Clockwork Wall nearby to generate components!</span>")
else
to_chat(user, "<span class='alloy'>[src] needs to be secured to generate components!</span>")
/obj/structure/destructible/clockwork/cache/examine(mob/user)
..()
if(is_servant_of_ratvar(user) || isobserver(user))
if(linkedwall)
to_chat(user, "<span class='brass'>It is linked to a Clockwork Wall and will generate a component every <b>[DisplayTimeText(get_production_time())]</b>!</span>")
else
to_chat(user, "<span class='alloy'>It is unlinked! Construct a Clockwork Wall nearby to generate components!</span>")
to_chat(user, "<b>Stored components:</b>")
for(var/i in GLOB.clockwork_component_cache)
to_chat(user, "[get_component_icon(i)] <span class='[get_component_span(i)]_small'><i>[get_component_name(i)][i != REPLICANT_ALLOY ? "s":""]:</i> <b>[GLOB.clockwork_component_cache[i]]</b></span>")
/obj/structure/destructible/clockwork/cache/proc/get_production_time()
return (CACHE_PRODUCTION_TIME + (ACTIVE_CACHE_SLOWDOWN * linked_caches)) * get_efficiency_mod(TRUE)
@@ -1,171 +0,0 @@
//Tinkerer's Daemon: A machine that rapidly produces components at a power cost.
/obj/structure/destructible/clockwork/powered/tinkerers_daemon
name = "tinkerer's daemon"
desc = "A strange machine with three small brass obelisks attached to it."
clockwork_desc = "An efficient machine that can rapidly produce components at a small power cost. It will only function if active daemons are outnumbered by servants at a rate to 5:1."
icon_state = "tinkerers_daemon"
active_icon = "tinkerers_daemon"
inactive_icon = "tinkerers_daemon"
unanchored_icon = "tinkerers_daemon_unwrenched"
max_integrity = 100
construction_value = 20
break_message = "<span class='warning'>The daemon shatters into millions of pieces, leaving only a disc of metal!</span>"
debris = list(/obj/item/clockwork/alloy_shards/medium = 1, \
/obj/item/clockwork/alloy_shards/small = 6, \
/obj/item/clockwork/component/replicant_alloy/replication_plate = 1)
var/static/mutable_appearance/daemon_glow = mutable_appearance('icons/obj/clockwork_objects.dmi', "tinkerglow")
var/static/mutable_appearance/component_glow = mutable_appearance('icons/obj/clockwork_objects.dmi', "t_random_component")
var/component_id_to_produce
var/production_time = 0 //last time we produced a component
var/production_cooldown = 70
/obj/structure/destructible/clockwork/powered/tinkerers_daemon/Destroy()
GLOB.active_daemons -= src
return ..()
/obj/structure/destructible/clockwork/powered/tinkerers_daemon/examine(mob/user)
..()
if(is_servant_of_ratvar(user) || isobserver(user))
if(active)
if(component_id_to_produce)
to_chat(user, "<span class='[get_component_span(component_id_to_produce)]_small'>It is currently producing [get_component_name(component_id_to_produce)][component_id_to_produce != REPLICANT_ALLOY ? "s":""].</span>")
else
to_chat(user, "<span class='brass'>It is currently producing random components.</span>")
to_chat(user, "<span class='nezbere_small'>It will produce a component every <b>[round((production_cooldown*0.1) * get_efficiency_mod(TRUE), 0.1)]</b> seconds and requires at least the following power for each component type:</span>")
for(var/i in GLOB.clockwork_component_cache)
to_chat(user, "[get_component_icon(i)] <span class='[get_component_span(i)]_small'><i>[get_component_name(i)]:</i> <b>[DisplayPower(get_component_cost(i))]</b> <i>([GLOB.clockwork_component_cache[i]] exist[GLOB.clockwork_component_cache[i] == 1 ? "s" : ""])</i></span>")
/obj/structure/destructible/clockwork/powered/tinkerers_daemon/forced_disable(bad_effects)
if(active)
if(bad_effects)
try_use_power(MIN_CLOCKCULT_POWER*4)
visible_message("<span class='warning'>[src] shuts down with a horrible grinding noise!</span>")
playsound(src, 'sound/magic/clockwork/anima_fragment_attack.ogg', 50, 1)
else
visible_message("<span class='warning'>[src] shuts down!</span>")
toggle()
return TRUE
/obj/structure/destructible/clockwork/powered/tinkerers_daemon/attack_hand(mob/living/user)
if(!is_servant_of_ratvar(user))
to_chat(user, "<span class='warning'>You place your hand on the daemon, but nothing happens.</span>")
return
if(active)
toggle(0, user)
else
if(!anchored)
to_chat(user, "<span class='warning'>[src] needs to be secured to the floor before it can be activated!</span>")
return FALSE
if(!GLOB.clockwork_caches)
to_chat(user, "<span class='nezbere'>\"You require a cache for this daemon to operate. Get to it.\"</span>")
return
var/min_power_usable = 0
for(var/i in GLOB.clockwork_component_cache)
if(!min_power_usable)
min_power_usable = get_component_cost(i)
else
min_power_usable = min(min_power_usable, get_component_cost(i))
if(total_accessable_power() < min_power_usable)
to_chat(user, "<span class='nezbere'>\"You need more power to activate this daemon, friend.\"</span>")
return
var/servants = 0
for(var/mob/living/L in GLOB.living_mob_list)
if(is_servant_of_ratvar(L))
servants++
if(servants * 0.2 < 1)
to_chat(user, "<span class='nezbere'>\"There are too few servants for daemons to work.\"</span>")
return
var/choice = alert(user,"Activate Daemon...",,"Specific Component","Random Component","Cancel")
switch(choice)
if("Specific Component")
var/list/components = list()
for(var/i in GLOB.clockwork_component_cache)
components["[get_component_name(i)] ([DisplayPower(get_component_cost(i))])"] = i
var/input_component = input(user, "Choose a component type.", name) as null|anything in components
component_id_to_produce = components[input_component]
servants = 0
for(var/mob/living/L in GLOB.living_mob_list)
if(is_servant_of_ratvar(L))
servants++
if(!is_servant_of_ratvar(user) || !user.canUseTopic(src, !issilicon(user), NO_DEXTERY) || active || !GLOB.clockwork_caches || servants * 0.2 < 1)
return
if(!component_id_to_produce)
to_chat(user, "<span class='warning'>You decide not to select a component and activate the daemon.</span>")
return
if(total_accessable_power() < get_component_cost(component_id_to_produce))
to_chat(user, "<span class='warning'>There is too little power to produce this type of component!</span>")
return
toggle(0, user)
if("Random Component")
component_id_to_produce = null
servants = 0
for(var/mob/living/L in GLOB.living_mob_list)
if(is_servant_of_ratvar(L))
servants++
if(!is_servant_of_ratvar(user) || !user.canUseTopic(src, !issilicon(user), NO_DEXTERY) || active || !GLOB.clockwork_caches || servants * 0.2 < 1)
return
toggle(0, user)
/obj/structure/destructible/clockwork/powered/tinkerers_daemon/toggle(fast_process, mob/living/user)
. = ..()
if(active)
GLOB.active_daemons += src
var/component_color = get_component_color(component_id_to_produce)
daemon_glow.color = component_color
add_overlay(daemon_glow)
component_glow.icon_state = "t_[component_id_to_produce ? component_id_to_produce :"random_component"]"
component_glow.color = component_color
add_overlay(component_glow)
production_time = world.time + production_cooldown //don't immediately produce when turned on after being off
set_light(2, 0.9, get_component_color_bright(component_id_to_produce))
else
GLOB.active_daemons -= src
cut_overlays()
set_light(0)
/obj/structure/destructible/clockwork/powered/tinkerers_daemon/proc/get_component_cost(id)
return max(MIN_CLOCKCULT_POWER*2, (MIN_CLOCKCULT_POWER*2) * (1 + round(GLOB.clockwork_component_cache[id] * 0.2)))
/obj/structure/destructible/clockwork/powered/tinkerers_daemon/process()
var/servants = 0
for(var/mob/living/L in GLOB.living_mob_list)
if(is_servant_of_ratvar(L))
servants++
while(servants * 0.2 < LAZYLEN(GLOB.active_daemons))
var/obj/structure/destructible/clockwork/powered/tinkerers_daemon/D = GLOB.active_daemons[1]
if(!istype(D))
break
if(D.active)
D.forced_disable(FALSE)
if(D == src)
return
. = ..()
var/min_power_usable = 0
if(!component_id_to_produce)
for(var/i in GLOB.clockwork_component_cache)
if(!min_power_usable)
min_power_usable = get_component_cost(i)
else
min_power_usable = min(min_power_usable, get_component_cost(i))
else
min_power_usable = get_component_cost(component_id_to_produce)
if(!GLOB.clockwork_caches || . < min_power_usable) //if we don't have enough to produce the lowest or what we chose to produce, cancel out
forced_disable(FALSE)
return
if(production_time <= world.time)
var/component_to_generate = component_id_to_produce
if(!component_to_generate)
component_to_generate = get_weighted_component_id() //more likely to generate components that we have less of
if(!try_use_power(get_component_cost(component_to_generate)))
component_to_generate = null
if(!component_id_to_produce)
for(var/i in GLOB.clockwork_component_cache)
if(try_use_power(get_component_cost(i))) //if we fail but are producing random, try and get a different component to produce
component_to_generate = i
break
if(component_to_generate)
generate_cache_component(component_to_generate, src)
production_time = world.time + (production_cooldown * get_efficiency_mod(TRUE)) //go on cooldown
visible_message("<span class='warning'>[src] hums as it produces a </span><span class='[get_component_span(component_to_generate)]'>component</span><span class='warning'>.</span>")
else
forced_disable(FALSE) //we shouldn't actually ever get here, as we should cancel out way before this