mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-15 01:54:52 +01:00
Basic mulebots. last basic bot refactor (#95899)
my watch has ended <img width="401" height="256" alt="ffffff" src="https://github.com/user-attachments/assets/a539203c-020b-4ad8-b034-f69ec0eafa78" /> ## Changelog 🆑 Profakos (originally pulled from their branch, did massive chunk of this), Ben10omintrix refactor: mulebots have been refactored. please report any bugs /🆑
This commit is contained in:
@@ -32,32 +32,32 @@
|
||||
|
||||
botcount = 0
|
||||
|
||||
for(var/mob/living/simple_animal/bot/simple_bot as anything in GLOB.bots_list)
|
||||
if(!is_valid_z_level(current_turf, get_turf(simple_bot)) || !(simple_bot.bot_mode_flags & BOT_MODE_REMOTE_ENABLED)) //Only non-emagged bots on the same Z-level are detected!
|
||||
for(var/mob/living/basic/bot/basic_bot as anything in GLOB.bots_list)
|
||||
if(!is_valid_z_level(current_turf, get_turf(basic_bot)) || !(basic_bot.bot_mode_flags & BOT_MODE_REMOTE_ENABLED)) //Only non-emagged bots on the same Z-level are detected!
|
||||
continue
|
||||
if(!simple_bot.allowed(user) && !simple_bot.check_access(computer.stored_id)) // Only check Bots we can access
|
||||
if(!basic_bot.allowed(user) && !basic_bot.check_access(computer.stored_id)) // Only check Bots we can access
|
||||
continue
|
||||
var/list/newbot = list(
|
||||
"name" = simple_bot.name,
|
||||
"mode" = simple_bot.get_mode_ui(),
|
||||
"model" = simple_bot.bot_type,
|
||||
"locat" = get_area(simple_bot),
|
||||
"bot_ref" = REF(simple_bot),
|
||||
"name" = basic_bot.name,
|
||||
"mode" = basic_bot.get_mode_ui(),
|
||||
"model" = basic_bot.bot_type,
|
||||
"locat" = get_area(basic_bot),
|
||||
"bot_ref" = REF(basic_bot),
|
||||
"mule_check" = FALSE,
|
||||
)
|
||||
if(simple_bot.bot_type == MULE_BOT)
|
||||
var/mob/living/simple_animal/bot/mulebot/simple_mulebot = simple_bot
|
||||
if(basic_bot.bot_type == MULE_BOT)
|
||||
var/mob/living/basic/bot/mulebot/basic_mulebot = basic_bot
|
||||
mulelist += list(list(
|
||||
"name" = simple_mulebot.name,
|
||||
"id" = simple_mulebot.id,
|
||||
"dest" = simple_mulebot.destination,
|
||||
"power" = simple_mulebot.cell ? simple_mulebot.cell.percent() : 0,
|
||||
"home" = simple_mulebot.home_destination,
|
||||
"autoReturn" = simple_mulebot.mulebot_delivery_flags & MULEBOT_RETURN_MODE,
|
||||
"autoPickup" = simple_mulebot.mulebot_delivery_flags & MULEBOT_AUTO_PICKUP_MODE,
|
||||
"reportDelivery" = simple_mulebot.mulebot_delivery_flags & MULEBOT_REPORT_DELIVERY_MODE,
|
||||
"mule_ref" = REF(simple_mulebot),
|
||||
"load" = simple_mulebot.get_load_name(),
|
||||
"name" = basic_mulebot.name,
|
||||
"id" = basic_mulebot.id,
|
||||
"dest" = basic_mulebot.ai_controller.blackboard[BB_MULEBOT_DESTINATION_BEACON],
|
||||
"power" = basic_mulebot.cell ? basic_mulebot.cell.percent() : 0,
|
||||
"home" = basic_mulebot.ai_controller.blackboard[BB_MULEBOT_HOME_BEACON],
|
||||
"autoReturn" = basic_mulebot.mulebot_delivery_flags & MULEBOT_RETURN_MODE,
|
||||
"autoPickup" = basic_mulebot.mulebot_delivery_flags & MULEBOT_AUTO_PICKUP_MODE,
|
||||
"reportDelivery" = basic_mulebot.mulebot_delivery_flags & MULEBOT_REPORT_DELIVERY_MODE,
|
||||
"mule_ref" = REF(basic_mulebot),
|
||||
"load" = basic_mulebot.get_load_name(),
|
||||
))
|
||||
newbot["mule_check"] = TRUE
|
||||
botlist += list(newbot)
|
||||
@@ -106,15 +106,15 @@
|
||||
"report",
|
||||
"ejectpai",
|
||||
)
|
||||
var/mob/living/simple_animal/bot/simple_bot = locate(params["robot"]) in GLOB.bots_list
|
||||
var/mob/living/basic/bot/basic_bot = locate(params["robot"]) in GLOB.bots_list
|
||||
if (action in standard_actions)
|
||||
simple_bot.bot_control(action, current_user, id_card?.GetAccess())
|
||||
basic_bot.bot_control(action, current_user, id_card?.GetAccess())
|
||||
if (action in MULE_actions)
|
||||
simple_bot.bot_control(action, current_user, id_card?.GetAccess(), TRUE)
|
||||
basic_bot.bot_control(action, current_user, id_card?.GetAccess(), TRUE)
|
||||
|
||||
switch(action)
|
||||
if("summon")
|
||||
simple_bot.bot_control(action, current_user, id_card ? id_card.access : id_card?.GetAccess())
|
||||
basic_bot.bot_control(action, current_user, id_card ? id_card.access : id_card?.GetAccess())
|
||||
if("ejectcard")
|
||||
if(!computer || !computer.stored_id)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user