mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-17 10:03:50 +01:00
Adds movement intents
This commit is contained in:
@@ -97,6 +97,10 @@
|
||||
#define INTENT_GRAB "grab"
|
||||
#define INTENT_HARM "harm"
|
||||
|
||||
// Movement Intents
|
||||
#define MOVE_INTENT_WALK "walk"
|
||||
#define MOVE_INTENT_RUN "run"
|
||||
|
||||
// AI wire/radio settings
|
||||
#define AI_CHECK_WIRELESS 1
|
||||
#define AI_CHECK_RADIO 2
|
||||
|
||||
@@ -41,14 +41,14 @@
|
||||
static_inventory += using
|
||||
|
||||
using = new /obj/screen/act_intent/alien()
|
||||
using.icon_state = (mymob.a_intent == "hurt" ? "harm" : mymob.a_intent)
|
||||
using.icon_state = (mymob.a_intent == "hurt" ? INTENT_HARM : mymob.a_intent)
|
||||
using.screen_loc = ui_acti
|
||||
static_inventory += using
|
||||
action_intent = using
|
||||
|
||||
using = new /obj/screen/mov_intent()
|
||||
using.icon = 'icons/mob/screen_alien.dmi'
|
||||
using.icon_state = (mymob.m_intent == "run" ? "running" : "walking")
|
||||
using.icon_state = (mymob.m_intent == MOVE_INTENT_RUN ? "running" : "walking")
|
||||
using.screen_loc = ui_movi
|
||||
static_inventory += using
|
||||
move_intent = using
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
using = new /obj/screen/mov_intent()
|
||||
using.icon = 'icons/mob/screen_alien.dmi'
|
||||
using.icon_state = (mymob.m_intent == "run" ? "running" : "walking")
|
||||
using.icon_state = (mymob.m_intent == MOVE_INTENT_RUN ? "running" : "walking")
|
||||
static_inventory += using
|
||||
move_intent = using
|
||||
|
||||
@@ -36,4 +36,4 @@
|
||||
|
||||
mymob.zone_sel = new /obj/screen/zone_sel/alien()
|
||||
mymob.zone_sel.update_icon(mymob)
|
||||
static_inventory += mymob.zone_sel
|
||||
static_inventory += mymob.zone_sel
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
|
||||
using = new /obj/screen/mov_intent()
|
||||
using.icon = ui_style
|
||||
using.icon_state = (mymob.m_intent == "run" ? "running" : "walking")
|
||||
using.icon_state = (mymob.m_intent == MOVE_INTENT_RUN ? "running" : "walking")
|
||||
using.screen_loc = ui_movi
|
||||
using.color = ui_color
|
||||
using.alpha = ui_alpha
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
using = new /obj/screen/mov_intent()
|
||||
using.icon = ui_style
|
||||
using.icon_state = (mymob.m_intent == "run" ? "running" : "walking")
|
||||
using.icon_state = (mymob.m_intent == MOVE_INTENT_RUN ? "running" : "walking")
|
||||
using.screen_loc = ui_movi
|
||||
using.color = ui_color
|
||||
using.alpha = ui_alpha
|
||||
|
||||
@@ -199,15 +199,15 @@
|
||||
var/mob/living/carbon/C = usr
|
||||
if(C.legcuffed)
|
||||
to_chat(C, "<span class='notice'>You are legcuffed! You cannot run until you get [C.legcuffed] removed!</span>")
|
||||
C.m_intent = "walk" //Just incase
|
||||
C.m_intent = MOVE_INTENT_WALK //Just incase
|
||||
C.hud_used.move_intent.icon_state = "walking"
|
||||
return 1
|
||||
switch(usr.m_intent)
|
||||
if("run")
|
||||
usr.m_intent = "walk"
|
||||
if(MOVE_INTENT_RUN)
|
||||
usr.m_intent = MOVE_INTENT_WALK
|
||||
usr.hud_used.move_intent.icon_state = "walking"
|
||||
if("walk")
|
||||
usr.m_intent = "run"
|
||||
if(MOVE_INTENT_WALK)
|
||||
usr.m_intent = MOVE_INTENT_RUN
|
||||
usr.hud_used.move_intent.icon_state = "running"
|
||||
if(istype(usr,/mob/living/carbon/alien/humanoid))
|
||||
usr.update_icons()
|
||||
|
||||
@@ -307,7 +307,7 @@
|
||||
|
||||
var/mob/living/L = A
|
||||
if(!L.ckey) return
|
||||
if((oldarea.has_gravity == 0) && (newarea.has_gravity == 1) && (L.m_intent == "run")) // Being ready when you change areas gives you a chance to avoid falling all together.
|
||||
if((oldarea.has_gravity == 0) && (newarea.has_gravity == 1) && (L.m_intent == MOVE_INTENT_RUN)) // Being ready when you change areas gives you a chance to avoid falling all together.
|
||||
thunk(L)
|
||||
|
||||
// Ambience goes down here -- make sure to list each area seperately for ease of adding things in later, thanks! Note: areas adjacent to each other should have the same sounds to prevent cutoff when possible.- LastyScratch
|
||||
@@ -344,7 +344,7 @@
|
||||
if(istype(get_turf(M), /turf/space)) // Can't fall onto nothing.
|
||||
return
|
||||
|
||||
if((istype(M,/mob/living/carbon/human/)) && (M.m_intent == "run")).
|
||||
if((istype(M,/mob/living/carbon/human/)) && (M.m_intent == MOVE_INTENT_RUN)).
|
||||
M.Stun(5)
|
||||
M.Weaken(5)
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
/obj/machinery/flasher/attack_ai(mob/user)
|
||||
if(anchored)
|
||||
return flash()
|
||||
|
||||
|
||||
/obj/machinery/flasher/attack_ghost(mob/user)
|
||||
if(anchored && user.can_advanced_admin_interact())
|
||||
return flash()
|
||||
@@ -92,7 +92,7 @@
|
||||
|
||||
if(istype(AM, /mob/living/carbon))
|
||||
var/mob/living/carbon/M = AM
|
||||
if((M.m_intent != "walk") && (anchored))
|
||||
if((M.m_intent != MOVE_INTENT_WALK) && (anchored))
|
||||
flash()
|
||||
|
||||
/obj/machinery/flasher/portable/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
|
||||
@@ -119,11 +119,11 @@
|
||||
anchored = 1.0
|
||||
use_power = 1
|
||||
idle_power_usage = 2
|
||||
active_power_usage = 4
|
||||
|
||||
active_power_usage = 4
|
||||
|
||||
/obj/machinery/flasher_button/attack_ai(mob/user as mob)
|
||||
return attack_hand(user)
|
||||
|
||||
|
||||
/obj/machinery/flasher_button/attack_ghost(mob/user)
|
||||
if(user.can_advanced_admin_interact())
|
||||
return attack_hand(user)
|
||||
@@ -150,4 +150,4 @@
|
||||
sleep(50)
|
||||
|
||||
icon_state = "launcherbtt"
|
||||
active = 0
|
||||
active = 0
|
||||
|
||||
@@ -283,7 +283,7 @@
|
||||
/obj/item/toy/snappop/Crossed(H as mob|obj)
|
||||
if(ishuman(H) || issilicon(H)) //i guess carp and shit shouldn't set them off
|
||||
var/mob/living/carbon/M = H
|
||||
if(issilicon(H) || M.m_intent == "run")
|
||||
if(issilicon(H) || M.m_intent == MOVE_INTENT_RUN)
|
||||
to_chat(M, "<span class='danger'>You step on the snap pop!</span>")
|
||||
pop_burst(2, 0)
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
if(armed)
|
||||
if(istype(AM, /mob/living/carbon) && !istype(AM, /mob/living/carbon/brain))
|
||||
var/mob/living/carbon/C = AM
|
||||
if(C.m_intent != "walk")
|
||||
if(C.m_intent != MOVE_INTENT_WALK)
|
||||
src.visible_message("The [src.name] beeps, \"Running on wet floors is hazardous to your health.\"")
|
||||
explosion(src.loc,-1,0,2)
|
||||
if(ishuman(C))
|
||||
|
||||
@@ -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