{ "dm_type": "/datum/ai_controller/basic_controller/trader", "type": "selector", "children": [ { "type": "subtree", "subtype": "/datum/bt_node/subtree/escape_captivity/pacifist" }, { "type": "parallel", "failure_policy": "BT_PARALLEL_FAILURE_CHILD_ONE", "success_policy": "BT_PARALLEL_SUCCESS_CHILD_ONE", "repeat_secondary": true, "repeat_secondary_delay": "BASIC_MOB_FIND_TARGET_RATE", "finish_on_primary": true, "children": [ { "type": "selector", "children": [ { "type": "decorator", "decorator": "/datum/bt_node/decorator/bb_key_set", "vars": { "observer_abort": "BT_ABORT_BOTH", "key": "BB_CURRENT_TARGET" }, "child": { "type": "parallel", "failure_policy": "BT_PARALLEL_FAILURE_ANY", "success_policy": "BT_PARALLEL_SUCCESS_CHILD_ONE", "repeat_secondary": true, "finish_on_primary": true, "children": [ { "type": "subplan", "success_policy": "BT_SUBPLAN_LOOP_ON_SUCCESS", "failure_policy": "BT_SUBPLAN_LOOP_ON_FAILURE", "children": [ { "type": "leaf", "behavior": "/datum/bt_node/ai_behavior/basic_ranged_attack", "vars": { "target_key": "BB_CURRENT_TARGET", "targeting_strategy": "BB_TARGETING_STRATEGY", "hiding_location_key": "BB_CURRENT_TARGET_HIDING_LOCATION", "avoid_friendly_fire": true, "time_between_perform": "3 SECONDS" } } ] }, { "type": "leaf", "behavior": "/datum/bt_node/ai_behavior/move_to_target", "vars": { "target_key": "BB_CURRENT_TARGET", "required_dist": 1, "finish_on_arrival": false } } ] } }, { "type": "decorator", "decorator": "/datum/bt_node/decorator/bb_key_set", "vars": { "observer_abort": "BT_ABORT_NONE", "invert": true, "key": "BB_SHOP_SPOT" }, "child": { "type": "decorator", "decorator": "/datum/bt_node/decorator/bb_key_set", "vars": { "observer_abort": "BT_ABORT_LOWER_PRIORITY", "key": "BB_FIRST_CUSTOMER" }, "child": { "type": "sequence", "children": [ { "type": "selector", "children": [ { "type": "decorator", "decorator": "/datum/bt_node/decorator/bb_key_equals", "vars": { "key": "BB_TRADER_RUSH_TO_SELL", "value": true }, "child": { "type": "leaf", "behavior": "/datum/bt_node/ai_behavior/move_to_target", "vars": { "target_key": "BB_FIRST_CUSTOMER", "required_dist": 1 } } }, { "type": "leaf", "behavior": "/datum/bt_node/ai_behavior/succeed" } ] }, { "type": "leaf", "behavior": "/datum/bt_node/ai_behavior/setup_shop" } ] } } }, { "type": "subplan", "success_policy": "BT_SUBPLAN_LOOP_ON_SUCCESS", "failure_policy": "BT_SUBPLAN_FAIL_ON_FAILURE", "loop_delay": "IDLE_BEHAVIOR_RATE", "children": [ { "type": "leaf", "behavior": "/datum/bt_node/ai_behavior/idle_random_walk/not_while_on_target", "vars": { "target_key": "BB_SHOP_SPOT" } } ] } ] }, { "type": "leaf", "behavior": "/datum/bt_node/ai_behavior/acquire_target/target_from_retaliate_list", "vars": { "target_key": "BB_CURRENT_TARGET", "targeting_strategy": "BB_TARGETING_STRATEGY", "hiding_location_key": "BB_CURRENT_TARGET_HIDING_LOCATION" } }, { "type": "leaf", "behavior": "/datum/bt_node/ai_behavior/acquire_target", "vars": { "target_key": "BB_FIRST_CUSTOMER", "target_source": "/datum/target_source/oview", "targeting_strategy": "/datum/targeting_strategy/conscious_human", "revalidation_mode": "TARGET_REVALIDATE" } } ] } ] }