compile, jump board crash to ground

This commit is contained in:
kevinz000
2020-01-25 17:25:15 -07:00
parent 19f1eba015
commit ebff6c9f38
6 changed files with 58 additions and 54 deletions

View File

@@ -59,7 +59,7 @@
START_PROCESSING(SSfastprocess, src)
create_reagents(1000)
if(noreact_reagents)
reagents.reagent_holder_flags |= NO_REACTION
reagents.reagents_holder_flags |= NO_REACTION
wires = new /datum/wires/poolcontroller(src)
scan_things()
@@ -189,8 +189,7 @@
return
if (!drained)
process_pool()
if(reagent_delay <= world.time)
process_reagents()
process_reagents()
/obj/machinery/pool/controller/proc/process_pool()
if(!drained)
@@ -251,7 +250,7 @@
color1.watertop.color = null
/obj/machinery/pool/controller/proc/update_temp()
if(mist_status)
if(mist_state)
if(temperature < POOL_SCALDING)
mist_off()
else
@@ -290,11 +289,11 @@
interact_delay = world.time + 15
if(href_list["Activate Drain"])
if((drainable || issilicon(usr) || IsAdminGhost(usr)) && !linked_drain.active)
mistoff()
mist_off()
interact_delay = world.time + 60
linked_drain.active = TRUE
linked_drain.timer = 15
if(!linked_drain.status)
linked_drain.cycles_left = 15
if(!linked_drain.filling)
new /obj/effect/whirlpool(linked_drain.loc)
temperature = POOL_NORMAL
else

View File

@@ -14,7 +14,7 @@
/// Drain mode suction range
var/drain_suck_range = 6
/// Parent controller
var/obj/machinery/pool/controller/pool_controller
var/obj/machinery/pool/controller/controller
/// Cycles left for fill/drain while active
var/cycles_left = 0
/// Mobs we are swirling around
@@ -28,8 +28,8 @@
return ..()
/obj/machinery/pool/drain/Destroy()
pool_controller.linked_drain = null
pool_controller = null
controller.linked_drain = null
controller = null
whirling_mobs = null
return ..()
@@ -40,11 +40,11 @@
if(!I.anchored && (I.w_class == WEIGHT_CLASS_SMALL))
step_towards(I, src)
if((I.w_class == WEIGHT_CLASS_TINY) && (get_dist(I, src) == 0))
I.forceMove(pool_controller.linked_filter)
I.forceMove(controller.linked_filter)
if(active)
if(filling)
if(timer-- > 0)
playsound(src, 'sound/efefcts/fillingwatter.ogg', 100, TRUE)
if(cycles_left-- > 0)
playsound(src, 'sound/effects/fillingwatter.ogg', 100, TRUE)
for(var/obj/O in orange(min(fill_push_range, 10), src))
if(!O.anchored)
step_away(O, src)
@@ -57,16 +57,16 @@
P.update_ion()
for(var/obj/effect/waterspout/S in range(1, src))
qdel(S)
pool_controller.drained = FALSE
if(pool_controller.bloody < 1000)
pool_controller.bloody /= 2
controller.drained = FALSE
if(controller.bloody < 1000)
controller.bloody /= 2
else
pool_controller.bloody /= 4
pool_controller.update_color()
controller.bloody /= 4
controller.update_color()
filling = FALSE
active = FALSE
else
if(timer-- > 0)
if(cycles_left-- > 0)
playsound(src, 'sound/effects/pooldrain.ogg', 100, TRUE)
playsound(src, "water_wade", 60, TRUE)
for(var/obj/O in orange(min(drain_suck_range, 10), src))
@@ -81,18 +81,18 @@
playsound(src, pick('sound/misc/crack.ogg','sound/misc/crunch.ogg'), 50, TRUE)
if(H.lying) //down for any reason
H.adjustBruteLoss(5)
to_chat(whirlm, "<span class='danger'>You're caught in the drain!</span>")
to_chat(H, "<span class='danger'>You're caught in the drain!</span>")
else
whirlm.apply_damage(4, BRUTE, pick("l_leg", "r_leg")) //drain should only target the legs
to_chat(whirlm, "<span class='danger'>Your legs are caught in the drain!</span>")
H.apply_damage(4, BRUTE, pick("l_leg", "r_leg")) //drain should only target the legs
to_chat(H, "<span class='danger'>Your legs are caught in the drain!</span>")
else
for(var/turf/open/pool/P in controller.linked_turfs)
P.filled = FALSE
P.update_icon()
for(var/obj/efefct/whirlpool/W in range(1, src))
for(var/obj/effect/whirlpool/W in range(1, src))
qdel(W)
linked_controller.drained = TRUE
linked_controller.mistoff()
linked_controller.mist_off()
active = FALSE
filling = TRUE
@@ -111,11 +111,11 @@
name = "Filter"
icon_state = "filter"
desc = "The part of the pool where all the IDs, ATV keys, and pens, and other dangerous things get trapped."
var/obj/machinery/pool/controller/pool_controller
var/obj/machinery/pool/controller/controller
/obj/machinery/pool/filter/Destroy()
pool_controller.linked_filter = null
pool_controller = null
controller.linked_filter = null
controller = null
return ..()
/obj/machinery/pool/filter/emag_act(mob/living/user)

