Merge pull request #10451 from kevinz000/mobility_flags

Mobility flags + combat rework stuff refactoring, fixes a few edge cases including the Oh Dreaded Xenomorph Hardstuns, etc etc time to break the game
This commit is contained in:
deathride58
2020-03-05 20:03:56 -05:00
committed by GitHub
290 changed files with 2244 additions and 1819 deletions
@@ -110,7 +110,7 @@
user.visible_message("<span class='notice'>[user] pulls [src] out from under [poordude].</span>", "<span class='notice'>You pull [src] out from under [poordude].</span>")
var/C = new item_chair(loc)
user.put_in_hands(C)
poordude.Knockdown(20)//rip in peace
poordude.DefaultCombatKnockdown(20)//rip in peace
user.adjustStaminaLoss(5)
unbuckle_all_mobs(TRUE)
qdel(src)
@@ -377,7 +377,7 @@
if(iscarbon(target))
var/mob/living/carbon/C = target
if(C.health < C.maxHealth*0.5)
C.Knockdown(20)
C.DefaultCombatKnockdown(20)
smash(user)
/obj/item/chair/greyscale
@@ -431,7 +431,7 @@
"<span class='italics'>You hear a loud metal bang.</span>")
var/mob/living/L = O
if(!issilicon(L))
L.Knockdown(40)
L.DefaultCombatKnockdown(40)
O.forceMove(T)
close()
else
@@ -474,8 +474,9 @@
set category = "Object"
set name = "Toggle Open"
if(!usr.canmove || usr.stat || usr.restrained())
return
var/mob/living/L = usr
if(!istype(L) || !CHECK_MOBILITY(L, MOBILITY_USE))
return FALSE
if(iscarbon(usr) || issilicon(usr) || isdrone(usr))
return attack_hand(usr)
@@ -510,7 +511,7 @@
user.visible_message("<span class='warning'>[src] begins to shake violently!</span>", \
"<span class='notice'>You lean on the back of [src] and start pushing the door open... (this will take about [DisplayTimeText(breakout_time)].)</span>", \
"<span class='italics'>You hear banging from [src].</span>")
if(do_after(user,(breakout_time), target = src))
if(do_after(user,(breakout_time), target = src, required_mobility_flags = MOBILITY_RESIST))
if(!user || user.stat != CONSCIOUS || user.loc != src || opened || (!locked && !welded) )
return
//we check after a while whether there is a point of resisting anymore and whether the user is capable of resisting
@@ -603,12 +604,12 @@
step_towards(user, T2)
T1 = get_turf(user)
if(T1 == T2)
user.resting = TRUE //so people can jump into crates without slamming the lid on their head
user.set_resting(TRUE, TRUE)
if(!close(user))
to_chat(user, "<span class='warning'>You can't get [src] to close!</span>")
user.resting = FALSE
user.set_resting(FALSE, TRUE)
return
user.resting = FALSE
user.set_resting(FALSE, TRUE)
togglelock(user)
T1.visible_message("<span class='warning'>[user] dives into [src]!</span>")
@@ -18,8 +18,8 @@
var/egged = 0
var/use_mob_movespeed = FALSE //Citadel adds snowflake box handling
/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(opened || move_delay || !CHECK_MOBILITY(user, MOBILITY_MOVE) || !isturf(loc) || !has_gravity(loc))
return
move_delay = TRUE
var/oldloc = loc
@@ -139,7 +139,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.DefaultCombatKnockdown(20)
/obj/structure/kitchenspike/Destroy()
if(has_buckled_mobs())
+2 -2
View File
@@ -82,7 +82,7 @@
/datum/song/proc/shouldStopPlaying(mob/user)
if(instrumentObj)
if(!user.canUseTopic(instrumentObj))
if(!user.canUseTopic(instrumentObj, TRUE, FALSE, FALSE, FALSE))
return TRUE
return !instrumentObj.anchored // add special cases to stop in subclasses
else
@@ -220,7 +220,7 @@
updateDialog(usr) // make sure updates when complete
/datum/song/Topic(href, href_list)
if(!usr.canUseTopic(instrumentObj))
if(!usr.canUseTopic(instrumentObj, TRUE, FALSE, FALSE, FALSE))
usr << browse(null, "window=instrument")
usr.unset_machine()
return
@@ -49,7 +49,7 @@
if(S.mind)
if(petrified_mob)
S.mind.transfer_to(petrified_mob)
petrified_mob.Knockdown(100)
petrified_mob.DefaultCombatKnockdown(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)
+15 -19
View File
@@ -109,8 +109,7 @@
/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.set_resting(TRUE, FALSE)
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")
@@ -128,7 +127,7 @@
pushed_mob.pass_flags &= ~PASSTABLE
if(pushed_mob.loc != loc) //Something prevented the tabling
return
pushed_mob.Knockdown(40)
pushed_mob.DefaultCombatKnockdown(40)
pushed_mob.visible_message("<span class='danger'>[user] slams [pushed_mob] onto [src]!</span>", \
"<span class='userdanger'>[user] slams you onto [src]!</span>")
log_combat(user, pushed_mob, "tabled", null, "onto [src]")
@@ -138,11 +137,11 @@
SEND_SIGNAL(H, COMSIG_ADD_MOOD_EVENT, "table", /datum/mood_event/table)
/obj/structure/table/shove_act(mob/living/target, mob/living/user)
if(!target.resting)
target.Knockdown(SHOVE_KNOCKDOWN_TABLE)
if(CHECK_MOBILITY(target, MOBILITY_STAND))
target.DefaultCombatKnockdown(SHOVE_KNOCKDOWN_TABLE)
user.visible_message("<span class='danger'>[user.name] shoves [target.name] onto \the [src]!</span>",
"<span class='danger'>You shove [target.name] onto \the [src]!</span>", null, COMBAT_MESSAGE_RANGE)
target.forceMove(src.loc)
target.forceMove(loc)
log_combat(user, target, "shoved", "onto [src] (table)")
return TRUE
@@ -270,7 +269,7 @@
debris -= AM
if(istype(AM, /obj/item/shard))
AM.throw_impact(L)
L.Knockdown(100)
L.DefaultCombatKnockdown(100)
qdel(src)
/obj/structure/table/glass/deconstruct(disassembled = TRUE, wrench_disassembly = 0)
@@ -568,23 +567,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)
if(M)
if(M.resting)
patient = M
return 1
var/mob/living/carbon/human/H = locate() in loc
if(H)
if(!CHECK_MOBILITY(H, MOBILITY_STAND))
patient = H
return TRUE
else
patient = null
return 0
return FALSE
/*
* Racks
@@ -644,7 +640,7 @@
. = ..()
if(.)
return
if(user.IsKnockdown() || user.resting || user.lying || user.get_num_legs() < 2)
if(CHECK_MULTIPLE_BITFIELDS(user.mobility_flags, MOBILITY_STAND|MOBILITY_MOVE) || user.get_num_legs() < 2)
return
user.changeNext_move(CLICK_CD_MELEE)
user.do_attack_animation(src, ATTACK_EFFECT_KICK)
@@ -43,10 +43,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())
/obj/structure/transit_tube/station/MouseDrop_T(obj/structure/c_transit_tube_pod/R, mob/living/user)
if(!istype(user) || !CHECK_MOBILITY(user, MOBILITY_USE))
return
if (!istype(R) || get_dist(user, src) > 1 || get_dist(src,R) > 1)
if(!istype(R) || get_dist(user, src) > 1 || get_dist(src,R) > 1)
return
for(var/obj/structure/transit_tube_pod/pod in loc)
return //no fun allowed
@@ -74,7 +74,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.DefaultCombatKnockdown(100)
src.Bumped(GM)
break
else
+6 -6
View File
@@ -83,7 +83,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.DefaultCombatKnockdown(100)
/obj/structure/trap/fire
name = "flame trap"
@@ -92,7 +92,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.DefaultCombatKnockdown(20)
/obj/structure/trap/fire/flare()
..()
@@ -106,7 +106,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.DefaultCombatKnockdown(20)
L.adjust_bodytemperature(-300)
L.apply_status_effect(/datum/status_effect/freon)
@@ -119,7 +119,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.DefaultCombatKnockdown(100)
L.adjustBruteLoss(35)
/obj/structure/trap/damage/flare()
@@ -147,7 +147,7 @@
/obj/structure/trap/cult/trap_effect(mob/living/L)
to_chat(L, "<span class='danger'><B>With a crack, the hostile constructs come out of hiding, stunning you!</B></span>")
L.electrocute_act(10, src, safety = TRUE) // electrocute act does a message.
L.Knockdown(20)
L.DefaultCombatKnockdown(20)
new /mob/living/simple_animal/hostile/construct/proteon/hostile(loc)
new /mob/living/simple_animal/hostile/construct/proteon/hostile(loc)
QDEL_IN(src, 30)
QDEL_IN(src, 30)
+1 -1
View File
@@ -529,7 +529,7 @@
if(B.cell.charge > 0 && B.status == 1)
flick("baton_active", src)
var/stunforce = B.stamforce
user.Knockdown(stunforce * 2)
user.DefaultCombatKnockdown(stunforce * 2)
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,7 +343,8 @@
set name = "Flip Windoor Assembly"
set category = "Object"
set src in oview(1)
if(usr.stat || !usr.canmove || usr.restrained())
var/mob/living/L = usr
if(!CHECK_MOBILITY(L, MOBILITY_PULL))
return
if(facing == "l")
@@ -354,4 +355,3 @@
to_chat(usr, "<span class='notice'>The windoor will now slide to the left.</span>")
update_icon()
return