Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjusts movement speed values #1089

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion code/__DEFINES/combat.dm
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
//slowdown when in softcrit. Note that crawling slowdown will also apply at the same time!
#define SOFTCRIT_ADD_SLOWDOWN 3
//slowdown when crawling
#define CRAWLING_ADD_SLOWDOWN 6
#define CRAWLING_ADD_SLOWDOWN 8

//Attack types for checking shields/hit reactions
#define MELEE_ATTACK 1
Expand Down
2 changes: 0 additions & 2 deletions code/__DEFINES/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -418,8 +418,6 @@
#define AGE_MINOR 20 //legal age of space drinking and smoking
#define WIZARD_AGE_MIN 30 //youngest a wizard can be
#define APPRENTICE_AGE_MIN 29 //youngest an apprentice can be
#define SHOES_SLOWDOWN 0 //How much shoes slow you down by default. Negative values speed you up
#define SHOES_SPEED_SLIGHT SHOES_SLOWDOWN - 1 // slightest speed boost to movement
#define POCKET_STRIP_DELAY (4 SECONDS) //time taken to search somebody's pockets
#define DOOR_CRUSH_DAMAGE 15 //the amount of damage that airlocks deal when they crush you

Expand Down
8 changes: 8 additions & 0 deletions code/datums/status_effects/neutral.dm
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,14 @@
status_type = STATUS_EFFECT_UNIQUE
alert_type = /atom/movable/screen/alert/status_effect/holdup

/datum/status_effect/holdup/on_apply()
. = ..()
owner.add_movespeed_modifier(/datum/movespeed_modifier/status_effect/holdup)

/datum/status_effect/holdup/on_remove()
. = ..()
owner.remove_movespeed_modifier(/datum/movespeed_modifier/status_effect/holdup)

