We don't have wheelchairs? Heresy. Plus fixes to work on citcode. Csafe
This commit is contained in:
@@ -119,7 +119,7 @@
|
||||
owner.update_disabled_bodyparts()
|
||||
|
||||
/datum/brain_trauma/severe/paralysis/paraplegic
|
||||
random_gain = FALSE
|
||||
can_gain = FALSE
|
||||
paralysis_type = "legs"
|
||||
resilience = TRAUMA_RESILIENCE_ABSOLUTE
|
||||
|
||||
|
||||
@@ -196,28 +196,28 @@
|
||||
lose_text = null
|
||||
medical_record_text = "Patient has an untreatable impairment in motor function in the lower extremities."
|
||||
|
||||
/datum/quirk/paraplegic/add()
|
||||
/datum/quirk/paraplegic/add()
|
||||
var/datum/brain_trauma/severe/paralysis/paraplegic/T = new()
|
||||
var/mob/living/carbon/human/H = quirk_holder
|
||||
H.gain_trauma(T, TRAUMA_RESILIENCE_ABSOLUTE)
|
||||
|
||||
/datum/quirk/paraplegic/on_spawn()
|
||||
/datum/quirk/paraplegic/on_spawn()
|
||||
if(quirk_holder.buckled) // Handle late joins being buckled to arrival shuttle chairs.
|
||||
quirk_holder.buckled.unbuckle_mob(quirk_holder)
|
||||
|
||||
var/turf/T = get_turf(quirk_holder)
|
||||
var/turf/T = get_turf(quirk_holder)
|
||||
var/obj/structure/chair/spawn_chair = locate() in T
|
||||
|
||||
var/obj/vehicle/ridden/wheelchair/wheels = new(T)
|
||||
var/obj/vehicle/ridden/wheelchair/wheels = new(T)
|
||||
if(spawn_chair) // Makes spawning on the arrivals shuttle more consistent looking
|
||||
wheels.setDir(spawn_chair.dir)
|
||||
|
||||
wheels.buckle_mob(quirk_holder)
|
||||
wheels.buckle_mob(quirk_holder)
|
||||
|
||||
// During the spawning process, they may have dropped what they were holding, due to the paralysis
|
||||
// During the spawning process, they may have dropped what they were holding, due to the paralysis
|
||||
// So put the things back in their hands.
|
||||
|
||||
for(var/obj/item/I in T)
|
||||
for(var/obj/item/I in T)
|
||||
if(I.fingerprintslast == quirk_holder.ckey)
|
||||
quirk_holder.put_in_hands(I)
|
||||
|
||||
|
||||
@@ -225,7 +225,7 @@
|
||||
set_disabled(is_disabled())
|
||||
|
||||
/obj/item/bodypart/proc/is_disabled()
|
||||
if(has_trait(TRAIT_PARALYSIS))
|
||||
if(owner.has_trait(TRAIT_PARALYSIS))
|
||||
return BODYPART_DISABLED_PARALYSIS
|
||||
if(can_dismember() && !owner.has_trait(TRAIT_NODISMEMBER))
|
||||
. = disabled //inertia, to avoid limbs healing 0.1 damage and being re-enabled
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
buckle_lying = FALSE
|
||||
default_driver_move = FALSE
|
||||
var/legs_required = 2
|
||||
var/arms_requires = 0 //why not?
|
||||
var/arms_required = 0 //why not?
|
||||
|
||||
/obj/vehicle/ridden/Initialize()
|
||||
. = ..()
|
||||
|
||||
@@ -0,0 +1,110 @@
|
||||
/obj/vehicle/ridden/wheelchair //ported from Hippiestation (by Jujumatic) Then ported by Fermis from tg!
|
||||
name = "wheelchair"
|
||||
desc = "A chair with big wheels. It looks like you can move in this on your own."
|
||||
icon = 'icons/obj/vehicles.dmi'
|
||||
icon_state = "wheelchair"
|
||||
layer = OBJ_LAYER
|
||||
max_integrity = 100
|
||||
armor = list("melee" = 10, "bullet" = 10, "laser" = 10, "energy" = 0, "bomb" = 10, "bio" = 0, "rad" = 0, "fire" = 20, "acid" = 30) //Wheelchairs aren't super tough yo
|
||||
legs_required = 0 //You'll probably be using this if you don't have legs
|
||||
canmove = TRUE
|
||||
density = FALSE //Thought I couldn't fix this one easily, phew
|
||||
arms_required = 1
|
||||
|
||||
/obj/vehicle/ridden/wheelchair/Initialize()
|
||||
. = ..()
|
||||
var/datum/component/riding/D = LoadComponent(/datum/component/riding)
|
||||
D.vehicle_move_delay = 0
|
||||
D.set_vehicle_dir_layer(SOUTH, OBJ_LAYER)
|
||||
D.set_vehicle_dir_layer(NORTH, ABOVE_MOB_LAYER)
|
||||
D.set_vehicle_dir_layer(EAST, OBJ_LAYER)
|
||||
D.set_vehicle_dir_layer(WEST, OBJ_LAYER)
|
||||
|
||||
/obj/vehicle/ridden/wheelchair/ComponentInitialize() //Since it's technically a chair I want it to have chair properties
|
||||
. = ..()
|
||||
AddComponent(/datum/component/simple_rotation,ROTATION_ALTCLICK | ROTATION_CLOCKWISE, CALLBACK(src, .proc/can_user_rotate),CALLBACK(src, .proc/can_be_rotated),null)
|
||||
|
||||
/obj/vehicle/ridden/wheelchair/obj_destruction(damage_flag)
|
||||
new /obj/item/stack/rods(drop_location(), 1)
|
||||
new /obj/item/stack/sheet/metal(drop_location(), 1)
|
||||
..()
|
||||
|
||||
/obj/vehicle/ridden/wheelchair/Destroy()
|
||||
if(has_buckled_mobs())
|
||||
var/mob/living/carbon/H = buckled_mobs[1]
|
||||
unbuckle_mob(H)
|
||||
return ..()
|
||||
|
||||
/obj/vehicle/ridden/wheelchair/driver_move(mob/living/user, direction)
|
||||
if(istype(user))
|
||||
if(canmove && (user.get_num_arms() < arms_required))
|
||||
to_chat(user, "<span class='warning'>You don't have enough arms to operate the wheels!</span>")
|
||||
canmove = FALSE
|
||||
addtimer(VARSET_CALLBACK(src, canmove, TRUE), 20)
|
||||
return FALSE
|
||||
var/datum/component/riding/D = GetComponent(/datum/component/riding)
|
||||
//1.5 (movespeed as of this change) multiplied by 6.7 gets ABOUT 10 (rounded), the old constant for the wheelchair that gets divided by how many arms they have
|
||||
//if that made no sense this simply makes the wheelchair speed change along with movement speed delay
|
||||
D.vehicle_move_delay = round(CONFIG_GET(number/movedelay/run_delay) * 6.7) / min(user.get_num_arms(), 2)
|
||||
return ..()
|
||||
|
||||
/obj/vehicle/ridden/wheelchair/Moved()
|
||||
. = ..()
|
||||
cut_overlays()
|
||||
playsound(src, 'sound/effects/roll.ogg', 75, 1)
|
||||
if(has_buckled_mobs())
|
||||
handle_rotation_overlayed()
|
||||
|
||||
|
||||
/obj/vehicle/ridden/wheelchair/post_buckle_mob(mob/living/user)
|
||||
. = ..()
|
||||
handle_rotation_overlayed()
|
||||
|
||||
/obj/vehicle/ridden/wheelchair/post_unbuckle_mob()
|
||||
. = ..()
|
||||
cut_overlays()
|
||||
|
||||
/obj/vehicle/ridden/wheelchair/setDir(newdir)
|
||||
..()
|
||||
handle_rotation(newdir)
|
||||
|
||||
/obj/vehicle/ridden/wheelchair/wrench_act(mob/living/user, obj/item/I) //Attackby should stop it attacking the wheelchair after moving away during decon
|
||||
to_chat(user, "<span class='notice'>You begin to detach the wheels...</span>")
|
||||
if(I.use_tool(src, user, 40, volume=50))
|
||||
to_chat(user, "<span class='notice'>You detach the wheels and deconstruct the chair.</span>")
|
||||
new /obj/item/stack/rods(drop_location(), 6)
|
||||
new /obj/item/stack/sheet/metal(drop_location(), 4)
|
||||
qdel(src)
|
||||
return TRUE
|
||||
|
||||
/obj/vehicle/ridden/wheelchair/proc/handle_rotation(direction)
|
||||
if(has_buckled_mobs())
|
||||
handle_rotation_overlayed()
|
||||
for(var/m in buckled_mobs)
|
||||
var/mob/living/buckled_mob = m
|
||||
buckled_mob.setDir(direction)
|
||||
|
||||
/obj/vehicle/ridden/wheelchair/proc/handle_rotation_overlayed()
|
||||
cut_overlays()
|
||||
var/image/V = image(icon = icon, icon_state = "wheelchair_overlay", layer = FLY_LAYER, dir = src.dir)
|
||||
add_overlay(V)
|
||||
|
||||
|
||||
|
||||
/obj/vehicle/ridden/wheelchair/proc/can_be_rotated(mob/living/user)
|
||||
return TRUE
|
||||
|
||||
/obj/vehicle/ridden/wheelchair/proc/can_user_rotate(mob/living/user)
|
||||
var/mob/living/L = user
|
||||
if(istype(L))
|
||||
if(!user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
|
||||
return FALSE
|
||||
if(isobserver(user) && CONFIG_GET(flag/ghost_interaction))
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/obj/vehicle/ridden/wheelchair/the_whip/driver_move(mob/living/user, direction)
|
||||
if(istype(user))
|
||||
var/datum/component/riding/D = GetComponent(/datum/component/riding)
|
||||
D.vehicle_move_delay = round(CONFIG_GET(number/movedelay/run_delay) * 6.7) / user.get_num_arms()
|
||||
return ..()
|
||||
Reference in New Issue
Block a user