mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-26 18:13:35 +00:00
Makes it possible to shake structures people are climbing on to make them stop.
This commit is contained in:
@@ -4,6 +4,7 @@
|
|||||||
var/climbable
|
var/climbable
|
||||||
var/breakable
|
var/breakable
|
||||||
var/parts
|
var/parts
|
||||||
|
var/list/climbers = list()
|
||||||
|
|
||||||
/obj/structure/proc/destroy()
|
/obj/structure/proc/destroy()
|
||||||
if(parts)
|
if(parts)
|
||||||
@@ -20,6 +21,12 @@
|
|||||||
var/mob/living/carbon/human/H = user
|
var/mob/living/carbon/human/H = user
|
||||||
if(H.species.can_shred(user))
|
if(H.species.can_shred(user))
|
||||||
attack_generic(user,1,"slices")
|
attack_generic(user,1,"slices")
|
||||||
|
|
||||||
|
if(climbers.len && !(user in climbers))
|
||||||
|
user.visible_message("<span class='warning'>[user.name] shakes \the [src].</span>", \
|
||||||
|
"<span class='notice'>You shake \the [src].</span>")
|
||||||
|
structure_shaken()
|
||||||
|
|
||||||
return ..()
|
return ..()
|
||||||
|
|
||||||
/obj/structure/blob_act()
|
/obj/structure/blob_act()
|
||||||
@@ -73,7 +80,7 @@
|
|||||||
return ..()
|
return ..()
|
||||||
|
|
||||||
/obj/structure/proc/can_climb(var/mob/living/user)
|
/obj/structure/proc/can_climb(var/mob/living/user)
|
||||||
if (!can_touch(user) || !climbable)
|
if (!can_touch(user) || !climbable || (user in climbers))
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
if (!user.Adjacent(src))
|
if (!user.Adjacent(src))
|
||||||
@@ -103,25 +110,32 @@
|
|||||||
return
|
return
|
||||||
|
|
||||||
usr.visible_message("<span class='warning'>[user] starts climbing onto \the [src]!</span>")
|
usr.visible_message("<span class='warning'>[user] starts climbing onto \the [src]!</span>")
|
||||||
|
climbers |= user
|
||||||
|
|
||||||
if(!do_after(user,50))
|
if(!do_after(user,50))
|
||||||
|
climbers -= user
|
||||||
return
|
return
|
||||||
|
|
||||||
if (!can_climb(user))
|
if (!can_climb(user))
|
||||||
|
climbers -= user
|
||||||
return
|
return
|
||||||
|
|
||||||
usr.forceMove(get_turf(src))
|
usr.forceMove(get_turf(src))
|
||||||
|
|
||||||
if (get_turf(user) == get_turf(src))
|
if (get_turf(user) == get_turf(src))
|
||||||
usr.visible_message("<span class='warning'>[user] climbs onto \the [src]!</span>")
|
usr.visible_message("<span class='warning'>[user] climbs onto \the [src]!</span>")
|
||||||
|
climbers -= user
|
||||||
|
|
||||||
/obj/structure/proc/structure_shaken()
|
/obj/structure/proc/structure_shaken()
|
||||||
|
for(var/mob/living/M in climbers)
|
||||||
|
M.Weaken(1)
|
||||||
|
M << "<span class='danger'>You topple as you are shaken off \the [src]!</span>"
|
||||||
|
climbers.Cut(1,2)
|
||||||
|
|
||||||
for(var/mob/living/M in get_turf(src))
|
for(var/mob/living/M in get_turf(src))
|
||||||
|
|
||||||
if(M.lying) return //No spamming this on people.
|
if(M.lying) return //No spamming this on people.
|
||||||
|
|
||||||
M.Weaken(5)
|
M.Weaken(3)
|
||||||
M << "<span class='danger'>You topple as \the [src] moves under you!</span>"
|
M << "<span class='danger'>You topple as \the [src] moves under you!</span>"
|
||||||
|
|
||||||
if(prob(25))
|
if(prob(25))
|
||||||
|
|||||||
5
html/changelogs/PsiOmegaDelta-PR-8901.yml
Normal file
5
html/changelogs/PsiOmegaDelta-PR-8901.yml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
author: PsiOmegaDelta
|
||||||
|
delete-after: True
|
||||||
|
|
||||||
|
changes:
|
||||||
|
- rscadd: "Makes it possible to shake tables with one's bare hands to stop climbers."
|
||||||
Reference in New Issue
Block a user