Fixes clockcult's overreliance on Replicant Alloy (#22824)

* Fixes clockcult's overreliance on replicant alloy

* i did it like that for a reason

* comment

* =
This commit is contained in:
Joan Lung
2017-01-10 09:57:01 +13:00
committed by oranges
parent 691f92ac77
commit d89fe0b870
17 changed files with 232 additions and 318 deletions
+19 -26
View File
@@ -46,39 +46,32 @@ var/global/list/all_scripture = list() //a list containing scripture instances;
#define LOWER_PROB_PER_COMPONENT 10 //how much each component in the cache reduces the weight of getting another of that component type
#define MAX_COMPONENTS_BEFORE_RAND 10*LOWER_PROB_PER_COMPONENT //the number of each component, times LOWER_PROB_PER_COMPONENT, you need to have before component generation will become random
#define MAX_COMPONENTS_BEFORE_RAND (10*LOWER_PROB_PER_COMPONENT) //the number of each component, times LOWER_PROB_PER_COMPONENT, you need to have before component generation will become random
#define CLOCKWORK_GENERAL_COOLDOWN 3000 //how long clockwork generals go on cooldown after use, defaults to 5 minutes
//proselytizer defines
#define REPLICANT_ALLOY_UNIT 100 //how much each piece of replicant alloy gives in a clockwork proselytizer
#define REPLICANT_STANDARD REPLICANT_ALLOY_UNIT*0.2 //how much alloy is in anything else; doesn't matter as much as the following
#define REPLICANT_FLOOR REPLICANT_ALLOY_UNIT*0.1 //how much alloy is in a clockwork floor, determines the cost of clockwork floor production
#define REPLICANT_WALL_MINUS_FLOOR REPLICANT_ALLOY_UNIT*0.4 //amount of alloy in a clockwork wall, determines the cost of clockwork wall production
#define REPLICANT_GEAR REPLICANT_ALLOY_UNIT*0.3 //amount of alloy in a wall gear, minus the brass from the wall
#define REPLICANT_WALL_TOTAL REPLICANT_WALL_MINUS_FLOOR+REPLICANT_FLOOR //how much alloy is in a clockwork wall and the floor under it
#define REPLICANT_ROD REPLICANT_ALLOY_UNIT*0.01 //amount of replicant alloy in one rod
#define REPLICANT_METAL REPLICANT_ALLOY_UNIT*0.02 //amount of replicant alloy in one sheet of metal
#define REPLICANT_PLASTEEL REPLICANT_ALLOY_UNIT*0.05 //amount of replicant alloy in one sheet of plasteel
#define RATVAR_ALLOY_CHECK "ratvar?" //when passed into can_use_alloy(), converts it into a check for if ratvar has woken/the proselytizer is debug
//clockcult power defines
#define MIN_CLOCKCULT_POWER 50 //the minimum amount of power clockcult machines will handle gracefully
#define MIN_CLOCKCULT_POWER 25 //the minimum amount of power clockcult machines will handle gracefully
#define CLOCKCULT_POWER_TO_ALLOY_MULTIPLIER 0.04 //conversion rate for power -> alloy
#define CLOCKCULT_POWER_UNIT (MIN_CLOCKCULT_POWER*100) //standard power amount for clockwork proselytizer costs
#define CLOCKCULT_ALLOY_TO_POWER_MULTIPLIER 25 //conversion rate for alloy -> power
#define POWER_STANDARD (CLOCKCULT_POWER_UNIT*0.2) //how much power is in anything else; doesn't matter as much as the following
#define REPLICANT_ALLOY_POWER REPLICANT_ALLOY_UNIT*CLOCKCULT_ALLOY_TO_POWER_MULTIPLIER //the amount of power you get from a single piece of replicant alloy
#define POWER_FLOOR (CLOCKCULT_POWER_UNIT*0.1) //how much power is in a clockwork floor, determines the cost of clockwork floor production
#define POWER_WALL_MINUS_FLOOR (CLOCKCULT_POWER_UNIT*0.4) //how much power is in a clockwork wall, determines the cost of clockwork wall production
#define POWER_GEAR (CLOCKCULT_POWER_UNIT*0.3) //how much power is in a wall gear, minus the brass from the wall
#define POWER_WALL_TOTAL (POWER_WALL_MINUS_FLOOR+POWER_FLOOR) //how much power is in a clockwork wall and the floor under it
#define POWER_ROD (CLOCKCULT_POWER_UNIT*0.01) //how much power is in one rod
#define POWER_METAL (CLOCKCULT_POWER_UNIT*0.02) //how much power is in one sheet of metal
#define POWER_PLASTEEL (CLOCKCULT_POWER_UNIT*0.05) //how much power is in one sheet of plasteel
#define RATVAR_POWER_CHECK "ratvar?" //when passed into can_use_power(), converts it into a check for if ratvar has woken/the proselytizer is debug
//Ark defines
#define GATEWAY_SUMMON_RATE 1 //the time amount the Gateway to the Celestial Derelict gets each process tick; defaults to 1 per tick
@@ -178,7 +178,7 @@
resist_string = "glows faintly"
sigil_name = "Sigil of Transmission"
affects_servants = TRUE
var/power_charge = REPLICANT_ALLOY_POWER //starts with REPLICANT_ALLOY_POWER by default
var/power_charge = CLOCKCULT_POWER_UNIT //starts with CLOCKCULT_POWER_UNIT by default
/obj/effect/clockwork/sigil/transmission/ex_act(severity)
if(severity == 3)
@@ -1,7 +1,7 @@
//For the clockwork proselytizer, this proc exists to make it easy to customize what the proselytizer does when hitting something.
//if a valid target, returns an associated list in this format;
//list("operation_time" = 15, "new_obj_type" = /obj/structure/window/reinforced/clockwork, "alloy_cost" = 5, "spawn_dir" = dir, "dir_in_new" = TRUE)
//list("operation_time" = 15, "new_obj_type" = /obj/structure/window/reinforced/clockwork, "power_cost" = 5, "spawn_dir" = dir, "dir_in_new" = TRUE)
//otherwise, return literally any non-list thing but preferably FALSE
//returning TRUE won't produce the "cannot be proselytized" message and will still prevent proselytizing
@@ -10,32 +10,32 @@
//Turf conversion
/turf/closed/wall/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer) //four sheets of metal
return list("operation_time" = 50, "new_obj_type" = /turf/closed/wall/clockwork, "alloy_cost" = REPLICANT_WALL_TOTAL - (REPLICANT_METAL * 4), "spawn_dir" = SOUTH)
return list("operation_time" = 50, "new_obj_type" = /turf/closed/wall/clockwork, "power_cost" = POWER_WALL_TOTAL - (POWER_METAL * 4), "spawn_dir" = SOUTH)
/turf/closed/wall/mineral/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer) //two sheets of metal
return list("operation_time" = 50, "new_obj_type" = /turf/closed/wall/clockwork, "alloy_cost" = REPLICANT_WALL_TOTAL - (REPLICANT_METAL * 2), "spawn_dir" = SOUTH)
return list("operation_time" = 50, "new_obj_type" = /turf/closed/wall/clockwork, "power_cost" = POWER_WALL_TOTAL - (POWER_METAL * 2), "spawn_dir" = SOUTH)
/turf/closed/wall/mineral/iron/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer) //two sheets of metal, five rods
return list("operation_time" = 50, "new_obj_type" = /turf/closed/wall/clockwork, "alloy_cost" = REPLICANT_WALL_TOTAL - (REPLICANT_METAL * 2) - (REPLICANT_ROD * 5), "spawn_dir" = SOUTH)
return list("operation_time" = 50, "new_obj_type" = /turf/closed/wall/clockwork, "power_cost" = POWER_WALL_TOTAL - (POWER_METAL * 2) - (POWER_ROD * 5), "spawn_dir" = SOUTH)
/turf/closed/wall/mineral/cult/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer) //no metal
return list("operation_time" = 80, "new_obj_type" = /turf/closed/wall/clockwork, "alloy_cost" = REPLICANT_WALL_TOTAL, "spawn_dir" = SOUTH)
return list("operation_time" = 80, "new_obj_type" = /turf/closed/wall/clockwork, "power_cost" = POWER_WALL_TOTAL, "spawn_dir" = SOUTH)
/turf/closed/wall/shuttle/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer) //two sheets of metal
return list("operation_time" = 50, "new_obj_type" = /turf/closed/wall/clockwork, "alloy_cost" = REPLICANT_WALL_TOTAL - (REPLICANT_METAL * 2), "spawn_dir" = SOUTH)
return list("operation_time" = 50, "new_obj_type" = /turf/closed/wall/clockwork, "power_cost" = POWER_WALL_TOTAL - (POWER_METAL * 2), "spawn_dir" = SOUTH)
/turf/closed/wall/r_wall/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer)
return FALSE
/turf/closed/wall/clockwork/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer)
return list("operation_time" = 50, "new_obj_type" = /turf/open/floor/clockwork, "alloy_cost" = -REPLICANT_WALL_MINUS_FLOOR, "spawn_dir" = SOUTH)
return list("operation_time" = 50, "new_obj_type" = /turf/open/floor/clockwork, "power_cost" = -POWER_WALL_MINUS_FLOOR, "spawn_dir" = SOUTH)
/turf/open/floor/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer)
if(floor_tile == /obj/item/stack/tile/plasteel)
PoolOrNew(floor_tile, src)
make_plating()
playsound(src, 'sound/items/Crowbar.ogg', 10, 1) //clink
return list("operation_time" = 30, "new_obj_type" = /turf/open/floor/clockwork, "alloy_cost" = REPLICANT_FLOOR, "spawn_dir" = SOUTH)
return list("operation_time" = 30, "new_obj_type" = /turf/open/floor/clockwork, "power_cost" = POWER_FLOOR, "spawn_dir" = SOUTH)
/turf/open/floor/plating/asteroid/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer)
return FALSE
@@ -50,19 +50,19 @@
if(is_blocked_turf(src))
user << "<span class='warning'>Something is in the way, preventing you from proselytizing [src] into a clockwork wall.</span>"
return TRUE
return list("operation_time" = 100, "new_obj_type" = /turf/closed/wall/clockwork, "alloy_cost" = REPLICANT_WALL_MINUS_FLOOR, "spawn_dir" = SOUTH)
return list("operation_time" = 100, "new_obj_type" = /turf/closed/wall/clockwork, "power_cost" = POWER_WALL_MINUS_FLOOR, "spawn_dir" = SOUTH)
//False wall conversion
/obj/structure/falsewall/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer)
var/cost = REPLICANT_WALL_MINUS_FLOOR
var/cost = POWER_WALL_MINUS_FLOOR
if(ispath(mineral, /obj/item/stack/sheet/metal))
cost -= (REPLICANT_METAL * (2 + mineral_amount)) //four sheets of metal, plus an assumption that the girder is also two
cost -= (POWER_METAL * (2 + mineral_amount)) //four sheets of metal, plus an assumption that the girder is also two
else
cost -= (REPLICANT_METAL * 2) //anything that doesn't use metal just has the girder
return list("operation_time" = 50, "new_obj_type" = /obj/structure/falsewall/brass, "alloy_cost" = cost, "spawn_dir" = SOUTH)
cost -= (POWER_METAL * 2) //anything that doesn't use metal just has the girder
return list("operation_time" = 50, "new_obj_type" = /obj/structure/falsewall/brass, "power_cost" = cost, "spawn_dir" = SOUTH)
/obj/structure/falsewall/iron/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer) //two sheets of metal, two rods; special assumption
return list("operation_time" = 50, "new_obj_type" = /obj/structure/falsewall/brass, "alloy_cost" = REPLICANT_WALL_MINUS_FLOOR - (REPLICANT_METAL * 2) - (REPLICANT_ROD * 2), "spawn_dir" = SOUTH)
return list("operation_time" = 50, "new_obj_type" = /obj/structure/falsewall/brass, "power_cost" = POWER_WALL_MINUS_FLOOR - (POWER_METAL * 2) - (POWER_ROD * 2), "spawn_dir" = SOUTH)
/obj/structure/falsewall/reinforced/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer)
return FALSE
@@ -75,17 +75,17 @@
if(source)
return FALSE
var/amount_temp = get_amount()
if(proselytizer.metal_to_alloy)
if(proselytizer.metal_to_power)
var/no_delete = FALSE
if(amount_temp < 2)
user << "<span class='warning'>You need at least <b>2</b> floor tiles to convert into alloy.</span>"
user << "<span class='warning'>You need at least <b>2</b> floor tiles to convert into power.</span>"
return TRUE
if(IsOdd(amount_temp))
amount_temp--
no_delete = TRUE
use(amount_temp)
amount_temp *= 0.5 //halve the alloy output; each tile is 0.5 alloy so this is 2 tiles to 1 alloy
return list("operation_time" = 0, "new_obj_type" = /obj/effect/overlay/temp/ratvar/beam/itemconsume, "alloy_cost" = -amount_temp, "spawn_dir" = SOUTH, "no_target_deletion" = no_delete)
amount_temp *= 12.5 //each tile is 12.5 power so this is 2 tiles to 25 power
return list("operation_time" = 0, "new_obj_type" = /obj/effect/overlay/temp/ratvar/beam/itemconsume, "power_cost" = -amount_temp, "spawn_dir" = SOUTH, "no_target_deletion" = no_delete)
if(amount_temp >= 20)
var/sheets_to_make = round(amount_temp * 0.05) //and 20 to 1 brass
var/used = sheets_to_make * 20
@@ -102,8 +102,8 @@
/obj/item/stack/rods/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer)
if(source)
return FALSE
if(proselytizer.metal_to_alloy)
return list("operation_time" = 0, "new_obj_type" = /obj/effect/overlay/temp/ratvar/beam/itemconsume, "alloy_cost" = -(amount*REPLICANT_ROD), "spawn_dir" = SOUTH)
if(proselytizer.metal_to_power)
return list("operation_time" = 0, "new_obj_type" = /obj/effect/overlay/temp/ratvar/beam/itemconsume, "power_cost" = -(amount*POWER_ROD), "spawn_dir" = SOUTH)
if(get_amount() >= 10)
var/sheets_to_make = round(get_amount() * 0.1)
var/used = sheets_to_make * 10
@@ -120,8 +120,8 @@
/obj/item/stack/sheet/metal/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer)
if(source)
return FALSE
if(proselytizer.metal_to_alloy)
return list("operation_time" = 0, "new_obj_type" = /obj/effect/overlay/temp/ratvar/beam/itemconsume, "alloy_cost" = -(amount*REPLICANT_METAL), "spawn_dir" = SOUTH)
if(proselytizer.metal_to_power)
return list("operation_time" = 0, "new_obj_type" = /obj/effect/overlay/temp/ratvar/beam/itemconsume, "power_cost" = -(amount*POWER_METAL), "spawn_dir" = SOUTH)
if(get_amount() >= 5)
var/sheets_to_make = round(get_amount() * 0.2)
var/used = sheets_to_make * 5
@@ -138,8 +138,8 @@
/obj/item/stack/sheet/plasteel/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer)
if(source)
return FALSE
if(proselytizer.metal_to_alloy)
return list("operation_time" = 0, "new_obj_type" = /obj/effect/overlay/temp/ratvar/beam/itemconsume, "alloy_cost" = -(amount*REPLICANT_PLASTEEL), "spawn_dir" = SOUTH)
if(proselytizer.metal_to_power)
return list("operation_time" = 0, "new_obj_type" = /obj/effect/overlay/temp/ratvar/beam/itemconsume, "power_cost" = -(amount*POWER_PLASTEEL), "spawn_dir" = SOUTH)
if(get_amount() >= 2)
var/sheets_to_make = round(get_amount() * 0.5)
var/used = sheets_to_make * 2
@@ -153,21 +153,18 @@
user << "<span class='warning'>You need at least <b>2</b> sheets of plasteel to convert into brass.</span>"
return TRUE
//Brass directly to alloy; scarab only
//Brass directly to power
/obj/item/stack/tile/brass/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer)
if(source)
return FALSE
if(!proselytizer.metal_to_alloy)
return FALSE
var/prosel_cost = -amount*REPLICANT_FLOOR
return list("operation_time" = amount, "new_obj_type" = /obj/effect/overlay/temp/ratvar/beam/itemconsume, "alloy_cost" = prosel_cost, "spawn_dir" = SOUTH)
return list("operation_time" = amount, "new_obj_type" = /obj/effect/overlay/temp/ratvar/beam/itemconsume, "power_cost" = -(amount*POWER_FLOOR), "spawn_dir" = SOUTH)
//Airlock conversion
/obj/machinery/door/airlock/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer)
var/doortype = /obj/machinery/door/airlock/clockwork
if(glass)
doortype = /obj/machinery/door/airlock/clockwork/brass
return list("operation_time" = 60, "new_obj_type" = doortype, "alloy_cost" = REPLICANT_WALL_TOTAL, "spawn_dir" = dir)
return list("operation_time" = 60, "new_obj_type" = doortype, "power_cost" = POWER_WALL_TOTAL, "spawn_dir" = dir)
/obj/machinery/door/airlock/clockwork/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer)
return FALSE
@@ -177,26 +174,26 @@
var/windowtype = /obj/structure/window/reinforced/clockwork
var/new_dir = TRUE
var/prosel_time = 15
var/prosel_cost = REPLICANT_FLOOR
var/prosel_cost = POWER_FLOOR
if(fulltile)
windowtype = /obj/structure/window/reinforced/clockwork/fulltile
new_dir = FALSE
prosel_time = 30
prosel_cost = REPLICANT_STANDARD
prosel_cost = POWER_STANDARD
if(reinf)
prosel_cost -= REPLICANT_ROD
prosel_cost -= POWER_ROD
if(reinf)
prosel_cost -= REPLICANT_ROD
prosel_cost -= POWER_ROD
for(var/obj/structure/grille/G in get_turf(src))
addtimer(CALLBACK(proselytizer, /obj/item/clockwork/clockwork_proselytizer.proc/proselytize, G, user), 0)
return list("operation_time" = prosel_time, "new_obj_type" = windowtype, "alloy_cost" = prosel_cost, "spawn_dir" = dir, "dir_in_new" = new_dir)
return list("operation_time" = prosel_time, "new_obj_type" = windowtype, "power_cost" = prosel_cost, "spawn_dir" = dir, "dir_in_new" = new_dir)
/obj/structure/window/reinforced/clockwork/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer)
return FALSE
//Windoor conversion
/obj/machinery/door/window/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer)
return list("operation_time" = 30, "new_obj_type" = /obj/machinery/door/window/clockwork, "alloy_cost" = REPLICANT_STANDARD, "spawn_dir" = dir, "dir_in_new" = TRUE)
return list("operation_time" = 30, "new_obj_type" = /obj/machinery/door/window/clockwork, "power_cost" = POWER_STANDARD, "spawn_dir" = dir, "dir_in_new" = TRUE)
/obj/machinery/door/window/clockwork/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer)
return FALSE
@@ -208,36 +205,35 @@
if(broken)
grilletype = /obj/structure/grille/ratvar/broken
prosel_time = 5
return list("operation_time" = prosel_time, "new_obj_type" = grilletype, "alloy_cost" = 0, "spawn_dir" = dir)
return list("operation_time" = prosel_time, "new_obj_type" = grilletype, "power_cost" = 0, "spawn_dir" = dir)
/obj/structure/grille/ratvar/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer)
return FALSE
//Girder conversion
/obj/structure/girder/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer)
var/prosel_cost = REPLICANT_GEAR - (REPLICANT_METAL * 2)
var/prosel_cost = POWER_GEAR - (POWER_METAL * 2)
if(state == GIRDER_REINF_STRUTS || state == GIRDER_REINF)
prosel_cost -= REPLICANT_PLASTEEL
return list("operation_time" = 20, "new_obj_type" = /obj/structure/destructible/clockwork/wall_gear, "alloy_cost" = prosel_cost, "spawn_dir" = SOUTH)
prosel_cost -= POWER_PLASTEEL
return list("operation_time" = 20, "new_obj_type" = /obj/structure/destructible/clockwork/wall_gear, "power_cost" = prosel_cost, "spawn_dir" = SOUTH)
//Hitting a clockwork structure will try to repair it.
/obj/structure/destructible/clockwork/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer)
. = TRUE
if(!can_be_repaired)
user << "<span class='warning'>[src] cannot be repaired with a proselytizer!</span>"
user << "<span class='warning'>[src] cannot be repaired!</span>"
return
if(obj_integrity >= max_integrity)
user << "<span class='warning'>[src] is at maximum integrity!</span>"
return
var/amount_to_heal = max_integrity - obj_integrity
var/healing_for_cycle = min(amount_to_heal, repair_amount)
var/alloy_required = healing_for_cycle
if(!proselytizer.can_use_alloy(RATVAR_ALLOY_CHECK))
healing_for_cycle = min(healing_for_cycle, proselytizer.get_power_alloy())
if(!healing_for_cycle || (!proselytizer.can_use_alloy(RATVAR_ALLOY_CHECK) && !proselytizer.can_use_alloy(healing_for_cycle)))
user << "<span class='warning'>You need at least <b>[alloy_required]</b> liquified alloy to start repairing [src], and at least <b>[amount_to_heal]</b> to fully repair it!</span>"
var/power_required = round(healing_for_cycle*MIN_CLOCKCULT_POWER, MIN_CLOCKCULT_POWER)
if(!healing_for_cycle || (!proselytizer.can_use_power(RATVAR_POWER_CHECK) && !proselytizer.can_use_power(power_required)))
user << "<span class='warning'>You need at least <b>[power_required]W</b> power to start repairing [src], and at least \
<b>[round(amount_to_heal*MIN_CLOCKCULT_POWER, MIN_CLOCKCULT_POWER)]W</b> to fully repair it!</span>"
return
user.visible_message("<span class='notice'>[user]'s [proselytizer.name] starts covering [src] in black liquid metal...</span>", \
user.visible_message("<span class='notice'>[user]'s [proselytizer.name] starts covering [src] in glowing orange energy...</span>", \
"<span class='alloy'>You start repairing [src]...</span>")
//hugeass while because we need to re-check after the do_after
proselytizer.repairing = src
@@ -246,75 +242,43 @@
if(amount_to_heal <= 0)
break
healing_for_cycle = min(amount_to_heal, repair_amount)
if(!proselytizer.can_use_alloy(RATVAR_ALLOY_CHECK))
healing_for_cycle = min(healing_for_cycle, proselytizer.get_power_alloy())
if(!healing_for_cycle || (!proselytizer.can_use_alloy(RATVAR_ALLOY_CHECK) && !proselytizer.can_use_alloy(healing_for_cycle)) || \
power_required = round(healing_for_cycle*MIN_CLOCKCULT_POWER, MIN_CLOCKCULT_POWER)
if(!healing_for_cycle || (!proselytizer.can_use_power(RATVAR_POWER_CHECK) && !proselytizer.can_use_power(power_required)) || \
!do_after(user, healing_for_cycle * proselytizer.speed_multiplier, target = src) || \
!proselytizer || (!proselytizer.can_use_alloy(RATVAR_ALLOY_CHECK) && !proselytizer.can_use_alloy(healing_for_cycle)))
!proselytizer || (!proselytizer.can_use_power(RATVAR_POWER_CHECK) && !proselytizer.can_use_power(power_required)))
break
amount_to_heal = max_integrity - obj_integrity
if(amount_to_heal <= 0)
break
healing_for_cycle = min(amount_to_heal, repair_amount)
if(!proselytizer.can_use_alloy(RATVAR_ALLOY_CHECK))
healing_for_cycle = min(healing_for_cycle, proselytizer.get_power_alloy())
if(!healing_for_cycle || (!proselytizer.can_use_alloy(RATVAR_ALLOY_CHECK) && !proselytizer.can_use_alloy(healing_for_cycle)))
power_required = round(healing_for_cycle*MIN_CLOCKCULT_POWER, MIN_CLOCKCULT_POWER)
if(!healing_for_cycle || (!proselytizer.can_use_power(RATVAR_POWER_CHECK) && !proselytizer.can_use_power(power_required)))
break
obj_integrity = Clamp(obj_integrity + healing_for_cycle, 0, max_integrity)
proselytizer.modify_stored_alloy(-healing_for_cycle)
proselytizer.modify_stored_power(-power_required)
playsound(src, 'sound/machines/click.ogg', 50, 1)
if(proselytizer)
proselytizer.repairing = null
if(user)
user.visible_message("<span class='notice'>[user]'s [proselytizer.name] stops covering [src] with black liquid metal.</span>", \
user.visible_message("<span class='notice'>[user]'s [proselytizer.name] stops covering [src] with glowing orange energy.</span>", \
"<span class='alloy'>You finish repairing [src]. It is now at <b>[obj_integrity]/[max_integrity]</b> integrity.</span>")
return
//Hitting a tinkerer's cache will try to fill the proselytizer with alloy after trying to repair.
/obj/structure/destructible/clockwork/cache/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer)
. = ..()
if(proselytizer.can_use_alloy(RATVAR_ALLOY_CHECK) || proselytizer.stored_alloy + REPLICANT_ALLOY_UNIT > proselytizer.max_alloy)
user << "<span class='warning'>[proselytizer]'s containers of liquified alloy are full!</span>"
return
if(!anchored)
user << "<span class='warning'>You need to anchor [src] to fill your [proselytizer.name] from it!</span>"
return
if(!clockwork_component_cache["replicant_alloy"])
user << "<span class='warning'>There is no Replicant Alloy in the global component cache!</span>"
return
proselytizer.refueling = TRUE
user.visible_message("<span class='notice'>[user] places the end of [proselytizer] in the hole in [src]...</span>", \
"<span class='notice'>You start filling [proselytizer] with liquified alloy...</span>")
//hugeass check because we need to re-check after the do_after
while(anchored && proselytizer && !proselytizer.can_use_alloy(RATVAR_ALLOY_CHECK) && proselytizer.stored_alloy + REPLICANT_ALLOY_UNIT <= proselytizer.max_alloy && clockwork_component_cache["replicant_alloy"] \
&& do_after(user, 10, target = src) \
&& anchored && proselytizer && !proselytizer.can_use_alloy(RATVAR_ALLOY_CHECK) && proselytizer.stored_alloy + REPLICANT_ALLOY_UNIT <= proselytizer.max_alloy && clockwork_component_cache["replicant_alloy"])
proselytizer.modify_stored_alloy(REPLICANT_ALLOY_UNIT)
clockwork_component_cache["replicant_alloy"]--
playsound(src, 'sound/items/Deconstruct.ogg', 50, 1)
if(proselytizer)
proselytizer.refueling = FALSE
if(user)
user.visible_message("<span class='notice'>[user] removes [proselytizer] from the hole in [src], apparently satisfied.</span>", \
"<span class='brass'>You finish filling [proselytizer] with liquified alloy. It now contains <b>[proselytizer.stored_alloy]/[proselytizer.max_alloy]</b> units of liquified alloy.</span>")
return
//Convert shards and replicant alloy directly to liquid alloy
/obj/item/clockwork/alloy_shards/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer)
return list("operation_time" = 0, "new_obj_type" = /obj/effect/overlay/temp/ratvar/beam/itemconsume, "alloy_cost" = -REPLICANT_STANDARD, "spawn_dir" = SOUTH)
return list("operation_time" = 0, "new_obj_type" = /obj/effect/overlay/temp/ratvar/beam/itemconsume, "power_cost" = -POWER_STANDARD, "spawn_dir" = SOUTH)
/obj/item/clockwork/alloy_shards/medium/gear_bit/large/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer)
return list("operation_time" = 0, "new_obj_type" = /obj/effect/overlay/temp/ratvar/beam/itemconsume, "alloy_cost" = -(REPLICANT_ALLOY_UNIT*0.08), "spawn_dir" = SOUTH)
return list("operation_time" = 0, "new_obj_type" = /obj/effect/overlay/temp/ratvar/beam/itemconsume, "power_cost" = -(CLOCKCULT_POWER_UNIT*0.08), "spawn_dir" = SOUTH)
/obj/item/clockwork/alloy_shards/large/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer)
return list("operation_time" = 0, "new_obj_type" = /obj/effect/overlay/temp/ratvar/beam/itemconsume, "alloy_cost" = -(REPLICANT_ALLOY_UNIT*0.06), "spawn_dir" = SOUTH)
return list("operation_time" = 0, "new_obj_type" = /obj/effect/overlay/temp/ratvar/beam/itemconsume, "power_cost" = -(CLOCKCULT_POWER_UNIT*0.06), "spawn_dir" = SOUTH)
/obj/item/clockwork/alloy_shards/medium/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer)
return list("operation_time" = 0, "new_obj_type" = /obj/effect/overlay/temp/ratvar/beam/itemconsume, "alloy_cost" = -(REPLICANT_ALLOY_UNIT*0.04), "spawn_dir" = SOUTH)
return list("operation_time" = 0, "new_obj_type" = /obj/effect/overlay/temp/ratvar/beam/itemconsume, "power_cost" = -(CLOCKCULT_POWER_UNIT*0.04), "spawn_dir" = SOUTH)
/obj/item/clockwork/alloy_shards/small/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer)
return list("operation_time" = 0, "new_obj_type" = /obj/effect/overlay/temp/ratvar/beam/itemconsume, "alloy_cost" = -(REPLICANT_ALLOY_UNIT*0.02), "spawn_dir" = SOUTH)
return list("operation_time" = 0, "new_obj_type" = /obj/effect/overlay/temp/ratvar/beam/itemconsume, "power_cost" = -(CLOCKCULT_POWER_UNIT*0.02), "spawn_dir" = SOUTH)
/obj/item/clockwork/component/replicant_alloy/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer)
return list("operation_time" = 0, "new_obj_type" = /obj/effect/overlay/temp/ratvar/beam/itemconsume, "alloy_cost" = -REPLICANT_ALLOY_UNIT, "spawn_dir" = SOUTH)
return list("operation_time" = 0, "new_obj_type" = /obj/effect/overlay/temp/ratvar/beam/itemconsume, "power_cost" = -CLOCKCULT_POWER_UNIT, "spawn_dir" = SOUTH)
@@ -84,7 +84,6 @@
servant_of_ratvar_messages = list("\"Who broke this.\"" = TRUE, "\"Did you break these off YOURSELF?\"" = TRUE, "\"Why did we give this to such simpletons, anyway?\"" = TRUE, \
"\"At least we can use these for something - unlike you.\"" = TRUE)
//Replicant Alloy. Used for fuel and construction, and not merely scripture.
/obj/item/clockwork/component/replicant_alloy
name = "replicant alloy"
desc = "A seemingly strong but very malleable chunk of metal. It seems as though it wants to be molded into something greater."
@@ -95,19 +94,6 @@
"A detailed image of Ratvar appears in the alloy for a moment." = FALSE)
message_span = "nezbere"
/obj/item/clockwork/component/replicant_alloy/examine(mob/user)
..()
if(is_servant_of_ratvar(user))
user << "<span class='alloy'>Can be used to fuel Clockwork Proselytizers and Mending Motors, or shaped into brass sheets.</span>"
/obj/item/clockwork/component/replicant_alloy/attack_self(mob/user)
if(is_servant_of_ratvar(user))
var/obj/item/stack/tile/brass/B = new /obj/item/stack/tile/brass(get_turf(src), 10)
user.unEquip(src, TRUE)
user.put_in_hands(B)
user << "<span class='brass'>You shape the alloy into some brass sheets.</span>"
qdel(src)
/obj/item/clockwork/component/replicant_alloy/smashed_anima_fragment
name = "smashed anima fragment"
desc = "Shattered chunks of metal. Damaged beyond repair and completely unusable."
@@ -1,31 +1,32 @@
//Clockwork proselytizer (yes, that's a real word): Converts applicable objects to Ratvarian variants.
//Clockwork proselytizer: Converts applicable objects to Ratvarian variants.
/obj/item/clockwork/clockwork_proselytizer
name = "clockwork proselytizer"
desc = "An odd, L-shaped device that hums with energy."
clockwork_desc = "A device that allows the replacing of mundane objects with Ratvarian variants. It requires liquified Replicant Alloy to function."
clockwork_desc = "A device that allows the replacing of mundane objects with Ratvarian variants. It requires power to function."
icon_state = "clockwork_proselytizer"
w_class = WEIGHT_CLASS_NORMAL
force = 5
flags = NOBLUDGEON
var/stored_alloy = 0 //Requires this to function; each chunk of replicant alloy provides REPLICANT_ALLOY_UNIT
var/max_alloy = REPLICANT_ALLOY_UNIT * 10
var/uses_alloy = TRUE
var/metal_to_alloy = FALSE
var/reform_alloy = TRUE
var/stored_power = 0 //Requires power to function
var/max_power = CLOCKCULT_POWER_UNIT * 10
var/uses_power = TRUE
var/metal_to_power = FALSE
var/repairing = null //what we're currently repairing, if anything
var/refueling = FALSE //if we're currently refueling from a cache
var/speed_multiplier = 1 //how fast this proselytizer works
var/charge_rate = MIN_CLOCKCULT_POWER //how much power we gain every two seconds
var/charge_delay = 2 //how many proccess ticks remain before we can start to charge
/obj/item/clockwork/clockwork_proselytizer/preloaded
stored_alloy = REPLICANT_WALL_MINUS_FLOOR+REPLICANT_WALL_TOTAL
stored_power = POWER_WALL_MINUS_FLOOR+POWER_WALL_TOTAL
/obj/item/clockwork/clockwork_proselytizer/scarab
name = "scarab proselytizer"
clockwork_desc = "A cogscarab's internal proselytizer. It can only be successfully used by a cogscarab and requires liquified Replicant Alloy to function."
metal_to_alloy = TRUE
clockwork_desc = "A cogscarab's internal proselytizer. It can only be successfully used by a cogscarab and requires power to function."
metal_to_power = TRUE
item_state = "nothing"
w_class = WEIGHT_CLASS_TINY
speed_multiplier = 0.5
charge_rate = MIN_CLOCKCULT_POWER * 2
var/debug = FALSE
/obj/item/clockwork/clockwork_proselytizer/scarab/proselytize(atom/target, mob/living/user)
@@ -35,90 +36,113 @@
/obj/item/clockwork/clockwork_proselytizer/scarab/debug
clockwork_desc = "A cogscarab's internal proselytizer. It can convert nearly any object into a Ratvarian variant."
uses_alloy = FALSE
uses_power = FALSE
debug = TRUE
/obj/item/clockwork/clockwork_proselytizer/cyborg
name = "cyborg proselytizer"
clockwork_desc = "A cyborg's internal proselytizer. It is capable of using the cyborg's power if it lacks liquified replicant alloy."
metal_to_alloy = TRUE
reform_alloy = FALSE
clockwork_desc = "A cyborg's internal proselytizer. It is capable of using the cyborg's power in addition to stored power."
metal_to_power = TRUE
/obj/item/clockwork/clockwork_proselytizer/cyborg/examine(mob/living/user)
..()
if(is_servant_of_ratvar(user) || isobserver(user))
user << "<span class='alloy'>It will use cell charge at a rate of <b>[CLOCKCULT_ALLOY_TO_POWER_MULTIPLIER]</b> charge to <b>1</b> alloy if it has insufficient alloy.</span>"
user << "<span class='alloy'><b>[get_power_alloy()]</b> is usable in this manner.</span>"
/obj/item/clockwork/clockwork_proselytizer/cyborg/get_power_alloy() //returns alloy plus the alloy we have from power, where we need such
var/mob/living/silicon/robot/R = loc
var/alloy_power = 0
/obj/item/clockwork/clockwork_proselytizer/cyborg/get_power() //returns power and cyborg's power
var/mob/living/silicon/robot/R = get_atom_on_turf(src, /mob/living)
var/borg_power = 0
var/current_charge = 0
if(istype(R) && R.cell)
current_charge = R.cell.charge
while(current_charge > CLOCKCULT_ALLOY_TO_POWER_MULTIPLIER)
current_charge -= CLOCKCULT_ALLOY_TO_POWER_MULTIPLIER
alloy_power++
return ..() + alloy_power
while(current_charge > MIN_CLOCKCULT_POWER)
current_charge -= MIN_CLOCKCULT_POWER
borg_power += MIN_CLOCKCULT_POWER
return ..() + borg_power
/obj/item/clockwork/clockwork_proselytizer/cyborg/can_use_alloy(amount)
if(amount != RATVAR_ALLOY_CHECK)
var/mob/living/silicon/robot/R = loc
/obj/item/clockwork/clockwork_proselytizer/cyborg/get_max_power()
var/mob/living/silicon/robot/R = get_atom_on_turf(src, /mob/living)
var/cell_maxcharge = 0
if(istype(R) && R.cell)
cell_maxcharge = R.cell.maxcharge
return ..() + cell_maxcharge
/obj/item/clockwork/clockwork_proselytizer/cyborg/can_use_power(amount)
if(amount != RATVAR_POWER_CHECK)
var/mob/living/silicon/robot/R = get_atom_on_turf(src, /mob/living)
var/current_charge = 0
if(istype(R) && R.cell)
current_charge = R.cell.charge
while(amount > 0 && stored_alloy - amount < 0) //amount is greater than 0 and stored alloy minus the amount is still less than 0
current_charge -= CLOCKCULT_ALLOY_TO_POWER_MULTIPLIER
amount--
while(amount > 0 && stored_power - amount < 0) //amount is greater than 0 and stored power minus the amount is still less than 0
current_charge -= MIN_CLOCKCULT_POWER
amount -= MIN_CLOCKCULT_POWER
if(current_charge < 0)
return FALSE
. = ..()
/obj/item/clockwork/clockwork_proselytizer/cyborg/modify_stored_alloy(amount)
var/mob/living/silicon/robot/R = loc
while(istype(R) && R.cell && amount < 0 && stored_alloy + amount < 0) //amount is less than 0 and stored alloy plus the amount is less than 0
R.cell.use(CLOCKCULT_ALLOY_TO_POWER_MULTIPLIER)
amount++
/obj/item/clockwork/clockwork_proselytizer/cyborg/modify_stored_power(amount)
var/mob/living/silicon/robot/R = get_atom_on_turf(src, /mob/living)
if(istype(R) && R.cell && amount)
if(amount < 0)
while(amount < 0 && stored_power + amount < 0) //amount is less than 0 and stored alloy plus the amount is less than 0
R.cell.use(MIN_CLOCKCULT_POWER)
amount += MIN_CLOCKCULT_POWER
else
while(amount > 0 && R.cell.charge + MIN_CLOCKCULT_POWER < R.cell.maxcharge) //amount is greater than 0 and cell charge plus MIN_CLOCKCULT_POWER is less than maximum cell charge
R.cell.give(MIN_CLOCKCULT_POWER)
amount -= MIN_CLOCKCULT_POWER
. = ..()
/obj/item/clockwork/clockwork_proselytizer/New()
..()
START_PROCESSING(SSobj, src)
/obj/item/clockwork/clockwork_proselytizer/Destroy()
STOP_PROCESSING(SSobj, src)
return ..()
/obj/item/clockwork/clockwork_proselytizer/process()
if(!charge_rate)
return
var/mob/living/L = get_atom_on_turf(src, /mob/living)
if(istype(L) && is_servant_of_ratvar(L))
if(charge_delay)
charge_delay--
return
modify_stored_power(charge_rate)
for(var/obj/item/clockwork/clockwork_proselytizer/S in L.GetAllContents()) //no multiple proselytizers
if(S == src)
continue
S.charge_delay = 2
else
charge_delay = 2
/obj/item/clockwork/clockwork_proselytizer/ratvar_act()
if(ratvar_awakens)
uses_power = FALSE
speed_multiplier = initial(speed_multiplier) * 0.25
else
uses_power = initial(uses_power)
speed_multiplier = initial(speed_multiplier)
/obj/item/clockwork/clockwork_proselytizer/examine(mob/living/user)
..()
if(is_servant_of_ratvar(user) || isobserver(user))
user << "<span class='brass'>Can be used to convert walls, floors, windows, airlocks, and a variety of other objects to clockwork variants.</span>"
user << "<span class='brass'>Can also form some objects into Brass sheets, as well as reform Clockwork Walls into Clockwork Floors, and vice versa.</span>"
if(uses_alloy)
if(metal_to_alloy)
user << "<span class='alloy'>It can convert rods, metal, plasteel, and brass to liquified replicant alloy at rates of <b>1:1</b>, <b>1:2</b>, <b>1:5</b>, and <b>1:10</b>, respectively.</span>"
user << "<span class='alloy'>It has <b>[stored_alloy]/[max_alloy]</b> units of liquified alloy stored.</span>"
user << "<span class='alloy'>Use it on a Tinkerer's Cache, strike it with Replicant Alloy, or attack Replicant Alloy with it to add additional liquified alloy.</span>"
if(reform_alloy)
user << "<span class='alloy'>Use it in-hand to remove stored liquified alloy.</span>"
if(uses_power)
if(metal_to_power)
user << "<span class='alloy'>It can convert rods, metal, plasteel, and brass to power at rates of <b>1:[POWER_ROD]W</b>, <b>1:[POWER_METAL]W</b>, \
<b>1:[POWER_PLASTEEL]W</b>, and <b>1:[POWER_FLOOR]W</b>, respectively.</span>"
else
user << "<span class='alloy'>It can convert brass to power at a rate of <b>1:[POWER_FLOOR]W</b>.</span>"
user << "<span class='alloy'>It is storing <b>[get_power()]W/[get_max_power()]W</b> of power, and is gaining [charge_rate*0.5] power per second.</span>"
user << "<span class='alloy'>Use it in-hand to produce brass sheets.</span>"
/obj/item/clockwork/clockwork_proselytizer/attack_self(mob/living/user)
if(is_servant_of_ratvar(user) && uses_alloy && reform_alloy)
if(!can_use_alloy(REPLICANT_ALLOY_UNIT))
user << "<span class='warning'>[src] [stored_alloy ? "lacks enough":"contains no"] alloy to reform[stored_alloy ? "":" any"] into solidified alloy!</span>"
if(is_servant_of_ratvar(user))
if(!can_use_power(POWER_WALL_TOTAL))
user << "<span class='warning'>[src] requires <b>[POWER_WALL_TOTAL]W</b> of power to produce brass sheets!</span>"
return
modify_stored_alloy(-REPLICANT_ALLOY_UNIT)
modify_stored_power(-POWER_WALL_TOTAL)
playsound(src, 'sound/items/Deconstruct.ogg', 50, 1)
new/obj/item/clockwork/component/replicant_alloy(user.loc)
user << "<span class='brass'>You force [stored_alloy ? "some":"all"] of the alloy in [src]'s compartments to reform and solidify. \
It now contains <b>[stored_alloy]/[max_alloy]</b> units of liquified alloy.</span>"
/obj/item/clockwork/clockwork_proselytizer/attackby(obj/item/I, mob/living/user, params)
if(istype(I, /obj/item/clockwork/component/replicant_alloy) && is_servant_of_ratvar(user) && uses_alloy)
if(!can_use_alloy(-REPLICANT_ALLOY_UNIT))
user << "<span class='warning'>[src]'s replicant alloy compartments are full!</span>"
return 0
modify_stored_alloy(REPLICANT_ALLOY_UNIT)
playsound(user, 'sound/machines/click.ogg', 50, 1)
clockwork_say(user, text2ratvar("Transmute into fuel."), TRUE)
user << "<span class='brass'>You force [I] to liquify and pour it into [src]'s compartments. It now contains <b>[stored_alloy]/[max_alloy]</b> units of liquified alloy.</span>"
user.drop_item()
qdel(I)
return 1
else
return ..()
new/obj/item/stack/tile/brass(user.loc, 5)
user << "<span class='brass'>You user [stored_power ? "some":"all"] of [src]'s power to produce some brass sheets. It now stores <b>[get_power()]W/[get_max_power()]W</b> of power.</span>"
/obj/item/clockwork/clockwork_proselytizer/afterattack(atom/target, mob/living/user, proximity_flag, params)
if(!target || !user || !proximity_flag)
@@ -127,22 +151,25 @@
return ..()
proselytize(target, user)
/obj/item/clockwork/clockwork_proselytizer/proc/get_power_alloy()
return stored_alloy
/obj/item/clockwork/clockwork_proselytizer/proc/get_power()
return stored_power
/obj/item/clockwork/clockwork_proselytizer/proc/modify_stored_alloy(amount)
stored_alloy = Clamp(stored_alloy + amount, 0, max_alloy)
/obj/item/clockwork/clockwork_proselytizer/proc/get_max_power()
return max_power
/obj/item/clockwork/clockwork_proselytizer/proc/modify_stored_power(amount)
stored_power = Clamp(stored_power + amount, 0, max_power)
return TRUE
/obj/item/clockwork/clockwork_proselytizer/proc/can_use_alloy(amount)
if(amount == RATVAR_ALLOY_CHECK)
if(ratvar_awakens || !uses_alloy)
/obj/item/clockwork/clockwork_proselytizer/proc/can_use_power(amount)
if(amount == RATVAR_POWER_CHECK)
if(ratvar_awakens || !uses_power)
return TRUE
else
return FALSE
if(stored_alloy - amount < 0)
if(stored_power - amount < 0)
return FALSE
if(stored_alloy - amount > max_alloy)
if(stored_power - amount > max_power)
return FALSE
return TRUE
@@ -152,9 +179,6 @@
if(repairing)
user << "<span class='warning'>You are currently repairing [repairing] with [src]!</span>"
return FALSE
if(refueling)
user << "<span class='warning'>You are currently refueling [src]!</span>"
return FALSE
var/list/proselytize_values = target.proselytize_vals(user, src) //relevant values for proselytizing stuff, given as an associated list
if(!islist(proselytize_values))
if(proselytize_values != TRUE) //if we get true, fail, but don't send a message for whatever reason
@@ -162,30 +186,24 @@
return proselytize(get_turf(target), user)
user << "<span class='warning'>[target] cannot be proselytized!</span>"
return FALSE
if(can_use_alloy(RATVAR_ALLOY_CHECK))
if(proselytize_values["alloy_cost"] < 0) //if it's less than 0, it's trying to refuel from whatever this is, and we don't need to refuel right now!
user << "<span class='warning'>[target] cannot be proselytized!</span>"
return FALSE
proselytize_values["alloy_cost"] = 0
if(can_use_power(RATVAR_POWER_CHECK))
proselytize_values["power_cost"] = 0
var/turf/Y = get_turf(user)
if(!Y || (Y.z != ZLEVEL_STATION && Y.z != ZLEVEL_CENTCOM && Y.z != ZLEVEL_MINING && Y.z != ZLEVEL_LAVALAND))
proselytize_values["operation_time"] *= 2
if(proselytize_values["alloy_cost"] > 0)
proselytize_values["alloy_cost"] *= 2
if(proselytize_values["power_cost"] > 0)
proselytize_values["power_cost"] *= 2
if(!can_use_alloy(proselytize_values["alloy_cost"]))
if(stored_alloy - proselytize_values["alloy_cost"] < 0)
user << "<span class='warning'>You need <b>[proselytize_values["alloy_cost"]]</b> liquified alloy to proselytize [target]!</span>"
else if(stored_alloy - proselytize_values["alloy_cost"] > max_alloy)
user << "<span class='warning'>You have too much liquified alloy stored to proselytize [target]!</span>"
if(!can_use_power(proselytize_values["power_cost"]))
if(stored_power - proselytize_values["power_cost"] < 0)
user << "<span class='warning'>You need <b>[proselytize_values["power_cost"]]W</b> power to proselytize [target]!</span>"
else if(stored_power - proselytize_values["power_cost"] > max_power)
user << "<span class='warning'>Your [name] contains too much power to proselytize [target]!</span>"
return FALSE
var/target_type = target.type
if(can_use_alloy(RATVAR_ALLOY_CHECK)) //Ratvar makes it faster
proselytize_values["operation_time"] *= 0.5
proselytize_values["operation_time"] *= speed_multiplier
playsound(target, 'sound/machines/click.ogg', 50, 1)
@@ -193,12 +211,11 @@
user.visible_message("<span class='warning'>[user]'s [name] begins tearing apart [target]!</span>", "<span class='brass'>You begin proselytizing [target]...</span>")
if(!do_after(user, proselytize_values["operation_time"], target = target))
return FALSE
user.visible_message("<span class='warning'>[user]'s [name] disgorges a chunk of metal and shapes it over what's left of [target]!</span>", \
"<span class='brass'>You proselytize [target].</span>")
if(repairing || !can_use_power(proselytize_values["power_cost"]) || !target || target.type != target_type) //Check again to prevent bypassing via spamclick
return FALSE
user.visible_message("<span class='warning'>[user]'s [name] covers [target] in golden energy!</span>", "<span class='brass'>You proselytize [target].</span>")
else
user.visible_message("<span class='warning'>[user]'s [name] tears apart [target], covering it in metal!</span>", "<span class='brass'>You proselytize [target].</span>")
if(repairing || refueling || !can_use_alloy(proselytize_values["alloy_cost"]) || !target || target.type != target_type) //Check again to prevent bypassing via spamclick
return FALSE
user.visible_message("<span class='warning'>[user]'s [name] tears apart [target], covering it in golden energy!</span>", "<span class='brass'>You proselytize [target].</span>")
playsound(target, 'sound/items/Deconstruct.ogg', 50, 1)
var/new_thing_type = proselytize_values["new_obj_type"]
@@ -213,5 +230,5 @@
A.setDir(proselytize_values["spawn_dir"])
if(!proselytize_values["no_target_deletion"])
qdel(target)
modify_stored_alloy(-proselytize_values["alloy_cost"])
modify_stored_power(-proselytize_values["power_cost"])
return TRUE
@@ -131,7 +131,7 @@
stored_components[component_to_generate]++
update_slab_info(src)
for(var/obj/item/clockwork/slab/S in L.GetAllContents()) //prevent slab abuse today
if(L == src)
if(S == src)
continue
S.production_time = production_time + 50 //set it to our next production plus five seconds, so that if you hold the same slabs, the same one will always generate
L << "<span class='warning'>Your slab cl[pick("ank", "ink", "unk", "ang")]s as it produces a new component.</span>"
@@ -184,17 +184,17 @@
/datum/clockwork_scripture/create_object/mending_motor
descname = "Structure, Repairs Other Structures"
name = "Mending Motor"
desc = "Creates a mechanized prism that will rapidly repair damage to clockwork creatures, converted cyborgs, and clockwork structures. Requires replicant alloy or power to function."
desc = "Creates a mechanized prism that will rapidly repair damage to clockwork creatures, converted cyborgs, and clockwork structures. Requires power to function."
invocations = list("May this prism...", "...mend our dents and scratches!")
channel_time = 80
required_components = list(VANGUARD_COGWHEEL = 4, GEIS_CAPACITOR = 1, REPLICANT_ALLOY = 1)
consumed_components = list(VANGUARD_COGWHEEL = 3, GEIS_CAPACITOR = 1, REPLICANT_ALLOY = 1)
object_path = /obj/structure/destructible/clockwork/powered/mending_motor/prefilled
creator_message = "<span class='brass'>You form a mending motor, which will consume power or replicant alloy to mend constructs and structures.</span>"
object_path = /obj/structure/destructible/clockwork/powered/mending_motor
creator_message = "<span class='brass'>You form a mending motor, which will consume power to mend constructs and structures.</span>"
observer_message = "<span class='warning'>An onyx prism forms in midair and sprouts tendrils to support itself!</span>"
invokers_required = 2
multiple_invokers_used = TRUE
usage_tip = "Powerful healing but power use is very inefficient, and its alloy use is little better."
usage_tip = "Powerful healing but power use is somewhat inefficient, though much better than a proselytizer."
tier = SCRIPTURE_APPLICATION
one_per_tile = TRUE
primary_component = VANGUARD_COGWHEEL
@@ -107,7 +107,7 @@
descname = "Global Structure Buff"
name = "Invoke Nezbere, the Brass Eidolon"
desc = "Taps the limitless power of Nezbere, one of Ratvar's four generals. The restless toil of the Eidolon will empower a wide variety of clockwork apparatus for a full minute - notably, \
clockwork proselytizers will cost no replicant alloy to use."
clockwork proselytizers will charge very rapidly."
invocations = list("I call upon you, Armorer!!", "Let your machinations reign on this miserable station!!", "Let your power flow through the tools of your master!!")
channel_time = 150
required_components = list(BELLIGERENT_EYE = 3, VANGUARD_COGWHEEL = 3, GEIS_CAPACITOR = 3, REPLICANT_ALLOY = 6)
@@ -140,7 +140,7 @@
W.damage_per_tick = 5
W.sight_range = 5
for(var/obj/item/clockwork/clockwork_proselytizer/P in all_clockwork_objects) //Proselytizers no longer require alloy
P.uses_alloy = FALSE
P.charge_rate = 1250
for(var/obj/structure/destructible/clockwork/powered/M in all_clockwork_objects) //Powered clockwork structures no longer need power
M.needs_power = FALSE
if(istype(M, /obj/structure/destructible/clockwork/powered/tinkerers_daemon)) //Daemons produce components twice as quickly
@@ -154,7 +154,8 @@
if(W.sight_range == 5)
W.sight_range = initial(W.sight_range)
for(var/obj/item/clockwork/clockwork_proselytizer/P in all_clockwork_objects)
P.uses_alloy = initial(P.uses_alloy)
if(P.charge_rate == 1250)
P.charge_rate = initial(P.charge_rate)
for(var/obj/structure/destructible/clockwork/powered/M in all_clockwork_objects)
M.needs_power = initial(M.needs_power)
if(istype(M, /obj/structure/destructible/clockwork/powered/tinkerers_daemon))
@@ -138,14 +138,14 @@
/datum/clockwork_scripture/create_object/clockwork_proselytizer
descname = "Converts Objects to Ratvarian"
name = "Clockwork Proselytizer"
desc = "Forms a device that, when used on certain objects, converts them into their Ratvarian equivalents. It requires replicant alloy to function."
desc = "Forms a device that, when used on certain objects, converts them into their Ratvarian equivalents. It requires power to function."
invocations = list("With this device...", "...his presence shall be made known.")
channel_time = 20
required_components = list(GEIS_CAPACITOR = 1, REPLICANT_ALLOY = 2)
consumed_components = list(GEIS_CAPACITOR = 1, REPLICANT_ALLOY = 1)
whispered = TRUE
object_path = /obj/item/clockwork/clockwork_proselytizer/preloaded
creator_message = "<span class='brass'>You form a clockwork proselytizer, which is already pre-loaded with a small amount of replicant alloy.</span>"
creator_message = "<span class='brass'>You form a clockwork proselytizer.</span>"
usage_tip = "Clockwork Walls cause nearby tinkerer's caches to generate components passively, making them a vital tool. Clockwork Floors heal toxin damage in Servants standing on them."
tier = SCRIPTURE_SCRIPT
space_allowed = TRUE
@@ -9,7 +9,7 @@
anchored = 1
density = 1
resistance_flags = FIRE_PROOF | ACID_PROOF
var/repair_amount = 5 //how much a proselytizer can repair each cycle
var/repair_amount = 4 //how much a proselytizer can repair each cycle
var/can_be_repaired = TRUE //if a proselytizer can repair it at all
break_message = "<span class='warning'>The frog isn't a meme after all!</span>" //The message shown when a structure breaks
break_sound = 'sound/magic/clockwork/anima_fragment_death.ogg' //The sound played when a structure breaks
@@ -37,7 +37,7 @@
SG.ex_act(1)
affected++
if(bad_effects)
affected += try_use_power(MIN_CLOCKCULT_POWER*2)
affected += try_use_power(MIN_CLOCKCULT_POWER*4)
return affected
/obj/structure/destructible/clockwork/powered/clockwork_obelisk/attack_hand(mob/living/user)
@@ -17,7 +17,6 @@
var/mania_cost = 200
var/convert_attempt_cost = 500
var/convert_cost = 500
var/static/list/mania_messages = list("Go nuts.", "Take a crack at crazy.", "Make a bid for insanity.", "Get kooky.", "Move towards mania.", "Become bewildered.", "Wax wild.", \
"Go round the bend.", "Land in lunacy.", "Try dementia.", "Strive to get a screw loose.")
var/static/list/compel_messages = list("Come closer.", "Approach the transmitter.", "Touch the antennae.", "I always have to deal with idiots. Move towards the mania motor.", \
@@ -38,7 +37,7 @@
/obj/structure/destructible/clockwork/powered/mania_motor/forced_disable(bad_effects)
if(active)
if(bad_effects)
try_use_power(MIN_CLOCKCULT_POWER*2)
try_use_power(MIN_CLOCKCULT_POWER*4)
visible_message("<span class='warning'>[src] hums loudly, then the sockets at its base fall dark!</span>")
playsound(src, 'sound/effects/screech.ogg', 40, 1)
toggle()
@@ -15,9 +15,8 @@
/obj/item/clockwork/alloy_shards/medium = 1, \
/obj/item/clockwork/alloy_shards/large = 1, \
/obj/item/clockwork/component/vanguard_cogwheel = 1)
var/stored_alloy = 0
var/max_alloy = REPLICANT_ALLOY_POWER * 10
var/heal_attempts = 4
var/heal_cost = MIN_CLOCKCULT_POWER*2
var/static/list/heal_finish_messages = list("There, all mended!", "Try not to get too damaged.", "No more dents and scratches for you!", "Champions never die.", "All patched up.", \
"Ah, child, it's okay now.")
var/static/list/heal_failure_messages = list("Pain is temporary.", "What you do for the Justiciar is eternal.", "Bear this for me.", "Be strong, child.", "Please, be careful!", \
@@ -29,36 +28,15 @@
/obj/structure/window/reinforced/clockwork,
/obj/structure/table/reinforced/brass))
/obj/structure/destructible/clockwork/powered/mending_motor/prefilled
stored_alloy = REPLICANT_ALLOY_POWER //starts with 1 replicant alloy's worth of power
/obj/structure/destructible/clockwork/powered/mending_motor/total_accessable_power()
. = ..()
if(. != INFINITY)
. += accessable_alloy_power()
/obj/structure/destructible/clockwork/powered/mending_motor/proc/accessable_alloy_power()
return stored_alloy
/obj/structure/destructible/clockwork/powered/mending_motor/use_power(amount)
var/alloypower = accessable_alloy_power()
while(alloypower >= MIN_CLOCKCULT_POWER && amount >= MIN_CLOCKCULT_POWER)
stored_alloy -= MIN_CLOCKCULT_POWER
alloypower -= MIN_CLOCKCULT_POWER
amount -= MIN_CLOCKCULT_POWER
return ..()
/obj/structure/destructible/clockwork/powered/mending_motor/examine(mob/user)
..()
if(is_servant_of_ratvar(user) || isobserver(user))
user << "<span class='alloy'>It contains <b>[stored_alloy*CLOCKCULT_POWER_TO_ALLOY_MULTIPLIER]/[max_alloy*CLOCKCULT_POWER_TO_ALLOY_MULTIPLIER]</b> units of liquified alloy, \
which is equivalent to <b>[stored_alloy]W/[max_alloy]W</b> of power.</span>"
user << "<span class='inathneq_small'>It requires at least <b>[MIN_CLOCKCULT_POWER]W</b> to attempt to repair clockwork mobs, structures, or converted silicons.</span>"
user << "<span class='inathneq_small'>It requires at least <b>[heal_cost]W</b> to attempt to repair clockwork mobs, structures, or converted silicons.</span>"
/obj/structure/destructible/clockwork/powered/mending_motor/forced_disable(bad_effects)
if(active)
if(bad_effects)
try_use_power(MIN_CLOCKCULT_POWER*2)
try_use_power(heal_cost)
visible_message("<span class='warning'>[src] emits an airy chuckling sound and falls dark!</span>")
toggle()
return TRUE
@@ -66,26 +44,10 @@
/obj/structure/destructible/clockwork/powered/mending_motor/attack_hand(mob/living/user)
if(user.canUseTopic(src, !issilicon(user)) && is_servant_of_ratvar(user))
if(total_accessable_power() < MIN_CLOCKCULT_POWER)
user << "<span class='warning'>[src] needs more power or replicant alloy to function!</span>"
user << "<span class='warning'>[src] needs more power to function!</span>"
return 0
toggle(0, user)
/obj/structure/destructible/clockwork/powered/mending_motor/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/clockwork/component/replicant_alloy) && is_servant_of_ratvar(user))
if(stored_alloy + REPLICANT_ALLOY_POWER > max_alloy)
user << "<span class='warning'>[src] is too full to accept any more alloy!</span>"
return 0
playsound(user, 'sound/machines/click.ogg', 50, 1)
clockwork_say(user, text2ratvar("Transmute into fuel."), TRUE)
user << "<span class='brass'>You force [I] to liquify and pour it into [src]'s compartments. \
It now contains <b>[stored_alloy*CLOCKCULT_POWER_TO_ALLOY_MULTIPLIER]/[max_alloy*CLOCKCULT_POWER_TO_ALLOY_MULTIPLIER]</b> units of liquified alloy.</span>"
stored_alloy = stored_alloy + REPLICANT_ALLOY_POWER
user.drop_item()
qdel(I)
return 1
else
return ..()
/obj/structure/destructible/clockwork/powered/mending_motor/process()
var/efficiency = get_efficiency_mod()
for(var/atom/movable/M in range(7, src))
@@ -97,7 +59,7 @@
continue
for(var/i in 1 to heal_attempts)
if(S.health < S.maxHealth)
if(try_use_power(MIN_CLOCKCULT_POWER))
if(try_use_power(heal_cost))
S.adjustHealth(-(8 * efficiency))
PoolOrNew(/obj/effect/overlay/temp/heal, list(T, "#1E8CE1"))
else
@@ -113,7 +75,7 @@
continue
for(var/i in 1 to heal_attempts)
if(C.obj_integrity < C.max_integrity)
if(try_use_power(MIN_CLOCKCULT_POWER))
if(try_use_power(heal_cost))
C.obj_integrity = min(C.obj_integrity + (8 * efficiency), C.max_integrity)
if(C == src)
efficiency = get_efficiency_mod()
@@ -130,7 +92,7 @@
continue
for(var/i in 1 to heal_attempts)
if(S.health < S.maxHealth)
if(try_use_power(MIN_CLOCKCULT_POWER))
if(try_use_power(heal_cost))
S.adjustBruteLoss(-(5 * efficiency))
S.adjustFireLoss(-(3 * efficiency))
PoolOrNew(/obj/effect/overlay/temp/heal, list(T, "#1E8CE1"))
@@ -141,5 +103,5 @@
S << "<span class='inathneq'>\"[text2ratvar(pick(heal_finish_messages))]\"</span>"
break
. = ..()
if(. < MIN_CLOCKCULT_POWER)
if(. < heal_cost)
forced_disable(FALSE)
@@ -76,27 +76,21 @@
else
return ..()
/obj/structure/destructible/clockwork/cache/attack_hand(mob/user)
if(!is_servant_of_ratvar(user))
return 0
if(!anchored)
user << "<span class='warning'>[src] needs to be secured to remove Replicant Alloy from it!</span>"
return 0
if(!clockwork_component_cache[REPLICANT_ALLOY])
user << "<span class='warning'>There is no Replicant Alloy in the global component cache!</span>"
return 0
clockwork_component_cache[REPLICANT_ALLOY]--
update_slab_info()
var/obj/item/clockwork/component/replicant_alloy/A = new(get_turf(src))
user.visible_message("<span class='notice'>[user] withdraws [A] from [src].</span>", "<span class='notice'>You withdraw [A] from [src].</span>")
user.put_in_hands(A)
return 1
/obj/structure/destructible/clockwork/cache/attack_hand(mob/living/user)
..()
if(is_servant_of_ratvar(user) && linkedwall)
if(wall_generation_cooldown > world.time)
user << "<span class='alloy'>It will produce a component in <b>[(world.time - wall_generation_cooldown) * 0.1]</b> seconds.</span>"
else
user << "<span class='brass'>It is about to produce a component!</span>"
/obj/structure/destructible/clockwork/cache/examine(mob/user)
..()
if(is_servant_of_ratvar(user) || isobserver(user))
if(linkedwall)
user << "<span class='brass'>It is linked and will generate a component every <b>[round((CACHE_PRODUCTION_TIME * 0.1) * get_efficiency_mod(TRUE), 0.1)]</b> seconds!</span>"
user << "<span class='brass'>It is linked to a Clockwork Wall and will generate a component every <b>[round((CACHE_PRODUCTION_TIME * 0.1) * get_efficiency_mod(TRUE), 0.1)]</b> seconds!</span>"
else
user << "<span class='alloy'>It is unlinked! Construct a Clockwork Wall nearby to generate components!</span>"
user << "<b>Stored components:</b>"
for(var/i in clockwork_component_cache)
user << "<span class='[get_component_span(i)]_small'><i>[get_component_name(i)][i != REPLICANT_ALLOY ? "s":""]:</i> <b>[clockwork_component_cache[i]]</b></span>"
@@ -43,7 +43,7 @@
/obj/structure/destructible/clockwork/powered/tinkerers_daemon/forced_disable(bad_effects)
if(active)
if(bad_effects)
try_use_power(MIN_CLOCKCULT_POWER*2)
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
@@ -126,7 +126,7 @@
SetLuminosity(0)
/obj/structure/destructible/clockwork/powered/tinkerers_daemon/proc/get_component_cost(id)
return max(MIN_CLOCKCULT_POWER, MIN_CLOCKCULT_POWER * (1 + round(clockwork_component_cache[id] * 0.2)))
return max(MIN_CLOCKCULT_POWER*2, (MIN_CLOCKCULT_POWER*2) * (1 + round(clockwork_component_cache[id] * 0.2)))
/obj/structure/destructible/clockwork/powered/tinkerers_daemon/process()
var/servants = 0
+1 -1
View File
@@ -61,7 +61,7 @@
/turf/closed/wall/clockwork/examine(mob/user)
..()
if((is_servant_of_ratvar(user) || isobserver(user)) && linkedcache)
user << "<span class='brass'>It is linked, generating components in a cache!</span>"
user << "<span class='brass'>It is linked to a Tinkerer's Cache, generating components!</span>"
/turf/closed/wall/clockwork/Destroy()
if(linkedcache)
+3 -5
View File
@@ -156,20 +156,18 @@ As a Cultist, your team starts off very weak, but if necessary can quickly conve
As a Cultist, the Blood Boil rune will deal massive amounts of brute damage to non-cultists, stamina damage to Ratvarian scum, and some damage to fellow cultists of Nar-Sie nearby, but will create a fire where the rune stands on use.
As a Cultist, you can create an army of manifested goons using a combination of the Manifest rune, which creates homunculi from ghosts, and the Blood Drain rune, which drains life from anyone standing on any blood drain rune.
As a Servant, your clockwork Slab fits in pockets and does not need to be held to communicate with other Servants.
As a Servant, remember that while the selection of scripture and tools Servant cyborgs get is limited, it is still extremely useful, and some of it is unique; for example, engineering and janitor cyborgs get a proselytizer that can use their own power if out of alloy.
As a Servant, remember that while the selection of scripture and tools Servant cyborgs get is limited, it is still extremely useful, and some of it is unique; for example, engineering and janitor cyborgs get a proselytizer that can use their own power in addition to its own.
As a Servant, the Judicial Visor is an effective defensive combat tool in small spaces, as it stuns and mutes anyone still on it after 3 seconds. It is also useful for stunning already-stunned enemies for long enough to convert them or finish them off.
As a Servant, making, and protecting, Tinkerer's Caches is extremely important, as caches are required to unlock scripture and share components.
As a Servant, Ocular Wardens, while fragile, do very high, rapid damage to a target non-servant that can see them and will even attack mechs that contain heretics. Place them behind objects that don't block vision to get the most use out of them.
As a Servant, Mending Motors can be powered by striking it with replicant alloy, in addition to Sigils of Transmission and APC power, and will rapidly repair all nearby damaged clockwork constructs, structures, and Servant silicons.
As a Servant, Clockwork Structures that require power will draw power from the APC if they cannot find a different source of power, and most power-using Structures will rapidly drain the APC.
As a Servant, you can repair Clockwork Structures with a Clockwork Proselytizer at a rate of 1 liquified alloy to 1 health.
As a Servant, you can repair Clockwork Structures with a Clockwork Proselytizer at a rate of 25W power to 1 health.
As a Servant, securing a reliable source of component generation is high-priority, as simply handing out slabs will slowly become inefficient. Try placing Tinkerer's Caches near clockwork walls or creating and powering Tinkerer's Daemons.
As a Servant, only a single held Clockwork Slab will generate components, no matter how many you're holding. In addition, slabs will generate components slower with large amounts of servants; you can see the exact time with Recollection.
As a Servant, you can use Geis to easily convert single targets, as it binds them in place, preventing escape unless they react quickly enough. Having another Servant apply Geis to someone already bound will prevent their escape, even if they reacted quickly.
As a Servant, be aware that Cogscarabs are not especially useful in large numbers, as they all require replicant alloy to convert objects and repair structures. Too many scarabs will likely result in a rapid loss of replicant alloy as they consume it to convert the station.
As a Servant, placing components in a slab or cache places those components in a globally-accessable storage that slabs will draw from to invoke scripture.
As a Servant, you can stack different types of Sigils on the same turf; try stacking a Sigil of Transgression and a Sigil of Submission for a subtle conversion trap.
As a Servant, you can deconstruct a clockwork wall with a Clockwork Proselytizer to regain 40 alloy. You can also construct clockwork walls on clockwork floors for a cost of 40 alloy.
As a Servant, you can deconstruct a clockwork wall with a Clockwork Proselytizer to regain 1000W power. You can also construct clockwork walls on Clockwork Floors for a cost of 1000W power.
As a Servant, using Volt Void while on a Sigil of Transmission will drain power from all a variety of objects and transfer that power into the Sigil.
As a Servant, Fellowship Armory invokes much faster for each nearby servant and attempts to provide each affected servant with powerful armor against melee, bullet, and bomb attacks. The gauntlets provided are also immune to elecricity.
As a Servant, Spatial Gateway can teleport to any living Servant or Clockwork Obelisk, and gains additional uses and duration for each Servant assisting in the invocation.