From 52093c1d486dc17c5d4f00214efcc3f6ed543a29 Mon Sep 17 00:00:00 2001 From: Anewbe Date: Tue, 3 Oct 2017 17:54:56 -0500 Subject: [PATCH] Adjusts checks for turf-slowed movement --- code/modules/clothing/clothing.dm | 3 +++ code/modules/clothing/shoes/boots.dm | 1 + .../mob/living/carbon/human/human_movement.dm | 25 ++++++++++++++++--- .../living/carbon/human/species/species.dm | 5 ++++ .../carbon/human/species/station/seromi.dm | 2 +- .../carbon/human/species/station/station.dm | 5 ++++ 6 files changed, 36 insertions(+), 5 deletions(-) diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index 43e8a17218..80009147ce 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -385,6 +385,9 @@ var/shoes_under_pants = 0 + var/water_speed = 0 //Speed boost/decrease in water, lower/negative values mean more speed + var/snow_speed = 0 //Speed boost/decrease on snow, lower/negative values mean more speed + permeability_coefficient = 0.50 slowdown = SHOES_SLOWDOWN force = 2 diff --git a/code/modules/clothing/shoes/boots.dm b/code/modules/clothing/shoes/boots.dm index d9bf4a7224..0b5e1c7428 100644 --- a/code/modules/clothing/shoes/boots.dm +++ b/code/modules/clothing/shoes/boots.dm @@ -46,6 +46,7 @@ min_cold_protection_temperature = SHOE_MIN_COLD_PROTECTION_TEMPERATURE heat_protection = FEET|LEGS max_heat_protection_temperature = SHOE_MAX_HEAT_PROTECTION_TEMPERATURE + snow_speed = -1 /obj/item/clothing/shoes/boots/winter/security name = "security winter boots" diff --git a/code/modules/mob/living/carbon/human/human_movement.dm b/code/modules/mob/living/carbon/human/human_movement.dm index 7720016611..ac8bdb6fec 100644 --- a/code/modules/mob/living/carbon/human/human_movement.dm +++ b/code/modules/mob/living/carbon/human/human_movement.dm @@ -67,6 +67,27 @@ if(mRun in mutations) tally = 0 + // Turf related slowdown + var/turf/T = get_turf(src) + if(T && T.movement_cost) + var/turf_move_cost = T.movement_cost + if(istype(T, /turf/simulated/floor/water)) + if(species.water_movement) + turf_move_cost = Clamp(-3, turf_move_cost + species.water_movement, 15) + if(shoes) + var/obj/item/clothing/shoes/feet = shoes + if(feet.water_speed) + turf_move_cost = Clamp(-3, turf_move_cost + feet.water_speed, 15) + tally += turf_move_cost + if(istype(T, /turf/simulated/floor/outdoors/snow)) + if(species.snow_movement) + turf_move_cost = Clamp(-3, turf_move_cost + species.snow_movement, 15) + if(shoes) + var/obj/item/clothing/shoes/feet = shoes + if(feet.water_speed) + turf_move_cost = Clamp(-3, turf_move_cost + feet.snow_speed, 15) + tally += turf_move_cost + // Loop through some slots, and add up their slowdowns. Shoes are handled below, unfortunately. // Includes slots which can provide armor, the back slot, and suit storage. for(var/obj/item/I in list(wear_suit, w_uniform, back, gloves, head, s_store)) @@ -82,10 +103,6 @@ var/obj/item/pulled = pulling item_tally += max(pulled.slowdown, 0) - var/turf/T = get_turf(src) - if(T && T.movement_cost) - tally += T.movement_cost - item_tally *= species.item_slowdown_mod tally += item_tally diff --git a/code/modules/mob/living/carbon/human/species/species.dm b/code/modules/mob/living/carbon/human/species/species.dm index 3eea8754c1..1c72d53f13 100644 --- a/code/modules/mob/living/carbon/human/species/species.dm +++ b/code/modules/mob/living/carbon/human/species/species.dm @@ -135,7 +135,12 @@ var/flags = 0 // Various specific features. var/appearance_flags = 0 // Appearance/display related features. var/spawn_flags = 0 // Flags that specify who can spawn as this species + var/slowdown = 0 // Passive movement speed malus (or boost, if negative) + var/water_movement = 0 // How much faster or slower the species is in water + var/snow_movement = 0 // How much faster or slower the species is on snow + + var/item_slowdown_mod = 1 // How affected by item slowdown the species is. var/primitive_form // Lesser form, if any (ie. monkey for humans) var/greater_form // Greater form, if any, ie. human for monkeys. diff --git a/code/modules/mob/living/carbon/human/species/station/seromi.dm b/code/modules/mob/living/carbon/human/species/station/seromi.dm index 2d64d22fac..36d9439277 100644 --- a/code/modules/mob/living/carbon/human/species/station/seromi.dm +++ b/code/modules/mob/living/carbon/human/species/station/seromi.dm @@ -13,7 +13,6 @@ max_age = 45 health_hud_intensity = 3 - male_cough_sounds = list('sound/effects/mob_effects/tesharicougha.ogg','sound/effects/mob_effects/tesharicoughb.ogg') female_cough_sounds = list('sound/effects/mob_effects/tesharicougha.ogg','sound/effects/mob_effects/tesharicoughb.ogg') male_sneeze_sound = 'sound/effects/mob_effects/tesharisneeze.ogg' @@ -35,6 +34,7 @@ fire_icon_state = "generic" // Humanoid is too big for them and spriting a new one is really annoying. slowdown = -1 + snow_movement = -2 // Ignores light snow total_health = 50 brute_mod = 1.35 burn_mod = 1.35 diff --git a/code/modules/mob/living/carbon/human/species/station/station.dm b/code/modules/mob/living/carbon/human/species/station/station.dm index d7073b3529..67fb427ff2 100644 --- a/code/modules/mob/living/carbon/human/species/station/station.dm +++ b/code/modules/mob/living/carbon/human/species/station/station.dm @@ -123,6 +123,7 @@ unarmed_types = list(/datum/unarmed_attack/stomp, /datum/unarmed_attack/kick, /datum/unarmed_attack/claws, /datum/unarmed_attack/bite/sharp) darksight = 8 slowdown = -0.5 + snow_movement = -1 //Ignores half of light snow brute_mod = 1.15 burn_mod = 1.15 flash_mod = 1.1 @@ -198,6 +199,8 @@ name_language = LANGUAGE_SKRELLIAN health_hud_intensity = 2 + water_movement = -3 + min_age = 19 max_age = 130 @@ -250,6 +253,8 @@ unarmed_types = list(/datum/unarmed_attack/stomp, /datum/unarmed_attack/kick, /datum/unarmed_attack/diona) //primitive_form = "Nymph" slowdown = 5 + snow_movement = -2 //Ignore light snow + water_movement = -4 //Ignore shallow water rarity_value = 3 hud_type = /datum/hud_data/diona siemens_coefficient = 0.3