From 92d4fa83850ed3947de841b4f80d9fb0563e50c0 Mon Sep 17 00:00:00 2001
From: Qwertytoforty <52090703+Qwertytoforty@users.noreply.github.com>
Date: Wed, 8 Nov 2023 03:51:09 -0500
Subject: [PATCH] Adds the NT drunk dialer, chasm recovery grenade (#22867)
* Adds the NT drunk dialer, chasm recovery grenade
* simple numbers game
* Update code/modules/mining/equipment/wormhole_jaunter.dm
Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>
* removes true
* removes trait
* Apply suggestions from code review
Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
* removes
* Update code/game/turfs/simulated/floor/chasm.dm
Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
---------
Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>
Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
---
code/game/turfs/simulated/floor/chasm.dm | 81 ++++++++++++++++---
.../mining/equipment/wormhole_jaunter.dm | 46 +++++++++++
code/modules/mining/machine_vending.dm | 1 +
3 files changed, 116 insertions(+), 12 deletions(-)
diff --git a/code/game/turfs/simulated/floor/chasm.dm b/code/game/turfs/simulated/floor/chasm.dm
index c4c6928ab72..b282a449096 100644
--- a/code/game/turfs/simulated/floor/chasm.dm
+++ b/code/game/turfs/simulated/floor/chasm.dm
@@ -154,8 +154,18 @@
L.adjustBruteLoss(30)
falling_atoms -= AM
+/turf/simulated/floor/chasm/straight_down
+ var/obj/effect/abstract/chasm_storage/storage
+
/turf/simulated/floor/chasm/straight_down/Initialize()
. = ..()
+ var/found_storage = FALSE
+ for(var/obj/effect/abstract/chasm_storage/C in contents)
+ storage = C
+ found_storage = TRUE
+ break
+ if(!found_storage)
+ storage = new /obj/effect/abstract/chasm_storage(src)
drop_x = x
drop_y = y
drop_z = z - 1
@@ -168,7 +178,7 @@
baseturf = /turf/simulated/floor/chasm/straight_down/lava_land_surface //Chasms should not turn into lava
light_range = 2
light_power = 0.75
- light_color = LIGHT_COLOR_LAVA //let's just say you're falling into lava, that makes sense right
+ light_color = LIGHT_COLOR_LAVA //let's just say you're falling into lava, that makes sense right. Ignore the fact the people you pull out are not burning.
/turf/simulated/floor/chasm/straight_down/lava_land_surface/Initialize()
. = ..()
@@ -184,7 +194,7 @@
if(isliving(AM))
var/mob/living/L = AM
L.notransform = TRUE
- L.Weaken(400 SECONDS)
+ L.Weaken(20 SECONDS)
var/oldtransform = AM.transform
var/oldcolor = AM.color
var/oldalpha = AM.alpha
@@ -200,20 +210,67 @@
if(!AM || QDELETED(AM))
return
- if(isrobot(AM))
- var/mob/living/silicon/robot/S = AM
- qdel(S.mmi)
-
falling_atoms -= AM
-
- qdel(AM)
-
- if(AM && !QDELETED(AM)) //It's indestructible
- visible_message("[src] spits out [AM]!")
+ if(isliving(AM))
AM.alpha = oldalpha
AM.color = oldcolor
AM.transform = oldtransform
- AM.throw_at(get_edge_target_turf(src,pick(GLOB.alldirs)),rand(1, 10),rand(1, 10))
+ var/mob/living/fallen_mob = AM
+ fallen_mob.notransform = FALSE
+ if(fallen_mob.stat != DEAD)
+ fallen_mob.death()
+ fallen_mob.adjustBruteLoss(1000) //crunch from long fall, want it to be like legion in damage
+ fallen_mob.forceMove(storage)
+ return
+
+ if(istype(AM, /obj/item/grenade/jaunter_grenade))
+ AM.forceMove(storage)
+ return
+ for(var/mob/M in AM.contents)
+ M.forceMove(src)
+
+ qdel(AM)
+
+/**
+ * An abstract object which is basically just a bag that the chasm puts people inside
+ */
+
+/obj/effect/abstract/chasm_storage
+ name = "chasm depths"
+ desc = "The bottom of a hole. You shouldn't be able to interact with this."
+ anchored = TRUE
+ mouse_opacity = MOUSE_OPACITY_TRANSPARENT
+
+/obj/effect/abstract/chasm_storage/Entered(atom/movable/arrived)
+ . = ..()
+ if(isliving(arrived))
+ RegisterSignal(arrived, COMSIG_LIVING_REVIVE, PROC_REF(on_revive))
+
+/obj/effect/abstract/chasm_storage/Exited(atom/movable/gone)
+ . = ..()
+ if(isliving(gone))
+ UnregisterSignal(gone, COMSIG_LIVING_REVIVE)
+
+/**
+ * Called if something comes back to life inside the pit. Expected sources are badmins and changelings.
+ * Ethereals should take enough damage to be smashed and not revive.
+ * Arguments
+ * escapee - Lucky guy who just came back to life at the bottom of a hole.
+ */
+/obj/effect/abstract/chasm_storage/proc/on_revive(mob/living/escapee)
+ SIGNAL_HANDLER
+ var/turf/ourturf = get_turf(src)
+ if(istype(ourturf, /turf/simulated/floor/chasm/straight_down/lava_land_surface))
+ ourturf.visible_message("After a long climb, [escapee] leaps out of [ourturf]!")
+ else
+ playsound(ourturf, 'sound/effects/bang.ogg', 50, TRUE)
+ ourturf.visible_message("[escapee] busts through [ourturf], leaping out of the chasm below!")
+ ourturf.ChangeTurf(ourturf.baseturf)
+ escapee.flying = TRUE
+ escapee.forceMove(ourturf)
+ escapee.throw_at(get_edge_target_turf(ourturf, pick(GLOB.alldirs)), rand(2, 10), rand(2, 10))
+ escapee.flying = FALSE
+ escapee.Sleeping(20 SECONDS)
/turf/simulated/floor/chasm/straight_down/lava_land_surface/normal_air
oxygen = MOLES_O2STANDARD
diff --git a/code/modules/mining/equipment/wormhole_jaunter.dm b/code/modules/mining/equipment/wormhole_jaunter.dm
index db05bac8549..15fec7ec179 100644
--- a/code/modules/mining/equipment/wormhole_jaunter.dm
+++ b/code/modules/mining/equipment/wormhole_jaunter.dm
@@ -173,3 +173,49 @@
. = ..()
playsound(loc, 'sound/goonstation/misc/matchstick_light.ogg', 50, TRUE)
set_light(8, l_color = "#FFD165")
+
+/obj/item/grenade/jaunter_grenade
+ name = "chasm jaunter recovery grenade"
+ desc = "NT-Drunk Dialer Grenade. Originally built by NT for locating all beacons in an area and creating wormholes to them, it now finds use to miners for recovering allies from chasms."
+ icon_state = "mirage"
+ /// Mob that threw the grenade.
+ var/mob/living/thrower
+
+/obj/item/grenade/jaunter_grenade/Destroy()
+ thrower = null
+ return ..()
+
+/obj/item/grenade/jaunter_grenade/attack_self(mob/user)
+ . = ..()
+ thrower = user
+
+/obj/item/grenade/jaunter_grenade/prime()
+ update_mob()
+ var/list/destinations = list()
+ for(var/obj/item/radio/beacon/B in GLOB.global_radios)
+ var/turf/BT = get_turf(B)
+ if(is_station_level(BT.z))
+ destinations += BT
+ var/turf/T = get_turf(src)
+ if(istype(T, /turf/simulated/floor/chasm/straight_down/lava_land_surface))
+ for(var/obj/effect/abstract/chasm_storage/C in T)
+ var/found_mob = FALSE
+ for(var/mob/M in C)
+ found_mob = TRUE
+ do_teleport(M, pick(destinations))
+ if(found_mob)
+ new /obj/effect/temp_visual/thunderbolt(T) //Visual feedback it worked.
+ playsound(src, 'sound/magic/lightningbolt.ogg', 100, TRUE)
+ qdel(src)
+ return
+
+ var/list/portal_turfs = list()
+ for(var/turf/PT in circleviewturfs(T, 3))
+ if(!PT.density)
+ portal_turfs += PT
+ playsound(src, 'sound/magic/lightningbolt.ogg', 100, TRUE)
+ for(var/turf/drunk_dial in shuffle(destinations))
+ var/drunken_opening = pick_n_take(portal_turfs)
+ new /obj/effect/portal/jaunt_tunnel(drunken_opening, drunk_dial, src, 100, thrower)
+ new /obj/effect/temp_visual/thunderbolt(drunken_opening)
+ qdel(src)
diff --git a/code/modules/mining/machine_vending.dm b/code/modules/mining/machine_vending.dm
index 459ceec08b2..89eb0e545f9 100644
--- a/code/modules/mining/machine_vending.dm
+++ b/code/modules/mining/machine_vending.dm
@@ -48,6 +48,7 @@
EQUIPMENT("Brute First-Aid Kit", /obj/item/storage/firstaid/brute, 600),
EQUIPMENT("Fulton Pack", /obj/item/extraction_pack, 1000),
EQUIPMENT("Jaunter", /obj/item/wormhole_jaunter, 750),
+ EQUIPMENT("Chasm Jaunter Recovery Grenade", /obj/item/grenade/jaunter_grenade, 1500),
EQUIPMENT("Lazarus Injector", /obj/item/lazarus_injector, 1000),
EQUIPMENT("Point Transfer Card", /obj/item/card/mining_point_card, 500),
EQUIPMENT("Shelter Capsule", /obj/item/survivalcapsule, 400),