|
1 |
| -#define GET_AI_BEHAVIOR(behavior_type) SSai_controllers.ai_behaviors[behavior_type] |
| 1 | +#define GET_AI_BEHAVIOR(behavior_type) SSai_behaviors.ai_behaviors[behavior_type] |
2 | 2 | #define HAS_AI_CONTROLLER_TYPE(thing, type) istype(thing?.ai_controller, type)
|
3 | 3 |
|
4 |
| -#define AI_STATUS_ON 1 |
5 |
| -#define AI_STATUS_OFF 2 |
| 4 | +#define AI_STATUS_ON 1 |
| 5 | +#define AI_STATUS_OFF 2 |
6 | 6 |
|
7 | 7 |
|
8 | 8 | ///Monkey checks
|
9 | 9 | #define SHOULD_RESIST(source) (source.on_fire || source.buckled || HAS_TRAIT(source, TRAIT_RESTRAINED) || (source.pulledby && source.pulledby.grab_state > GRAB_PASSIVE))
|
| 10 | +#define IS_DEAD_OR_INCAP(source) (source.incapacitated() || source.stat) |
10 | 11 |
|
11 |
| -///Max pathing attempts before auto-fail |
12 |
| -#define MAX_PATHING_ATTEMPTS 30 |
| 12 | +///For JPS pathing, the maximum length of a path we'll try to generate. Should be modularized depending on what we're doing later on |
| 13 | +#define AI_MAX_PATH_LENGTH 30 // 30 is possibly overkill since by default we lose interest after 14 tiles of distance, but this gives wiggle room for weaving around obstacles |
| 14 | + |
| 15 | +///Cooldown on planning if planning failed last time |
| 16 | + |
| 17 | +#define AI_FAILED_PLANNING_COOLDOWN 1.5 SECONDS |
13 | 18 |
|
14 | 19 | ///Flags for ai_behavior new()
|
15 | 20 | #define AI_CONTROLLER_INCOMPATIBLE (1<<0)
|
|
19 | 24 | ///Does this task let you perform the action while you move closer? (Things like moving and shooting)
|
20 | 25 | #define AI_BEHAVIOR_MOVE_AND_PERFORM (1<<1)
|
21 | 26 |
|
| 27 | +///AI flags |
| 28 | +#define STOP_MOVING_WHEN_PULLED (1<<0) |
| 29 | + |
| 30 | +///Subtree defines |
| 31 | + |
| 32 | +///This subtree should cancel any further planning, (Including from other subtrees) |
| 33 | +#define SUBTREE_RETURN_FINISH_PLANNING 1 |
| 34 | + |
| 35 | +//Generic BB keys |
| 36 | +#define BB_CURRENT_MIN_MOVE_DISTANCE "min_move_distance" |
22 | 37 |
|
23 | 38 | ///Monkey AI controller blackboard keys
|
24 | 39 |
|
25 | 40 | #define BB_MONKEY_AGRESSIVE "BB_monkey_agressive"
|
| 41 | +#define BB_MONKEY_GUN_NEURONS_ACTIVATED "BB_monkey_gun_aware" |
| 42 | +#define BB_MONKEY_GUN_WORKED "BB_monkey_gun_worked" |
26 | 43 | #define BB_MONKEY_BEST_FORCE_FOUND "BB_monkey_bestforcefound"
|
27 | 44 | #define BB_MONKEY_ENEMIES "BB_monkey_enemies"
|
28 | 45 | #define BB_MONKEY_BLACKLISTITEMS "BB_monkey_blacklistitems"
|
29 | 46 | #define BB_MONKEY_PICKUPTARGET "BB_monkey_pickuptarget"
|
30 | 47 | #define BB_MONKEY_PICKPOCKETING "BB_monkey_pickpocketing"
|
31 | 48 | #define BB_MONKEY_CURRENT_ATTACK_TARGET "BB_monkey_current_attack_target"
|
| 49 | +#define BB_MONKEY_CURRENT_PRESS_TARGET "BB_monkey_current_press_target" |
| 50 | +#define BB_MONKEY_CURRENT_GIVE_TARGET "BB_monkey_current_give_target" |
32 | 51 | #define BB_MONKEY_TARGET_DISPOSAL "BB_monkey_target_disposal"
|
33 | 52 | #define BB_MONKEY_DISPOSING "BB_monkey_disposing"
|
34 | 53 | #define BB_MONKEY_RECRUIT_COOLDOWN "BB_monkey_recruit_cooldown"
|
| 54 | +#define BB_MONKEY_NEXT_HUNGRY "BB_monkey_next_hungry" |
| 55 | + |
| 56 | + |
| 57 | +///Haunted item controller defines |
| 58 | + |
| 59 | +///Chance for haunted item to haunt someone |
| 60 | +#define HAUNTED_ITEM_ATTACK_HAUNT_CHANCE 10 |
| 61 | +///Chance for haunted item to try to get itself let go. |
| 62 | +#define HAUNTED_ITEM_ESCAPE_GRASP_CHANCE 20 |
| 63 | +///Chance for haunted item to warp somewhere new |
| 64 | +#define HAUNTED_ITEM_TELEPORT_CHANCE 4 |
| 65 | +///Amount of aggro you get when picking up a haunted item |
| 66 | +#define HAUNTED_ITEM_AGGRO_ADDITION 2 |
| 67 | + |
| 68 | +///Blackboard keys for haunted items |
| 69 | +#define BB_TO_HAUNT_LIST "BB_to_haunt_list" |
| 70 | +///Actual mob the item is haunting at the moment |
| 71 | +#define BB_HAUNT_TARGET "BB_haunt_target" |
| 72 | +///Amount of successful hits in a row this item has had |
| 73 | +#define BB_HAUNTED_THROW_ATTEMPT_COUNT "BB_haunted_throw_attempt_count" |
| 74 | + |
| 75 | +///Cursed item controller defines |
| 76 | + |
| 77 | +//defines |
| 78 | +///how far a cursed item will still try to chase a target |
| 79 | +#define CURSED_VIEW_RANGE 7 |
| 80 | +#define CURSED_ITEM_TELEPORT_CHANCE 4 |
| 81 | +//blackboards |
| 82 | + |
| 83 | +///Actual mob the item is haunting at the moment |
| 84 | +#define BB_CURSE_TARGET "BB_haunt_target" |
| 85 | +///Where the item wants to land on |
| 86 | +#define BB_TARGET_SLOT "BB_target_slot" |
| 87 | +///Amount of successful hits in a row this item has had |
| 88 | +#define BB_CURSED_THROW_ATTEMPT_COUNT "BB_cursed_throw_attempt_count" |
| 89 | + |
| 90 | +///Vending machine AI controller blackboard keys |
| 91 | +#define BB_VENDING_CURRENT_TARGET "BB_vending_current_target" |
| 92 | +#define BB_VENDING_TILT_COOLDOWN "BB_vending_tilt_cooldown" |
| 93 | +#define BB_VENDING_UNTILT_COOLDOWN "BB_vending_untilt_cooldown" |
| 94 | +#define BB_VENDING_BUSY_TILTING "BB_vending_busy_tilting" |
| 95 | +#define BB_VENDING_LAST_HIT_SUCCESSFUL "BB_vending_last_hit_succesful" |
| 96 | + |
| 97 | +///Robot customer AI controller blackboard keys |
| 98 | +#define BB_CUSTOMER_CURRENT_ORDER "BB_customer_current_order" |
| 99 | +#define BB_CUSTOMER_MY_SEAT "BB_customer_my_seat" |
| 100 | +#define BB_CUSTOMER_PATIENCE "BB_customer_patience" |
| 101 | +#define BB_CUSTOMER_CUSTOMERINFO "BB_customer_customerinfo" |
| 102 | +#define BB_CUSTOMER_EATING "BB_customer_eating" |
| 103 | +#define BB_CUSTOMER_ATTENDING_VENUE "BB_customer_attending_avenue" |
| 104 | +#define BB_CUSTOMER_LEAVING "BB_customer_leaving" |
| 105 | +#define BB_CUSTOMER_CURRENT_TARGET "BB_customer_current_target" |
| 106 | +/// Robot customer has said their can't find seat line at least once. Used to rate limit how often they'll complain after the first time. |
| 107 | +#define BB_CUSTOMER_SAID_CANT_FIND_SEAT_LINE "BB_customer_said_cant_find_seat_line" |
| 108 | + |
| 109 | + |
| 110 | +///Hostile AI controller blackboard keys |
| 111 | +#define BB_HOSTILE_ORDER_MODE "BB_HOSTILE_ORDER_MODE" |
| 112 | +#define BB_HOSTILE_FRIEND "BB_HOSTILE_FRIEND" |
| 113 | +#define BB_HOSTILE_ATTACK_WORD "BB_HOSTILE_ATTACK_WORD" |
| 114 | +#define BB_FOLLOW_TARGET "BB_FOLLOW_TARGET" |
| 115 | +#define BB_ATTACK_TARGET "BB_ATTACK_TARGET" |
| 116 | +#define BB_VISION_RANGE "BB_VISION_RANGE" |
| 117 | + |
| 118 | +/// Basically, what is our vision/hearing range. |
| 119 | +#define BB_HOSTILE_VISION_RANGE 10 |
| 120 | +/// After either being given a verbal order or a pointing order, ignore further of each for this duration |
| 121 | +#define AI_HOSTILE_COMMAND_COOLDOWN 2 SECONDS |
| 122 | + |
| 123 | +// hostile command modes (what pointing at something/someone does depending on the last order the carp heard) |
| 124 | +/// Don't do anything (will still react to stuff around them though) |
| 125 | +#define HOSTILE_COMMAND_NONE 0 |
| 126 | +/// Will attack a target. |
| 127 | +#define HOSTILE_COMMAND_ATTACK 1 |
| 128 | +/// Will follow a target. |
| 129 | +#define HOSTILE_COMMAND_FOLLOW 2 |
| 130 | + |
| 131 | +///Dog AI controller blackboard keys |
| 132 | + |
| 133 | +#define BB_SIMPLE_CARRY_ITEM "BB_SIMPLE_CARRY_ITEM" |
| 134 | +#define BB_FETCH_TARGET "BB_FETCH_TARGET" |
| 135 | +#define BB_FETCH_IGNORE_LIST "BB_FETCH_IGNORE_LISTlist" |
| 136 | +#define BB_FETCH_DELIVER_TO "BB_FETCH_DELIVER_TO" |
| 137 | +#define BB_DOG_FRIENDS "BB_DOG_FRIENDS" |
| 138 | +#define BB_DOG_ORDER_MODE "BB_DOG_ORDER_MODE" |
| 139 | +#define BB_DOG_PLAYING_DEAD "BB_DOG_PLAYING_DEAD" |
| 140 | +#define BB_DOG_HARASS_TARGET "BB_DOG_HARASS_TARGET" |
| 141 | + |
| 142 | +/// Basically, what is our vision/hearing range for picking up on things to fetch/ |
| 143 | +#define AI_DOG_VISION_RANGE 10 |
| 144 | +/// What are the odds someone petting us will become our friend? |
| 145 | +#define AI_DOG_PET_FRIEND_PROB 15 |
| 146 | +/// After this long without having fetched something, we clear our ignore list |
| 147 | +#define AI_FETCH_IGNORE_DURATION 30 SECONDS |
| 148 | +/// After being ordered to heel, we spend this long chilling out |
| 149 | +#define AI_DOG_HEEL_DURATION 20 SECONDS |
| 150 | +/// After either being given a verbal order or a pointing order, ignore further of each for this duration |
| 151 | +#define AI_DOG_COMMAND_COOLDOWN 2 SECONDS |
| 152 | + |
| 153 | +// dog command modes (what pointing at something/someone does depending on the last order the dog heard) |
| 154 | +/// Don't do anything (will still react to stuff around them though) |
| 155 | +#define DOG_COMMAND_NONE 0 |
| 156 | +/// Will try to pick up and bring back whatever you point to |
| 157 | +#define DOG_COMMAND_FETCH 1 |
| 158 | +/// Will get within a few tiles of whatever you point at and continually growl/bark. If the target is a living mob who gets too close, the dog will attack them with bites |
| 159 | +#define DOG_COMMAND_ATTACK 2 |
| 160 | + |
| 161 | +//enumerators for parsing command speech |
| 162 | +#define COMMAND_HEEL "Heel" |
| 163 | +#define COMMAND_FETCH "Fetch" |
| 164 | +#define COMMAND_FOLLOW "Follow" |
| 165 | +#define COMMAND_STOP "Stop" |
| 166 | +#define COMMAND_ATTACK "Attack" |
| 167 | +#define COMMAND_DIE "Play Dead" |
| 168 | + |
| 169 | +///bane ai |
| 170 | +#define BB_BANE_BATMAN "BB_bane_batman" |
| 171 | +//yep thats it |
| 172 | + |
| 173 | + |
| 174 | +//Hunting defines |
| 175 | +#define SUCCESSFUL_HUNT_COOLDOWN 5 SECONDS |
| 176 | + |
| 177 | +///Hunting BB keys |
| 178 | +#define BB_CURRENT_HUNTING_TARGET "BB_current_hunting_target" |
| 179 | +#define BB_HUNTING_COOLDOWN "BB_HUNTING_COOLDOWN" |
| 180 | + |
| 181 | +///Basic Mob Keys |
| 182 | + |
| 183 | +///Targetting subtrees |
| 184 | +#define BB_BASIC_MOB_CURRENT_TARGET "BB_basic_current_target" |
| 185 | +#define BB_BASIC_MOB_CURRENT_TARGET_HIDING_LOCATION "BB_basic_current_target_hiding_location" |
| 186 | +#define BB_TARGETTING_DATUM "targetting_datum" |
0 commit comments