Adds Prolonging Prism as an application scripture (#1472)
This commit is contained in:
committed by
kevinz000
parent
7fdb5f484e
commit
a090e33a15
@@ -104,3 +104,5 @@ GLOBAL_LIST_EMPTY(all_scripture) //a list containing scripture instances; not us
|
||||
#define OCULAR_WARDEN_EXCLUSION_RANGE 3 //the range at which ocular wardens cannot be placed near other ocular wardens
|
||||
|
||||
#define RATVARIAN_SPEAR_DURATION 1800 //how long ratvarian spears last; defaults to 3 minutes
|
||||
|
||||
#define PRISM_DELAY_DURATION 1200 //how long prolonging prisms delay the shuttle for; defaults to 2 minutes
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
/obj/item/clockwork/component/vanguard_cogwheel/onyx_prism
|
||||
name = "onyx prism"
|
||||
desc = "An onyx prism with a small aperture. It's very heavy."
|
||||
clockwork_desc = "A broken prism from a mending motor. <b>Serviceable as a substitute for a vanguard cogwheel.</b>"
|
||||
clockwork_desc = "A broken prism from a prolonging prism. <b>Serviceable as a substitute for a vanguard cogwheel.</b>"
|
||||
icon_state = "onyx_prism"
|
||||
cultist_message = "The prism grows painfully hot in your hands."
|
||||
servant_of_ratvar_messages = list("The prism isn't getting any lighter." = FALSE, "\"So... you haven't failed yet. Have hope, child.\"" = TRUE, \
|
||||
|
||||
@@ -214,6 +214,38 @@
|
||||
quickbind_desc = "Creates an Interdiction Lens, which drains power into nearby Sigils of Transmission."
|
||||
|
||||
|
||||
//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"
|
||||
desc = "Creates a mechanized prism which will delay the arrival of an emergency shuttle by 2 minutes at a massive power cost."
|
||||
invocations = list("May this prism...", "...grant us time to enact his will!")
|
||||
channel_time = 80
|
||||
consumed_components = list(VANGUARD_COGWHEEL = 5, GEIS_CAPACITOR = 2, REPLICANT_ALLOY = 2)
|
||||
object_path = /obj/structure/destructible/clockwork/powered/prolonging_prism
|
||||
creator_message = "<span class='brass'>You form a prolonging prism, which will delay the arrival of an emergency shuttle at a massive power cost.</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 = "The power cost to delay a shuttle increases based on CV and the number of times activated."
|
||||
tier = SCRIPTURE_APPLICATION
|
||||
one_per_tile = TRUE
|
||||
primary_component = VANGUARD_COGWHEEL
|
||||
sort_priority = 7
|
||||
quickbind = TRUE
|
||||
quickbind_desc = "Creates a Prolonging Prism, which will delay the arrival of an emergency shuttle by 2 minutes at a massive power cost."
|
||||
|
||||
/datum/clockwork_scripture/create_object/prolonging_prism/check_special_requirements()
|
||||
if(SSshuttle.emergency.mode == SHUTTLE_DOCKED || SSshuttle.emergency.mode == SHUTTLE_IGNITING || SSshuttle.emergency.mode == SHUTTLE_STRANDED || SSshuttle.emergency.mode == SHUTTLE_ESCAPE)
|
||||
to_chat(invoker, "<span class='inathneq'>\"It is too late to construct one of these, champion.\"</span>")
|
||||
return FALSE
|
||||
var/turf/T = get_turf(invoker)
|
||||
if(!T || T.z != ZLEVEL_STATION)
|
||||
to_chat(invoker, "<span class='inathneq'>\"You must be on the station to construct one of these, champion.\"</span>")
|
||||
return FALSE
|
||||
return ..()
|
||||
|
||||
|
||||
//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"
|
||||
|
||||
@@ -0,0 +1,140 @@
|
||||
//Prolonging Prism: A prism that consumes power to delay the shuttle
|
||||
/obj/structure/destructible/clockwork/powered/prolonging_prism
|
||||
name = "prolonging prism"
|
||||
desc = "A dark onyx prism, held in midair by spiraling tendrils of stone."
|
||||
clockwork_desc = "A powerful prism that will delay the arrival of an emergency shuttle."
|
||||
icon_state = "prolonging_prism_inactive"
|
||||
active_icon = "prolonging_prism"
|
||||
inactive_icon = "prolonging_prism_inactive"
|
||||
unanchored_icon = "prolonging_prism_unwrenched"
|
||||
construction_value = 20
|
||||
max_integrity = 125
|
||||
obj_integrity = 125
|
||||
break_message = "<span class='warning'>The prism falls to the ground with a heavy thud!</span>"
|
||||
debris = list(/obj/item/clockwork/alloy_shards/small = 3, \
|
||||
/obj/item/clockwork/alloy_shards/medium = 1, \
|
||||
/obj/item/clockwork/alloy_shards/large = 1, \
|
||||
/obj/item/clockwork/component/vanguard_cogwheel/onyx_prism = 1)
|
||||
var/static/list/component_refund = list(VANGUARD_COGWHEEL = 2, GEIS_CAPACITOR = 1, REPLICANT_ALLOY = 1)
|
||||
var/static/delay_cost = 2500
|
||||
var/static/delay_cost_increase = 750
|
||||
var/static/delay_remaining = 0
|
||||
|
||||
/obj/structure/destructible/clockwork/powered/prolonging_prism/examine(mob/user)
|
||||
..()
|
||||
if(is_servant_of_ratvar(user) || isobserver(user))
|
||||
if(SSshuttle.emergency.mode == SHUTTLE_DOCKED || SSshuttle.emergency.mode == SHUTTLE_IGNITING || SSshuttle.emergency.mode == SHUTTLE_STRANDED || SSshuttle.emergency.mode == SHUTTLE_ESCAPE)
|
||||
to_chat(user, "<span class='inathneq'>An emergency shuttle has arrived and this prism is no longer useful; attempt to activate it to gain a partial refund of components used.</span>")
|
||||
else
|
||||
var/efficiency = get_efficiency_mod()
|
||||
var/efficiency_time = get_efficiency_mod(TRUE)
|
||||
to_chat(user, "<span class='inathneq_small'>It requires at least <b>[get_delay_cost() * efficiency]W</b> of power to attempt to delay the arrival of an emergency shuttle by \
|
||||
<b>[2 * efficiency_time]</b> minutes.</span>")
|
||||
to_chat(user, "<span class='inathneq_small'>This cost increases by <b>[delay_cost_increase * 0.1]W</b> for every <b>10 CV</b> and <b>[delay_cost_increase]W</b> for every previous \
|
||||
activation.</span>")
|
||||
|
||||
/obj/structure/destructible/clockwork/powered/prolonging_prism/forced_disable(bad_effects)
|
||||
if(active)
|
||||
if(bad_effects)
|
||||
try_use_power(MIN_CLOCKCULT_POWER*4)
|
||||
visible_message("<span class='warning'>[src] emits an airy chuckling sound and falls dark!</span>")
|
||||
toggle()
|
||||
return TRUE
|
||||
|
||||
/obj/structure/destructible/clockwork/powered/prolonging_prism/attack_hand(mob/living/user)
|
||||
if(user.canUseTopic(src, !issilicon(user), NO_DEXTERY) && is_servant_of_ratvar(user))
|
||||
if(SSshuttle.emergency.mode == SHUTTLE_DOCKED || SSshuttle.emergency.mode == SHUTTLE_IGNITING || SSshuttle.emergency.mode == SHUTTLE_STRANDED || SSshuttle.emergency.mode == SHUTTLE_ESCAPE)
|
||||
to_chat(user, "<span class='brass'>You break [src] apart, refunding some of the components used.</span>")
|
||||
for(var/i in component_refund)
|
||||
generate_cache_component(i, src)
|
||||
take_damage(max_integrity)
|
||||
return 0
|
||||
if(active)
|
||||
return 0
|
||||
var/turf/T = get_turf(src)
|
||||
if(!T || T.z != ZLEVEL_STATION)
|
||||
to_chat(user, "<span class='warning'>[src] must be on the station to function!</span>")
|
||||
return 0
|
||||
if(SSshuttle.emergency.mode != SHUTTLE_CALL)
|
||||
to_chat(user, "<span class='warning'>No emergency shuttles are attempting to arrive at the station!</span>")
|
||||
return 0
|
||||
var/efficiency = get_efficiency_mod()
|
||||
if(!try_use_power(get_delay_cost() * efficiency))
|
||||
to_chat(user, "<span class='warning'>[src] needs more power to function!</span>")
|
||||
return 0
|
||||
delay_cost += delay_cost_increase
|
||||
delay_remaining += PRISM_DELAY_DURATION
|
||||
toggle(0, user)
|
||||
|
||||
/obj/structure/destructible/clockwork/powered/prolonging_prism/process()
|
||||
var/turf/own_turf = get_turf(src)
|
||||
if(SSshuttle.emergency.mode != SHUTTLE_CALL || delay_remaining <= 0 || !own_turf || own_turf.z != ZLEVEL_STATION)
|
||||
forced_disable(FALSE)
|
||||
return
|
||||
. = ..()
|
||||
var/delay_amount = 40
|
||||
delay_remaining -= delay_amount
|
||||
var/efficiency = get_efficiency_mod()
|
||||
SSshuttle.emergency.setTimer(SSshuttle.emergency.timeLeft(1) + (delay_amount * efficiency))
|
||||
var/highest_y
|
||||
var/highest_x
|
||||
var/lowest_y
|
||||
var/lowest_x
|
||||
var/list/prism_turfs = list()
|
||||
for(var/t in SSshuttle.emergency.ripple_area(SSshuttle.getDock("emergency_home")))
|
||||
prism_turfs[t] = TRUE
|
||||
var/turf/T = t
|
||||
if(!highest_y || T.y > highest_y)
|
||||
highest_y = T.y
|
||||
if(!highest_x || T.x > highest_x)
|
||||
highest_x = T.x
|
||||
if(!lowest_y || T.y < lowest_y)
|
||||
lowest_y = T.y
|
||||
if(!lowest_x || T.x < lowest_x)
|
||||
lowest_x = T.x
|
||||
var/mean_y = Lerp(lowest_y, highest_y)
|
||||
var/mean_x = Lerp(lowest_x, highest_x)
|
||||
if(prob(50))
|
||||
mean_y = Ceiling(mean_y)
|
||||
else
|
||||
mean_y = Floor(mean_y)
|
||||
if(prob(50))
|
||||
mean_x = Ceiling(mean_x)
|
||||
else
|
||||
mean_x = Floor(mean_x)
|
||||
var/turf/semi_random_center_turf = locate(mean_x, mean_y, ZLEVEL_STATION)
|
||||
for(var/t in getline(src, semi_random_center_turf))
|
||||
prism_turfs[t] = TRUE
|
||||
var/placement_style = prob(50)
|
||||
for(var/t in prism_turfs)
|
||||
var/turf/T = t
|
||||
if(placement_style)
|
||||
if(IsOdd(T.x + T.y))
|
||||
seven_random_hexes(T, efficiency)
|
||||
else if(prob(50 * efficiency))
|
||||
new /obj/effect/temp_visual/ratvar/prolonging_prism(T)
|
||||
else
|
||||
if(IsEven(T.x + T.y))
|
||||
seven_random_hexes(T, efficiency)
|
||||
else if(prob(50 * efficiency))
|
||||
new /obj/effect/temp_visual/ratvar/prolonging_prism(T)
|
||||
CHECK_TICK //we may be going over a hell of a lot of turfs
|
||||
|
||||
/obj/structure/destructible/clockwork/powered/prolonging_prism/proc/get_delay_cost()
|
||||
return Floor((GLOB.clockwork_construction_value * delay_cost_increase * 0.01) + delay_cost, MIN_CLOCKCULT_POWER)
|
||||
|
||||
/obj/structure/destructible/clockwork/powered/prolonging_prism/proc/seven_random_hexes(turf/T, efficiency)
|
||||
var/static/list/hex_states = list("prismhex1", "prismhex2", "prismhex3", "prismhex4", "prismhex5", "prismhex6", "prismhex7")
|
||||
var/mutable_appearance/hex_combo
|
||||
for(var/n in hex_states) //BUILD ME A HEXAGON
|
||||
if(prob(50 * efficiency))
|
||||
if(!hex_combo)
|
||||
hex_combo = mutable_appearance('icons/effects/64x64.dmi', n, RIPPLE_LAYER)
|
||||
else
|
||||
hex_combo.overlays += mutable_appearance('icons/effects/64x64.dmi', n, RIPPLE_LAYER)
|
||||
if(hex_combo) //YOU BUILT A HEXAGON
|
||||
hex_combo.pixel_x = -16
|
||||
hex_combo.pixel_y = -16
|
||||
hex_combo.mouse_opacity = 0
|
||||
hex_combo.plane = GAME_PLANE
|
||||
new /obj/effect/temp_visual/ratvar/prolonging_prism(T, hex_combo)
|
||||
@@ -146,6 +146,20 @@
|
||||
pixel_y = rand(-10, 10)
|
||||
animate(src, alpha = 0, time = 3, easing = EASE_OUT)
|
||||
|
||||
/obj/effect/temp_visual/ratvar/prolonging_prism
|
||||
icon = 'icons/effects/64x64.dmi'
|
||||
icon_state = "prismhex1"
|
||||
layer = RIPPLE_LAYER
|
||||
pixel_y = -16
|
||||
pixel_x = -16
|
||||
duration = 30
|
||||
|
||||
/obj/effect/temp_visual/ratvar/prolonging_prism/Initialize(mapload, set_appearance)
|
||||
. = ..()
|
||||
if(set_appearance)
|
||||
appearance = set_appearance
|
||||
animate(src, alpha = 0, time = duration, easing = BOUNCE_EASING)
|
||||
|
||||
/obj/effect/temp_visual/ratvar/spearbreak
|
||||
icon = 'icons/effects/64x64.dmi'
|
||||
icon_state = "ratvarspearbreak"
|
||||
|
||||
Reference in New Issue
Block a user