mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-30 19:41:56 +00:00
About The Pull Request Alphabetized several long lists of strings so its easier for us to look through them, just code polish, nothing the players would see. Fixed some minor spelling errors as well. Clarified door bolt state to be less ambiguous in the door wiring gui. Originally it would say the door bolts have fallen, and the door bolts "Look up". i dont know about you but that was very not clear for me to read. Like where are the bolts? In the door or the frame? Arnt there bolts on top and bottom? Just didn't make sense to me. Now it says "Have engaged!" & "Have disengaged" hopefully that makes the state clearer at a glance. I also added a small handful of funny texts to some string files. See changelog Why It's Good For The Game Well, who doesn't like a bit of polish? Just makes the game a little easier for people. Also funny text funny text. Changelog spelling: improves spelling and adds more flavortext
49 lines
1.8 KiB
Plaintext
49 lines
1.8 KiB
Plaintext
/// An AI controller for the MODsuit pathfinder module. It's activated by implant and attaches itself to the user.
|
|
/datum/ai_controller/mod
|
|
blackboard = list(
|
|
BB_MOD_TARGET,
|
|
BB_MOD_IMPLANT,
|
|
)
|
|
max_target_distance = MOD_AI_RANGE //a little spicy but its one specific item that summons it, and it doesn't run otherwise
|
|
ai_movement = /datum/ai_movement/jps
|
|
///ID card generated from the suit's required access. Used for pathing.
|
|
var/obj/item/card/id/advanced/id_card
|
|
|
|
/datum/ai_controller/mod/TryPossessPawn(atom/new_pawn)
|
|
if(!istype(new_pawn, /obj/item/mod/control))
|
|
return AI_CONTROLLER_INCOMPATIBLE
|
|
var/obj/item/mod/control/mod = new_pawn
|
|
id_card = new /obj/item/card/id/advanced/simple_bot()
|
|
if(length(mod.req_access))
|
|
id_card.set_access(mod.req_access)
|
|
return ..() //Run parent at end
|
|
|
|
/datum/ai_controller/mod/UnpossessPawn(destroy)
|
|
QDEL_NULL(id_card)
|
|
return ..() //Run parent at end
|
|
|
|
/datum/ai_controller/mod/SelectBehaviors(delta_time)
|
|
current_behaviors = list()
|
|
if(blackboard[BB_MOD_TARGET] && blackboard[BB_MOD_IMPLANT])
|
|
queue_behavior(/datum/ai_behavior/mod_attach)
|
|
|
|
/datum/ai_controller/mod/get_access()
|
|
return id_card
|
|
|
|
/datum/ai_behavior/mod_attach
|
|
behavior_flags = AI_BEHAVIOR_REQUIRE_MOVEMENT|AI_BEHAVIOR_MOVE_AND_PERFORM
|
|
|
|
/datum/ai_behavior/mod_attach/perform(delta_time, datum/ai_controller/controller)
|
|
. = ..()
|
|
if(!controller.pawn.Adjacent(controller.blackboard[BB_MOD_TARGET]))
|
|
return
|
|
var/obj/item/implant/mod/implant = controller.blackboard[BB_MOD_IMPLANT]
|
|
implant.module.attach(controller.blackboard[BB_MOD_TARGET])
|
|
finish_action(controller, TRUE)
|
|
|
|
/datum/ai_behavior/mod_attach/finish_action(datum/ai_controller/controller, succeeded)
|
|
. = ..()
|
|
controller.blackboard[BB_MOD_TARGET] = null
|
|
var/obj/item/implant/mod/implant = controller.blackboard[BB_MOD_IMPLANT]
|
|
implant.end_recall(succeeded)
|