sprint updates
@@ -118,27 +118,7 @@
|
||||
action_intent.hud = src
|
||||
static_inventory += action_intent
|
||||
|
||||
using = new /obj/screen/mov_intent
|
||||
using.icon = tg_ui_icon_to_cit_ui(ui_style) // CIT CHANGE - overrides mov intent icon
|
||||
using.icon_state = (mymob.m_intent == MOVE_INTENT_RUN ? "running" : "walking")
|
||||
using.screen_loc = ui_movi
|
||||
using.hud = src
|
||||
static_inventory += using
|
||||
|
||||
//CITADEL CHANGES - sprint button
|
||||
using = new /obj/screen/sprintbutton
|
||||
using.icon = tg_ui_icon_to_cit_ui(ui_style)
|
||||
using.icon_state = ((owner.combat_flags & COMBAT_FLAG_SPRINT_ACTIVE) ? "act_sprint_on" : "act_sprint")
|
||||
using.screen_loc = ui_movi
|
||||
using.hud = src
|
||||
static_inventory += using
|
||||
//END OF CITADEL CHANGES
|
||||
|
||||
//same as above but buffer.
|
||||
sprint_buffer = new /obj/screen/sprint_buffer
|
||||
sprint_buffer.screen_loc = ui_sprintbufferloc
|
||||
sprint_buffer.hud = src
|
||||
static_inventory += sprint_buffer
|
||||
assert_move_intent_ui()
|
||||
|
||||
// clickdelay
|
||||
clickdelay = new
|
||||
@@ -393,6 +373,42 @@
|
||||
|
||||
update_locked_slots()
|
||||
|
||||
/datum/hud/human/assert_move_intent_ui()
|
||||
// delete old ones
|
||||
var/list/obj/screen/victim += list()
|
||||
victims += locate(/obj/screen/mov_intent) in static_inventory
|
||||
victims += locate(/obj/screen/sprintbutton) in static_inventory
|
||||
victims += locate(/obj/screen/sprint_buffer) in sttatic_inventory
|
||||
if(victims)
|
||||
QDEL_LIST(victims)
|
||||
static_inventory -= victims
|
||||
|
||||
// make new ones
|
||||
using = new /obj/screen/mov_intent
|
||||
using.icon = tg_ui_icon_to_cit_ui(ui_style) // CIT CHANGE - overrides mov intent icon
|
||||
using.screen_loc = ui_movi
|
||||
using.hud = src
|
||||
using.update_icon()
|
||||
static_inventory += using
|
||||
|
||||
if(!CONFIG_GET(flag/sprint_enabled))
|
||||
return
|
||||
|
||||
//CITADEL CHANGES - sprint button
|
||||
using = new /obj/screen/sprintbutton
|
||||
using.icon = tg_ui_icon_to_cit_ui(ui_style)
|
||||
using.icon_state = ((owner.combat_flags & COMBAT_FLAG_SPRINT_ACTIVE) ? "act_sprint_on" : "act_sprint")
|
||||
using.screen_loc = ui_movi
|
||||
using.hud = src
|
||||
static_inventory += using
|
||||
//END OF CITADEL CHANGES
|
||||
|
||||
//same as above but buffer.
|
||||
sprint_buffer = new /obj/screen/sprint_buffer
|
||||
sprint_buffer.screen_loc = ui_sprintbufferloc
|
||||
sprint_buffer.hud = src
|
||||
static_inventory += sprint_buffer
|
||||
|
||||
/datum/hud/human/update_locked_slots()
|
||||
if(!mymob)
|
||||
return
|
||||
|
||||
@@ -351,6 +351,10 @@
|
||||
icon = 'icons/mob/screen_midnight.dmi'
|
||||
icon_state = "running"
|
||||
|
||||
/obj/screen/mov_intent/Initialize(mapload)
|
||||
. = ..()
|
||||
update_icon()
|
||||
|
||||
/obj/screen/mov_intent/Click()
|
||||
toggle(usr)
|
||||
|
||||
@@ -359,7 +363,7 @@
|
||||
if(MOVE_INTENT_WALK)
|
||||
icon_state = "walking"
|
||||
if(MOVE_INTENT_RUN)
|
||||
icon_state = "running"
|
||||
icon_state = CONFIG_GET(flag/sprint_enabled)? "running" : "running_nosprint"
|
||||
|
||||
/obj/screen/mov_intent/proc/toggle(mob/user)
|
||||
if(isobserver(user))
|
||||
|
||||
@@ -290,6 +290,9 @@
|
||||
var/datum/movespeed_modifier/config_walk_run/M = get_cached_movespeed_modifier(/datum/movespeed_modifier/config_walk_run/walk)
|
||||
M.sync()
|
||||
|
||||
/datum/config_entry/flag/sprint_enabled
|
||||
config_entry_value = TRUE
|
||||
|
||||
/datum/config_entry/number/movedelay/sprint_speed_increase
|
||||
config_entry_value = 1
|
||||
|
||||
|
||||
@@ -26,6 +26,8 @@
|
||||
update_sprint_icon()
|
||||
|
||||
/mob/living/proc/enable_sprint_mode(update_icon = TRUE)
|
||||
if(!CONFIG_GET(flag/sprint_enabled))
|
||||
return
|
||||
if(combat_flags & COMBAT_FLAG_SPRINT_ACTIVE)
|
||||
return
|
||||
ENABLE_BITFIELD(combat_flags, COMBAT_FLAG_SPRINT_ACTIVE)
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
/mob/living/silicon/robot/default_toggle_sprint(shutdown = FALSE)
|
||||
if(!CONFIG_GET(flag/sprint_enabled))
|
||||
disable_intentional_sprint_mode()
|
||||
return
|
||||
var/current = (combat_flags & COMBAT_FLAG_SPRINT_ACTIVE)
|
||||
if(current || shutdown || !cell || (cell.charge < 25) || !cansprint)
|
||||
disable_intentional_sprint_mode()
|
||||
|
||||
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.6 KiB |
|
Before Width: | Height: | Size: 5.9 KiB After Width: | Height: | Size: 7.1 KiB |
|
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 6.8 KiB |
|
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 6.3 KiB |
|
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 6.0 KiB |