View File

@@ -49,21 +49,21 @@
// Mousedrop hook to normal turfs to get out of pools.
/turf/open/MouseDrop_T(atom/from, mob/user)
// I could make this /open/floor and not have the !istype but ehh - kev
if(SEND_SIGNAL(from, COMSIG_IS_SWIMMING) && isliving(user) && ((user == from) || user.CanReach(from)) && !user.IsStunned() && !user.IsKnockdown() && !user.incapacitated() && !istype(src, /turf/open/pool))
if(isliving(from) && SEND_SIGNAL(from, COMSIG_IS_SWIMMING) && isliving(user) && ((user == from) || user.CanReach(from)) && !user.IsStun() && !user.IsKnockdown() && !user.incapacitated() && !istype(src, /turf/open/pool))
var/mob/living/L = from
//The element only exists if you're on water and a living mob, so let's skip those checks.
var/pre_msg
var/post_msg
if(user == from)
pre_msg = "<span class='notice'>[from] is getting out of the pool.</span>"
post_msg = "<span class='notice'>[from] gets out of the pool.</span>"
pre_msg = "<span class='notice'>[L] is getting out of the pool.</span>"
post_msg = "<span class='notice'>[L] gets out of the pool.</span>"
else
pre_msg = "<span class='notice'>[from] is being pulled out of the pool by [user].</span>"
post_msg = "<span class='notice'>[user] pulls [from] out of the pool.</span>"
from.visible_message(pre_msg)
if(do_mob(user, from, 20))
from.visible_message(post_msg)
from.forceMove(src)
pre_msg = "<span class='notice'>[L] is being pulled out of the pool by [user].</span>"
post_msg = "<span class='notice'>[user] pulls [L] out of the pool.</span>"
L.visible_message(pre_msg)
if(do_mob(user, L, 20))
L.visible_message(post_msg)
L.forceMove(src)
else
return ..()
@@ -141,7 +141,7 @@
H.Knockdown(40)
playsound(src, 'sound/effects/woodhit.ogg', 60, TRUE, 1)
else if(filled)
AM.adjustStaminaLoss(1)
victim.adjustStaminaLoss(1)
playsound(src, "water_wade", 20, TRUE)
return ..()
@@ -172,7 +172,7 @@
. = ..()
if(.)
return
if((user.loc != src) && !user.IsStunned() && !user.IsKnockdown() && !user.incapacitated() && Adjacent(user) && SEND_SIGNAL(user, COMSIG_IS_SWIMMING) && filled && (next_splash < world.time))
if((user.loc != src) && !user.IsStun() && !user.IsKnockdown() && !user.incapacitated() && Adjacent(user) && SEND_SIGNAL(user, COMSIG_IS_SWIMMING) && filled && (next_splash < world.time))
playsound(src, 'sound/effects/watersplash.ogg', 8, TRUE, 1)
next_splash = world.time + 25
var/obj/effect/splash/S = new(src)

View File

