mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-11 08:06:33 +01:00
21b4095dfd
Upstream 04/17/2026 fixes https://github.com/Bubberstation/Bubberstation/issues/5549 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: tgstation-ci[bot] <179393467+tgstation-ci[bot]@users.noreply.github.com> Co-authored-by: ArcaneMusic <41715314+ArcaneMusic@users.noreply.github.com> Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com> Co-authored-by: Rhials <28870487+Rhials@users.noreply.github.com> Co-authored-by: rageguy505 <54517726+rageguy505@users.noreply.github.com> Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com> Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com> Co-authored-by: Aliceee2ch <160794176+Aliceee2ch@users.noreply.github.com> Co-authored-by: Time-Green <7501474+Time-Green@users.noreply.github.com> Co-authored-by: Tsar-Salat <62388554+Tsar-Salat@users.noreply.github.com> Co-authored-by: SmArtKar <44720187+SmArtKar@users.noreply.github.com> Co-authored-by: Maxipat <108554989+Maxipat112@users.noreply.github.com> Co-authored-by: SyncIt21 <110812394+SyncIt21@users.noreply.github.com> Co-authored-by: deltanedas <39013340+deltanedas@users.noreply.github.com> Co-authored-by: SimplyLogan <47579821+loganuk@users.noreply.github.com> Co-authored-by: loganuk <fakeemail123@aol.com> Co-authored-by: Leland Kemble <70413276+lelandkemble@users.noreply.github.com> Co-authored-by: FalloutFalcon <86381784+FalloutFalcon@users.noreply.github.com> Co-authored-by: Roxy <75404941+TealSeer@users.noreply.github.com> Co-authored-by: Lucy <lucy@absolucy.moe> Co-authored-by: siliconOpossum <138069572+siliconOpossum@users.noreply.github.com> Co-authored-by: Isratosh <Isratosh@hotmail.com> Co-authored-by: TheRyeGuyWhoWillNowDie <70169560+TheRyeGuyWhoWillNowDie@users.noreply.github.com> Co-authored-by: Neocloudy <88008002+Neocloudy@users.noreply.github.com> Co-authored-by: Alexander V. <volas@ya.ru> Co-authored-by: ElGitificador <168473461+ElGitificador@users.noreply.github.com> Co-authored-by: Twaticus <46540570+Twaticus@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com> Co-authored-by: Cameron Lennox <killer65311@gmail.com> Co-authored-by: Tim <timothymtorres@gmail.com> Co-authored-by: Iamgoofball <iamgoofball@gmail.com> Co-authored-by: Layzu666 <121319428+Layzu666@users.noreply.github.com> Co-authored-by: Arturlang <24881678+Arturlang@users.noreply.github.com> Co-authored-by: _0Steven <42909981+00-Steven@users.noreply.github.com> Co-authored-by: mrmanlikesbt <99309552+mrmanlikesbt@users.noreply.github.com> Co-authored-by: Ben10Omintrix <138636438+Ben10Omintrix@users.noreply.github.com> Co-authored-by: John F. Kennedy <54908920+MacaroniCritter@users.noreply.github.com> Co-authored-by: Cursor <102828457+theselfish@users.noreply.github.com> Co-authored-by: Josh <josh.adam.powell@gmail.com> Co-authored-by: Josh Powell <josh.powell@softwire.com> Co-authored-by: Yobrocharlie <Charliemiller5617@gmail.com> Co-authored-by: Hardly3D <66234359+Hardly3D@users.noreply.github.com> Co-authored-by: shayoki <96078776+shayoki@users.noreply.github.com> Co-authored-by: LT3 <83487515+lessthnthree@users.noreply.github.com>
119 lines
4.3 KiB
Plaintext
119 lines
4.3 KiB
Plaintext
/mob/living/basic/bot/proc/diag_hud_set_bothealth()
|
|
set_hud_image_state(DIAG_HUD, "huddiag[RoundDiagBar(health/maxHealth)]")
|
|
|
|
/mob/living/basic/bot/proc/diag_hud_set_botstat() //On (With wireless on or off), Off, EMP'ed
|
|
if(bot_mode_flags & BOT_MODE_ON)
|
|
set_hud_image_state(DIAG_STAT_HUD, "hudstat")
|
|
return
|
|
|
|
if(stat != CONSCIOUS)
|
|
set_hud_image_state(DIAG_STAT_HUD, "hudoffline")
|
|
return
|
|
|
|
set_hud_image_state(DIAG_STAT_HUD, "huddead2")
|
|
|
|
/mob/living/basic/bot/proc/diag_hud_set_botmode() //Shows a bot's current operation
|
|
if(client) //If the bot is player controlled, it will not be following mode logic!
|
|
set_hud_image_state(DIAG_BOT_HUD, "hudsentient")
|
|
return
|
|
|
|
switch(mode)
|
|
if(BOT_SUMMON, BOT_RESPONDING) //Responding to PDA or AI summons
|
|
set_hud_image_state(DIAG_BOT_HUD, "hudcalled")
|
|
if(BOT_CLEANING, BOT_HEALING) //Cleanbot cleaning, Floorbot fixing, or Medibot Healing
|
|
set_hud_image_state(DIAG_BOT_HUD, "hudworking")
|
|
if(BOT_PATROL, BOT_START_PATROL) //Patrol mode
|
|
set_hud_image_state(DIAG_BOT_HUD, "hudpatrol")
|
|
if(BOT_PREP_ARREST, BOT_ARREST, BOT_HUNT) //STOP RIGHT THERE, CRIMINAL SCUM!
|
|
set_hud_image_state(DIAG_BOT_HUD, "hudalert")
|
|
if(BOT_MOVING, BOT_DELIVER, BOT_GO_HOME, BOT_NAV) //Moving to target for normal bots, moving to deliver or go home for MULES.
|
|
set_hud_image_state(DIAG_BOT_HUD, "hudmove")
|
|
else
|
|
set_hud_image_state(DIAG_BOT_HUD, "")
|
|
|
|
///proc that handles drawing and transforming the bot's path onto diagnostic huds
|
|
/mob/living/basic/bot/proc/generate_bot_path(datum/move_loop/has_target/jps/source)
|
|
SIGNAL_HANDLER
|
|
|
|
UnregisterSignal(src, COMSIG_MOVELOOP_JPS_FINISHED_PATHING)
|
|
|
|
if(isnull(ai_controller))
|
|
return
|
|
|
|
|
|
var/atom/move_target = ai_controller.current_movement_target
|
|
if(move_target != ai_controller.blackboard[BB_BEACON_TARGET])
|
|
return
|
|
|
|
|
|
//Removes path images and handles removing hud client images
|
|
clear_path_hud()
|
|
|
|
var/list/path_huds_watching_me = list(GLOB.huds[DATA_HUD_DIAGNOSTIC], GLOB.huds[DATA_HUD_BOT_PATH])
|
|
|
|
var/list/path_images = active_hud_list[DIAG_PATH_HUD]
|
|
LAZYCLEARLIST(path_images)
|
|
|
|
var/list/our_path = source.movement_path
|
|
if(!length(our_path))
|
|
return
|
|
|
|
for(var/index in 1 to our_path.len)
|
|
if(index == 1 || index == our_path.len)
|
|
continue
|
|
var/turf/current_turf = our_path[index]
|
|
var/turf/previous_turf = our_path[index - 1]
|
|
|
|
var/turf/next_turf = our_path[index + 1]
|
|
var/next_direction = get_dir(previous_turf, next_turf)
|
|
var/previous_direction = get_dir(current_turf, previous_turf)
|
|
|
|
var/image/path_display = image(icon = path_image_icon, loc = current_turf, icon_state = path_image_icon_state, layer = BOT_PATH_LAYER, dir = next_direction)
|
|
|
|
SET_PLANE(path_display, GAME_PLANE, current_turf)
|
|
|
|
if((ISDIAGONALDIR(next_direction) && (previous_direction & (NORTH|SOUTH))))
|
|
var/turn_value = (next_direction == SOUTHWEST || next_direction == NORTHEAST) ? 90 : -90
|
|
path_display.transform = path_display.transform.Turn(turn_value)
|
|
path_display.transform = path_display.transform.Scale(1, -1)
|
|
|
|
path_display.color = path_image_color
|
|
path_images += path_display
|
|
current_pathed_turfs[current_turf] = path_display
|
|
|
|
for(var/datum/atom_hud/hud as anything in path_huds_watching_me)
|
|
hud.add_atom_to_hud(src)
|
|
|
|
///proc that handles moving along the bot's drawn path
|
|
/mob/living/basic/bot/proc/handle_loop_movement(atom/movable/source, atom/oldloc, dir, forced)
|
|
SIGNAL_HANDLER
|
|
|
|
handle_hud_path()
|
|
on_bot_movement(source, oldloc, dir, forced)
|
|
|
|
/mob/living/basic/bot/proc/handle_hud_path()
|
|
if(client || !length(current_pathed_turfs) || isnull(ai_controller))
|
|
return
|
|
|
|
var/turf/our_turf = get_turf(src)
|
|
var/image/target_image = current_pathed_turfs[our_turf]
|
|
if(target_image)
|
|
animate(target_image, alpha = 0, time = 0.3 SECONDS)
|
|
current_pathed_turfs -= our_turf
|
|
|
|
///proc that handles deleting the bot's drawn path when needed
|
|
/mob/living/basic/bot/proc/clear_path_hud(remove_hud = TRUE)
|
|
for(var/turf/index as anything in current_pathed_turfs)
|
|
var/image/our_image = current_pathed_turfs[index]
|
|
animate(our_image, alpha = 0, time = 0.3 SECONDS)
|
|
current_pathed_turfs -= index
|
|
|
|
if(!remove_hud)
|
|
return
|
|
|
|
// Call hud remove handlers to ensure viewing user client images are removed
|
|
var/list/path_huds_watching_me = list(GLOB.huds[DATA_HUD_DIAGNOSTIC], GLOB.huds[DATA_HUD_BOT_PATH])
|
|
for(var/datum/atom_hud/hud as anything in path_huds_watching_me)
|
|
hud.remove_atom_from_hud(src)
|
|
|