Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mobility Refactor #8965

Closed
wants to merge 62 commits into from
Closed
Show file tree
Hide file tree
Changes from 42 commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
bc135aa
https://github.com/tgstation/tgstation/pull/50270
Tsar-Salat Apr 30, 2023
01fa8af
https://github.com/tgstation/tgstation/pull/50321
Tsar-Salat Apr 30, 2023
b196cee
https://github.com/tgstation/tgstation/pull/51348
Tsar-Salat Apr 30, 2023
573b1c6
https://github.com/tgstation/tgstation/pull/49237
Tsar-Salat Apr 30, 2023
45a5abd
https://github.com/tgstation/tgstation/pull/52578
Tsar-Salat Apr 30, 2023
09bb98a
https://github.com/tgstation/tgstation/pull/52884
Tsar-Salat Apr 30, 2023
daa807f
https://github.com/tgstation/tgstation/pull/53981
Tsar-Salat May 1, 2023
61fdd2b
https://github.com/tgstation/tgstation/pull/53117
Tsar-Salat May 1, 2023
570608b
fixes
Tsar-Salat May 1, 2023
2c7dcc2
https://github.com/tgstation/tgstation/pull/52929
Tsar-Salat May 1, 2023
e888ce2
resolved conflicts
Tsar-Salat May 1, 2023
3cc2bd6
https://github.com/tgstation/tgstation/pull/53374
Tsar-Salat May 1, 2023
d83cf24
fix-disabled
Tsar-Salat May 1, 2023
18879df
proc_ref 1
Tsar-Salat May 1, 2023
23e264a
PROC_REF 2
Tsar-Salat May 1, 2023
d17c473
https://github.com/tgstation/tgstation/pull/54078
Tsar-Salat May 1, 2023
e7849d9
https://github.com/tgstation/tgstation/pull/54183
Tsar-Salat May 1, 2023
44410c3
extra oops
Tsar-Salat May 1, 2023
6a083d8
https://github.com/tgstation/tgstation/pull/54320
Tsar-Salat May 1, 2023
7377e78
Merge remote-tracking branch 'Upstream/master' into crit-status
Tsar-Salat May 3, 2023
dfdab57
Merge remote-tracking branch 'Upstream/master' into crit-status
Tsar-Salat May 7, 2023
85f2e5f
Merge remote-tracking branch 'Upstream/master' into crit-status
Tsar-Salat May 9, 2023
9cd1ffd
fix wheelchair bug
Tsar-Salat May 9, 2023
ef0c2b4
Merge remote-tracking branch 'upstream/master' into crit-status
Tsar-Salat May 14, 2023
f1b967a
Merge remote-tracking branch 'upstream/master' into crit-status
Tsar-Salat May 14, 2023
695b845
fix
Tsar-Salat May 14, 2023
5330a08
Merge remote-tracking branch 'upstream/master' into crit-status
Tsar-Salat May 15, 2023
ab94417
succumb fixes
Tsar-Salat May 15, 2023
ed92eb4
woops
Tsar-Salat May 15, 2023
20751ca
disclaimer
Tsar-Salat May 15, 2023
03bcc4a
working
Tsar-Salat May 15, 2023
3e87f7d
Merge remote-tracking branch 'upstream/master' into crit-status
Tsar-Salat May 18, 2023
fb3b5e7
.
Tsar-Salat May 18, 2023
c0d7544
.
Tsar-Salat May 18, 2023
f6c095b
.
Tsar-Salat May 18, 2023
1a692b9
no conflicts
Tsar-Salat May 18, 2023
0637253
Merge remote-tracking branch 'upstream/master' into crit-status
Tsar-Salat May 19, 2023
7de05bb
clean up movable
Tsar-Salat May 19, 2023
7b033c9
add linters and purity
Tsar-Salat May 19, 2023
efa3753
Merge remote-tracking branch 'upstream/master' into crit-status
Tsar-Salat Jun 11, 2023
8607fff
oops
Tsar-Salat Jun 11, 2023
48d0ebc
Merge remote-tracking branch 'upstream/master' into crit-status
Tsar-Salat Jun 23, 2023
5b75379
Merge remote-tracking branch 'upstream/master' into crit-status
Tsar-Salat Jul 6, 2023
a7de43d
Merge remote-tracking branch 'upstream/master' into crit-status
Tsar-Salat Jul 6, 2023
ed9e2f8
Merge remote-tracking branch 'upstream/master' into crit-status
Tsar-Salat Jul 7, 2023
576446c
Merge remote-tracking branch 'upstream/master' into crit-status
Tsar-Salat Jul 12, 2023
564325b
footstep sound revert
Tsar-Salat Jul 12, 2023
aa31e5e
adds ref
Tsar-Salat Jul 12, 2023
88c0d49
stun "amount" modifier cleanup
Tsar-Salat Jul 12, 2023
7faf35e
blind adjacent check
Tsar-Salat Jul 12, 2023
ea552f9
resolve conflicts 1
Tsar-Salat Jul 12, 2023
08c8eae
fix conflicts 2
Tsar-Salat Jul 12, 2023
cefb231
fix dismemberment
Tsar-Salat Jul 12, 2023
6d4d32b
REVIVESBYHEALING revert
Tsar-Salat Jul 12, 2023
e754384
Merge remote-tracking branch 'upstream/master' into crit-status
Tsar-Salat Jul 16, 2023
1ca41ea
Merge remote-tracking branch 'Upstream/master' into crit-status
Tsar-Salat Jul 22, 2023
712dbf7
Merge remote-tracking branch 'Upstream/master' into crit-status
Tsar-Salat Jul 23, 2023
0929347
Merge remote-tracking branch 'upstream/master' into crit-status
Tsar-Salat Jul 24, 2023
e0427a3
Merge remote-tracking branch 'upstream/master' into crit-status
Tsar-Salat Aug 1, 2023
2030fb9
Merge remote-tracking branch 'upstream/master' into crit-status
Tsar-Salat Aug 2, 2023
1fd5aec
Merge remote-tracking branch 'upstream/master' into crit-status
Tsar-Salat Aug 3, 2023
68af802
Merge remote-tracking branch 'upstream/master' into crit-status
Tsar-Salat Aug 7, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions beestation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -2668,6 +2668,7 @@
#include "code\modules\mob\living\death.dm"
#include "code\modules\mob\living\emote.dm"
#include "code\modules\mob\living\inhand_holder.dm"
#include "code\modules\mob\living\init_signals.dm"
#include "code\modules\mob\living\life.dm"
#include "code\modules\mob\living\living.dm"
#include "code\modules\mob\living\living_defense.dm"
Expand Down
2 changes: 1 addition & 1 deletion code/__DEFINES/ai.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


