From 988319b3e3f0afe83f1e4537dea20e030d3e3392 Mon Sep 17 00:00:00 2001 From: Rohesie Date: Mon, 24 Aug 2020 17:56:07 -0300 Subject: [PATCH] mobility refactor (#52929) --- code/__DEFINES/traits.dm | 1 + code/datums/action.dm | 14 +- code/datums/components/riding.dm | 4 +- code/datums/components/twohanded.dm | 2 +- code/game/atoms.dm | 2 +- code/game/atoms_movable.dm | 13 +- code/game/machinery/Sleeper.dm | 2 +- code/game/machinery/_machinery.dm | 2 +- .../machinery/computer/camera_advanced.dm | 4 +- code/game/machinery/dna_scanner.dm | 2 +- code/game/machinery/gulag_teleporter.dm | 2 +- code/game/machinery/harvester.dm | 2 +- code/game/machinery/hypnochair.dm | 2 +- code/game/machinery/rechargestation.dm | 2 +- code/game/machinery/suit_storage_unit.dm | 2 +- code/game/machinery/washing_machine.dm | 2 +- code/game/mecha/mecha.dm | 2 +- .../objects/items/devices/chameleonproj.dm | 2 +- code/game/objects/items/handcuffs.dm | 8 +- code/game/objects/items/his_grace.dm | 2 +- code/game/objects/items/holy_weapons.dm | 2 +- code/game/objects/items/hot_potato.dm | 2 +- .../objects/items/implants/implantchair.dm | 2 +- .../structures/crates_lockers/closets.dm | 4 +- .../crates_lockers/closets/cardboardbox.dm | 2 +- code/game/objects/structures/morgue.dm | 2 +- code/game/objects/structures/tables_racks.dm | 2 +- .../transit_tubes/transit_tube_pod.dm | 45 ++++--- code/game/turfs/closed/walls.dm | 2 +- .../abductor/equipment/abduction_gear.dm | 4 +- .../abductor/machinery/experiment.dm | 2 +- code/modules/antagonists/cult/blood_magic.dm | 2 +- .../devil/true_devil/_true_devil.dm | 10 +- .../eldritch_cult/eldritch_magic.dm | 21 +-- .../components/unary_devices/cryo.dm | 2 +- .../machinery/pipes/layermanifold.dm | 8 +- code/modules/clothing/head/jobs.dm | 2 +- .../modules/clothing/spacesuits/chronosuit.dm | 2 +- .../kitchen_machinery/gibber.dm | 2 +- .../library/skill_learning/skill_station.dm | 2 +- code/modules/mining/aux_base_camera.dm | 8 +- code/modules/mob/inventory.dm | 2 +- code/modules/mob/living/bloodcrawl.dm | 2 +- code/modules/mob/living/brain/MMI.dm | 2 +- code/modules/mob/living/carbon/alien/alien.dm | 4 +- .../living/carbon/alien/humanoid/humanoid.dm | 10 +- .../mob/living/carbon/alien/larva/larva.dm | 19 ++- code/modules/mob/living/carbon/carbon.dm | 62 +++++++-- .../mob/living/carbon/carbon_defines.dm | 14 +- .../mob/living/carbon/carbon_movement.dm | 40 ++++++ code/modules/mob/living/carbon/emote.dm | 2 +- code/modules/mob/living/carbon/examine.dm | 2 +- .../mob/living/carbon/human/examine.dm | 7 +- .../mob/living/carbon/human/human_helpers.dm | 6 +- .../living/carbon/human/human_update_icons.dm | 4 +- .../mob/living/carbon/human/species.dm | 13 +- .../carbon/human/species_types/jellypeople.dm | 2 +- .../mob/living/carbon/monkey/monkey.dm | 12 +- code/modules/mob/living/emote.dm | 4 +- code/modules/mob/living/inhand_holder.dm | 2 +- code/modules/mob/living/living.dm | 59 +++++++-- code/modules/mob/living/living_defines.dm | 14 ++ .../modules/mob/living/silicon/robot/robot.dm | 2 +- .../mob/living/simple_animal/bot/mulebot.dm | 2 +- .../hostile/mining_mobs/goldgrub.dm | 2 +- .../simple_animal/hostile/netherworld.dm | 2 +- .../mob/living/simple_animal/simple_animal.dm | 2 +- code/modules/mob/mob.dm | 87 +++++++------ code/modules/recycling/disposal/bin.dm | 2 +- code/modules/recycling/disposal/holder.dm | 2 +- .../research/nanites/nanite_chamber.dm | 2 +- .../research/nanites/public_chamber.dm | 2 +- .../modules/ruins/lavalandruin_code/puzzle.dm | 2 +- .../spells/spell_types/ethereal_jaunt.dm | 2 +- .../modules/spells/spell_types/shadow_walk.dm | 2 +- .../spells/spell_types/touch_attacks.dm | 2 +- code/modules/surgery/bodyparts/_bodyparts.dm | 23 ++-- .../surgery/bodyparts/dismemberment.dm | 4 +- code/modules/surgery/bodyparts/helpers.dm | 85 +++--------- code/modules/surgery/bodyparts/parts.dm | 122 +++++++++++------- code/modules/vehicles/_vehicle.dm | 4 +- code/modules/vehicles/cars/car.dm | 2 +- code/modules/vehicles/motorized_wheelchair.dm | 2 +- code/modules/vehicles/ridden.dm | 12 +- code/modules/vehicles/scooter.dm | 6 +- code/modules/vehicles/secway.dm | 2 +- code/modules/vehicles/wheelchair.dm | 6 +- 87 files changed, 522 insertions(+), 341 deletions(-) diff --git a/code/__DEFINES/traits.dm b/code/__DEFINES/traits.dm index 3eb8c2f6ed5..25fd070a663 100644 --- a/code/__DEFINES/traits.dm +++ b/code/__DEFINES/traits.dm @@ -325,3 +325,4 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai #define SKILLCHIP_TRAIT "skillchip" #define PULLED_WHILE_SOFTCRIT_TRAIT "pulled-while-softcrit" #define LOCKED_BORG_TRAIT "locked-borg" +#define LACKING_LOCOMOTION_APPENDAGES_TRAIT "lacking-locomotion-appengades" //trait associated to not having locomotion appendages nor the ability to fly or float diff --git a/code/datums/action.dm b/code/datums/action.dm index 2b6463fe3a2..5952340136b 100644 --- a/code/datums/action.dm +++ b/code/datums/action.dm @@ -468,6 +468,7 @@ else Remove(owner) + /datum/action/item_action/cult_dagger/Trigger() for(var/obj/item/H in owner.held_items) //In case we were already holding another dagger if(istype(H, /obj/item/melee/cultblade/dagger)) @@ -478,11 +479,16 @@ owner.temporarilyRemoveItemFromInventory(I) owner.put_in_hands(I) I.attack_self(owner) + return + if(!isliving(owner)) + to_chat(owner, "You lack the necessary living force for this action.") + return + var/mob/living/living_owner = owner + if (living_owner.usable_hands <= 0) + to_chat(living_owner, "You dont have any usable hands!") else - if (owner.get_num_arms() <= 0) - to_chat(owner, "You dont have any usable hands!") - else - to_chat(owner, "Your hands are full!") + to_chat(living_owner, "Your hands are full!") + ///MGS BOX! /datum/action/item_action/agent_box diff --git a/code/datums/components/riding.dm b/code/datums/components/riding.dm index f9ab924f36c..1538cc8bff7 100644 --- a/code/datums/components/riding.dm +++ b/code/datums/components/riding.dm @@ -219,7 +219,7 @@ return override_allow_spacemove || AM.has_gravity() /datum/component/riding/proc/account_limbs(mob/living/M) - if(M.get_num_legs() < 2 && !slowed) + if(M.usable_legs < 2 && !slowed) vehicle_move_delay = vehicle_move_delay + slowvalue slowed = TRUE else if(slowed) @@ -302,7 +302,7 @@ return if(iscarbon(user)) var/mob/living/carbon/carbonuser = user - if(!carbonuser.get_num_arms()) + if(!carbonuser.usable_hands) Unbuckle(user) to_chat(user, "You can't grab onto [AM] with no hands!") return diff --git a/code/datums/components/twohanded.dm b/code/datums/components/twohanded.dm index 88e15d7f0a5..0d7c03d4075 100644 --- a/code/datums/components/twohanded.dm +++ b/code/datums/components/twohanded.dm @@ -135,7 +135,7 @@ else to_chat(user, "You need your other hand to be empty!") return - if(user.get_num_arms() < 2) + if(user.usable_hands < 2) if(require_twohands) user.dropItemToGround(parent, force=TRUE) to_chat(user, "You don't have enough intact hands.") diff --git a/code/game/atoms.dm b/code/game/atoms.dm index e4480c4e6a8..5f097d46646 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -653,7 +653,7 @@ * Default behaviour is to send a warning that the user can't move while buckled as long * as the [buckle_message_cooldown][/atom/var/buckle_message_cooldown] has expired (50 ticks) */ -/atom/proc/relaymove(mob/user) +/atom/proc/relaymove(mob/living/user, direction) if(buckle_message_cooldown <= world.time) buckle_message_cooldown = world.time + 50 to_chat(user, "You can't move while buckled to [src]!") diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index 78a8efb12f4..ffae8794e16 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -1,5 +1,7 @@ /atom/movable layer = OBJ_LAYER + glide_size = 8 + appearance_flags = TILE_BOUND|PIXEL_SCALE var/last_move = null var/last_move_time = 0 var/anchored = FALSE @@ -31,10 +33,9 @@ var/atom/movable/moving_from_pull //attempt to resume grab after moving instead of before. var/list/client_mobs_in_contents // This contains all the client mobs within this container var/list/acted_explosions //for explosion dodging - glide_size = 8 - appearance_flags = TILE_BOUND|PIXEL_SCALE var/datum/forced_movement/force_moving = null //handled soley by forced_movement.dm - var/movement_type = GROUND //Incase you have multiple types, you automatically use the most useful one. IE: Skating on ice, flippers on water, flying over chasm/space, etc. + ///In case you have multiple types, you automatically use the most useful one. IE: Skating on ice, flippers on water, flying over chasm/space, etc. Should only be changed through setMovetype() + var/movement_type = GROUND var/atom/movable/pulling var/grab_state = 0 var/throwforce = 0 @@ -563,9 +564,15 @@ var/atom/movable/AM = item AM.onTransitZ(old_z,new_z) + +///Proc to modify the movement_type and hook behavior associated with it changing. /atom/movable/proc/setMovetype(newval) + if(movement_type == newval) + return + . = movement_type movement_type = newval + /** * Called whenever an object moves and by mobs when they attempt to move themselves through space * And when an object or action applies a force on src, see [newtonian_move][/atom/movable/proc/newtonian_move] diff --git a/code/game/machinery/Sleeper.dm b/code/game/machinery/Sleeper.dm index 582fdb39916..acbc92eda34 100644 --- a/code/game/machinery/Sleeper.dm +++ b/code/game/machinery/Sleeper.dm @@ -68,7 +68,7 @@ if (!state_open && user == occupant) container_resist_act(user) -/obj/machinery/sleeper/relaymove(mob/user) +/obj/machinery/sleeper/relaymove(mob/living/user, direction) if (!state_open) container_resist_act(user) diff --git a/code/game/machinery/_machinery.dm b/code/game/machinery/_machinery.dm index 580780c799c..3e10bf6b6f7 100644 --- a/code/game/machinery/_machinery.dm +++ b/code/game/machinery/_machinery.dm @@ -362,7 +362,7 @@ Class Procs: var/obj/item/bodypart/arm = user.hand_bodyparts[user.active_hand_index] if(!arm) return - if(arm.disabled) + if(arm.bodypart_disabled) return var/damage = damage_deflection / 10 arm.receive_damage(brute=damage, wound_bonus = CANT_WOUND) diff --git a/code/game/machinery/computer/camera_advanced.dm b/code/game/machinery/computer/camera_advanced.dm index 62426129805..c2a4f722ea2 100644 --- a/code/game/machinery/computer/camera_advanced.dm +++ b/code/game/machinery/computer/camera_advanced.dm @@ -211,7 +211,7 @@ user_image = image(icon,loc,icon_state,FLY_LAYER) eye_user.client.images += user_image -/mob/camera/ai_eye/remote/relaymove(mob/user,direct) +/mob/camera/ai_eye/remote/relaymove(mob/living/user, direction) var/initial = initial(sprint) var/max_sprint = 50 @@ -219,7 +219,7 @@ sprint = initial for(var/i = 0; i < max(sprint, initial); i += 20) - var/turf/step = get_turf(get_step(src, direct)) + var/turf/step = get_turf(get_step(src, direction)) if(step) setLoc(step) diff --git a/code/game/machinery/dna_scanner.dm b/code/game/machinery/dna_scanner.dm index 172bffd8113..242c96ce354 100644 --- a/code/game/machinery/dna_scanner.dm +++ b/code/game/machinery/dna_scanner.dm @@ -114,7 +114,7 @@ return TRUE -/obj/machinery/dna_scannernew/relaymove(mob/user) +/obj/machinery/dna_scannernew/relaymove(mob/living/user, direction) if(user.stat || locked) if(message_cooldown <= world.time) message_cooldown = world.time + 50 diff --git a/code/game/machinery/gulag_teleporter.dm b/code/game/machinery/gulag_teleporter.dm index 6a839bd61e5..e69deb67508 100644 --- a/code/game/machinery/gulag_teleporter.dm +++ b/code/game/machinery/gulag_teleporter.dm @@ -84,7 +84,7 @@ The console is located at computer/gulag_teleporter.dm return -/obj/machinery/gulag_teleporter/relaymove(mob/user) +/obj/machinery/gulag_teleporter/relaymove(mob/living/user, direction) if(user.stat != CONSCIOUS) return if(locked) diff --git a/code/game/machinery/harvester.dm b/code/game/machinery/harvester.dm index 2bd531a7c73..6c64d1ae992 100644 --- a/code/game/machinery/harvester.dm +++ b/code/game/machinery/harvester.dm @@ -180,7 +180,7 @@ if (!state_open && user == occupant) container_resist_act(user) -/obj/machinery/harvester/relaymove(mob/user) +/obj/machinery/harvester/relaymove(mob/living/user, direction) if (!state_open) container_resist_act(user) diff --git a/code/game/machinery/hypnochair.dm b/code/game/machinery/hypnochair.dm index 7aba0d2a691..226e5dfba15 100644 --- a/code/game/machinery/hypnochair.dm +++ b/code/game/machinery/hypnochair.dm @@ -188,7 +188,7 @@ "You successfully break out of [src]!") open_machine() -/obj/machinery/hypnochair/relaymove(mob/user) +/obj/machinery/hypnochair/relaymove(mob/living/user, direction) if(message_cooldown <= world.time) message_cooldown = world.time + 50 to_chat(user, "[src]'s door won't budge!") diff --git a/code/game/machinery/rechargestation.dm b/code/game/machinery/rechargestation.dm index b3dbaab0a09..f92139f40ca 100644 --- a/code/game/machinery/rechargestation.dm +++ b/code/game/machinery/rechargestation.dm @@ -43,7 +43,7 @@ process_occupant() return 1 -/obj/machinery/recharge_station/relaymove(mob/user) +/obj/machinery/recharge_station/relaymove(mob/living/user, direction) if(user.stat) return open_machine() diff --git a/code/game/machinery/suit_storage_unit.dm b/code/game/machinery/suit_storage_unit.dm index 061045cbdaf..9068ff3a83a 100644 --- a/code/game/machinery/suit_storage_unit.dm +++ b/code/game/machinery/suit_storage_unit.dm @@ -323,7 +323,7 @@ if(electrocute_mob(user, src, src, 1, TRUE)) return 1 -/obj/machinery/suit_storage_unit/relaymove(mob/user) +/obj/machinery/suit_storage_unit/relaymove(mob/living/user, direction) if(locked) if(message_cooldown <= world.time) message_cooldown = world.time + 50 diff --git a/code/game/machinery/washing_machine.dm b/code/game/machinery/washing_machine.dm index 66e5e470ef3..1b5f1800b61 100644 --- a/code/game/machinery/washing_machine.dm +++ b/code/game/machinery/washing_machine.dm @@ -269,7 +269,7 @@ GLOBAL_LIST_INIT(dye_registry, list( new /obj/item/restraints/handcuffs(loc) ..() -/obj/machinery/washing_machine/relaymove(mob/user) +/obj/machinery/washing_machine/relaymove(mob/living/user, direction) container_resist_act(user) /obj/machinery/washing_machine/container_resist_act(mob/living/user) diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index 378c8905c4e..582b218e587 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -570,7 +570,7 @@ return FALSE -/obj/mecha/relaymove(mob/user,direction) +/obj/mecha/relaymove(mob/living/user, direction) if(completely_disabled) return if(!direction) diff --git a/code/game/objects/items/devices/chameleonproj.dm b/code/game/objects/items/devices/chameleonproj.dm index 632019f5608..91742f60e5e 100644 --- a/code/game/objects/items/devices/chameleonproj.dm +++ b/code/game/objects/items/devices/chameleonproj.dm @@ -154,7 +154,7 @@ . = ..() master.disrupt() -/obj/effect/dummy/chameleon/relaymove(mob/user, direction) +/obj/effect/dummy/chameleon/relaymove(mob/living/user, direction) if(isspaceturf(loc) || !direction) return //No magical space movement! diff --git a/code/game/objects/items/handcuffs.dm b/code/game/objects/items/handcuffs.dm index d317655de4f..7eaa638fc14 100644 --- a/code/game/objects/items/handcuffs.dm +++ b/code/game/objects/items/handcuffs.dm @@ -57,12 +57,12 @@ M.retaliate(user) if(!C.handcuffed) - if(C.get_num_arms(FALSE) >= 2 || C.get_arm_ignore()) + if(C.canBeHandcuffed()) C.visible_message("[user] is trying to put [src.name] on [C]!", \ "[user] is trying to put [src.name] on you!") playsound(loc, cuffsound, 30, TRUE, -2) - if(do_mob(user, C, 30) && (C.get_num_arms(FALSE) >= 2 || C.get_arm_ignore())) + if(do_mob(user, C, 30) && C.canBeHandcuffed()) if(iscyborg(user)) apply_cuffs(C, user, TRUE) else @@ -269,7 +269,7 @@ var/mob/living/carbon/C = L if(C.mobility_flags & MOBILITY_STAND) def_zone = pick(BODY_ZONE_L_LEG, BODY_ZONE_R_LEG) - if(!C.legcuffed && C.get_num_legs(FALSE) >= 2) //beartrap can't cuff your leg if there's already a beartrap or legcuffs, or you don't have two legs. + if(!C.legcuffed && C.num_legs >= 2) //beartrap can't cuff your leg if there's already a beartrap or legcuffs, or you don't have two legs. C.legcuffed = src forceMove(C) C.update_equipment_speed_mods() @@ -339,7 +339,7 @@ * * C - the carbon that we will try to ensnare */ /obj/item/restraints/legcuffs/bola/proc/ensnare(mob/living/carbon/C) - if(!C.legcuffed && C.get_num_legs(FALSE) >= 2) + if(!C.legcuffed && C.num_legs >= 2) visible_message("\The [src] ensnares [C]!") C.legcuffed = src forceMove(C) diff --git a/code/game/objects/items/his_grace.dm b/code/game/objects/items/his_grace.dm index 013bc28210f..c72ce45e969 100644 --- a/code/game/objects/items/his_grace.dm +++ b/code/game/objects/items/his_grace.dm @@ -70,7 +70,7 @@ else . += "[src] is latched closed." -/obj/item/his_grace/relaymove(mob/living/user) //Allows changelings, etc. to climb out of Him after they revive, provided He isn't active +/obj/item/his_grace/relaymove(mob/living/user, direction) //Allows changelings, etc. to climb out of Him after they revive, provided He isn't active if(!awakened) user.forceMove(get_turf(src)) user.visible_message("[user] scrambles out of [src]!", "You climb out of [src]!") diff --git a/code/game/objects/items/holy_weapons.dm b/code/game/objects/items/holy_weapons.dm index 7670723de5d..6e02c864be1 100644 --- a/code/game/objects/items/holy_weapons.dm +++ b/code/game/objects/items/holy_weapons.dm @@ -463,7 +463,7 @@ hitsound = 'sound/weapons/rapierhit.ogg' var/possessed = FALSE -/obj/item/nullrod/scythe/talking/relaymove(mob/user) +/obj/item/nullrod/scythe/talking/relaymove(mob/living/user, direction) return //stops buckled message spam for the ghost. /obj/item/nullrod/scythe/talking/attack_self(mob/living/user) diff --git a/code/game/objects/items/hot_potato.dm b/code/game/objects/items/hot_potato.dm index 3893cc997b4..ac238a85a33 100644 --- a/code/game/objects/items/hot_potato.dm +++ b/code/game/objects/items/hot_potato.dm @@ -103,7 +103,7 @@ return FALSE if(!victim.client) to_chat(user, "[src] refuses to attach to a non-sapient creature!") - if(victim.stat != CONSCIOUS || !victim.get_num_legs()) + if(victim.stat != CONSCIOUS || !victim.usable_legs) to_chat(user, "[src] refuses to attach to someone incapable of using it!") user.temporarilyRemoveItemFromInventory(src, TRUE) . = FALSE diff --git a/code/game/objects/items/implants/implantchair.dm b/code/game/objects/items/implants/implantchair.dm index 7f6454e66e7..193049d998a 100644 --- a/code/game/objects/items/implants/implantchair.dm +++ b/code/game/objects/items/implants/implantchair.dm @@ -134,7 +134,7 @@ "You successfully break out of [src]!") open_machine() -/obj/machinery/implantchair/relaymove(mob/user) +/obj/machinery/implantchair/relaymove(mob/living/user, direction) if(message_cooldown <= world.time) message_cooldown = world.time + 50 to_chat(user, "[src]'s door won't budge!") diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm index ae60dde1cae..3eb02423395 100644 --- a/code/game/objects/structures/crates_lockers/closets.dm +++ b/code/game/objects/structures/crates_lockers/closets.dm @@ -343,8 +343,8 @@ O.forceMove(T) return 1 -/obj/structure/closet/relaymove(mob/user) - if(user.stat || !isturf(loc) || !isliving(user)) +/obj/structure/closet/relaymove(mob/living/user, direction) + if(user.stat || !isturf(loc)) return if(locked) if(message_cooldown <= world.time) diff --git a/code/game/objects/structures/crates_lockers/closets/cardboardbox.dm b/code/game/objects/structures/crates_lockers/closets/cardboardbox.dm index 166ea7c6f99..b6a80ee5197 100644 --- a/code/game/objects/structures/crates_lockers/closets/cardboardbox.dm +++ b/code/game/objects/structures/crates_lockers/closets/cardboardbox.dm @@ -21,7 +21,7 @@ var/egged = 0 /obj/structure/closet/cardboard/relaymove(mob/living/user, direction) - if(!istype(user) || opened || move_delay || user.incapacitated() || !isturf(loc) || !has_gravity(loc)) + if(opened || move_delay || user.incapacitated() || !isturf(loc) || !has_gravity(loc)) return move_delay = TRUE var/oldloc = loc diff --git a/code/game/objects/structures/morgue.dm b/code/game/objects/structures/morgue.dm index b76a67407b4..73e23b958ea 100644 --- a/code/game/objects/structures/morgue.dm +++ b/code/game/objects/structures/morgue.dm @@ -48,7 +48,7 @@ GLOBAL_LIST_EMPTY(bodycontainers) //Let them act as spawnpoints for revenants an /obj/structure/bodycontainer/update_icon() return -/obj/structure/bodycontainer/relaymove(mob/user) +/obj/structure/bodycontainer/relaymove(mob/living/user, direction) if(user.stat || !isturf(loc)) return if(locked) diff --git a/code/game/objects/structures/tables_racks.dm b/code/game/objects/structures/tables_racks.dm index cf1d02b40b8..d57f8388d18 100644 --- a/code/game/objects/structures/tables_racks.dm +++ b/code/game/objects/structures/tables_racks.dm @@ -632,7 +632,7 @@ . = ..() if(.) return - if(!(user.mobility_flags & MOBILITY_STAND) || user.get_num_legs() < 2) + if(!(user.mobility_flags & MOBILITY_STAND) || user.usable_legs < 2) return user.changeNext_move(CLICK_CD_MELEE) user.do_attack_animation(src, ATTACK_EFFECT_KICK) diff --git a/code/game/objects/structures/transit_tubes/transit_tube_pod.dm b/code/game/objects/structures/transit_tubes/transit_tube_pod.dm index c923312f336..177ad9cc124 100644 --- a/code/game/objects/structures/transit_tubes/transit_tube_pod.dm +++ b/code/game/objects/structures/transit_tubes/transit_tube_pod.dm @@ -178,28 +178,33 @@ /obj/structure/transit_tube_pod/remove_air(amount) return air_contents.remove(amount) -/obj/structure/transit_tube_pod/relaymove(mob/mob, direction) - if(istype(mob) && mob.client) - if(!moving) - for(var/obj/structure/transit_tube/station/station in loc) - if(!station.pod_moving) - if(direction == turn(station.boarding_dir,180)) - if(station.open_status == STATION_TUBE_OPEN) - mob.forceMove(loc) - update_icon() - else - station.open_animation() - else if(direction in station.tube_dirs) - setDir(direction) - station.launch_pod() - return +/obj/structure/transit_tube_pod/relaymove(mob/living/user, direction) + if(!user.client || moving) + return + + for(var/obj/structure/transit_tube/station/station in loc) + if(station.pod_moving) + return + if(direction == turn(station.boarding_dir,180)) + if(station.open_status == STATION_TUBE_OPEN) + user.forceMove(loc) + update_icon() + else + station.open_animation() + else if(direction in station.tube_dirs) + setDir(direction) + station.launch_pod() + return + + for(var/obj/structure/transit_tube/transit_tube in loc) + if(!(dir in transit_tube.tube_dirs)) + continue + if(!transit_tube.has_exit(direction)) + continue + setDir(direction) + return - for(var/obj/structure/transit_tube/TT in loc) - if(dir in TT.tube_dirs) - if(TT.has_exit(direction)) - setDir(direction) - return /obj/structure/transit_tube_pod/return_temperature() return air_contents.temperature diff --git a/code/game/turfs/closed/walls.dm b/code/game/turfs/closed/walls.dm index 34697e750b4..68142b1f50d 100644 --- a/code/game/turfs/closed/walls.dm +++ b/code/game/turfs/closed/walls.dm @@ -136,7 +136,7 @@ var/obj/item/bodypart/arm = user.hand_bodyparts[user.active_hand_index] if(!arm) return - if(arm.disabled) + if(arm.bodypart_disabled) return if(prob(hardness)) playsound(src, 'sound/effects/meteorimpact.ogg', 100, TRUE) diff --git a/code/modules/antagonists/abductor/equipment/abduction_gear.dm b/code/modules/antagonists/abductor/equipment/abduction_gear.dm index f373bf939bb..2b3050343c1 100644 --- a/code/modules/antagonists/abductor/equipment/abduction_gear.dm +++ b/code/modules/antagonists/abductor/equipment/abduction_gear.dm @@ -585,11 +585,11 @@ Congratulations! You are now trained for invasive xenobiology research!"} return var/mob/living/carbon/C = L if(!C.handcuffed) - if(C.get_num_arms(FALSE) >= 2 || C.get_arm_ignore()) + if(C.canBeHandcuffed()) playsound(src, 'sound/weapons/cablecuff.ogg', 30, TRUE, -2) C.visible_message("[user] begins restraining [C] with [src]!", \ "[user] begins shaping an energy field around your hands!") - if(do_mob(user, C, time_to_cuff) && (C.get_num_arms(FALSE) >= 2 || C.get_arm_ignore())) + if(do_mob(user, C, time_to_cuff) && C.canBeHandcuffed()) if(!C.handcuffed) C.handcuffed = new /obj/item/restraints/handcuffs/energy/used(C) C.update_handcuffed() diff --git a/code/modules/antagonists/abductor/machinery/experiment.dm b/code/modules/antagonists/abductor/machinery/experiment.dm index 100c186ff20..d3f5baeaa5c 100644 --- a/code/modules/antagonists/abductor/machinery/experiment.dm +++ b/code/modules/antagonists/abductor/machinery/experiment.dm @@ -34,7 +34,7 @@ if(state_open && !panel_open) ..(target) -/obj/machinery/abductor/experiment/relaymove(mob/user) +/obj/machinery/abductor/experiment/relaymove(mob/living/user, direction) if(user.stat != CONSCIOUS) return if(message_cooldown <= world.time) diff --git a/code/modules/antagonists/cult/blood_magic.dm b/code/modules/antagonists/cult/blood_magic.dm index f56baeb3902..20b752b924f 100644 --- a/code/modules/antagonists/cult/blood_magic.dm +++ b/code/modules/antagonists/cult/blood_magic.dm @@ -511,7 +511,7 @@ /obj/item/melee/blood_magic/shackles/afterattack(atom/target, mob/living/carbon/user, proximity) if(iscultist(user) && iscarbon(target) && proximity) var/mob/living/carbon/C = target - if(C.get_num_arms(FALSE) >= 2 || C.get_arm_ignore()) + if(C.canBeHandcuffed()) CuffAttack(C, user) else user.visible_message("This victim doesn't have enough arms to complete the restraint!") diff --git a/code/modules/antagonists/devil/true_devil/_true_devil.dm b/code/modules/antagonists/devil/true_devil/_true_devil.dm index a15097096e0..a937c9c39de 100644 --- a/code/modules/antagonists/devil/true_devil/_true_devil.dm +++ b/code/modules/antagonists/devil/true_devil/_true_devil.dm @@ -18,8 +18,14 @@ status_flags = CANPUSH mob_size = MOB_SIZE_LARGE held_items = list(null, null) - bodyparts = list(/obj/item/bodypart/chest/devil, /obj/item/bodypart/head/devil, /obj/item/bodypart/l_arm/devil, - /obj/item/bodypart/r_arm/devil, /obj/item/bodypart/r_leg/devil, /obj/item/bodypart/l_leg/devil) + bodyparts = list( + /obj/item/bodypart/chest/devil, + /obj/item/bodypart/head/devil, + /obj/item/bodypart/l_arm/devil, + /obj/item/bodypart/r_arm/devil, + /obj/item/bodypart/r_leg/devil, + /obj/item/bodypart/l_leg/devil, + ) hud_type = /datum/hud/devil var/ascended = FALSE var/mob/living/oldform diff --git a/code/modules/antagonists/eldritch_cult/eldritch_magic.dm b/code/modules/antagonists/eldritch_cult/eldritch_magic.dm index f6cdbbc9ebf..ebcd4d8a290 100644 --- a/code/modules/antagonists/eldritch_cult/eldritch_magic.dm +++ b/code/modules/antagonists/eldritch_cult/eldritch_magic.dm @@ -132,27 +132,28 @@ if(tar.anti_magic_check()) tar.visible_message("Spell bounces off of [target]!","The spell bounces off of you!") return ..() - var/mob/living/carbon/C2 = user + var/mob/living/carbon/carbon_user = user if(isliving(target)) - var/mob/living/L = target - L.adjustBruteLoss(20) - C2.adjustBruteLoss(-20) + var/mob/living/living_target = target + living_target.adjustBruteLoss(20) + carbon_user.adjustBruteLoss(-20) if(iscarbon(target)) - var/mob/living/carbon/C1 = target - for(var/obj/item/bodypart/bodypart in C2.bodyparts) + var/mob/living/carbon/carbon_target = target + for(var/bp in carbon_user.bodyparts) + var/obj/item/bodypart/bodypart = bp for(var/i in bodypart.wounds) var/datum/wound/iter_wound = i if(prob(50)) continue - var/obj/item/bodypart/target_bodypart = locate(bodypart.type) in C1.bodyparts + var/obj/item/bodypart/target_bodypart = locate(bodypart.type) in carbon_target.bodyparts if(!target_bodypart) continue iter_wound.remove_wound() iter_wound.apply_wound(target_bodypart) - C1.blood_volume -= 20 - if(C2.blood_volume < BLOOD_VOLUME_MAXIMUM) //we dont want to explode after all - C2.blood_volume += 20 + carbon_target.blood_volume -= 20 + if(carbon_user.blood_volume < BLOOD_VOLUME_MAXIMUM) //we dont want to explode after all + carbon_user.blood_volume += 20 return ..() /obj/effect/proc_holder/spell/targeted/projectile/dumbfire/rust_wave diff --git a/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm b/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm index e7c34ac9652..725df459b87 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm @@ -278,7 +278,7 @@ if(air1.temperature > 2000) take_damage(clamp((air1.temperature)/200, 10, 20), BURN) -/obj/machinery/atmospherics/components/unary/cryo_cell/relaymove(mob/user) +/obj/machinery/atmospherics/components/unary/cryo_cell/relaymove(mob/living/user, direction) if(message_cooldown <= world.time) message_cooldown = world.time + 50 to_chat(user, "[src]'s door won't budge!") diff --git a/code/modules/atmospherics/machinery/pipes/layermanifold.dm b/code/modules/atmospherics/machinery/pipes/layermanifold.dm index c16c99d0865..b1592dcaeb9 100644 --- a/code/modules/atmospherics/machinery/pipes/layermanifold.dm +++ b/code/modules/atmospherics/machinery/pipes/layermanifold.dm @@ -120,12 +120,12 @@ back_nodes[i] = null update_icon() -/obj/machinery/atmospherics/pipe/layer_manifold/relaymove(mob/living/user, dir) - if(initialize_directions & dir) +/obj/machinery/atmospherics/pipe/layer_manifold/relaymove(mob/living/user, direction) + if(initialize_directions & direction) return ..() - if((NORTH|EAST) & dir) + if((NORTH|EAST) & direction) user.ventcrawl_layer = clamp(user.ventcrawl_layer + 1, PIPING_LAYER_MIN, PIPING_LAYER_MAX) - if((SOUTH|WEST) & dir) + if((SOUTH|WEST) & direction) user.ventcrawl_layer = clamp(user.ventcrawl_layer - 1, PIPING_LAYER_MIN, PIPING_LAYER_MAX) to_chat(user, "You align yourself with the [user.ventcrawl_layer]\th output.") diff --git a/code/modules/clothing/head/jobs.dm b/code/modules/clothing/head/jobs.dm index 21b4609a479..b04fd4cbc2d 100644 --- a/code/modules/clothing/head/jobs.dm +++ b/code/modules/clothing/head/jobs.dm @@ -31,7 +31,7 @@ playsound(user, 'sound/machines/ding.ogg', 50, TRUE) return(FIRELOSS) -/obj/item/clothing/head/chefhat/relaymove(mob/user, direction) +/obj/item/clothing/head/chefhat/relaymove(mob/living/user, direction) if(!istype(user, /mob/living/simple_animal/mouse) || !isliving(loc) || !prob(mouse_control_probability)) return var/mob/living/L = loc diff --git a/code/modules/clothing/spacesuits/chronosuit.dm b/code/modules/clothing/spacesuits/chronosuit.dm index 97e33e668bf..4a612f9041e 100644 --- a/code/modules/clothing/spacesuits/chronosuit.dm +++ b/code/modules/clothing/spacesuits/chronosuit.dm @@ -271,7 +271,7 @@ if(target_ui) QDEL_NULL(target_ui) -/obj/effect/chronos_cam/relaymove(mob/user, direction) +/obj/effect/chronos_cam/relaymove(mob/living/user, direction) if(!holder) qdel(src) return diff --git a/code/modules/food_and_drinks/kitchen_machinery/gibber.dm b/code/modules/food_and_drinks/kitchen_machinery/gibber.dm index 7ce6592bb9a..62e17b9020e 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/gibber.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/gibber.dm @@ -57,7 +57,7 @@ /obj/machinery/gibber/container_resist_act(mob/living/user) go_out() -/obj/machinery/gibber/relaymove(mob/living/user) +/obj/machinery/gibber/relaymove(mob/living/user, direction) go_out() /obj/machinery/gibber/attack_hand(mob/user) diff --git a/code/modules/library/skill_learning/skill_station.dm b/code/modules/library/skill_learning/skill_station.dm index 4dda9f6f465..b61842784f3 100644 --- a/code/modules/library/skill_learning/skill_station.dm +++ b/code/modules/library/skill_learning/skill_station.dm @@ -44,7 +44,7 @@ if(working) . += "working" -/obj/machinery/skill_station/relaymove(mob/user) +/obj/machinery/skill_station/relaymove(mob/living/user, direction) open_machine() /obj/machinery/skill_station/open_machine() diff --git a/code/modules/mining/aux_base_camera.dm b/code/modules/mining/aux_base_camera.dm index 9583918c6c2..2668becd1eb 100644 --- a/code/modules/mining/aux_base_camera.dm +++ b/code/modules/mining/aux_base_camera.dm @@ -16,9 +16,11 @@ return ..() //While players are only allowed to build in the base area, but consoles starting outside the base can move into the base area to begin work. -/mob/camera/ai_eye/remote/base_construction/relaymove(mob/user, direct) - dir = direct //This camera eye is visible as a drone, and needs to keep the dir updated - ..() + +/mob/camera/ai_eye/remote/base_construction/relaymove(mob/living/user, direction) + dir = direction //This camera eye is visible as a drone, and needs to keep the dir updated + return ..() + /obj/item/construction/rcd/internal //Base console's internal RCD. Roundstart consoles are filled, rebuilt cosoles start empty. name = "internal RCD" diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm index 8779d97648e..05a4dec912a 100644 --- a/code/modules/mob/inventory.dm +++ b/code/modules/mob/inventory.dm @@ -473,7 +473,7 @@ var/obj/item/bodypart/BP = new path () BP.owner = src BP.held_index = i - bodyparts += BP + add_bodypart(BP) hand_bodyparts[i] = BP ..() //Don't redraw hands until we have organs for them diff --git a/code/modules/mob/living/bloodcrawl.dm b/code/modules/mob/living/bloodcrawl.dm index 9d61a9039e0..c09fef670ad 100644 --- a/code/modules/mob/living/bloodcrawl.dm +++ b/code/modules/mob/living/bloodcrawl.dm @@ -8,7 +8,7 @@ resistance_flags = LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF var/canmove = TRUE -/obj/effect/dummy/phased_mob/slaughter/relaymove(mob/user, direction) +/obj/effect/dummy/phased_mob/slaughter/relaymove(mob/living/user, direction) forceMove(get_step(src,direction)) /obj/effect/dummy/phased_mob/slaughter/ex_act() diff --git a/code/modules/mob/living/brain/MMI.dm b/code/modules/mob/living/brain/MMI.dm index 6798f7c650a..9b3d62f61cd 100644 --- a/code/modules/mob/living/brain/MMI.dm +++ b/code/modules/mob/living/brain/MMI.dm @@ -219,7 +219,7 @@ else . += "\The [src] indicates that the brain is active." -/obj/item/mmi/relaymove(mob/user) +/obj/item/mmi/relaymove(mob/living/user, direction) return //so that the MMI won't get a warning about not being able to move if it tries to move /obj/item/mmi/proc/brain_check(mob/user) diff --git a/code/modules/mob/living/carbon/alien/alien.dm b/code/modules/mob/living/carbon/alien/alien.dm index d79036b57b9..4deaa1ee8f6 100644 --- a/code/modules/mob/living/carbon/alien/alien.dm +++ b/code/modules/mob/living/carbon/alien/alien.dm @@ -114,7 +114,9 @@ Des: Removes all infected images from the alien. return /mob/living/carbon/alien/canBeHandcuffed() - return 1 + if(num_hands < 2) + return FALSE + return TRUE /mob/living/carbon/alien/get_standard_pixel_y_offset(lying = 0) return initial(pixel_y) diff --git a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm index 25a1b2b2613..e6fe7f1346a 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm @@ -18,8 +18,14 @@ var/sneaking = 0 //For sneaky-sneaky mode and appropriate slowdown var/drooling = 0 //For Neruotoxic spit overlays deathsound = 'sound/voice/hiss6.ogg' - bodyparts = list(/obj/item/bodypart/chest/alien, /obj/item/bodypart/head/alien, /obj/item/bodypart/l_arm/alien, - /obj/item/bodypart/r_arm/alien, /obj/item/bodypart/r_leg/alien, /obj/item/bodypart/l_leg/alien) + bodyparts = list( + /obj/item/bodypart/chest/alien, + /obj/item/bodypart/head/alien, + /obj/item/bodypart/l_arm/alien, + /obj/item/bodypart/r_arm/alien, + /obj/item/bodypart/r_leg/alien, + /obj/item/bodypart/l_leg/alien, + ) /mob/living/carbon/alien/humanoid/Initialize() . = ..() diff --git a/code/modules/mob/living/carbon/alien/larva/larva.dm b/code/modules/mob/living/carbon/alien/larva/larva.dm index bd21aa06291..de5eafc5b28 100644 --- a/code/modules/mob/living/carbon/alien/larva/larva.dm +++ b/code/modules/mob/living/carbon/alien/larva/larva.dm @@ -11,13 +11,22 @@ health = 25 hardcrit_threshold = HEALTH_THRESHOLD_CRIT + rotate_on_lying = FALSE + + default_num_legs = 1 + num_legs = 1 //Alien larvas always have a movable apendage. + usable_legs = 1 //Alien larvas always have a movable apendage. + default_num_hands = 0 + + bodyparts = list( + /obj/item/bodypart/chest/larva, + /obj/item/bodypart/head/larva, + ) + var/amount_grown = 0 var/max_grown = 100 var/time_of_birth - rotate_on_lying = 0 - bodyparts = list(/obj/item/bodypart/chest/larva, /obj/item/bodypart/head/larva) - //This is fine right now, if we're adding organ specific damage this needs to be updated /mob/living/carbon/alien/larva/Initialize() @@ -74,3 +83,7 @@ /mob/living/carbon/alien/larva/stripPanelEquip(obj/item/what, mob/who) to_chat(src, "You don't have the dexterity to do this!") return + + +/mob/living/carbon/alien/larva/canBeHandcuffed() + return TRUE diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 962aba1073c..b0f0e6363ac 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -172,8 +172,9 @@ /mob/living/carbon/restrained(ignore_grab) . = (handcuffed || (!ignore_grab && pulledby && pulledby.grab_state >= GRAB_AGGRESSIVE)) + /mob/living/carbon/proc/canBeHandcuffed() - return 0 + return FALSE /mob/living/carbon/show_inv(mob/user) @@ -933,22 +934,55 @@ /mob/living/carbon/fakefireextinguish() remove_overlay(FIRE_LAYER) + /mob/living/carbon/proc/create_bodyparts() var/l_arm_index_next = -1 var/r_arm_index_next = 0 - for(var/X in bodyparts) - var/obj/item/bodypart/O = new X() - O.owner = src - bodyparts.Remove(X) - bodyparts.Add(O) - if(O.body_part == ARM_LEFT) - l_arm_index_next += 2 - O.held_index = l_arm_index_next //1, 3, 5, 7... - hand_bodyparts += O - else if(O.body_part == ARM_RIGHT) - r_arm_index_next += 2 - O.held_index = r_arm_index_next //2, 4, 6, 8... - hand_bodyparts += O + for(var/bodypart_path in bodyparts) + var/obj/item/bodypart/bodypart_instance = new bodypart_path() + bodypart_instance.owner = src + bodyparts.Remove(bodypart_path) + add_bodypart(bodypart_instance) + switch(bodypart_instance.body_part) + if(ARM_LEFT) + l_arm_index_next += 2 + bodypart_instance.held_index = l_arm_index_next //1, 3, 5, 7... + hand_bodyparts += bodypart_instance + if(ARM_RIGHT) + r_arm_index_next += 2 + bodypart_instance.held_index = r_arm_index_next //2, 4, 6, 8... + hand_bodyparts += bodypart_instance + + +///Proc to hook behavior on bodypart additions. +/mob/living/carbon/proc/add_bodypart(obj/item/bodypart/new_bodypart) + bodyparts += new_bodypart + + switch(new_bodypart.body_part) + if(LEG_LEFT, LEG_RIGHT) + set_num_legs(num_legs + 1) + if(!new_bodypart.bodypart_disabled) + set_usable_legs(usable_legs + 1) + if(ARM_LEFT, ARM_RIGHT) + set_num_hands(num_hands + 1) + if(!new_bodypart.bodypart_disabled) + set_usable_hands(usable_hands + 1) + + +///Proc to hook behavior on bodypart removals. +/mob/living/carbon/proc/remove_bodypart(obj/item/bodypart/old_bodypart) + bodyparts -= old_bodypart + + switch(old_bodypart.body_part) + if(LEG_LEFT, LEG_RIGHT) + set_num_legs(num_legs - 1) + if(!old_bodypart.bodypart_disabled) + set_usable_legs(usable_legs - 1) + if(ARM_LEFT, ARM_RIGHT) + set_num_hands(num_hands - 1) + if(!old_bodypart.bodypart_disabled) + set_usable_hands(usable_hands - 1) + /mob/living/carbon/do_after_coefficent() . = ..() diff --git a/code/modules/mob/living/carbon/carbon_defines.dm b/code/modules/mob/living/carbon/carbon_defines.dm index 7385403352e..a877729c0cb 100644 --- a/code/modules/mob/living/carbon/carbon_defines.dm +++ b/code/modules/mob/living/carbon/carbon_defines.dm @@ -6,6 +6,10 @@ hud_possible = list(HEALTH_HUD,STATUS_HUD,ANTAG_HUD,GLAND_HUD,NANITE_HUD,DIAG_NANITE_FULL_HUD) has_limbs = 1 held_items = list(null, null) + num_legs = 0 //Populated on init through list/bodyparts + usable_legs = 0 //Populated on init through list/bodyparts + num_hands = 0 //Populated on init through list/bodyparts + usable_hands = 0 //Populated on init through list/bodyparts var/list/internal_organs = list() ///List of [/obj/item/organ] in the mob. They don't go in the contents for some reason I don't want to know. var/list/internal_organs_slot= list() ///Same as [above][/mob/living/carbon/var/internal_organs], but stores "slot ID" - "organ" pairs for easy access. var/silent = 0 ///Can't talk. Value goes down every life proc. NOTE TO FUTURE CODERS: DO NOT INITIALIZE NUMERICAL VARS AS NULL OR I WILL MURDER YOU. @@ -44,8 +48,14 @@ var/tinttotal = 0 /// Total level of visualy impairing items ///Gets filled up in [create_bodyparts()][/mob/living/carbon/proc/create_bodyparts] - var/list/bodyparts = list(/obj/item/bodypart/chest, /obj/item/bodypart/head, /obj/item/bodypart/l_arm, - /obj/item/bodypart/r_arm, /obj/item/bodypart/r_leg, /obj/item/bodypart/l_leg) + var/list/bodyparts = list( + /obj/item/bodypart/chest, + /obj/item/bodypart/head, + /obj/item/bodypart/l_arm, + /obj/item/bodypart/r_arm, + /obj/item/bodypart/r_leg, + /obj/item/bodypart/l_leg, + ) var/list/hand_bodyparts = list() ///a collection of arms (or actually whatever the fug /bodyparts you monsters use to wreck my systems) diff --git a/code/modules/mob/living/carbon/carbon_movement.dm b/code/modules/mob/living/carbon/carbon_movement.dm index a7a683a764e..18b18009bda 100644 --- a/code/modules/mob/living/carbon/carbon_movement.dm +++ b/code/modules/mob/living/carbon/carbon_movement.dm @@ -30,3 +30,43 @@ adjust_nutrition(-(HUNGER_FACTOR/10)) if(m_intent == MOVE_INTENT_RUN) adjust_nutrition(-(HUNGER_FACTOR/10)) + + +/mob/living/carbon/set_usable_legs(new_value) + . = ..() + if(isnull(.)) + return + if(. == 0) + if(usable_legs != 0) //From having no usable legs to having some. + REMOVE_TRAIT(src, TRAIT_FLOORED, LACKING_LOCOMOTION_APPENDAGES_TRAIT) + REMOVE_TRAIT(src, TRAIT_IMMOBILIZED, LACKING_LOCOMOTION_APPENDAGES_TRAIT) + else if(usable_legs == 0 && !(movement_type & (FLYING | FLOATING))) //From having usable legs to no longer having them. + ADD_TRAIT(src, TRAIT_FLOORED, LACKING_LOCOMOTION_APPENDAGES_TRAIT) + if(!usable_hands) + ADD_TRAIT(src, TRAIT_IMMOBILIZED, LACKING_LOCOMOTION_APPENDAGES_TRAIT) + + +/mob/living/carbon/set_usable_hands(new_value) + . = ..() + if(isnull(.)) + return + if(. == 0) + if(usable_hands != 0) //From having no usable hands to having some. + REMOVE_TRAIT(src, TRAIT_IMMOBILIZED, LACKING_LOCOMOTION_APPENDAGES_TRAIT) + else if(usable_hands == 0) //From having usable hands to no longer having them. + if(!usable_legs && !(movement_type & (FLYING | FLOATING))) + ADD_TRAIT(src, TRAIT_IMMOBILIZED, LACKING_LOCOMOTION_APPENDAGES_TRAIT) + + +/mob/living/carbon/setMovetype(newval) + . = ..() + if(isnull(.)) + return + if(. & !(FLYING | FLOATING)) + if(movement_type & (FLYING | FLOATING)) //From not flying to flying. + REMOVE_TRAIT(src, TRAIT_FLOORED, LACKING_LOCOMOTION_APPENDAGES_TRAIT) + REMOVE_TRAIT(src, TRAIT_IMMOBILIZED, LACKING_LOCOMOTION_APPENDAGES_TRAIT) + else if(!(movement_type & (FLYING | FLOATING)) && !usable_legs) //From flying to no longer flying. + ADD_TRAIT(src, TRAIT_FLOORED, LACKING_LOCOMOTION_APPENDAGES_TRAIT) + if(!usable_hands) + ADD_TRAIT(src, TRAIT_IMMOBILIZED, LACKING_LOCOMOTION_APPENDAGES_TRAIT) diff --git a/code/modules/mob/living/carbon/emote.dm b/code/modules/mob/living/carbon/emote.dm index 408c4bbf124..464e47a22a6 100644 --- a/code/modules/mob/living/carbon/emote.dm +++ b/code/modules/mob/living/carbon/emote.dm @@ -42,7 +42,7 @@ cooldown = 6 SECONDS /datum/emote/living/carbon/crack/can_run_emote(mob/living/carbon/user, status_check = TRUE , intentional) - if(user.get_num_arms() <= 1) + if(user.usable_hands < 2) return FALSE return ..() diff --git a/code/modules/mob/living/carbon/examine.dm b/code/modules/mob/living/carbon/examine.dm index b6d8bb0cd0a..a0ed1a43504 100644 --- a/code/modules/mob/living/carbon/examine.dm +++ b/code/modules/mob/living/carbon/examine.dm @@ -37,7 +37,7 @@ var/list/disabled = list() for(var/X in bodyparts) var/obj/item/bodypart/BP = X - if(BP.disabled) + if(BP.bodypart_disabled) disabled += BP missing -= BP.body_zone for(var/obj/item/I in BP.embedded_objects) diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index 73de1719463..09aa0abee62 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -51,9 +51,8 @@ if(gloves && !(ITEM_SLOT_GLOVES in obscured)) . += "[t_He] [t_has] [gloves.get_examine_string(user)] on [t_his] hands." else if(FR && length(FR.blood_DNA)) - var/hand_number = get_num_arms(FALSE) - if(hand_number) - . += "[t_He] [t_has] [hand_number > 1 ? "" : "a"] blood-stained hand[hand_number > 1 ? "s" : ""]!" + if(num_hands) + . += "[t_He] [t_has] [num_hands > 1 ? "" : "a"] blood-stained hand[num_hands > 1 ? "s" : ""]!" //handcuffed? @@ -142,7 +141,7 @@ var/list/disabled = list() for(var/X in bodyparts) var/obj/item/bodypart/BP = X - if(BP.disabled) + if(BP.bodypart_disabled) disabled += BP missing -= BP.body_zone for(var/obj/item/I in BP.embedded_objects) diff --git a/code/modules/mob/living/carbon/human/human_helpers.dm b/code/modules/mob/living/carbon/human/human_helpers.dm index ba46c3d124f..62237843e99 100644 --- a/code/modules/mob/living/carbon/human/human_helpers.dm +++ b/code/modules/mob/living/carbon/human/human_helpers.dm @@ -4,10 +4,10 @@ /mob/living/carbon/human/canBeHandcuffed() - if(get_num_arms(FALSE) >= 2) - return TRUE - else + if(num_hands < 2) return FALSE + return TRUE + //gets assignment from ID or ID inside PDA or PDA itself //Useful when player do something with computers diff --git a/code/modules/mob/living/carbon/human/human_update_icons.dm b/code/modules/mob/living/carbon/human/human_update_icons.dm index fe32c33cf0a..194766acdca 100644 --- a/code/modules/mob/living/carbon/human/human_update_icons.dm +++ b/code/modules/mob/living/carbon/human/human_update_icons.dm @@ -175,7 +175,7 @@ There are several things that need to be remembered: if(!gloves && blood_in_hands) var/mutable_appearance/bloody_overlay = mutable_appearance('icons/effects/blood.dmi', "bloodyhands", -GLOVES_LAYER) - if(get_num_arms(FALSE) < 2) + if(num_hands < 2) if(has_left_hand(FALSE)) bloody_overlay.icon_state = "bloodyhands_left" else if(has_right_hand(FALSE)) @@ -255,7 +255,7 @@ There are several things that need to be remembered: /mob/living/carbon/human/update_inv_shoes() remove_overlay(SHOES_LAYER) - if(get_num_legs(FALSE) <2) + if(num_legs < 2) return if(client && hud_used) diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index 199ea66505d..df83aea6a9b 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -663,7 +663,7 @@ GLOBAL_LIST_EMPTY(roundstart_races) else standing += mutable_appearance(undershirt.icon, undershirt.icon_state, -BODY_LAYER) - if(H.socks && H.get_num_legs(FALSE) >= 2 && !(DIGITIGRADE in species_traits)) + if(H.socks && H.num_legs >= 2 && !(DIGITIGRADE in species_traits)) var/datum/sprite_accessory/socks/socks = GLOB.socks_list[H.socks] if(socks) standing += mutable_appearance(socks.icon, socks.icon_state, -BODY_LAYER) @@ -920,9 +920,6 @@ GLOBAL_LIST_EMPTY(roundstart_races) if(!I.species_exception || !is_type_in_list(src, I.species_exception)) return FALSE - var/num_arms = H.get_num_arms(FALSE) - var/num_legs = H.get_num_legs(FALSE) - switch(slot) if(ITEM_SLOT_HANDS) if(H.get_empty_held_indexes()) @@ -959,7 +956,7 @@ GLOBAL_LIST_EMPTY(roundstart_races) return FALSE if( !(I.slot_flags & ITEM_SLOT_GLOVES) ) return FALSE - if(num_arms < 2) + if(H.num_hands < 2) return FALSE return equip_delay_self_check(I, H, bypass_equip_delay_self) if(ITEM_SLOT_FEET) @@ -967,7 +964,7 @@ GLOBAL_LIST_EMPTY(roundstart_races) return FALSE if( !(I.slot_flags & ITEM_SLOT_FEET) ) return FALSE - if(num_legs < 2) + if(H.num_legs < 2) return FALSE if(DIGITIGRADE in species_traits) if(!disable_warning) @@ -1086,7 +1083,7 @@ GLOBAL_LIST_EMPTY(roundstart_races) return FALSE if(!istype(I, /obj/item/restraints/handcuffs)) return FALSE - if(num_arms < 2) + if(H.num_hands < 2) return FALSE return TRUE if(ITEM_SLOT_LEGCUFFED) @@ -1094,7 +1091,7 @@ GLOBAL_LIST_EMPTY(roundstart_races) return FALSE if(!istype(I, /obj/item/restraints/legcuffs)) return FALSE - if(num_legs < 2) + if(H.num_legs < 2) return FALSE return TRUE if(ITEM_SLOT_BACKPACK) diff --git a/code/modules/mob/living/carbon/human/species_types/jellypeople.dm b/code/modules/mob/living/carbon/human/species_types/jellypeople.dm index 3d5f5fd34d4..e51f0a1658e 100644 --- a/code/modules/mob/living/carbon/human/species_types/jellypeople.dm +++ b/code/modules/mob/living/carbon/human/species_types/jellypeople.dm @@ -57,7 +57,7 @@ if(!limbs_to_consume.len) H.losebreath++ return - if(H.get_num_legs(FALSE)) //Legs go before arms + if(H.num_legs) //Legs go before arms limbs_to_consume -= list(BODY_ZONE_R_ARM, BODY_ZONE_L_ARM) consumed_limb = H.get_bodypart(pick(limbs_to_consume)) consumed_limb.drop_limb() diff --git a/code/modules/mob/living/carbon/monkey/monkey.dm b/code/modules/mob/living/carbon/monkey/monkey.dm index 85e1cd6fcb0..b7d0e223392 100644 --- a/code/modules/mob/living/carbon/monkey/monkey.dm +++ b/code/modules/mob/living/carbon/monkey/monkey.dm @@ -14,8 +14,14 @@ unique_name = TRUE can_be_shoved_into = TRUE blocks_emissive = EMISSIVE_BLOCK_UNIQUE - bodyparts = list(/obj/item/bodypart/chest/monkey, /obj/item/bodypart/head/monkey, /obj/item/bodypart/l_arm/monkey, - /obj/item/bodypart/r_arm/monkey, /obj/item/bodypart/r_leg/monkey, /obj/item/bodypart/l_leg/monkey) + bodyparts = list( + /obj/item/bodypart/chest/monkey, + /obj/item/bodypart/head/monkey, + /obj/item/bodypart/l_arm/monkey, + /obj/item/bodypart/r_arm/monkey, + /obj/item/bodypart/r_leg/monkey, + /obj/item/bodypart/l_leg/monkey, + ) hud_type = /datum/hud/monkey /mob/living/carbon/monkey/Initialize(mapload, cubespawned=FALSE, mob/spawner) @@ -119,6 +125,8 @@ return FALSE /mob/living/carbon/monkey/canBeHandcuffed() + if(num_hands < 2) + return FALSE return TRUE /mob/living/carbon/monkey/assess_threat(judgement_criteria, lasercolor = "", datum/callback/weaponcheck=null) diff --git a/code/modules/mob/living/emote.dm b/code/modules/mob/living/emote.dm index c5bfae2647d..fc0f1fcaf7c 100644 --- a/code/modules/mob/living/emote.dm +++ b/code/modules/mob/living/emote.dm @@ -246,8 +246,8 @@ message_param = initial(message_param) // reset if(ishuman(user)) var/mob/living/carbon/human/H = user - if(H.get_num_arms() == 0) - if(H.get_num_legs() != 0) + if(H.usable_hands == 0) + if(H.usable_legs != 0) message_param = "tries to point at %t with a leg, falling down in the process!" H.Paralyze(20) else diff --git a/code/modules/mob/living/inhand_holder.dm b/code/modules/mob/living/inhand_holder.dm index c1b608ab46e..f3054ca9af6 100644 --- a/code/modules/mob/living/inhand_holder.dm +++ b/code/modules/mob/living/inhand_holder.dm @@ -66,7 +66,7 @@ qdel(src) return TRUE -/obj/item/clothing/head/mob_holder/relaymove(mob/user) +/obj/item/clothing/head/mob_holder/relaymove(mob/living/user, direction) release() /obj/item/clothing/head/mob_holder/container_resist_act() diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 761a331edca..13d65eac617 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -399,7 +399,7 @@ return TRUE /mob/living/canUseStorage() - if (get_num_arms() <= 0) + if (usable_hands <= 0) return FALSE return TRUE @@ -1191,6 +1191,7 @@ /mob/living/can_be_pulled() return ..() && !(buckled && buckled.buckle_prevents_pull) + //Updates canmove, lying and icons. Could perhaps do with a rename but I can't think of anything to describe it. //Robots, animals and brains have their own version so don't worry about them /mob/living/proc/update_mobility() @@ -1198,16 +1199,13 @@ var/stat_conscious = (stat == CONSCIOUS) || stat_softcrit var/chokehold = pulledby && pulledby.grab_state >= GRAB_NECK var/restrained = restrained() - var/has_legs = get_num_legs() - var/has_arms = get_num_arms() var/paralyzed = IsParalyzed() - var/ignore_legs = get_leg_ignore() - var/canmove = !HAS_TRAIT(src, TRAIT_IMMOBILIZED) && (has_arms || ignore_legs || has_legs) + var/canmove = !HAS_TRAIT(src, TRAIT_IMMOBILIZED) if(canmove) mobility_flags |= MOBILITY_MOVE else mobility_flags &= ~MOBILITY_MOVE - var/canstand_involuntary = !HAS_TRAIT(src, TRAIT_FLOORED) && (ignore_legs || has_legs) + var/canstand_involuntary = !HAS_TRAIT(src, TRAIT_FLOORED) var/canstand = canstand_involuntary && !resting if(buckled && buckled.buckle_lying != -1) @@ -1231,9 +1229,7 @@ else mobility_flags |= MOBILITY_UI|MOBILITY_PULL - - - var/canitem = !paralyzed && !IsStun() && stat_conscious && !chokehold && !restrained && has_arms + var/canitem = !paralyzed && !IsStun() && stat_conscious && !chokehold && !restrained && usable_hands if(canitem) mobility_flags |= (MOBILITY_USE | MOBILITY_PICKUP | MOBILITY_STORAGE) else @@ -1247,18 +1243,21 @@ unset_machine() // Movespeed mods based on arms/legs quantity - if(!get_leg_ignore()) + if(movement_type & (FLYING | FLOATING)) + remove_movespeed_modifier(/datum/movespeed_modifier/limbless) + else var/limbless_slowdown = 0 // These checks for <2 should be swapped out for something else if we ever end up with a species with more than 2 - if(has_legs < 2) - limbless_slowdown += 6 - (has_legs * 3) - if(!has_legs && has_arms < 2) - limbless_slowdown += 6 - (has_arms * 3) + if(usable_legs < default_num_legs) + limbless_slowdown += (default_num_legs * 3) - (usable_legs * 3) + if(!usable_legs && usable_hands < default_num_hands) + limbless_slowdown += (default_num_hands * 3) - (usable_hands * 3) if(limbless_slowdown) add_or_update_variable_movespeed_modifier(/datum/movespeed_modifier/limbless, multiplicative_slowdown = limbless_slowdown) else remove_movespeed_modifier(/datum/movespeed_modifier/limbless) + ///Called when mob changes from a standing position into a prone while lacking the ability to stand up at the moment, through update_mobility() /mob/living/proc/on_fall() return @@ -1702,3 +1701,35 @@ /// Only defined for carbons who can wear masks and helmets, we just assume other mobs have visible faces /mob/living/proc/is_face_visible() return TRUE + + +///Proc to modify the value of num_legs and hook behavior associated to this event. +/mob/living/proc/set_num_legs(new_value) + if(num_legs == new_value) + return + . = num_legs + num_legs = new_value + + +///Proc to modify the value of usable_legs and hook behavior associated to this event. +/mob/living/proc/set_usable_legs(new_value) + if(usable_legs == new_value) + return + . = usable_legs + usable_legs = new_value + + +///Proc to modify the value of num_hands and hook behavior associated to this event. +/mob/living/proc/set_num_hands(new_value) + if(num_hands == new_value) + return + . = num_hands + num_hands = new_value + + +///Proc to modify the value of usable_hands and hook behavior associated to this event. +/mob/living/proc/set_usable_hands(new_value) + if(usable_hands == new_value) + return + . = usable_hands + usable_hands = new_value diff --git a/code/modules/mob/living/living_defines.dm b/code/modules/mob/living/living_defines.dm index 42ddfe20aa2..f1ef55650dc 100644 --- a/code/modules/mob/living/living_defines.dm +++ b/code/modules/mob/living/living_defines.dm @@ -67,6 +67,20 @@ var/metabolism_efficiency = 1 ///more or less efficiency to metabolize helpful/harmful reagents and regulate body temperature.. var/has_limbs = 0 ///does the mob have distinct limbs?(arms,legs, chest,head) + ///How many legs does this mob have by default. This shouldn't change at runtime. + var/default_num_legs = 2 + ///How many legs does this mob currently have. Should only be changed through set_num_legs() + var/num_legs = 2 + ///How many usable legs this mob currently has. Should only be changed through set_usable_legs() + var/usable_legs = 2 + + ///How many hands does this mob have by default. This shouldn't change at runtime. + var/default_num_hands = 2 + ///How many hands hands does this mob currently have. Should only be changed through set_num_hands() + var/num_hands = 2 + ///How many usable hands does this mob currently have. Should only be changed through set_usable_hands() + var/usable_hands = 2 + var/list/pipes_shown = list() var/last_played_vent diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index b0a539fca6d..775910e580c 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -1044,7 +1044,7 @@ if(!do_after(src, 5, target = M)) return if(iscarbon(M) && !M.incapacitated() && !riding_datum.equip_buckle_inhands(M, 1)) - if(M.get_num_arms() <= 0) + if(M.usable_hands == 0) M.visible_message("[M] can't climb onto [src] because [M.p_they()] don't have any usable arms!") else M.visible_message("[M] can't climb onto [src] because [M.p_their()] hands are full!") diff --git a/code/modules/mob/living/simple_animal/bot/mulebot.dm b/code/modules/mob/living/simple_animal/bot/mulebot.dm index a2163d85a10..9074221a63d 100644 --- a/code/modules/mob/living/simple_animal/bot/mulebot.dm +++ b/code/modules/mob/living/simple_animal/bot/mulebot.dm @@ -751,7 +751,7 @@ bloodiness += 4 // player on mulebot attempted to move -/mob/living/simple_animal/bot/mulebot/relaymove(mob/user) +/mob/living/simple_animal/bot/mulebot/relaymove(mob/living/user, direction) if(user.incapacitated()) return if(load == user) diff --git a/code/modules/mob/living/simple_animal/hostile/mining_mobs/goldgrub.dm b/code/modules/mob/living/simple_animal/hostile/mining_mobs/goldgrub.dm index f922c2ba3f2..05a9db5f9a2 100644 --- a/code/modules/mob/living/simple_animal/hostile/mining_mobs/goldgrub.dm +++ b/code/modules/mob/living/simple_animal/hostile/mining_mobs/goldgrub.dm @@ -76,7 +76,7 @@ resistance_flags = LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF var/canmove = TRUE -/obj/effect/dummy/phased_mob/goldgrub/relaymove(mob/user, direction) +/obj/effect/dummy/phased_mob/goldgrub/relaymove(mob/living/user, direction) forceMove(get_step(src,direction)) /obj/effect/dummy/phased_mob/goldgrub/ex_act() diff --git a/code/modules/mob/living/simple_animal/hostile/netherworld.dm b/code/modules/mob/living/simple_animal/hostile/netherworld.dm index 150628e3932..6605bf613ff 100644 --- a/code/modules/mob/living/simple_animal/hostile/netherworld.dm +++ b/code/modules/mob/living/simple_animal/hostile/netherworld.dm @@ -45,7 +45,7 @@ resistance_flags = LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF var/canmove = TRUE -/obj/effect/dummy/phased_mob/creature/relaymove(mob/user, direction) +/obj/effect/dummy/phased_mob/creature/relaymove(mob/living/user, direction) forceMove(get_step(src,direction)) /obj/effect/dummy/phased_mob/creature/ex_act() diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index 4198d848fcf..58e8f8e0aea 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -658,7 +658,7 @@ M.forceMove(get_turf(src)) return ..() -/mob/living/simple_animal/relaymove(mob/user, direction) +/mob/living/simple_animal/relaymove(mob/living/user, direction) if (stat == DEAD) return var/datum/component/riding/riding_datum = GetComponent(/datum/component/riding) diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 22baf03e4ac..b252d180ff5 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -446,41 +446,8 @@ // shift-click catcher may issue examinate() calls for out-of-sight turfs return - if(is_blind()) //blind people see things differently (through touch) - //need to be next to something and awake - if(!in_range(A, src) || incapacitated()) - to_chat(src, "Something is there, but you can't see it!") - return - //also neeed an empty hand, and you can only initiate as many examines as you have hands - if(LAZYLEN(do_afters) >= get_num_arms() || get_active_held_item()) - to_chat(src, "You don't have a free hand to examine this!") - return - //can only queue up one examine on something at a time - if(A in do_afters) - return - - to_chat(src, "You start feeling around for something...") - visible_message(" [name] begins feeling around for \the [A.name]...") - - /// how long it takes for the blind person to find the thing they're examining - var/examine_delay_length = rand(1 SECONDS, 2 SECONDS) - if(client?.recent_examines && client?.recent_examines[A]) //easier to find things we just touched - examine_delay_length = 0.5 SECONDS - else if(isobj(A)) - examine_delay_length *= 1.5 - else if(ismob(A) && A != src) - examine_delay_length *= 2 - - if(examine_delay_length > 0 && !do_after(src, examine_delay_length, target = A)) - to_chat(src, "You can't get a good feel for what is there.") - return - - //now we touch the thing we're examining - /// our current intent, so we can go back to it after touching - var/previous_intent = a_intent - a_intent = INTENT_HELP - A.attack_hand(src) - a_intent = previous_intent + if(is_blind() && !blind_examine_check(A)) //blind people see things differently (through touch) + return face_atom(A) var/list/result @@ -500,6 +467,49 @@ to_chat(src, result.Join("\n")) SEND_SIGNAL(src, COMSIG_MOB_EXAMINATE, A) + +/mob/proc/blind_examine_check(atom/examined_thing) + return TRUE //The non-living will always succeed at this check. + + +/mob/living/blind_examine_check(atom/examined_thing) + //need to be next to something and awake + if(!in_range(examined_thing, src) || incapacitated()) + to_chat(src, "Something is there, but you can't see it!") + return FALSE + //also neeed an empty hand, and you can only initiate as many examines as you have hands + if(LAZYLEN(do_afters) >= usable_hands || get_active_held_item()) + to_chat(src, "You don't have a free hand to examine this!") + return FALSE + //can only queue up one examine on something at a time + if(examined_thing in do_afters) + return FALSE + + to_chat(src, "You start feeling around for something...") + visible_message(" [name] begins feeling around for \the [examined_thing.name]...") + + /// how long it takes for the blind person to find the thing they're examining + var/examine_delay_length = rand(1 SECONDS, 2 SECONDS) + if(client?.recent_examines && client?.recent_examines[examined_thing]) //easier to find things we just touched + examine_delay_length = 0.5 SECONDS + else if(isobj(examined_thing)) + examine_delay_length *= 1.5 + else if(ismob(examined_thing) && examined_thing != src) + examine_delay_length *= 2 + + if(examine_delay_length > 0 && !do_after(src, examine_delay_length, target = examined_thing)) + to_chat(src, "You can't get a good feel for what is there.") + return FALSE + + //now we touch the thing we're examining + /// our current intent, so we can go back to it after touching + var/previous_intent = a_intent + a_intent = INTENT_HELP + examined_thing.attack_hand(src) + a_intent = previous_intent + return TRUE + + /mob/proc/clear_from_recent_examines(atom/A) SIGNAL_HANDLER @@ -1350,11 +1360,14 @@ /mob/proc/set_nutrition(change) //Seriously fuck you oldcoders. nutrition = max(0, change) -///Set the movement type of the mob and update it's movespeed -/mob/setMovetype(newval) + +/mob/setMovetype(newval) //Set the movement type of the mob and update it's movespeed . = ..() + if(isnull(.)) + return update_movespeed(FALSE) + /// Updates the grab state of the mob and updates movespeed /mob/setGrabState(newstate) . = ..() diff --git a/code/modules/recycling/disposal/bin.dm b/code/modules/recycling/disposal/bin.dm index 1556d205bba..f3b97ea39db 100644 --- a/code/modules/recycling/disposal/bin.dm +++ b/code/modules/recycling/disposal/bin.dm @@ -143,7 +143,7 @@ target.LAssailant = user update_icon() -/obj/machinery/disposal/relaymove(mob/user) +/obj/machinery/disposal/relaymove(mob/living/user, direction) attempt_escape(user) // resist to escape the bin diff --git a/code/modules/recycling/disposal/holder.dm b/code/modules/recycling/disposal/holder.dm index 16b9674c937..f58021eabcb 100644 --- a/code/modules/recycling/disposal/holder.dm +++ b/code/modules/recycling/disposal/holder.dm @@ -113,7 +113,7 @@ // called when player tries to move while in a pipe -/obj/structure/disposalholder/relaymove(mob/user) +/obj/structure/disposalholder/relaymove(mob/living/user, direction) if(user.incapacitated()) return for(var/mob/M in range(5, get_turf(src))) diff --git a/code/modules/research/nanites/nanite_chamber.dm b/code/modules/research/nanites/nanite_chamber.dm index 79712aa9b2a..1f20bf0f02f 100644 --- a/code/modules/research/nanites/nanite_chamber.dm +++ b/code/modules/research/nanites/nanite_chamber.dm @@ -178,7 +178,7 @@ return TRUE -/obj/machinery/nanite_chamber/relaymove(mob/user) +/obj/machinery/nanite_chamber/relaymove(mob/living/user, direction) if(user.stat || locked) if(message_cooldown <= world.time) message_cooldown = world.time + 50 diff --git a/code/modules/research/nanites/public_chamber.dm b/code/modules/research/nanites/public_chamber.dm index 210ace02ce4..59f0136d153 100644 --- a/code/modules/research/nanites/public_chamber.dm +++ b/code/modules/research/nanites/public_chamber.dm @@ -172,7 +172,7 @@ return TRUE -/obj/machinery/public_nanite_chamber/relaymove(mob/user) +/obj/machinery/public_nanite_chamber/relaymove(mob/living/user, direction) if(user.stat || locked) if(message_cooldown <= world.time) message_cooldown = world.time + 50 diff --git a/code/modules/ruins/lavalandruin_code/puzzle.dm b/code/modules/ruins/lavalandruin_code/puzzle.dm index ccd90a0f69e..7b0c61b3a43 100644 --- a/code/modules/ruins/lavalandruin_code/puzzle.dm +++ b/code/modules/ruins/lavalandruin_code/puzzle.dm @@ -296,7 +296,7 @@ /obj/structure/puzzle_element/prison armor = list(MELEE = 50, BULLET = 50, LASER = 50, ENERGY = 50, BOMB = 50, BIO = 50, RAD = 50, FIRE = 50, ACID = 50) -/obj/structure/puzzle_element/prison/relaymove(mob/user) +/obj/structure/puzzle_element/prison/relaymove(mob/living/user, direction) return /obj/item/prisoncube diff --git a/code/modules/spells/spell_types/ethereal_jaunt.dm b/code/modules/spells/spell_types/ethereal_jaunt.dm index 574ab42722e..50b62640c37 100644 --- a/code/modules/spells/spell_types/ethereal_jaunt.dm +++ b/code/modules/spells/spell_types/ethereal_jaunt.dm @@ -87,7 +87,7 @@ AM.forceMove(get_turf(src)) return ..() -/obj/effect/dummy/phased_mob/spell_jaunt/relaymove(mob/user, direction) +/obj/effect/dummy/phased_mob/spell_jaunt/relaymove(mob/living/user, direction) if ((movedelay > world.time) || reappearing || !direction) return var/turf/newLoc = get_step(src,direction) diff --git a/code/modules/spells/spell_types/shadow_walk.dm b/code/modules/spells/spell_types/shadow_walk.dm index 23b2f46d44f..7cca35db0a8 100644 --- a/code/modules/spells/spell_types/shadow_walk.dm +++ b/code/modules/spells/spell_types/shadow_walk.dm @@ -45,7 +45,7 @@ invisibility = 60 resistance_flags = LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF -/obj/effect/dummy/phased_mob/shadow/relaymove(mob/user, direction) +/obj/effect/dummy/phased_mob/shadow/relaymove(mob/living/user, direction) var/turf/newLoc = get_step(src,direction) if(isspaceturf(newLoc)) to_chat(user, "It really would not be wise to go into space.") diff --git a/code/modules/spells/spell_types/touch_attacks.dm b/code/modules/spells/spell_types/touch_attacks.dm index 9f9459803be..c130dbb57f5 100644 --- a/code/modules/spells/spell_types/touch_attacks.dm +++ b/code/modules/spells/spell_types/touch_attacks.dm @@ -48,7 +48,7 @@ attached_hand.attached_spell = src if(!user.put_in_hands(attached_hand)) remove_hand(TRUE) - if (user.get_num_arms() <= 0) + if (user.usable_hands == 0) to_chat(user, "You dont have any usable hands!") else to_chat(user, "Your hands are full!") diff --git a/code/modules/surgery/bodyparts/_bodyparts.dm b/code/modules/surgery/bodyparts/_bodyparts.dm index fb5c7bdd42f..9e8406e0f85 100644 --- a/code/modules/surgery/bodyparts/_bodyparts.dm +++ b/code/modules/surgery/bodyparts/_bodyparts.dm @@ -22,7 +22,7 @@ var/held_index = 0 //are we a hand? if so, which one! var/is_pseudopart = FALSE //For limbs that don't really exist, eg chainsaws - var/disabled = BODYPART_NOT_DISABLED //If disabled, limb is as good as missing + var/bodypart_disabled = BODYPART_NOT_DISABLED //If disabled, limb is as good as missing var/body_damage_coeff = 1 //Multiplier of the limb's damage that gets applied to the mob var/stam_damage_coeff = 0.75 var/brutestate = 0 @@ -101,7 +101,7 @@ /obj/item/bodypart/Destroy() if(owner) - owner.bodyparts -= src + owner.remove_bodypart(src) owner = null return ..() @@ -487,7 +487,9 @@ /obj/item/bodypart/proc/update_disabled() if(!owner) return - set_disabled(is_disabled()) + if(!isnull(set_disabled(is_disabled()))) //set_disabled will return null when there's no change + owner.update_mobility() + /obj/item/bodypart/proc/is_disabled() if(!owner) @@ -499,7 +501,7 @@ if(W.disabling) return BODYPART_DISABLED_WOUND if(can_dismember() && !HAS_TRAIT(owner, TRAIT_NOLIMBDISABLE)) - . = disabled //inertia, to avoid limbs healing 0.1 damage and being re-enabled + . = bodypart_disabled //inertia, to avoid limbs healing 0.1 damage and being re-enabled if(get_damage(TRUE) >= max_damage * (HAS_TRAIT(owner, TRAIT_EASYLIMBWOUND) ? 0.6 : 1)) //Easy limb disable disables the limb at 40% health instead of 0% if(!last_maxed) @@ -507,23 +509,24 @@ last_maxed = TRUE if(!is_organic_limb() || stamina_dam >= max_damage) return BODYPART_DISABLED_DAMAGE - else if(disabled && (get_damage(TRUE) <= (max_damage * 0.8))) // reenabled at 80% now instead of 50% as of wounds update + else if(bodypart_disabled && (get_damage(TRUE) <= (max_damage * 0.8))) // reenabled at 80% now instead of 50% as of wounds update last_maxed = FALSE return BODYPART_NOT_DISABLED else return BODYPART_NOT_DISABLED return BODYPART_NOT_DISABLED + /obj/item/bodypart/proc/set_disabled(new_disabled) - if(disabled == new_disabled || !owner) + if(isnull(new_disabled) || bodypart_disabled == new_disabled || !owner) return - disabled = new_disabled - if(disabled && owner.get_item_for_held_index(held_index)) + . = bodypart_disabled + bodypart_disabled = new_disabled + if(bodypart_disabled && owner.get_item_for_held_index(held_index)) owner.dropItemToGround(owner.get_item_for_held_index(held_index)) owner.update_health_hud() //update the healthdoll owner.update_body() - owner.update_mobility() - return TRUE //if there was a change. + //Updates an organ's brute/burn states for use by update_damage_overlays() //Returns 1 if we need to update overlays. 0 otherwise. diff --git a/code/modules/surgery/bodyparts/dismemberment.dm b/code/modules/surgery/bodyparts/dismemberment.dm index f02c7a86a36..37668288362 100644 --- a/code/modules/surgery/bodyparts/dismemberment.dm +++ b/code/modules/surgery/bodyparts/dismemberment.dm @@ -91,7 +91,7 @@ var/mob/living/carbon/C = owner SEND_SIGNAL(C, COMSIG_CARBON_REMOVE_LIMB, src, dismembered) update_limb(1) - C.bodyparts -= src + C.remove_bodypart(src) if(held_index) if(C.hand_bodyparts[held_index] == src) @@ -341,7 +341,7 @@ . = TRUE moveToNullspace() owner = C - C.bodyparts += src + C.add_bodypart(src) if(held_index) if(held_index > C.hand_bodyparts.len) C.hand_bodyparts.len = held_index diff --git a/code/modules/surgery/bodyparts/helpers.dm b/code/modules/surgery/bodyparts/helpers.dm index d4f69095d13..f8d4735c8f6 100644 --- a/code/modules/surgery/bodyparts/helpers.dm +++ b/code/modules/surgery/bodyparts/helpers.dm @@ -10,11 +10,13 @@ if(L.body_zone == zone) return L + /mob/living/carbon/has_hand_for_held_index(i) - if(i) - var/obj/item/bodypart/L = hand_bodyparts[i] - if(L && !L.disabled) - return L + if(!i) + return FALSE + var/obj/item/bodypart/hand_instance = hand_bodyparts[i] + if(hand_instance && !hand_instance.bodypart_disabled) + return hand_instance return FALSE @@ -32,13 +34,15 @@ /mob/proc/has_left_hand(check_disabled = TRUE) return TRUE + /mob/living/carbon/has_left_hand(check_disabled = TRUE) - for(var/obj/item/bodypart/L in hand_bodyparts) - if(L.held_index % 2) - if(!check_disabled || !L.disabled) - return TRUE + for(var/obj/item/bodypart/hand_instance in hand_bodyparts) + if(!(hand_instance.held_index % 2) || (check_disabled && hand_instance.bodypart_disabled)) + continue + return TRUE return FALSE + /mob/living/carbon/alien/larva/has_left_hand() return 1 @@ -46,68 +50,19 @@ /mob/proc/has_right_hand(check_disabled = TRUE) return TRUE + /mob/living/carbon/has_right_hand(check_disabled = TRUE) - for(var/obj/item/bodypart/L in hand_bodyparts) - if(!(L.held_index % 2)) - if(!check_disabled || !L.disabled) - return TRUE + for(var/obj/item/bodypart/hand_instance in hand_bodyparts) + if(hand_instance.held_index % 2 || (check_disabled && hand_instance.bodypart_disabled)) + continue + return TRUE return FALSE + /mob/living/carbon/alien/larva/has_right_hand() return 1 - -//Limb numbers -/mob/proc/get_num_arms(check_disabled = TRUE) - return 2 - -/mob/living/carbon/get_num_arms(check_disabled = TRUE) - . = 0 - for(var/X in bodyparts) - var/obj/item/bodypart/affecting = X - if(affecting.body_part == ARM_RIGHT) - if(!check_disabled || !affecting.disabled) - .++ - if(affecting.body_part == ARM_LEFT) - if(!check_disabled || !affecting.disabled) - .++ - - -//sometimes we want to ignore that we don't have the required amount of arms. -/mob/proc/get_arm_ignore() - return 0 - -/mob/living/carbon/alien/larva/get_arm_ignore() - return 1 //so we can still handcuff larvas. - - -/mob/proc/get_num_legs(check_disabled = TRUE) - return 2 - -/mob/living/carbon/get_num_legs(check_disabled = TRUE) - . = 0 - for(var/X in bodyparts) - var/obj/item/bodypart/affecting = X - if(affecting.body_part == LEG_RIGHT) - if(!check_disabled || !affecting.disabled) - .++ - if(affecting.body_part == LEG_LEFT) - if(!check_disabled || !affecting.disabled) - .++ - -//sometimes we want to ignore that we don't have the required amount of legs. -/mob/proc/get_leg_ignore() - return FALSE - -/mob/living/carbon/alien/larva/get_leg_ignore() - return TRUE - -/mob/living/carbon/human/get_leg_ignore() - if(movement_type & (FLYING | FLOATING)) - return TRUE - return FALSE - /mob/living/proc/get_missing_limbs() return list() @@ -134,7 +89,7 @@ var/list/disabled = list() for(var/zone in full) var/obj/item/bodypart/affecting = get_bodypart(zone) - if(affecting && affecting.disabled) + if(affecting?.bodypart_disabled) disabled += zone return disabled @@ -143,7 +98,7 @@ var/list/disabled = list() for(var/zone in full) var/obj/item/bodypart/affecting = get_bodypart(zone) - if(affecting && affecting.disabled) + if(affecting?.bodypart_disabled) disabled += zone return disabled diff --git a/code/modules/surgery/bodyparts/parts.dm b/code/modules/surgery/bodyparts/parts.dm index ac58398f282..a84cb1a2c2f 100644 --- a/code/modules/surgery/bodyparts/parts.dm +++ b/code/modules/surgery/bodyparts/parts.dm @@ -78,26 +78,33 @@ return BODYPART_DISABLED_PARALYSIS return ..() + /obj/item/bodypart/l_arm/set_disabled(new_disabled) . = ..() - if(!.) + if(isnull(.)) return - if(disabled == BODYPART_DISABLED_DAMAGE) - if(owner.stat < UNCONSCIOUS) - owner.emote("scream") - if(owner.stat < DEAD) - to_chat(owner, "Your [name] is too damaged to function!") - if(held_index) - owner.dropItemToGround(owner.get_item_for_held_index(held_index)) - else if(disabled == BODYPART_DISABLED_PARALYSIS) - if(owner.stat < DEAD) - to_chat(owner, "You can't feel your [name]!") + if(. == BODYPART_NOT_DISABLED) + if(bodypart_disabled != BODYPART_NOT_DISABLED) + owner.set_usable_hands(owner.usable_hands + 1) + else if(bodypart_disabled == BODYPART_NOT_DISABLED) + owner.set_usable_hands(owner.usable_hands - 1) + switch(bodypart_disabled) + if(BODYPART_DISABLED_DAMAGE) + if(owner.stat < UNCONSCIOUS) + owner.emote("scream") + if(owner.stat < DEAD) + to_chat(owner, "Your [name] is too damaged to function!") if(held_index) owner.dropItemToGround(owner.get_item_for_held_index(held_index)) + if(BODYPART_DISABLED_PARALYSIS) + if(owner.stat < DEAD) + to_chat(owner, "You can't feel your [name]!") + if(held_index) + owner.dropItemToGround(owner.get_item_for_held_index(held_index)) if(owner.hud_used) - var/obj/screen/inventory/hand/L = owner.hud_used.hand_slots["[held_index]"] - if(L) - L.update_icon() + var/obj/screen/inventory/hand/hand_screen_object = owner.hud_used.hand_slots["[held_index]"] + hand_screen_object?.update_icon() + /obj/item/bodypart/l_arm/monkey icon = 'icons/mob/animal_parts.dmi' @@ -144,26 +151,33 @@ return BODYPART_DISABLED_PARALYSIS return ..() + /obj/item/bodypart/r_arm/set_disabled(new_disabled) . = ..() - if(!.) + if(isnull(.)) return - if(disabled == BODYPART_DISABLED_DAMAGE) - if(owner.stat < UNCONSCIOUS) - owner.emote("scream") - if(owner.stat < DEAD) - to_chat(owner, "Your [name] is too damaged to function!") - if(held_index) - owner.dropItemToGround(owner.get_item_for_held_index(held_index)) - else if(disabled == BODYPART_DISABLED_PARALYSIS) - if(owner.stat < DEAD) - to_chat(owner, "You can't feel your [name]!") + if(. == BODYPART_NOT_DISABLED) + if(bodypart_disabled != BODYPART_NOT_DISABLED) + owner.set_usable_hands(owner.usable_hands + 1) + else if(bodypart_disabled == BODYPART_NOT_DISABLED) + owner.set_usable_hands(owner.usable_hands - 1) + switch(bodypart_disabled) + if(BODYPART_DISABLED_DAMAGE) + if(owner.stat < UNCONSCIOUS) + owner.emote("scream") + if(owner.stat < DEAD) + to_chat(owner, "Your [name] is too damaged to function!") if(held_index) owner.dropItemToGround(owner.get_item_for_held_index(held_index)) + if(BODYPART_DISABLED_PARALYSIS) + if(owner.stat < DEAD) + to_chat(owner, "You can't feel your [name]!") + if(held_index) + owner.dropItemToGround(owner.get_item_for_held_index(held_index)) if(owner.hud_used) - var/obj/screen/inventory/hand/R = owner.hud_used.hand_slots["[held_index]"] - if(R) - R.update_icon() + var/obj/screen/inventory/hand/hand_screen_object = owner.hud_used.hand_slots["[held_index]"] + hand_screen_object?.update_icon() + /obj/item/bodypart/r_arm/monkey icon = 'icons/mob/animal_parts.dmi' @@ -207,18 +221,26 @@ return BODYPART_DISABLED_PARALYSIS return ..() + /obj/item/bodypart/l_leg/set_disabled(new_disabled) . = ..() - if(!.) + if(isnull(.)) return - if(disabled == BODYPART_DISABLED_DAMAGE) - if(owner.stat < UNCONSCIOUS) - owner.emote("scream") - if(owner.stat < DEAD) - to_chat(owner, "Your [name] is too damaged to function!") - else if(disabled == BODYPART_DISABLED_PARALYSIS) - if(owner.stat < DEAD) - to_chat(owner, "You can't feel your [name]!") + if(. == BODYPART_NOT_DISABLED) + if(bodypart_disabled != BODYPART_NOT_DISABLED) + owner.set_usable_legs(owner.usable_legs + 1) + else if(bodypart_disabled == BODYPART_NOT_DISABLED) + owner.set_usable_legs(owner.usable_legs - 1) + switch(bodypart_disabled) + if(BODYPART_DISABLED_DAMAGE) + if(owner.stat < UNCONSCIOUS) + owner.emote("scream") + if(owner.stat < DEAD) + to_chat(owner, "Your [name] is too damaged to function!") + if(BODYPART_DISABLED_PARALYSIS) + if(owner.stat < DEAD) + to_chat(owner, "You can't feel your [name]!") + /obj/item/bodypart/l_leg/digitigrade name = "left digitigrade leg" @@ -267,18 +289,26 @@ return BODYPART_DISABLED_PARALYSIS return ..() + /obj/item/bodypart/r_leg/set_disabled(new_disabled) . = ..() - if(!.) + if(isnull(.)) return - if(disabled == BODYPART_DISABLED_DAMAGE) - if(owner.stat < UNCONSCIOUS) - owner.emote("scream") - if(owner.stat < DEAD) - to_chat(owner, "Your [name] is too damaged to function!") - else if(disabled == BODYPART_DISABLED_PARALYSIS) - if(owner.stat < DEAD) - to_chat(owner, "You can't feel your [name]!") + if(. == BODYPART_NOT_DISABLED) + if(bodypart_disabled != BODYPART_NOT_DISABLED) + owner.set_usable_legs(owner.usable_legs + 1) + else if(bodypart_disabled == BODYPART_NOT_DISABLED) + owner.set_usable_legs(owner.usable_legs - 1) + switch(bodypart_disabled) + if(BODYPART_DISABLED_DAMAGE) + if(owner.stat < UNCONSCIOUS) + owner.emote("scream") + if(owner.stat < DEAD) + to_chat(owner, "Your [name] is too damaged to function!") + if(BODYPART_DISABLED_PARALYSIS) + if(owner.stat < DEAD) + to_chat(owner, "You can't feel your [name]!") + /obj/item/bodypart/r_leg/digitigrade name = "right digitigrade leg" diff --git a/code/modules/vehicles/_vehicle.dm b/code/modules/vehicles/_vehicle.dm index 64bc1814f40..2c54bf605cc 100644 --- a/code/modules/vehicles/_vehicle.dm +++ b/code/modules/vehicles/_vehicle.dm @@ -107,12 +107,12 @@ /obj/vehicle/proc/after_remove_occupant(mob/M) -/obj/vehicle/relaymove(mob/user, direction) +/obj/vehicle/relaymove(mob/living/user, direction) if(is_driver(user)) return driver_move(user, direction) return FALSE -/obj/vehicle/proc/driver_move(mob/user, direction) +/obj/vehicle/proc/driver_move(mob/living/user, direction) if(key_type && !is_key(inserted_key)) to_chat(user, "[src] has no key inserted!") return FALSE diff --git a/code/modules/vehicles/cars/car.dm b/code/modules/vehicles/cars/car.dm index 10fec0e1266..d222d1d3e33 100644 --- a/code/modules/vehicles/cars/car.dm +++ b/code/modules/vehicles/cars/car.dm @@ -20,7 +20,7 @@ if(car_traits & CAN_KIDNAP) initialize_controller_action_type(/datum/action/vehicle/sealed/dump_kidnapped_mobs, VEHICLE_CONTROL_DRIVE) -/obj/vehicle/sealed/car/driver_move(mob/user, direction) +/obj/vehicle/sealed/car/driver_move(mob/living/user, direction) if(key_type && !is_key(inserted_key)) to_chat(user, "[src] has no key inserted!") return FALSE diff --git a/code/modules/vehicles/motorized_wheelchair.dm b/code/modules/vehicles/motorized_wheelchair.dm index 179010e7301..afac3a6c68b 100644 --- a/code/modules/vehicles/motorized_wheelchair.dm +++ b/code/modules/vehicles/motorized_wheelchair.dm @@ -51,7 +51,7 @@ canmove = FALSE addtimer(VARSET_CALLBACK(src, canmove, TRUE), 20) return FALSE - if(user.get_num_arms() < arms_required) + if(user.usable_hands < arms_required) to_chat(user, "You don't have enough arms to operate the motor controller!") canmove = FALSE addtimer(VARSET_CALLBACK(src, canmove, TRUE), 20) diff --git a/code/modules/vehicles/ridden.dm b/code/modules/vehicles/ridden.dm index c67086bc3c4..71805a8e6f0 100644 --- a/code/modules/vehicles/ridden.dm +++ b/code/modules/vehicles/ridden.dm @@ -58,22 +58,20 @@ inserted_key = null return ..() -/obj/vehicle/ridden/driver_move(mob/user, direction) +/obj/vehicle/ridden/driver_move(mob/living/user, direction) if(key_type && !is_key(inserted_key)) if(message_cooldown < world.time) to_chat(user, "[src] has no key inserted!") message_cooldown = world.time + 5 SECONDS return FALSE if(legs_required) - var/how_many_legs = user.get_num_legs() - if(how_many_legs < legs_required) + if(user.usable_legs < legs_required) if(message_cooldown < world.time) - to_chat(user, "You can't seem to manage that with[how_many_legs ? " your leg[how_many_legs > 1 ? "s" : null]" : "out legs"]...") + to_chat(user, "You can't seem to manage that with[user.usable_legs ? " your leg[user.usable_legs > 1 ? "s" : null]" : "out legs"]...") message_cooldown = world.time + 5 SECONDS return FALSE if(arms_required) - var/how_many_arms = user.get_num_arms() - if(how_many_arms < arms_required) + if(user.usable_hands < arms_required) if(fall_off_if_missing_arms) unbuckle_mob(user, TRUE) user.visible_message("[user] falls off \the [src].",\ @@ -84,7 +82,7 @@ return FALSE if(message_cooldown < world.time) - to_chat(user, "You can't seem to manage that with[how_many_arms ? " your arm[how_many_arms > 1 ? "s" : null]" : "out arms"]...") + to_chat(user, "You can't seem to manage that with[user.usable_hands ? " your arm[user.usable_hands > 1 ? "s" : null]" : "out arms"]...") message_cooldown = world.time + 5 SECONDS return FALSE var/datum/component/riding/R = GetComponent(/datum/component/riding) diff --git a/code/modules/vehicles/scooter.dm b/code/modules/vehicles/scooter.dm index 1368d378fdf..ad2e6e3754a 100644 --- a/code/modules/vehicles/scooter.dm +++ b/code/modules/vehicles/scooter.dm @@ -29,7 +29,7 @@ . = ..() for(var/m in buckled_mobs) var/mob/living/buckled_mob = m - if(buckled_mob.get_num_legs(FALSE) > 0) + if(buckled_mob.num_legs > 0) buckled_mob.pixel_y = 5 else buckled_mob.pixel_y = -4 @@ -37,7 +37,7 @@ /obj/vehicle/ridden/scooter/buckle_mob(mob/living/M, force = FALSE, check_loc = TRUE) if(!istype(M)) return FALSE - if(M.get_num_legs() < legs_required && M.get_num_arms() < arms_required) + if(M.usable_legs < legs_required && M.usable_hands < arms_required) to_chat(M, "You don't think it'd be a good idea trying to ride \the [src]...") return FALSE return ..() @@ -78,7 +78,7 @@ QDEL_NULL(sparks) . = ..() -/obj/vehicle/ridden/scooter/skateboard/relaymove() +/obj/vehicle/ridden/scooter/skateboard/relaymove(mob/living/user, direction) if (grinding || world.time < next_crash) return FALSE return ..() diff --git a/code/modules/vehicles/secway.dm b/code/modules/vehicles/secway.dm index 450ffdfdf48..42c11c1f4f9 100644 --- a/code/modules/vehicles/secway.dm +++ b/code/modules/vehicles/secway.dm @@ -64,7 +64,7 @@ return return ..() -/obj/vehicle/ridden/secway/driver_move(mob/user, direction) +/obj/vehicle/ridden/secway/driver_move(mob/living/user, direction) if(is_key(inserted_key) && eddie_murphy) if(stall_cooldown + 10 < world.time) visible_message("[src] sputters and refuses to move!") diff --git a/code/modules/vehicles/wheelchair.dm b/code/modules/vehicles/wheelchair.dm index a4b6e8f0a95..77aa0e2cf65 100644 --- a/code/modules/vehicles/wheelchair.dm +++ b/code/modules/vehicles/wheelchair.dm @@ -40,7 +40,7 @@ /obj/vehicle/ridden/wheelchair/driver_move(mob/living/user, direction) if(istype(user)) - if(canmove && (user.get_num_arms() < arms_required)) + if(canmove && (user.usable_hands < arms_required)) to_chat(user, "You don't have enough arms to operate the wheels!") canmove = FALSE addtimer(VARSET_CALLBACK(src, canmove, TRUE), 20) @@ -52,7 +52,7 @@ 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) * delay_multiplier) / min(user.get_num_arms(), 2) + D.vehicle_move_delay = round(CONFIG_GET(number/movedelay/run_delay) * delay_multiplier) / clamp(user.usable_hands, 1, 2) /obj/vehicle/ridden/wheelchair/Moved() . = ..() @@ -113,7 +113,7 @@ /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() + D.vehicle_move_delay = round(CONFIG_GET(number/movedelay/run_delay) * 6.7) / max(user.usable_hands, 1) return ..()