mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-19 20:15:47 +01:00
Combat/Stun (slip) overhaul staging, mobility flags, adds crawling (#39967)
Aiming to implement the framework oranges has detailed in https://tgstation13.org/phpBB/viewtopic.php?f=10&t=19102 Moves canmove to a bitflag in a new variable called mobility_flags, that will allow finer grain control of what someone can do codewise, for example, letting them move but not stand up, or stand up but not move. Adds Immobilize()d status effect that freezes movement but does not prevent anything else. Adds Paralyze()d which is oldstun "You can't do anything at all and knock down). Stun() will now prevent any item/UI usage and movement (which is similar to before). Knockdown() will now only knockdown without preventing item usage/movement. People knocked down will be able to crawl at softcrit-speeds Refactors some /mob variables and procs to /mob/living. update_canmove() refactored to update_mobility() and will handle mobility_flags instead of the removed canmove cl rscadd: Crawling is now possible if you are down but not stunned. Obviously, you will be slower. /cl Refactors are done. I'd rather get this merged faster than try to fine tune stuff like slips. The most obvious gameplay effect this pr has will be crawling, and I believe I made tiny tweaks but I can't find it Anything I missed or weird behavior should be reported.
This commit is contained in:
@@ -324,7 +324,7 @@
|
||||
if(iscarbon(target))
|
||||
var/mob/living/carbon/C = target
|
||||
if(C.health < C.maxHealth*0.5)
|
||||
C.Knockdown(20)
|
||||
C.Paralyze(20)
|
||||
smash(user)
|
||||
|
||||
|
||||
|
||||
@@ -337,8 +337,10 @@ LINEN BINS
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
if(user.lying)
|
||||
return
|
||||
if(isliving(user))
|
||||
var/mob/living/L = user
|
||||
if(!(L.mobility_flags & MOBILITY_PICKUP))
|
||||
return
|
||||
if(amount >= 1)
|
||||
amount--
|
||||
|
||||
|
||||
@@ -280,7 +280,7 @@
|
||||
/obj/structure/closet/MouseDrop_T(atom/movable/O, mob/living/user)
|
||||
if(!istype(O) || O.anchored || istype(O, /obj/screen))
|
||||
return
|
||||
if(!istype(user) || user.incapacitated() || user.lying)
|
||||
if(!istype(user) || user.incapacitated() || !(user.mobility_flags & MOBILITY_STAND))
|
||||
return
|
||||
if(!Adjacent(user) || !user.Adjacent(O))
|
||||
return
|
||||
@@ -309,7 +309,7 @@
|
||||
"<span class='italics'>You hear a loud metal bang.</span>")
|
||||
var/mob/living/L = O
|
||||
if(!issilicon(L))
|
||||
L.Knockdown(40)
|
||||
L.Paralyze(40)
|
||||
O.forceMove(T)
|
||||
close()
|
||||
else
|
||||
@@ -326,11 +326,11 @@
|
||||
return
|
||||
container_resist(user)
|
||||
|
||||
/obj/structure/closet/attack_hand(mob/user)
|
||||
/obj/structure/closet/attack_hand(mob/living/user)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
if(user.lying && get_dist(src, user) > 0)
|
||||
if(!(user.mobility_flags & MOBILITY_STAND) && get_dist(src, user) > 0)
|
||||
return
|
||||
|
||||
if(!toggle(user))
|
||||
@@ -352,7 +352,7 @@
|
||||
set category = "Object"
|
||||
set name = "Toggle Open"
|
||||
|
||||
if(!usr.canmove || usr.stat || usr.restrained())
|
||||
if(!usr.incapacitated())
|
||||
return
|
||||
|
||||
if(iscarbon(usr) || issilicon(usr) || isdrone(usr))
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
var/move_delay = FALSE
|
||||
var/egged = 0
|
||||
|
||||
/obj/structure/closet/cardboard/relaymove(mob/user, direction)
|
||||
if(opened || move_delay || user.stat || user.IsStun() || user.IsKnockdown() || user.IsUnconscious() || !isturf(loc) || !has_gravity(loc))
|
||||
/obj/structure/closet/cardboard/relaymove(mob/living/user, direction)
|
||||
if(!istype(user) || opened || move_delay || user.incapacitated() || !isturf(loc) || !has_gravity(loc))
|
||||
return
|
||||
move_delay = TRUE
|
||||
if(step(src, direction))
|
||||
|
||||
@@ -132,7 +132,7 @@
|
||||
src.visible_message(text("<span class='danger'>[M] falls free of [src]!</span>"))
|
||||
unbuckle_mob(M,force=1)
|
||||
M.emote("scream")
|
||||
M.AdjustKnockdown(20)
|
||||
M.AdjustParalyzed(20)
|
||||
|
||||
/obj/structure/kitchenspike/Destroy()
|
||||
if(has_buckled_mobs())
|
||||
|
||||
@@ -343,8 +343,12 @@ GLOBAL_LIST_EMPTY(crematoriums)
|
||||
var/mob/M = O
|
||||
if(M.buckled)
|
||||
return
|
||||
if(!ismob(user) || user.lying || user.incapacitated())
|
||||
if(!ismob(user) || user.incapacitated())
|
||||
return
|
||||
if(isliving(user))
|
||||
var/mob/living/L = user
|
||||
if(!(L.mobility_flags & MOBILITY_STAND))
|
||||
return
|
||||
O.forceMove(src.loc)
|
||||
if (user != O)
|
||||
visible_message("<span class='warning'>[user] stuffs [O] into [src].</span>")
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
if(S.mind)
|
||||
if(petrified_mob)
|
||||
S.mind.transfer_to(petrified_mob)
|
||||
petrified_mob.Knockdown(100)
|
||||
petrified_mob.Paralyze(100)
|
||||
to_chat(petrified_mob, "<span class='notice'>You slowly come back to your senses. You are in control of yourself again!</span>")
|
||||
qdel(S)
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@
|
||||
return 1
|
||||
if(M.buckled && istype(M.buckled, /mob/living/simple_animal/bot/mulebot)) // mulebot passenger gets a free pass.
|
||||
return 1
|
||||
if(!M.lying && !M.ventcrawler && M.mob_size != MOB_SIZE_TINY) //If your not laying down, or a ventcrawler or a small creature, no pass.
|
||||
if((M.mobility_flags & MOBILITY_STAND) && !M.ventcrawler && M.mob_size != MOB_SIZE_TINY) //If your not laying down, or a ventcrawler or a small creature, no pass.
|
||||
return 0
|
||||
return ..()
|
||||
|
||||
|
||||
@@ -107,9 +107,8 @@
|
||||
. = . || (mover.pass_flags & PASSTABLE)
|
||||
|
||||
/obj/structure/table/proc/tableplace(mob/living/user, mob/living/pushed_mob)
|
||||
pushed_mob.forceMove(src.loc)
|
||||
pushed_mob.resting = TRUE
|
||||
pushed_mob.update_canmove()
|
||||
pushed_mob.forceMove(loc)
|
||||
pushed_mob.set_resting(TRUE, TRUE)
|
||||
pushed_mob.visible_message("<span class='notice'>[user] places [pushed_mob] onto [src].</span>", \
|
||||
"<span class='notice'>[user] places [pushed_mob] onto [src].</span>")
|
||||
log_combat(user, pushed_mob, "placed")
|
||||
@@ -124,7 +123,7 @@
|
||||
pushed_mob.pass_flags &= ~PASSTABLE
|
||||
if(pushed_mob.loc != loc) //Something prevented the tabling
|
||||
return
|
||||
pushed_mob.Knockdown(40)
|
||||
pushed_mob.Paralyze(40)
|
||||
pushed_mob.visible_message("<span class='danger'>[user] pushes [pushed_mob] onto [src].</span>", \
|
||||
"<span class='userdanger'>[user] pushes [pushed_mob] onto [src].</span>")
|
||||
log_combat(user, pushed_mob, "pushed")
|
||||
@@ -236,7 +235,7 @@
|
||||
debris -= AM
|
||||
if(istype(AM, /obj/item/shard))
|
||||
AM.throw_impact(L)
|
||||
L.Knockdown(100)
|
||||
L.Paralyze(100)
|
||||
qdel(src)
|
||||
|
||||
/obj/structure/table/glass/deconstruct(disassembled = TRUE, wrench_disassembly = 0)
|
||||
@@ -433,23 +432,20 @@
|
||||
break
|
||||
|
||||
/obj/structure/table/optable/tablepush(mob/living/user, mob/living/pushed_mob)
|
||||
pushed_mob.forceMove(src.loc)
|
||||
pushed_mob.resting = 1
|
||||
pushed_mob.update_canmove()
|
||||
pushed_mob.forceMove(loc)
|
||||
pushed_mob.set_resting(TRUE, TRUE)
|
||||
visible_message("<span class='notice'>[user] has laid [pushed_mob] on [src].</span>")
|
||||
check_patient()
|
||||
|
||||
/obj/structure/table/optable/proc/check_patient()
|
||||
var/mob/M = locate(/mob/living/carbon/human, loc)
|
||||
var/mob/living/carbon/human/M = locate(/mob/living/carbon/human, loc)
|
||||
if(M)
|
||||
if(M.resting)
|
||||
patient = M
|
||||
return 1
|
||||
return TRUE
|
||||
else
|
||||
patient = null
|
||||
return 0
|
||||
|
||||
|
||||
return FALSE
|
||||
|
||||
/*
|
||||
* Racks
|
||||
@@ -509,7 +505,7 @@
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
if(user.IsKnockdown() || user.resting || user.lying || user.get_num_legs() < 2)
|
||||
if(!(user.mobility_flags & MOBILITY_STAND) || user.get_num_legs() < 2)
|
||||
return
|
||||
user.changeNext_move(CLICK_CD_MELEE)
|
||||
user.do_attack_animation(src, ATTACK_EFFECT_KICK)
|
||||
|
||||
@@ -44,8 +44,10 @@
|
||||
|
||||
//pod insertion
|
||||
/obj/structure/transit_tube/station/MouseDrop_T(obj/structure/c_transit_tube_pod/R, mob/user)
|
||||
if(!user.canmove || user.stat || user.restrained())
|
||||
return
|
||||
if(isliving(user))
|
||||
var/mob/living/L = user
|
||||
if(L.incapacitated())
|
||||
return
|
||||
if (!istype(R) || get_dist(user, src) > 1 || get_dist(src,R) > 1)
|
||||
return
|
||||
for(var/obj/structure/transit_tube_pod/pod in loc)
|
||||
@@ -74,7 +76,7 @@
|
||||
pod.visible_message("<span class='warning'>[user] starts putting [GM] into the [pod]!</span>")
|
||||
if(do_after(user, 15, target = src))
|
||||
if(open_status == STATION_TUBE_OPEN && GM && user.grab_state >= GRAB_AGGRESSIVE && user.pulling == GM && !GM.buckled && !GM.has_buckled_mobs())
|
||||
GM.Knockdown(100)
|
||||
GM.Paralyze(100)
|
||||
src.Bumped(GM)
|
||||
break
|
||||
else
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
|
||||
/obj/structure/trap/stun/trap_effect(mob/living/L)
|
||||
L.electrocute_act(30, src, safety=1) // electrocute act does a message.
|
||||
L.Knockdown(100)
|
||||
L.Paralyze(100)
|
||||
|
||||
/obj/structure/trap/fire
|
||||
name = "flame trap"
|
||||
@@ -90,7 +90,7 @@
|
||||
|
||||
/obj/structure/trap/fire/trap_effect(mob/living/L)
|
||||
to_chat(L, "<span class='danger'><B>Spontaneous combustion!</B></span>")
|
||||
L.Knockdown(20)
|
||||
L.Paralyze(20)
|
||||
|
||||
/obj/structure/trap/fire/flare()
|
||||
..()
|
||||
@@ -104,7 +104,7 @@
|
||||
|
||||
/obj/structure/trap/chill/trap_effect(mob/living/L)
|
||||
to_chat(L, "<span class='danger'><B>You're frozen solid!</B></span>")
|
||||
L.Knockdown(20)
|
||||
L.Paralyze(20)
|
||||
L.adjust_bodytemperature(-300)
|
||||
L.apply_status_effect(/datum/status_effect/freon)
|
||||
|
||||
@@ -117,7 +117,7 @@
|
||||
|
||||
/obj/structure/trap/damage/trap_effect(mob/living/L)
|
||||
to_chat(L, "<span class='danger'><B>The ground quakes beneath your feet!</B></span>")
|
||||
L.Knockdown(100)
|
||||
L.Paralyze(100)
|
||||
L.adjustBruteLoss(35)
|
||||
|
||||
/obj/structure/trap/damage/flare()
|
||||
|
||||
@@ -521,7 +521,7 @@
|
||||
if(B.cell.charge > 0 && B.status == 1)
|
||||
flick("baton_active", src)
|
||||
var/stunforce = B.stunforce
|
||||
user.Knockdown(stunforce)
|
||||
user.Paralyze(stunforce)
|
||||
user.stuttering = stunforce/20
|
||||
B.deductcharge(B.hitcost)
|
||||
user.visible_message("<span class='warning'>[user] shocks [user.p_them()]self while attempting to wash the active [B.name]!</span>", \
|
||||
|
||||
@@ -343,9 +343,14 @@
|
||||
set name = "Flip Windoor Assembly"
|
||||
set category = "Object"
|
||||
set src in oview(1)
|
||||
if(usr.stat || !usr.canmove || usr.restrained())
|
||||
if(usr.stat || usr.restrained())
|
||||
return
|
||||
|
||||
if(isliving(usr))
|
||||
var/mob/living/L = usr
|
||||
if(!(L.mobility_flags & MOBILITY_USE))
|
||||
return
|
||||
|
||||
if(facing == "l")
|
||||
to_chat(usr, "<span class='notice'>The windoor will now slide to the right.</span>")
|
||||
facing = "r"
|
||||
|
||||
Reference in New Issue
Block a user