///Monkey checks
#define SHOULD_RESIST(source) (source.on_fire || source.buckled || source.restrained() || (source.pulledby && source.pulledby.grab_state > GRAB_PASSIVE))
#define SHOULD_RESIST(source) (source.on_fire || source.buckled || HAS_TRAIT(source, TRAIT_RESTRAINED) || (source.pulledby && source.pulledby.grab_state > GRAB_PASSIVE))
#define IS_DEAD_OR_INCAP(source) (source.incapacitated() || source.stat)

///For JPS pathing, the maximum length of a path we'll try to generate. Should be modularized depending on what we're doing later on
Expand Down
49 changes: 34 additions & 15 deletions code/__DEFINES/dcs/signals/signals_mob/signals_living.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,24 @@
// All signals send the source datum of the signal as the first argument

// /mob/living signals
#define COMSIG_LIVING_REVIVE "living_revive" //! from base of mob/living/revive() (/mob/living, full_heal, admin_revive)
#define COMSIG_LIVING_RESIST "living_resist" //! from base of mob/living/resist() (/mob/living)
#define COMSIG_LIVING_IGNITED "living_ignite" //! from base of mob/living/IgniteMob() (/mob/living)
#define COMSIG_LIVING_EXTINGUISHED "living_extinguished" //! from base of mob/living/ExtinguishMob() (/mob/living)
#define COMSIG_LIVING_ELECTROCUTE_ACT "living_electrocute_act" //! from base of mob/living/electrocute_act(): (shock_damage)
#define COMSIG_LIVING_MINOR_SHOCK "living_minor_shock" //! sent by stuff like stunbatons and tasers: ()
#define COMSIG_PROCESS_BORGCHARGER_OCCUPANT "living_charge" //! sent from borg recharge stations: (amount, repairs)
#define COMSIG_LIVING_TRY_SYRINGE "living_try_syringe" ///From post-can inject check of syringe after attack (mob/user)
///from base of mob/living/resist() (/mob/living)
#define COMSIG_LIVING_RESIST "living_resist"
///from base of mob/living/ignite_mob() (/mob/living)
#define COMSIG_LIVING_IGNITED "living_ignite"
///from base of mob/living/extinguish_mob() (/mob/living)
#define COMSIG_LIVING_EXTINGUISHED "living_extinguished"
///from base of mob/living/electrocute_act(): (shock_damage, source, siemens_coeff, flags)
#define COMSIG_LIVING_ELECTROCUTE_ACT "living_electrocute_act"
///sent by stuff like stunbatons and tasers: ()
#define COMSIG_LIVING_MINOR_SHOCK "living_minor_shock"
///from base of mob/living/revive() (full_heal, admin_revive)
#define COMSIG_LIVING_REVIVE "living_revive"
///from base of mob/living/set_buckled(): (new_buckled)
#define COMSIG_LIVING_SET_BUCKLED "living_set_buckled"
///from base of mob/living/set_body_position()
/*#define COMSIG_LIVING_SET_BODY_POSITION "living_set_body_position"*/
///From post-can inject check of syringe after attack (mob/user)
#define COMSIG_LIVING_TRY_SYRINGE "living_try_syringe"
#define COMSIG_LIVING_START_PULL "living_start_pull" ///called on /living when someone starts pulling (atom/movable/pulled, state, force)
/// from base of mob/living/Life() (seconds, times_fired)
#define COMSIG_LIVING_LIFE "living_life"
Expand All @@ -25,11 +35,20 @@
#define COMSIG_LIVING_CAN_TRACK "mob_can_track" ///from base of /mob/living/can_track()
#define COMPONENT_CANT_TRACK 1

