mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-10 01:34:01 +00:00
[MIRROR] More Basic AI behavior flags for manipulating movement [MDB IGNORE] (#10593)
* More Basic AI behavior flags for manipulating movement (#63974) * More Basic AI behavior flags for manipulating movement Co-authored-by: ma44 <guyonleagueoflegends@gmail.com>
This commit is contained in:
@@ -18,6 +18,10 @@
|
||||
#define AI_BEHAVIOR_REQUIRE_MOVEMENT (1<<0)
|
||||
///Does this task let you perform the action while you move closer? (Things like moving and shooting)
|
||||
#define AI_BEHAVIOR_MOVE_AND_PERFORM (1<<1)
|
||||
///Does finishing this task not null the current movement target?
|
||||
#define AI_BEHAVIOR_KEEP_MOVE_TARGET_ON_FINISH (1<<2)
|
||||
///Does finishing this task make the AI stop moving towards the target?
|
||||
#define AI_BEHAVIOR_KEEP_MOVING_TOWARDS_TARGET_ON_FINISH (1<<3)
|
||||
|
||||
///AI flags
|
||||
#define STOP_MOVING_WHEN_PULLED (1<<0)
|
||||
|
||||
@@ -21,6 +21,8 @@
|
||||
/datum/ai_behavior/proc/finish_action(datum/ai_controller/controller, succeeded, ...)
|
||||
LAZYREMOVE(controller.current_behaviors, src)
|
||||
controller.behavior_args -= type
|
||||
if(behavior_flags & AI_BEHAVIOR_REQUIRE_MOVEMENT) //If this was a movement task, reset our movement target.
|
||||
controller.current_movement_target = null
|
||||
controller.ai_movement.stop_moving_towards(controller)
|
||||
if(behavior_flags & AI_BEHAVIOR_REQUIRE_MOVEMENT) //If this was a movement task, reset our movement target if necessary
|
||||
if(!(behavior_flags & AI_BEHAVIOR_KEEP_MOVE_TARGET_ON_FINISH))
|
||||
controller.current_movement_target = null
|
||||
if(!(behavior_flags & AI_BEHAVIOR_KEEP_MOVING_TOWARDS_TARGET_ON_FINISH))
|
||||
controller.ai_movement.stop_moving_towards(controller)
|
||||
|
||||
Reference in New Issue
Block a user