mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-19 02:54:41 +01:00
Adds movement intents
This commit is contained in:
@@ -101,7 +101,7 @@
|
||||
if(armed)
|
||||
if(ishuman(AM))
|
||||
var/mob/living/carbon/H = AM
|
||||
if(H.m_intent == "run")
|
||||
if(H.m_intent == MOVE_INTENT_RUN)
|
||||
triggered(H)
|
||||
H.visible_message("<span class='warning'>[H] accidentally steps on [src].</span>", \
|
||||
"<span class='warning'>You accidentally step on [src]</span>")
|
||||
|
||||
@@ -421,7 +421,7 @@ BLIND // can't see anything
|
||||
if(!istype(H) || !istype(T))
|
||||
return 0
|
||||
|
||||
if(H.m_intent == "run")
|
||||
if(H.m_intent == MOVE_INTENT_RUN)
|
||||
if(shoe_sound_footstep >= 2)
|
||||
if(T.shoe_running_volume)
|
||||
playsound(src, shoe_sound, T.shoe_running_volume, 1)
|
||||
|
||||
@@ -273,7 +273,7 @@ Des: Removes all infected images from the alien.
|
||||
if(T.footstep_sounds["xeno"])
|
||||
var/S = pick(T.footstep_sounds["xeno"])
|
||||
if(S)
|
||||
if(m_intent == "run")
|
||||
if(m_intent == MOVE_INTENT_RUN)
|
||||
if(!(step_count % 2)) //every other turf makes a sound
|
||||
return 0
|
||||
|
||||
@@ -281,7 +281,7 @@ Des: Removes all infected images from the alien.
|
||||
range -= 0.666 //-(7 - 2) = (-5) = -5 | -5 - (0.666) = -5.666 | (7 + -5.666) = 1.334 | 1.334 * 3 = 4.002 | range(4.002) = range(4)
|
||||
var/volume = 5
|
||||
|
||||
if(m_intent == "walk")
|
||||
if(m_intent == MOVE_INTENT_WALK)
|
||||
return 0 //silent when walking
|
||||
|
||||
if(buckled || lying || throwing)
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
|
||||
|
||||
/mob/living/carbon/alien/humanoid/hunter/handle_environment()
|
||||
if(m_intent == "run" || resting)
|
||||
if(m_intent == MOVE_INTENT_RUN || resting)
|
||||
..()
|
||||
else
|
||||
adjustPlasma(-heal_rate)
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
else if(lying || resting)
|
||||
icon_state = "alien[caste]_sleep"
|
||||
else if(m_intent == "run")
|
||||
else if(m_intent == MOVE_INTENT_RUN)
|
||||
icon_state = "alien[caste]_running"
|
||||
else
|
||||
icon_state = "alien[caste]_s"
|
||||
|
||||
@@ -34,9 +34,9 @@
|
||||
if(.)
|
||||
if(nutrition && stat != DEAD)
|
||||
nutrition -= hunger_drain / 10
|
||||
if(m_intent == "run")
|
||||
if(m_intent == MOVE_INTENT_RUN)
|
||||
nutrition -= hunger_drain / 10
|
||||
if((FAT in mutations) && m_intent == "run" && bodytemperature <= 360)
|
||||
if((FAT in mutations) && m_intent == MOVE_INTENT_RUN && bodytemperature <= 360)
|
||||
bodytemperature += 2
|
||||
|
||||
// Moving around increases germ_level faster
|
||||
@@ -936,7 +936,7 @@ var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/unary/vent_pump,
|
||||
|
||||
|
||||
/mob/living/carbon/proc/slip(var/description, var/stun, var/weaken, var/tilesSlipped, var/walkSafely, var/slipAny)
|
||||
if(flying || buckled || (walkSafely && m_intent == "walk"))
|
||||
if(flying || buckled || (walkSafely && m_intent == MOVE_INTENT_WALK))
|
||||
return 0
|
||||
if((lying) && (!(tilesSlipped)))
|
||||
return 0
|
||||
|
||||
@@ -47,12 +47,12 @@
|
||||
if(T.footstep_sounds["human"])
|
||||
var/S = pick(T.footstep_sounds["human"])
|
||||
if(S)
|
||||
if(m_intent == "run")
|
||||
if(m_intent == MOVE_INTENT_RUN)
|
||||
if(!(step_count % 2)) //every other turf makes a sound
|
||||
return 0
|
||||
|
||||
var/range = -(world.view - 2)
|
||||
if(m_intent == "walk")
|
||||
if(m_intent == MOVE_INTENT_WALK)
|
||||
range -= 0.333
|
||||
if(!shoes)
|
||||
range -= 0.333
|
||||
@@ -65,7 +65,7 @@
|
||||
//-(7 - 2) = (-5) = -5 | -5 - (0.333 * 2) = -5.666 | (7 + -5.666) = 1.334 | 1.334 * 3 = 4.002 | range(4.002) = range(4)
|
||||
|
||||
var/volume = 13
|
||||
if(m_intent == "walk")
|
||||
if(m_intent == MOVE_INTENT_WALK)
|
||||
volume -= 4
|
||||
if(!shoes)
|
||||
volume -= 4
|
||||
@@ -91,4 +91,4 @@
|
||||
playsound(T, S, volume, 1, range)
|
||||
return 1
|
||||
|
||||
return 0
|
||||
return 0
|
||||
|
||||
@@ -1092,8 +1092,8 @@ var/global/list/damage_icon_parts = list()
|
||||
if(legcuffed)
|
||||
overlays_standing[LEGCUFF_LAYER] = image("icon" = 'icons/mob/mob.dmi', "icon_state" = "legcuff1")
|
||||
throw_alert("legcuffed", /obj/screen/alert/restrained/legcuffed, new_master = legcuffed)
|
||||
if(m_intent != "walk")
|
||||
m_intent = "walk"
|
||||
if(m_intent != MOVE_INTENT_WALK)
|
||||
m_intent = MOVE_INTENT_WALK
|
||||
if(hud_used && hud_used.move_intent)
|
||||
hud_used.move_intent.icon_state = "walking"
|
||||
|
||||
|
||||
@@ -937,11 +937,11 @@
|
||||
. += config.run_speed
|
||||
else
|
||||
switch(m_intent)
|
||||
if("run")
|
||||
if(MOVE_INTENT_RUN)
|
||||
if(drowsyness > 0)
|
||||
. += 6
|
||||
. += config.run_speed
|
||||
if("walk")
|
||||
if(MOVE_INTENT_WALK)
|
||||
. += config.walk_speed
|
||||
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
var/intent = null//Living
|
||||
var/shakecamera = 0
|
||||
var/a_intent = INTENT_HELP//Living
|
||||
var/m_intent = "run"//Living
|
||||
var/m_intent = MOVE_INTENT_RUN//Living
|
||||
var/lastKnownIP = null
|
||||
var/atom/movable/buckled = null//Living
|
||||
var/obj/item/l_hand = null//Living
|
||||
@@ -196,5 +196,5 @@
|
||||
var/list/permanent_huds = list()
|
||||
|
||||
var/list/actions = list()
|
||||
|
||||
|
||||
var/list/progressbars = null //for stacking do_after bars
|
||||
|
||||
@@ -70,11 +70,11 @@
|
||||
// a reasonable approximation of movement speed
|
||||
var/mob_speed = M.movement_delay()
|
||||
switch(M.m_intent)
|
||||
if("run")
|
||||
if(MOVE_INTENT_RUN)
|
||||
if(M.drowsyness > 0)
|
||||
mob_speed += 6
|
||||
mob_speed += config.run_speed - 1
|
||||
if("walk")
|
||||
if(MOVE_INTENT_WALK)
|
||||
mob_speed += config.walk_speed - 1
|
||||
mob_speed = BASE_MOVE_DELAY / max(1, BASE_MOVE_DELAY + mob_speed)
|
||||
speed = min(speed + inertia * mob_speed, mob_speed)
|
||||
|
||||
@@ -305,8 +305,8 @@ var/static/regex/multispin_words = regex("like a record baby")
|
||||
else if((findtext(message, walk_words)))
|
||||
for(var/V in listeners)
|
||||
var/mob/living/L = V
|
||||
if(L.m_intent != "walk")
|
||||
L.m_intent = "walk"
|
||||
if(L.m_intent != MOVE_INTENT_WALK)
|
||||
L.m_intent = MOVE_INTENT_WALK
|
||||
if(L.hud_used)
|
||||
L.hud_used.move_intent.icon_state = "walking"
|
||||
next_command = world.time + cooldown_meme
|
||||
@@ -315,8 +315,8 @@ var/static/regex/multispin_words = regex("like a record baby")
|
||||
else if((findtext(message, run_words)))
|
||||
for(var/V in listeners)
|
||||
var/mob/living/L = V
|
||||
if(L.m_intent != "run")
|
||||
L.m_intent = "run"
|
||||
if(L.m_intent != MOVE_INTENT_RUN)
|
||||
L.m_intent = MOVE_INTENT_RUN
|
||||
if(L.hud_used)
|
||||
L.hud_used.move_intent.icon_state = "running"
|
||||
next_command = world.time + cooldown_meme
|
||||
@@ -452,4 +452,4 @@ var/static/regex/multispin_words = regex("like a record baby")
|
||||
next_command = world.time + cooldown_none
|
||||
|
||||
message_admins("[key_name_admin(owner)] has said '[log_message]' with a Voice of God, affecting [english_list(listeners)], with a power multiplier of [power_multiplier].")
|
||||
log_game("[key_name(owner)] has said '[log_message]' with a Voice of God, affecting [english_list(listeners)], with a power multiplier of [power_multiplier].")
|
||||
log_game("[key_name(owner)] has said '[log_message]' with a Voice of God, affecting [english_list(listeners)], with a power multiplier of [power_multiplier].")
|
||||
|
||||
Reference in New Issue
Block a user