#define COMSIG_PROCESS_BORGCHARGER_OCCUPANT "living_charge" //! sent from borg recharge stations: (amount, repairs)

//ALL OF THESE DO NOT TAKE INTO ACCOUNT WHETHER AMOUNT IS 0 OR LOWER AND ARE SENT REGARDLESS!
#define COMSIG_LIVING_STATUS_STUN "living_stun" //! from base of mob/living/Stun() (amount, update, ignore)
#define COMSIG_LIVING_STATUS_KNOCKDOWN "living_knockdown" //! from base of mob/living/Knockdown() (amount, update, ignore)
#define COMSIG_LIVING_STATUS_PARALYZE "living_paralyze" //! from base of mob/living/Paralyze() (amount, update, ignore)
#define COMSIG_LIVING_STATUS_IMMOBILIZE "living_immobilize" //! from base of mob/living/Immobilize() (amount, update, ignore)
#define COMSIG_LIVING_STATUS_UNCONSCIOUS "living_unconscious" //! from base of mob/living/Unconscious() (amount, update, ignore)
#define COMSIG_LIVING_STATUS_SLEEP "living_sleeping" //! from base of mob/living/Sleeping() (amount, update, ignore)
#define COMPONENT_NO_STUN 1 //For all of them

///from base of mob/living/Stun() (amount, ignore_canstun)
#define COMSIG_LIVING_STATUS_STUN "living_stun"
///from base of mob/living/Knockdown() (amount, ignore_canstun)
#define COMSIG_LIVING_STATUS_KNOCKDOWN "living_knockdown"
///from base of mob/living/Paralyze() (amount, ignore_canstun)
#define COMSIG_LIVING_STATUS_PARALYZE "living_paralyze"
///from base of mob/living/Immobilize() (amount, ignore_canstun)
#define COMSIG_LIVING_STATUS_IMMOBILIZE "living_immobilize"
///from base of mob/living/Unconscious() (amount, ignore_canstun)
#define COMSIG_LIVING_STATUS_UNCONSCIOUS "living_unconscious"
///from base of mob/living/Sleeping() (amount, ignore_canstun)
#define COMSIG_LIVING_STATUS_SLEEP "living_sleeping"
#define COMPONENT_NO_STUN (1<<0) //For all of them
9 changes: 8 additions & 1 deletion code/__DEFINES/dcs/signals/signals_movable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,16 @@
#define HEARING_SPANS 6
#define HEARING_MESSAGE_MODE 7
*/
#define COMSIG_MOVABLE_DISPOSING "movable_disposing" //! called when the movable is added to a disposal holder object for disposal movement: (obj/structure/disposalholder/holder, obj/machinery/disposal/source)
///called when the movable is added to a disposal holder object for disposal movement: (obj/structure/disposalholder/holder, obj/machinery/disposal/source)
#define COMSIG_MOVABLE_DISPOSING "movable_disposing"
// called when movable is expelled from a disposal pipe, bin or outlet on obj/pipe_eject: (direction)
#define COMSIG_MOVABLE_PIPE_EJECTING "movable_pipe_ejecting"
///called when the movable sucessfully has it's anchored var changed, from base atom/movable/set_anchored(): (value)
/*#define COMSIG_MOVABLE_SET_ANCHORED "movable_set_anchored"*/
///from base of atom/movable/setGrabState(): (newstate)
#define COMSIG_MOVABLE_SET_GRAB_STATE "living_set_grab_state"
///called when the movable's glide size is updated: (new_glide_size)
/*#define COMSIG_MOVABLE_UPDATE_GLIDE_SIZE "movable_glide_size"*/

