Wheelchair fixes

This commit is contained in:
Hubblenaut
2016-01-05 00:51:32 +01:00
parent beb54f906a
commit 61e31ab8ad
7 changed files with 22 additions and 27 deletions

View File

@@ -15,7 +15,7 @@
/obj/structure/bed/chair/wheelchair/set_dir()
..()
overlays = null
var/image/O = image(icon = 'icons/obj/objects.dmi', icon_state = "w_overlay", layer = FLY_LAYER, dir = src.dir)
var/image/O = image(icon = 'icons/obj/furniture.dmi', icon_state = "w_overlay", layer = FLY_LAYER, dir = src.dir)
overlays += O
if(buckled_mob)
buckled_mob.set_dir(dir)
@@ -116,26 +116,21 @@
user_unbuckle_mob(user)
return
/obj/structure/bed/chair/wheelchair/MouseDrop(over_object, src_location, over_location)
..()
if(over_object == usr && in_range(src, usr))
if(!ishuman(usr)) return
if(usr == buckled_mob)
usr << "<span class='warning'>You realize you are unable to push the wheelchair you sit in.</span>"
/obj/structure/bed/chair/wheelchair/CtrlClick(var/mob/user)
if(in_range(src, user))
if(!ishuman(user)) return
if(user == buckled_mob)
user << "<span class='warning'>You realize you are unable to push the wheelchair you sit in.</span>"
return
if(!pulling)
pulling = usr
usr.pulledby = src
if(usr.pulling)
usr.stop_pulling()
usr.set_dir(get_dir(usr, src))
usr << "You grip \the [name]'s handles."
pulling = user
user.pulledby = src
if(user.pulling)
user.stop_pulling()
user.set_dir(get_dir(user, src))
user << "You grip \the [name]'s handles."
else
if(usr != pulling)
for(var/mob/O in viewers(pulling, null))
O.show_message("<span class='warning'>[usr] breaks [pulling]'s grip on the wheelchair.</span>", 1)
else
usr << "You let go of \the [name]'s handles."
usr << "You let go of \the [name]'s handles."
pulling.pulledby = null
pulling = null
return

View File

@@ -43,7 +43,7 @@
E.process()
number_wounds += E.number_wounds
if (!lying && world.time - l_move_time < 15)
if (!lying && !buckled && world.time - l_move_time < 15)
//Moving around with fractured ribs won't do you any good
if (E.is_broken() && E.internal_organs && E.internal_organs.len && prob(15))
var/obj/item/organ/I = pick(E.internal_organs)

View File

@@ -85,7 +85,7 @@ default behaviour is:
now_pushing = 0
return
if((tmob.mob_always_swap || (tmob.a_intent == I_HELP || tmob.restrained()) && (a_intent == I_HELP || src.restrained())) && tmob.canmove && canmove && !dense && can_move_mob(tmob, 1, 0)) // mutual brohugs all around!
if((tmob.mob_always_swap || (tmob.a_intent == I_HELP || tmob.restrained()) && (a_intent == I_HELP || src.restrained())) && tmob.canmove && canmove && !tmob.buckled && !buckled && !dense && can_move_mob(tmob, 1, 0)) // mutual brohugs all around!
var/turf/oldloc = loc
forceMove(tmob.loc)
tmob.forceMove(oldloc)

View File

@@ -11,7 +11,7 @@
return
/mob/proc/setMoveCooldown(var/timeout)
if(client)
if(client)
client.move_delay = max(world.time + timeout, client.move_delay)
/client/North()
@@ -300,8 +300,8 @@
if(istype(mob.pulledby, /obj/structure/bed/chair/wheelchair))
return mob.pulledby.relaymove(mob, direct)
else if(istype(mob.buckled, /obj/structure/bed/chair/wheelchair))
if(ishuman(mob.buckled))
var/mob/living/carbon/human/driver = mob.buckled
if(ishuman(mob))
var/mob/living/carbon/human/driver = mob
var/obj/item/organ/external/l_hand = driver.get_organ("l_hand")
var/obj/item/organ/external/r_hand = driver.get_organ("r_hand")
if((!l_hand || (l_hand.status & ORGAN_DESTROYED)) && (!r_hand || (r_hand.status & ORGAN_DESTROYED)))
@@ -450,8 +450,8 @@
if(!Check_Dense_Object()) //Nothing to push off of so end here
update_floating(0)
return 0
update_floating(1)
update_floating(1)
if(restrained()) //Check to see if we can do things
return 0
@@ -477,10 +477,10 @@
if(istype(turf,/turf/simulated/floor)) // Floors don't count if they don't have gravity
var/area/A = turf.loc
if(istype(A) && A.has_gravity == 0)
if(istype(A) && A.has_gravity == 0)
if(shoegrip == null)
shoegrip = Check_Shoegrip() //Shoegrip is only ever checked when a zero-gravity floor is encountered to reduce load
if(!shoegrip)
if(!shoegrip)
continue
dense_object++