Falling into a chasm doesn't delete your body and someone can fish you up (#17723)

* eeeee

* e

* map

* break

* eeeee

* cope

* Update chasm.dm
This commit is contained in:
Byemoh
2023-02-09 19:22:03 -06:00
committed by GitHub
parent 229d6664ef
commit 4a6973a465
6 changed files with 183 additions and 45 deletions

View File

@@ -927,6 +927,12 @@
},
/turf/open/floor/plasteel,
/area/mine/living_quarters)
"jc" = (
/obj/structure/fireaxecabinet/fishingrod{
pixel_y = 32
},
/turf/open/floor/plasteel/white,
/area/mine/infirmary)
"jp" = (
/obj/machinery/door/airlock{
name = "Restroom"
@@ -5216,7 +5222,7 @@ WO
Er
Yy
kD
fA
jc
fA
fA
fA

View File

@@ -1,6 +1,7 @@
// Used by /turf/open/chasm and subtypes to implement the "dropping" mechanic
/datum/component/chasm
var/turf/target_turf
var/obj/effect/abstract/chasm_storage/storage
var/fall_message = "GAH! Ah... where are you?"
var/oblivion_message = "You stumble and stare into the abyss before you. It stares back, and you fall into the enveloping dark."
@@ -26,6 +27,7 @@
/datum/component/chasm/Initialize(turf/target)
RegisterSignals(parent, list(COMSIG_MOVABLE_CROSSED, COMSIG_ATOM_ENTERED), .proc/Entered)
RegisterSignal(parent, COMSIG_PARENT_ATTACKBY,.proc/fish)
target_turf = target
START_PROCESSING(SSobj, src) // process on create, in case stuff is still there
@@ -86,58 +88,146 @@
return FALSE
return TRUE
/datum/component/chasm/proc/drop(atom/movable/AM)
/datum/component/chasm/proc/drop(atom/movable/dropped_thing)
var/datum/weakref/falling_ref = WEAKREF(dropped_thing)
//Make sure the item is still there after our sleep
if(!AM || QDELETED(AM))
if(!dropped_thing || !falling_ref?.resolve())
falling_atoms -= falling_ref
return
falling_atoms[AM] = (falling_atoms[AM] || 0) + 1
falling_atoms[falling_ref] = (falling_atoms[falling_ref] || 0) + 1
var/turf/T = target_turf
var/atom/parent = src.parent
if(T)
// send to the turf below
AM.visible_message(span_boldwarning("[AM] falls into [parent]!"), span_userdanger("[fall_message]"))
T.visible_message(span_boldwarning("[AM] falls from above!"))
AM.forceMove(T)
if(isliving(AM))
var/mob/living/L = AM
dropped_thing.visible_message(span_boldwarning("[dropped_thing] falls into [parent]!"), span_userdanger("[fall_message]"))
T.visible_message(span_boldwarning("[dropped_thing] falls from above!"))
dropped_thing.forceMove(T)
if(isliving(dropped_thing))
var/mob/living/L = dropped_thing
L.Paralyze(100)
L.adjustBruteLoss(30)
falling_atoms -= AM
falling_atoms -= falling_ref
return
else
// send to oblivion
AM.visible_message(span_boldwarning("[AM] falls into [parent]!"), span_userdanger("[oblivion_message]"))
if (isliving(AM))
var/mob/living/L = AM
L.notransform = TRUE
L.Stun(200)
L.resting = TRUE
// send to oblivion
dropped_thing.visible_message(span_boldwarning("[dropped_thing] falls into [parent]!"), span_userdanger("[oblivion_message]"))
if (isliving(dropped_thing))
var/mob/living/falling_mob = dropped_thing
falling_mob.notransform = TRUE
falling_mob.Paralyze(20 SECONDS)
var/oldtransform = AM.transform
var/oldcolor = AM.color
var/oldalpha = AM.alpha
animate(AM, transform = matrix() - matrix(), alpha = 0, color = rgb(0, 0, 0), time = 1 SECONDS)
for(var/i in 1 to 5)
//Make sure the item is still there after our sleep
if(!AM || QDELETED(AM))
return
AM.pixel_y--
sleep(0.2 SECONDS)
var/oldtransform = dropped_thing.transform
var/oldcolor = dropped_thing.color
var/oldalpha = dropped_thing.alpha
animate(dropped_thing, transform = matrix() - matrix(), alpha = 0, color = rgb(0, 0, 0), time = 10)
for(var/i in 1 to 5)
//Make sure the item is still there after our sleep
if(!AM || QDELETED(AM))
if(!dropped_thing || QDELETED(dropped_thing))
return
dropped_thing.pixel_y--
sleep(0.2 SECONDS)
if(iscyborg(AM))
var/mob/living/silicon/robot/S = AM
qdel(S.mmi)
//Make sure the item is still there after our sleep
if(!dropped_thing || QDELETED(dropped_thing))
return
falling_atoms -= AM
qdel(AM)
if(AM && !QDELETED(AM)) //It's indestructible
var/atom/parent = src.parent
parent.visible_message(span_boldwarning("[parent] spits out [AM]!"))
AM.alpha = oldalpha
AM.color = oldcolor
AM.transform = oldtransform
AM.throw_at(get_edge_target_turf(parent,pick(GLOB.alldirs)),rand(1, 10),rand(1, 10))
if (!storage)
storage = new(get_turf(parent))
RegisterSignal(storage, COMSIG_ATOM_EXITED, .proc/left_chasm)
if (storage.contains(dropped_thing))
return
dropped_thing.alpha = oldalpha
dropped_thing.color = oldcolor
dropped_thing.transform = oldtransform
if (dropped_thing.forceMove(storage))
if (isliving(dropped_thing))
RegisterSignal(dropped_thing, COMSIG_LIVING_REVIVE, .proc/on_revive)
else
parent.visible_message(span_boldwarning("[parent] spits out [dropped_thing]!"))
dropped_thing.throw_at(get_edge_target_turf(parent, pick(GLOB.alldirs)), rand(1, 10), rand(1, 10))
if (isliving(dropped_thing))
var/mob/living/fallen_mob = dropped_thing
if(fallen_mob.stat != DEAD)
fallen_mob.death(TRUE)
fallen_mob.notransform = FALSE
fallen_mob.apply_damage(300)
var/obj/item/bodypart/l_leg = fallen_mob.get_bodypart(BODY_ZONE_L_LEG)
var/datum/wound/blunt/critical/l_fracture = new
l_fracture.apply_wound(l_leg)
var/obj/item/bodypart/r_leg = fallen_mob.get_bodypart(BODY_ZONE_R_LEG)
var/datum/wound/blunt/critical/r_fracture = new
r_fracture.apply_wound(r_leg)
falling_atoms -= falling_ref
/**
* Called when something has left the chasm depths storage.
* Arguments
*
* * source - Chasm object holder.
* * gone - Item which has just left the chasm contents.
*/
/datum/component/chasm/proc/left_chasm(atom/source, atom/movable/gone)
SIGNAL_HANDLER
UnregisterSignal(gone, COMSIG_LIVING_REVIVE)
#define CHASM_TRAIT "chasm trait"
/**
* Called if something comes back to life inside the pit. Expected sources are badmins and changelings.
*
* Arguments
* * escapee - Lucky guy who just came back to life at the bottom of a hole.
*/
/datum/component/chasm/proc/on_revive(mob/living/escapee)
var/atom/parent = src.parent
parent.visible_message(span_boldwarning("After a long climb, [escapee] leaps out of [parent]!"))
escapee.movement_type &= FLYING
escapee.forceMove(get_turf(parent))
escapee.throw_at(get_edge_target_turf(parent, pick(GLOB.alldirs)), rand(1, 10), rand(1, 10))
escapee.movement_type &= ~FLYING
escapee.Paralyze(20 SECONDS, TRUE)
UnregisterSignal(escapee, COMSIG_LIVING_REVIVE)
#undef CHASM_TRAIT
/**
* 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
/datum/component/chasm/proc/fish(datum/source, obj/item/I, mob/user, params)
if(!istype(I,/obj/item/twohanded/fishingrod))
return
var/obj/item/twohanded/fishingrod/rod = I
if(!rod.wielded)
to_chat(user, span_warning("You need to wield the rod in both hands before you can fish in the chasm!"))
return
if(do_after(user, 3 SECONDS, src.parent))
if(!rod.wielded)
return
var/atom/parent = src.parent
var/list/fishing_contents = parent.GetAllContents()
if(!length(fishing_contents))
to_chat(user, span_warning("There's nothing here!"))
return
var/found = FALSE
for(var/mob/M in fishing_contents) //since only mobs can fall in here this really isnt needed but on the off chance something naughty happens..
M.forceMove(get_turf(user))
UnregisterSignal(M, COMSIG_LIVING_REVIVE)
found = TRUE
if(found)
to_chat(user, span_warning("You reel in something!"))
else
to_chat(user, span_warning("There's nothing here!"))
return

View File

@@ -12,6 +12,7 @@
var/open = FALSE
var/obj/item/twohanded/fireaxe/fireaxe
var/obj/item/card/id/captains_spare/spareid
var/obj/item/twohanded/fishingrod/collapsable/miningmedic/olreliable //what the fuck?
var/alert = TRUE
var/axe = TRUE
@@ -84,6 +85,17 @@
to_chat(user, span_caution("You place the [S.name] back in the [name]."))
update_icon()
return
else if(istype(I, /obj/item/twohanded/fishingrod/collapsable/miningmedic) && !olreliable && !axe)
var/obj/item/twohanded/fishingrod/collapsable/miningmedic/R = I
if(R.opened)
to_chat(user, span_caution("[R.name] won't seem to fit!"))
return
if(!user.transferItemToLoc(R, src))
return
olreliable = R
to_chat(user, span_caution("You place the [R.name] back in the [name]."))
update_icon()
return
else if(!broken)
//open the cabinet normally.
toggle_open()
@@ -155,13 +167,16 @@
if(.)
return
if(open || broken)
if(fireaxe || spareid)
if(fireaxe || spareid || olreliable)
if(spareid)
fireaxe = spareid
if(olreliable)
fireaxe = olreliable
user.put_in_hands(fireaxe)
to_chat(user, span_caution("You take the [fireaxe.name] from the [name]."))
fireaxe = null
spareid = null
olreliable = null
src.add_fingerprint(user)
update_icon()
return
@@ -185,6 +200,8 @@
add_overlay("axe")
if(spareid)
add_overlay("card")
if(olreliable)
add_overlay("rod")
if(!open)
var/hp_percent = obj_integrity/max_integrity * 100
if(broken)
@@ -276,3 +293,19 @@
if(!.)
return
trigger_alarm()
/obj/structure/fireaxecabinet/fishingrod
name = "fishing cabinet"
desc = "There is a small label that reads \"Fo* Em**gen*y u*e *nly\". All the other text is scratched out and replaced with various fish weights. <BR>There are bolts under it's glass cover for easy disassembly using a wrench."
icon = 'icons/obj/wallmounts.dmi'
icon_state = "fishingrod"
axe = FALSE
alert = FALSE
req_access = list(ACCESS_MEDICAL, ACCESS_MINING)
/obj/structure/fireaxecabinet/fishingrod/Initialize()
. = ..()
fireaxe = null
olreliable = new(src)
update_icon()

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

@@ -167,10 +167,12 @@
/obj/item/twohanded/fishingrod/collapsable
name = "collapsable fishing rod"
icon_state = "fishing_rod_collapse_c"
desc = "A collapsable fishing rod! This one can fit into your backpack for space hikes and the like."
var/opened = FALSE
icon_state = "fishing_rod_collapse_c"
fishing_power = 15
var/opened = FALSE
var/rod_icon_state = "fishing_rod_collapse"
/obj/item/twohanded/fishingrod/collapsable/attackby(obj/item/B, mob/user, params)
if(!istype(B,/obj/item/reagent_containers/food/snacks/bait))
@@ -200,7 +202,7 @@
update_icon()
/obj/item/twohanded/fishingrod/collapsable/update_icon()
icon_state = "fishing_rod_collapse[opened ? "" : "_c"]"
icon_state = "[rod_icon_state][opened ? "" : "_c"]"
/obj/item/twohanded/fishingrod/collapsable/attack_self(mob/user)
if(!opened)
@@ -213,3 +215,10 @@
to_chat(user,"The collapsable rod has to be open before you can do anything!")
return
..()
/obj/item/twohanded/fishingrod/collapsable/miningmedic
name = "ol' reliable"
desc = "Hey! I caught a miner!"
icon_state = "fishing_rod_miningmedic_c"
rod_icon_state = "fishing_rod_miningmedic"
fishing_power = 1 //Rescue Yo Miners Bitch Damn! Fuck You Doin Fishin For!

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 9.1 KiB