///from base of atom/movable/newtonian_move(): (inertia_direction)
#define COMSIG_MOVABLE_NEWTONIAN_MOVE "movable_newtonian_move"
Expand Down
1 change: 0 additions & 1 deletion code/__DEFINES/flags.dm
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ GLOBAL_LIST_INIT(bitflags, list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 204
#define MOBILITY_PULL (1<<6) //! can pull things

#define MOBILITY_FLAGS_DEFAULT (MOBILITY_MOVE | MOBILITY_STAND | MOBILITY_PICKUP | MOBILITY_USE | MOBILITY_UI | MOBILITY_STORAGE | MOBILITY_PULL)
#define MOBILITY_FLAGS_INTERACTION (MOBILITY_USE | MOBILITY_PICKUP | MOBILITY_UI | MOBILITY_STORAGE)

// radiation
#define RAD_PROTECT_CONTENTS (1<<0)
Expand Down
22 changes: 18 additions & 4 deletions code/__DEFINES/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,6 @@
#define BODYTYPE_DIGITIGRADE (1<<4) //Cancer
#define NUMBER_OF_BODYTYPES 5 //KEEP THIS UPDATED OR SHIT WILL BREAK

#define BODYPART_NOT_DISABLED 0
#define BODYPART_DISABLED_DAMAGE 1
#define BODYPART_DISABLED_PARALYSIS 2

#define DEFAULT_BODYPART_ICON_ORGANIC 'icons/mob/human_parts_greyscale.dmi'
#define DEFAULT_BODYPART_ICON_ROBOTIC 'icons/mob/augmentation/augments.dmi'

Expand Down Expand Up @@ -350,6 +346,10 @@
#define SENTIENCE_BOSS 5

//Mob AI Status
#define POWER_RESTORATION_OFF 0
#define POWER_RESTORATION_START 1
#define POWER_RESTORATION_SEARCH_APC 2
#define POWER_RESTORATION_APC_FOUND 3

//Hostile simple animals
//If you add a new status, be sure to add a list for it to the simple_animals global in _globalvars/lists/mobs.dm
Expand Down Expand Up @@ -502,6 +502,11 @@
#define THROW_MODE_TOGGLE 1
#define THROW_MODE_HOLD 2

/// Possible value of [/atom/movable/buckle_lying]. If set to a different (positive-or-zero) value than this, the buckling thing will force a lying angle on the buckled.
#define NO_BUCKLE_LYING -1

/// Simple mob trait, indicating it may follow continuous move actions controlled by code instead of by user input.
#define MOVES_ON_ITS_OWN (1<<0)

// Mob Overlays Indexes
/// KEEP THIS UP-TO-DATE OR SHIT WILL BREAK ;_;
Expand Down Expand Up @@ -601,3 +606,12 @@

/// Messages when (something) lays an egg
#define EGG_LAYING_MESSAGES list("lays an egg.","squats down and croons.","begins making a huge racket.","begins clucking raucously.")

/// Returns whether or not the given mob can succumb
#define CAN_SUCCUMB(target) (HAS_TRAIT(target, TRAIT_CRITICAL_CONDITION) && !HAS_TRAIT(target, TRAIT_NODEATH))

// Body position defines.
/// Mob is standing up, usually associated with lying_angle value of 0.
#define STANDING_UP 0
/// Mob is lying down, usually associated with lying_angle values of 90 or 270.
#define LYING_DOWN 1
3 changes: 2 additions & 1 deletion code/__DEFINES/stat.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
#define CONSCIOUS 0
#define SOFT_CRIT 1
#define UNCONSCIOUS 2
#define DEAD 3
#define HARD_CRIT 3
#define DEAD 4

//Maximum healthiness an individual can have
#define MAX_SATIETY 600
Expand Down
6 changes: 5 additions & 1 deletion code/__DEFINES/status_effects.dm
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@

#define STATUS_EFFECT_GO_AWAY /datum/status_effect/go_away //! makes you launch through walls in a single direction for a while

#define STATUS_EFFECT_STASIS /datum/status_effect/incapacitating/stasis //! Halts biological functions like bleeding, chemical processing, blood regeneration, walking, etc
#define STATUS_EFFECT_STASIS /datum/status_effect/grouped/stasis //Halts biological functions like bleeding, chemical processing, blood regeneration, walking, etc

#define STATUS_EFFECT_SYRINGE /datum/status_effect/syringe //used to handle being injected with a syringe

Expand Down Expand Up @@ -138,6 +138,10 @@
#define STATUS_EFFECT_RAINBOWPROTECTION /datum/status_effect/rainbow_protection //! Invulnerable and pacifistic
#define STATUS_EFFECT_SLIMESKIN /datum/status_effect/slimeskin //! Increased armor

// Grouped effect sources, see also code/__DEFINES/traits.dm

#define STASIS_MACHINE_EFFECT "stasis_machine"

// Stasis helpers

#define STASIS_ASCENSION_EFFECT "heretic_ascension"
Expand Down
82 changes: 71 additions & 11 deletions code/__DEFINES/traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,29 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
*/

//mob traits
/// Forces the user to stay unconscious.
#define TRAIT_KNOCKEDOUT "knockedout"
/// Prevents voluntary movement.
#define TRAIT_IMMOBILIZED "immobilized"
/// Prevents voluntary standing or staying up on its own.
#define TRAIT_FLOORED "floored"
/// Forces user to stay standing
#define TRAIT_FORCED_STANDING "forcedstanding"
/// Prevents usage of manipulation appendages (picking, holding or using items, manipulating storage).
#define TRAIT_HANDS_BLOCKED "handsblocked"
/// Inability to access UI hud elements. Turned into a trait from [MOBILITY_UI] to be able to track sources.
#define TRAIT_UI_BLOCKED "uiblocked"
/// Inability to pull things. Turned into a trait from [MOBILITY_PULL] to be able to track sources.
#define TRAIT_PULL_BLOCKED "pullblocked"
/// Abstract condition that prevents movement if being pulled and might be resisted against. Handcuffs and straight jackets, basically.
#define TRAIT_RESTRAINED "restrained"
#define TRAIT_INCAPACITATED "incapacitated"
#define TRAIT_CRITICAL_CONDITION "critical-condition" //In some kind of critical condition. Is able to succumb.
#define TRAIT_BLIND "blind"
#define TRAIT_MUTE "mute"
#define TRAIT_EMOTEMUTE "emotemute"
/// Mute. Can't talk.
#define TRAIT_MUTE "mute"
/// Emotemute. Can't... emote.
#define TRAIT_EMOTEMUTE "emotemute"
#define TRAIT_DEAF "deaf"
#define TRAIT_NEARSIGHT "nearsighted"
#define TRAIT_FAT "fat"
Expand Down Expand Up @@ -251,18 +271,28 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
#define TRAIT_MADNESS_IMMUNE "supermatter_madness_immune"

//non-mob traits
#define TRAIT_PARALYSIS "paralysis" //Used for limb-based paralysis, where replacing the limb will fix it
/// Used for limb-based paralysis, where replacing the limb will fix it.
#define TRAIT_PARALYSIS "paralysis"
/// Used for limbs.
/*#define TRAIT_DISABLED_BY_WOUND "disabled-by-wound"*/

#define TRAIT_HEARING_SENSITIVE "hearing_sensitive"

// item traits
#define TRAIT_NODROP "nodrop"
#define TRAIT_NO_STORAGE_INSERT "no_storage_insert" //cannot be inserted in a storage.
#define TRAIT_SPRAYPAINTED "spraypainted"
#define TRAIT_T_RAY_VISIBLE "t-ray-visible" // Visible on t-ray scanners if the atom/var/level == 1
#define TRAIT_NO_TELEPORT "no-teleport" //you just can't
#define TRAIT_STARGAZED "stargazed" //Affected by a stargazer
#define TRAIT_DOOR_PRYER "door-pryer" //Item can be used on airlocks to pry them open (even when powered)
#define TRAIT_NODROP "nodrop"
/// cannot be inserted in a storage.
#define TRAIT_NO_STORAGE_INSERT "no_storage_insert"
#define TRAIT_SPRAYPAINTED "spraypainted"
/// Visible on t-ray scanners if the atom/var/level == 1
#define TRAIT_T_RAY_VISIBLE "t-ray-visible"
/// you just can't
#define TRAIT_NO_TELEPORT "no-teleport"
/// Buckling yourself to objects with this trait won't immobilize you
#define TRAIT_NO_IMMOBILIZE "no_immobilize"
/// Affected by a stargazer
#define TRAIT_STARGAZED "stargazed"
/// Item can be used on airlocks to pry them open (even when powered)
#define TRAIT_DOOR_PRYER "door-pryer"
#define TRAIT_FISH_SAFE_STORAGE "fish_case" //Fish in this won't die
#define TRAIT_FISH_CASE_COMPATIBILE "fish_case_compatibile" //Stuff that can go inside fish cases
#define TRAIT_NEEDS_TWO_HANDS "needstwohands" // The items needs two hands to be carried
Expand Down Expand Up @@ -309,6 +339,7 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
// common trait sources
#define TRAIT_GENERIC "generic"
#define GENERIC_ITEM_TRAIT "generic_item"
#define UNCONSCIOUS_TRAIT "unconscious"
#define EYE_DAMAGE "eye_damage"
#define GENETIC_MUTATION "genetic"
#define OBESITY "obesity"
Expand All @@ -330,6 +361,20 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
#define CLOTHING_FEET_TRAIT "feet"
#define VEHICLE_TRAIT "vehicle" // inherited from riding vehicles
#define INNATE_TRAIT "innate"
#define CRIT_HEALTH_TRAIT "crit_health"
#define OXYLOSS_TRAIT "oxyloss"
/*#define TURF_TRAIT "turf"*/
#define BUCKLED_TRAIT "buckled" //trait associated to being buckled
#define CHOKEHOLD_TRAIT "chokehold" //trait associated to being held in a chokehold
#define RESTING_TRAIT "resting" //trait associated to resting
#define STAT_TRAIT "stat" //trait associated to a stat value or range of
/*(#define MAPPING_HELPER_TRAIT "mapping-helper" *///obtained from mapping helper
/// Trait associated to wearing a suit
#define SUIT_TRAIT "suit"
/// Trait associated to lying down (having a [lying_angle] of a different value than zero).
#define LYING_DOWN_TRAIT "lying-down"
/// Trait associated to lacking electrical power.
#define POWER_LACK_TRAIT "power-lack"
#define GLASSES_TRAIT "glasses"
#define CURSE_TRAIT "eldritch"
#define STATION_TRAIT "station-trait"
Expand Down Expand Up @@ -387,7 +432,22 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
#define BATTLE_ROYALE_TRAIT "battleroyale_trait"
#define MADE_UNCLONEABLE "made-uncloneable"
#define TRAIT_JAWS_OF_LIFE "jaws-of-life"
#define STICKY_NODROP "sticky-nodrop" //sticky nodrop sounds like a bad soundcloud rapper's name
#define STICKY_NODROP "sticky-nodrop" //sticky nodrop sounds like a ~~bad~~ fantastic soundcloud rapper's name
#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
#define LACKING_MANIPULATION_APPENDAGES_TRAIT "lacking-manipulation-appengades" //trait associated to not having fine manipulation appendages such as hands
#define HANDCUFFED_TRAIT "handcuffed"
/// Trait applied by by [/datum/component/soulstoned]
#define SOULSTONE_TRAIT "soulstone"
/// Trait applied to slimes by low temperature
#define SLIME_COLD "slime-cold"
/// Trait applied to bots by being tipped over
#define BOT_TIPPED_OVER "bot-tipped-over"
/// Trait applied to PAIs by being folded
#define PAI_FOLDED "pai-folded"
/// Trait applied to brain mobs when they lack external aid for locomotion, such as being inside a mech.
#define BRAIN_UNAIDED "brain-unaided"
#define TRAIT_PRESERVE_UI_WITHOUT_CLIENT "preserve_ui_without_client" //this mob should never close ui even if it doesn't have a client
#define EXPERIMENTAL_SURGERY_TRAIT "experimental_surgery"

Expand Down
2 changes: 1 addition & 1 deletion code/__HELPERS/atoms.dm
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
return FALSE
if(isliving(source))
var/mob/living/source_mob = source
if(source_mob.mobility_flags & MOBILITY_STAND)
if(source_mob.body_position == LYING_DOWN)
return FALSE
var/goal_dir = get_dir(source, target)
var/clockwise_source_dir = turn(source.dir, -45)
Expand Down
2 changes: 1 addition & 1 deletion code/__HELPERS/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ GLOBAL_LIST_EMPTY(species_list)
/*This can be used to add additional effects on interactions between mobs depending on how the mobs are facing each other, such as adding a crit damage to blows to the back of a guy's head.
Given how click code currently works (Nov '13), the initiating mob will be facing the target mob most of the time
That said, this proc should not be used if the change facing proc of the click code is overridden at the same time*/
if(!ismob(target) || !(target.mobility_flags & MOBILITY_STAND))
if(!isliving(target) || target.body_position == LYING_DOWN)
//Make sure we are not doing this for things that can't have a logical direction to the players given that the target would be on their side
return FALSE
if(initator.dir == target.dir) //mobs are facing the same direction
Expand Down
10 changes: 10 additions & 0 deletions code/_globalvars/traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@
*/
GLOBAL_LIST_INIT(traits_by_type, list(
/mob = list(
"TRAIT_KNOCKEDOUT" = TRAIT_KNOCKEDOUT,
"TRAIT_IMMOBILIZED" = TRAIT_IMMOBILIZED,
"TRAIT_FLOORED" = TRAIT_FLOORED,
"TRAIT_FORCED_STANDING" = TRAIT_FORCED_STANDING,
"TRAIT_HANDS_BLOCKED" = TRAIT_HANDS_BLOCKED,
"TRAIT_UI_BLOCKED" = TRAIT_UI_BLOCKED,
"TRAIT_PULL_BLOCKED" = TRAIT_PULL_BLOCKED,
"TRAIT_RESTRAINED" = TRAIT_RESTRAINED,
"TRAIT_INCAPACITATED" = TRAIT_INCAPACITATED,
"TRAIT_CRITICAL_CONDITION" = TRAIT_CRITICAL_CONDITION,
"TRAIT_BLIND" = TRAIT_BLIND,
"TRAIT_MUTE" = TRAIT_MUTE,
"TRAIT_EMOTEMUTE " = TRAIT_EMOTEMUTE,
Expand Down
3 changes: 0 additions & 3 deletions code/_onclick/ai.dm
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
/*
AI ClickOn()

Note currently ai restrained() returns 0 in all cases,
therefore restrained code has been removed

The AI can double click to move the camera (this was already true but is cleaner),
or double click a mob to track them.

Expand Down
13 changes: 3 additions & 10 deletions code/_onclick/click.dm
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@
var/obj/mecha/M = loc
return M.click_action(A,src,params)

if(restrained())
if(HAS_TRAIT(src, TRAIT_HANDS_BLOCKED))
changeNext_move(CLICK_CD_HANDCUFFED) //Doing shit in cuffs shall be vey slow
RestrainedClickOn(A)
UnarmedAttack(A)
return
Tsar-Salat marked this conversation as resolved.
Show resolved Hide resolved

if(throw_mode && throw_item(A))
Expand Down Expand Up @@ -160,6 +160,7 @@

//Is the atom obscured by a PREVENT_CLICK_UNDER_1 object above it
/atom/proc/IsObscured()
SHOULD_BE_PURE(TRUE)
if(!isturf(loc)) //This only makes sense for things directly on turfs for now
return FALSE
var/turf/T = get_turf_pixel(src)
Expand Down Expand Up @@ -273,14 +274,6 @@
*/
/mob/proc/RangedAttack(atom/A, params)
SEND_SIGNAL(src, COMSIG_MOB_ATTACK_RANGED, A, params)
/*
Restrained ClickOn

Used when you are handcuffed and click things.
Not currently used by anything but could easily be.
*/
/mob/proc/RestrainedClickOn(atom/A)
return

/**
* Middle click
Expand Down
Loading