Skip to content

Commit

Permalink
Merge pull request #2617 from Tenebrosity/thudfix
Browse files Browse the repository at this point in the history
Fixes #2603: Bodyfall thuds in cryo and cloning
  • Loading branch information
Razharas committed Feb 7, 2014
2 parents 0aed481 + 8a6bcf6 commit 863e6aa
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 18 deletions.
5 changes: 4 additions & 1 deletion code/game/atoms.dm
Original file line number Diff line number Diff line change
Expand Up @@ -364,4 +364,7 @@ var/list/blood_splatter_icons = list()
if(istype(get_turf(src), /turf/space))
return 1
else
return 0
return 0

/atom/proc/handle_fall()
return
3 changes: 3 additions & 0 deletions code/game/turfs/space/space.dm
Original file line number Diff line number Diff line change
Expand Up @@ -233,4 +233,7 @@
spawn (0)
if ((A && A.loc))
A.loc.Entered(A)
return

turf/space/handle_fall()
return
15 changes: 14 additions & 1 deletion code/game/turfs/turf.dm
Original file line number Diff line number Diff line change
Expand Up @@ -287,4 +287,17 @@
if(!t.density)
if(!LinkBlocked(src, t) && !TurfBlockedNonWindow(t))
L.Add(t)
return L
return L

/turf/handle_fall(mob/faller)
playsound(src, "bodyfall", 50, 1)
var/mob/living/carbon/human/M = faller
if(istype(M) && M.head)
var/obj/item/clothing/head/H = M.head
if(!istype(H) || prob(M.hat_fall_prob()))
M.drop_from_inventory(H)
if(prob(60))
step_rand(H)
if(!M.stat)
M << "<span class='warning'>[H] fell off your head!</span>"
else return
7 changes: 6 additions & 1 deletion code/modules/mob/living/carbon/carbon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -578,4 +578,9 @@ var/const/GALOSHES_DONT_HELP = 8
Stun(s_amount)
Weaken(w_amount)
return 1
return 0 // no success. Used in clown pda and wet floors
return 0 // no success. Used in clown pda and wet floors

/mob/living/carbon/fall(var/forced)
..()
if(forced) //if going prone was involuntary
loc.handle_fall(src) //it's loc so it doesn't call the mob's handle_fall() which does nothing
15 changes: 0 additions & 15 deletions code/modules/mob/living/carbon/human/human_damage.dm
Original file line number Diff line number Diff line change
Expand Up @@ -64,21 +64,6 @@ mob/living/carbon/human/proc/hat_fall_prob()
loose = 0
return loose * multiplier

/mob/living/carbon/human/fall(var/forced)
..()
if(istype(loc, /turf/space)) //if space is at the human's location
return //stop executing the proc
if(forced) //if going prone was involuntary
playsound(loc, "bodyfall", 50, 1) //play bodyfall at 50% volume
if(head)
var/obj/item/clothing/head/H = head
if(!istype(H) || prob(hat_fall_prob()))
drop_from_inventory(H)
if(prob(60))
step_rand(H)
if(!stat)
src << "<span class='warning'>[H] fell off your head!</span>"

////////////////////////////////////////////

//Returns a list of damaged organs
Expand Down

0 comments on commit 863e6aa

Please sign in to comment.