From 935817e607d137a3b69aa9fa77bea9cf0e55188a Mon Sep 17 00:00:00 2001 From: kevinz000 <2003111+kevinz000@users.noreply.github.com> Date: Sat, 11 Jan 2020 15:36:32 -0800 Subject: [PATCH] a a a a a --- code/datums/components/riding.dm | 2 +- .../antagonists/slaughter/slaughter.dm | 5 ++- code/modules/mob/living/carbon/human/human.dm | 17 +++++---- .../mob/living/carbon/human/human_movement.dm | 10 +++--- .../mob/living/carbon/human/species.dm | 11 +++--- .../mob/living/carbon/monkey/monkey.dm | 6 ++-- code/modules/mob/living/silicon/pai/pai.dm | 4 +-- code/modules/movespeed/_movespeed_modifier.dm | 27 +++++++++----- code/modules/movespeed/modifiers/mobs.dm | 35 +++++++++++++++++++ code/modules/movespeed/modifiers/reagent.dm | 28 ++++++++++++--- .../movespeed/modifiers/status_effects.dm | 19 ++++++++-- code/modules/movespeed/modifiers/variable.dm | 10 ------ .../reagents/cat2_medicine_reagents.dm | 22 ++++++------ .../chemistry/reagents/drink_reagents.dm | 4 +-- .../chemistry/reagents/drug_reagents.dm | 4 +-- .../chemistry/reagents/food_reagents.dm | 2 +- .../chemistry/reagents/medicine_reagents.dm | 4 +-- .../chemistry/reagents/other_reagents.dm | 4 +-- .../crossbreeding/_status_effects.dm | 22 ++++++------ code/modules/station_goals/dna_vault.dm | 2 -- tgstation.dme | 2 +- 21 files changed, 152 insertions(+), 88 deletions(-) create mode 100644 code/modules/movespeed/modifiers/mobs.dm delete mode 100644 code/modules/movespeed/modifiers/variable.dm diff --git a/code/datums/components/riding.dm b/code/datums/components/riding.dm index 3840845a4c4..c8c916e465a 100644 --- a/code/datums/components/riding.dm +++ b/code/datums/components/riding.dm @@ -364,4 +364,4 @@ if(rider in AM.buckled_mobs) AM.unbuckle_mob(rider) . = ..() - + diff --git a/code/modules/antagonists/slaughter/slaughter.dm b/code/modules/antagonists/slaughter/slaughter.dm index c4fb5deb541..127a5bb15a2 100644 --- a/code/modules/antagonists/slaughter/slaughter.dm +++ b/code/modules/antagonists/slaughter/slaughter.dm @@ -67,9 +67,8 @@ /mob/living/simple_animal/slaughter/phasein() . = ..() - add_movespeed_modifier(MOVESPEED_ID_SLAUGHTER, update=TRUE, priority=100, multiplicative_slowdown=-1) - addtimer(CALLBACK(src, .proc/remove_movespeed_modifier, MOVESPEED_ID_SLAUGHTER, TRUE), 6 SECONDS, TIMER_UNIQUE | TIMER_OVERRIDE) - + _REFACTORING_add_movespeed_modifier(/datum/movespeed_modifier/slaughter) + addtimer(CALLBACK(src, .proc/_REFACTORING_remove_movespeed_modifier, /datum/movespeed_modifier/slaughter), 6 SECONDS, TIMER_UNIQUE | TIMER_OVERRIDE) //The loot from killing a slaughter demon - can be consumed to allow the user to blood crawl /obj/item/organ/heart/demon diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 41d82045c8f..fcedbba7d61 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -1031,24 +1031,23 @@ . = ..() dna?.species.spec_updatehealth(src) if(HAS_TRAIT(src, TRAIT_IGNOREDAMAGESLOWDOWN)) - remove_movespeed_modifier(MOVESPEED_ID_DAMAGE_SLOWDOWN) - remove_movespeed_modifier(MOVESPEED_ID_DAMAGE_SLOWDOWN_FLYING) + _REFACTORING_remove_movespeed_modifier(/datum/movespeed_modifier/damage_slowdown) + _REFACTORING_remove_movespeed_modifier(/datum/movespeed_modifier/damage_slowdown_flying) return var/health_deficiency = max((maxHealth - health), staminaloss) if(health_deficiency >= 40) - add_movespeed_modifier(MOVESPEED_ID_DAMAGE_SLOWDOWN, override = TRUE, multiplicative_slowdown = (health_deficiency / 75), blacklisted_movetypes = FLOATING|FLYING) - add_movespeed_modifier(MOVESPEED_ID_DAMAGE_SLOWDOWN_FLYING, override = TRUE, multiplicative_slowdown = (health_deficiency / 25), movetypes = FLOATING) + add_or_update_variable_movespeed_modifier(/datum/movespeed_modifier/damage_slowdown) + add_or_update_variable_movespeed_modifier(/datum/movespeed_modifier/damage_slowdown_flying) else - remove_movespeed_modifier(MOVESPEED_ID_DAMAGE_SLOWDOWN) - remove_movespeed_modifier(MOVESPEED_ID_DAMAGE_SLOWDOWN_FLYING) + _REFACTORING_remove_movespeed_modifier(/datum/movespeed_modifier/damage_slowdown) + _REFACTORING_remove_movespeed_modifier(/datum/movespeed_modifier/damage_slowdown_flying) - -/mob/living/carbon/human/adjust_nutrition(var/change) //Honestly FUCK the oldcoders for putting nutrition on /mob someone else can move it up because holy hell I'd have to fix SO many typechecks +/mob/living/carbon/human/adjust_nutrition(change) //Honestly FUCK the oldcoders for putting nutrition on /mob someone else can move it up because holy hell I'd have to fix SO many typechecks if(HAS_TRAIT(src, TRAIT_NOHUNGER)) return FALSE return ..() -/mob/living/carbon/human/set_nutrition(var/change) //Seriously fuck you oldcoders. +/mob/living/carbon/human/set_nutrition(change) //Seriously fuck you oldcoders. if(HAS_TRAIT(src, TRAIT_NOHUNGER)) return FALSE return ..() diff --git a/code/modules/mob/living/carbon/human/human_movement.dm b/code/modules/mob/living/carbon/human/human_movement.dm index 7f1c7c4c2fb..fd46ad8b9f1 100644 --- a/code/modules/mob/living/carbon/human/human_movement.dm +++ b/code/modules/mob/living/carbon/human/human_movement.dm @@ -1,11 +1,11 @@ /mob/living/carbon/human/get_movespeed_modifiers() var/list/considering = ..() - . = considering + . = list() if(HAS_TRAIT(src, TRAIT_IGNORESLOWDOWN)) - for(var/id in .) - var/list/data = .[id] - if(data[MOVESPEED_DATA_INDEX_FLAGS] & IGNORE_NOSLOW) - .[id] = data + for(var/id in considering) + var/datum/movespeed_modifier/M = considering[id] + if(M.flags & IGNORE_NOSLOW) + .[id] = M /mob/living/carbon/human/slip(knockdown_amount, obj/O, lube, paralyze, forcedrop) if(HAS_TRAIT(src, TRAIT_NOSLIPALL)) diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index 6ae31b7febd..3f04b2df013 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -1018,7 +1018,6 @@ GLOBAL_LIST_EMPTY(roundstart_races) //////// //LIFE// //////// - /datum/species/proc/handle_digestion(mob/living/carbon/human/H) if(HAS_TRAIT(src, TRAIT_NOHUNGER)) return //hunger is for BABIES @@ -1028,14 +1027,14 @@ GLOBAL_LIST_EMPTY(roundstart_races) if(H.overeatduration < 100) to_chat(H, "You feel fit again!") REMOVE_TRAIT(H, TRAIT_FAT, OBESITY) - H.remove_movespeed_modifier(MOVESPEED_ID_FAT) + H._REFACTORING_remove_movespeed_modifier(/datum/movespeed_modifier/obesity) H.update_inv_w_uniform() H.update_inv_wear_suit() else if(H.overeatduration >= 100) to_chat(H, "You suddenly feel blubbery!") ADD_TRAIT(H, TRAIT_FAT, OBESITY) - H.add_movespeed_modifier(MOVESPEED_ID_FAT, multiplicative_slowdown = 1.5) + H._REFACTORING_add_movespeed_modifier(/datum/movespeed_modifier/obesity) H.update_inv_w_uniform() H.update_inv_wear_suit() @@ -1090,13 +1089,13 @@ GLOBAL_LIST_EMPTY(roundstart_races) if(!HAS_TRAIT(H, TRAIT_NOHUNGER)) var/hungry = (500 - H.nutrition) / 5 //So overeat would be 100 and default level would be 80 if(hungry >= 70) - H.add_movespeed_modifier(MOVESPEED_ID_HUNGRY, override = TRUE, multiplicative_slowdown = (hungry / 50)) + H.add_or_update_variable_movespeed_modifier(/datum/movespeed_modifier/hunger, multiplicative_slowdown = (hungry / 50)) else if(isethereal(H)) var/datum/species/ethereal/E = H.dna.species if(E.get_charge(H) <= ETHEREAL_CHARGE_NORMAL) - H.add_movespeed_modifier(MOVESPEED_ID_HUNGRY, override = TRUE, multiplicative_slowdown = (1.5 * (1 - E.get_charge(H) / 100))) + H.add_or_update_variable_movespeed_modifier(/datum/movespeed_modifier/hunger, multiplicative_slowdown = (1.5 * (1 - E.get_charge(H) / 100))) else - H.remove_movespeed_modifier(MOVESPEED_ID_HUNGRY) + H._REFACTORING_remove_movespeed_modifier(/datum/movespeed_modifier/hunger) switch(H.nutrition) if(NUTRITION_LEVEL_FULL to INFINITY) diff --git a/code/modules/mob/living/carbon/monkey/monkey.dm b/code/modules/mob/living/carbon/monkey/monkey.dm index c8dd9a90e36..0452cebe784 100644 --- a/code/modules/mob/living/carbon/monkey/monkey.dm +++ b/code/modules/mob/living/carbon/monkey/monkey.dm @@ -66,7 +66,7 @@ if(reagents.has_reagent(/datum/reagent/consumable/nuka_cola)) amount = -1 if(amount) - add_or_update_movespeed_modifier(/datum/movespeed_modifier/variable/monkey_reagent_speedmod, TRUE, amount) + add_or_update_variable_movespeed_modifier(/datum/movespeed_modifier/monkey_reagent_speedmod, TRUE, amount) /mob/living/carbon/monkey/updatehealth() . = ..() @@ -75,14 +75,14 @@ var/health_deficiency = (maxHealth - health) if(health_deficiency >= 45) slow += (health_deficiency / 25) - add_or_update_movespeed_modifier(/datum/movespeed_modifier/variable/monkey_health_speedmod, TRUE, slow) + add_or_update_variable_movespeed_modifier(/datum/movespeed_modifier/monkey_health_speedmod, TRUE, slow) /mob/living/carbon/monkey/adjust_bodytemperature(amount) . = ..() var/slow = 0 if (bodytemperature < 283.222) slow += ((283.222 - bodytemperature) / 10) * 1.75 - add_or_update_movespeed_modifier(/datum/movespeed_modifier/variable/monkey_temperature_speedmod, TRUE, slow) + add_or_update_variable_movespeed_modifier(/datum/movespeed_modifier/monkey_temperature_speedmod, TRUE, slow) /mob/living/carbon/monkey/Stat() ..() diff --git a/code/modules/mob/living/silicon/pai/pai.dm b/code/modules/mob/living/silicon/pai/pai.dm index 89a627ce9e5..bd2f9e085fd 100644 --- a/code/modules/mob/living/silicon/pai/pai.dm +++ b/code/modules/mob/living/silicon/pai/pai.dm @@ -254,9 +254,9 @@ /mob/living/silicon/pai/Process_Spacemove(movement_dir = 0) . = ..() if(!.) - add_movespeed_modifier(MOVESPEED_ID_PAI_SPACEWALK_SPEEDMOD, TRUE, 100, multiplicative_slowdown = 2) + _REFACTORING_add_movespeed_modifier(/datum/movespeed_modifier/pai_spacewalk) return TRUE - remove_movespeed_modifier(MOVESPEED_ID_PAI_SPACEWALK_SPEEDMOD, TRUE) + _REFACTORING_remove_movespeed_modifier(/datum/movespeed_modifier/pai_spacewalk) return TRUE /mob/living/silicon/pai/examine(mob/user) diff --git a/code/modules/movespeed/_movespeed_modifier.dm b/code/modules/movespeed/_movespeed_modifier.dm index a6d9c3972ba..6f00153abc4 100644 --- a/code/modules/movespeed/_movespeed_modifier.dm +++ b/code/modules/movespeed/_movespeed_modifier.dm @@ -3,6 +3,9 @@ */ /datum/movespeed_modifier + /// Whether or not this is a variable modifier. Variable modifiers can NOT be ever auto-cached. ONLY CHECKED VIA INITIAL(), EFFECTIVELY READ ONLY (and for very good reason) + var/variable = FALSE + /// Unique ID. You can never have different modifications with the same ID var/id = "ERROR" @@ -64,16 +67,16 @@ GLOBAL_LIST_EMPTY(movespeed_modification_cache) /proc/get_cached_movespeed_modification(modtype) if(!ispath(modtype, /datum/movespeed_modifier)) CRASH("[modtype] is not a movespeed modification typepath.") - if(ispath(modtype, /datum/movespeed_modifier/variable)) + var/datum/movespeed_modifier/M = modtype + if(initial(M.variable)) CRASH("[modtype] is a variable modifier, and can never be cached.") - var/datum/movespeed_modifier/M = GLOB.movespeed_modification_cache[modtype] || ((GLOB.movespeed_modification_cache[modtype] = new modtype)) - return M + return GLOB.movespeed_modification_cache[modtype] || ((GLOB.movespeed_modification_cache[modtype] = new modtype)) ///Add a move speed modifier to a mob. If a variable subtype is passed in as the first argument, it will make a new datum. /mob/proc/_REFACTORING_add_movespeed_modifier(datum/movespeed_modifier/type_or_datum, update = TRUE, override = FALSE) var/created = FALSE if(ispath(type_or_datum)) - if(!ispath(type_or_datum, /datum/movespeed_modifier/variable)) + if(!initial(type_or_datum.variable)) type_or_datum = get_cached_movespeed_modification(type_or_datum) else created = TRUE @@ -100,12 +103,14 @@ GLOBAL_LIST_EMPTY(movespeed_modification_cache) ///Remove a move speed modifier from a mob, whether static or variable. /mob/proc/_REFACTORING_remove_movespeed_modifier(datum/movespeed_modifier/type_id_datum, update = TRUE) if(ispath(type_id_datum)) - if(!ispath(type_id_datum, /datum/movespeed_modifier/variable)) + if(!initial(type_id_datum.variable)) type_id_datum = get_cached_movespeed_modification(type_id_datum) else type_id_datum = initial(type_id_datum.id) if(istype(type_id_datum)) type_id_datum = type_id_datum.id + if(!istext(type_id_datum)) + CRASH("Invalid ID") if(!LAZYACCESS(movespeed_modification, type_id_datum)) return FALSE LAZYREMOVE(movespeed_modification, type_id_datum) @@ -116,7 +121,7 @@ GLOBAL_LIST_EMPTY(movespeed_modification_cache) /// Used for variable slowdowns like hunger/health loss/etc, works somewhat like the old list-based modification adds. /// Implies override. -/mob/proc/add_or_update_variable_movespeed_modifier(datum/movespeed_modifier/variable/type_id_datum, update = TRUE, multiplicative_slowdown) +/mob/proc/add_or_update_variable_movespeed_modifier(datum/movespeed_modifier/type_id_datum, update = TRUE, multiplicative_slowdown) /* How this SHOULD work is: 1. Ensures type_id_datum one way or another refers to a /variable datum. This makes sure it can't be cached. This includes if it's already in the modification list. @@ -128,12 +133,14 @@ GLOBAL_LIST_EMPTY(movespeed_modification_cache) . = FALSE var/modified = FALSE var/inject = FALSE - var/datum/movespeed_modifier/variable/final + var/datum/movespeed_modifier/final if(istext(type_id_datum)) final = LAZYACCESS(movespeed_modification, type_id_datum) if(!istype(final)) CRASH("Couldn't find existing modification when only provided an ID.") else if(ispath(type_id_datum)) + if(!initial(type_id_datum.variable)) + CRASH("Not a variable modifier") var/id = initial(type_id_datum.id) final = LAZYACCESS(movespeed_modification, type_id_datum) if(!istype(final)) @@ -141,6 +148,8 @@ GLOBAL_LIST_EMPTY(movespeed_modification_cache) inject = TRUE modified = TRUE else if(istype(type_id_datum)) + if(!initial(type_id_datum.variable)) + CRASH("Not a variable modifier") final = type_id_datum if(!LAZYACCESS(movespeed_modification, final.id)) inject = TRUE @@ -198,7 +207,7 @@ GLOBAL_LIST_EMPTY(movespeed_modification_cache) continue if(M.blacklisted_movetypes & movement_type) // There's a movetype here that disables this modifier, skip continue - var/conflict = M.conflict + var/conflict = M.conflicts_with var/amt = M.multiplicative_slowdown if(conflict) // Conflicting modifiers prioritize the larger slowdown or the larger speedup @@ -219,7 +228,7 @@ GLOBAL_LIST_EMPTY(movespeed_modification_cache) . = 0 for(var/id in get_movespeed_modifiers()) var/datum/movespeed_modifier/M = movespeed_modification[id] - . += M.multiplicative_slowdown() + . += M.multiplicative_slowdown ///Checks if a move speed modifier is valid and not missing any data /proc/movespeed_data_null_check(datum/movespeed_modifier/M) //Determines if a data list is not meaningful and should be discarded. diff --git a/code/modules/movespeed/modifiers/mobs.dm b/code/modules/movespeed/modifiers/mobs.dm new file mode 100644 index 00000000000..23084dc0ea2 --- /dev/null +++ b/code/modules/movespeed/modifiers/mobs.dm @@ -0,0 +1,35 @@ +/datum/movespeed_modifier/obesity + id = MOVESPEED_ID_FAT + multiplicative_slowdown = 1.5 + +/datum/movespeed_modifier/monkey_reagent_speedmod + variable = TRUE + id = MOVESPEED_ID_MONKEY_REAGENT_SPEEDMOD + +/datum/movespeed_modifier/monkey_health_speedmod + variable = TRUE + id = MOVESPEED_ID_MONKEY_HEALTH_SPEEDMOD + +/datum/movespeed_modifier/monkey_temperature_speedmod + variable = TRUE + id = MOVESPEED_ID_MONKEY_TEMPERATURE_SPEEDMOD + +/datum/movespeed_modifier/hunger + id = MOVESPEED_ID_HUNGRY + variable = TRUE + +/datum/movespeed_modifier/slaughter + id = MOVESPEED_ID_SLAUGHTER + multiplicative_slowdown = -1 + +/datum/movespeed_modifier/damage_slowdown + id = MOVESPEED_ID_DAMAGE_SLOWDOWN + blacklisted_movetypes = FLOATING|FLYING + +/datum/movespeed_modifier/damage_slowdown_flying + id = MOVESPEED_ID_DAMAGE_SLOWDOWN_FLYING + movetypes = FLOATING + +/datum/movespeed_modifier/pai_spacewalk + id = MOVESPEED_ID_PAI_SPACEWALK_SPEEDMOD + multiplicative_slowdown = 2 diff --git a/code/modules/movespeed/modifiers/reagent.dm b/code/modules/movespeed/modifiers/reagent.dm index 90d4348486c..708925bda2b 100644 --- a/code/modules/movespeed/modifiers/reagent.dm +++ b/code/modules/movespeed/modifiers/reagent.dm @@ -1,24 +1,42 @@ +/datum/movespeed_modifier/reagent + blacklisted_movetypes = (FLYING|FLOATING) + /datum/movespeed_modifier/reagent/stimulants id = "stimulants_reagent" multiplicative_slowdown = -1 - blacklisted_movetypes = (FLYING|FLOATING) /datum/movespeed_modifier/reagent/ephedrine id = "ephedrine_reagent" multiplicative_slowdown = -0.5 - blacklisted_movetypes = (FLYING|FLOATING) /datum/movespeed_modifier/reagent/pepperspray id = MOVESPEED_ID_PEPPER_SPRAY multiplicative_slowdown = 0.25 - blacklisted_movetypes = (FLYING|FLOATING) /datum/movespeed_modifier/reagent/badstims id = "reagent_badstims" multiplicative_slowdown = -0.35 - blacklisted_movetypes = (FLYING|FLOATING) /datum/movespeed_modifier/reagent/monkey_energy id = "reagent_monkey_energy" multiplicative_slowdown = -0.35 - blacklisted_movetypes = (FLYING|FLOATING) + +/datum/movespeed_modifier/reagent/changelinghaste + id = "reagent_changelinghaste" + multiplicative_slowdown = -2 + +/datum/movespeed_modifier/reagent/methamphetamine + id = "reagent_methamphetamine" + multiplicative_slowdown = -0.65 + +/datum/movespeed_modifier/reagent/nitryl + id = "reagent_nitryl" + multiplicative_slowdown = -0.65 + +/datum/movespeed_modifier/reagent/lenturi + id = "reagent_lenturi" + multiplicative_slowdown = 1.5 + +/datum/movespeed_modifier/reagent/nuka_cola + id = "reagent_nukacola" + multiplicative_slowdown = -0.35 diff --git a/code/modules/movespeed/modifiers/status_effects.dm b/code/modules/movespeed/modifiers/status_effects.dm index b4bb2b07ba6..de68bd78ed1 100644 --- a/code/modules/movespeed/modifiers/status_effects.dm +++ b/code/modules/movespeed/modifiers/status_effects.dm @@ -1,7 +1,22 @@ -/datum/movespeed_modifier/bloodchill +/datum/movespeed_modifier/status_effect/bloodchill id = "bloodchilled" multiplicative_slowdown = 3 -/datum/movespeed_modifier/bonechill +/datum/movespeed_modifier/status_effect/bonechill id = "bonechilled" multiplicative_slowdown = 3 + +/datum/movespeed_modifier/status_effect/lightpink + id = MOVESPEED_ID_SLIME_STATUS + multiplicative_slowdown = -0.5 + blacklisted_movetypes = (FLYING|FLOATING) + +/datum/movespeed_modifier/status_effect/tarfoot + id = MOVESPEED_ID_TARFOOT + multiplicative_slowdown = 0.5 + blacklisted_movetypes = (FLYING|FLOATING) + +/datum/movespeed_modifier/status_effect/sepia + variable = TRUE + id = MOVESPEED_ID_SEPIA + blacklisted_movetypes = (FLYING|FLOATING) diff --git a/code/modules/movespeed/modifiers/variable.dm b/code/modules/movespeed/modifiers/variable.dm deleted file mode 100644 index f7836a90c9e..00000000000 --- a/code/modules/movespeed/modifiers/variable.dm +++ /dev/null @@ -1,10 +0,0 @@ -/datum/movespeed_modifier/variable - -/datum/movespeed_modifier/variable/monkey_reagent_speedmod - id = MOVESPEED_ID_MONKEY_REAGENT_SPEEDMOD - -/datum/movespeed_modifier/variable/monkey_health_speedmod - id = MOVESPEED_ID_MONKEY_HEALTH_SPEEDMOD - -/datum/movespeed_modifier/variable/monkey_temperature_speedmod - id = MOVESPEED_ID_MONKEY_TEMPERATURE_SPEEDMOD diff --git a/code/modules/reagents/chemistry/reagents/cat2_medicine_reagents.dm b/code/modules/reagents/chemistry/reagents/cat2_medicine_reagents.dm index 4fc4fca9bf2..67e57ddf168 100644 --- a/code/modules/reagents/chemistry/reagents/cat2_medicine_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/cat2_medicine_reagents.dm @@ -100,17 +100,19 @@ var/spammer = 0 /datum/reagent/medicine/C2/lenturi/on_mob_life(mob/living/carbon/M) - M.adjustFireLoss(-3 * REM) - M.adjustOrganLoss(ORGAN_SLOT_STOMACH, 0.4 * REM) - ..() - return TRUE -/datum/reagent/medicine/C2/lenturi/on_mob_metabolize(mob/living/carbon/M) - M.add_movespeed_modifier(MOVESPEED_ID_LENTURI, update=TRUE, priority=100, multiplicative_slowdown=1.50, blacklisted_movetypes=(FLYING|FLOATING)) - . = ..() -/datum/reagent/medicine/C2/lenturi/on_mob_end_metabolize(mob/living/carbon/M) - M.remove_movespeed_modifier(MOVESPEED_ID_LENTURI) + M.adjustFireLoss(-3 * REM) + M.adjustOrganLoss(ORGAN_SLOT_STOMACH, 0.4 * REM) + ..() + return TRUE + +/datum/reagent/medicine/C2/lenturi/on_mob_metabolize(mob/living/carbon/M) + M._REFACTORING_add_movespeed_modifier(/datum/movespeed_modifier/reagent/lenturi) + return ..() + +/datum/reagent/medicine/C2/lenturi/on_mob_end_metabolize(mob/living/carbon/M) + M._REFACTORING_remove_movespeed_modifier(/datum/movespeed_modifier/reagent/lenturi) + return ..() - . = ..() /datum/reagent/medicine/C2/aiuri name = "Aiuri" description = "Used to treat burns. Does minor eye damage." diff --git a/code/modules/reagents/chemistry/reagents/drink_reagents.dm b/code/modules/reagents/chemistry/reagents/drink_reagents.dm index b291206e370..1df4e807393 100644 --- a/code/modules/reagents/chemistry/reagents/drink_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/drink_reagents.dm @@ -376,10 +376,10 @@ /datum/reagent/consumable/nuka_cola/on_mob_metabolize(mob/living/L) ..() - L.add_movespeed_modifier(type, update=TRUE, priority=100, multiplicative_slowdown=-0.35, blacklisted_movetypes=(FLYING|FLOATING)) + L._REFACTORING_add_movespeed_modifier(/datum/movespeed_modifier/reagent/nuka_cola) /datum/reagent/consumable/nuka_cola/on_mob_end_metabolize(mob/living/L) - L.remove_movespeed_modifier(type) + L._REFACTORING_remove_movespeed_modifier(/datum/movespeed_modifier/reagent/nuka_cola) ..() /datum/reagent/consumable/nuka_cola/on_mob_life(mob/living/carbon/M) diff --git a/code/modules/reagents/chemistry/reagents/drug_reagents.dm b/code/modules/reagents/chemistry/reagents/drug_reagents.dm index 87c1fe954a0..9af53eff1da 100644 --- a/code/modules/reagents/chemistry/reagents/drug_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/drug_reagents.dm @@ -174,10 +174,10 @@ /datum/reagent/drug/methamphetamine/on_mob_metabolize(mob/living/L) ..() - L.add_movespeed_modifier(type, update=TRUE, priority=100, multiplicative_slowdown=-0.65, blacklisted_movetypes=(FLYING|FLOATING)) + L._REFACTORING_add_movespeed_modifier(/datum/movespeed_modifier/reagent/methamphetamine) /datum/reagent/drug/methamphetamine/on_mob_end_metabolize(mob/living/L) - L.remove_movespeed_modifier(type) + L._REFACTORING_remove_movespeed_modifier(/datum/movespeed_modifier/reagent/methamphetamine) ..() /datum/reagent/drug/methamphetamine/on_mob_life(mob/living/carbon/M) diff --git a/code/modules/reagents/chemistry/reagents/food_reagents.dm b/code/modules/reagents/chemistry/reagents/food_reagents.dm index 0159f6852ff..bd9d3286014 100755 --- a/code/modules/reagents/chemistry/reagents/food_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/food_reagents.dm @@ -294,7 +294,7 @@ victim.confused = max(M.confused, 5) // 10 seconds victim.Knockdown(3 SECONDS) victim._REFACTORING_add_movespeed_modifier(/datum/movespeed_modifier/reagent/pepperspray) - addtimer(CALLBACK(victim, /mob.proc/remove_movespeed_modifier, /datum/movespeed_modifier/reagent/pepperspray), 10 SECONDS) + addtimer(CALLBACK(victim, /mob.proc/_REFACTORING_remove_movespeed_modifier, /datum/movespeed_modifier/reagent/pepperspray), 10 SECONDS) victim.update_damage_hud() if(method == INGEST) if(!holder.has_reagent(/datum/reagent/consumable/milk)) diff --git a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm index 2115a2d8a95..23cad61cc2e 100644 --- a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm @@ -1038,10 +1038,10 @@ /datum/reagent/medicine/changelinghaste/on_mob_metabolize(mob/living/L) ..() - L.add_movespeed_modifier(type, update=TRUE, priority=100, multiplicative_slowdown=-2, blacklisted_movetypes=(FLYING|FLOATING)) + L._REFACTORING_add_movespeed_modifier(/datum/movespeed_modifier/reagent/changelinghaste) /datum/reagent/medicine/changelinghaste/on_mob_end_metabolize(mob/living/L) - L.remove_movespeed_modifier(type) + L._REFACTORING_remove_movespeed_modifier(/datum/movespeed_modifier/reagent/changelinghaste) ..() /datum/reagent/medicine/changelinghaste/on_mob_life(mob/living/carbon/M) diff --git a/code/modules/reagents/chemistry/reagents/other_reagents.dm b/code/modules/reagents/chemistry/reagents/other_reagents.dm index 52ad85ec33a..828ea4779d1 100644 --- a/code/modules/reagents/chemistry/reagents/other_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/other_reagents.dm @@ -1230,10 +1230,10 @@ /datum/reagent/nitryl/on_mob_metabolize(mob/living/L) ..() - L.add_movespeed_modifier(type, update=TRUE, priority=100, multiplicative_slowdown=-0.65, blacklisted_movetypes=(FLYING|FLOATING)) + L._REFACTORING_add_movespeed_modifier(/datum/movespeed_modifier/reagent/nitryl) /datum/reagent/nitryl/on_mob_end_metabolize(mob/living/L) - L.remove_movespeed_modifier(type) + L._REFACTORING_remove_movespeed_modifier(/datum/movespeed_modifier/reagent/nitryl) ..() /////////////////////////Colorful Powder//////////////////////////// diff --git a/code/modules/research/xenobiology/crossbreeding/_status_effects.dm b/code/modules/research/xenobiology/crossbreeding/_status_effects.dm index af254f6c028..cf5a55d1287 100644 --- a/code/modules/research/xenobiology/crossbreeding/_status_effects.dm +++ b/code/modules/research/xenobiology/crossbreeding/_status_effects.dm @@ -185,7 +185,7 @@ alert_type = /obj/screen/alert/status_effect/bloodchill /datum/status_effect/bloodchill/on_apply() - owner._REFACTORING_add_movespeed_modifier(/datum/movespeed_modifier/bloodchill) + owner._REFACTORING_add_movespeed_modifier(/datum/movespeed_modifier/status_effect/bloodchill) return ..() /datum/status_effect/bloodchill/tick() @@ -193,7 +193,7 @@ owner.adjustFireLoss(2) /datum/status_effect/bloodchill/on_remove() - owner._REFACTORING_remove_movespeed_modifier(/datum/movespeed_modifier/bloodchill) + owner._REFACTORING_remove_movespeed_modifier(/datum/movespeed_modifier/status_effect/bloodchill) /datum/status_effect/bonechill id = "bonechill" @@ -201,7 +201,7 @@ alert_type = /obj/screen/alert/status_effect/bonechill /datum/status_effect/bonechill/on_apply() - owner._REFACTORING_add_movespeed_modifier(/datum/movespeed_modifier/bonechill) + owner._REFACTORING_add_movespeed_modifier(/datum/movespeed_modifier/status_effect/bonechill) return ..() /datum/status_effect/bonechill/tick() @@ -211,7 +211,7 @@ owner.adjust_bodytemperature(-10) /datum/status_effect/bonechill/on_remove() - owner._REFACTORING_remove_movespeed_modifier(/datum/movespeed_modifier/bonechill) + owner._REFACTORING_remove_movespeed_modifier(/datum/movespeed_modifier/status_effect/bonechill) /obj/screen/alert/status_effect/bonechill name = "Bonechilled" desc = "You feel a shiver down your spine after hearing the haunting noise of bone rattling. You'll move slower and get frostbite for a while!" @@ -365,11 +365,11 @@ datum/status_effect/rebreathing/tick() duration = 30 /datum/status_effect/tarfoot/on_apply() - owner.add_movespeed_modifier(MOVESPEED_ID_TARFOOT, update=TRUE, priority=100, multiplicative_slowdown=0.5, blacklisted_movetypes=(FLYING|FLOATING)) + owner._REFACTORING_add_movespeed_modifier(/datum/movespeed_modifier/status_effect/tarfoot) return ..() /datum/status_effect/tarfoot/on_remove() - owner.remove_movespeed_modifier(MOVESPEED_ID_TARFOOT) + owner._REFACTORING_remove_movespeed_modifier(/datum/movespeed_modifier/status_effect/tarfoot) /datum/status_effect/spookcookie id = "spookcookie" @@ -683,15 +683,15 @@ datum/status_effect/stabilized/blue/on_remove() /datum/status_effect/stabilized/sepia/tick() if(prob(50) && mod > -1) mod-- - owner.add_movespeed_modifier(MOVESPEED_ID_SEPIA, override = TRUE, update=TRUE, priority=100, multiplicative_slowdown=-0.5, blacklisted_movetypes=(FLYING|FLOATING)) + owner.add_movespeed_modifier(/datum/movespeed_modifier/status_effect/sepia, multiplicative_slowdown = -0.5) else if(mod < 1) mod++ // yeah a value of 0 does nothing but replacing the trait in place is cheaper than removing and adding repeatedly - owner.add_movespeed_modifier(MOVESPEED_ID_SEPIA, override = TRUE, update=TRUE, priority=100, multiplicative_slowdown=0, blacklisted_movetypes=(FLYING|FLOATING)) + owner.add_or_update_variable_movespeed_modifier(/datum/movespeed_modifier/status_effect/sepia, multiplicative_slowdown = 0) return ..() /datum/status_effect/stabilized/sepia/on_remove() - owner.remove_movespeed_modifier(MOVESPEED_ID_SEPIA) + owner._REFACTORING_remove_movespeed_modifier(/datum/movespeed_modifier/status_effect/sepia) /datum/status_effect/stabilized/cerulean id = "stabilizedcerulean" @@ -899,7 +899,7 @@ datum/status_effect/stabilized/blue/on_remove() colour = "light pink" /datum/status_effect/stabilized/lightpink/on_apply() - owner.add_movespeed_modifier(MOVESPEED_ID_SLIME_STATUS, update=TRUE, priority=100, multiplicative_slowdown=-0.5, blacklisted_movetypes=(FLYING|FLOATING)) + owner._REFACTORING_add_movespeed_modifier(/datum/movespeed_modifier/status_effect/lightpink) return ..() /datum/status_effect/stabilized/lightpink/tick() @@ -910,7 +910,7 @@ datum/status_effect/stabilized/blue/on_remove() return ..() /datum/status_effect/stabilized/lightpink/on_remove() - owner.remove_movespeed_modifier(MOVESPEED_ID_SLIME_STATUS) + owner._REFACTORING_remove_movespeed_modifier(/datum/movespeed_modifier/status_effect/lightpink) /datum/status_effect/stabilized/adamantine id = "stabilizedadamantine" diff --git a/code/modules/station_goals/dna_vault.dm b/code/modules/station_goals/dna_vault.dm index e040ea422a4..98cafcb0bda 100644 --- a/code/modules/station_goals/dna_vault.dm +++ b/code/modules/station_goals/dna_vault.dm @@ -248,8 +248,6 @@ else return ..() - - /obj/machinery/dna_vault/proc/upgrade(mob/living/carbon/human/H,upgrade_type) if(!(upgrade_type in power_lottery[H])) return diff --git a/tgstation.dme b/tgstation.dme index 7642b2722b8..6e500d532af 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -2381,9 +2381,9 @@ #include "code\modules\movespeed\_movespeed_modifier.dm" #include "code\modules\movespeed\modifiers\components.dm" #include "code\modules\movespeed\modifiers\innate.dm" +#include "code\modules\movespeed\modifiers\mobs.dm" #include "code\modules\movespeed\modifiers\reagent.dm" #include "code\modules\movespeed\modifiers\status_effects.dm" -#include "code\modules\movespeed\modifiers\variable.dm" #include "code\modules\ninja\__ninjaDefines.dm" #include "code\modules\ninja\energy_katana.dm" #include "code\modules\ninja\ninja_event.dm"