Fixes Movement for Some Mobs

This commit is contained in:
Fox-McCloud
2017-05-28 01:38:29 -04:00
parent 1987522950
commit 8cd77f2935
15 changed files with 111 additions and 97 deletions
@@ -15,6 +15,9 @@
alien_organs += new /obj/item/organ/internal/xenos/resinspinner
..()
/mob/living/carbon/alien/humanoid/drone/movement_delay()
. = ..()
//Drones use the same base as generic humanoids.
//Drone verbs
@@ -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
@@ -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()
@@ -44,6 +42,9 @@
alien_organs += new /obj/item/organ/internal/xenos/neurotoxin
..()
/mob/living/carbon/alien/humanoid/sentinel/movement_delay()
. = ..()
/mob/living/carbon/alien/humanoid/sentinel/handle_regular_hud_updates()
..() //-Yvarov
@@ -6,7 +6,6 @@
icon_state = "alienq_s"
status_flags = CANPARALYSE
mob_size = MOB_SIZE_LARGE
move_delay_add = 3
large = 1
ventcrawler = 0
@@ -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(..())
@@ -28,6 +28,9 @@
alien_organs += new /obj/item/organ/internal/xenos/neurotoxin
..()
/mob/living/carbon/alien/humanoid/queen/movement_delay()
. += 4
. = ..()
/mob/living/carbon/alien/humanoid/queen/handle_regular_hud_updates()
..() //-Yvarov
@@ -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)
@@ -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
@@ -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)
-1
View File
@@ -919,7 +919,6 @@
/mob/living/movement_delay(ignorewalk = 0)
. = ..()
if(isturf(loc))
var/turf/T = loc
. += T.slowdown
@@ -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,19 @@
C.toff = 1
..()
/mob/living/silicon/pai/movement_delay()
. = ..()
. += slowdown
. += 1 //A bit slower than humans, so they're easier to smash
/mob/living/silicon/pai/Process_Spacemove(movement_dir = 0)
. = ..()
if(!.)
slowdown = 2
return TRUE
slowdown = initial(slowdown)
return TRUE
/mob/living/silicon/pai/update_icons()
if(stat == DEAD)
icon_state = "[chassis]_dead"
@@ -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
@@ -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))
@@ -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()
..()
+4 -3
View File
@@ -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