Updates stable gateways

Changes some stuff around, makes gateways automatically stable if they are a reebe-station obelisk-obelisk gateway
This commit is contained in:
DeltaFire
2020-07-12 18:36:59 +02:00
parent b98f2532d5
commit 0b0fbc1272
2 changed files with 20 additions and 51 deletions
@@ -229,14 +229,22 @@
gateway_uses = round(gateway_uses * (2 * efficiency), 1)
time_duration = round(time_duration * (2 * efficiency), 1)
CO.active = TRUE //you'd be active in a second but you should update immediately
invoker.visible_message("<span class='warning'>The air in front of [invoker] ripples before suddenly tearing open!</span>", \
"<span class='brass'>With a word, you rip open a [two_way ? "two-way":"one-way"] rift to [input_target_key]. It will last for [DisplayTimeText(time_duration)] and has [gateway_uses] use[gateway_uses > 1 ? "s" : ""].</span>")
var/obj/effect/clockwork/spatial_gateway/S1 = new(issrcobelisk ? get_turf(src) : get_step(get_turf(invoker), invoker.dir))
var/obj/effect/clockwork/spatial_gateway/S2 = new(istargetobelisk ? get_turf(target) : get_step(get_turf(target), target.dir))
if(issrcobelisk && istargetobelisk && src.z != target.z && (is_reebe(src.z) || is_reebe(target.z)))
invoker.visible_message("<span class='warning'>The air in front of [invoker] ripples before suddenly tearing open!</span>", \
"<span class='brass'>With a word, you rip open a stable two-way rift between reebe and the mortal realm.</span>")
var/obj/effect/clockwork/spatial_gateway/stable/stable_S1 = new(get_turf(src))
var/obj/effect/clockwork/spatial_gateway/stable/stable_S2 = new(get_turf(target))
stable_S1.setup_gateway(stable_S2)
stable_S2.visible_message("<span class='warning'>The air in front of [target] ripples before suddenly tearing open!</span>")
else
invoker.visible_message("<span class='warning'>The air in front of [invoker] ripples before suddenly tearing open!</span>", \
"<span class='brass'>With a word, you rip open a [two_way ? "two-way":"one-way"] rift to [input_target_key]. It will last for [DisplayTimeText(time_duration)] and has [gateway_uses] use[gateway_uses > 1 ? "s" : ""].</span>")
var/obj/effect/clockwork/spatial_gateway/S1 = new(issrcobelisk ? get_turf(src) : get_step(get_turf(invoker), invoker.dir))
var/obj/effect/clockwork/spatial_gateway/S2 = new(istargetobelisk ? get_turf(target) : get_step(get_turf(target), target.dir))
//Set up the portals now that they've spawned
S1.setup_gateway(S2, time_duration, gateway_uses, two_way)
S2.visible_message("<span class='warning'>The air in front of [target] ripples before suddenly tearing open!</span>")
//Set up the portals now that they've spawned
S1.setup_gateway(S2, time_duration, gateway_uses, two_way)
S2.visible_message("<span class='warning'>The air in front of [target] ripples before suddenly tearing open!</span>")
return TRUE
//Stable Gateway: Used to travel to and from reebe without any further powercost. Needs a clockwork obilisk to keep active, but stays active as long as it is not deactivated via an null rod or a slab, or the obilisk is destroyed
@@ -251,6 +259,9 @@
return TRUE
return FALSE
/obj/effect/clockwork/spatial_gateway/stable/setup_gateway(/obj/effect/clockwork/spatial_gateway/stable/gatewayB, set_duration = 1, set_uses = 1, two_way = TRUE) //Reduced setup call due to some things being irrelevant for stable gateways
return ..()
/obj/effect/clockwork/spatial_gateway/stable/attackby(obj/item/I, mob/living/user, params)
if(!istype(I, /obj/item/clockwork/slab) || !is_servant_of_ratvar(user) || busy)
return ..()
@@ -266,6 +277,7 @@
return TRUE
//TODO: Add effect for this, maybe reuse the void blaster one from that PR?
/obj/effect/clockwork/spatial_gateway/stable/proc/start_shutdown()
deltimer(timerid)
deltimer(linked_gateway.timerid)
@@ -53,7 +53,7 @@
if(!is_servant_of_ratvar(user) || !can_access_clockwork_power(src, hierophant_cost) || !anchored)
to_chat(user, "<span class='warning'>You place your hand on [src], but it doesn't react.</span>")
return
var/choice = alert(user,"You place your hand on [src]...",,/*"Hierophant Broadcast",*/"Spatial Gateway","Stable Reebe Gateway","Cancel") //TODO: Find a good way to do this because choice / alert does only support up to six args, not seven as needed
var/choice = alert(user,"You place your hand on [src]...",,"Hierophant Broadcast","Spatial Gateway","Cancel") //TODO: Find a good way to do this because choice / alert does only support up to six args, not seven as needed
switch(choice)
if("Hierophant Broadcast")
if(active)
@@ -96,26 +96,6 @@
clockwork_say(user, text2ratvar("Spatial Gateway, activate!"))
return
adjust_clockwork_power(gateway_cost) //if we didn't return above, ie, successfully create a gateway, we give the power back
if("Stable Reebe Gateway")
if(active)
to_chat(user, "<span class='warning'>[src] is already sustaining a gateway!</span>")
return
if(!user.can_speak_vocal())
to_chat(user, "<span class='warning'>You need to be able to speak to open a stable gateway!</span>")
return
if(is_reebe(z))
to_chat(user, "<span class='brass'>You are already on reebe, child...</span>")
return
if(!try_use_power(gateway_cost)) //Maybe set it a bit higher than a normal portal? Eh should be fine, balance will tell..
to_chat(user, "<span class='warning'>[src] lacks the power to open a stable gateway!</span>")
return
if(procure_reebe_gateway(user))
process()
if(!active)
active = TRUE
clockwork_say(user, text2ratvar("Stable Gateway, activate!"))
return
adjust_clockwork_power(gateway_cost) //Same as before
/obj/structure/destructible/clockwork/powered/clockwork_obelisk/process()
if(!anchored)
@@ -129,26 +109,3 @@
icon_state = inactive_icon
density = TRUE
active = FALSE
//Special proc used for station-reebe stable gateways created by Obilisks on the station. Not done as subtype of the proc because it's quite a bit different.\
Chooses one random non-active obilisk on reebe to link to.
/obj/structure/destructible/clockwork/powered/clockwork_obelisk/proc/procure_reebe_gateway(mob/living/user)
var/list/possible_reebe_obilisks = list()
for(var/obj/structure/destructible/clockwork/powered/clockwork_obelisk/O in GLOB.all_clockwork_objects)
if(is_reebe(O.z) && !O.active && O.anchored)
possible_reebe_obilisks += O
if(!possible_reebe_obilisks.len)
to_chat(user, "<span class='warning'>There are no eligible Obilisks on reebe!</span>")
return FALSE
var/obj/structure/destructible/clockwork/powered/clockwork_obelisk/target = pick(possible_reebe_obilisks)
target.active = TRUE
src.active = TRUE
user.visible_message("<span class='warning'>The air in front of [user] ripples before suddenly tearing open!</span>", \
"<span class='brass'>With a word, you open a stable rift between reebe and the mortal realm.</span>")
var/obj/effect/clockwork/spatial_gateway/stable/S1 = new(get_turf(src))
var/obj/effect/clockwork/spatial_gateway/stable/S2 = new(get_turf(target))
S1.setup_gateway(S2, 1, 1, TRUE) //The two 1s are irrelevant since it's a stable gateway
S2.visible_message("<span class='warning'>The air in front of [target] ripples before suddenly tearing open!</span>")
return TRUE