From 75c575acef74f9853eb59edf9c018779abdf5529 Mon Sep 17 00:00:00 2001 From: kevinz000 <2003111+kevinz000@users.noreply.github.com> Date: Fri, 10 Jan 2020 13:36:32 -0800 Subject: [PATCH] move some stuff add some stuff yadda yadda --- .../antagonists/slaughter/slaughter.dm | 2 +- .../mob/living/carbon/monkey/monkey.dm | 2 -- code/modules/movespeed/_movespeed_modifier.dm | 26 +++++++++---------- code/modules/movespeed/modifiers/reagent.dm | 15 +++++++++++ .../chemistry/reagents/drink_reagents.dm | 5 ++-- .../chemistry/reagents/food_reagents.dm | 4 +-- .../chemistry/reagents/medicine_reagents.dm | 4 +-- 7 files changed, 35 insertions(+), 23 deletions(-) diff --git a/code/modules/antagonists/slaughter/slaughter.dm b/code/modules/antagonists/slaughter/slaughter.dm index 4f3f49e04cd..c4fb5deb541 100644 --- a/code/modules/antagonists/slaughter/slaughter.dm +++ b/code/modules/antagonists/slaughter/slaughter.dm @@ -33,7 +33,7 @@ health = 200 healable = 0 environment_smash = ENVIRONMENT_SMASH_STRUCTURES - obj_damage = 50 + obj_damage = 5 melee_damage_lower = 30 melee_damage_upper = 30 see_in_dark = 8 diff --git a/code/modules/mob/living/carbon/monkey/monkey.dm b/code/modules/mob/living/carbon/monkey/monkey.dm index 51a1a284c54..15ae5c68270 100644 --- a/code/modules/mob/living/carbon/monkey/monkey.dm +++ b/code/modules/mob/living/carbon/monkey/monkey.dm @@ -95,8 +95,6 @@ if(changeling) stat("Chemical Storage", "[changeling.chem_charges]/[changeling.chem_storage]") stat("Absorbed DNA", changeling.absorbedcount) - return - /mob/living/carbon/monkey/verb/removeinternal() set name = "Remove Internals" diff --git a/code/modules/movespeed/_movespeed_modifier.dm b/code/modules/movespeed/_movespeed_modifier.dm index 30871b1e01f..2df0435bfb5 100644 --- a/code/modules/movespeed/_movespeed_modifier.dm +++ b/code/modules/movespeed/_movespeed_modifier.dm @@ -96,7 +96,7 @@ GLOBAL_LIST_EMPTY(movespeed_modification_cache) type_id_datum = type_id_datum.id if(!LAZYACCESS(movespeed_modification, type_id_datum)) return FALSE - LAZYREMOVE(movespeed_modification, id) + LAZYREMOVE(movespeed_modification, type_id_datum) UNSETEMPTY(movespeed_modification) if(update) update_movespeed(FALSE) @@ -139,13 +139,13 @@ GLOBAL_LIST_EMPTY(movespeed_modification_cache) . = 0 var/list/conflict_tracker = list() for(var/id in get_movespeed_modifiers()) - var/list/data = movespeed_modification[id] - if(!(data[MOVESPEED_DATA_INDEX_MOVETYPE] & movement_type)) // We don't affect any of these move types, skip + var/datum/movespeed_modifier/M = movespeed_modification[id] + if(!(M.movetypes & movement_type)) // We don't affect any of these move types, skip continue - if(data[MOVESPEED_DATA_INDEX_BL_MOVETYPE] & movement_type) // There's a movetype here that disables this modifier, skip + if(M.blacklisted_movetypes & movement_type) // There's a movetype here that disables this modifier, skip continue - var/conflict = data[MOVESPEED_DATA_INDEX_CONFLICT] - var/amt = data[MOVESPEED_DATA_INDEX_MULTIPLICATIVE_SLOWDOWN] + var/conflict = M.conflict + var/amt = M.multiplicative_slowdown if(conflict) // Conflicting modifiers prioritize the larger slowdown or the larger speedup // We purposefuly don't handle mixing speedups and slowdowns on the same id @@ -183,20 +183,20 @@ GLOBAL_LIST_EMPTY(movespeed_modification_cache) return var/list/assembled = list() for(var/our_id in movespeed_modification) - var/list/our_data = movespeed_modification[our_id] - if(!islist(our_data) || (our_data.len < MOVESPEED_DATA_INDEX_PRIORITY) || movespeed_data_null_check(our_data)) + var/datum/movespeed_modifier/M = movespeed_modification[our_id] + if(!istype(M) || movespeed_data_null_check(M)) movespeed_modification -= our_id continue - var/our_priority = our_data[MOVESPEED_DATA_INDEX_PRIORITY] + var/our_priority = M.priority var/resolved = FALSE for(var/their_id in assembled) - var/list/their_data = assembled[their_id] - if(their_data[MOVESPEED_DATA_INDEX_PRIORITY] < our_priority) + var/datum/movespeed_modifier/other = assembled[their_id] + if(other.priority < our_priority) assembled.Insert(assembled.Find(their_id), our_id) - assembled[our_id] = our_data + assembled[our_id] = M resolved = TRUE break if(!resolved) - assembled[our_id] = our_data + assembled[our_id] = M movespeed_modification = assembled UNSETEMPTY(movespeed_modification) diff --git a/code/modules/movespeed/modifiers/reagent.dm b/code/modules/movespeed/modifiers/reagent.dm index a66b6c730ee..90d4348486c 100644 --- a/code/modules/movespeed/modifiers/reagent.dm +++ b/code/modules/movespeed/modifiers/reagent.dm @@ -7,3 +7,18 @@ 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) diff --git a/code/modules/reagents/chemistry/reagents/drink_reagents.dm b/code/modules/reagents/chemistry/reagents/drink_reagents.dm index 3f2592dfc46..b291206e370 100644 --- a/code/modules/reagents/chemistry/reagents/drink_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/drink_reagents.dm @@ -556,17 +556,16 @@ /datum/reagent/consumable/monkey_energy/on_mob_metabolize(mob/living/L) ..() if(ismonkey(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/monkey_energy) /datum/reagent/consumable/monkey_energy/on_mob_end_metabolize(mob/living/L) - L.remove_movespeed_modifier(type) + L._REFACTORING_remove_movespeed_modifier(/datum/movespeed_modifier/reagent/monkey_energy) ..() /datum/reagent/consumable/monkey_energy/overdose_process(mob/living/M) if(prob(15)) M.say(pick_list_replacements(BOOMER_FILE, "boomer"), forced = /datum/reagent/consumable/monkey_energy) ..() - return /datum/reagent/consumable/ice name = "Ice" diff --git a/code/modules/reagents/chemistry/reagents/food_reagents.dm b/code/modules/reagents/chemistry/reagents/food_reagents.dm index 017b30a369a..0159f6852ff 100755 --- a/code/modules/reagents/chemistry/reagents/food_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/food_reagents.dm @@ -293,8 +293,8 @@ victim.blind_eyes(3) // 6 seconds victim.confused = max(M.confused, 5) // 10 seconds victim.Knockdown(3 SECONDS) - victim.add_movespeed_modifier(MOVESPEED_ID_PEPPER_SPRAY, update=TRUE, priority=100, multiplicative_slowdown=0.25, blacklisted_movetypes=(FLYING|FLOATING)) - addtimer(CALLBACK(victim, /mob.proc/remove_movespeed_modifier, MOVESPEED_ID_PEPPER_SPRAY), 10 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) 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 79c87e51c88..2115a2d8a95 100644 --- a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm @@ -1348,14 +1348,14 @@ ..() ADD_TRAIT(L, TRAIT_SLEEPIMMUNE, type) ADD_TRAIT(L, TRAIT_STUNRESISTANCE, type) - 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/badstims) L.ignore_slowdown(type) /datum/reagent/medicine/badstims/on_mob_end_metabolize(mob/living/L) ..() REMOVE_TRAIT(L, TRAIT_SLEEPIMMUNE, type) REMOVE_TRAIT(L, TRAIT_STUNRESISTANCE, type) - L.remove_movespeed_modifier(type) + L._REFACTORING_remove_movespeed_modifier(/datum/movespeed_modifier/reagent/badstims) L.unignore_slowdown(type) L.Dizzy(0) L.Jitter(0)