/atom/movable/screen/alert/status_effect/holdup
name = "Holding Up"
desc = "You're currently pointing a gun at someone."
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/washing_machine.dm
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ GLOBAL_LIST_INIT(dye_registry, list(
/obj/item/clothing/shoes/sneakers/machine_wash(obj/machinery/washing_machine/washer)
if(chained)
chained = FALSE
slowdown = SHOES_SLOWDOWN
slowdown = initial(slowdown)
new /obj/item/restraints/handcuffs(loc)
..()

Expand Down
4 changes: 2 additions & 2 deletions code/modules/antagonists/clown_ops/clown_weapons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
name = "combat clown shoes"
desc = "advanced clown shoes that protect the wearer and render them nearly immune to slipping on their own peels. They also squeak at 100% capacity."
clothing_traits = list(TRAIT_NO_SLIP_WATER)
slowdown = SHOES_SLOWDOWN
slowdown = /obj/item/clothing/shoes::slowdown
armor = list(BLUNT = 25, PUNCTURE = 25, SLASH = 0, LASER = 25, ENERGY = 25, BOMB = 50, BIO = 10, FIRE = 70, ACID = 50)
strip_delay = 70
resistance_flags = NONE
Expand All @@ -34,7 +34,7 @@
/obj/item/clothing/shoes/clown_shoes/banana_shoes/combat
name = "mk-honk combat shoes"
desc = "The culmination of years of clown combat research, these shoes leave a trail of chaos in their wake. They will slowly recharge themselves over time, or can be manually charged with bananium."
slowdown = SHOES_SLOWDOWN
slowdown = /obj/item/clothing/shoes::slowdown
armor = list(BLUNT = 25, PUNCTURE = 25, SLASH = 0, LASER = 25, ENERGY = 25, BOMB = 50, BIO = 10, FIRE = 70, ACID = 50)
strip_delay = 70
resistance_flags = NONE
Expand Down
2 changes: 1 addition & 1 deletion code/modules/clothing/shoes/_shoes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
supports_variations_flags = CLOTHING_VOX_VARIATION | CLOTHING_DIGITIGRADE_VARIATION

permeability_coefficient = 0.5
slowdown = SHOES_SLOWDOWN
slowdown = 0
strip_delay = 1 SECONDS

var/offset = 0
Expand Down
2 changes: 1 addition & 1 deletion code/modules/clothing/shoes/clown.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
name = "clown shoes"
icon_state = "clown"
inhand_icon_state = "clown_shoes"
slowdown = SHOES_SLOWDOWN+1
slowdown = parent_type::slowdown + 1 // Slower than normal
var/enabled_waddle = TRUE
lace_time = 20 SECONDS // how the hell do these laces even work??
supports_variations_flags = CLOTHING_DIGITIGRADE_VARIATION | CLOTHING_TESHARI_VARIATION | CLOTHING_VOX_VARIATION
Expand Down
2 changes: 1 addition & 1 deletion code/modules/clothing/shoes/galoshes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
icon_state = "galoshes"
permeability_coefficient = 0.01
clothing_traits = list(TRAIT_NO_SLIP_WATER)
slowdown = SHOES_SLOWDOWN+1
slowdown = parent_type::slowdown + 1 // Slower than normal
strip_delay = 30
equip_delay_other = 50
resistance_flags = NONE
Expand Down
3 changes: 1 addition & 2 deletions code/modules/clothing/shoes/magboots.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
resistance_flags = FIRE_PROOF
supports_variations_flags = CLOTHING_DIGITIGRADE_VARIATION | CLOTHING_TESHARI_VARIATION | CLOTHING_VOX_VARIATION

slowdown = SHOES_SLOWDOWN
/// Whether the magpulse system is active
var/magpulse = FALSE
/// Slowdown applied wwhen magpulse is active. This is added onto existing slowdown
Expand Down Expand Up @@ -66,7 +65,7 @@
name = "advanced magboots"
icon_state = "advmag0"
base_icon_state = "advmag"
slowdown_active = SHOES_SLOWDOWN // ZERO active slowdown
slowdown_active = parent_type::slowdown // ZERO active slowdown
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ACID_PROOF

/obj/item/clothing/shoes/magboots/syndie
Expand Down
2 changes: 1 addition & 1 deletion code/modules/clothing/shoes/sneakers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
/obj/item/clothing/shoes/sneakers/orange/attack_self(mob/user)
if (chained)
chained = FALSE
slowdown = SHOES_SLOWDOWN
slowdown = initial(slowdown)
new /obj/item/restraints/handcuffs( user.loc )
icon_state = initial(icon_state)
return
Expand Down
4 changes: 2 additions & 2 deletions code/modules/clothing/shoes/wheelys.dm
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
greyscale_colors = null
greyscale_config = null
worn_icon_state = "rollerskates"
slowdown = SHOES_SLOWDOWN+1
slowdown = parent_type::slowdown + 1 // Slower than normal
wheels = /obj/vehicle/ridden/scooter/skateboard/wheelys/rollerskates
custom_premium_price = PAYCHECK_EASY * 5
custom_price = PAYCHECK_EASY * 5
Expand All @@ -75,7 +75,7 @@
greyscale_colors = null
greyscale_config = null
worn_icon_state = "skishoes"
slowdown = SHOES_SLOWDOWN+1
slowdown = parent_type::slowdown + 1 // Slower than normal
wheels = /obj/vehicle/ridden/scooter/skateboard/wheelys/skishoes
custom_premium_price = PAYCHECK_EASY * 1.6
custom_price = PAYCHECK_EASY * 1.6
6 changes: 3 additions & 3 deletions code/modules/mob/living/carbon/pain.dm
Original file line number Diff line number Diff line change
Expand Up @@ -189,13 +189,13 @@

to_chat(src, result.create_tooltip("Pain is temporary, I will not die on this day! (Shock reduced)"))
shock_stage = max(shock_stage - 15, 0)
stats.set_cooldown("shrug_off_pain", 60 SECONDS)
stats.set_cooldown("shrug_off_pain", 180 SECONDS)
return

if(SUCCESS)
shock_stage = max(shock_stage - 5, 0)
to_chat(src, result.create_tooltip("Not here, not now. (Pain shrugged off)"))
stats.set_cooldown("shrug_off_pain", 30 SECONDS)
stats.set_cooldown("shrug_off_pain", 180 SECONDS)
return

if(FAILURE)
Expand All @@ -205,7 +205,7 @@
if(CRIT_FAILURE)
shock_stage = min(shock_stage + 1, SHOCK_MAXIMUM)
to_chat(src, result.create_tooltip("I'm going to die here. (Shock increased)"))
stats.set_cooldown("shrug_off_pain", 30 SECONDS)
stats.set_cooldown("shrug_off_pain", 60 SECONDS)
// Do not return

shock_stage = min(shock_stage + 1, SHOCK_MAXIMUM)
Expand Down
8 changes: 7 additions & 1 deletion code/modules/mob/status_procs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,21 @@
* Set drowsyness of a mob to passed value
*/
/mob/proc/set_drowsyness(amount)
. = drowsyness
drowsyness = max(amount, 0)

if(!!. != !!drowsyness)
if(drowsyness)
add_movespeed_modifier(/datum/movespeed_modifier/status_effect/drowsy)
else
remove_movespeed_modifier(/datum/movespeed_modifier/status_effect/drowsy)
/**
* Adds passed value to the drowsyness of a mob
*/
/mob/proc/adjust_drowsyness(amount, up_to = INFINITY)
if(amount + drowsyness > up_to)
amount = max(up_to - drowsyness, 0)
drowsyness = max(drowsyness + amount, 0)
set_drowsyness(max(drowsyness + amount, 0))

///Blind a mobs eyes by amount
/mob/proc/blind_eyes(amount)
Expand Down
3 changes: 3 additions & 0 deletions code/modules/movespeed/modifiers/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@

/datum/movespeed_modifier/shock
slowdown = 3
blacklisted_movetypes = FLOATING

/datum/movespeed_modifier/asystole
slowdown = 10
blacklisted_movetypes = FLOATING

/datum/movespeed_modifier/equipment_speedmod
variable = TRUE
Expand Down Expand Up @@ -116,6 +118,7 @@
/datum/movespeed_modifier/living_exhaustion
slowdown = STAMINA_EXHAUSTION_MOVESPEED_SLOWDOWN
flags = IGNORE_NOSLOW

/datum/movespeed_modifier/carbon_crawling
slowdown = CRAWLING_ADD_SLOWDOWN
flags = IGNORE_NOSLOW
Expand Down
7 changes: 7 additions & 0 deletions code/modules/movespeed/modifiers/status_effects.dm
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,10 @@

/datum/movespeed_modifier/status_effect/disorient
slowdown = 1

// technically not a status effect but like, close enough
/datum/movespeed_modifier/status_effect/drowsy
slowdown = 4

/datum/movespeed_modifier/status_effect/holdup
slowdown = 5
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@
C.silent = FALSE
C.remove_status_effect(/datum/status_effect/dizziness)
C.disgust = 0
C.drowsyness = 0
C.set_drowsyness(0)

// Remove all speech related status effects
for(var/effect in typesof(/datum/status_effect/speech))
C.remove_status_effect(effect)
Expand Down
42 changes: 42 additions & 0 deletions code/modules/surgery/bodyparts/parts.dm
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,51 @@

minimum_break_damage = 30

/// Used for inventory procs
var/hand_side
var/fingerprints = ""

/obj/item/bodypart/arm/update_limb(dropping_limb, is_creating)
. = ..()
if(is_creating && owner?.has_dna())
fingerprints = md5(owner.dna.unique_identity)

/obj/item/bodypart/arm/on_life(delta_time, times_fired, stam_heal)
. = ..()
// Splinted, exit
if(splint)
return

// Not broken or dislocated, exit
if(!(bodypart_flags & (BP_BROKEN_BONES|BP_DISLOCATED)))
return

var/obj/target_item
if(hand_side == LEFT_HANDS)
target_item = owner.get_item_for_held_index(1)
else
target_item = owner.get_item_for_held_index(2)

if(isnull(target_item) || !owner.canUnequipItem(target_item))
return

var/zone_name = parse_zone(aux_zone)

if(IS_ORGANIC_LIMB(src))
if(bodypart_flags & BP_NO_PAIN)
owner.visible_message(span_alert("<b>[owner]</b> drops what [owner.p_they()] [p_are()] holding in [owner.p_their()] [zone_name]."))
owner.dropItemToGround(target_item)
return

owner.apply_pain(30, src, "A sharp pain in your [plaintext_zone] forces you to drop your [target_item]!", TRUE, FALSE)
owner.dropItemToGround(target_item)
return . | BODYPART_LIFE_UPDATE_HEALTH_HUD

else
owner.visible_message(span_alert("<b>[owner]</b>'s [zone_name] malfunctions, dropping what [owner.p_they()] [p_are()] holding.."))
owner.dropItemToGround(target_item)
return

/obj/item/bodypart/arm/left
name = "left arm"
desc = "Did you know that the word 'sinister' stems originally from the \
Expand All @@ -115,6 +153,8 @@
amputation_point = "left shoulder"
joint_name = "left elbow"

hand_side = LEFT_HANDS


/obj/item/bodypart/arm/left/set_owner(new_owner)
. = ..()
Expand Down Expand Up @@ -199,6 +239,8 @@
amputation_point = "right shoulder"
joint_name = "right elbow"

hand_side = RIGHT_HANDS

/obj/item/bodypart/arm/right/set_owner(new_owner)
. = ..()
if(. == FALSE)
Expand Down
12 changes: 12 additions & 0 deletions code/modules/surgery/organs/heart.dm
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
return

owner.med_hud_set_health()
update_movespeed()

/obj/item/organ/heart/Remove(mob/living/carbon/heartless, special = 0)
..()
Expand All @@ -59,11 +60,22 @@
pulse = PULSE_NORM
update_appearance(UPDATE_ICON_STATE)
owner?.med_hud_set_health()
update_movespeed()

/obj/item/organ/heart/proc/Stop()
pulse = PULSE_NONE
update_appearance(UPDATE_ICON_STATE)
owner?.med_hud_set_health()
update_movespeed()

/obj/item/organ/heart/proc/update_movespeed()
if(isnull(owner))
return

if(is_working() || !owner.needs_organ(ORGAN_SLOT_HEART))
owner.remove_movespeed_modifier(/datum/movespeed_modifier/asystole)
else
owner.add_movespeed_modifier(/datum/movespeed_modifier/asystole)

/obj/item/organ/heart/proc/stop_if_unowned()
if(!owner)
Expand Down
6 changes: 3 additions & 3 deletions config/game_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ COMMENDATION_PERCENT_POLL 0.05
## To speed things up make the number negative, to slow things down, make the number positive.

## These modify the run/walk speed of all mobs before the mob-specific modifiers are applied.
RUN_DELAY 2.2
WALK_DELAY 4
SPRINT_DELAY 1.4
RUN_DELAY 4
WALK_DELAY 6
SPRINT_DELAY 2

## The variables below affect the movement of specific mob types. THIS AFFECTS ALL SUBTYPES OF THE TYPE YOU CHOOSE!
## Entries completely override all subtypes. Later entries have precedence over earlier entries.
Expand Down
Loading