[MIRROR] Simplifies and fixes bot modes [MDB IGNORE] (#12256)

This commit is contained in:
SkyratBot
2022-03-24 23:14:29 +01:00
committed by GitHub
parent 2f9ae57a7d
commit 037374169b
8 changed files with 56 additions and 83 deletions

View File

@@ -104,28 +104,6 @@
var/beacon_freq = FREQ_NAV_BEACON
///The type of data HUD the bot uses. Diagnostic by default.
var/data_hud_type = DATA_HUD_DIAGNOSTIC_BASIC
//This holds text for what the bot is mode doing, reported on the remote bot control interface.
var/list/mode_name = list(
"In Pursuit",
"Preparing to Arrest",
"Arresting",
"Beginning Patrol",
"Patrolling",
"Summoned by PDA",
"Cleaning",
"Repairing",
"Proceeding to work site",
"Healing",
"Proceeding to AI waypoint",
"Navigating to Delivery Location",
"Navigating to Home",
"Waiting for clear path",
"Calculating navigation path",
"Pinging beacon network",
"Unable to reach destination",
"Chasing filth",
"No Route",
)
var/datum/atom_hud/data/bot_path/path_hud = new /datum/atom_hud/data/bot_path()
var/path_image_icon = 'icons/mob/aibots.dmi'
var/path_image_icon_state = "path_indicator"
@@ -141,10 +119,8 @@
return "<b>Autonomous</b>"
else if(!(bot_mode_flags & BOT_MODE_ON))
return "<span class='bad'>Inactive</span>"
else if(!mode)
return "<span class='good'>Idle</span>"
else
return "<span class='average'>[mode_name[mode]]</span>"
return "<span class='average'>[mode]</span>"
/**
* Returns a status string about the bot's current status, if it's moving, manually controlled, or idle.
@@ -154,10 +130,8 @@
return paicard ? "pAI Controlled" : "Autonomous"
else if(!(bot_mode_flags & BOT_MODE_ON))
return "Inactive"
else if(!mode)
return "Idle"
else
return "[mode_name[mode]]"
return "[mode]"
/mob/living/simple_animal/bot/proc/turn_on()
if(stat)

View File

@@ -234,11 +234,11 @@
target = scan(/obj/item/food/deadmouse)
if(!target && bot_mode_flags & BOT_MODE_AUTOPATROL) //Search for cleanables it can see.
if(mode == BOT_IDLE || mode == BOT_START_PATROL)
start_patrol()
if(mode == BOT_PATROL)
bot_patrol()
switch(mode)
if(BOT_IDLE, BOT_START_PATROL)
start_patrol()
if(BOT_PATROL)
bot_patrol()
if(target)
if(QDELETED(target) || !isturf(target.loc))

View File

@@ -239,11 +239,11 @@
frustration++
if(bot_mode_flags & BOT_MODE_AUTOPATROL && !target_fire)
if(mode == BOT_IDLE || mode == BOT_START_PATROL)
start_patrol()
if(mode == BOT_PATROL)
bot_patrol()
switch(mode)
if(BOT_IDLE, BOT_START_PATROL)
start_patrol()
if(BOT_PATROL)
bot_patrol()
//Look for burning people or turfs around the bot

View File

@@ -220,11 +220,11 @@
if(!target)
if(bot_mode_flags & BOT_MODE_AUTOPATROL)
if(mode == BOT_IDLE || mode == BOT_START_PATROL)
start_patrol()
if(mode == BOT_PATROL)
bot_patrol()
switch(mode)
if(BOT_IDLE, BOT_START_PATROL)
start_patrol()
if(BOT_PATROL)
bot_patrol()
if(target)
if(loc == target || loc == get_turf(target))

View File

@@ -338,12 +338,12 @@
if(!.)
return
if(mode == BOT_TIPPED)
handle_panic()
return
if(mode == BOT_HEALING)
return
switch(mode)
if(BOT_TIPPED)
handle_panic()
return
if(BOT_HEALING)
return
if(IsStun() || IsParalyzed())
oldpatient = patient
@@ -405,11 +405,11 @@
frustration++
if(bot_mode_flags & BOT_MODE_AUTOPATROL && !(medical_mode_flags & MEDBOT_STATIONARY_MODE) && !patient)
if(mode == BOT_IDLE || mode == BOT_START_PATROL)
start_patrol()
if(mode == BOT_PATROL)
bot_patrol()
switch(mode)
if(BOT_IDLE, BOT_START_PATROL)
start_patrol()
if(BOT_PATROL)
bot_patrol()
/mob/living/simple_animal/bot/medbot/proc/assess_patient(mob/living/carbon/C)
. = FALSE

View File

@@ -249,7 +249,7 @@
data["on"] = bot_mode_flags & BOT_MODE_ON
data["locked"] = bot_cover_flags & BOT_COVER_LOCKED
data["siliconUser"] = user.has_unlimited_silicon_privilege
data["mode"] = mode ? mode_name[mode] : "Ready"
data["mode"] = mode ? "[mode]" : "Ready"
data["modeStatus"] = ""
switch(mode)
if(BOT_IDLE, BOT_DELIVER, BOT_GO_HOME)
@@ -302,7 +302,7 @@
switch(command)
if("stop")
if(mode >= BOT_DELIVER)
if(mode != BOT_IDLE)
bot_reset()
if("go")
if(mode == BOT_IDLE)

View File

@@ -43,10 +43,11 @@
if(!(bot_mode_flags & BOT_MODE_AUTOPATROL))
return
if(mode == BOT_IDLE || mode == BOT_START_PATROL)
start_patrol()
if(mode == BOT_PATROL)
bot_patrol()
switch(mode)
if(BOT_IDLE, BOT_START_PATROL)
start_patrol()
if(BOT_PATROL)
bot_patrol()
/mob/living/simple_animal/bot/vibebot/turn_off()
vibe_ability.remove_colors()