-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathliving.dm
More file actions
273 lines (229 loc) · 12.6 KB
/
Copy pathliving.dm
File metadata and controls
273 lines (229 loc) · 12.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
// living_flags
/// 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)
/// Always does *deathgasp when they die
/// If unset mobs will only deathgasp if supplied a death sound or custom death message
#define ALWAYS_DEATHGASP (1<<1)
/// Nutrition changed last life tick, so we should bulk update this tick
#define QUEUE_NUTRITION_UPDATE (1<<3)
// NON-MODULE CHANGE
// Sticking these here for now because i'm dumb
/// Updating a mob's movespeed when lacking limbs. (list/modifiers)
#define COMSIG_LIVING_LIMBLESS_MOVESPEED_UPDATE "living_get_movespeed_modifiers"
// -- Defines for the pain system. --
/// Sent when a carbon gains pain. (source = mob/living/carbon/human, obj/item/bodypart/affected_bodypart, amount, type)
#define COMSIG_CARBON_PAIN_GAINED "pain_gain"
/// Sent when a carbon loses pain. (source = mob/living/carbon/human, obj/item/bodypart/affected_bodypart, amount, type)
#define COMSIG_CARBON_PAIN_LOST "pain_loss"
/// Sent when a temperature pack is applied to a mob. (source = obj/item/temperature_pack)
#define COMISG_TEMPERATURE_PACK_ENABLED "temperature_pack_enabled"
/// Sent when a temperature pack runs out of juice. (source = obj/item/temperature_pack)
#define COMSIG_TEMPERATURE_PACK_EXPIRED "temp_pack_expired"
#define COMSIG_HUMAN_ON_HANDLE_BLOOD "human_on_handle_blood"
#define HANDLE_BLOOD_HANDLED (1<<0)
#define HANDLE_BLOOD_NO_NUTRITION_DRAIN (1<<1)
#define HANDLE_BLOOD_NO_EFFECTS (1<<2)
#define COMSIG_LIVING_BODY_TEMPERATURE_CHANGE "living_body_temperature_change"
#define COMSIG_LIVING_HOMEOSTASIS "living_homeostasis"
/// Return to do no homeostasis at all
#define HOMEOSTASIS_HANDLED (1<<0)
/// Return to not reduce hunger at all
#define HOMEOSTASIS_NO_HUNGER (1<<1)
//from base of living/set_pull_offset(): (mob/living/pull_target, grab_state)
#define COMSIG_LIVING_SET_PULL_OFFSET "living_set_pull_offset"
//from base of living/reset_pull_offsets(): (mob/living/pull_target, override)
#define COMSIG_LIVING_RESET_PULL_OFFSETS "living_reset_pull_offsets"
//from base of living/CanAllowThrough(): (atom/movable/mover, border_dir)
#define COMSIG_LIVING_CAN_ALLOW_THROUGH "living_can_allow_through"
#define COMPONENT_LIVING_PASSABLE (1<<0)
/// Send when sharing body temperature to breath
#define COMSIG_HUMAN_ON_HANDLE_BREATH_TEMPERATURE "human_on_handle_breath_temperature"
/// Stops further processing
#define HANDLE_BREATH_TEMPERATURE_HANDLED (1<<0)
#define COMSIG_CARBON_HEARTBEAT "carbon_heartbeat"
#define HEARTBEAT_HANDLED (1<<0)
/// Movable is pinning a mob (source = the mob doing the pinning, mob/living/pinned_mob)
#define COMSIG_MOVABLE_PINNING_MOB "movable_pinning_mob"
/// Movable is unpinning a mob (source = the mob doing the unpinning, mob/living/unpinned_mob)
#define COMSIG_MOVABLE_UNPINNING_MOB "movable_unpinning_mob"
/// Living mob is being pinned by some movable (source = the movable doing the pinning, atom/movable/pinning)
#define COMSIG_LIVING_PINNED_BY "living_pinned_by"
/// Living mob is being unpinned by some movable (source = the movable doing the unpinning, atom/movable/unpinning)
#define COMSIG_LIVING_UNPINNED_BY "living_unpinned_by"
/// Various lists of body zones affected by pain.
#define BODY_ZONES_ALL list(BODY_ZONE_HEAD, BODY_ZONE_CHEST, BODY_ZONE_L_ARM, BODY_ZONE_R_ARM, BODY_ZONE_L_LEG, BODY_ZONE_R_LEG)
#define BODY_ZONES_MINUS_HEAD list(BODY_ZONE_CHEST, BODY_ZONE_L_ARM, BODY_ZONE_R_ARM, BODY_ZONE_L_LEG, BODY_ZONE_R_LEG)
#define BODY_ZONES_LIMBS list(BODY_ZONE_L_ARM, BODY_ZONE_R_ARM, BODY_ZONE_L_LEG, BODY_ZONE_R_LEG)
#define BODY_ZONES_MINUS_CHEST list(BODY_ZONE_HEAD, BODY_ZONE_L_ARM, BODY_ZONE_R_ARM, BODY_ZONE_L_LEG, BODY_ZONE_R_LEG)
/// List of some emotes that convey pain.
#define PAIN_EMOTES list("wince", "gasp", "grimace", "shiver", "sway", "twitch_s", "whimper", "inhale_s", "exhale_s", "groan")
/// Amount of pain gained (to chest) from dismembered limb
#define PAIN_LIMB_DISMEMBERED 120
/// Amount of pain gained (to chest) from surgically removed limb
#define PAIN_LIMB_REMOVED 30
// Defines for pain (and shock) gained by surgery
#define SURGERY_PAIN_TRIVIAL 6
#define SURGERY_PAIN_LOW 12
#define SURGERY_PAIN_MEDIUM 18
#define SURGERY_PAIN_HIGH 24
#define SURGERY_PAIN_SEVERE 36
#define SURGERY_PAIN_CRITICAL 48
/// Cap on shock level
#define MAX_TRAUMATIC_SHOCK 200
/// Hard cap on pain level
#define MAX_LIMB_PAIN 300
/// Checks if a mob can feel pain.
#define CAN_FEEL_PAIN(mob) (mob?.stat <= SOFT_CRIT && mob?.pain_controller?.pain_modifier > 0.33)
// Keys for pain modifiers
#define PAIN_MOD_CHEMS "chems"
#define PAIN_MOD_NEAR_DEATH "near-death"
#define PAIN_MOD_KOD "ko-d"
#define PAIN_MOD_RECENT_SHOCK "recently-shocked"
#define PAIN_MOD_QUIRK "quirk"
#define PAIN_MOD_SPECIES "species"
#define PAIN_MOD_OFF_STATION "off-station-pain-resistance"
#define PAIN_MOD_STATUS_EFFECT "status_effect"
// ID for traits and modifiers gained by pain
#define PAIN_LIMB_PARALYSIS "pain_paralysis"
#define MOVESPEED_ID_PAIN "pain_movespeed"
#define ACTIONSPEED_ID_PAIN "pain_actionspeed"
/// If the mob enters shock, they will have +1 cure condition (helps cure it faster)
#define TRAIT_ABATES_SHOCK "shock_abated"
/// All this trait does is change your stat to soft crit, which itself doesn't do much,
/// but as your stat is changed many stat checks will block you (such as using the radio)
#define TRAIT_SOFT_CRIT "soft_crit"
/// Skip a breath once in every x breaths (where x is ticks between breaths)
#define TRAIT_LABOURED_BREATHING "laboured_breathing"
/// Blocks losebreath from accumulating from things such as heart attacks or choking
#define TRAIT_ASSISTED_BREATHING "assisted_breathing"
/// Stops organs from decaying while dead
#define TRAIT_NO_ORGAN_DECAY "no_organ_decay"
/// Don't get slowed down by aggro grabbing (or above)
#define TRAIT_NO_GRAB_SPEED_PENALTY "no_grab_speed_penalty"
/// Doesn't let a mob shift this atom around with move_pulled
#define TRAIT_NO_MOVE_PULL "no_move_pull"
/// Does not harm patients when undergoing CPR
#define TRAIT_CPR_CERTIFIED "cpr_certified"
/// Boosts the heart rate of the mob (raises blood pressure)
/// One application of the trait translates to +10 bpm, which may translate to +10 blood pressure
#define TRAIT_HEART_RATE_BOOST "heart_rate_boost"
/// Slows the heart rate of the mob (lowers blood pressure)
/// One application of the trait translates to -10 bpm, which may translate to -10 blood pressure
#define TRAIT_HEART_RATE_SLOW "heart_rate_slow"
/// Constricts blood vessels (raises blood pressure)
/// One application of the trait translates to +0.2 "vasoconstriction", which is a +0.2 multiplier to blood pressure
#define TRAIT_VASOCONSTRICTED "vasoconstricted"
/// Dilates blood vessels (lowers blood pressure)
/// One application of the trait translates to -0.2 "vasodilation", which is a -0.2 multiplier to blood pressure
#define TRAIT_VASODILATED "vasodilated"
/// Attempts to stabilize the heart, boosting it if it's too slow and slowing it if it's too fast.
#define TRAIT_HEART_RATE_STABILIZED "heart_rate_stabilized"
/// The trait that determines if someone has the robotic limb reattachment quirk.
#define TRAIT_ROBOTIC_LIMBATTACHMENT "trait_robotic_limbattachment"
/// Mob can walk despite having two disabled/missing legs so long as they have two of this trait.
/// Kind of jank, refactor at a later day when I can think of a better solution.
/// Just be sure to call update_limbless_locomotion() after applying / removal
#define TRAIT_NO_LEG_AID "no_leg_aid"
/// Eyelids are closed so long as this trait is present
#define TRAIT_CLOSED_EYES "closed_eyes"
/// Attach to a turf to have whispers project across it if the speaker is facing it
/// (basically expanding the range of whispers by one tile in the direction of the speaker)
/// Used to allow people to whisper across desks/tables since they otherwise are too distant
#define TRAIT_TURF_PROJECTS_WHISPERS "projects_whispers"
#define COLOR_BLOOD "#c90000"
/// Helper for picking between left or right when given a value
/// Used primarily for hand or foot indexes
#define SELECT_LEFT_OR_RIGHT(value, left, right) (IS_LEFT_INDEX(value) ? left : right)
// Used in ready menu anominity
/// Hide ckey
#define CKEY_ANON (1<<0)
/// Hide character name
#define NAME_ANON (1<<1)
/// Hide top job preference
#define JOB_ANON (1<<2)
/// Calculates oxyloss cap
#define MAX_OXYLOSS(maxHealth) (maxHealth * 2)
// Frozen item temperature pack defaults
#define FROZEN_ITEM_PAIN_RATE 0.1 // so cold that it barely heals
#define FROZEN_ITEM_PAIN_MODIFIER 0.25
#define FROZEN_ITEM_TEMPERATURE_CHANGE -2 KELVIN
// Some source defines for pain and consciousness
// Consciousness ones are human readable because of laziness (they are shown in cause of death)
#define PAINSHOCK "traumatic shock"
#define PAINCRIT "paincrit"
#define PAIN "pain"
#define HUNGER "starvation"
#define BRAIN_DAMAGE "brain damage"
#define BLOOD_LOSS "blood loss"
#define BLUNT_DAMAGE "blunt force trauma"
#define BURN_DAMAGE "severe burns"
#define OXY_DAMAGE "suffocation"
#define TOX_DAMAGE "toxic poisoning"
// For SShealth_updates
/// Call update_damage_hud()
#define UPDATE_SELF_DAMAGE (1 << 0)
/// Call update_health_hud()
#define UPDATE_SELF_HEALTH (1 << 1)
/// Call med_hud_set_health()
#define UPDATE_MEDHUD_HEALTH (1 << 2)
/// Call med_hud_set_status()
#define UPDATE_MEDHUD_STATUS (1 << 3)
/// Call update_conscisouness()
#define UPDATE_CON (1 << 4)
/// Updates the entire medhud
#define UPDATE_MEDHUD (UPDATE_MEDHUD_HEALTH | UPDATE_MEDHUD_STATUS)
/// Updates associated self-huds on the mob
#define UPDATE_SELF (UPDATE_SELF_DAMAGE | UPDATE_SELF_HEALTH)
/// Threshold that heart beat becomes "slow"
#define SLOW_HEARTBEAT_THRESHOLD 60
/// Threshold that heart beat becomes "fast"
#define FAST_HEARTBEAT_THRESHOLD 110
/// Threshold that heart beat starts to cause heart damaage
#define DANGER_HEARTBEAT_THRESHOLD 160
/// Threshold that heart beat's heart damage doubles and it has a chance to stop outright
#define DEADLY_HEARTBEAT_THRESHOLD 200
// Used in living mob offset list for determining pixel offsets
#define PIXEL_W_OFFSET "w"
#define PIXEL_X_OFFSET "x"
#define PIXEL_Y_OFFSET "y"
#define PIXEL_Z_OFFSET "z"
/// Disables headset use, but not internal radio / intercom use
#define TRAIT_BLOCK_HEADSET_USE "block_headset_use"
/// Calculates hunger drain per step taken
#define BASE_MOVEMENT_HUNGER_DRAIN(amount, mob) ( amount * MOVEMENT_HUNGER_MULTIPLIER * (1 + length(mob.buckled_mobs) * 0.25) * (mob.move_intent == MOVE_INTENT_RUN ? 2 : 1) )
/// Checks if a mob is moving intentionally (ie, nothing is forcing them to move like another mob or a conveyor)
#define IS_MOVING_INTENTIONALLY(mob) ( mob.stat != DEAD && !mob.pulledby && !CHECK_MOVE_LOOP_FLAGS(mob, MOVEMENT_LOOP_OUTSIDE_CONTROL) )
/// Dwarf but without some side effects
#define TRAIT_SMALL "small_size_trait"
/// Giant but without some side effects
#define TRAIT_HUGE "huge_size_trait"
/// Formats text for an object for a mob that they are examining
/// - The mob is holding it: "your [thing.name]"
/// - Another mob is holding it: "[mob]'s [thing.name]"
/// - Then object is on the ground: "the [thing.name]"
#define EXAMINING_WHAT(examiner, thing) (thing.loc == examiner ? "your [thing.name]" : (ismob(thing.loc) ? "[thing.loc]'s [thing.name]" : thing ))
/// Formats text for an object for a mob witnessing another mob examining it
/// - The mob is holding it: "their [thing.name]"
/// - Another mob is holding it: "[other]'s [thing.name]"
/// - Viewer is holding it: "your [thing.name]"
/// - The object is on the ground: "the [thing.name]"
#define WITNESSING_EXAMINE_WHAT(examiner, thing, viewer) (thing.loc == examiner ? "[examiner.p_their()] [thing.name]" : EXAMINING_WHAT(viewer, thing))
/// For consistent examine span formatting (normal size)
#define examining_span_normal(msg) span_infoplain(span_italics(msg))
/// For consistent examine span formatting (small size)
#define examining_span_small(msg) span_slightly_smaller(span_infoplain(span_italics(msg)))
// Smell intensities
/// Very faint - Often low enough to not noticed, but if noticed, people get used to it quickly
#define SMELL_INTENSITY_FAINT 1
/// Will be noticed for a short time but eventually people get used to it
#define SMELL_INTENSITY_WEAK 6
/// Noticable, will take a while to get used to
#define SMELL_INTENSITY_MODERATE 12
/// Very strong, hard to ignore, very unlikely to get used to
#define SMELL_INTENSITY_STRONG 24
/// Overpowers all other smells, extremely hard to ignore
#define SMELL_INTENSITY_OVERPOWERING 48
/// Damtype is "physical" like a slap to the face
#define IS_PHYSICAL_DAMAGE(damage_type) (damage_type == BRUTE || damage_type == BURN)
/// Damtype is intended to disable rather than kill
#define IS_DISABLING_DAMAGE(damage_type) (damage_type == STAMINA || damage_type == PAIN)