Merge pull request #11980 from Ghommie/Ghommie-cit700
Movespeed modifiers refactor port.
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
to_chat(user, "<span class='notice'>Our muscles tense and strengthen.</span>")
|
||||
changeling.chem_recharge_slowdown += 0.5
|
||||
else
|
||||
user.remove_movespeed_modifier(MOVESPEED_ID_CHANGELING_MUSCLES)
|
||||
user.remove_movespeed_modifier(/datum/movespeed_modifier/strained_muscles)
|
||||
to_chat(user, "<span class='notice'>Our muscles relax.</span>")
|
||||
changeling.chem_recharge_slowdown -= 0.5
|
||||
if(stacks >= 20)
|
||||
@@ -36,12 +36,12 @@
|
||||
/obj/effect/proc_holder/changeling/strained_muscles/proc/muscle_loop(mob/living/carbon/user)
|
||||
var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling)
|
||||
while(active)
|
||||
user.add_movespeed_modifier(MOVESPEED_ID_CHANGELING_MUSCLES, update=TRUE, priority=100, multiplicative_slowdown=-1, blacklisted_movetypes=(FLYING|FLOATING))
|
||||
user.add_movespeed_modifier(/datum/movespeed_modifier/strained_muscles)
|
||||
if(user.stat != CONSCIOUS || user.staminaloss >= 90)
|
||||
active = !active
|
||||
to_chat(user, "<span class='notice'>Our muscles relax without the energy to strengthen them.</span>")
|
||||
user.DefaultCombatKnockdown(40)
|
||||
user.remove_movespeed_modifier(MOVESPEED_ID_CHANGELING_MUSCLES)
|
||||
user.remove_movespeed_modifier(/datum/movespeed_modifier/strained_muscles)
|
||||
changeling.chem_recharge_slowdown -= 0.5
|
||||
break
|
||||
|
||||
|
||||
@@ -64,8 +64,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)
|
||||
add_movespeed_modifier(/datum/movespeed_modifier/slaughter)
|
||||
addtimer(CALLBACK(src, .proc/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
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
update_body_parts() //to update the carbon's new bodyparts appearance
|
||||
GLOB.carbon_list += src
|
||||
blood_volume = (BLOOD_VOLUME_NORMAL * blood_ratio)
|
||||
add_movespeed_modifier(/datum/movespeed_modifier/carbon_crawling)
|
||||
|
||||
/mob/living/carbon/Destroy()
|
||||
//This must be done first, so the mob ghosts correctly before DNA etc is nulled
|
||||
@@ -574,9 +575,9 @@
|
||||
become_husk("burn")
|
||||
med_hud_set_health()
|
||||
if(stat == SOFT_CRIT)
|
||||
add_movespeed_modifier(MOVESPEED_ID_CARBON_SOFTCRIT, TRUE, multiplicative_slowdown = SOFTCRIT_ADD_SLOWDOWN)
|
||||
add_movespeed_modifier(/datum/movespeed_modifier/carbon_softcrit)
|
||||
else
|
||||
remove_movespeed_modifier(MOVESPEED_ID_CARBON_SOFTCRIT, TRUE)
|
||||
remove_movespeed_modifier(/datum/movespeed_modifier/carbon_softcrit)
|
||||
|
||||
/mob/living/carbon/update_stamina()
|
||||
var/stam = getStaminaLoss()
|
||||
|
||||
@@ -1041,7 +1041,7 @@
|
||||
return FALSE
|
||||
|
||||
/mob/living/carbon/human/proc/clear_shove_slowdown()
|
||||
remove_movespeed_modifier(MOVESPEED_ID_SHOVE)
|
||||
remove_movespeed_modifier(/datum/movespeed_modifier/shove)
|
||||
var/active_item = get_active_held_item()
|
||||
if(is_type_in_typecache(active_item, GLOB.shove_disarming_types))
|
||||
visible_message("<span class='warning'>[src.name] regains their grip on \the [active_item]!</span>", "<span class='warning'>You regain your grip on \the [active_item]</span>", null, COMBAT_MESSAGE_RANGE)
|
||||
@@ -1050,17 +1050,17 @@
|
||||
. = ..()
|
||||
|
||||
if(HAS_TRAIT(src, TRAIT_IGNORESLOWDOWN))
|
||||
remove_movespeed_modifier(MOVESPEED_ID_DAMAGE_SLOWDOWN)
|
||||
remove_movespeed_modifier(MOVESPEED_ID_DAMAGE_SLOWDOWN_FLYING)
|
||||
remove_movespeed_modifier(/datum/movespeed_modifier/damage_slowdown)
|
||||
remove_movespeed_modifier(/datum/movespeed_modifier/damage_slowdown_flying)
|
||||
return
|
||||
var/stambufferinfluence = (bufferedstam*(100/stambuffer))*0.2 //CIT CHANGE - makes stamina buffer influence movedelay
|
||||
var/health_deficiency = ((100 + stambufferinfluence) - health + (getStaminaLoss()*0.75))//CIT CHANGE - reduces the impact of staminaloss and makes stamina buffer influence it
|
||||
if(health_deficiency >= 40)
|
||||
add_movespeed_modifier(MOVESPEED_ID_DAMAGE_SLOWDOWN, override = TRUE, multiplicative_slowdown = ((health_deficiency-39) / 75), blacklisted_movetypes = FLOATING|FLYING)
|
||||
add_movespeed_modifier(MOVESPEED_ID_DAMAGE_SLOWDOWN_FLYING, override = TRUE, multiplicative_slowdown = ((health_deficiency-39) / 25), movetypes = FLYING, blacklisted_movetypes = FLOATING)
|
||||
add_or_update_variable_movespeed_modifier(/datum/movespeed_modifier/damage_slowdown, TRUE, (health_deficiency-39) / 75)
|
||||
add_or_update_variable_movespeed_modifier(/datum/movespeed_modifier/damage_slowdown_flying, TRUE, (health_deficiency-39) / 25)
|
||||
else
|
||||
remove_movespeed_modifier(MOVESPEED_ID_DAMAGE_SLOWDOWN)
|
||||
remove_movespeed_modifier(MOVESPEED_ID_DAMAGE_SLOWDOWN_FLYING)
|
||||
remove_movespeed_modifier(/datum/movespeed_modifier/damage_slowdown)
|
||||
remove_movespeed_modifier(/datum/movespeed_modifier/damage_slowdown_flying)
|
||||
|
||||
/mob/living/carbon/human/do_after_coefficent()
|
||||
. = ..()
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
/mob/living/carbon/human/get_movespeed_modifiers()
|
||||
var/list/considering = ..()
|
||||
. = considering
|
||||
if(HAS_TRAIT(src, TRAIT_IGNORESLOWDOWN))
|
||||
for(var/id in .)
|
||||
var/list/data = .[id]
|
||||
if(data[MOVESPEED_DATA_INDEX_FLAGS] & IGNORE_NOSLOW)
|
||||
.[id] = data
|
||||
. = list()
|
||||
for(var/id in considering)
|
||||
var/datum/movespeed_modifier/M = considering[id]
|
||||
if(M.flags & IGNORE_NOSLOW || M.multiplicative_slowdown < 0)
|
||||
.[id] = M
|
||||
return
|
||||
return considering
|
||||
|
||||
/mob/living/carbon/human/movement_delay()
|
||||
. = ..()
|
||||
|
||||
@@ -331,7 +331,7 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
|
||||
if(mutant_bodyparts["meat_type"]) //I can't believe it's come to the meat
|
||||
H.type_of_meat = GLOB.meat_types[H.dna.features["meat_type"]]
|
||||
|
||||
C.add_movespeed_modifier(MOVESPEED_ID_SPECIES, TRUE, 100, override=TRUE, multiplicative_slowdown=speedmod, movetypes=(~FLYING))
|
||||
C.add_or_update_variable_movespeed_modifier(/datum/movespeed_modifier/species, TRUE, multiplicative_slowdown = speedmod)
|
||||
|
||||
SEND_SIGNAL(C, COMSIG_SPECIES_GAIN, src, old_species)
|
||||
|
||||
@@ -349,7 +349,7 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
|
||||
for(var/X in inherent_traits)
|
||||
REMOVE_TRAIT(C, X, SPECIES_TRAIT)
|
||||
|
||||
C.remove_movespeed_modifier(MOVESPEED_ID_SPECIES)
|
||||
C.remove_movespeed_modifier(/datum/movespeed_modifier/species)
|
||||
|
||||
if(mutant_bodyparts["meat_type"])
|
||||
C.type_of_meat = GLOB.meat_types[C.dna.features["meat_type"]]
|
||||
@@ -1299,14 +1299,14 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
|
||||
if(H.overeatduration < 100)
|
||||
to_chat(H, "<span class='notice'>You feel fit again!</span>")
|
||||
REMOVE_TRAIT(H, TRAIT_FAT, OBESITY)
|
||||
H.remove_movespeed_modifier(MOVESPEED_ID_FAT)
|
||||
H.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, "<span class='danger'>You suddenly feel blubbery!</span>")
|
||||
ADD_TRAIT(H, TRAIT_FAT, OBESITY)
|
||||
H.add_movespeed_modifier(MOVESPEED_ID_FAT, multiplicative_slowdown = 1.5)
|
||||
H.add_movespeed_modifier(/datum/movespeed_modifier/obesity)
|
||||
H.update_inv_w_uniform()
|
||||
H.update_inv_wear_suit()
|
||||
|
||||
@@ -1362,9 +1362,9 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
|
||||
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
|
||||
H.remove_movespeed_modifier(MOVESPEED_ID_HUNGRY)
|
||||
H.remove_movespeed_modifier(/datum/movespeed_modifier/hunger)
|
||||
|
||||
switch(H.nutrition)
|
||||
if(NUTRITION_LEVEL_FULL to INFINITY)
|
||||
@@ -1615,7 +1615,7 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
|
||||
"You hear a slap."
|
||||
)
|
||||
return FALSE
|
||||
|
||||
|
||||
else
|
||||
user.do_attack_animation(target, ATTACK_EFFECT_DISARM)
|
||||
|
||||
@@ -1623,10 +1623,10 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
|
||||
user.adjustStaminaLossBuffered(1)
|
||||
else
|
||||
user.adjustStaminaLossBuffered(3)
|
||||
|
||||
|
||||
if(attacker_style && attacker_style.disarm_act(user,target))
|
||||
return TRUE
|
||||
|
||||
|
||||
if(target.w_uniform)
|
||||
target.w_uniform.add_fingerprint(user)
|
||||
//var/randomized_zone = ran_zone(user.zone_selected) CIT CHANGE - comments out to prevent compiling errors
|
||||
@@ -1659,7 +1659,7 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
|
||||
randn -= 25 //if you are a pugilist, you're slapping that item from them pretty reliably
|
||||
if(HAS_TRAIT(target, TRAIT_PUGILIST))
|
||||
randn += 25 //meanwhile, pugilists are less likely to get disarmed
|
||||
|
||||
|
||||
if(randn <= 35)//CIT CHANGE - changes this back to a 35% chance to accomodate for the above being commented out in favor of right-click pushing
|
||||
var/obj/item/I = null
|
||||
if(target.pulling)
|
||||
@@ -1932,8 +1932,8 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
|
||||
var/obj/item/target_held_item = target.get_active_held_item()
|
||||
if(!is_type_in_typecache(target_held_item, GLOB.shove_disarming_types))
|
||||
target_held_item = null
|
||||
if(!target.has_movespeed_modifier(MOVESPEED_ID_SHOVE))
|
||||
target.add_movespeed_modifier(MOVESPEED_ID_SHOVE, multiplicative_slowdown = SHOVE_SLOWDOWN_STRENGTH)
|
||||
if(!target.has_movespeed_modifier(/datum/movespeed_modifier/shove))
|
||||
target.add_movespeed_modifier(/datum/movespeed_modifier/shove)
|
||||
if(target_held_item)
|
||||
if(!HAS_TRAIT(target_held_item, TRAIT_NODROP))
|
||||
target.visible_message("<span class='danger'>[target.name]'s grip on \the [target_held_item] loosens!</span>",
|
||||
@@ -2084,7 +2084,7 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
|
||||
SEND_SIGNAL(H, COMSIG_CLEAR_MOOD_EVENT, "cold")
|
||||
SEND_SIGNAL(H, COMSIG_ADD_MOOD_EVENT, "hot", /datum/mood_event/hot)
|
||||
|
||||
H.remove_movespeed_modifier(MOVESPEED_ID_COLD)
|
||||
H.remove_movespeed_modifier(/datum/movespeed_modifier/cold)
|
||||
|
||||
var/burn_damage
|
||||
var/firemodifier = H.fire_stacks / 50
|
||||
@@ -2101,8 +2101,8 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
|
||||
else if(H.bodytemperature < BODYTEMP_COLD_DAMAGE_LIMIT && !HAS_TRAIT(H, TRAIT_RESISTCOLD))
|
||||
SEND_SIGNAL(H, COMSIG_CLEAR_MOOD_EVENT, "hot")
|
||||
SEND_SIGNAL(H, COMSIG_ADD_MOOD_EVENT, "cold", /datum/mood_event/cold)
|
||||
//Sorry for the nasty oneline but I don't want to assign a variable on something run pretty frequently
|
||||
H.add_movespeed_modifier(MOVESPEED_ID_COLD, override = TRUE, multiplicative_slowdown = ((BODYTEMP_COLD_DAMAGE_LIMIT - H.bodytemperature) / COLD_SLOWDOWN_FACTOR), blacklisted_movetypes = FLOATING)
|
||||
//Apply cold slowdown
|
||||
H.add_or_update_variable_movespeed_modifier(/datum/movespeed_modifier/cold, multiplicative_slowdown = ((BODYTEMP_COLD_DAMAGE_LIMIT - H.bodytemperature) / COLD_SLOWDOWN_FACTOR))
|
||||
switch(H.bodytemperature)
|
||||
if(200 to BODYTEMP_COLD_DAMAGE_LIMIT)
|
||||
H.apply_damage(COLD_DAMAGE_LEVEL_1*coldmod*H.physiology.cold_mod, BURN)
|
||||
@@ -2112,7 +2112,7 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
|
||||
H.apply_damage(COLD_DAMAGE_LEVEL_3*coldmod*H.physiology.cold_mod, BURN)
|
||||
|
||||
else
|
||||
H.remove_movespeed_modifier(MOVESPEED_ID_COLD)
|
||||
H.remove_movespeed_modifier(/datum/movespeed_modifier/cold)
|
||||
SEND_SIGNAL(H, COMSIG_CLEAR_MOOD_EVENT, "cold")
|
||||
SEND_SIGNAL(H, COMSIG_CLEAR_MOOD_EVENT, "hot")
|
||||
|
||||
|
||||
@@ -65,12 +65,11 @@
|
||||
|
||||
/mob/living/carbon/monkey/on_reagent_change()
|
||||
. = ..()
|
||||
remove_movespeed_modifier(MOVESPEED_ID_MONKEY_REAGENT_SPEEDMOD, TRUE)
|
||||
var/amount
|
||||
if(reagents.has_reagent(/datum/reagent/medicine/morphine))
|
||||
amount = -1
|
||||
if(amount)
|
||||
add_movespeed_modifier(MOVESPEED_ID_MONKEY_REAGENT_SPEEDMOD, TRUE, 100, override = TRUE, multiplicative_slowdown = amount)
|
||||
add_or_update_variable_movespeed_modifier(/datum/movespeed_modifier/monkey_reagent_speedmod, TRUE, amount)
|
||||
|
||||
/mob/living/carbon/monkey/updatehealth()
|
||||
. = ..()
|
||||
@@ -78,7 +77,7 @@
|
||||
var/health_deficiency = (100 - health)
|
||||
if(health_deficiency >= 45)
|
||||
slow += (health_deficiency / 25)
|
||||
add_movespeed_modifier(MOVESPEED_ID_MONKEY_HEALTH_SPEEDMOD, TRUE, 100, override = TRUE, multiplicative_slowdown = slow)
|
||||
add_or_update_variable_movespeed_modifier(/datum/movespeed_modifier/monkey_health_speedmod, TRUE, slow)
|
||||
|
||||
/mob/living/carbon/monkey/adjust_bodytemperature(amount)
|
||||
. = ..()
|
||||
@@ -87,7 +86,7 @@
|
||||
slow += (283.222 - bodytemperature) / 10 * 1.75
|
||||
if(slow <= 0)
|
||||
return
|
||||
add_movespeed_modifier(MOVESPEED_ID_MONKEY_TEMPERATURE_SPEEDMOD, TRUE, 100, override = TRUE, multiplicative_slowdown = amount)
|
||||
add_or_update_variable_movespeed_modifier(/datum/movespeed_modifier/monkey_temperature_speedmod, TRUE, slow)
|
||||
|
||||
/mob/living/carbon/monkey/Stat()
|
||||
..()
|
||||
@@ -99,7 +98,6 @@
|
||||
if(changeling)
|
||||
stat("Chemical Storage", "[changeling.chem_charges]/[changeling.chem_storage]")
|
||||
stat("Absorbed DNA", changeling.absorbedcount)
|
||||
return
|
||||
|
||||
|
||||
/mob/living/carbon/monkey/verb/removeinternal()
|
||||
|
||||
@@ -94,11 +94,13 @@
|
||||
|
||||
if(should_be_lying)
|
||||
mobility_flags &= ~MOBILITY_STAND
|
||||
setMovetype(movement_type | CRAWLING)
|
||||
if(!lying) //force them on the ground
|
||||
lying = pick(90, 270)
|
||||
if(has_gravity() && !buckled)
|
||||
playsound(src, "bodyfall", 20, 1)
|
||||
else
|
||||
setMovetype(movement_type & ~CRAWLING)
|
||||
mobility_flags |= MOBILITY_STAND
|
||||
lying = 0
|
||||
|
||||
@@ -161,8 +163,8 @@
|
||||
if(!has_legs && has_arms < 2)
|
||||
limbless_slowdown += 6 - (has_arms * 3)
|
||||
if(limbless_slowdown)
|
||||
add_movespeed_modifier(MOVESPEED_ID_LIVING_LIMBLESS, update=TRUE, priority=100, override=TRUE, multiplicative_slowdown=limbless_slowdown, blacklisted_movetypes = FLYING|FLOATING)
|
||||
add_or_update_variable_movespeed_modifier(/datum/movespeed_modifier/limbless, multiplicative_slowdown = limbless_slowdown)
|
||||
else
|
||||
remove_movespeed_modifier(MOVESPEED_ID_LIVING_LIMBLESS, update=TRUE)
|
||||
remove_movespeed_modifier(/datum/movespeed_modifier/limbless)
|
||||
|
||||
return mobility_flags
|
||||
|
||||
@@ -36,38 +36,26 @@
|
||||
sprint_stamina_cost = CONFIG_GET(number/movedelay/sprint_stamina_cost)
|
||||
return ..()
|
||||
|
||||
/mob/living/movement_delay(ignorewalk = 0)
|
||||
. = ..()
|
||||
if(!CHECK_MOBILITY(src, MOBILITY_STAND))
|
||||
. += 6
|
||||
|
||||
/// whether or not we can slide under another living mob. defaults to if we're not dense. CanPass should check "overriding circumstances" like buckled mobs/having PASSMOB flag, etc.
|
||||
/mob/living/proc/can_move_under_living(mob/living/other)
|
||||
return !density
|
||||
|
||||
/mob/living/proc/update_move_intent_slowdown()
|
||||
var/mod = 0
|
||||
if(m_intent == MOVE_INTENT_WALK)
|
||||
mod = CONFIG_GET(number/movedelay/walk_delay)
|
||||
else
|
||||
mod = CONFIG_GET(number/movedelay/run_delay)
|
||||
if(!isnum(mod))
|
||||
mod = 1
|
||||
add_movespeed_modifier(MOVESPEED_ID_MOB_WALK_RUN_CONFIG_SPEED, TRUE, 100, override = TRUE, multiplicative_slowdown = mod)
|
||||
add_movespeed_modifier((m_intent == MOVE_INTENT_WALK)? /datum/movespeed_modifier/config_walk_run/walk : /datum/movespeed_modifier/config_walk_run/run)
|
||||
|
||||
/mob/living/proc/update_turf_movespeed(turf/open/T)
|
||||
if(isopenturf(T) && !is_flying())
|
||||
add_movespeed_modifier(MOVESPEED_ID_LIVING_TURF_SPEEDMOD, TRUE, 100, override = TRUE, multiplicative_slowdown = T.slowdown)
|
||||
if(isopenturf(T))
|
||||
add_or_update_variable_movespeed_modifier(/datum/movespeed_modifier/turf_slowdown, multiplicative_slowdown = T.slowdown)
|
||||
else
|
||||
remove_movespeed_modifier(MOVESPEED_ID_LIVING_TURF_SPEEDMOD)
|
||||
remove_movespeed_modifier(/datum/movespeed_modifier/turf_slowdown)
|
||||
|
||||
/mob/living/proc/update_pull_movespeed()
|
||||
if(pulling && isliving(pulling))
|
||||
var/mob/living/L = pulling
|
||||
if(drag_slowdown && L.lying && !L.buckled && grab_state < GRAB_AGGRESSIVE)
|
||||
add_movespeed_modifier(MOVESPEED_ID_PRONE_DRAGGING, multiplicative_slowdown = PULL_PRONE_SLOWDOWN)
|
||||
add_or_update_variable_movespeed_modifier(/datum/movespeed_modifier/bulky_drag, multiplicative_slowdown = PULL_PRONE_SLOWDOWN)
|
||||
return
|
||||
remove_movespeed_modifier(MOVESPEED_ID_PRONE_DRAGGING)
|
||||
remove_movespeed_modifier(/datum/movespeed_modifier/bulky_drag)
|
||||
|
||||
/mob/living/canZMove(dir, turf/target)
|
||||
return can_zTravel(target, dir) && (movement_type & FLYING)
|
||||
|
||||
@@ -273,9 +273,9 @@
|
||||
/mob/living/silicon/pai/Process_Spacemove(movement_dir = 0)
|
||||
. = ..()
|
||||
if(!.)
|
||||
add_movespeed_modifier(MOVESPEED_ID_PAI_SPACEWALK_SPEEDMOD, TRUE, 100, multiplicative_slowdown = 2)
|
||||
add_movespeed_modifier(/datum/movespeed_modifier/pai_spacewalk)
|
||||
return TRUE
|
||||
remove_movespeed_modifier(MOVESPEED_ID_PAI_SPACEWALK_SPEEDMOD, TRUE)
|
||||
remove_movespeed_modifier(/datum/movespeed_modifier/pai_spacewalk)
|
||||
return TRUE
|
||||
|
||||
/mob/living/silicon/pai/examine(mob/user)
|
||||
|
||||
@@ -186,10 +186,10 @@
|
||||
. = ..()
|
||||
if(slowed_by_webs)
|
||||
if(!(locate(/obj/structure/spider/stickyweb) in loc))
|
||||
remove_movespeed_modifier(MOVESPEED_ID_TARANTULA_WEB)
|
||||
remove_movespeed_modifier(/datum/movespeed_modifier/tarantula_web)
|
||||
slowed_by_webs = FALSE
|
||||
else if(locate(/obj/structure/spider/stickyweb) in loc)
|
||||
add_movespeed_modifier(MOVESPEED_ID_TARANTULA_WEB, priority=100, multiplicative_slowdown=3)
|
||||
add_movespeed_modifier(/datum/movespeed_modifier/tarantula_web)
|
||||
slowed_by_webs = TRUE
|
||||
|
||||
//midwives are the queen of the spiders, can send messages to all them and web faster. That rare round where you get a queen spider and turn your 'for honor' players into 'r6siege' players will be a fun one.
|
||||
|
||||
@@ -292,8 +292,8 @@
|
||||
|
||||
/mob/living/simple_animal/proc/update_simplemob_varspeed()
|
||||
if(speed == 0)
|
||||
remove_movespeed_modifier(MOVESPEED_ID_SIMPLEMOB_VARSPEED, TRUE)
|
||||
add_movespeed_modifier(MOVESPEED_ID_SIMPLEMOB_VARSPEED, TRUE, 100, multiplicative_slowdown = speed, override = TRUE)
|
||||
remove_movespeed_modifier(/datum/movespeed_modifier/simplemob_varspeed)
|
||||
add_or_update_variable_movespeed_modifier(/datum/movespeed_modifier/simplemob_varspeed, multiplicative_slowdown = speed)
|
||||
|
||||
/mob/living/simple_animal/Stat()
|
||||
..()
|
||||
|
||||
@@ -147,25 +147,25 @@
|
||||
|
||||
/mob/living/simple_animal/slime/on_reagent_change()
|
||||
. = ..()
|
||||
remove_movespeed_modifier(MOVESPEED_ID_SLIME_REAGENTMOD, TRUE)
|
||||
remove_movespeed_modifier(/datum/movespeed_modifier/slime_reagentmod)
|
||||
var/amount = 0
|
||||
if(reagents.has_reagent(/datum/reagent/medicine/morphine)) // morphine slows slimes down
|
||||
amount = 2
|
||||
if(reagents.has_reagent(/datum/reagent/consumable/frostoil)) // Frostoil also makes them move VEEERRYYYYY slow
|
||||
amount = 5
|
||||
if(amount)
|
||||
add_movespeed_modifier(MOVESPEED_ID_SLIME_REAGENTMOD, TRUE, 100, override = TRUE, multiplicative_slowdown = amount)
|
||||
add_or_update_variable_movespeed_modifier(/datum/movespeed_modifier/slime_reagentmod, multiplicative_slowdown = amount)
|
||||
|
||||
/mob/living/simple_animal/slime/updatehealth()
|
||||
. = ..()
|
||||
remove_movespeed_modifier(MOVESPEED_ID_SLIME_HEALTHMOD, FALSE)
|
||||
remove_movespeed_modifier(/datum/movespeed_modifier/slime_healthmod)
|
||||
var/health_deficiency = (100 - health)
|
||||
var/mod = 0
|
||||
if(health_deficiency >= 45)
|
||||
mod += (health_deficiency / 25)
|
||||
if(health <= 0)
|
||||
mod += 2
|
||||
add_movespeed_modifier(MOVESPEED_ID_SLIME_HEALTHMOD, TRUE, 100, multiplicative_slowdown = mod)
|
||||
add_or_update_variable_movespeed_modifier(/datum/movespeed_modifier/slime_healthmod, multiplicative_slowdown = mod)
|
||||
|
||||
/mob/living/simple_animal/slime/adjust_bodytemperature()
|
||||
. = ..()
|
||||
@@ -173,9 +173,8 @@
|
||||
if(bodytemperature >= 330.23) // 135 F or 57.08 C
|
||||
mod = -1 // slimes become supercharged at high temperatures
|
||||
else if(bodytemperature < 183.222)
|
||||
mod = (283.222 - bodytemperature) / 10 * 1.75
|
||||
if(mod)
|
||||
add_movespeed_modifier(MOVESPEED_ID_SLIME_TEMPMOD, TRUE, 100, override = TRUE, multiplicative_slowdown = mod)
|
||||
mod = min(15, (283.222 - bodytemperature) / 10 * 1.75)
|
||||
add_or_update_variable_movespeed_modifier(/datum/movespeed_modifier/slime_tempmod, multiplicative_slowdown = mod)
|
||||
|
||||
/mob/living/simple_animal/slime/ObjBump(obj/O)
|
||||
if(!client && powerlevel > 0)
|
||||
|
||||
@@ -622,10 +622,40 @@
|
||||
tod = STATION_TIME_TIMESTAMP("hh:mm:ss", world.time)
|
||||
update_stat()
|
||||
|
||||
///Unignores all slowdowns that lack the IGNORE_NOSLOW flag.
|
||||
/mob/living/proc/unignore_slowdown(source)
|
||||
REMOVE_TRAIT(src, TRAIT_IGNORESLOWDOWN, source)
|
||||
update_movespeed(FALSE)
|
||||
update_movespeed()
|
||||
|
||||
///Ignores all slowdowns that lack the IGNORE_NOSLOW flag.
|
||||
/mob/living/proc/ignore_slowdown(source)
|
||||
ADD_TRAIT(src, TRAIT_IGNORESLOWDOWN, source)
|
||||
update_movespeed(FALSE)
|
||||
update_movespeed()
|
||||
|
||||
///Ignores specific slowdowns. Accepts a list of slowdowns.
|
||||
/mob/living/proc/add_movespeed_mod_immunities(source, slowdown_type, update = TRUE)
|
||||
if(islist(slowdown_type))
|
||||
for(var/listed_type in slowdown_type)
|
||||
if(ispath(listed_type))
|
||||
listed_type = "[listed_type]" //Path2String
|
||||
LAZYADDASSOC(movespeed_mod_immunities, listed_type, source)
|
||||
else
|
||||
if(ispath(slowdown_type))
|
||||
slowdown_type = "[slowdown_type]" //Path2String
|
||||
LAZYADDASSOC(movespeed_mod_immunities, slowdown_type, source)
|
||||
if(update)
|
||||
update_movespeed()
|
||||
|
||||
///Unignores specific slowdowns. Accepts a list of slowdowns.
|
||||
/mob/living/proc/remove_movespeed_mod_immunities(source, slowdown_type, update = TRUE)
|
||||
if(islist(slowdown_type))
|
||||
for(var/listed_type in slowdown_type)
|
||||
if(ispath(listed_type))
|
||||
listed_type = "[listed_type]" //Path2String
|
||||
LAZYREMOVEASSOC(movespeed_mod_immunities, listed_type, source)
|
||||
else
|
||||
if(ispath(slowdown_type))
|
||||
slowdown_type = "[slowdown_type]" //Path2String
|
||||
LAZYREMOVEASSOC(movespeed_mod_immunities, slowdown_type, source)
|
||||
if(update)
|
||||
update_movespeed()
|
||||
|
||||
+11
-6
@@ -1033,17 +1033,22 @@ GLOBAL_VAR_INIT(exploit_warn_spam_prevention, 0)
|
||||
/// Updates the grab state of the mob and updates movespeed
|
||||
/mob/setGrabState(newstate)
|
||||
. = ..()
|
||||
if(grab_state == GRAB_PASSIVE)
|
||||
remove_movespeed_modifier(MOVESPEED_ID_MOB_GRAB_STATE, update=TRUE)
|
||||
else
|
||||
add_movespeed_modifier(MOVESPEED_ID_MOB_GRAB_STATE, update=TRUE, priority=100, override=TRUE, multiplicative_slowdown=grab_state*3, blacklisted_movetypes=FLOATING)
|
||||
switch(grab_state)
|
||||
if(GRAB_PASSIVE)
|
||||
remove_movespeed_modifier(MOVESPEED_ID_MOB_GRAB_STATE)
|
||||
if(GRAB_AGGRESSIVE)
|
||||
add_movespeed_modifier(/datum/movespeed_modifier/grab_slowdown/aggressive)
|
||||
if(GRAB_NECK)
|
||||
add_movespeed_modifier(/datum/movespeed_modifier/grab_slowdown/neck)
|
||||
if(GRAB_KILL)
|
||||
add_movespeed_modifier(/datum/movespeed_modifier/grab_slowdown/kill)
|
||||
|
||||
/mob/proc/update_equipment_speed_mods()
|
||||
var/speedies = equipped_speed_mods()
|
||||
if(!speedies)
|
||||
remove_movespeed_modifier(MOVESPEED_ID_MOB_EQUIPMENT, update=TRUE)
|
||||
remove_movespeed_modifier(/datum/movespeed_modifier/equipment_speedmod, update=TRUE)
|
||||
else
|
||||
add_movespeed_modifier(MOVESPEED_ID_MOB_EQUIPMENT, update=TRUE, priority=100, override=TRUE, multiplicative_slowdown=speedies, blacklisted_movetypes=FLOATING)
|
||||
add_or_update_variable_movespeed_modifier(/datum/movespeed_modifier/equipment_speedmod, multiplicative_slowdown = speedies)
|
||||
|
||||
/// Gets the combined speed modification of all worn items
|
||||
/// Except base mob type doesnt really wear items
|
||||
|
||||
@@ -42,8 +42,11 @@
|
||||
var/lying_prev = 0
|
||||
var/is_shifted = FALSE
|
||||
|
||||
//MOVEMENT SPEED
|
||||
/// List of movement speed modifiers applying to this mob
|
||||
var/list/movespeed_modification //Lazy list, see mob_movespeed.dm
|
||||
/// List of movement speed modifiers ignored by this mob. List -> List (id) -> List (sources)
|
||||
var/list/movespeed_mod_immunities //Lazy list, see mob_movespeed.dm
|
||||
/// The calculated mob speed slowdown based on the modifiers list
|
||||
var/cached_multiplicative_slowdown
|
||||
/////////////////
|
||||
|
||||
|
||||
@@ -251,9 +251,9 @@
|
||||
/mob/proc/update_gravity(has_gravity, override=FALSE)
|
||||
var/speed_change = max(0, has_gravity - STANDARD_GRAVITY)
|
||||
if(!speed_change)
|
||||
remove_movespeed_modifier(MOVESPEED_ID_MOB_GRAVITY, update=TRUE)
|
||||
remove_movespeed_modifier(/datum/movespeed_modifier/gravity)
|
||||
else
|
||||
add_movespeed_modifier(MOVESPEED_ID_MOB_GRAVITY, update=TRUE, priority=100, override=TRUE, multiplicative_slowdown=speed_change, blacklisted_movetypes=FLOATING)
|
||||
add_or_update_variable_movespeed_modifier(/datum/movespeed_modifier/gravity, multiplicative_slowdown = speed_change)
|
||||
|
||||
//bodypart selection - Cyberboss
|
||||
//8 toggles through head - eyes - mouth
|
||||
|
||||
@@ -1,126 +0,0 @@
|
||||
|
||||
/*Current movespeed modification list format: list(id = list(
|
||||
priority,
|
||||
flags,
|
||||
legacy slowdown/speedup amount,
|
||||
movetype_flags,
|
||||
blacklisted_movetypes,
|
||||
conflict
|
||||
))
|
||||
*/
|
||||
|
||||
//ANY ADD/REMOVE DONE IN UPDATE_MOVESPEED MUST HAVE THE UPDATE ARGUMENT SET AS FALSE!
|
||||
/mob/proc/add_movespeed_modifier(id, update=TRUE, priority=0, flags=NONE, override=FALSE, multiplicative_slowdown=0, movetypes=ALL, blacklisted_movetypes=NONE, conflict=FALSE)
|
||||
var/list/temp = list(priority, flags, multiplicative_slowdown, movetypes, blacklisted_movetypes, conflict) //build the modification list
|
||||
var/resort = TRUE
|
||||
if(LAZYACCESS(movespeed_modification, id))
|
||||
var/list/existing_data = movespeed_modification[id]
|
||||
if(movespeed_modifier_identical_check(existing_data, temp))
|
||||
return FALSE
|
||||
if(!override)
|
||||
return FALSE
|
||||
if(priority == existing_data[MOVESPEED_DATA_INDEX_PRIORITY])
|
||||
resort = FALSE // We don't need to re-sort if we're replacing something already there and it's the same priority
|
||||
LAZYSET(movespeed_modification, id, temp)
|
||||
if(update)
|
||||
update_movespeed(resort)
|
||||
return TRUE
|
||||
|
||||
/mob/proc/remove_movespeed_modifier(id, update = TRUE)
|
||||
if(!LAZYACCESS(movespeed_modification, id))
|
||||
return FALSE
|
||||
LAZYREMOVE(movespeed_modification, id)
|
||||
UNSETEMPTY(movespeed_modification)
|
||||
if(update)
|
||||
update_movespeed(FALSE)
|
||||
return TRUE
|
||||
|
||||
/mob/vv_edit_var(var_name, var_value)
|
||||
var/slowdown_edit = (var_name == NAMEOF(src, cached_multiplicative_slowdown))
|
||||
var/diff
|
||||
if(slowdown_edit && isnum(cached_multiplicative_slowdown) && isnum(var_value))
|
||||
remove_movespeed_modifier(MOVESPEED_ID_ADMIN_VAREDIT)
|
||||
diff = var_value - cached_multiplicative_slowdown
|
||||
. = ..()
|
||||
if(. && slowdown_edit && isnum(diff))
|
||||
add_movespeed_modifier(MOVESPEED_ID_ADMIN_VAREDIT, TRUE, 100, override = TRUE, multiplicative_slowdown = diff)
|
||||
|
||||
/mob/proc/has_movespeed_modifier(id)
|
||||
return LAZYACCESS(movespeed_modification, id)
|
||||
|
||||
/mob/proc/update_config_movespeed()
|
||||
add_movespeed_modifier(MOVESPEED_ID_CONFIG_SPEEDMOD, FALSE, 100, override = TRUE, multiplicative_slowdown = get_config_multiplicative_speed())
|
||||
|
||||
/mob/proc/get_config_multiplicative_speed()
|
||||
if(!islist(GLOB.mob_config_movespeed_type_lookup) || !GLOB.mob_config_movespeed_type_lookup[type])
|
||||
return 0
|
||||
else
|
||||
return GLOB.mob_config_movespeed_type_lookup[type]
|
||||
|
||||
/mob/proc/update_movespeed(resort = TRUE)
|
||||
if(resort)
|
||||
sort_movespeed_modlist()
|
||||
. = 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
|
||||
continue
|
||||
if(data[MOVESPEED_DATA_INDEX_BL_MOVETYPE] & 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]
|
||||
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
|
||||
if(abs(conflict_tracker[conflict]) < abs(amt))
|
||||
conflict_tracker[conflict] = amt
|
||||
else
|
||||
continue
|
||||
. += amt
|
||||
cached_multiplicative_slowdown = .
|
||||
|
||||
/mob/proc/get_movespeed_modifiers()
|
||||
return movespeed_modification
|
||||
|
||||
/mob/proc/movespeed_modifier_identical_check(list/mod1, list/mod2)
|
||||
if(!islist(mod1) || !islist(mod2) || mod1.len < MOVESPEED_DATA_INDEX_MAX || mod2.len < MOVESPEED_DATA_INDEX_MAX)
|
||||
return FALSE
|
||||
for(var/i in 1 to MOVESPEED_DATA_INDEX_MAX)
|
||||
if(mod1[i] != mod2[i])
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/mob/proc/total_multiplicative_slowdown()
|
||||
. = 0
|
||||
for(var/id in get_movespeed_modifiers())
|
||||
var/list/data = movespeed_modification[id]
|
||||
. += data[MOVESPEED_DATA_INDEX_MULTIPLICATIVE_SLOWDOWN]
|
||||
|
||||
/proc/movespeed_data_null_check(list/data) //Determines if a data list is not meaningful and should be discarded.
|
||||
. = TRUE
|
||||
if(data[MOVESPEED_DATA_INDEX_MULTIPLICATIVE_SLOWDOWN])
|
||||
. = FALSE
|
||||
|
||||
/mob/proc/sort_movespeed_modlist() //Verifies it too. Sorts highest priority (first applied) to lowest priority (last applied)
|
||||
if(!movespeed_modification)
|
||||
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))
|
||||
movespeed_modification -= our_id
|
||||
continue
|
||||
var/our_priority = our_data[MOVESPEED_DATA_INDEX_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)
|
||||
assembled.Insert(assembled.Find(their_id), our_id)
|
||||
assembled[our_id] = our_data
|
||||
resolved = TRUE
|
||||
break
|
||||
if(!resolved)
|
||||
assembled[our_id] = our_data
|
||||
movespeed_modification = assembled
|
||||
UNSETEMPTY(movespeed_modification)
|
||||
@@ -0,0 +1,217 @@
|
||||
/*! Movespeed modification datums.
|
||||
|
||||
How move speed for mobs works
|
||||
|
||||
Move speed is now calculated by using modifier datums which are added to mobs. Some of them (nonvariable ones) are globally cached, the variable ones are instanced and changed based on need.
|
||||
|
||||
This gives us the ability to have multiple sources of movespeed, reliabily keep them applied and remove them when they should be
|
||||
|
||||
THey can have unique sources and a bunch of extra fancy flags that control behaviour
|
||||
|
||||
Previously trying to update move speed was a shot in the dark that usually meant mobs got stuck going faster or slower
|
||||
|
||||
Movespeed modification list is a simple key = datum system. Key will be the datum's ID if it is overridden to not be null, or type if it is not.
|
||||
|
||||
DO NOT override datum IDs unless you are going to have multiple types that must overwrite each other. It's more efficient to use types, ID functionality is only kept for cases where dynamic creation of modifiers need to be done.
|
||||
|
||||
When update movespeed is called, the list of items is iterated, according to flags priority and a bunch of conditions
|
||||
this spits out a final calculated value which is used as a modifer to last_move + modifier for calculating when a mob
|
||||
can next move
|
||||
|
||||
Key procs
|
||||
* [add_movespeed_modifier](mob.html#proc/add_movespeed_modifier)
|
||||
* [remove_movespeed_modifier](mob.html#proc/remove_movespeed_modifier)
|
||||
* [has_movespeed_modifier](mob.html#proc/has_movespeed_modifier)
|
||||
* [update_movespeed](mob.html#proc/update_movespeed)
|
||||
*/
|
||||
|
||||
/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. By default, this SHOULD NOT be set. Only set it for cases where you're dynamically making modifiers/need to have two types overwrite each other. If unset, uses path (converted to text) as ID.
|
||||
var/id
|
||||
|
||||
/// Higher ones override lower priorities. This is NOT used for ID, ID must be unique, if it isn't unique the newer one overwrites automatically if overriding.
|
||||
var/priority = 0
|
||||
var/flags = NONE
|
||||
|
||||
/// Multiplicative slowdown
|
||||
var/multiplicative_slowdown = 0
|
||||
|
||||
/// Movetypes this applies to
|
||||
var/movetypes = ALL
|
||||
|
||||
/// Movetypes this never applies to
|
||||
var/blacklisted_movetypes = NONE
|
||||
|
||||
/// Other modification datums this conflicts with.
|
||||
var/conflicts_with
|
||||
|
||||
/datum/movespeed_modifier/New()
|
||||
. = ..()
|
||||
if(!id)
|
||||
id = "[type]" //We turn the path into a string.
|
||||
|
||||
GLOBAL_LIST_EMPTY(movespeed_modification_cache)
|
||||
|
||||
/// Grabs a STATIC MODIFIER datum from cache. YOU MUST NEVER EDIT THESE DATUMS, OR IT WILL AFFECT ANYTHING ELSE USING IT TOO!
|
||||
/proc/get_cached_movespeed_modifier(modtype)
|
||||
if(!ispath(modtype, /datum/movespeed_modifier))
|
||||
CRASH("[modtype] is not a movespeed modification typepath.")
|
||||
var/datum/movespeed_modifier/M = modtype
|
||||
if(initial(M.variable))
|
||||
CRASH("[modtype] is a variable modifier, and can never be cached.")
|
||||
M = GLOB.movespeed_modification_cache[modtype]
|
||||
if(!M)
|
||||
M = GLOB.movespeed_modification_cache[modtype] = new modtype
|
||||
return M
|
||||
|
||||
///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. If ID conflicts, it will overwrite the old ID.
|
||||
/mob/proc/add_movespeed_modifier(datum/movespeed_modifier/type_or_datum, update = TRUE)
|
||||
if(ispath(type_or_datum))
|
||||
if(!initial(type_or_datum.variable))
|
||||
type_or_datum = get_cached_movespeed_modifier(type_or_datum)
|
||||
else
|
||||
type_or_datum = new type_or_datum
|
||||
var/datum/movespeed_modifier/existing = LAZYACCESS(movespeed_modification, type_or_datum.id)
|
||||
if(existing)
|
||||
if(existing == type_or_datum) //same thing don't need to touch
|
||||
return TRUE
|
||||
remove_movespeed_modifier(existing, FALSE)
|
||||
if(length(movespeed_modification))
|
||||
BINARY_INSERT(type_or_datum.id, movespeed_modification, datum/movespeed_modifier, type_or_datum, priority, COMPARE_VALUE)
|
||||
LAZYSET(movespeed_modification, type_or_datum.id, type_or_datum)
|
||||
if(update)
|
||||
update_movespeed()
|
||||
return TRUE
|
||||
|
||||
/// Remove a move speed modifier from a mob, whether static or variable.
|
||||
/mob/proc/remove_movespeed_modifier(datum/movespeed_modifier/type_id_datum, update = TRUE)
|
||||
var/key
|
||||
if(ispath(type_id_datum))
|
||||
key = initial(type_id_datum.id) || "[type_id_datum]" //id if set, path set to string if not.
|
||||
else if(!istext(type_id_datum)) //if it isn't text it has to be a datum, as it isn't a type.
|
||||
key = type_id_datum.id
|
||||
else //assume it's an id
|
||||
key = type_id_datum
|
||||
if(!LAZYACCESS(movespeed_modification, key))
|
||||
return FALSE
|
||||
LAZYREMOVE(movespeed_modification, key)
|
||||
if(update)
|
||||
update_movespeed(FALSE)
|
||||
return TRUE
|
||||
|
||||
/*! Used for variable slowdowns like hunger/health loss/etc, works somewhat like the old list-based modification adds. Returns the modifier datum if successful
|
||||
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.
|
||||
2. Instantiate a new datum if type_id_datum isn't already instantiated + in the list, using the type. Obviously, wouldn't work for ID only.
|
||||
3. Add the datum if necessary using the regular add proc
|
||||
4. If any of the rest of the args are not null (see: multiplicative slowdown), modify the datum
|
||||
5. Update if necessary
|
||||
*/
|
||||
/mob/proc/add_or_update_variable_movespeed_modifier(datum/movespeed_modifier/type_id_datum, update = TRUE, multiplicative_slowdown)
|
||||
var/modified = FALSE
|
||||
var/inject = FALSE
|
||||
var/datum/movespeed_modifier/final
|
||||
if(istext(type_id_datum))
|
||||
final = LAZYACCESS(movespeed_modification, type_id_datum)
|
||||
if(!final)
|
||||
CRASH("Couldn't find existing modification when provided a text ID.")
|
||||
else if(ispath(type_id_datum))
|
||||
if(!initial(type_id_datum.variable))
|
||||
CRASH("Not a variable modifier")
|
||||
final = LAZYACCESS(movespeed_modification, initial(type_id_datum.id) || "[type_id_datum]")
|
||||
if(!final)
|
||||
final = new type_id_datum
|
||||
inject = TRUE
|
||||
modified = TRUE
|
||||
else
|
||||
if(!initial(type_id_datum.variable))
|
||||
CRASH("Not a variable modifier")
|
||||
final = type_id_datum
|
||||
if(!LAZYACCESS(movespeed_modification, final.id))
|
||||
inject = TRUE
|
||||
modified = TRUE
|
||||
if(!isnull(multiplicative_slowdown))
|
||||
final.multiplicative_slowdown = multiplicative_slowdown
|
||||
modified = TRUE
|
||||
if(inject)
|
||||
add_movespeed_modifier(final, FALSE)
|
||||
if(update && modified)
|
||||
update_movespeed(TRUE)
|
||||
return final
|
||||
|
||||
/// Handles the special case of editing the movement var
|
||||
/mob/vv_edit_var(var_name, var_value)
|
||||
var/slowdown_edit = (var_name == NAMEOF(src, cached_multiplicative_slowdown))
|
||||
var/diff
|
||||
if(slowdown_edit && isnum(cached_multiplicative_slowdown) && isnum(var_value))
|
||||
remove_movespeed_modifier(/datum/movespeed_modifier/admin_varedit)
|
||||
diff = var_value - cached_multiplicative_slowdown
|
||||
. = ..()
|
||||
if(. && slowdown_edit && isnum(diff))
|
||||
add_or_update_variable_movespeed_modifier(/datum/movespeed_modifier/admin_varedit, multiplicative_slowdown = diff)
|
||||
|
||||
///Is there a movespeed modifier for this mob
|
||||
/mob/proc/has_movespeed_modifier(datum/movespeed_modifier/datum_type_id)
|
||||
var/key
|
||||
if(ispath(datum_type_id))
|
||||
key = initial(datum_type_id.id) || "[datum_type_id]"
|
||||
else if(istext(datum_type_id))
|
||||
key = datum_type_id
|
||||
else
|
||||
key = datum_type_id.id
|
||||
return LAZYACCESS(movespeed_modification, key)
|
||||
|
||||
/// Set or update the global movespeed config on a mob
|
||||
/mob/proc/update_config_movespeed()
|
||||
add_or_update_variable_movespeed_modifier(/datum/movespeed_modifier/mob_config_speedmod, multiplicative_slowdown = get_config_multiplicative_speed())
|
||||
|
||||
/// Get the global config movespeed of a mob by type
|
||||
/mob/proc/get_config_multiplicative_speed()
|
||||
if(!islist(GLOB.mob_config_movespeed_type_lookup) || !GLOB.mob_config_movespeed_type_lookup[type])
|
||||
return 0
|
||||
else
|
||||
return GLOB.mob_config_movespeed_type_lookup[type]
|
||||
|
||||
/// Go through the list of movespeed modifiers and calculate a final movespeed. ANY ADD/REMOVE DONE IN UPDATE_MOVESPEED MUST HAVE THE UPDATE ARGUMENT SET AS FALSE!
|
||||
/mob/proc/update_movespeed()
|
||||
. = 0
|
||||
var/list/conflict_tracker = list()
|
||||
for(var/key in get_movespeed_modifiers())
|
||||
var/datum/movespeed_modifier/M = movespeed_modification[key]
|
||||
if(!(M.movetypes & movement_type)) // We don't affect any of these move types, skip
|
||||
continue
|
||||
if(M.blacklisted_movetypes & movement_type) // There's a movetype here that disables this modifier, skip
|
||||
continue
|
||||
var/conflict = M.conflicts_with
|
||||
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
|
||||
if(abs(conflict_tracker[conflict]) < abs(amt))
|
||||
conflict_tracker[conflict] = amt
|
||||
else
|
||||
continue
|
||||
. += amt
|
||||
cached_multiplicative_slowdown = .
|
||||
|
||||
/// Get the move speed modifiers list of the mob
|
||||
/mob/proc/get_movespeed_modifiers()
|
||||
. = LAZYCOPY(movespeed_modification)
|
||||
for(var/id in movespeed_mod_immunities)
|
||||
. -= id
|
||||
|
||||
/// Calculate the total slowdown of all movespeed modifiers
|
||||
/mob/proc/total_multiplicative_slowdown()
|
||||
. = 0
|
||||
for(var/id in get_movespeed_modifiers())
|
||||
var/datum/movespeed_modifier/M = movespeed_modification[id]
|
||||
. += 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.
|
||||
. = TRUE
|
||||
if(M.multiplicative_slowdown)
|
||||
. = FALSE
|
||||
@@ -0,0 +1,21 @@
|
||||
/datum/movespeed_modifier/shrink_ray
|
||||
movetypes = GROUND
|
||||
multiplicative_slowdown = 4
|
||||
flags = IGNORE_NOSLOW
|
||||
|
||||
/datum/movespeed_modifier/snail_crawl
|
||||
multiplicative_slowdown = -7
|
||||
movetypes = GROUND
|
||||
|
||||
/datum/movespeed_modifier/sanity
|
||||
id = MOVESPEED_ID_SANITY
|
||||
blacklisted_movetypes = FLYING
|
||||
|
||||
/datum/movespeed_modifier/sanity/insane
|
||||
multiplicative_slowdown = 1.5
|
||||
|
||||
/datum/movespeed_modifier/sanity/crazy
|
||||
multiplicative_slowdown = 1
|
||||
|
||||
/datum/movespeed_modifier/sanity/disturbed
|
||||
multiplicative_slowdown = 0.5
|
||||
@@ -0,0 +1,20 @@
|
||||
/datum/movespeed_modifier/strained_muscles
|
||||
multiplicative_slowdown = -1
|
||||
blacklisted_movetypes = (FLYING|FLOATING)
|
||||
|
||||
/datum/movespeed_modifier/pai_spacewalk
|
||||
multiplicative_slowdown = 2
|
||||
flags = IGNORE_NOSLOW
|
||||
|
||||
/datum/movespeed_modifier/species
|
||||
movetypes = ~FLYING
|
||||
variable = TRUE
|
||||
|
||||
/datum/movespeed_modifier/dna_vault_speedup
|
||||
blacklisted_movetypes = (FLYING|FLOATING)
|
||||
multiplicative_slowdown = -1
|
||||
|
||||
/datum/movespeed_modifier/small_stride
|
||||
blacklisted_movetypes = (FLOATING|CRAWLING)
|
||||
variable = TRUE
|
||||
flags = IGNORE_NOSLOW
|
||||
@@ -0,0 +1,12 @@
|
||||
/datum/movespeed_modifier/jetpack
|
||||
conflicts_with = MOVE_CONFLICT_JETPACK
|
||||
movetypes = FLOATING
|
||||
|
||||
/datum/movespeed_modifier/jetpack/cybernetic
|
||||
multiplicative_slowdown = -0.5
|
||||
|
||||
/datum/movespeed_modifier/jetpack/fullspeed
|
||||
multiplicative_slowdown = -2
|
||||
|
||||
/datum/movespeed_modifier/die_of_fate
|
||||
multiplicative_slowdown = 1
|
||||
@@ -0,0 +1,6 @@
|
||||
/datum/movespeed_modifier/admin_varedit
|
||||
variable = TRUE
|
||||
|
||||
/datum/movespeed_modifier/yellow_orb
|
||||
multiplicative_slowdown = -2
|
||||
blacklisted_movetypes = (FLYING|FLOATING)
|
||||
@@ -0,0 +1,120 @@
|
||||
/datum/movespeed_modifier/obesity
|
||||
multiplicative_slowdown = 1.5
|
||||
|
||||
/datum/movespeed_modifier/monkey_reagent_speedmod
|
||||
blacklisted_movetypes = FLOATING
|
||||
variable = TRUE
|
||||
|
||||
/datum/movespeed_modifier/monkey_health_speedmod
|
||||
blacklisted_movetypes = FLOATING
|
||||
variable = TRUE
|
||||
|
||||
/datum/movespeed_modifier/monkey_temperature_speedmod
|
||||
blacklisted_movetypes = FLOATING
|
||||
variable = TRUE
|
||||
|
||||
/datum/movespeed_modifier/hunger
|
||||
variable = TRUE
|
||||
|
||||
/datum/movespeed_modifier/slaughter
|
||||
multiplicative_slowdown = -1
|
||||
|
||||
/datum/movespeed_modifier/damage_slowdown
|
||||
blacklisted_movetypes = FLOATING|FLYING
|
||||
variable = TRUE
|
||||
|
||||
/datum/movespeed_modifier/damage_slowdown_flying
|
||||
movetypes = FLOATING
|
||||
variable = TRUE
|
||||
|
||||
/datum/movespeed_modifier/equipment_speedmod
|
||||
variable = TRUE
|
||||
blacklisted_movetypes = FLOATING
|
||||
|
||||
/datum/movespeed_modifier/grab_slowdown
|
||||
id = MOVESPEED_ID_MOB_GRAB_STATE
|
||||
blacklisted_movetypes = FLOATING
|
||||
|
||||
/datum/movespeed_modifier/grab_slowdown/aggressive
|
||||
multiplicative_slowdown = 3
|
||||
|
||||
/datum/movespeed_modifier/grab_slowdown/neck
|
||||
multiplicative_slowdown = 6
|
||||
|
||||
/datum/movespeed_modifier/grab_slowdown/kill
|
||||
multiplicative_slowdown = 9
|
||||
|
||||
/datum/movespeed_modifier/slime_reagentmod
|
||||
variable = TRUE
|
||||
|
||||
/datum/movespeed_modifier/slime_healthmod
|
||||
variable = TRUE
|
||||
|
||||
/datum/movespeed_modifier/config_walk_run
|
||||
multiplicative_slowdown = 1
|
||||
id = MOVESPEED_ID_MOB_WALK_RUN
|
||||
flags = IGNORE_NOSLOW
|
||||
|
||||
/datum/movespeed_modifier/config_walk_run/proc/sync()
|
||||
|
||||
/datum/movespeed_modifier/config_walk_run/walk/sync()
|
||||
var/mod = CONFIG_GET(number/movedelay/walk_delay)
|
||||
multiplicative_slowdown = isnum(mod)? mod : initial(multiplicative_slowdown)
|
||||
|
||||
/datum/movespeed_modifier/config_walk_run/run/sync()
|
||||
var/mod = CONFIG_GET(number/movedelay/run_delay)
|
||||
multiplicative_slowdown = isnum(mod)? mod : initial(multiplicative_slowdown)
|
||||
|
||||
/datum/movespeed_modifier/turf_slowdown
|
||||
movetypes = GROUND
|
||||
blacklisted_movetypes = (FLYING|FLOATING)
|
||||
variable = TRUE
|
||||
|
||||
/datum/movespeed_modifier/bulky_drag
|
||||
variable = TRUE
|
||||
|
||||
/datum/movespeed_modifier/cold
|
||||
blacklisted_movetypes = FLOATING
|
||||
variable = TRUE
|
||||
|
||||
/datum/movespeed_modifier/shove
|
||||
multiplicative_slowdown = SHOVE_SLOWDOWN_STRENGTH
|
||||
|
||||
/datum/movespeed_modifier/human_carry
|
||||
variable = TRUE
|
||||
|
||||
/datum/movespeed_modifier/limbless
|
||||
variable = TRUE
|
||||
movetypes = GROUND
|
||||
flags = IGNORE_NOSLOW
|
||||
|
||||
/datum/movespeed_modifier/simplemob_varspeed
|
||||
variable = TRUE
|
||||
flags = IGNORE_NOSLOW
|
||||
|
||||
/datum/movespeed_modifier/tarantula_web
|
||||
multiplicative_slowdown = 3
|
||||
|
||||
/datum/movespeed_modifier/gravity
|
||||
blacklisted_movetypes = FLOATING
|
||||
variable = TRUE
|
||||
flags = IGNORE_NOSLOW
|
||||
|
||||
/datum/movespeed_modifier/carbon_softcrit
|
||||
multiplicative_slowdown = SOFTCRIT_ADD_SLOWDOWN
|
||||
|
||||
/datum/movespeed_modifier/slime_tempmod
|
||||
variable = TRUE
|
||||
|
||||
/datum/movespeed_modifier/carbon_crawling
|
||||
multiplicative_slowdown = CRAWLING_ADD_SLOWDOWN
|
||||
movetypes = CRAWLING
|
||||
flags = IGNORE_NOSLOW
|
||||
|
||||
/datum/movespeed_modifier/mob_config_speedmod
|
||||
variable = TRUE
|
||||
flags = IGNORE_NOSLOW
|
||||
|
||||
/datum/movespeed_modifier/liver_cirrhosis
|
||||
blacklisted_movetypes = FLOATING
|
||||
variable = TRUE
|
||||
@@ -0,0 +1,14 @@
|
||||
/datum/movespeed_modifier/reagent
|
||||
blacklisted_movetypes = (FLYING|FLOATING)
|
||||
|
||||
/datum/movespeed_modifier/reagent/stimulants
|
||||
multiplicative_slowdown = -0.5
|
||||
|
||||
/datum/movespeed_modifier/reagent/changelinghaste
|
||||
multiplicative_slowdown = -2
|
||||
|
||||
/datum/movespeed_modifier/reagent/skooma
|
||||
multiplicative_slowdown = -1
|
||||
|
||||
/datum/movespeed_modifier/reagent/nitryl
|
||||
multiplicative_slowdown = -1
|
||||
@@ -0,0 +1,44 @@
|
||||
/datum/movespeed_modifier/status_effect/bloodchill
|
||||
multiplicative_slowdown = 3
|
||||
|
||||
/datum/movespeed_modifier/status_effect/bonechill
|
||||
multiplicative_slowdown = 3
|
||||
|
||||
/datum/movespeed_modifier/status_effect/tarfoot
|
||||
multiplicative_slowdown = 0.5
|
||||
blacklisted_movetypes = (FLYING|FLOATING)
|
||||
|
||||
/datum/movespeed_modifier/status_effect/sepia
|
||||
variable = TRUE
|
||||
blacklisted_movetypes = (FLYING|FLOATING)
|
||||
|
||||
/datum/movespeed_modifier/status_effect/mesmerize
|
||||
blacklisted_movetypes = CRAWLING
|
||||
multiplicative_slowdown = 5
|
||||
priority = 64
|
||||
|
||||
/datum/movespeed_modifier/status_effect/tased
|
||||
multiplicative_slowdown = 1.5
|
||||
priority = 50
|
||||
|
||||
/datum/movespeed_modifier/status_effect/tased/no_combat_mode
|
||||
multiplicative_slowdown = 8
|
||||
priority = 100
|
||||
|
||||
/datum/movespeed_modifier/status_effect/electrostaff
|
||||
multiplicative_slowdown = 1
|
||||
movetypes = GROUND
|
||||
|
||||
//no comment.
|
||||
/datum/movespeed_modifier/status_effect/breast_hypertrophy
|
||||
blacklisted_movetypes = FLOATING
|
||||
variable = TRUE
|
||||
|
||||
//this shouldn't even exist.
|
||||
/datum/movespeed_modifier/status_effect/penis_hypertrophy
|
||||
blacklisted_movetypes = FLOATING
|
||||
variable = TRUE
|
||||
|
||||
/datum/movespeed_modifier/status_effect/mkultra
|
||||
multiplicative_slowdown = -2
|
||||
blacklisted_movetypes= FLYING|FLOATING
|
||||
@@ -460,7 +460,7 @@
|
||||
|
||||
/datum/reagent/drug/skooma/on_mob_metabolize(mob/living/L)
|
||||
. = ..()
|
||||
L.add_movespeed_modifier(type, update=TRUE, priority=100, multiplicative_slowdown=-1, blacklisted_movetypes=(FLYING|FLOATING))
|
||||
L.add_movespeed_modifier(/datum/movespeed_modifier/reagent/skooma)
|
||||
L.next_move_modifier *= 2
|
||||
if(ishuman(L))
|
||||
var/mob/living/carbon/human/H = L
|
||||
@@ -473,7 +473,7 @@
|
||||
|
||||
/datum/reagent/drug/skooma/on_mob_end_metabolize(mob/living/L)
|
||||
. = ..()
|
||||
L.remove_movespeed_modifier(type)
|
||||
L.remove_movespeed_modifier(/datum/movespeed_modifier/reagent/skooma)
|
||||
L.next_move_modifier *= 0.5
|
||||
if(ishuman(L))
|
||||
var/mob/living/carbon/human/H = L
|
||||
|
||||
@@ -708,10 +708,10 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M)
|
||||
|
||||
/datum/reagent/medicine/morphine/on_mob_metabolize(mob/living/L)
|
||||
..()
|
||||
L.ignore_slowdown(type)
|
||||
L.add_movespeed_mod_immunities(type, list(/datum/movespeed_modifier/damage_slowdown, /datum/movespeed_modifier/damage_slowdown_flying, /datum/movespeed_modifier/monkey_health_speedmod))
|
||||
|
||||
/datum/reagent/medicine/morphine/on_mob_end_metabolize(mob/living/L)
|
||||
L.unignore_slowdown(type)
|
||||
L.remove_movespeed_mod_immunities(type, list(/datum/movespeed_modifier/damage_slowdown, /datum/movespeed_modifier/damage_slowdown_flying, /datum/movespeed_modifier/monkey_health_speedmod))
|
||||
..()
|
||||
|
||||
/datum/reagent/medicine/morphine/on_mob_life(mob/living/carbon/M)
|
||||
@@ -993,11 +993,11 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M)
|
||||
|
||||
/datum/reagent/medicine/stimulants/on_mob_metabolize(mob/living/L)
|
||||
..()
|
||||
L.add_movespeed_modifier(type, update=TRUE, priority=100, multiplicative_slowdown=-0.5, blacklisted_movetypes=(FLYING|FLOATING))
|
||||
L.add_movespeed_modifier(/datum/movespeed_modifier/reagent/stimulants)
|
||||
ADD_TRAIT(L, TRAIT_TASED_RESISTANCE, type)
|
||||
|
||||
/datum/reagent/medicine/stimulants/on_mob_end_metabolize(mob/living/L)
|
||||
L.remove_movespeed_modifier(type)
|
||||
L.remove_movespeed_modifier(/datum/movespeed_modifier/reagent/stimulants)
|
||||
REMOVE_TRAIT(L, TRAIT_TASED_RESISTANCE, type)
|
||||
..()
|
||||
|
||||
@@ -1332,10 +1332,10 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M)
|
||||
|
||||
/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.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.remove_movespeed_modifier(/datum/movespeed_modifier/reagent/changelinghaste)
|
||||
..()
|
||||
|
||||
/datum/reagent/medicine/changelinghaste/on_mob_life(mob/living/carbon/M)
|
||||
@@ -1368,11 +1368,11 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M)
|
||||
|
||||
/datum/reagent/medicine/muscle_stimulant/on_mob_metabolize(mob/living/M)
|
||||
. = ..()
|
||||
M.ignore_slowdown(type)
|
||||
M.add_movespeed_mod_immunities(type, list(/datum/movespeed_modifier/damage_slowdown, /datum/movespeed_modifier/damage_slowdown_flying, /datum/movespeed_modifier/monkey_health_speedmod))
|
||||
|
||||
/datum/reagent/medicine/muscle_stimulant/on_mob_end_metabolize(mob/living/M)
|
||||
. = ..()
|
||||
M.unignore_slowdown(type)
|
||||
M.remove_movespeed_mod_immunities(type, list(/datum/movespeed_modifier/damage_slowdown, /datum/movespeed_modifier/damage_slowdown_flying, /datum/movespeed_modifier/monkey_health_speedmod))
|
||||
|
||||
/datum/reagent/medicine/modafinil
|
||||
name = "Modafinil"
|
||||
|
||||
@@ -1445,10 +1445,10 @@
|
||||
|
||||
/datum/reagent/nitryl/on_mob_metabolize(mob/living/L)
|
||||
..()
|
||||
L.add_movespeed_modifier(type, update=TRUE, priority=100, multiplicative_slowdown=-1, blacklisted_movetypes=(FLYING|FLOATING))
|
||||
L.add_movespeed_modifier(/datum/movespeed_modifier/reagent/nitryl)
|
||||
|
||||
/datum/reagent/nitryl/on_mob_end_metabolize(mob/living/L)
|
||||
L.remove_movespeed_modifier(type)
|
||||
L.remove_movespeed_modifier(/datum/movespeed_modifier/reagent/nitryl)
|
||||
..()
|
||||
|
||||
/////////////////////////Coloured Crayon Powder////////////////////////////
|
||||
|
||||
@@ -191,7 +191,7 @@
|
||||
alert_type = /obj/screen/alert/status_effect/bloodchill
|
||||
|
||||
/datum/status_effect/bloodchill/on_apply()
|
||||
owner.add_movespeed_modifier("bloodchilled", TRUE, 100, NONE, override = TRUE, multiplicative_slowdown = 3)
|
||||
owner.add_movespeed_modifier(/datum/movespeed_modifier/status_effect/bloodchill)
|
||||
return ..()
|
||||
|
||||
/datum/status_effect/bloodchill/tick()
|
||||
@@ -199,7 +199,7 @@
|
||||
owner.adjustFireLoss(2)
|
||||
|
||||
/datum/status_effect/bloodchill/on_remove()
|
||||
owner.remove_movespeed_modifier("bloodchilled")
|
||||
owner.remove_movespeed_modifier(/datum/movespeed_modifier/status_effect/bloodchill)
|
||||
return ..()
|
||||
|
||||
/obj/screen/alert/status_effect/bloodchill
|
||||
@@ -213,7 +213,7 @@
|
||||
alert_type = /obj/screen/alert/status_effect/bonechill
|
||||
|
||||
/datum/status_effect/bonechill/on_apply()
|
||||
owner.add_movespeed_modifier("bonechilled", TRUE, 100, NONE, override = TRUE, multiplicative_slowdown = 3)
|
||||
owner.add_movespeed_modifier(/datum/movespeed_modifier/status_effect/bonechill)
|
||||
return ..()
|
||||
|
||||
/datum/status_effect/bonechill/tick()
|
||||
@@ -223,7 +223,7 @@
|
||||
owner.adjust_bodytemperature(-10)
|
||||
|
||||
/datum/status_effect/bonechill/on_remove()
|
||||
owner.remove_movespeed_modifier("bonechilled")
|
||||
owner.remove_movespeed_modifier(/datum/movespeed_modifier/status_effect/bonechill)
|
||||
return ..()
|
||||
|
||||
/obj/screen/alert/status_effect/bonechill
|
||||
@@ -385,11 +385,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.add_movespeed_modifier(/datum/movespeed_modifier/status_effect/tarfoot)
|
||||
return ..()
|
||||
|
||||
/datum/status_effect/tarfoot/on_remove()
|
||||
owner.remove_movespeed_modifier(MOVESPEED_ID_TARFOOT)
|
||||
owner.remove_movespeed_modifier(/datum/movespeed_modifier/status_effect/tarfoot)
|
||||
return ..()
|
||||
|
||||
/datum/status_effect/spookcookie
|
||||
@@ -707,15 +707,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, update=TRUE, priority=100, multiplicative_slowdown=-1, blacklisted_movetypes=(FLYING|FLOATING))
|
||||
owner.add_or_update_variable_movespeed_modifier(/datum/movespeed_modifier/status_effect/sepia, multiplicative_slowdown = 1)
|
||||
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, 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.remove_movespeed_modifier(/datum/movespeed_modifier/status_effect/sepia)
|
||||
return ..()
|
||||
|
||||
/datum/status_effect/stabilized/cerulean
|
||||
@@ -777,11 +777,11 @@ datum/status_effect/stabilized/blue/on_remove()
|
||||
colour = "red"
|
||||
|
||||
/datum/status_effect/stabilized/red/on_apply()
|
||||
owner.ignore_slowdown("slimestatus")
|
||||
return ..()
|
||||
. = ..()
|
||||
owner.add_movespeed_mod_immunities(type, /datum/movespeed_modifier/equipment_speedmod)
|
||||
|
||||
/datum/status_effect/stabilized/red/on_remove()
|
||||
owner.unignore_slowdown("slimestatus")
|
||||
owner.remove_movespeed_mod_immunities(type, /datum/movespeed_modifier/equipment_speedmod)
|
||||
return ..()
|
||||
|
||||
/datum/status_effect/stabilized/green
|
||||
|
||||
@@ -276,7 +276,7 @@
|
||||
ADD_TRAIT(H, TRAIT_PIERCEIMMUNE, "dna_vault")
|
||||
if(VAULT_SPEED)
|
||||
to_chat(H, "<span class='notice'>Your legs feel faster.</span>")
|
||||
H.add_movespeed_modifier(MOVESPEED_ID_DNA_VAULT, update=TRUE, priority=100, multiplicative_slowdown=-1, blacklisted_movetypes=(FLYING|FLOATING))
|
||||
H.add_movespeed_modifier(/datum/movespeed_modifier/dna_vault_speedup)
|
||||
if(VAULT_QUICK)
|
||||
to_chat(H, "<span class='notice'>Your arms move as fast as lightning.</span>")
|
||||
H.next_move_modifier = 0.5
|
||||
|
||||
@@ -165,14 +165,14 @@
|
||||
if(allow_thrust(0.01))
|
||||
ion_trail.start()
|
||||
RegisterSignal(owner, COMSIG_MOVABLE_MOVED, .proc/move_react)
|
||||
owner.add_movespeed_modifier(MOVESPEED_ID_CYBER_THRUSTER, priority=100, multiplicative_slowdown=-2, movetypes=FLOATING, conflict=MOVE_CONFLICT_JETPACK)
|
||||
owner.add_movespeed_modifier(/datum/movespeed_modifier/jetpack/cybernetic)
|
||||
if(!silent)
|
||||
to_chat(owner, "<span class='notice'>You turn your thrusters set on.</span>")
|
||||
else
|
||||
ion_trail.stop()
|
||||
if(!QDELETED(owner))
|
||||
UnregisterSignal(owner, COMSIG_MOVABLE_MOVED)
|
||||
owner.remove_movespeed_modifier(MOVESPEED_ID_CYBER_THRUSTER)
|
||||
owner.remove_movespeed_modifier(/datum/movespeed_modifier/jetpack/cybernetic)
|
||||
if(!silent)
|
||||
to_chat(owner, "<span class='notice'>You turn your thrusters set off.</span>")
|
||||
on = FALSE
|
||||
|
||||
@@ -56,22 +56,22 @@
|
||||
return
|
||||
if(damage >= high_threshold)
|
||||
var/move_calc = 1+((round(damage) - high_threshold)/(high_threshold/3))
|
||||
owner.add_movespeed_modifier(MOVESPEED_ID_CIRRHOSIS, TRUE, 100, NONE, override = TRUE, multiplicative_slowdown = move_calc)
|
||||
owner.add_or_update_variable_movespeed_modifier(/datum/movespeed_modifier/liver_cirrhosis, multiplicative_slowdown = move_calc)
|
||||
sizeMoveMod(move_calc, owner)
|
||||
else
|
||||
owner.remove_movespeed_modifier(MOVESPEED_ID_CIRRHOSIS)
|
||||
owner.remove_movespeed_modifier(/datum/movespeed_modifier/liver_cirrhosis)
|
||||
sizeMoveMod(1, owner)
|
||||
|
||||
/obj/item/organ/liver/Insert(mob/living/carbon/M, special = FALSE, drop_if_replaced = TRUE)
|
||||
. = ..()
|
||||
if(. && damage >= high_threshold)
|
||||
var/move_calc = 1+((round(damage) - high_threshold)/(high_threshold/3))
|
||||
M.add_movespeed_modifier(MOVESPEED_ID_CIRRHOSIS, TRUE, 100, NONE, override = TRUE, multiplicative_slowdown = move_calc)
|
||||
M.add_or_update_variable_movespeed_modifier(/datum/movespeed_modifier/liver_cirrhosis, multiplicative_slowdown = move_calc)
|
||||
sizeMoveMod(move_calc, owner)
|
||||
|
||||
/obj/item/organ/liver/Remove(special = FALSE)
|
||||
if(!QDELETED(owner))
|
||||
owner.remove_movespeed_modifier(MOVESPEED_ID_CIRRHOSIS)
|
||||
owner.remove_movespeed_modifier(/datum/movespeed_modifier/liver_cirrhosis)
|
||||
sizeMoveMod(1, owner)
|
||||
return ..()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user