Merge branch 'master' into upstream-merge-31044

This commit is contained in:
LetterJay
2017-09-30 14:53:08 -04:00
committed by GitHub
346 changed files with 9273 additions and 7009 deletions
@@ -1,18 +1,24 @@
#define ARK_GRACE_PERIOD 300 //In seconds, how long the crew has before the Ark truly "begins"
//The gateway to Reebe, from which Ratvar emerges.
/obj/structure/destructible/clockwork/massive/celestial_gateway
name = "ark of the Clockwork Justicar"
desc = "A massive, thrumming rip in spacetime."
clockwork_desc = "A portal to the Celestial Derelict. Massive and intimidating, it is the only thing that can both transport Ratvar and withstand the massive amount of energy he emits."
name = "\improper Ark of the Clockwork Justicar"
desc = "A massive, hulking amalgamation of parts. It seems to be maintaining a very unstable bluespace anomaly."
clockwork_desc = "Nezbere's magnum opus: a hulking clockwork machine capable of combining bluespace and steam power to summon Ratvar. Once activated, \
its instability will cause one-way bluespace rifts to open across the station to the City of Cogs, so be prepared to defend it at all costs."
max_integrity = 500
mouse_opacity = MOUSE_OPACITY_OPAQUE
icon = 'icons/effects/clockwork_effects.dmi'
icon_state = "nothing"
density = FALSE
invisibility = INVISIBILITY_MAXIMUM
resistance_flags = FIRE_PROOF | ACID_PROOF | INDESTRUCTIBLE | FREEZE_PROOF
density = TRUE
resistance_flags = FIRE_PROOF | ACID_PROOF | FREEZE_PROOF
can_be_repaired = FALSE
immune_to_servant_attacks = TRUE
var/active = FALSE
var/progress_in_seconds = 0 //Once this reaches GATEWAY_RATVAR_ARRIVAL, it's game over
var/grace_period = ARK_GRACE_PERIOD //This exists to allow the crew to gear up and prepare for the invasion
var/initial_activation_delay = -1 //How many seconds the Ark will have initially taken to activate
var/seconds_until_activation = -1 //How many seconds until the Ark activates; if it should never activate, set this to -1
var/purpose_fulfilled = FALSE
var/first_sound_played = FALSE
var/second_sound_played = FALSE
@@ -20,31 +26,41 @@
var/fourth_sound_played = FALSE
var/obj/effect/clockwork/overlay/gateway_glow/glow
var/obj/effect/countdown/clockworkgate/countdown
var/list/required_components = list(BELLIGERENT_EYE = ARK_CONSUME_COST, VANGUARD_COGWHEEL = ARK_CONSUME_COST, GEIS_CAPACITOR = ARK_CONSUME_COST, REPLICANT_ALLOY = ARK_CONSUME_COST, HIEROPHANT_ANSIBLE = ARK_CONSUME_COST)
/obj/structure/destructible/clockwork/massive/celestial_gateway/Initialize()
. = ..()
INVOKE_ASYNC(src, .proc/spawn_animation)
glow = new(get_turf(src))
if(!GLOB.ark_of_the_clockwork_justiciar)
GLOB.ark_of_the_clockwork_justiciar = src
START_PROCESSING(SSprocessing, src)
/obj/structure/destructible/clockwork/massive/celestial_gateway/proc/cry_havoc()
visible_message("<span class='boldwarning'>[src] shudders and roars to life, its parts beginning to whirr and screech!</span>")
hierophant_message("<span class='bold large_brass'>The Ark is activating! Get back to the base!</span>")
for(var/mob/M in GLOB.player_list)
if(is_servant_of_ratvar(M) || isobserver(M) || M.z == z)
M.playsound_local(M, 'sound/magic/clockwork/ark_activation_sequence.ogg', 30, FALSE, pressure_affected = FALSE)
addtimer(CALLBACK(src, .proc/let_slip_the_dogs), 300)
/obj/structure/destructible/clockwork/massive/celestial_gateway/proc/let_slip_the_dogs()
spawn_animation()
first_sound_played = TRUE
active = TRUE
priority_announce("Massive [Gibberish("bluespace", 100)] anomaly detected on all frequencies. All crew are directed to \
@!$, [text2ratvar("PURGE ALL UNTRUTHS")] <&. the anomalies and destroy their source to prevent further damage to corporate property. This is \
not a drill.[grace_period ? " Estimated time of appearance: [grace_period] seconds. Use this time to prepare." : ""]", \
"Central Command Higher Dimensional Affairs", 'sound/magic/clockwork/ark_activation.ogg')
set_security_level("delta")
for(var/V in SSticker.mode.servants_of_ratvar)
var/datum/mind/M = V
if(ishuman(M.current))
M.current.add_overlay(mutable_appearance('icons/effects/genetics.dmi', "servitude", -MUTATIONS_LAYER))
/obj/structure/destructible/clockwork/massive/celestial_gateway/proc/open_portal(turf/T)
new/obj/effect/clockwork/city_of_cogs_rift(T)
/obj/structure/destructible/clockwork/massive/celestial_gateway/proc/spawn_animation()
var/turf/T = get_turf(src)
new/obj/effect/clockwork/general_marker/inathneq(T)
hierophant_message("<span class='inathneq'>\"[text2ratvar("Engine, come forth and show your servants your mercy")]!\"</span>")
playsound(T, 'sound/magic/clockwork/invoke_general.ogg', 30, 0)
sleep(10)
new/obj/effect/clockwork/general_marker/sevtug(T)
hierophant_message("<span class='sevtug'>\"[text2ratvar("Engine, come forth and show this station your decorating skills")]!\"</span>")
playsound(T, 'sound/magic/clockwork/invoke_general.ogg', 45, 0)
sleep(10)
new/obj/effect/clockwork/general_marker/nezbere(T)
hierophant_message("<span class='nezbere'>\"[text2ratvar("Engine, come forth and shine your light across this realm")]!!\"</span>")
playsound(T, 'sound/magic/clockwork/invoke_general.ogg', 60, 0)
sleep(10)
new/obj/effect/clockwork/general_marker/nzcrentr(T)
hierophant_message("<span class='nzcrentr'>\"[text2ratvar("Engine, come forth")].\"</span>")
playsound(T, 'sound/magic/clockwork/invoke_general.ogg', 75, 0)
sleep(10)
playsound(T, 'sound/magic/clockwork/invoke_general.ogg', 100, 0)
var/list/open_turfs = list()
for(var/turf/open/OT in orange(1, T))
if(!is_blocked_turf(OT, TRUE))
@@ -52,16 +68,10 @@
if(open_turfs.len)
for(var/mob/living/L in T)
L.forceMove(pick(open_turfs))
resistance_flags &= ~INDESTRUCTIBLE
density = TRUE
invisibility = 0
glow = new(get_turf(src))
countdown = new(src)
countdown.start()
var/area/gate_area = get_area(src)
hierophant_message("<span class='large_brass'><b>An Ark of the Clockwork Justicar has been created in [gate_area.map_name]!</b></span>", FALSE, src)
hierophant_message("<span class='bold large_brass'>The Ark has activated! [grace_period ? "You have [round(grace_period / 60)] minutes until the crew invades! " : ""]Defend it at all costs!</span>", FALSE, src)
sound_to_playing_players(volume = 10, channel = CHANNEL_JUSTICAR_ARK, S = sound('sound/effects/clockcult_gateway_charging.ogg', TRUE))
seconds_until_activation = 0
SSshuttle.registerHostileEnvironment(src)
START_PROCESSING(SSprocessing, src)
/obj/structure/destructible/clockwork/massive/celestial_gateway/Destroy()
STOP_PROCESSING(SSprocessing, src)
@@ -76,6 +86,18 @@
if(countdown)
qdel(countdown)
countdown = null
for(var/mob/L in GLOB.player_list)
if(L.z == z)
L.forceMove(get_turf(pick(GLOB.generic_event_spawns)))
L.overlay_fullscreen("flash", /obj/screen/fullscreen/flash/static)
L.clear_fullscreen("flash", 30)
if(isliving(L))
var/mob/living/LI = L
LI.Stun(50)
for(var/obj/effect/clockwork/city_of_cogs_rift/R in GLOB.all_clockwork_objects)
qdel(R)
if(GLOB.ark_of_the_clockwork_justiciar == src)
GLOB.ark_of_the_clockwork_justiciar = null
. = ..()
/obj/structure/destructible/clockwork/massive/celestial_gateway/deconstruct(disassembled = TRUE)
@@ -84,12 +106,13 @@
resistance_flags |= INDESTRUCTIBLE
countdown.stop()
visible_message("<span class='userdanger'>[src] begins to pulse uncontrollably... you might want to run!</span>")
sound_to_playing_players(volume = 50, channel = CHANNEL_JUSTICAR_ARK, S = sound('sound/effects/clockcult_gateway_disrupted.ogg', 0))
sound_to_playing_players(volume = 50, channel = CHANNEL_JUSTICAR_ARK, S = sound('sound/effects/clockcult_gateway_disrupted.ogg'))
make_glow()
glow.icon_state = "clockwork_gateway_disrupted"
resistance_flags |= INDESTRUCTIBLE
sleep(27)
explosion(src, 1, 3, 8, 8)
sound_to_playing_players('sound/effects/explosion_distant.ogg', volume = 50)
qdel(src)
/obj/structure/destructible/clockwork/massive/celestial_gateway/proc/make_glow()
@@ -101,46 +124,11 @@
var/damage = max((obj_integrity * 0.7) / severity, 100) //requires multiple bombs to take down
take_damage(damage, BRUTE, "bomb", 0)
/obj/structure/destructible/clockwork/massive/celestial_gateway/attackby(obj/item/I, mob/living/user, params) //add components directly to the ark
if(!is_servant_of_ratvar(user) || !still_needs_components())
return ..()
if(istype(I, /obj/item/clockwork/component))
var/obj/item/clockwork/component/C = I
if(required_components[C.component_id])
required_components[C.component_id]--
to_chat(user, "<span class='notice'>You add [C] to [src].</span>")
user.drop_item()
qdel(C)
else
to_chat(user, "<span class='notice'>[src] has enough [get_component_name(C.component_id)][C.component_id != REPLICANT_ALLOY ? "s":""].</span>")
return 1
else if(istype(I, /obj/item/clockwork/slab))
var/obj/item/clockwork/slab/S = I
var/used_components = FALSE
var/used_all = TRUE
for(var/i in S.stored_components)
if(required_components[i])
var/to_use = min(S.stored_components[i], required_components[i])
required_components[i] -= to_use
S.stored_components[i] -= to_use
if(to_use)
used_components = TRUE
if(S.stored_components[i])
used_all = FALSE
if(used_components)
update_slab_info(S)
user.visible_message("<span class='notice'>[user][used_all ? "":" partially"] empties [S] into [src].</span>", \
"<span class='notice'>You offload [used_all ? "all":"some"] of your slab's components into [src].</span>")
return 1
else
return ..()
/obj/structure/destructible/clockwork/massive/celestial_gateway/proc/still_needs_components()
for(var/i in required_components)
if(required_components[i])
return TRUE
/obj/structure/destructible/clockwork/massive/celestial_gateway/proc/get_arrival_text(s_on_time)
if(seconds_until_activation)
return "[seconds_until_activation][s_on_time ? "S" : ""]"
if(grace_period)
return "[grace_period][s_on_time ? "S" : ""]"
. = "IMMINENT"
if(!obj_integrity)
. = "DETONATING"
@@ -152,97 +140,87 @@
..()
icon_state = initial(icon_state)
if(is_servant_of_ratvar(user) || isobserver(user))
if(still_needs_components())
to_chat(user, "<span class='big'><b>Components required until activation:</b></span>")
for(var/i in required_components)
if(required_components[i])
to_chat(user, "[get_component_icon(i)] <span class='[get_component_span(i)]'>[get_component_name(i)][i != REPLICANT_ALLOY ? "s":""]:</span> \
<span class='[get_component_span(i)]_large'>[required_components[i]]</span>")
if(!active)
to_chat(user, "<span class='big'><b>Seconds until the Ark's activation:</b> [get_arrival_text(TRUE)]</span>")
else
if(grace_period)
to_chat(user, "<span class='big'><b>Crew grace period time remaining:</b> [get_arrival_text(TRUE)]</span>")
else
to_chat(user, "<span class='big'><b>Seconds until Ratvar's arrival:</b> [get_arrival_text(TRUE)]</span>")
switch(progress_in_seconds)
if(-INFINITY to GATEWAY_REEBE_FOUND)
to_chat(user, "<span class='heavy_brass'>The Ark is feeding power into the bluespace field.</span>")
if(GATEWAY_REEBE_FOUND to GATEWAY_RATVAR_COMING)
to_chat(user, "<span class='heavy_brass'>The field is ripping open a copy of itself in Ratvar's prison.</span>")
if(GATEWAY_RATVAR_COMING to INFINITY)
to_chat(user, "<span class='heavy_brass'>With the bluespace field established, Ratvar is preparing to come through!</span>")
else
if(!active)
to_chat(user, "<span class='warning'>Whatever it is, it doesn't seem to be active.</span>")
else
to_chat(user, "<span class='big'><b>Seconds until Ratvar's arrival:</b> [get_arrival_text(TRUE)]</span>")
switch(progress_in_seconds)
if(-INFINITY to GATEWAY_REEBE_FOUND)
to_chat(user, "<span class='heavy_brass'>It's still opening.</span>")
to_chat(user, "<span class='warning'>You see a swirling bluespace anomaly steadily growing in intensity.</span>")
if(GATEWAY_REEBE_FOUND to GATEWAY_RATVAR_COMING)
to_chat(user, "<span class='heavy_brass'>It's reached the Celestial Derelict and is drawing power from it.</span>")
to_chat(user, "<span class='warning'>The anomaly is stable, and you can see flashes of something from it.</span>")
if(GATEWAY_RATVAR_COMING to INFINITY)
to_chat(user, "<span class='heavy_brass'>Ratvar is coming through the gateway!</span>")
else
switch(progress_in_seconds)
if(-INFINITY to GATEWAY_REEBE_FOUND)
to_chat(user, "<span class='warning'>It's a swirling mass of blackness.</span>")
if(GATEWAY_REEBE_FOUND to GATEWAY_RATVAR_COMING)
to_chat(user, "<span class='warning'>It seems to be leading somewhere.</span>")
if(GATEWAY_RATVAR_COMING to INFINITY)
to_chat(user, "<span class='boldwarning'>Something is coming through!</span>")
to_chat(user, "<span class='boldwarning'>The anomaly is stable! Something is coming through!</span>")
/obj/structure/destructible/clockwork/massive/celestial_gateway/process()
if(seconds_until_activation == -1) //we never do anything
return
adjust_clockwork_power(2.5) //Provides weak power generation on its own
if(seconds_until_activation)
if(!countdown)
countdown = new(src)
countdown.start()
seconds_until_activation--
if(!GLOB.script_scripture_unlocked && initial_activation_delay * 0.5 > seconds_until_activation)
GLOB.script_scripture_unlocked = TRUE
hierophant_message("<span class='large_brass bold'>The Ark is halfway prepared. Script scripture is now available!</span>")
if(!seconds_until_activation)
cry_havoc()
seconds_until_activation = -1 //we'll set this after cry_havoc()
return
if(!first_sound_played || prob(7))
for(var/M in GLOB.player_list)
for(var/mob/M in GLOB.player_list)
if(M && !isnewplayer(M))
to_chat(M, "<span class='warning'><b>You hear otherworldly sounds from the [dir2text(get_dir(get_turf(M), get_turf(src)))]...</span>")
if(M.z == z)
to_chat(M, "<span class='warning'><b>You hear otherworldly sounds from the [dir2text(get_dir(get_turf(M), get_turf(src)))]...</span>")
else
to_chat(M, "<span class='boldwarning'>You hear otherworldly sounds from all around you...</span>")
if(!obj_integrity)
return 0
var/convert_dist = 1 + (round(Floor(progress_in_seconds, 15) * 0.067))
for(var/t in RANGE_TURFS(convert_dist, loc))
var/turf/T = t
if(!T)
continue
if(get_dist(T, src) < 2)
if(iswallturf(T))
var/turf/closed/wall/W = T
W.dismantle_wall()
else if(t && (isclosedturf(T) || !is_blocked_turf(T)))
T.ChangeTurf(/turf/open/floor/clockwork)
var/dist = cheap_hypotenuse(T.x, T.y, x, y)
if(dist < convert_dist)
T.ratvar_act(FALSE, TRUE, 3)
return
for(var/turf/closed/wall/W in RANGE_TURFS(2, src))
W.dismantle_wall()
for(var/obj/O in orange(1, src))
if(!O.pulledby && !istype(O, /obj/effect) && O.density)
if(!step_away(O, src, 2) || get_dist(O, src) < 2)
O.take_damage(50, BURN, "bomb")
O.update_icon()
if(still_needs_components())
if(!first_sound_played)
priority_announce("Massive energy anomaly detected on short-range scanners. Attempting to triangulate location...", "Anomaly Alert")
sound_to_playing_players(volume = 10, channel = CHANNEL_JUSTICAR_ARK, S = sound('sound/effects/clockcult_gateway_charging.ogg', 1))
first_sound_played = TRUE
make_glow()
glow.icon_state = "clockwork_gateway_components"
var/used_components = FALSE
for(var/i in required_components)
if(required_components[i])
var/to_use = min(GLOB.clockwork_component_cache[i], required_components[i])
required_components[i] -= to_use
GLOB.clockwork_component_cache[i] -= to_use
if(to_use)
used_components = TRUE
if(used_components)
update_slab_info()
if(still_needs_components())
return
if(grace_period)
grace_period--
return
progress_in_seconds += GATEWAY_SUMMON_RATE
switch(progress_in_seconds)
if(-INFINITY to GATEWAY_REEBE_FOUND)
if(!second_sound_played)
new /obj/effect/temp_visual/decoy/fading/threesecond(loc, glow)
sound_to_playing_players(volume = 30, channel = CHANNEL_JUSTICAR_ARK, S = sound('sound/effects/clockcult_gateway_charging.ogg', 1))
for(var/V in GLOB.generic_event_spawns)
addtimer(CALLBACK(src, .proc/open_portal, get_turf(V)), rand(100, 600))
sound_to_playing_players('sound/magic/clockwork/invoke_general.ogg', 30, FALSE)
sound_to_playing_players(volume = 30, channel = CHANNEL_JUSTICAR_ARK, S = sound('sound/effects/clockcult_gateway_charging.ogg', TRUE))
second_sound_played = TRUE
make_glow()
glow.icon_state = "clockwork_gateway_charging"
if(GATEWAY_REEBE_FOUND to GATEWAY_RATVAR_COMING)
if(!third_sound_played)
var/area/gate_area = get_area(src)
priority_announce("Location of massive energy anomaly has been triangulated. Location: [gate_area.map_name].", "Anomaly Alert")
new /obj/effect/temp_visual/decoy/fading/threesecond(loc, glow)
sound_to_playing_players(volume = 35, channel = CHANNEL_JUSTICAR_ARK, S = sound('sound/effects/clockcult_gateway_active.ogg', 1))
sound_to_playing_players(volume = 35, channel = CHANNEL_JUSTICAR_ARK, S = sound('sound/effects/clockcult_gateway_active.ogg', TRUE))
third_sound_played = TRUE
make_glow()
glow.icon_state = "clockwork_gateway_active"
if(GATEWAY_RATVAR_COMING to GATEWAY_RATVAR_ARRIVAL)
if(!fourth_sound_played)
new /obj/effect/temp_visual/decoy/fading/threesecond(loc, glow)
sound_to_playing_players(volume = 40, channel = CHANNEL_JUSTICAR_ARK, S = sound('sound/effects/clockcult_gateway_closing.ogg', 1))
sound_to_playing_players(volume = 40, channel = CHANNEL_JUSTICAR_ARK, S = sound('sound/effects/clockcult_gateway_closing.ogg', TRUE))
fourth_sound_played = TRUE
make_glow()
glow.icon_state = "clockwork_gateway_closing"
@@ -252,38 +230,25 @@
resistance_flags |= INDESTRUCTIBLE
purpose_fulfilled = TRUE
make_glow()
animate(glow, transform = matrix() * 3, time = 125)
sound_to_playing_players('sound/effects/ratvar_rises.ogg', channel = CHANNEL_JUSTICAR_ARK) //End the sounds
animate(glow, transform = matrix() * 1.5, alpha = 255, time = 125)
sound_to_playing_players(volume = 100, channel = CHANNEL_JUSTICAR_ARK, S = sound('sound/effects/ratvar_rises.ogg')) //End the sounds
sleep(125)
var/turf/startpoint = get_turf(src)
make_glow()
glow.transform = matrix() * 4.5
animate(glow, transform = matrix() * 0.1, time = 10)
QDEL_IN(src, 10)
animate(glow, transform = matrix() * 3, alpha = 0, time = 5)
var/turf/startpoint = get_turf(src)
QDEL_IN(src, 3)
sleep(3)
GLOB.clockwork_gateway_activated = TRUE
new/obj/structure/destructible/clockwork/massive/ratvar(startpoint)
send_to_playing_players("<span class='inathneq_large'>\"[text2ratvar("See Engine's mercy")]!\"</span>\n\
<span class='sevtug_large'>\"[text2ratvar("Observe Engine's design skills")]!\"</span>\n<span class='nezbere_large'>\"[text2ratvar("Behold Engine's light")]!!\"</span>\n\
<span class='nzcrentr_large'>\"[text2ratvar("Gaze upon Engine's power")].\"</span>")
sound_to_playing_players('sound/effects/empulse.ogg')
var/x0 = startpoint.x
var/y0 = startpoint.y
for(var/I in spiral_range_turfs(255, startpoint))
var/turf/T = I
if(!T)
continue
var/dist = cheap_hypotenuse(T.x, T.y, x0, y0)
if(dist < 100)
dist = TRUE
else
dist = FALSE
T.ratvar_act(dist, TRUE)
CHECK_TICK
var/obj/structure/destructible/clockwork/massive/ratvar/R = new(startpoint)
var/turf/T = locate(round(world.maxx * 0.5, 1), round(world.maxy * 0.5, 1), ZLEVEL_STATION_PRIMARY) //approximate center of the station
R.forceMove(T)
//the actual appearance of the Ark of the Clockwork Justicar; an object so the edges of the gate can be clicked through.
/obj/effect/clockwork/overlay/gateway_glow
icon = 'icons/effects/96x96.dmi'
icon_state = "clockwork_gateway_charging"
icon_state = "clockwork_gateway_components"
pixel_x = -32
pixel_y = -32
layer = BELOW_OPEN_DOOR_LAYER
@@ -42,7 +42,7 @@
return affected
/obj/structure/destructible/clockwork/powered/clockwork_obelisk/attack_hand(mob/living/user)
if(!is_servant_of_ratvar(user) || total_accessable_power() < hierophant_cost || !anchored)
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","Cancel")
@@ -87,7 +87,7 @@
active = TRUE
clockwork_say(user, text2ratvar("Spatial Gateway, activate!"))
return
return_power(gateway_cost) //if we didn't return above, ie, successfully create a gateway, we give the power back
adjust_clockwork_power(gateway_cost) //if we didn't return above, ie, successfully create a gateway, we give the power back
/obj/structure/destructible/clockwork/powered/clockwork_obelisk/process()
if(!anchored)
@@ -1,174 +0,0 @@
//Used by the Geis scripture to hold its target in place
/obj/structure/destructible/clockwork/geis_binding
name = "glowing ring"
desc = "A flickering, glowing purple ring around a target."
clockwork_desc = "A binding ring around a target, preventing them from taking action."
max_integrity = 20
light_range = 2
light_power = 0.8
light_color = "#AF0AAF"
anchored = FALSE
density = FALSE
immune_to_servant_attacks = TRUE
icon = 'icons/effects/clockwork_effects.dmi'
icon_state = "geisbinding_full"
break_message = null
break_sound = 'sound/magic/repulse.ogg'
debris = list()
can_buckle = TRUE
buckle_lying = 0
var/mob_layer = MOB_LAYER
var/last_mob_health = 0
var/apply_time = 0
/obj/structure/destructible/clockwork/geis_binding/Initialize(mapload, obj/item/clockwork/slab/the_slab)
. = ..()
START_PROCESSING(SSprocessing, src)
/obj/structure/destructible/clockwork/geis_binding/Destroy()
STOP_PROCESSING(SSprocessing, src)
return ..()
/obj/structure/destructible/clockwork/geis_binding/examine(mob/user)
icon_state = "geisbinding_full"
..()
icon_state = "geisbinding"
/obj/structure/destructible/clockwork/geis_binding/process()
var/tick_damage = 1
if(locate(/obj/effect/clockwork/sigil/submission) in loc)
tick_damage *= 0.5
if(LAZYLEN(buckled_mobs))
for(var/V in buckled_mobs)
var/mob/living/L = V
if(is_servant_of_ratvar(L)) //servants are freed automatically
take_damage(obj_integrity)
return
if(last_mob_health > L.health)
tick_damage += last_mob_health - L.health
last_mob_health = L.health
if(L.layer != mob_layer)
mob_layer = L.layer
layer = mob_layer - 0.01
cut_overlays()
add_overlay(mutable_appearance('icons/effects/clockwork_effects.dmi', "geisbinding_top", mob_layer + 0.01))
break
take_damage(tick_damage, sound_effect = FALSE)
playsound(src, 'sound/effects/empulse.ogg', tick_damage * 40, TRUE, -4)
/obj/structure/destructible/clockwork/geis_binding/attack_hand(mob/living/user)
return
/obj/structure/destructible/clockwork/geis_binding/attackby(obj/item/I, mob/user, params)
if(is_servant_of_ratvar(user) && istype(I, /obj/item/clockwork/slab))
user.visible_message("<span class='warning'>[user] starts to dispel [src]...</span>", "<span class='danger'>You start to dispel [src]...</span>")
if(do_after(user, 30, target = src))
user.visible_message("<span class='warning'>[user] dispels [src]!</span>", "<span class='danger'>You dispel [src]!</span>")
take_damage(obj_integrity)
return 1
return ..()
/obj/structure/destructible/clockwork/geis_binding/emp_act(severity)
new /obj/effect/temp_visual/emp(loc)
qdel(src)
/obj/structure/destructible/clockwork/geis_binding/post_buckle_mob(mob/living/M)
..()
if(M.buckled == src)
desc = "A flickering, glowing purple ring around [M]."
clockwork_desc = "A binding ring around [M], preventing [M.p_them()] from taking action."
icon_state = "geisbinding"
mob_layer = M.layer
layer = mob_layer - 0.01
add_overlay(mutable_appearance('icons/effects/clockwork_effects.dmi', "geisbinding_top", mob_layer + 0.01))
last_mob_health = M.health
apply_time = world.time
for(var/obj/item/I in M.held_items)
M.dropItemToGround(I)
for(var/i in M.get_empty_held_indexes())
var/obj/item/geis_binding/B = new(M)
M.put_in_hands(B, i)
if(iscarbon(M))
var/mob/living/carbon/C = M
if(!C.handcuffed)
C.handcuffed = new /obj/item/restraints/handcuffs/energy/clock(C)
M.regenerate_icons()
M.visible_message("<span class='warning'>A [name] appears around [M]!</span>", "<span class='warning'>A [name] appears around you!</span>")
repair_and_interrupt()
else
var/obj/effect/temp_visual/ratvar/geis_binding/G = new /obj/effect/temp_visual/ratvar/geis_binding(M.loc)
var/obj/effect/temp_visual/ratvar/geis_binding/T = new /obj/effect/temp_visual/ratvar/geis_binding/top(M.loc)
G.layer = mob_layer - 0.01
T.layer = mob_layer + 0.01
G.alpha = alpha
T.alpha = alpha
animate(G, transform = matrix()*2, alpha = 0, time = 8, easing = EASE_OUT)
animate(T, transform = matrix()*2, alpha = 0, time = 8, easing = EASE_OUT)
M.visible_message("<span class='warning'>[src] snaps into glowing pieces and dissipates!</span>")
M.AdjustStun(-130 + (apply_time - world.time), 1, 1) //remove exactly as much stun as was applied
if(iscarbon(M))
var/mob/living/carbon/C = M
C.silent = max(C.silent - 7, 0)
for(var/obj/item/geis_binding/GB in M.held_items)
M.dropItemToGround(GB, TRUE)
if(iscarbon(M))
var/mob/living/carbon/C = M
if(istype(C.handcuffed, /obj/item/restraints/handcuffs/energy/clock))
QDEL_NULL(C.handcuffed)
C.update_handcuffed()
/obj/structure/destructible/clockwork/geis_binding/play_attack_sound(damage_amount, damage_type = BRUTE, damage_flag = 0)
playsound(src, 'sound/effects/empulse.ogg', 50, 1)
/obj/structure/destructible/clockwork/geis_binding/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = 1, attack_dir)
. = ..()
if(.)
update_icon()
/obj/structure/destructible/clockwork/geis_binding/update_icon()
alpha = min(255 * ((obj_integrity/max_integrity) + 0.2) , 255)
/obj/structure/destructible/clockwork/geis_binding/proc/repair_and_interrupt()
obj_integrity = max_integrity
update_icon()
for(var/m in buckled_mobs)
var/mob/living/L = m
if(L)
L.Stun(130, 1, 1) //basically here to act as a mute for borgs
if(iscarbon(L))
var/mob/living/carbon/C = L
C.silent += 7
visible_message("<span class='sevtug'>[src] flares brightly!</span>")
var/obj/effect/temp_visual/ratvar/geis_binding/G1 = new /obj/effect/temp_visual/ratvar/geis_binding(loc)
var/obj/effect/temp_visual/ratvar/geis_binding/G2 = new /obj/effect/temp_visual/ratvar/geis_binding(loc)
var/obj/effect/temp_visual/ratvar/geis_binding/T1 = new /obj/effect/temp_visual/ratvar/geis_binding/top(loc)
var/obj/effect/temp_visual/ratvar/geis_binding/T2 = new /obj/effect/temp_visual/ratvar/geis_binding/top(loc)
G1.layer = mob_layer - 0.01
G2.layer = mob_layer - 0.01
T1.layer = mob_layer + 0.01
T2.layer = mob_layer + 0.01
animate(G1, pixel_y = pixel_y + 9, alpha = 0, time = 8, easing = EASE_IN)
animate(G2, pixel_y = pixel_y - 9, alpha = 0, time = 8, easing = EASE_IN)
animate(T1, pixel_y = pixel_y + 9, alpha = 0, time = 8, easing = EASE_IN)
animate(T2, pixel_y = pixel_y - 9, alpha = 0, time = 8, easing = EASE_IN)
/obj/structure/destructible/clockwork/geis_binding/user_unbuckle_mob(mob/living/buckled_mob, mob/user)
if(buckled_mob != user)
return ..()
/obj/item/geis_binding
name = "glowing ring"
desc = "A flickering ring preventing you from holding items."
icon = 'icons/effects/clockwork_effects.dmi'
icon_state = "geisbinding_full"
flags_1 = NODROP_1|ABSTRACT_1|DROPDEL_1
/obj/item/geis_binding/pre_attackby(atom/target, mob/living/user, params)
return FALSE
/obj/item/restraints/handcuffs/energy/clock
name = "glowing rings"
desc = "Flickering rings preventing you from holding items."
icon = 'icons/effects/clockwork_effects.dmi'
icon_state = "geisbinding_full"
flags_1 = NODROP_1|ABSTRACT_1|DROPDEL_1
@@ -0,0 +1,109 @@
//Used to "declare war" against the station. The servants' equipment will be permanently supercharged, and the Ark given extra time to prepare.
//This will send an announcement to the station, meaning that they will be warned very early in advance about the impending attack.
/obj/structure/destructible/clockwork/heralds_beacon
name = "herald's beacon"
desc = "An imposing spire formed of brass, with a thrumming gemstone at its peak."
clockwork_desc = "A massively-powerful beacon. If enough servants decide to activate it, it will send an incredibly large energy pulse to the Ark, \
permanently empowering many clockwork objects and reducing all power costs by 50%, but alerting the crew to your presence. It doesn't have enough \
energy to sustain itself for long, and if not activated within five minutes, it will permanently shut down."
icon_state = "interdiction_lens"
break_message = "<span class='warning'>The beacon crackles with power before collapsing into pieces!</span>"
max_integrity = 250
light_color = "#EF078E"
var/time_remaining = 300 //Amount of seconds left to vote on whether or not to activate the beacon
var/list/voters //People who have voted to activate the beacon
var/votes_needed = 0 //How many votes are needed to activate the beacon
var/available = FALSE //If the beacon can be used
/obj/structure/destructible/clockwork/heralds_beacon/Initialize()
. = ..()
voters = list()
START_PROCESSING(SSprocessing, src)
/obj/structure/destructible/clockwork/heralds_beacon/Destroy()
STOP_PROCESSING(SSprocessing, src)
. = ..()
/obj/structure/destructible/clockwork/heralds_beacon/process()
if(!available)
if(istype(SSticker.mode, /datum/game_mode/clockwork_cult))
available = TRUE
else
return
if(!SSticker.mode.servants_of_ratvar.len)
return
if(!votes_needed)
var/servants = SSticker.mode.servants_of_ratvar.len
if(servants)
votes_needed = round(servants * 0.66)
time_remaining--
if(!time_remaining)
hierophant_message("<span class='bold sevtug_small'>[src] has lost its power, and can no longer be activated.</span>")
for(var/mob/M in GLOB.player_list)
if(isobserver(M) || is_servant_of_ratvar(M))
M.playsound_local(M, 'sound/magic/blind.ogg', 50, FALSE)
available = FALSE
icon_state = "interdiction_lens_unwrenched"
STOP_PROCESSING(SSprocessing, src)
/obj/structure/destructible/clockwork/heralds_beacon/examine(mob/user)
..()
if(isobserver(user) || is_servant_of_ratvar(user))
if(!available)
if(!GLOB.ratvar_approaches)
to_chat(user, "<span class='bold alloy'>It can no longer be activated.</span>")
else
to_chat(user, "<span class='bold neovgre_small'>It has been activated!</span>")
else
to_chat(user, "<span class='brass'>There are <b>[time_remaining]</b> second[time_remaining != 1 ? "s" : ""] remaining to vote.</span>")
to_chat(user, "<span class='big brass'>There are <b>[voters.len]/[votes_needed]</b> votes to activate the beacon!</span>")
/obj/structure/destructible/clockwork/heralds_beacon/attack_hand(mob/living/user)
if(!is_servant_of_ratvar(user))
to_chat(user, "<span class='notice'>You can tell how powerful [src] is; you know better than to touch it.</span>")
return
if(!available)
to_chat(user, "<span class='danger'>You can no longer vote with [src].</span>")
return
var/voting = !(user.key in voters)
if(alert(user, "[voting ? "Cast a" : "Undo your"] vote to activate the beacon?", "Herald's Beacon", "Change Vote", "Cancel") == "Cancel")
return
if(!user.canUseTopic(src) || !is_servant_of_ratvar(user) || !available)
return
if(voting)
if(user.key in voters)
return
voters += user.key
else
if(!user.key in voters)
return
voters -= user.key
var/votes_left = votes_needed - voters.len
message_admins("[ADMIN_LOOKUPFLW(user)] has [voting ? "voted" : "undone their vote"] to activate [src]! [ADMIN_JMP(user)]")
hierophant_message("<span class='brass'><b>[user.real_name]</b> has [voting ? "voted" : "undone their vote"] to activate [src]! The beacon needs [votes_left] more votes to activate.")
for(var/mob/M in GLOB.player_list)
if(isobserver(M) || is_servant_of_ratvar(M))
M.playsound_local(M, 'sound/magic/clockwork/fellowship_armory.ogg', 50, FALSE)
if(!votes_left)
herald_the_justiciar()
/obj/structure/destructible/clockwork/heralds_beacon/proc/herald_the_justiciar()
priority_announce("A powerful group of fanatical zealots following the cause of Ratvar have brazenly sacrificed stealth for power, and dare anyone \
to try and stop them.", title = "The Justiciar Comes", sound = 'sound/magic/clockwork/ark_activation.ogg')
GLOB.ratvar_approaches = TRUE
available = FALSE
STOP_PROCESSING(SSprocessing, src)
icon_state = "interdiction_lens_active"
hierophant_message("<span class='big bold brass'>The beacon's activation has given your team great power! Many of your objects are permanently empowered!</span>")
for(var/mob/living/simple_animal/hostile/clockwork/C in GLOB.all_clockwork_mobs)
if(C.stat == DEAD)
continue
C.update_values()
to_chat(C, C.empower_string)
for(var/mob/living/carbon/human/H in GLOB.living_mob_list)
if(is_servant_of_ratvar(H))
to_chat(H, "<span class='bold alloy'>The beacon's power warps your body into a clockwork form! You are now immune to many hazards, and your body is more robust against damage!</span>")
H.set_species(/datum/species/golem/clockwork/no_scrap)
SSshuttle.registerHostileEnvironment(GLOB.ark_of_the_clockwork_justiciar) //no leaving when we need to purge you, heretics
var/obj/structure/destructible/clockwork/massive/celestial_gateway/G = GLOB.ark_of_the_clockwork_justiciar
G.grace_period = FALSE //no grace period if we've declared war
@@ -32,7 +32,7 @@
/obj/structure/destructible/clockwork/powered/mania_motor/attack_hand(mob/living/user)
if(user.canUseTopic(src, !issilicon(user), NO_DEXTERY) && is_servant_of_ratvar(user))
if(!total_accessable_power() >= mania_cost)
if(!can_access_clockwork_power(src, mania_cost))
to_chat(user, "<span class='warning'>[src] needs more power to function!</span>")
return 0
toggle(0, user)
@@ -11,7 +11,7 @@
break_message = "<span class='warning'>The warden's eye gives a glare of utter hate before falling dark!</span>"
debris = list(/obj/item/clockwork/component/belligerent_eye/blind_eye = 1)
resistance_flags = LAVA_PROOF | FIRE_PROOF | ACID_PROOF
var/damage_per_tick = 2.7
var/damage_per_tick = 2.5
var/sight_range = 3
var/atom/movable/target
var/list/idle_messages = list(" sulkily glares around.", " lazily drifts from side to side.", " looks around for something to burn.", " slowly turns in circles.")
@@ -68,9 +68,9 @@
else
R.reveal(10)
if(prob(50))
L.playsound_local(null,'sound/machines/clockcult/ocularwarden-dot1.ogg',50,1)
L.playsound_local(null,'sound/machines/clockcult/ocularwarden-dot1.ogg',75 * get_efficiency_mod(),1)
else
L.playsound_local(null,'sound/machines/clockcult/ocularwarden-dot2.ogg',50,1)
L.playsound_local(null,'sound/machines/clockcult/ocularwarden-dot2.ogg',75 * get_efficiency_mod(),1)
L.adjustFireLoss((!iscultist(L) ? damage_per_tick : damage_per_tick * 2) * get_efficiency_mod()) //Nar-Sian cultists take additional damage
if(GLOB.ratvar_awakens && L)
L.adjust_fire_stacks(damage_per_tick)
@@ -89,10 +89,10 @@
visible_message("<span class='warning'>[src] swivels to face [target]!</span>")
if(isliving(target))
var/mob/living/L = target
to_chat(L, "<span class='heavy_brass'>\"I SEE YOU!\"</span>\n<span class='userdanger'>[src]'s gaze [GLOB.ratvar_awakens ? "melts you alive" : "burns you"]!</span>")
to_chat(L, "<span class='neovgre'>\"I SEE YOU!\"</span>\n<span class='userdanger'>[src]'s gaze [GLOB.ratvar_awakens ? "melts you alive" : "burns you"]!</span>")
else if(istype(target, /obj/mecha))
var/obj/mecha/M = target
to_chat(M.occupant, "<span class='heavy_brass'>\"I SEE YOU!\"</span>" )
to_chat(M.occupant, "<span class='neovgre'>\"I SEE YOU!\"</span>" )
else if(prob(0.5)) //Extremely low chance because of how fast the subsystem it uses processes
if(prob(50))
visible_message("<span class='notice'>[src][pick(idle_messages)]</span>")
@@ -112,7 +112,7 @@
continue
if(is_servant_of_ratvar(L) || (L.disabilities & BLIND) || L.null_rod_check())
continue
if(L.stat || L.restrained() || L.buckled || L.lying || istype(L.buckled, /obj/structure/destructible/clockwork/geis_binding))
if(L.stat || L.restrained() || L.buckled || L.lying)
continue
if(ishostile(L))
var/mob/living/simple_animal/hostile/H = L
@@ -134,3 +134,15 @@
target = null
visible_message("<span class='warning'>[src] settles and seems almost disappointed.</span>")
return 1
/obj/structure/destructible/clockwork/ocular_warden/get_efficiency_mod()
if(GLOB.ratvar_awakens)
return 2
. = 1
if(target)
for(var/turf/T in getline(src, target))
for(var/obj/structure/O in T)
if(O.density)
. -= 0.15
. -= (get_dist(src, target) * 0.05)
. = max(., 0.1) //The lowest damage a warden can do is 10% of its normal amount (0.25 by default)
@@ -1,135 +0,0 @@
//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
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 = 3000
var/static/delay_cost_increase = 1250
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(TRUE)
to_chat(user, "<span class='inathneq_small'>It requires at least <b>[DisplayPower(get_delay_cost())]</b> of power to attempt to delay the arrival of an emergency shuttle by <b>[2 * efficiency]</b> minutes.</span>")
to_chat(user, "<span class='inathneq_small'>This cost increases by <b>[DisplayPower(delay_cost_increase)]</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 in GLOB.station_z_levels))
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
if(!try_use_power(get_delay_cost()))
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 in GLOB.station_z_levels))
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_PRIMARY)
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(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.add_overlay(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 = MOUSE_OPACITY_TRANSPARENT
hex_combo.plane = GAME_PLANE
new /obj/effect/temp_visual/ratvar/prolonging_prism(T, hex_combo)
@@ -1,8 +1,8 @@
//Ratvar himself. Impossible to damage by most standard means, He will dominate the station and all upon it.
//Ratvar himself. Impossible to damage by most standard means, and converts nearby objects and players into clockwork variants and Servants.
/obj/structure/destructible/clockwork/massive/ratvar
name = "Ratvar, the Clockwork Justiciar"
desc = "<span class='userdanger'>What is what is what are what real what is all a lie all a lie it's all a lie why how can what is</span>"
clockwork_desc = "<span class='large_brass'><b><i>Ratvar, the Clockwork Justiciar, your master eternal.</i></b></span>"
desc = "..."
clockwork_desc = "<span class='large_brass bold italics'>Ratvar, free at last!</span>"
icon = 'icons/effects/512x512.dmi'
icon_state = "ratvar"
pixel_x = -235
@@ -13,7 +13,7 @@
light_range = 15
light_color = "#BE8700"
var/atom/prey //Whatever Ratvar is chasing
var/clashing = FALSE //If Ratvar is FUCKING FIGHTING WITH NAR-SIE
var/clashing = FALSE //If Ratvar is fighting with Nar-Sie
var/convert_range = 10
dangerous_possession = TRUE
@@ -22,20 +22,21 @@
GLOB.ratvar_awakens++
for(var/obj/O in GLOB.all_clockwork_objects)
O.ratvar_act()
for(var/mob/living/simple_animal/hostile/clockwork/M in GLOB.all_clockwork_mobs)
M.ratvar_act()
START_PROCESSING(SSobj, src)
INVOKE_ASYNC(SSshuttle.emergency, /obj/docking_port/mobile/emergency.proc/request, null, 0, null, FALSE, 0)
send_to_playing_players("<span class='ratvar'>\"[text2ratvar("ONCE AGAIN MY LIGHT SHALL SHINE ACROSS THIS PATHETIC REALM")]!!\"</span>")
send_to_playing_players("<span class='ratvar'>[text2ratvar("ONCE AGAIN MY LIGHT SHINES AMONG THESE PATHETIC STARS")]</span>")
sound_to_playing_players('sound/effects/ratvar_reveal.ogg')
var/mutable_appearance/alert_overlay = mutable_appearance('icons/effects/clockwork_effects.dmi', "ratvar_alert")
var/area/A = get_area(src)
notify_ghosts("The Justiciar's light calls to you! Reach out to Ratvar in [A.name] to be granted a shell to spread his glory!", null, source = src, alert_overlay = alert_overlay)
INVOKE_ASYNC(SSshuttle.emergency, /obj/docking_port/mobile/emergency.proc/request, null, 10, null, FALSE, 0)
/obj/structure/destructible/clockwork/massive/ratvar/Destroy()
GLOB.ratvar_awakens--
for(var/obj/O in GLOB.all_clockwork_objects)
O.ratvar_act()
STOP_PROCESSING(SSobj, src)
send_to_playing_players("<span class='heavy_brass'><font size=6>\"NO! I will not... be...</font> <font size=5>banished...</font> <font size=4>again...\"</font></span>")
return ..()
/obj/structure/destructible/clockwork/massive/ratvar/attack_ghost(mob/dead/observer/O)
@@ -100,12 +101,12 @@
return
clashing = TRUE
GLOB.cult_narsie.clashing = TRUE
to_chat(world, "<span class='heavy_brass'><font size=5>\"[pick("BLOOD GOD!!!", "NAR-SIE!!!", "AT LAST, YOUR TIME HAS COME!")]\"</font></span>")
to_chat(world, "<span class='cult'><font size=5>\"<b>Ratvar?! How?!</b>\"</font></span>")
clash_of_the_titans(GLOB.cult_narsie) //IT'S TIME FOR THE BATTLE OF THE AGES
to_chat(world, "<span class='bold brass'><font size=5>\"YOU.\"</font></span>")
to_chat(world, "<span class='bold cult'><font size=5>\"Ratvar?!\"</font></span>")
clash_of_the_titans(GLOB.cult_narsie) // >:(
return TRUE
//Put me in Reebe, will you? Ratvar has found and is going to fucking murder Nar-Sie
//Put me in Reebe, will you? Ratvar has found and is going to do a hecking murder on Nar-Sie
/obj/structure/destructible/clockwork/massive/ratvar/proc/clash_of_the_titans(obj/singularity/narsie/narsie)
var/winner = "Undeclared"
var/base_victory_chance = 1
@@ -136,7 +137,7 @@
base_victory_chance *= 2 //The clash has a higher chance of resolving each time both gods attack one another
switch(winner)
if("Ratvar")
send_to_playing_players("<span class='heavy_brass'><font size=5>\"[pick("DIE! DIE! DIE!", "FILTH!!!", "SUFFER!!!", text2ratvar("ROT FOR CENTURIES AS I HAVE!!"))]\"</font></span>\n\
send_to_playing_players("<span class='heavy_brass'><font size=5>\"[pick("DIE.", "ROT.")]\"</font></span>\n\
<span class='cult'><font size=5>\"<b>[pick("Nooooo...", "Not die. To y-", "Die. Ratv-", "Sas tyen re-")]\"</b></font></span>") //nar-sie get out
sound_to_playing_players('sound/magic/clockwork/anima_fragment_attack.ogg')
sound_to_playing_players('sound/magic/demon_dies.ogg', 50)
@@ -0,0 +1,66 @@
#define STARGAZER_RANGE 3 //How many tiles the stargazer can see out to
#define STARGAZER_POWER 20 //How many watts will be produced per second when the stargazer sees starlight
//Stargazer: A very fragile but cheap generator that creates power from starlight.
/obj/structure/destructible/clockwork/stargazer
name = "stargazer"
desc = "A large lantern-shaped machine made of thin brass. It looks fragile."
clockwork_desc = "A lantern-shaped generator that produces power when near starlight."
icon_state = "stargazer"
unanchored_icon = "stargazer_unwrenched"
max_integrity = 40
construction_value = 5
layer = WALL_OBJ_LAYER
break_message = "<span class='warning'>The stargazer's fragile body shatters into pieces!</span>"
resistance_flags = LAVA_PROOF | FIRE_PROOF | ACID_PROOF
light_color = "#DAAA18"
var/star_light_star_bright = FALSE //If this stargazer can see starlight
/obj/structure/destructible/clockwork/stargazer/Initialize()
. = ..()
START_PROCESSING(SSprocessing, src)
/obj/structure/destructible/clockwork/stargazer/Destroy()
STOP_PROCESSING(SSprocessing, src)
. = ..()
/obj/structure/destructible/clockwork/stargazer/examine(mob/user)
..()
if(is_servant_of_ratvar(user))
to_chat(user, "<span class='nzcrentr_small'>Generates <b>[DisplayPower(STARGAZER_POWER)]</b> per second while viewing starlight within [STARGAZER_RANGE] tiles.</span>")
if(star_light_star_bright)
to_chat(user, "[is_servant_of_ratvar(user) ? "<span class='nzcrentr_small'>It can see starlight!</span>" : "It's shining brilliantly!"]")
/obj/structure/destructible/clockwork/stargazer/process()
star_light_star_bright = check_starlight()
if(star_light_star_bright)
adjust_clockwork_power(STARGAZER_POWER)
/obj/structure/destructible/clockwork/stargazer/update_anchored(mob/living/user, damage)
. = ..()
star_light_star_bright = check_starlight()
/obj/structure/destructible/clockwork/stargazer/proc/check_starlight()
var/old_status = star_light_star_bright
var/has_starlight
if(!anchored)
has_starlight = FALSE
else
for(var/turf/T in view(3, src))
if(isspaceturf(T))
has_starlight = TRUE
break
if(old_status != has_starlight)
if(has_starlight)
visible_message("<span class='nzcrentr_small'>[src] hums and shines brilliantly!</span>")
playsound(src, 'sound/machines/clockcult/stargazer_activate.ogg', 50, TRUE)
add_overlay("stargazer_light")
set_light(1.5, 5)
else
if(anchored) //We lost visibility somehow
visible_message("<span class='danger'>[src] flickers, and falls dark.</span>")
else
visible_message("<span class='danger'>[src] whooshes quietly as it slides into a less bulky form.</span>")
cut_overlays()
set_light(0)
return has_starlight
@@ -105,7 +105,7 @@
..()
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>[round(get_production_time() * 0.1, 0.1)]</b> seconds!</span>")
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>")
@@ -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