@@ -55,7 +55,7 @@
jumpee.pixel_x = 0
jumpee.pixel_y = 0
jumpee.Stun(2)
jumpee.swimming = TRUE
jumpee.AddElement(/datum/element/swimming)
/obj/structure/pool/Lboard/attack_hand(mob/living/user)
if(iscarbon(user))
@@ -64,13 +64,9 @@
to_chat(user, "<span class='notice'>Someone else is already making a jump!</span>")
return
var/turf/T = get_turf(src)
if(user.swimming)
if(SEND_SIGNAL(user, COMSIG_IS_SWIMMING))
return
else
for(var/obj/machinery/pool/controller/pc in range(4,src)) //Clunky as fuck I know.
if(pc.drained)
to_chat(user, "<span class='notice'>That would be suicide</span>") //TODO: make this a suicide action.
return
if(Adjacent(jumper))
jumper.visible_message("<span class='notice'>[user] climbs up \the [src]!</span>", \
"<span class='notice'>You climb up \the [src] and prepares to jump!</span>")
@@ -79,7 +75,7 @@
jumper.layer = RIPPLE_LAYER
jumper.pixel_x = 3
jumper.pixel_y = 7
jumper.dir=8
jumper.dir = 8
sleep(1)
jumper.loc = T
addtimer(CALLBACK(src, .proc/dive, jumper), 10)
@@ -92,7 +88,7 @@
sleep(15)
backswim()
var/atom/throw_target = get_edge_target_turf(src, dir)
jumper.throw_at(throw_target, 1, 1)
jumper.throw_at(throw_target, 1, 1, callback = CALLBACK(src, .proc/on_finish_jump, jumper))
if(21 to 40)
jumper.visible_message("<span class='notice'>[jumper] goes for a dive!</span>", \
@@ -100,7 +96,7 @@
sleep(20)
backswim()
var/atom/throw_target = get_edge_target_turf(src, dir)
jumper.throw_at(throw_target, 2, 1)
jumper.throw_at(throw_target, 2, 1, callback = CALLBACK(src, .proc/on_finish_jump, jumper))
if(41 to 60)
jumper.visible_message("<span class='notice'>[jumper] goes for a long dive! Stay far away!</span>", \
@@ -108,7 +104,7 @@
sleep(25)
backswim()
var/atom/throw_target = get_edge_target_turf(src, dir)
jumper.throw_at(throw_target, 3, 1)
jumper.throw_at(throw_target, 3, 1, callback = CALLBACK(src, .proc/on_finish_jump, jumper))
if(61 to 80)
jumper.visible_message("<span class='notice'>[jumper] goes for an awesome dive! Don't stand in [jumper.p_their()] way!</span>", \
@@ -116,14 +112,14 @@
sleep(30)
backswim()
var/atom/throw_target = get_edge_target_turf(src, dir)
jumper.throw_at(throw_target, 4, 1)
jumper.throw_at(throw_target, 4, 1, callback = CALLBACK(src, .proc/on_finish_jump, jumper))
if(81 to 91)
sleep(20)
backswim()
jumper.visible_message("<span class='danger'>[jumper] misses [jumper.p_their()] step!</span>", \
"<span class='userdanger'>You misstep!</span>")
var/atom/throw_target = get_edge_target_turf(src, dir)
jumper.throw_at(throw_target, 0, 1)
jumper.throw_at(throw_target, 0, 1, callback = CALLBACK(src, .proc/on_finish_jump, jumper))
jumper.Knockdown(100)
jumper.adjustBruteLoss(10)
@@ -138,7 +134,7 @@
jumper.visible_message("<span class='notice'>[jumper] fails!</span>", \
"<span class='userdanger'>You can't quite do it!</span>")
var/atom/throw_target = get_edge_target_turf(src, dir)
jumper.throw_at(throw_target, 1, 1)
jumper.throw_at(throw_target, 1, 1, callback = CALLBACK(src, .proc/on_finish_jump, jumper))
else
jumper.fire_stacks = min(1,jumper.fire_stacks + 1)
jumper.IgniteMob()
@@ -147,8 +143,17 @@
jumper.visible_message("<span class='danger'>[jumper] bursts into flames of pure awesomness!</span>", \
"<span class='userdanger'>No one can stop you now!</span>")
var/atom/throw_target = get_edge_target_turf(src, dir)
jumper.throw_at(throw_target, 6, 1)
jumper.throw_at(throw_target, 6, 1, callback = CALLBACK(src, .proc/on_finish_jump, jumper))
addtimer(CALLBACK(src, .proc/togglejumping), 35)
/obj/structure/pool/Lboard/proc/togglejumping()
jumping = FALSE
/obj/structure/pool/Lboard/proc/on_finish_jump(mob/living/victim)
if(istype(victim.loc, /turf/open/pool))
var/turf/open/pool/P = victim.loc
if(!P.filled) //you dun fucked up now
to_chat(victim, "<span class='warning'>That was stupid of you..</span>")
victim.visible_message("<span class='danger'>[victim] smashes into the ground!</span>")
victim.apply_damage(50)
victim.Knockdown(200)