mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-27 06:54:18 +01:00
Sprinting, Stamina and Temporary Modifiers (#1030)
Introduces: - Temporary modifiers process and datums for that - A new stamina and sprinting mechanic. That is in need of further development! Weee!
This commit is contained in:
@@ -179,7 +179,7 @@
|
||||
Process_Incorpmove(direct)
|
||||
return
|
||||
|
||||
if(moving) return 0
|
||||
if(moving) return 0
|
||||
|
||||
if(world.time < move_delay) return
|
||||
|
||||
@@ -209,6 +209,8 @@
|
||||
if(item.zoom)
|
||||
item.zoom()
|
||||
break
|
||||
|
||||
//TODO: REMOVE This stupid zooming stuff
|
||||
/*
|
||||
if(locate(/obj/item/weapon/gun/energy/sniperrifle, mob.contents)) // If mob moves while zoomed in with sniper rifle, unzoom them.
|
||||
var/obj/item/weapon/gun/energy/sniperrifle/s = locate() in mob
|
||||
@@ -257,14 +259,21 @@
|
||||
|
||||
move_delay = world.time//set move delay
|
||||
mob.last_move_intent = world.time + 10
|
||||
switch(mob.m_intent)
|
||||
if("run")
|
||||
if(mob.drowsyness > 0)
|
||||
move_delay += 6
|
||||
move_delay += 1+config.run_speed
|
||||
if("walk")
|
||||
move_delay += 7+config.walk_speed
|
||||
move_delay += mob.movement_delay()
|
||||
if (ishuman(mob))
|
||||
|
||||
var/mob/living/carbon/human/H = mob
|
||||
var/tally = mob.movement_delay()+config.walk_speed
|
||||
//If we're sprinting and able to continue sprinting, then apply the sprint bonus ontop of this
|
||||
if (H.m_intent == "run" && H.species.handle_sprint_cost(H, tally))//This will return false if we collapse from exhaustion
|
||||
tally = tally/(1+H.sprint_speed_factor)
|
||||
else
|
||||
tally = max(tally, H.min_walk_delay)//clamp walking speed if its limited
|
||||
move_delay += tally
|
||||
|
||||
else
|
||||
move_delay += config.walk_speed
|
||||
move_delay += mob.movement_delay()
|
||||
|
||||
|
||||
var/tickcomp = 0 //moved this out here so we can use it for vehicles
|
||||
if(config.Tickcomp)
|
||||
@@ -272,10 +281,11 @@
|
||||
tickcomp = ((1/(world.tick_lag))*1.3) - 1.3
|
||||
move_delay = move_delay + tickcomp
|
||||
|
||||
|
||||
if(istype(mob.buckled, /obj/vehicle))
|
||||
//manually set move_delay for vehicles so we don't inherit any mob movement penalties
|
||||
//specific vehicle move delays are set in code\modules\vehicles\vehicle.dm
|
||||
move_delay = world.time + tickcomp
|
||||
move_delay = world.time
|
||||
//drunk driving
|
||||
if(mob.confused && prob(20))
|
||||
direct = pick(cardinal)
|
||||
@@ -351,7 +361,6 @@
|
||||
G.adjust_position()
|
||||
|
||||
moving = 0
|
||||
|
||||
return .
|
||||
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user