diff --git a/code/__DEFINES/pool.dm b/code/__DEFINES/pool.dm index 3a7981d354..aabcd3493e 100644 --- a/code/__DEFINES/pool.dm +++ b/code/__DEFINES/pool.dm @@ -8,5 +8,5 @@ GLOBAL_LIST_INIT(blacklisted_pool_reagents, list( /datum/reagent/toxin/plasma, /datum/reagent/oxygen, /datum/reagent/nitrous_oxide, /datum/reagent/nitrogen, //gases /datum/reagent/fermi, //blanket fermichem ban sorry. this also covers mkultra, genital enlargers, etc etc. - /datum/reagent/drug/aphrodisiac, /datum/reagent/drug/anaphrodisiac, /datum/reagent/drug/aphrodisiacplus, /datum/reagent/anaphrodisiacplus //literally asking for prefbreaks + /datum/reagent/drug/aphrodisiac, /datum/reagent/drug/anaphrodisiac, /datum/reagent/drug/aphrodisiacplus, /datum/reagent/drug/anaphrodisiacplus //literally asking for prefbreaks )) diff --git a/code/datums/elements/swimming.dm b/code/datums/elements/swimming.dm index 2349a1e50f..eeabc465ed 100644 --- a/code/datums/elements/swimming.dm +++ b/code/datums/elements/swimming.dm @@ -21,4 +21,4 @@ /datum/element/swimming/proc/check_valid(datum/source) var/mob/living/L = source if(!istype(L.loc, /turf/open/pool)) - source.RemoveElement(/datum/elemtn/swimming) + source.RemoveElement(/datum/element/swimming) diff --git a/code/modules/pool/pool_controller.dm b/code/modules/pool/pool_controller.dm index 6be4fd7643..7076635a06 100644 --- a/code/modules/pool/pool_controller.dm +++ b/code/modules/pool/pool_controller.dm @@ -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 diff --git a/code/modules/pool/pool_drain.dm b/code/modules/pool/pool_drain.dm index c292dd7354..36debbc06e 100644 --- a/code/modules/pool/pool_drain.dm +++ b/code/modules/pool/pool_drain.dm @@ -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, "You're caught in the drain!") + to_chat(H, "You're caught in the drain!") else - whirlm.apply_damage(4, BRUTE, pick("l_leg", "r_leg")) //drain should only target the legs - to_chat(whirlm, "Your legs are caught in the drain!") + H.apply_damage(4, BRUTE, pick("l_leg", "r_leg")) //drain should only target the legs + to_chat(H, "Your legs are caught in the drain!") 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) diff --git a/code/modules/pool/pool_main.dm b/code/modules/pool/pool_main.dm index 1089869bc9..cb9f598729 100644 --- a/code/modules/pool/pool_main.dm +++ b/code/modules/pool/pool_main.dm @@ -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 = "[from] is getting out of the pool." - post_msg = "[from] gets out of the pool." + pre_msg = "[L] is getting out of the pool." + post_msg = "[L] gets out of the pool." else - pre_msg = "[from] is being pulled out of the pool by [user]." - post_msg = "[user] pulls [from] out of the pool." - from.visible_message(pre_msg) - if(do_mob(user, from, 20)) - from.visible_message(post_msg) - from.forceMove(src) + pre_msg = "[L] is being pulled out of the pool by [user]." + post_msg = "[user] pulls [L] out of the pool." + 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) diff --git a/code/modules/pool/pool_structures.dm b/code/modules/pool/pool_structures.dm index 72a5289f23..914b2db129 100644 --- a/code/modules/pool/pool_structures.dm +++ b/code/modules/pool/pool_structures.dm @@ -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, "Someone else is already making a jump!") 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, "That would be suicide") //TODO: make this a suicide action. - return if(Adjacent(jumper)) jumper.visible_message("[user] climbs up \the [src]!", \ "You climb up \the [src] and prepares to jump!") @@ -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("[jumper] goes for a dive!", \ @@ -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("[jumper] goes for a long dive! Stay far away!", \ @@ -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("[jumper] goes for an awesome dive! Don't stand in [jumper.p_their()] way!", \ @@ -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("[jumper] misses [jumper.p_their()] step!", \ "You misstep!") 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("[jumper] fails!", \ "You can't quite do it!") 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("[jumper] bursts into flames of pure awesomness!", \ "No one can stop you now!") 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, "That was stupid of you..") + victim.visible_message("[victim] smashes into the ground!") + victim.apply_damage(50) + victim.Knockdown(200)