diff --git a/aurorastation.dme b/aurorastation.dme index b2646e9f75a..3662c98958d 100644 --- a/aurorastation.dme +++ b/aurorastation.dme @@ -543,6 +543,7 @@ #include "code\datums\components\skills\medical\medicine_skill_component.dm" #include "code\datums\components\skills\medical\pharmacology_skill_component.dm" #include "code\datums\components\skills\medical\surgery_skill_component.dm" +#include "code\datums\components\skills\operations\conditioning_skill_component.dm" #include "code\datums\components\skills\operations\pilot_mechs_skill_component.dm" #include "code\datums\components\skills\operations\pilot_spacecraft_skill_component.dm" #include "code\datums\components\skills\operations\robotics_skill_component.dm" diff --git a/code/__DEFINES/_unit_tests.dm b/code/__DEFINES/_unit_tests.dm index f08c7f42f27..fa7c625a3e5 100644 --- a/code/__DEFINES/_unit_tests.dm +++ b/code/__DEFINES/_unit_tests.dm @@ -94,14 +94,39 @@ #define TEST_OUTPUT_YELLOW(text) (text) #endif +/* + REMOVE BEFORE FLIGHT TESTING FLAGS + + These all are used for physics/calculus + methods which are extremely sensitive to specific domains. + The test flags don't compile in live code, but in tests will force + test fails if the condition is not respected. + */ +#ifdef UNIT_TEST // REMOVE BEFORE FLIGHT /** * To be used in procs that involve calculus methods (either seconds_per_tick or delta_time). * This enforces that said proc MUST have a valid seconds_per_tick given to it by all callers. */ -#ifdef UNIT_TEST // REMOVE BEFORE FLIGHT #define ENFORCE_CALCULUS(seconds_per_tick) \ if (seconds_per_tick <= 0)\ CRASH("[caller.name] called [callee.name] without passing in seconds_per_tick (or gave a negative time). This proc MUST be given a positive and non-zero seconds_per_tick value."); +/// Test flag for forcing species mass_modifier to be a positive number. +#define ENFORCE_POSITIVE_SPECIES_MASS(mass) \ + if (mass <= 0)\ + CRASH("[src.type] set mass_modifier as [mass]. mass_modifier MUST BE A POSITIVE NUMBER, NOT 0 OR NEGATIVE."); + +/// Test flag for forcing mass must be a positive number +#define ENFORCE_POSITIVE_MASS(mass) \ + if (mass <= 0)\ + CRASH("[src.type] set mass as [mass]. mass MUST BE A POSITIVE NUMBER, NOT 0 OR NEGATIVE."); #else +/** + * To be used in procs that involve calculus methods (either seconds_per_tick or delta_time). + * This enforces that said proc MUST have a valid seconds_per_tick given to it by all callers. + */ #define ENFORCE_CALCULUS(seconds_per_tick) +/// Test flag for forcing species mass_modifier to be a positive number. +#define ENFORCE_POSITIVE_SPECIES_MASS(mass) +/// Test flag for forcing mass must be a positive number +#define ENFORCE_POSITIVE_MASS(mass) #endif diff --git a/code/__DEFINES/components.dm b/code/__DEFINES/components.dm index 033a7025362..cbcafd0159c 100644 --- a/code/__DEFINES/components.dm +++ b/code/__DEFINES/components.dm @@ -30,6 +30,7 @@ #define CAROUSING_SKILL_COMPONENT /datum/component/skill/carousing #define TENACITY_SKILL_COMPONENT /datum/component/skill/tenacity #define MINISTRY_SKILL_COMPONENT /datum/component/skill/ministry +#define CONDITIONING_SKILL_COMPONENT /datum/component/skill/conditioning /** * Trinary-Boolean helper that either returns null, or the skill level of a given skill component(which can be zero). diff --git a/code/__DEFINES/dcs/signals.dm b/code/__DEFINES/dcs/signals.dm index 5b68f267610..5d65a9b0ee6 100644 --- a/code/__DEFINES/dcs/signals.dm +++ b/code/__DEFINES/dcs/signals.dm @@ -52,7 +52,7 @@ ///Mob is trying to open the wires of a target [/atom], from /datum/wires/interactable(): (atom/target) #define COMSIG_TRY_WIRES_INTERACT "try_wires_interact" #define COMPONENT_CANT_INTERACT_WIRES (1<<0) - +#define COMSIG_GET_EFFECTIVE_MASS "get_effective_mass" /// Sent from /proc/do_after if someone starts a do_after action bar. #define COMSIG_DO_AFTER_BEGAN "mob_do_after_began" diff --git a/code/__DEFINES/mobs.dm b/code/__DEFINES/mobs.dm index cfb9545b8c3..a7364896b8d 100644 --- a/code/__DEFINES/mobs.dm +++ b/code/__DEFINES/mobs.dm @@ -327,13 +327,88 @@ /// Superheavy mobs. Gonna need a lot of help with those. #define MOB_WEIGHT_SUPERHEAVY 4 +/* + Mob Reference Masses + */ +// Reference Masses of different Mobs. Unlike MOB_WEIGHT, these represent a physics-typed value, and thus can be used directly in Kinematic Equations. +// Note: These values absolutely must be in Kilograms, I'm terribly sorry for any Americans reading this, but these get included in physics equations that require Kg inputs. + +// For any species with sexual dimorphism, the Reference Mass is 1/n * (sum of average mass of each sex). +// To give an example, an average adult female human weighs 62kg, and 80kg for an average adult male human. +// 62 + 80.7 = 142.7. Since there's two examples, 142.7 / 2 = 71.35, which to "fudge things a little" I round up to 72kg. +// Hence humans being 72.0kg and not 62.0kg. + +// If you're making an alien with sexual dimorphism (or trimorphism, or polymorphism), the same pattern as humans can be followed. +// Whereas for aliens without notable differences, you can just use a single average number. +// It's perfectly reasonable to just give a rough guess, none of these numbers need to be perfectly exact or even clean, just in a general ballpark. + +/// Average mass of a human (in Kg) +#define REFERENCE_MASS_HUMAN 72.0 + +/// Average mass of an Offworlder (in Kg) +#define REFERENCE_MASS_HUMAN_OFFWORLDER 62.0 + +/// Average mass of an Interstellar Megacorporation CEO (in Kg) +#define REFERENCE_MASS_CEO 76.4 // Megacorp lore requested this. :) + +/// Average mass of a Skrell (in Kg) +#define REFERENCE_MASS_SKRELL 40.8 + +/// Average mass of an Axiori Skrell (in Kg) +#define REFERENCE_MASS_SKRELL_AXIORI 52.3 + +/// Average mass of a Diona (in Kg) +#define REFERENCE_MASS_DIONA 200 + +/// Average mass of a Diona Coeus (in Kg) +#define REFERENCE_MASS_DIONA_COEUS 100 + +/// Average mass of an Unathi (in Kg) +#define REFERENCE_MASS_UNATHI 120 + +/// Average mass of an IPC (in Kg) +#define REFERENCE_MASS_IPC 125 + +/// Average mass of a Shell (in Kg) +#define REFERENCE_MASS_IPC_SHELL 92.0 + +/// Average mass of an Industrial IPC (in Kg) +#define REFERENCE_MASS_IPC_INDUSTRIAL 200 + +/// Average mass of a (Njarir or Hharar) Tajara (in Kg) +#define REFERENCE_MASS_TAJARA 80.0 + +/// Average mass of a M'sai Tajara (in Kg) +#define REFERENCE_MASS_TAJARA_MSAI 85.2 + +/// Average mass of a Zhan Tajara (in Kg) +#define REFERENCE_MASS_TAJARA_ZHAN 92.9 + +/// Average mass of a Tesla Rejuv Suit (in Kg) +#define REFERENCE_MASS_TAJARA_TESLA 500 + +/// Average mass of a Vaurca Worker (in Kg) +#define REFERENCE_MASS_VAURCA_KA 85.0 + +/// Average mass of a Vaurca Warrior (in Kg) +#define REFERENCE_MASS_VAURCA_ZA 80.2 + +/// Average mass of a Vaurca Breeder (in Kg) +#define REFERENCE_MASS_VAURCA_TA 1000 // BEEG + +/// Average mass of a Vaurca Bulwark (in Kg) +#define REFERENCE_MASS_VAURCA_RA 363 + +/// Average mass of a Vaurca Warform (in Kg) +#define REFERENCE_MASS_VAURCA_BA 800 + // Mob strength. This allows us to represent stronger mobs with a bit more granularity. Robots should be stronger than normal people. A bonus to the checks on lifting/throwing mobs, essentially. /// A normal mob, basically. Does not get us any buffs. -#define MOB_STRENGTH_NORMAL 0 +#define MOB_STRENGTH_NORMAL 1.25 /// A strong mob. Small bonus. -#define MOB_STRENGTH_STRONG 1 +#define MOB_STRENGTH_STRONG 1.5 /// A very strong mob. Big bonus. -#define MOB_STRENGTH_VERY_STRONG 2 +#define MOB_STRENGTH_VERY_STRONG 2.0 #define BASE_MAX_NUTRITION 600 #define HUNGER_FACTOR 0.04 // Factor of how fast mob nutrition decreases over time. diff --git a/code/datums/components/skills/operations/conditioning_skill_component.dm b/code/datums/components/skills/operations/conditioning_skill_component.dm new file mode 100644 index 00000000000..542bb2b0129 --- /dev/null +++ b/code/datums/components/skills/operations/conditioning_skill_component.dm @@ -0,0 +1,20 @@ +/datum/component/skill/conditioning + /** + * A standard humanoid can be assumed to have a "Comfortable Maximum Lift" around 1.25x their mass. + * Certain species have a significantly higher multiplier. + * But regardless of species, each purchased rank in Conditioning increases this limit by 0.25x. + * This is done by making the game situationally treat the character's mass as a larger number. + **/ + var/bonus_mass_per_rank = 0.25 + +/datum/component/skill/conditioning/Initialize(level) + . = ..() + RegisterSignal(parent, COMSIG_GET_EFFECTIVE_MASS, PROC_REF(get_mass_modifiers), override = TRUE) + +/datum/component/skill/conditioning/Destroy(force) + UnregisterSignal(parent, COMSIG_GET_EFFECTIVE_MASS) + return ..() + +/datum/component/skill/conditioning/proc/get_mass_modifiers(atom/movable/owner, effective_mass) + SIGNAL_HANDLER + *effective_mass = *effective_mass * (1 + (bonus_mass_per_rank * (skill_level - 1))) diff --git a/code/datums/skills/occupational/operations.dm b/code/datums/skills/occupational/operations.dm index 41bf82e8073..87502d3855e 100644 --- a/code/datums/skills/occupational/operations.dm +++ b/code/datums/skills/occupational/operations.dm @@ -118,3 +118,20 @@ ) required = TRUE component_type = PILOT_MECHS_SKILL_COMPONENT + +/singleton/skill/conditioning + name = "Conditioning" + description = "Governs a character's ability to pick up, drag, and throw heavy objects, particularly crates and people. " \ + + "By default, most characters can comfortably lift or drag 1.25x their body weight without penalty. " \ + + "This includes determining how heavy a character you can fireman carry, and with how much slowdown. " + maximum_level = SKILL_LEVEL_PROFESSIONAL + uneducated_skill_cap = SKILL_LEVEL_PROFESSIONAL + category = /singleton/skill_category/occupational + subcategory = SKILL_SUBCATEGORY_OPERATIONS + skill_level_descriptions = alist( + SKILL_LEVEL_UNFAMILIAR = "You have no modifiers from your Conditioning.", + SKILL_LEVEL_FAMILIAR = "Your maximum Lift Capacity is increased by 25%", + SKILL_LEVEL_TRAINED = "Your maximum Lift Capacity is increased by 50%", + SKILL_LEVEL_PROFESSIONAL = "Your maximum Lift Capacity is increased by 75%" + ) + component_type = CONDITIONING_SKILL_COMPONENT diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index 6ac8ac31238..9704d222b63 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -112,8 +112,22 @@ var/atmos_canpass = CANPASS_ALWAYS + /** + * Mass of an object in Kilograms (Kg) to be used for physics systems and kinematics. + * EG: Linear Impulse (m/s) = Momentum (kg m/s) / Mass (kg) + * Acceleration (m/s^2) = Force (kg m/s^2) / Mass (kg) + * + * This is ASSERTED to ALWAYS be a POSITIVE, NONZERO number. It is therefore always safe to divide by. + * + * For the love of god don't spam #define for each and every single object. + * It's perfectly reasonable to set crowbar/mass = 5.0 and voidsuit/mass = 68.0 + * And leave it at that. It's a float. You're going to go insane if you make 10 million defines for it. + **/ + var/mass = 1.0 //kg + /atom/movable/Initialize(mapload, ...) . = ..() + ENFORCE_POSITIVE_MASS(mass) update_emissive_blocker() if(opacity) @@ -1293,3 +1307,18 @@ SEND_SIGNAL(src, COMSIG_MOVABLE_UPDATE_GLIDE_SIZE, target) glide_size = target +/** + * Returns the "effective mass" of a kinematic (movable) object with signal modifiers. + * Which is useful for "Strength" calculations, or for representing an object as being "Unwieldy". + * + * This will ALWAYS return a POSITIVE, NONZERO number. Meaning it is safe to divide by. + */ +/atom/movable/proc/get_effective_mass() + ENFORCE_POSITIVE_MASS(mass) + + var/effective_mass = mass + SEND_SIGNAL(src, COMSIG_GET_EFFECTIVE_MASS, &effective_mass) + if (effective_mass <= 0) + stack_trace("[caller.name] requested an Effective Mass and got a non-positive number") + return 1.0 + return effective_mass diff --git a/code/modules/emotes/definitions/_species.dm b/code/modules/emotes/definitions/_species.dm index 509fa4ed47e..0d8d09f3bdf 100644 --- a/code/modules/emotes/definitions/_species.dm +++ b/code/modules/emotes/definitions/_species.dm @@ -1,6 +1,3 @@ -/datum/species - var/list/default_emotes = list() - /mob/living/carbon/update_emotes() . = ..(skip_sort=1) if(species) diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm index 6d627ec0414..7ba8cf5677f 100644 --- a/code/modules/mob/inventory.dm +++ b/code/modules/mob/inventory.dm @@ -422,8 +422,9 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( item = G.throw_held() //throw the person instead of the grab if(ismob(item) && G.state >= GRAB_NECK) var/mob/M = item - if(M.mob_weight > get_mob_strength()) - to_chat(src, SPAN_WARNING("[M] is far too heavy for you to throw around!")) + var/grabber_strength = get_effective_mass() * mob_strength + if(M.mass > grabber_strength) + to_chat(src, SPAN_WARNING("[M] is heavier (or more unwieldy) than your limit of [grabber_strength]kg, you cannot throw them!")) return throw_range = round(throw_range * (src.mob_size/M.mob_size)) diff --git a/code/modules/mob/living/autohiss.dm b/code/modules/mob/living/autohiss.dm index 90a356d7a66..561deca9418 100644 --- a/code/modules/mob/living/autohiss.dm +++ b/code/modules/mob/living/autohiss.dm @@ -27,16 +27,6 @@ autohiss_mode = AUTOHISS_OFF to_chat(src, "Auto-hiss is now OFF.") -/datum/species - var/has_autohiss = FALSE - var/list/autohiss_basic_map = null - var/list/autohiss_extra_map = null - var/list/autohiss_exempt = null - var/list/autohiss_basic_extend = null - var/list/autohiss_extra_extend = null - var/autohiss_extender = "..." - var/ignore_subsequent = FALSE - /datum/species/unathi autohiss_basic_map = list( "s" = list("ss", "sss", "ssss") diff --git a/code/modules/mob/living/carbon/carbon_defines.dm b/code/modules/mob/living/carbon/carbon_defines.dm index 12f41aec587..323672bfb9a 100644 --- a/code/modules/mob/living/carbon/carbon_defines.dm +++ b/code/modules/mob/living/carbon/carbon_defines.dm @@ -65,3 +65,5 @@ /// Hallucinations currently affecting the mob. Not to be confused with singular "hallucination" which is a NUM variable like confused/drowsy/eye_blind etc var/list/hallucinations = list() var/shock_stage = 0 + + mass = REFERENCE_MASS_HUMAN diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 3bdc8eafb4a..644e2aba0a2 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -1508,7 +1508,7 @@ else to_chat(usr, SPAN_WARNING("You failed to check the pulse. Try again.")) -/mob/living/carbon/human/proc/set_species(var/new_species, var/default_colour, var/kpg=0, var/change_hair = TRUE) +/mob/living/carbon/human/proc/set_species(new_species, default_colour, kpg = 0, change_hair = TRUE) cached_bodytype = null if(!dna) if(!new_species) @@ -1635,6 +1635,7 @@ client.init_verbs() update_emotes() + mass = initial(mass) * species.mass_modifier if(species) return TRUE diff --git a/code/modules/mob/living/carbon/human/human_defines.dm b/code/modules/mob/living/carbon/human/human_defines.dm index 2713cbae6b2..c4bcbc8bfff 100644 --- a/code/modules/mob/living/carbon/human/human_defines.dm +++ b/code/modules/mob/living/carbon/human/human_defines.dm @@ -172,6 +172,11 @@ /// Pref holder for the speech bubble style. var/speech_bubble_type + // Some player characters are of type human and some are of type ../carbon + // Confusingly human includes most (but not all) aliens. + // For redundancy I'm stating this here as well as in /carbon + mass = REFERENCE_MASS_HUMAN + var/med_record = "" var/sec_record = "" var/list/incidents = list() diff --git a/code/modules/mob/living/carbon/human/human_movement.dm b/code/modules/mob/living/carbon/human/human_movement.dm index 6eb6fd802d7..db3c303c678 100644 --- a/code/modules/mob/living/carbon/human/human_movement.dm +++ b/code/modules/mob/living/carbon/human/human_movement.dm @@ -51,14 +51,13 @@ if((mutations & mRun)) tally = 0 - if(isitem(pulling) && !(species.flags & NO_EQUIP_SPEEDMODS)) - var/obj/item/P = pulling - tally += P.slowdown + var/effective_mass = get_effective_mass() + if(pulling && pulling.mass > mass) + tally += pulling.mass / effective_mass var/obj/item/grab/grab = get_type_in_hands(/obj/item/grab) - if(istype(grab) && ishuman(grab.affecting)) - if(grab.affecting.mob_weight > get_mob_strength()) - tally += grab.affecting.mob_weight - get_mob_strength() + if(istype(grab) && ismovable(grab.affecting) && grab.affecting.mass > mass) + tally += grab.affecting.mass / effective_mass var/turf/T = get_turf(src) if(T) // changelings don't get movement costs @@ -79,7 +78,6 @@ if(!isnull(facing_dir) && facing_dir != dir) tally += 3 - tally = round(tally, 0.1) return tally diff --git a/code/modules/mob/living/carbon/human/species/species.dm b/code/modules/mob/living/carbon/human/species/species.dm index 631e29063fd..48ce3be721c 100644 --- a/code/modules/mob/living/carbon/human/species/species.dm +++ b/code/modules/mob/living/carbon/human/species/species.dm @@ -472,10 +472,33 @@ /// A list of species components that should only EVER apply to this species. This is because some components must be removed if the species changes (imagine changing from IPC to human as a merc). var/list/species_components + var/list/default_emotes = list() + + // Vars used for Autohiss + var/has_autohiss = FALSE + var/list/autohiss_basic_map = null + var/list/autohiss_extra_map = null + var/list/autohiss_exempt = null + var/list/autohiss_basic_extend = null + var/list/autohiss_extra_extend = null + var/autohiss_extender = "..." + var/ignore_subsequent = FALSE + + /** + * The "Mass Modifier" used to set the starting mass of a player character for a given species. + * This should always be written as REFERENCE_MASS_SPECIES / REFERENCE_MASS_HUMAN + * This division by REFERENCE_MASS_HUMAN will be algebraically cancelled out, + * when multiplied by the humanoid character's standard mass (which happens to be REFERENCE_MASS_HUMAN) + * + * This is a pure number ratio (kg / kg), it has no SI Units. + */ + var/mass_modifier = REFERENCE_MASS_HUMAN / REFERENCE_MASS_HUMAN + /datum/species/proc/get_eyes(var/mob/living/carbon/human/H) return /datum/species/New() + ENFORCE_POSITIVE_SPECIES_MASS(mass_modifier) if(hud_type) hud = new hud_type() else diff --git a/code/modules/mob/living/carbon/human/species/station/diona/diona.dm b/code/modules/mob/living/carbon/human/species/station/diona/diona.dm index 787c10327e4..b795b44cf21 100644 --- a/code/modules/mob/living/carbon/human/species/station/diona/diona.dm +++ b/code/modules/mob/living/carbon/human/species/station/diona/diona.dm @@ -148,6 +148,8 @@ They are very slow, reasonably strong, and quite durable. They also require ligh tail_animation = 'icons/mob/species/diona/tail.dmi' selectable_tails = list("No Tail", "Unathi Tail") + mass_modifier = REFERENCE_MASS_DIONA / REFERENCE_MASS_HUMAN + /datum/species/diona/can_understand(var/mob/other) var/mob/living/carbon/alien/diona/D = other if(istype(D)) diff --git a/code/modules/mob/living/carbon/human/species/station/diona/diona_subspecies.dm b/code/modules/mob/living/carbon/human/species/station/diona/diona_subspecies.dm index d6cadbbf1b5..40d92ccf492 100644 --- a/code/modules/mob/living/carbon/human/species/station/diona/diona_subspecies.dm +++ b/code/modules/mob/living/carbon/human/species/station/diona/diona_subspecies.dm @@ -25,3 +25,4 @@ In return, they are generally substantially more fragile, being especially susce pain_mod = 2 brute_mod = 1.1 burn_mod = 1.3 + mass_modifier = REFERENCE_MASS_DIONA_COEUS / REFERENCE_MASS_HUMAN diff --git a/code/modules/mob/living/carbon/human/species/station/human/human_subspecies.dm b/code/modules/mob/living/carbon/human/species/station/human/human_subspecies.dm index 3f8de75ecd9..c23219b6f9f 100644 --- a/code/modules/mob/living/carbon/human/species/station/human/human_subspecies.dm +++ b/code/modules/mob/living/carbon/human/species/station/human/human_subspecies.dm @@ -24,6 +24,7 @@ hazard_low_pressure = 10 examine_color = "#C2AE95" + mass_modifier = REFERENCE_MASS_HUMAN_OFFWORLDER / REFERENCE_MASS_HUMAN /datum/species/human/offworlder/equip_later_gear(var/mob/living/carbon/human/H) if(istype(H.get_equipped_item(slot_back), /obj/item/storage/backpack) && H.equip_to_slot_or_del(new /obj/item/storage/pill_bottle/rmt(H.back), slot_in_backpack)) diff --git a/code/modules/mob/living/carbon/human/species/station/ipc/ipc.dm b/code/modules/mob/living/carbon/human/species/station/ipc/ipc.dm index 7930b942fcf..65a8a757ddc 100644 --- a/code/modules/mob/living/carbon/human/species/station/ipc/ipc.dm +++ b/code/modules/mob/living/carbon/human/species/station/ipc/ipc.dm @@ -164,6 +164,7 @@ ) species_components = list(/datum/component/synthetic_endoskeleton) + mass_modifier = REFERENCE_MASS_IPC / REFERENCE_MASS_HUMAN // Special snowflake machine vars. var/sprint_temperature_factor = 1.05 diff --git a/code/modules/mob/living/carbon/human/species/station/ipc/ipc_subspecies.dm b/code/modules/mob/living/carbon/human/species/station/ipc/ipc_subspecies.dm index 13a0ae79e94..531132039e5 100644 --- a/code/modules/mob/living/carbon/human/species/station/ipc/ipc_subspecies.dm +++ b/code/modules/mob/living/carbon/human/species/station/ipc/ipc_subspecies.dm @@ -77,6 +77,7 @@ bodyfall_sound = SFX_BODYFALL use_alt_hair_layer = FALSE + mass_modifier = REFERENCE_MASS_IPC_SHELL / REFERENCE_MASS_HUMAN /datum/species/machine/shell/get_species(var/reference, var/mob/living/carbon/human/H, var/records) if(reference) @@ -122,6 +123,8 @@ /datum/unarmed_attack/terminator, /datum/unarmed_attack/bite/strong) + mass_modifier = REFERENCE_MASS_IPC_SHELL / REFERENCE_MASS_HUMAN + /datum/species/machine/shell/rogue/check_tag(var/mob/living/carbon/human/new_machine, var/client/player) return @@ -205,6 +208,7 @@ ) machine_ui_theme = "hephaestus" + mass_modifier = REFERENCE_MASS_IPC_INDUSTRIAL / REFERENCE_MASS_HUMAN /datum/species/machine/industrial/get_light_color() return LIGHT_COLOR_TUNGSTEN @@ -406,6 +410,8 @@ melee = ARMOR_MELEE_KEVLAR ) + mass_modifier = REFERENCE_MASS_IPC_INDUSTRIAL / REFERENCE_MASS_HUMAN + /mob/living/carbon/human/proc/discard_limb() set name = "Discard Limb" set category = "Object" diff --git a/code/modules/mob/living/carbon/human/species/station/skrell/skrell.dm b/code/modules/mob/living/carbon/human/species/station/skrell/skrell.dm index f72b448ed52..d323dac430f 100644 --- a/code/modules/mob/living/carbon/human/species/station/skrell/skrell.dm +++ b/code/modules/mob/living/carbon/human/species/station/skrell/skrell.dm @@ -111,6 +111,7 @@ has_psionics = PSI_RANK_SENSITIVE character_creation_psi_points = 2 + mass_modifier = REFERENCE_MASS_SKRELL / REFERENCE_MASS_HUMAN /datum/species/skrell/handle_trail(var/mob/living/carbon/human/H, var/turf/T) var/list/trail_info = ..() diff --git a/code/modules/mob/living/carbon/human/species/station/skrell/skrell_subspecies.dm b/code/modules/mob/living/carbon/human/species/station/skrell/skrell_subspecies.dm index db9d94fc787..a39b359485c 100644 --- a/code/modules/mob/living/carbon/human/species/station/skrell/skrell_subspecies.dm +++ b/code/modules/mob/living/carbon/human/species/station/skrell/skrell_subspecies.dm @@ -23,3 +23,5 @@ fast_pulse = 80 // Species default 70 v_fast_pulse = 100 // Species default 90 max_pulse = 140 // Species default 130 + + mass_modifier = REFERENCE_MASS_SKRELL_AXIORI / REFERENCE_MASS_HUMAN diff --git a/code/modules/mob/living/carbon/human/species/station/tajara/tajara.dm b/code/modules/mob/living/carbon/human/species/station/tajara/tajara.dm index 484753ccabf..cd22b161c18 100644 --- a/code/modules/mob/living/carbon/human/species/station/tajara/tajara.dm +++ b/code/modules/mob/living/carbon/human/species/station/tajara/tajara.dm @@ -130,6 +130,8 @@ meat_type = /obj/item/reagent_containers/food/snacks/meat/adhomai valid_prosthetics = list(PROSTHETIC_TESLA) + mass_modifier = REFERENCE_MASS_TAJARA / REFERENCE_MASS_HUMAN + /datum/species/tajaran/after_equip(var/mob/living/carbon/human/H) . = ..() if(H.shoes) diff --git a/code/modules/mob/living/carbon/human/species/station/tajara/tajaran_subspecies.dm b/code/modules/mob/living/carbon/human/species/station/tajara/tajaran_subspecies.dm index bc6b87ed4e9..948ac23861e 100644 --- a/code/modules/mob/living/carbon/human/species/station/tajara/tajaran_subspecies.dm +++ b/code/modules/mob/living/carbon/human/species/station/tajara/tajaran_subspecies.dm @@ -50,6 +50,8 @@ /singleton/origin_item/culture/offworld_tajara/zhan ) + mass_modifier = REFERENCE_MASS_TAJARA_ZHAN / REFERENCE_MASS_HUMAN + /datum/species/tajaran/m_sai name = SPECIES_TAJARA_MSAI name_plural = "M'sai Tajara" @@ -100,6 +102,8 @@ /singleton/origin_item/culture/offworld_tajara/msai ) + mass_modifier = REFERENCE_MASS_TAJARA_MSAI / REFERENCE_MASS_HUMAN + /datum/species/tajaran/tesla_body name = SPECIES_TAJARA_TESLA_BODY name_plural = "Tesla Rejuvenation Suit Tajara" @@ -199,6 +203,7 @@ push_flags = (~HEAVY) ^ ROBOT possible_external_organs_modifications = list("Normal", "Amputated") //We don't have any alternate limbs for Tesla suits valid_prosthetics = null + mass_modifier = REFERENCE_MASS_TAJARA_TESLA / REFERENCE_MASS_HUMAN /datum/species/tajaran/tesla_body/New() ..() diff --git a/code/modules/mob/living/carbon/human/species/station/unathi/unathi.dm b/code/modules/mob/living/carbon/human/species/station/unathi/unathi.dm index 0d63e516347..033ee082f01 100644 --- a/code/modules/mob/living/carbon/human/species/station/unathi/unathi.dm +++ b/code/modules/mob/living/carbon/human/species/station/unathi/unathi.dm @@ -137,6 +137,7 @@ possible_external_organs_modifications = list("Normal","Amputated","Prosthesis", "Diona Nymph") valid_prosthetics = list(PROSTHETIC_AUTAKH) + mass_modifier = REFERENCE_MASS_UNATHI / REFERENCE_MASS_HUMAN /datum/species/unathi/after_equip(var/mob/living/carbon/human/H) . = ..() diff --git a/code/modules/mob/living/carbon/human/species/station/vaurca/vaurca.dm b/code/modules/mob/living/carbon/human/species/station/vaurca/vaurca.dm index 4a1f6e347f6..a2bebb2b7a2 100644 --- a/code/modules/mob/living/carbon/human/species/station/vaurca/vaurca.dm +++ b/code/modules/mob/living/carbon/human/species/station/vaurca/vaurca.dm @@ -171,6 +171,8 @@ "C'thur: Unbound Mouv" = "#96B4FF", "C'thur: Bound Mouv" = "#5A96FF", "C'thur: Unbound Xetl" = "#370078", "C'thur: Bound Xetl" = "#3C0F5F" ) + mob_strength = 1.35 // Requested by Vaurca lore to make them a bit more different + mass_modifier = REFERENCE_MASS_VAURCA_KA / REFERENCE_MASS_HUMAN /datum/species/bug/before_equip(var/mob/living/carbon/human/H) . = ..() diff --git a/code/modules/mob/living/carbon/human/species/station/vaurca/vaurca_subspecies.dm b/code/modules/mob/living/carbon/human/species/station/vaurca/vaurca_subspecies.dm index a52b758d487..ed8a9cd522b 100644 --- a/code/modules/mob/living/carbon/human/species/station/vaurca/vaurca_subspecies.dm +++ b/code/modules/mob/living/carbon/human/species/station/vaurca/vaurca_subspecies.dm @@ -66,6 +66,8 @@ "C'thur: Unbound Xetl" = "#370078" ) + mass_modifier = REFERENCE_MASS_VAURCA_ZA / REFERENCE_MASS_HUMAN + /datum/species/bug/type_b/type_bb name = SPECIES_VAURCA_ATTENDANT name_plural = "Type BB" @@ -220,6 +222,8 @@ "C'thur: Mouv" = "#7D75FF" ) + mass_modifier = REFERENCE_MASS_VAURCA_TA / REFERENCE_MASS_HUMAN + /datum/species/bug/type_c/New() ..() equip_adjust = list( @@ -308,6 +312,7 @@ default_h_style = "Bald" possible_external_organs_modifications = list("Normal", "Amputated") //We don't have any limb modfications for this species valid_prosthetics = null + mass_modifier = REFERENCE_MASS_VAURCA_BA / REFERENCE_MASS_HUMAN /datum/species/bug/type_big/handle_post_spawn(var/mob/living/carbon/human/H) H.mutations |= HULK @@ -407,6 +412,8 @@ Bulwarks are much larger and have significantly thicker carapaces than most Vaur "C'thur: Unbound Xetl" = "#3F0876", "C'thur: Bound Xetl" = "#330563" ) + mass_modifier = REFERENCE_MASS_VAURCA_RA / REFERENCE_MASS_HUMAN + /datum/species/bug/type_e/New() ..() equip_adjust = list( diff --git a/code/modules/mob/mob_grab.dm b/code/modules/mob/mob_grab.dm index 2d3b401c55b..3481d4c50ba 100644 --- a/code/modules/mob/mob_grab.dm +++ b/code/modules/mob/mob_grab.dm @@ -443,8 +443,9 @@ to_chat(H, SPAN_WARNING("You can only fireman carry humanoids!")) return var/mob/living/carbon/human/affected_human = affecting - if(affected_human.mob_weight > H.get_mob_strength()) - to_chat(H, SPAN_WARNING("\The [affected_human] is way too big to fireman carry!")) + var/grabber_strength = H.get_effective_mass() * H.mob_strength + if(affected_human.mass > grabber_strength) + to_chat(H, SPAN_WARNING("\The [affected_human] is heavier than your Lift Limit of [grabber_strength]kg, you cannot fireman carry then!")) return if(state < GRAB_AGGRESSIVE) to_chat(H, SPAN_WARNING("You need an aggressive grab before you can fireman carry someone!")) diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index d9c4d994fc9..9cbd1edb8b0 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -1393,7 +1393,3 @@ GLOBAL_LIST_INIT(organ_rel_size, list( message_notifications.Cut(1, 2) message_notifications[key_check] = world.time + next_message_time - -/// Gets a mob's strength. -/mob/proc/get_mob_strength() - return mob_weight + mob_strength diff --git a/html/changelogs/hellfirejag-mass-contests-conditioning.yml b/html/changelogs/hellfirejag-mass-contests-conditioning.yml new file mode 100644 index 00000000000..e6c713b3146 --- /dev/null +++ b/html/changelogs/hellfirejag-mass-contests-conditioning.yml @@ -0,0 +1,9 @@ +author: Hellfirejag +delete-after: True +changes: + - rscadd: "Movables (Mobs, Objects) now have a Mass value (in Kilograms) that can be used for kinematic equations." + - rscadd: "All species datums now include a Mass modifier that allows them to start with a specific mass." + - rscadd: "Movables (Mobs, Objects) also have a derived Effective Mass that can be dynamically modified via a Signal. Meaning Skills, Drugs, Hardsuits, Equipment, Cybernetics, etc can all touch it." + - rscadd: "Reworked Fireman Carrying limits to instead be based on relative effective mass." + - rscadd: "Added a new Conditioning skill that increases a character's Effective Mass, allowing them to Lift/Drag/Fireman heavier objects or people." + - rscadd: "Dragging and Grabbing characters now slows down the user based on this relative Effective Mass."