Merge pull request #9592 from Ghommie/Ghommie-cit262

Porting movespeed modification system updates.
This commit is contained in:
kevinz000
2019-10-29 21:27:53 -07:00
committed by GitHub
38 changed files with 193 additions and 200 deletions
+1 -2
View File
@@ -104,8 +104,7 @@
#define SHOVE_KNOCKDOWN_HUMAN 30
#define SHOVE_KNOCKDOWN_TABLE 30
#define SHOVE_KNOCKDOWN_COLLATERAL 10
//Shove slowdown
#define SHOVE_SLOWDOWN_ID "shove_slowdown"
//for the shove slowdown, see __DEFINES/movespeed_modification.dm
#define SHOVE_SLOWDOWN_LENGTH 30
#define SHOVE_SLOWDOWN_STRENGTH 0.85 //multiplier
//Shove disarming item list
+1 -2
View File
@@ -233,8 +233,7 @@
//Mood
#define COMSIG_ADD_MOOD_EVENT "add_mood" //Called when you send a mood event from anywhere in the code.
#define COMSIG_CLEAR_MOOD_EVENT "clear_mood" //Called when you clear a mood event from anywhere in the code.
#define COMSIG_INCREASE_SANITY "decrease_sanity" //Called when you want to increase sanity from anywhere in the code.
#define COMSIG_DECREASE_SANITY "increase_sanity" //Same as above but to decrease sanity instead.
#define COMSIG_MODIFY_SANITY "modify_sanity" //Called when you want to increase or decrease sanity from anywhere in the code.
//NTnet
#define COMSIG_COMPONENT_NTNET_RECEIVE "ntnet_receive" //called on an object by its NTNET connection component on receive. (sending_id(number), sending_netname(text), data(datum/netdata))
+1
View File
@@ -58,6 +58,7 @@ GLOBAL_LIST_INIT(bitflags, list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 204
#define GROUND (1<<0)
#define FLYING (1<<1)
#define VENTCRAWLING (1<<2)
#define FLOATING (1<<3)
//Fire and Acid stuff, for resistance_flags
#define LAVA_PROOF (1<<0)
+34 -2
View File
@@ -1,12 +1,19 @@
#define MOVESPEED_DATA_INDEX_PRIORITY 1
#define MOVESPEED_DATA_INDEX_FLAGS 2
#define MOVESPEED_DATA_INDEX_MULTIPLICATIVE_SLOWDOWN 3
#define MOVESPEED_DATA_INDEX_MOVETYPE 4
#define MOVESPEED_DATA_INDEX_BL_MOVETYPE 5
#define MOVESPEED_DATA_INDEX_CONFLICT 6
#define MOVESPEED_DATA_INDEX_MAX 3
#define MOVESPEED_DATA_INDEX_MAX 6
//flags
#define IGNORE_NOSLOW (1 << 0)
//conflict types
#define MOVE_CONFLICT_JETPACK "JETPACK"
//ids
#define MOVESPEED_ID_MOB_WALK_RUN_CONFIG_SPEED "MOB_WALK_RUN"
@@ -16,15 +23,29 @@
#define MOVESPEED_ID_SLIME_HEALTHMOD "SLIME_HEALTH_MODIFIER"
#define MOVESPEED_ID_SLIME_TEMPMOD "SLIME_TEMPERATURE_MODIFIER"
#define MOVESPEED_ID_SLIME_STATUS "SLIME_STATUS"
#define MOVESPEED_ID_TARANTULA_WEB "TARANTULA_WEB"
#define MOVESPEED_ID_LIVING_TURF_SPEEDMOD "LIVING_TURF_SPEEDMOD"
#define MOVESPEED_ID_CARBON_SOFTCRIT "CARBON_SOFTCRIT"
#define MOVESPEED_ID_CARBON_OLDSPEED "CARBON_DEPRECATED_SPEED"
#define MOVESPEED_ID_DNA_VAULT "DNA_VAULT"
#define MOVESPEED_ID_YELLOW_ORB "YELLOW_ORB"
#define MOVESPEED_ID_TARFOOT "TARFOOT"
#define MOVESPEED_ID_SEPIA "SEPIA"
#define MOVESPEED_ID_MONKEY_REAGENT_SPEEDMOD "MONKEY_REAGENT_SPEEDMOD"
#define MOVESPEED_ID_MONKEY_TEMPERATURE_SPEEDMOD "MONKEY_TEMPERATURE_SPEEDMOD"
#define MOVESPEED_ID_MONKEY_HEALTH_SPEEDMOD "MONKEY_HEALTH_SPEEDMOD"
#define MOVESPEED_ID_CHANGELING_MUSCLES "CHANGELING_MUSCLES"
#define MOVESPEED_ID_SIMPLEMOB_VARSPEED "SIMPLEMOB_VARSPEED_MODIFIER"
#define MOVESPEED_ID_ADMIN_VAREDIT "ADMIN_VAREDIT_MODIFIER"
@@ -32,7 +53,18 @@
#define MOVESPEED_ID_SANITY "MOOD_SANITY"
#define MOVESPEED_ID_SPECIES "SPECIES_SPEED_MOD"
#define MOVESPEED_ID_PRONE_DRAGGING "PRONE_DRAG"
#define MOVESPEED_ID_HUMAN_CARRYING "HUMAN_CARRY"
#define MOVESPEED_ID_TASED_STATUS "TASED"
#define MOVESPEED_ID_TASED_STATUS "TASED"
#define MOVESPEED_ID_SLAUGHTER "SLAUGHTER"
#define MOVESPEED_ID_CYBER_THRUSTER "CYBER_IMPLANT_THRUSTER"
#define MOVESPEED_ID_JETPACK "JETPACK"
#define MOVESPEED_ID_SHOVE "SHOVE"
#define MOVESPEED_ID_MKULTRA "MKULTRA"
-2
View File
@@ -70,8 +70,6 @@
#define TRAIT_MONKEYLIKE "monkeylike" //sets IsAdvancedToolUser to FALSE
#define TRAIT_PACIFISM "pacifism"
#define TRAIT_IGNORESLOWDOWN "ignoreslow"
#define TRAIT_GOTTAGOFAST "fast"
#define TRAIT_GOTTAGOREALLYFAST "2fast"
#define TRAIT_DEATHCOMA "deathcoma" //Causes death-like unconsciousness
#define TRAIT_FAKEDEATH "fakedeath" //Makes the owner appear as dead to most forms of medical examination
#define TRAIT_DISFIGURED "disfigured"
+1 -1
View File
@@ -65,7 +65,7 @@
return FALSE
if(!isliving(AM) && !isobj(AM))
return FALSE
if(is_type_in_typecache(AM, forbidden_types) || AM.throwing || AM.floating)
if(is_type_in_typecache(AM, forbidden_types) || AM.throwing || (AM.movement_type & FLOATING))
return FALSE
//Flies right over the chasm
if(ismob(AM))
+13 -48
View File
@@ -10,7 +10,6 @@
var/mood_modifier = 1 //Modifier to allow certain mobs to be less affected by moodlets
var/datum/mood_event/list/mood_events = list()
var/insanity_effect = 0 //is the owner being punished for low mood? If so, how much?
var/holdmyinsanityeffect = 0 //before we edit our sanity lets take a look
var/obj/screen/mood/screen_obj
/datum/component/mood/Initialize()
@@ -21,8 +20,7 @@
RegisterSignal(parent, COMSIG_ADD_MOOD_EVENT, .proc/add_event)
RegisterSignal(parent, COMSIG_CLEAR_MOOD_EVENT, .proc/clear_event)
RegisterSignal(parent, COMSIG_INCREASE_SANITY, .proc/IncreaseSanity)
RegisterSignal(parent, COMSIG_DECREASE_SANITY, .proc/DecreaseSanity)
RegisterSignal(parent, COMSIG_MODIFY_SANITY, .proc/modify_sanity)
RegisterSignal(parent, COMSIG_MOB_HUD_CREATED, .proc/modify_hud)
var/mob/living/owner = parent
@@ -131,31 +129,23 @@
switch(mood_level)
if(1)
DecreaseSanity(src, 0.2)
setSanity(sanity-0.2)
if(2)
DecreaseSanity(src, 0.125, SANITY_CRAZY)
setSanity(sanity-0.125, minimum=SANITY_CRAZY)
if(3)
DecreaseSanity(src, 0.075, SANITY_UNSTABLE)
setSanity(sanity-0.075, minimum=SANITY_UNSTABLE)
if(4)
DecreaseSanity(src, 0.025, SANITY_DISTURBED)
setSanity(sanity-0.025, minimum=SANITY_DISTURBED)
if(5)
IncreaseSanity(src, 0.1)
setSanity(sanity+0.1)
if(6)
IncreaseSanity(src, 0.15)
setSanity(sanity+0.15)
if(7)
IncreaseSanity(src, 0.20)
setSanity(sanity+0.20)
if(8)
IncreaseSanity(src, 0.25, SANITY_GREAT)
setSanity(sanity+0.25, maximum=SANITY_GREAT)
if(9)
IncreaseSanity(src, 0.4, SANITY_GREAT)
/*
if(insanity_effect != holdmyinsanityeffect)
if(insanity_effect > holdmyinsanityeffect)
owner.crit_threshold += (insanity_effect - holdmyinsanityeffect)
else
owner.crit_threshold -= (holdmyinsanityeffect - insanity_effect)
*/
setSanity(sanity+0.4, maximum=SANITY_GREAT)
if(HAS_TRAIT(owner, TRAIT_DEPRESSION))
if(prob(0.05))
@@ -166,8 +156,6 @@
add_event(null, "jolly", /datum/mood_event/jolly)
clear_event(null, "depression")
holdmyinsanityeffect = insanity_effect
HandleNutrition(owner)
/datum/component/mood/proc/setSanity(amount, minimum=SANITY_INSANE, maximum=SANITY_NEUTRAL)//I'm sure bunging this in here will have no negative repercussions.
@@ -189,7 +177,7 @@
sanity = amount
switch(sanity)
if(SANITY_INSANE to SANITY_CRAZY)
if(-INFINITY to SANITY_CRAZY)
setInsanityEffect(MAJOR_INSANITY_PEN)
master.add_movespeed_modifier(MOVESPEED_ID_SANITY, TRUE, 100, override=TRUE, multiplicative_slowdown=1.5) //Did we change something ? movetypes is runtiming, movetypes=(~FLYING))
sanity_level = 6
@@ -222,31 +210,8 @@
//master.crit_threshold = (master.crit_threshold - insanity_effect) + newval
insanity_effect = newval
/datum/component/mood/proc/DecreaseSanity(datum/source, amount, minimum = SANITY_INSANE)
if(sanity < minimum) //This might make KevinZ stop fucking pinging me.
IncreaseSanity(src, 0.5)
else
sanity = max(minimum, sanity - amount)
if(sanity < SANITY_UNSTABLE)
if(sanity < SANITY_CRAZY)
insanity_effect = (MAJOR_INSANITY_PEN)
else
insanity_effect = (MINOR_INSANITY_PEN)
/datum/component/mood/proc/IncreaseSanity(datum/source, amount, maximum = SANITY_NEUTRAL)
// Disturbed stops you from getting any more sane - I'm just gonna bung this in here
var/mob/living/owner = parent
if(HAS_TRAIT(owner, TRAIT_UNSTABLE))
return
if(sanity > maximum)
DecreaseSanity(src, 0.5) //Removes some sanity to go back to our current limit.
else
sanity = min(maximum, sanity + amount)
if(sanity > SANITY_CRAZY)
if(sanity > SANITY_UNSTABLE)
insanity_effect = 0
else
insanity_effect = MINOR_INSANITY_PEN
/datum/component/mood/proc/modify_sanity(datum/source, amount, minimum = -INFINITY, maximum = INFINITY)
setSanity(sanity + amount, minimum, maximum)
/datum/component/mood/proc/add_event(datum/source, category, type, param) //Category will override any events in the same category, should be unique unless the event is based on the same thing like hunger.
var/datum/mood_event/the_event
+7 -5
View File
@@ -27,7 +27,6 @@
glide_size = 8
appearance_flags = TILE_BOUND|PIXEL_SCALE
var/datum/forced_movement/force_moving = null //handled soley by forced_movement.dm
var/floating = FALSE
var/movement_type = GROUND //Incase you have multiple types, you automatically use the most useful one. IE: Skating on ice, flippers on water, flying over chasm/space, etc.
var/atom/movable/pulling
var/grab_state = 0
@@ -422,6 +421,9 @@
var/atom/movable/AM = item
AM.onTransitZ(old_z,new_z)
/atom/movable/proc/setMovetype(newval)
movement_type = newval
//Called whenever an object moves and by mobs when they attempt to move themselves through space
//And when an object or action applies a force on src, see newtonian_move() below
//Return 0 to have src start/keep drifting in a no-grav area and 1 to stop/not start drifting
@@ -686,14 +688,14 @@
/atom/movable/proc/float(on)
if(throwing)
return
if(on && !floating)
if(on && !(movement_type & FLOATING))
animate(src, pixel_y = pixel_y + 2, time = 10, loop = -1)
sleep(10)
animate(src, pixel_y = pixel_y - 2, time = 10, loop = -1)
floating = TRUE
else if (!on && floating)
setMovetype(movement_type | FLOATING)
else if (!on && (movement_type & FLOATING))
animate(src, pixel_y = initial(pixel_y), time = 10)
floating = FALSE
setMovetype(movement_type & ~FLOATING)
/* Language procs */
/atom/movable/proc/get_language_holder(shadow=TRUE)
+2 -2
View File
@@ -170,7 +170,7 @@
if(!victim.client || !istype(victim))
return
to_chat(victim, "<span class='notice'>You feel fast!</span>")
ADD_TRAIT(victim, TRAIT_GOTTAGOREALLYFAST, "yellow_orb")
victim.add_movespeed_modifier(MOVESPEED_ID_YELLOW_ORB, update=TRUE, priority=100, multiplicative_slowdown=-2, blacklisted_movetypes=(FLYING|FLOATING))
sleep(duration)
REMOVE_TRAIT(victim, TRAIT_GOTTAGOREALLYFAST, "yellow_orb")
victim.remove_movespeed_modifier(MOVESPEED_ID_YELLOW_ORB)
to_chat(victim, "<span class='notice'>You slow down.</span>")
+29 -18
View File
@@ -17,7 +17,7 @@
/obj/item/tank/jetpack/New()
..()
if(gas_type)
air_contents.gases[gas_type] = (6 * ONE_ATMOSPHERE) * volume / (R_IDEAL_GAS_EQUATION * T20C)
air_contents.gases[gas_type] = ((6 * ONE_ATMOSPHERE) * volume / (R_IDEAL_GAS_EQUATION * T20C))
ion_trail = new
ion_trail.set_up(src)
@@ -37,42 +37,50 @@
return
if(!on)
turn_on()
turn_on(user)
to_chat(user, "<span class='notice'>You turn the jetpack on.</span>")
else
turn_off()
turn_off(user)
to_chat(user, "<span class='notice'>You turn the jetpack off.</span>")
for(var/X in actions)
var/datum/action/A = X
A.UpdateButtonIcon()
/obj/item/tank/jetpack/proc/turn_on()
/obj/item/tank/jetpack/proc/turn_on(mob/user)
on = TRUE
icon_state = "[initial(icon_state)]-on"
ion_trail.start()
RegisterSignal(user, COMSIG_MOVABLE_MOVED, .proc/move_react)
if(full_speed)
user.add_movespeed_modifier(MOVESPEED_ID_JETPACK, priority=100, multiplicative_slowdown=-2, movetypes=FLOATING, conflict=MOVE_CONFLICT_JETPACK)
/obj/item/tank/jetpack/proc/turn_off()
/obj/item/tank/jetpack/proc/turn_off(mob/user)
on = FALSE
stabilizers = FALSE
icon_state = initial(icon_state)
ion_trail.stop()
UnregisterSignal(user, COMSIG_MOVABLE_MOVED)
user.remove_movespeed_modifier(MOVESPEED_ID_JETPACK)
/obj/item/tank/jetpack/proc/move_react(mob/user)
allow_thrust(0.01, user)
/obj/item/tank/jetpack/proc/allow_thrust(num, mob/living/user)
if(!on)
return
if((num < 0.005 || air_contents.total_moles() < num))
turn_off()
turn_off(user)
return
var/datum/gas_mixture/removed = air_contents.remove(num)
if(removed.total_moles() < 0.005)
turn_off()
turn_off(user)
return
var/turf/T = get_turf(user)
T.assume_air(removed)
return 1
return TRUE
/obj/item/tank/jetpack/suicide_act(mob/user)
if (istype(user, /mob/living/carbon/human/))
@@ -96,22 +104,22 @@
if(!on)
return
if((num < 0.005 || air_contents.total_moles() < num))
turn_off()
turn_off(user)
return
if(rand(0,250) == 0)
to_chat(user, "<span class='notice'>You feel your jetpack's engines cut out.</span>")
turn_off()
turn_off(user)
return
var/datum/gas_mixture/removed = air_contents.remove(num)
if(removed.total_moles() < 0.005)
turn_off()
turn_off(user)
return
var/turf/T = get_turf(user)
T.assume_air(removed)
return 1
return TRUE
/obj/item/tank/jetpack/void
name = "void jetpack (oxygen)"
@@ -178,6 +186,7 @@
full_speed = FALSE
var/datum/gas_mixture/temp_air_contents
var/obj/item/tank/internals/tank = null
var/mob/living/carbon/human/cur_user
/obj/item/tank/jetpack/suit/New()
..()
@@ -198,28 +207,30 @@
return
..()
/obj/item/tank/jetpack/suit/turn_on()
if(!istype(loc, /obj/item/clothing/suit/space/hardsuit) || !ishuman(loc.loc))
/obj/item/tank/jetpack/suit/turn_on(mob/user)
if(!istype(loc, /obj/item/clothing/suit/space/hardsuit) || !ishuman(loc.loc) || loc.loc != user)
return
var/mob/living/carbon/human/H = loc.loc
var/mob/living/carbon/human/H = user
tank = H.s_store
air_contents = tank.air_contents
START_PROCESSING(SSobj, src)
cur_user = user
..()
/obj/item/tank/jetpack/suit/turn_off()
/obj/item/tank/jetpack/suit/turn_off(mob/user)
tank = null
air_contents = temp_air_contents
STOP_PROCESSING(SSobj, src)
cur_user = null
..()
/obj/item/tank/jetpack/suit/process()
if(!istype(loc, /obj/item/clothing/suit/space/hardsuit) || !ishuman(loc.loc))
turn_off()
turn_off(cur_user)
return
var/mob/living/carbon/human/H = loc.loc
if(!tank || tank != H.s_store)
turn_off()
turn_off(cur_user)
return
..()
@@ -21,7 +21,7 @@
to_chat(user, "<span class='notice'>Our muscles tense and strengthen.</span>")
changeling.chem_recharge_slowdown += 0.5
else
REMOVE_TRAIT(user, TRAIT_GOTTAGOFAST, "changeling_muscles")
user.remove_movespeed_modifier(MOVESPEED_ID_CHANGELING_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)
ADD_TRAIT(user, TRAIT_GOTTAGOFAST, "changeling_muscles")
user.add_movespeed_modifier(MOVESPEED_ID_CHANGELING_MUSCLES, update=TRUE, priority=100, multiplicative_slowdown=-1, blacklisted_movetypes=(FLYING|FLOATING))
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.Knockdown(40)
REMOVE_TRAIT(user, TRAIT_GOTTAGOFAST, "changeling_muscles")
user.remove_movespeed_modifier(MOVESPEED_ID_CHANGELING_MUSCLES)
changeling.chem_recharge_slowdown -= 0.5
break
@@ -46,11 +46,11 @@
if(!depression)
SEND_SIGNAL(affected_mob, COMSIG_ADD_MOOD_EVENT, "rev_blight", /datum/mood_event/revenant_blight)
depression = TRUE
SEND_SIGNAL(affected_mob, COMSIG_DECREASE_SANITY, 0.12, SANITY_CRAZY)
SEND_SIGNAL(affected_mob, COMSIG_MODIFY_SANITY, -0.12, SANITY_CRAZY)
if(prob(10))
affected_mob.emote(pick("pale","shiver"))
if(4)
SEND_SIGNAL(affected_mob, COMSIG_DECREASE_SANITY, 0.18, SANITY_CRAZY)
SEND_SIGNAL(affected_mob, COMSIG_MODIFY_SANITY, -0.18, SANITY_CRAZY)
if(prob(15))
affected_mob.emote(pick("pale","shiver","cries"))
if(5)
@@ -34,7 +34,6 @@
melee_damage_upper = 30
see_in_dark = 8
lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE
var/boost = 0
bloodcrawl = BLOODCRAWL_EAT
var/playstyle_string = "<span class='big bold'>You are a slaughter demon,</span><B> a terrible creature from another realm. You have a single desire: To kill. \
You may use the \"Blood Crawl\" ability near blood pools to travel through them, appearing and disappearing from the station at will. \
@@ -54,24 +53,18 @@
if(istype(loc, /obj/effect/dummy/phased_mob/slaughter))
bloodspell.phased = TRUE
/mob/living/simple_animal/slaughter/Life()
..()
if(boost<world.time)
speed = 1
else
speed = 0
/obj/effect/decal/cleanable/blood/innards
icon = 'icons/obj/surgery.dmi'
name = "pile of viscera"
desc = "A repulsive pile of guts and gore."
gender = NEUTER
icon_state = "innards"
random_icon_states = null
/mob/living/simple_animal/slaughter/phasein()
. = ..()
speed = 0
boost = world.time + 60
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)
//The loot from killing a slaughter demon - can be consumed to allow the user to blood crawl
+1 -1
View File
@@ -135,7 +135,7 @@
to_chat(user, "<span class='warning'>You cannot remove the jetpack from [src] while wearing it.</span>")
return
jetpack.turn_off()
jetpack.turn_off(user)
jetpack.forceMove(drop_location())
jetpack = null
to_chat(user, "<span class='notice'>You successfully remove the jetpack from [src].</span>")
+1 -2
View File
@@ -152,8 +152,7 @@
newcolor = BLOOD_COLOR_XENO
add_atom_colour(newcolor, TEMPORARY_COLOUR_PRIORITY)
// but only for a few seconds
spawn(30)
remove_atom_colour(TEMPORARY_COLOUR_PRIORITY, newcolor)
addtimer(CALLBACK(src, /atom/.proc/remove_atom_colour, TEMPORARY_COLOUR_PRIORITY, newcolor), 6 SECONDS)
/mob/living/proc/phasein(obj/effect/decal/cleanable/B)
if(src.notransform)
@@ -36,7 +36,7 @@
/mob/living/carbon/Move(NewLoc, direct)
. = ..()
if(. && mob_has_gravity()) //floating is easy
if(. && (movement_type & FLOATING)) //floating is easy
if(HAS_TRAIT(src, TRAIT_NOHUNGER))
nutrition = NUTRITION_LEVEL_FED - 1 //just less than feeling vigorous
else if(nutrition && stat != DEAD)
@@ -946,7 +946,7 @@
return FALSE
/mob/living/carbon/human/proc/clear_shove_slowdown()
remove_movespeed_modifier(SHOVE_SLOWDOWN_ID)
remove_movespeed_modifier(MOVESPEED_ID_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)
@@ -21,8 +21,6 @@
var/bleed_mod = 1 // % bleeding modifier
var/datum/armor/armor // internal armor datum
var/speed_mod = 0 //tick modifier for each step. Positive is slower, negative is faster.
var/hunger_mod = 1 //% of hunger rate taken per tick.
var/do_after_speed = 1 //Speed mod for do_after. Lower is better. If temporarily adjusting, please only modify using *= and /=, so you don't interrupt other calculations.
@@ -332,6 +332,8 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
if("meat_type" in default_features) //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))
SEND_SIGNAL(C, COMSIG_SPECIES_GAIN, src, old_species)
@@ -348,6 +350,8 @@ 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)
if("meat_type" in default_features)
C.type_of_meat = GLOB.meat_types[C.dna.features["meat_type"]]
else
@@ -1389,39 +1393,16 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
/datum/species/proc/movement_delay(mob/living/carbon/human/H)
. = 0 //We start at 0.
var/flight = 0 //Check for flight and flying items
var/ignoreslow = 0
var/gravity = 0
if(H.movement_type & FLYING)
flight = 1
gravity = H.has_gravity()
if(gravity && !flight) //Check for chemicals and innate speedups and slowdowns if we're on the ground
if(HAS_TRAIT(H, TRAIT_GOTTAGOFAST))
. -= 1
if(HAS_TRAIT(H, TRAIT_GOTTAGOREALLYFAST))
. -= 2
. += speedmod
. += H.physiology.speed_mod
if (H.m_intent == MOVE_INTENT_WALK && HAS_TRAIT(H, TRAIT_SPEEDY_STEP))
. -= 1.5
if(HAS_TRAIT(H, TRAIT_IGNORESLOWDOWN))
ignoreslow = 1
if(!gravity)
var/obj/item/tank/jetpack/J = H.back
var/obj/item/clothing/suit/space/hardsuit/C = H.wear_suit
var/obj/item/organ/cyberimp/chest/thrusters/T = H.getorganslot(ORGAN_SLOT_THRUSTERS)
if(!istype(J) && istype(C))
J = C.jetpack
if(istype(J) && J.full_speed && J.allow_thrust(0.01, H)) //Prevents stacking
. -= 0.4
else if(istype(T) && T.allow_thrust(0.01, H))
. -= 0.4
if(!ignoreslow && gravity)
if(!HAS_TRAIT(H, TRAIT_IGNORESLOWDOWN) && gravity)
if(H.wear_suit)
. += H.wear_suit.slowdown
if(H.shoes)
@@ -1448,16 +1429,6 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
var/grav_force = min(gravity - STANDARD_GRAVITY,3)
. += 1 + grav_force
var/datum/component/mood/mood = H.GetComponent(/datum/component/mood)
if(mood && !flight) //How can depression slow you down if you can just fly away from your problems?
switch(mood.sanity)
if(SANITY_INSANE to SANITY_CRAZY)
. += 1.5
if(SANITY_CRAZY to SANITY_UNSTABLE)
. += 1
if(SANITY_UNSTABLE to SANITY_DISTURBED)
. += 0.5
if(HAS_TRAIT(H, TRAIT_FAT))
. += (1.5 - flight)
if(H.bodytemperature < BODYTEMP_COLD_DAMAGE_LIMIT && !HAS_TRAIT(H, TRAIT_RESISTCOLD))
@@ -1940,8 +1911,8 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
var/knocked_item = FALSE
if(!is_type_in_typecache(target_held_item, GLOB.shove_disarming_types))
target_held_item = null
if(!target.has_movespeed_modifier(SHOVE_SLOWDOWN_ID))
target.add_movespeed_modifier(SHOVE_SLOWDOWN_ID, multiplicative_slowdown = SHOVE_SLOWDOWN_STRENGTH)
if(!target.has_movespeed_modifier(MOVESPEED_ID_SHOVE))
target.add_movespeed_modifier(MOVESPEED_ID_SHOVE, multiplicative_slowdown = SHOVE_SLOWDOWN_STRENGTH)
if(target_held_item)
target.visible_message("<span class='danger'>[target.name]'s grip on \the [target_held_item] loosens!</span>",
"<span class='danger'>Your grip on \the [target_held_item] loosens!</span>", null, COMBAT_MESSAGE_RANGE)
@@ -29,7 +29,7 @@
if(fly)
fly.Remove(H)
if(H.movement_type & FLYING)
H.movement_type &= ~FLYING
H.setMovetype(H.movement_type & ~FLYING)
ToggleFlight(H,0)
if(H.dna && H.dna.species && (H.dna.features["wings"] == "Angel"))
if("wings" in H.dna.species.mutant_bodyparts)
@@ -132,14 +132,14 @@
if(flight && CanFly(H))
stunmod = 2
speedmod = -0.35
H.movement_type |= FLYING
H.setMovetype(H.movement_type | FLYING)
override_float = TRUE
H.pass_flags |= PASSTABLE
H.OpenWings()
else
stunmod = 1
speedmod = 0
H.movement_type &= ~FLYING
H.setMovetype(H.movement_type & ~FLYING)
override_float = FALSE
H.pass_flags &= ~PASSTABLE
H.CloseWings()
@@ -23,7 +23,7 @@
if(changed)
animate(src, transform = ntransform, time = 2, pixel_y = final_pixel_y, dir = final_dir, easing = EASE_IN|EASE_OUT)
floating = 0 // If we were without gravity, the bouncing animation got stopped, so we make sure we restart it in next life().
setMovetype(movement_type & ~FLOATING) // If we were without gravity, the bouncing animation got stopped, so we make sure we restart it in next life().
/mob/living/carbon
+1 -1
View File
@@ -4,7 +4,7 @@
if(digitalinvis)
handle_diginvis() //AI becomes unable to see mob
if((movement_type & FLYING) && !floating) //TODO: Better floating
if((movement_type & FLYING) && !(movement_type & FLOATING)) //TODO: Better floating
float(on = TRUE)
if (client)
+5 -5
View File
@@ -716,14 +716,14 @@
var/fixed = 0
if(anchored || (buckled && buckled.anchored))
fixed = 1
if(on && !floating && !fixed)
if(on && !(movement_type & FLOATING) && !fixed)
animate(src, pixel_y = pixel_y + 2, time = 10, loop = -1)
sleep(10)
animate(src, pixel_y = pixel_y - 2, time = 10, loop = -1)
floating = TRUE
else if(((!on || fixed) && floating))
setMovetype(movement_type | FLOATING)
else if(((!on || fixed) && (movement_type & FLOATING)))
animate(src, pixel_y = get_standard_pixel_y_offset(lying), time = 10)
floating = FALSE
setMovetype(movement_type & ~FLOATING)
// The src mob is trying to strip an item from someone
// Override if a certain type of mob should be behave differently when stripping items (can't, for example)
@@ -795,7 +795,7 @@
var/final_pixel_y = get_standard_pixel_y_offset(lying)
animate(src, pixel_x = pixel_x + pixel_x_diff, pixel_y = pixel_y + pixel_y_diff , time = 2, loop = 6)
animate(pixel_x = final_pixel_x , pixel_y = final_pixel_y , time = 2)
floating = 0 // If we were without gravity, the bouncing animation got stopped, so we make sure to restart it in next life().
setMovetype(movement_type & ~FLOATING) // If we were without gravity, the bouncing animation got stopped, so we make sure to restart it in next life().
/mob/living/proc/get_temperature(datum/gas_mixture/environment)
var/loc_temp = environment ? environment.temperature : T0C
+1 -1
View File
@@ -422,4 +422,4 @@
if(!used_item)
used_item = get_active_held_item()
..()
floating = 0 // If we were without gravity, the bouncing animation got stopped, so we make sure we restart the bouncing after the next movement.
setMovetype(movement_type & ~FLOATING) // If we were without gravity, the bouncing animation got stopped, so we make sure we restart the bouncing after the next movement.
@@ -175,14 +175,17 @@
status_flags = NONE
mob_size = MOB_SIZE_LARGE
gold_core_spawnable = NO_SPAWN
var/slowed_by_webs = FALSE
/mob/living/simple_animal/hostile/poison/giant_spider/tarantula/movement_delay()
var/turf/T = get_turf(src)
if(locate(/obj/structure/spider/stickyweb) in T)
speed = 2
else
speed = 7
/mob/living/simple_animal/hostile/poison/giant_spider/tarantula/Moved(atom/oldloc, dir)
. = ..()
if(slowed_by_webs)
if(!(locate(/obj/structure/spider/stickyweb) in loc))
remove_movespeed_modifier(MOVESPEED_ID_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)
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.
/mob/living/simple_animal/hostile/poison/giant_spider/nurse/midwife
@@ -363,7 +363,7 @@
density = initial(density)
lying = 0
. = 1
movement_type = initial(movement_type)
setMovetype(initial(movement_type))
/mob/living/simple_animal/proc/make_babies() // <3 <3 <3
if(gender != FEMALE || stat || next_scan_time > world.time || !childtype || !animal_species || !SSticker.IsRoundInProgress())
+2 -2
View File
@@ -100,7 +100,7 @@ GLOBAL_LIST_INIT(ventcrawl_machinery, typecacheof(list(
A.pipe_vision_img.plane = ABOVE_HUD_PLANE
client.images += A.pipe_vision_img
pipes_shown += A.pipe_vision_img
movement_type |= VENTCRAWLING
setMovetype(movement_type | VENTCRAWLING)
/mob/living/proc/remove_ventcrawl()
@@ -108,7 +108,7 @@ GLOBAL_LIST_INIT(ventcrawl_machinery, typecacheof(list(
for(var/image/current_image in pipes_shown)
client.images -= current_image
pipes_shown.len = 0
movement_type &= ~VENTCRAWLING
setMovetype(movement_type & ~VENTCRAWLING)
+4
View File
@@ -961,3 +961,7 @@ GLOBAL_VAR_INIT(exploit_warn_spam_prevention, 0)
var/datum/language_holder/H = get_language_holder()
H.open_language_menu(usr)
/mob/setMovetype(newval)
. = ..()
update_movespeed(FALSE)
+28 -8
View File
@@ -1,23 +1,29 @@
/*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)
var/list/temp = list(priority, flags, multiplicative_slowdown) //build the modification list
/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))
if(movespeed_modifier_identical_check(movespeed_modification[id], temp))
var/list/existing_data = movespeed_modification[id]
if(movespeed_modifier_identical_check(existing_data, temp))
return FALSE
if(!override)
return FALSE
else
remove_movespeed_modifier(id, update)
LAZYSET(movespeed_modification, id, list(priority, flags, multiplicative_slowdown))
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(TRUE)
update_movespeed(resort)
return TRUE
/mob/proc/remove_movespeed_modifier(id, update = TRUE)
@@ -55,9 +61,23 @@
if(resort)
sort_movespeed_modlist()
. = 0
var/list/conflict_tracker = list()
for(var/id in get_movespeed_modifiers())
var/list/data = movespeed_modification[id]
. += data[MOVESPEED_DATA_INDEX_MULTIPLICATIVE_SLOWDOWN]
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()
@@ -407,10 +407,10 @@
/datum/reagent/consumable/nuka_cola/on_mob_metabolize(mob/living/L)
..()
ADD_TRAIT(L, TRAIT_GOTTAGOFAST, id)
L.add_movespeed_modifier(id, update=TRUE, priority=100, multiplicative_slowdown=-1, blacklisted_movetypes=(FLYING|FLOATING))
/datum/reagent/consumable/nuka_cola/on_mob_end_metabolize(mob/living/L)
REMOVE_TRAIT(L, TRAIT_GOTTAGOFAST, id)
L.remove_movespeed_modifier(id)
..()
/datum/reagent/consumable/nuka_cola/on_mob_life(mob/living/carbon/M)
@@ -469,7 +469,7 @@
/datum/reagent/drug/skooma/on_mob_metabolize(mob/living/L)
. = ..()
ADD_TRAIT(L, TRAIT_GOTTAGOFAST, id)
L.add_movespeed_modifier(id, update=TRUE, priority=100, multiplicative_slowdown=-1, blacklisted_movetypes=(FLYING|FLOATING))
L.next_move_modifier *= 2
if(ishuman(L))
var/mob/living/carbon/human/H = L
@@ -480,7 +480,7 @@
/datum/reagent/drug/skooma/on_mob_end_metabolize(mob/living/L)
. = ..()
REMOVE_TRAIT(L, TRAIT_GOTTAGOFAST, id)
L.remove_movespeed_modifier(id)
L.next_move_modifier *= 0.5
if(ishuman(L))
var/mob/living/carbon/human/H = L
@@ -984,10 +984,10 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M)
/datum/reagent/medicine/stimulants/on_mob_metabolize(mob/living/L)
..()
ADD_TRAIT(L, TRAIT_GOTTAGOFAST, id)
L.add_movespeed_modifier(id, update=TRUE, priority=100, multiplicative_slowdown=-1, blacklisted_movetypes=(FLYING|FLOATING))
/datum/reagent/medicine/stimulants/on_mob_end_metabolize(mob/living/L)
REMOVE_TRAIT(L, TRAIT_GOTTAGOFAST, id)
L.remove_movespeed_modifier(id)
..()
/datum/reagent/medicine/stimulants/on_mob_life(mob/living/carbon/M)
@@ -1308,10 +1308,10 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M)
/datum/reagent/medicine/changelinghaste/on_mob_metabolize(mob/living/L)
..()
ADD_TRAIT(L, TRAIT_GOTTAGOREALLYFAST, id)
L.add_movespeed_modifier(id, update=TRUE, priority=100, multiplicative_slowdown=-2, blacklisted_movetypes=(FLYING|FLOATING))
/datum/reagent/medicine/changelinghaste/on_mob_end_metabolize(mob/living/L)
REMOVE_TRAIT(L, TRAIT_GOTTAGOREALLYFAST, id)
L.remove_movespeed_modifier(id)
..()
/datum/reagent/medicine/changelinghaste/on_mob_life(mob/living/carbon/M)
@@ -1529,10 +1529,10 @@
/datum/reagent/nitryl/on_mob_metabolize(mob/living/L)
..()
ADD_TRAIT(L, TRAIT_GOTTAGOFAST, id)
L.add_movespeed_modifier(id, update=TRUE, priority=100, multiplicative_slowdown=-1, blacklisted_movetypes=(FLYING|FLOATING))
/datum/reagent/nitryl/on_mob_end_metabolize(mob/living/L)
REMOVE_TRAIT(L, TRAIT_GOTTAGOFAST, id)
L.remove_movespeed_modifier(id)
..()
/////////////////////////Coloured Crayon Powder////////////////////////////
@@ -372,15 +372,11 @@ datum/status_effect/rebreathing/tick()
duration = 30
/datum/status_effect/tarfoot/on_apply()
var/mob/living/carbon/human/H = owner
if(istype(H))
H.physiology.speed_mod += 0.5
owner.add_movespeed_modifier(MOVESPEED_ID_TARFOOT, update=TRUE, priority=100, multiplicative_slowdown=0.5, blacklisted_movetypes=(FLYING|FLOATING))
return ..()
/datum/status_effect/tarfoot/on_remove()
var/mob/living/carbon/human/H = owner
if(istype(H))
H.physiology.speed_mod -= 0.5
owner.remove_movespeed_modifier(MOVESPEED_ID_TARFOOT)
/datum/status_effect/spookcookie
id = "spookcookie"
@@ -692,20 +688,15 @@ datum/status_effect/stabilized/blue/on_remove()
/datum/status_effect/stabilized/sepia/tick()
if(prob(50) && mod > -1)
mod--
var/mob/living/carbon/human/H = owner
if(istype(H))
H.physiology.speed_mod--
owner.add_movespeed_modifier(MOVESPEED_ID_SEPIA, update=TRUE, priority=100, multiplicative_slowdown=-1, blacklisted_movetypes=(FLYING|FLOATING))
else if(mod < 1)
mod++
var/mob/living/carbon/human/H = owner
if(istype(H))
H.physiology.speed_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))
return ..()
/datum/status_effect/stabilized/sepia/on_remove()
var/mob/living/carbon/human/H = owner
if(istype(H))
H.physiology.speed_mod += -mod //Reset the changes.
owner.remove_movespeed_modifier(MOVESPEED_ID_SEPIA)
/datum/status_effect/stabilized/cerulean
id = "stabilizedcerulean"
@@ -913,7 +904,7 @@ datum/status_effect/stabilized/blue/on_remove()
colour = "light pink"
/datum/status_effect/stabilized/lightpink/on_apply()
ADD_TRAIT(owner, TRAIT_GOTTAGOFAST,"slimestatus")
owner.add_movespeed_modifier(MOVESPEED_ID_SLIME_STATUS, update=TRUE, priority=100, multiplicative_slowdown=-1, blacklisted_movetypes=(FLYING|FLOATING))
return ..()
/datum/status_effect/stabilized/lightpink/tick()
@@ -924,7 +915,7 @@ datum/status_effect/stabilized/blue/on_remove()
return ..()
/datum/status_effect/stabilized/lightpink/on_remove()
REMOVE_TRAIT(owner, TRAIT_GOTTAGOFAST,"slimestatus")
owner.remove_movespeed_modifier(MOVESPEED_ID_SLIME_STATUS)
/datum/status_effect/stabilized/adamantine
id = "stabilizedadamantine"
+1 -1
View File
@@ -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>")
ADD_TRAIT(H, TRAIT_GOTTAGOFAST, "dna_vault")
H.add_movespeed_modifier(MOVESPEED_ID_DNA_VAULT, update=TRUE, priority=100, multiplicative_slowdown=-1, blacklisted_movetypes=(FLYING|FLOATING))
if(VAULT_QUICK)
to_chat(H, "<span class='notice'>Your arms move as fast as lightning.</span>")
H.next_move_modifier = 0.5
+1 -1
View File
@@ -116,7 +116,7 @@
return TRUE
/mob/living/carbon/human/get_leg_ignore()
if((movement_type & FLYING) || floating)
if(movement_type & FLYING|FLOATING)
return TRUE
return FALSE
@@ -129,7 +129,7 @@
var/datum/effect_system/trail_follow/ion/ion_trail
/obj/item/organ/cyberimp/chest/thrusters/Insert(mob/living/carbon/M, special = 0)
..()
. = ..()
if(!ion_trail)
ion_trail = new
ion_trail.set_up(M)
@@ -151,10 +151,14 @@
on = TRUE
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)
if(!silent)
to_chat(owner, "<span class='notice'>You turn your thrusters set on.</span>")
else
ion_trail.stop()
UnregisterSignal(owner, COMSIG_MOVABLE_MOVED)
owner.remove_movespeed_modifier(MOVESPEED_ID_CYBER_THRUSTER)
if(!silent)
to_chat(owner, "<span class='notice'>You turn your thrusters set off.</span>")
on = FALSE
@@ -169,6 +173,9 @@
var/datum/action/A = X
A.UpdateButtonIcon()
/obj/item/organ/cyberimp/chest/thrusters/proc/move_react()
allow_thrust(0.01)
/obj/item/organ/cyberimp/chest/thrusters/proc/allow_thrust(num)
if(!on || !owner)
return 0
@@ -499,7 +499,7 @@
cooldown += 1 //Cooldown doesn't process till status is done
else if(status == "charge")
ADD_TRAIT(owner, TRAIT_GOTTAGOFAST, "MKUltra")
owner.add_movespeed_modifier(MOVESPEED_ID_MKULTRA, update=TRUE, priority=100, multiplicative_slowdown=-2, blacklisted_movetypes=(FLYING|FLOATING))
status = "charged"
if(master.client?.prefs.lewdchem)
to_chat(owner, "<span class='notice'><i>Your [enthrallGender]'s order fills you with a burst of speed!</i></span>")
@@ -509,7 +509,7 @@
else if (status == "charged")
if (statusStrength < 0)
status = null
REMOVE_TRAIT(owner, TRAIT_GOTTAGOFAST, "MKUltra")
owner.remove_movespeed_modifier(MOVESPEED_ID_MKULTRA)
owner.Knockdown(50)
to_chat(owner, "<span class='notice'><i>Your body gives out as the adrenaline in your system runs out.</i></span>")
else