Move buckling to /atom/movable, can now buckle to mobs if adminbooze

Also changed:
 - Comment clarifying what buckle_lying = -1 means
 - Changes direction of lying on operating tables, somehow missed it
This commit is contained in:
Tigercat2000
2015-09-30 15:29:47 -07:00
parent 7565da30ec
commit 575362b0f4
10 changed files with 79 additions and 54 deletions
+4
View File
@@ -309,6 +309,10 @@ var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/unary/vent_pump,
src << "You can't vent crawl while you're stunned!"
return
if(buckled_mob)
src << "You can't vent crawl with [buckled_mob] on you!"
return
var/obj/machinery/atmospherics/unary/vent_found
if(clicked_on)
@@ -185,7 +185,7 @@
return
//BubbleWrap: people in handcuffs are always switched around as if they were on 'help' intent to prevent a person being pulled from being seperated from their puller
if((tmob.a_intent == I_HELP || tmob.restrained()) && (a_intent == I_HELP || src.restrained()) && tmob.canmove && !tmob.buckled && canmove) // mutual brohugs all around!
if((tmob.a_intent == I_HELP || tmob.restrained()) && (a_intent == I_HELP || restrained()) && tmob.canmove && canmove && !tmob.buckled && !tmob.buckled_mob) // mutual brohugs all around!
var/turf/oldloc = loc
loc = tmob.loc
tmob.loc = oldloc
+2 -2
View File
@@ -317,7 +317,7 @@
C.reagents.addiction_list.Cut()
hud_updateflag |= 1 << HEALTH_HUD
hud_updateflag |= 1 << STATUS_HUD
/mob/living/proc/update_revive() // handles revival through other means than cloning or adminbus (defib, IPC repair)
stat = CONSCIOUS
dead_mob_list -= src
@@ -406,7 +406,7 @@
return
/mob/living/Move(atom/newloc, direct)
if (buckled && buckled.loc != newloc)
if (buckled && buckled.loc != newloc) //not updating position
if (!buckled.anchored)
return buckled.Move(newloc, direct)
else
+27 -3
View File
@@ -1019,9 +1019,6 @@ var/list/slot_equipment_priority = list( \
/mob/proc/facedir(var/ndir)
if(!canface()) return 0
dir = ndir
if(buckled && buckled.movable)
buckled.dir = ndir
buckled.handle_rotation()
client.move_delay += movement_delay()
return 1
@@ -1398,3 +1395,30 @@ mob/proc/yank_out_object()
/mob/proc/handle_ventcrawl()
return // Only living mobs can ventcrawl
//You can buckle on mobs if you're next to them since most are dense
/mob/buckle_mob(mob/living/M)
if(M.buckled)
return 0
var/turf/T = get_turf(src)
if(M.loc != T)
var/old_density = density
density = 0
var/can_step = step_towards(M, T)
density = old_density
if(!can_step)
return 0
return ..()
//Default buckling shift visual for mobs
/mob/post_buckle_mob(mob/living/M)
if(M == buckled_mob) //post buckling
M.pixel_y = initial(M.pixel_y) + 9
if(M.layer < layer)
M.layer = layer + 0.1
else //post unbuckling
M.layer = initial(M.layer)
M.pixel_y = initial(M.pixel_y)
/mob/proc/can_unbuckle(mob/user)
return 1
+1 -1
View File
@@ -118,7 +118,7 @@
var/m_int = null//Living
var/m_intent = "run"//Living
var/lastKnownIP = null
var/obj/structure/stool/bed/buckled = null//Living
var/atom/movable/buckled = null//Living
var/obj/item/l_hand = null//Living
var/obj/item/r_hand = null//Living
var/obj/item/weapon/back = null//Human/Monkey
+11 -8
View File
@@ -1,16 +1,19 @@
/mob/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
if(air_group || (height==0)) return 1
if(istype(mover) && mover.checkpass(PASSMOB))
/mob/CanPass(atom/movable/mover, turf/target, height=0)
if(height==0)
return 1
if(istype(mover, /obj/item/projectile) || mover.throwing)
return (!density || lying)
if(mover.checkpass(PASSMOB))
return 1
if(buckled == mover)
return 1
if(ismob(mover))
var/mob/moving_mob = mover
if ((other_mobs && moving_mob.other_mobs))
return 1
return (!mover.density || !density || lying)
else
return (!mover.density || !density || lying)
return
if (mover == buckled_mob)
return 1
return (!mover.density || !density || lying)
/client/North()