diff --git a/code/modules/mob/living/carbon/alien/humanoid/caste/hunter.dm b/code/modules/mob/living/carbon/alien/humanoid/caste/hunter.dm index cdd1b55bcf9..3782806db33 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/caste/hunter.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/caste/hunter.dm @@ -13,6 +13,10 @@ alien_organs += new /obj/item/organ/internal/xenos/plasmavessel/hunter ..() +/mob/living/carbon/alien/humanoid/hunter/movement_delay() + . = -1 //hunters are sanic + . += ..() //but they still need to slow down on stun + /mob/living/carbon/alien/humanoid/hunter/handle_regular_hud_updates() ..() //-Yvarov diff --git a/code/modules/mob/living/carbon/alien/humanoid/caste/sentinel.dm b/code/modules/mob/living/carbon/alien/humanoid/caste/sentinel.dm index 8d8f8894234..6a9565fc449 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/caste/sentinel.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/caste/sentinel.dm @@ -12,14 +12,12 @@ pixel_x = -16 maxHealth = 200 health = 200 - move_delay_add = 1 large = 1 /mob/living/carbon/alien/humanoid/sentinel/praetorian name = "alien praetorian" maxHealth = 200 health = 200 - move_delay_add = 1 large = 1 /mob/living/carbon/alien/humanoid/sentinel/large/update_icons() diff --git a/code/modules/mob/living/carbon/alien/humanoid/empress.dm b/code/modules/mob/living/carbon/alien/humanoid/empress.dm index 287974b610f..7db3ea5b1c5 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/empress.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/empress.dm @@ -6,7 +6,6 @@ icon_state = "alienq_s" status_flags = CANPARALYSE mob_size = MOB_SIZE_LARGE - move_delay_add = 3 large = 1 ventcrawler = 0 diff --git a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm index 735b4ccb777..fff315c90e3 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm @@ -26,16 +26,8 @@ /mob/living/carbon/alien/humanoid/movement_delay() - var/tally = 0 - if(istype(src, /mob/living/carbon/alien/humanoid/queen)) - tally += 4 - if(istype(src, /mob/living/carbon/alien/humanoid/drone)) - tally += 0 - if(istype(src, /mob/living/carbon/alien/humanoid/sentinel)) - tally += 0 - if(istype(src, /mob/living/carbon/alien/humanoid/hunter)) - tally = -2 // hunters go supersuperfast - return (tally + move_delay_add + config.alien_delay) + . = ..() + . += move_delay_add + config.alien_delay //move_delay_add is used to slow aliens with stuns /mob/living/carbon/alien/humanoid/Process_Spacemove(var/check_drift = 0) if(..()) diff --git a/code/modules/mob/living/carbon/alien/humanoid/queen.dm b/code/modules/mob/living/carbon/alien/humanoid/queen.dm index 11914d3c0ee..a8f17714b0e 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/queen.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/queen.dm @@ -28,6 +28,9 @@ alien_organs += new /obj/item/organ/internal/xenos/neurotoxin ..() +/mob/living/carbon/alien/humanoid/queen/movement_delay() + . = ..() + . += 3 /mob/living/carbon/alien/humanoid/queen/handle_regular_hud_updates() ..() //-Yvarov diff --git a/code/modules/mob/living/carbon/human/human_movement.dm b/code/modules/mob/living/carbon/human/human_movement.dm index c65e5f70f99..87176a7a02a 100644 --- a/code/modules/mob/living/carbon/human/human_movement.dm +++ b/code/modules/mob/living/carbon/human/human_movement.dm @@ -1,75 +1,8 @@ /mob/living/carbon/human/movement_delay() . = 0 . += ..() - - var/gravity = 1 - - if(!has_gravity(src)) - gravity = 0 - - if(flying) - gravity = 0 - - if(embedded_flag) - handle_embedded_objects() //Moving with objects stuck in you can cause bad times. - - if(slowed) - . += 10 - - if(gravity) - if(species.slowdown) - . = species.slowdown - - var/health_deficiency = (maxHealth - health + staminaloss) - if(reagents) - for(var/datum/reagent/R in reagents.reagent_list) - if(R.shock_reduction) - health_deficiency -= R.shock_reduction - if(health_deficiency >= 40) - . += (health_deficiency / 25) - - var/hungry = (500 - nutrition)/5 // So overeat would be 100 and default level would be 80 - if(hungry >= 70) - . += hungry/50 - - if(wear_suit) - . += wear_suit.slowdown - - if(!buckled) - if(shoes) - . += shoes.slowdown - - if(shock_stage >= 10) - . += 3 - - if(back) - . += back.slowdown - - if(l_hand && (l_hand.flags & HANDSLOW)) - . += l_hand.slowdown - if(r_hand && (r_hand.flags & HANDSLOW)) - . += r_hand.slowdown - - if(FAT in src.mutations) - . += 1.5 - - if(bodytemperature < BODYTEMP_COLD_DAMAGE_LIMIT) - . += (BODYTEMP_COLD_DAMAGE_LIMIT - bodytemperature) / COLD_SLOWDOWN_FACTOR - - . += 2 * stance_damage //damaged/missing feet or legs is slow - - if(RUN in mutations) - . = -1 - - if(status_flags & IGNORESLOWDOWN) // make sure this is always at the end so we don't have ignore slowdown getting ignored itself - . = -1 - - if(status_flags & GOTTAGOFAST) - . -= 1 - if(status_flags & GOTTAGOREALLYFAST) - . -= 2 - . += config.human_delay + . += species.movement_delay(src) /mob/living/carbon/human/Process_Spacemove(movement_dir = 0) diff --git a/code/modules/mob/living/carbon/human/species/species.dm b/code/modules/mob/living/carbon/human/species/species.dm index d2d44757705..c1d1a169c1d 100644 --- a/code/modules/mob/living/carbon/human/species/species.dm +++ b/code/modules/mob/living/carbon/human/species/species.dm @@ -380,6 +380,72 @@ if(heat_level_3_breathe to INFINITY) H.apply_damage(hot_env_multiplier*HEAT_GAS_DAMAGE_LEVEL_3, BURN, "head", used_weapon = "Excessive Heat") +//////////////// +// MOVE SPEED // +//////////////// + +/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.flying) + flight = 1 + + if((H.status_flags & IGNORESLOWDOWN) || (RUN in H.mutations)) + ignoreslow = 1 + + if(has_gravity(H)) + gravity = 1 + + if(H.embedded_flag) + H.handle_embedded_objects() //Moving with objects stuck in you can cause bad times. + + if(!ignoreslow && gravity) + if(slowdown) + . = slowdown + + if(H.wear_suit) + . += H.wear_suit.slowdown + if(!H.buckled) + if(H.shoes) + . += H.shoes.slowdown + if(H.back) + . += H.back.slowdown + if(H.l_hand && (H.l_hand.flags & HANDSLOW)) + . += H.l_hand.slowdown + if(H.r_hand && (H.r_hand.flags & HANDSLOW)) + . += H.r_hand.slowdown + + var/health_deficiency = (H.maxHealth - H.health + H.staminaloss) + var/hungry = (500 - H.nutrition)/5 // So overeat would be 100 and default level would be 80 + if(H.reagents) + for(var/datum/reagent/R in H.reagents.reagent_list) + if(R.shock_reduction) + health_deficiency -= R.shock_reduction + if(health_deficiency >= 40) + if(flight) + . += (health_deficiency / 75) + else + . += (health_deficiency / 25) + if(H.shock_stage >= 10) + . += 3 + . += 2 * H.stance_damage //damaged/missing feet or legs is slow + + if((hungry >= 70) && !flight) + . += hungry/50 + if(FAT in H.mutations) + . += (1.5 - flight) + if(H.bodytemperature < BODYTEMP_COLD_DAMAGE_LIMIT) + . += (BODYTEMP_COLD_DAMAGE_LIMIT - H.bodytemperature) / COLD_SLOWDOWN_FACTOR + + if(H.status_flags & GOTTAGOFAST) + . -= 1 + if(H.status_flags & GOTTAGOREALLYFAST) + . -= 2 + return . + /datum/species/proc/handle_post_spawn(var/mob/living/carbon/C) //Handles anything not already covered by basic species assignment. grant_abilities(C) return diff --git a/code/modules/mob/living/carbon/slime/slime.dm b/code/modules/mob/living/carbon/slime/slime.dm index 9031a77311c..85fed33c156 100644 --- a/code/modules/mob/living/carbon/slime/slime.dm +++ b/code/modules/mob/living/carbon/slime/slime.dm @@ -83,10 +83,11 @@ if(bodytemperature >= 330.23) // 135 F return -1 // slimes become supercharged at high temperatures - . = ..(1) + . = ..() var/health_deficiency = (100 - health) - if(health_deficiency >= 45) . += (health_deficiency / 25) + if(health_deficiency >= 45) + . += (health_deficiency / 25) if(bodytemperature < 183.222) . += (283.222 - bodytemperature) / 10 * 1.75 @@ -101,7 +102,7 @@ if(health <= 0) // if damaged, the slime moves twice as slow . *= 2 - return . + config.slime_delay + . += config.slime_delay /mob/living/carbon/slime/ObjBump(obj/O) if(!client && powerlevel > 0) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 5e1dab9874b..6fd8a08e1e1 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -919,7 +919,6 @@ /mob/living/movement_delay(ignorewalk = 0) . = ..() - if(isturf(loc)) var/turf/T = loc . += T.slowdown diff --git a/code/modules/mob/living/silicon/pai/pai.dm b/code/modules/mob/living/silicon/pai/pai.dm index 202984fd14e..3f1799c7c9f 100644 --- a/code/modules/mob/living/silicon/pai/pai.dm +++ b/code/modules/mob/living/silicon/pai/pai.dm @@ -82,6 +82,7 @@ var/current_pda_messaging = null var/custom_sprite = 0 + var/slowdown = 0 /mob/living/silicon/pai/New(var/obj/item/device/paicard) loc = paicard @@ -117,6 +118,12 @@ C.toff = 1 ..() +/mob/living/silicon/pai/movement_delay() + . = ..() + . += slowdown + . += 1 //A bit slower than humans, so they're easier to smash + . += config.robot_delay + /mob/living/silicon/pai/update_icons() if(stat == DEAD) icon_state = "[chassis]_dead" diff --git a/code/modules/mob/living/silicon/robot/robot_movement.dm b/code/modules/mob/living/silicon/robot/robot_movement.dm index 5ccc6e9585c..e896e7c9473 100644 --- a/code/modules/mob/living/silicon/robot/robot_movement.dm +++ b/code/modules/mob/living/silicon/robot/robot_movement.dm @@ -7,14 +7,11 @@ //No longer needed, but I'll leave it here incase we plan to re-use it. /mob/living/silicon/robot/movement_delay() - . = ..(1) //Incase I need to add stuff other than "speed" later - + . = ..() . += speed - if(module_active && istype(module_active,/obj/item/borg/combat/mobility)) . -= 3 - - return . + config.robot_delay + . += config.robot_delay /mob/living/silicon/robot/mob_negates_gravity() return magpulse diff --git a/code/modules/mob/living/simple_animal/friendly/sloth.dm b/code/modules/mob/living/simple_animal/friendly/sloth.dm index 1066b2a0d39..bf12b07de2e 100644 --- a/code/modules/mob/living/simple_animal/friendly/sloth.dm +++ b/code/modules/mob/living/simple_animal/friendly/sloth.dm @@ -21,7 +21,7 @@ melee_damage_upper = 18 health = 50 maxHealth = 50 - speed = 1 + speed = 2 //Cargo Sloth diff --git a/code/modules/mob/living/simple_animal/hostile/faithless.dm b/code/modules/mob/living/simple_animal/hostile/faithless.dm index a14efc6d279..35926a602f2 100644 --- a/code/modules/mob/living/simple_animal/hostile/faithless.dm +++ b/code/modules/mob/living/simple_animal/hostile/faithless.dm @@ -22,7 +22,6 @@ atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0) minbodytemp = 0 - speed = 4 faction = list("faithless") gold_core_spawnable = CHEM_MOB_SPAWN_HOSTILE diff --git a/code/modules/mob/living/simple_animal/hostile/retaliate/undead.dm b/code/modules/mob/living/simple_animal/hostile/retaliate/undead.dm index 66972b06d2e..e5beb60097e 100644 --- a/code/modules/mob/living/simple_animal/hostile/retaliate/undead.dm +++ b/code/modules/mob/living/simple_animal/hostile/retaliate/undead.dm @@ -31,7 +31,7 @@ response_disarm = "shoves" response_harm = "hits" turns_per_move = 10 - speed = -1 + speed = 0 maxHealth = 20 health = 20 @@ -74,7 +74,7 @@ response_help = "shakes hands with" response_disarm = "shoves" response_harm = "hits" - speed = -1 + speed = 0 maxHealth = 20 health = 20 diff --git a/code/modules/mob/living/simple_animal/parrot.dm b/code/modules/mob/living/simple_animal/parrot.dm index bd484903aa9..de27a2173c3 100644 --- a/code/modules/mob/living/simple_animal/parrot.dm +++ b/code/modules/mob/living/simple_animal/parrot.dm @@ -505,7 +505,8 @@ /mob/living/simple_animal/parrot/movement_delay() if(client && stat == CONSCIOUS && parrot_state != "parrot_fly") icon_state = "parrot_fly" - ..() + //Because the most appropriate place to set icon_state is movement_delay(), clearly + return ..() /mob/living/simple_animal/parrot/proc/search_for_item() for(var/atom/movable/AM in view(src)) diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index bd6ed65a979..1aa6c82b4a8 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -434,11 +434,11 @@ /mob/living/simple_animal/movement_delay() - var/tally = 0 //Incase I need to add stuff other than "speed" later + . = ..() - tally = speed + . = speed - return tally+config.animal_delay + . += config.animal_delay /mob/living/simple_animal/Stat() ..() diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 99d7a7a1fa6..cb86d417fbc 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -1008,9 +1008,10 @@ var/list/slot_equipment_priority = list( \ drop_l_hand() drop_r_hand() -/mob/proc/facedir(var/ndir) - if(!canface()) return 0 - dir = ndir +/mob/proc/facedir(ndir) + if(!canface()) + return 0 + setDir(ndir) client.move_delay += movement_delay() return 1