- 好友
- 0
- 在线时间
- 0 小时
- 最后登录
- 2026-10-20
平民

- UID
- 3897508
- 第纳尔
- 0
- 精华
- 0
- 互助
- 1
- 荣誉
- 0
- 贡献
- 0
- 魅力
- 0
- 注册时间
- 2026-9-20
 鲜花( 0)  鸡蛋( 0)
|
本帖最后由 Bluet 于 2026-10-18 22:29 编辑
潘德的预言原版里骑射手有一个bug,移动时瞄准点有一个沿着速度方向的偏移,导致命中率很低,甚至经常出现几十个骑射手绕一个敌人转圈却半天射不中的情况。所以我用AI研究了一下然后写了一段弓骑射手(只对弓有效!对弩、投掷武器无效)的增强补丁。核心修改是通过测试拟合把这部分偏移修正掉,从而让箭能准确地射向敌人。此外为了平衡性和真实性还添加了预瞄和近似高斯分布的随机噪声,预瞄考虑重力下落修正和敌人移动引入的提前量,通过距离、箭飞行速度、敌人速度来计算,随机噪声简单来说就是自己和目标速度越快误差越大,弓熟练度和骑射技能可以降低误差,最后有一个统一设置的总噪声系数,默认是1。这种情况下噪声其实很大,即使是满骑射和弓熟练度的自建骑射手在距离和速度稍大时也要好几箭才能射中一箭,但是不妨碍骑射手拥有很高的强度。代码中很多参数都是通过大量测试拟合出来的,主要是因为不清楚箭的准确飞行速度。触发器间隔为0,但是涉及的大部分计算都设置了冷却时间,所以实际性能消耗很小。这段代码只是覆盖了原版骑射手的射击逻辑,所以开不开骑射AI都可以用,但想要发挥骑射手实力还是得配合骑射AI。
- # ============================================================
- # 弓骑射手 AI:精确瞄准 + 弹道补偿 + 射速控制
- #
- # 工作原理:
- # 每帧遍历所有骑射手,满足"骑马 + 持弓 + 攻击中"时接管其瞄准与释放;
- # 目标切换、视线遮挡、方位不对时自动取消攻击,交回引擎 AI;
- # 弹药不足时切换近战武器并停止攻击,跳过全部弹道计算;
- # 战斗胜利或撤退时清理骑射状态,交回引擎 AI。
- #
- # slot 分配:
- # 1010 — 保留(本脚本未使用)
- # 1012 — 本次拉弓所需最短时长(进入拉弓时随机 1000~2000ms)
- # 1013 — 上次噪声生成时间戳
- # 1014-1016 — 当前噪声 X/Y/Z
- # 1018 — 骑射模式寄存器(0.5 秒去抖后为 1)
- # 1019 — 上次偏移计算时间戳
- # 1020-1022 — 缓存的偏移 X/Y/Z
- # 1023 — 缓存的飞行时间 t_ms
- # 1025 — 视线+方位检查缓存(0/1)
- # 1026 — 上次三条件满足的时间戳
- # 1027 — 拉弓起始时间戳(0 = 未拉弓)
- # 1028 — 目标切换冷却截止时间戳
- # 1034 — 上次锁定的目标 agent id
- #
- # 性能优化:
- # 弹道计算、噪声、视线检查都放进 0.3 秒冷却块,每帧只做轻量级的缓存读取和瞄准应用。
- #
- # 总噪声系数 noise_mul:
- # 在噪声生成后乘 N 除 D,当前 1/1(乘 0 可完全禁用)。
- # ============================================================
- (0.0, 0.0, 0.0,
- [
- (get_player_agent_no, ":player_no"),
- (store_mission_timer_a_msec, ":now"),
- (try_for_agents, ":agent_no"),
- (agent_is_active, ":agent_no"),
- (agent_is_alive, ":agent_no"),
- (agent_is_human, ":agent_no"),
- (neg|eq, ":agent_no", ":player_no"),
- (agent_get_slot, ":was_archer", ":agent_no", 1018),
- # ============================================================
- # 战斗胜利 或 撤退 → 清理骑射状态;否则 → 走完整逻辑
- # ============================================================
- (agent_get_team, ":team_no", ":agent_no"),
- (agent_get_division, ":division_no", ":agent_no"),
- (team_get_movement_order, ":movement_order", ":team_no", ":division_no"),
- (try_begin),
- (this_or_next|all_enemies_defeated),
- (eq, ":movement_order", mordr_retreat),
- # ----- 清理动作 -----
- (agent_set_attack_action, ":agent_no", -2, 1),
- (agent_clear_scripted_mode, ":agent_no"),
- (agent_force_rethink, ":agent_no"),
- (agent_set_slot, ":agent_no", 1018, 0),
- (agent_set_slot, ":agent_no", 1025, 0),
- (agent_set_slot, ":agent_no", 1027, 0),
- (agent_set_slot, ":agent_no", 1028, 0),
- (agent_set_slot, ":agent_no", 1034, 0),
- (else_try),
- # ============================================================
- # 条件 A:骑马 + 持弓
- # ============================================================
- (assign, ":mount_bow_ok", 0),
- (try_begin),
- (agent_get_horse, ":horse_no", ":agent_no"),
- (gt, ":horse_no", -1),
- (agent_get_wielded_item, ":weapon", ":agent_no", 0),
- (gt, ":weapon", 0),
- (item_get_type, ":type", ":weapon"),
- (eq, ":type", itp_type_bow),
- (assign, ":mount_bow_ok", 1),
- (try_end),
- # ============================================================
- # 条件 B:攻击中(0.5s去抖)
- # ============================================================
- (assign, ":attacking_now", 0),
- (try_begin),
- (agent_get_attack_action, ":action", ":agent_no"),
- (eq, ":action", 1),
- (assign, ":attacking_now", 1),
- (try_end),
- (assign, ":effective_ok", 0),
- (assign, ":do_stop", 0),
- (try_begin),
- # ---- A 不满足:立即退出 ----
- (eq, ":mount_bow_ok", 0),
- (agent_set_slot, ":agent_no", 1018, 0),
- (try_begin),
- (eq, ":was_archer", 1),
- (assign, ":do_stop", 1),
- (try_end),
- (else_try),
- # ---- A 满足 + B 满足:激活 + 刷新时间戳 ----
- (eq, ":attacking_now", 1),
- (agent_set_slot, ":agent_no", 1018, 1),
- (agent_set_slot, ":agent_no", 1026, ":now"),
- (assign, ":effective_ok", 1),
- (else_try),
- # ---- A 满足 + B 不满足:去抖 ----
- (agent_get_slot, ":last_ok_time", ":agent_no", 1026),
- (store_sub, ":gap", ":now", ":last_ok_time"),
- (try_begin),
- (lt, ":gap", 500),
- (eq, ":was_archer", 1),
- (agent_set_slot, ":agent_no", 1018, 1),
- (assign, ":effective_ok", 1),
- (else_try),
- (agent_set_slot, ":agent_no", 1018, 0),
- (try_begin),
- (eq, ":was_archer", 1),
- (assign, ":do_stop", 1),
- (try_end),
- (try_end),
- (try_end),
- # ============================================================
- # 主逻辑
- # ============================================================
- (try_begin),
- # ------------------------------------------------------------
- # 分支 1:effective_ok 但弹药不足 → 切近战武器 + 停止攻击
- # ------------------------------------------------------------
- (eq, ":effective_ok", 1),
- (agent_get_ammo, ":ammo_check", ":agent_no", 1),
- (le, ":ammo_check", 0),
- (assign, ":melee_weapon", -1),
- (try_for_range, ":slot_idx", 0, 4),
- (agent_get_item_slot, ":slot_item", ":agent_no", ":slot_idx"),
- (gt, ":slot_item", 0),
- (item_get_type, ":slot_type", ":slot_item"),
- (try_begin),
- (this_or_next|eq, ":slot_type", itp_type_one_handed_wpn),
- (this_or_next|eq, ":slot_type", itp_type_two_handed_wpn),
- (eq, ":slot_type", itp_type_polearm),
- (eq, ":melee_weapon", -1),
- (assign, ":melee_weapon", ":slot_item"),
- (try_end),
- (try_end),
- (try_begin),
- (gt, ":melee_weapon", 0),
- (agent_set_wielded_item, ":agent_no", ":melee_weapon"),
- (try_end),
- (agent_set_attack_action, ":agent_no", -2, 1),
- (else_try),
- # ------------------------------------------------------------
- # 分支 2:effective_ok 且弹药充足 → 主逻辑
- # ------------------------------------------------------------
- (eq, ":effective_ok", 1),
- (agent_ai_get_look_target, ":target", ":agent_no"),
- (gt, ":target", -1),
- (agent_is_alive, ":target"),
- (agent_is_human, ":target"),
- (agent_get_team, ":team1", ":agent_no"),
- (agent_get_team, ":team2", ":target"),
- (teams_are_enemies, ":team1", ":team2"),
- (agent_get_position, pos1, ":target"),
- (agent_get_horse, ":target_horse", ":target"),
- (try_begin),
- (gt, ":target_horse", -1),
- (position_move_z, pos1, 220, 1),
- (else_try),
- (position_move_z, pos1, 110, 1),
- (try_end),
- (agent_get_position, pos2, ":agent_no"),
- (position_move_z, pos2, 200, 1),
- # ============================================================
- # 每帧计算水平距离
- # ============================================================
- (set_fixed_point_multiplier, 1000),
- (position_get_x, ":tx", pos1),
- (position_get_y, ":ty", pos1),
- (position_get_x, ":px2", pos2),
- (position_get_y, ":py2", pos2),
- (store_sub, ":dx", ":tx", ":px2"),
- (store_sub, ":dy", ":ty", ":py2"),
- (store_mul, ":dx_sq", ":dx", ":dx"),
- (store_mul, ":dy_sq", ":dy", ":dy"),
- (store_add, ":dist_sq", ":dx_sq", ":dy_sq"),
- (set_fixed_point_multiplier, 1),
- (store_sqrt, ":dist", ":dist_sq"),
- (set_fixed_point_multiplier, 1000),
- # ============================================================
- # 0.3 秒冷却块:视线检查 + 方位检查 + 完整弹道计算
- # ============================================================
- (agent_get_slot, ":offset_time", ":agent_no", 1019),
- (store_sub, ":offset_elapsed", ":now", ":offset_time"),
- (try_begin),
- (ge, ":offset_elapsed", 300),
- (try_begin),
- (position_has_line_of_sight_to_position, pos2, pos1),
- (agent_get_position, pos7, ":agent_no"),
- (position_transform_position_to_local, pos8, pos7, pos1),
- (position_get_x, ":enemy_local_x", pos8),
- (position_get_y, ":enemy_local_y", pos8),
- (assign, ":side_ok", 0),
- (try_begin),
- (le, ":enemy_local_x", 0),
- (assign, ":side_ok", 1),
- (else_try),
- (gt, ":enemy_local_y", 0),
- (store_mul, ":check_x", ":enemy_local_x", 1000),
- (store_mul, ":check_y", ":enemy_local_y", 268),
- (le, ":check_x", ":check_y"),
- (assign, ":side_ok", 1),
- (try_end),
- (eq, ":side_ok", 1),
- (set_fixed_point_multiplier, 1000),
- (agent_get_position, pos3, ":agent_no"),
- (agent_get_speed, pos0, ":agent_no"),
- (position_transform_position_to_parent, pos4, pos3, pos0),
- (position_get_x, ":wx", pos4),
- (position_get_y, ":wy", pos4),
- (position_get_z, ":wz", pos4),
- (position_get_x, ":sx", pos3),
- (position_get_y, ":sy", pos3),
- (position_get_z, ":sz", pos3),
- (store_sub, ":wx", ":wx", ":sx"),
- (store_sub, ":wy", ":wy", ":sy"),
- (store_sub, ":wz", ":wz", ":sz"),
- (assign, ":shooter_vx", ":wx"),
- (assign, ":shooter_vy", ":wy"),
- (assign, ":shooter_vz", ":wz"),
- (agent_get_position, pos5, ":target"),
- (agent_get_speed, pos0, ":target"),
- (position_transform_position_to_parent, pos6, pos5, pos0),
- (position_get_x, ":tvx", pos6),
- (position_get_y, ":tvy", pos6),
- (position_get_z, ":tvz", pos6),
- (position_get_x, ":tsx", pos5),
- (position_get_y, ":tsy", pos5),
- (position_get_z, ":tsz", pos5),
- (store_sub, ":tvx", ":tvx", ":tsx"),
- (store_sub, ":tvy", ":tvy", ":tsy"),
- (store_sub, ":tvz", ":tvz", ":tsz"),
- (store_sub, ":relvx", ":tvx", ":shooter_vx"),
- (store_sub, ":relvy", ":tvy", ":shooter_vy"),
- (store_sub, ":relvz", ":tvz", ":shooter_vz"),
- # ---------- 飞行时间 ----------
- # 箭速 = 标称速度 × (1 + 0.033 × 强弓等级)
- # 强弓等级 0~10 → 系数 1.00 ~ 1.33
- # 用整数运算模拟:speed = speed × (1000 + 33 × pd) / 1000
- (agent_get_troop_id, ":troop_no_bt", ":agent_no"),
- (store_skill_level, ":pd_level", 33, ":troop_no_bt"),
- (assign, ":speed_mul", ":pd_level"),
- (val_mul, ":speed_mul", 33),
- (val_add, ":speed_mul", 1000),
- (item_get_missile_speed, ":speed", ":weapon"),
- (val_mul, ":speed", ":speed_mul"),
- (val_div, ":speed", 1000),
- (assign, ":t_ms", 0),
- (try_begin),
- (gt, ":speed", 0),
- (store_div, ":t_ms", ":dist", ":speed"),
- (try_end),
- (store_mul, ":ahead_dx", ":tvx", ":t_ms"),
- (val_div, ":ahead_dx", 1000),
- (store_mul, ":ahead_dy", ":tvy", ":t_ms"),
- (val_div, ":ahead_dy", 1000),
- (store_mul, ":ahead_dz", ":tvz", ":t_ms"),
- (val_div, ":ahead_dz", 1000),
- # 修正固定偏差
- (store_add, ":dist_plus", ":dist", 135000),
- (val_mul, ":wx", -1),
- (val_mul, ":wx", ":dist_plus"),
- (val_div, ":wx", 1500000),
- (val_mul, ":wy", -1),
- (val_mul, ":wy", ":dist_plus"),
- (val_div, ":wy", 1500000),
- # ============================================================
- # 噪声:每 0.5 秒重新生成一次
- # 弓熟练度修正系数:1 / (1 + 0.3 × sqrt(bow_prof))
- # 骑射技能修正系数:1 / (1 + 2 × sqrt(h_archery))
- # ============================================================
- (agent_get_slot, ":noise_time", ":agent_no", 1013),
- (store_sub, ":noise_elapsed", ":now", ":noise_time"),
- (try_begin),
- (ge, ":noise_elapsed", 500),
- (agent_get_troop_id, ":troop_no", ":agent_no"),
- (store_proficiency_level, ":bow_prof", ":troop_no", 3),
- (store_skill_level, ":h_archery", 23, ":troop_no"),
- # ---------- 弓熟练度修正系数 bp_factor = 1/(1+0.3*sqrt(bp)) ----------
- # 目标:sqrt(bow_prof) 用 fixed_point(1000) 表示
- (set_fixed_point_multiplier, 1000),
- (assign, ":sqrt_bp", ":bow_prof"),
- (val_mul, ":sqrt_bp", 1000),
- (store_sqrt, ":sqrt_bp", ":sqrt_bp"), # sqrt(bp) × 1000
- # 0.3 × sqrt(bp) = 3 × sqrt_bp / 10
- (store_mul, ":bp_temp", ":sqrt_bp", 3),
- (val_div, ":bp_temp", 10),
- # bp_den = (1 + 0.3*sqrt(bp)) × 1000
- (store_add, ":bp_den", 1000, ":bp_temp"),
- # bp_factor = 1000 × 1000 / bp_den,得到 fixed_point(1000) 的系数
- (assign, ":bp_factor", 1000000),
- (val_div, ":bp_factor", ":bp_den"),
- # ---------- 骑射技能修正系数 h_factor = 1/(1+2*sqrt(ha)) ----------
- (assign, ":sqrt_h", ":h_archery"),
- (val_mul, ":sqrt_h", 1000),
- (store_sqrt, ":sqrt_h", ":sqrt_h"), # sqrt(ha) × 1000
- # 2 × sqrt(ha)
- (store_mul, ":h_temp", ":sqrt_h", 2),
- # h_den = (1 + 2*sqrt(ha)) × 1000
- (store_add, ":h_den", 1000, ":h_temp"),
- # h_factor = 1000 × 1000 / h_den
- (assign, ":h_factor", 1000000),
- (val_div, ":h_factor", ":h_den"),
- # ---------- 基础散布 ----------
- # base_sigma = max(1, dist/10) × bp_factor
- (store_div, ":base_sigma", ":dist", 10),
- (val_max, ":base_sigma", 1),
- (val_mul, ":base_sigma", ":bp_factor"),
- (val_div, ":base_sigma", 1000),
- (val_max, ":base_sigma", 1),
- (assign, ":neg_b", ":base_sigma"),
- (val_mul, ":neg_b", -1),
- (assign, ":pos_b", ":base_sigma"),
- (val_add, ":pos_b", 1),
- (assign, ":base_x", 0),
- (try_for_range, ":i", 0, 3),
- (store_random_in_range, ":r", ":neg_b", ":pos_b"),
- (val_add, ":base_x", ":r"),
- (try_end),
- (assign, ":base_y", 0),
- (try_for_range, ":i", 0, 3),
- (store_random_in_range, ":r", ":neg_b", ":pos_b"),
- (val_add, ":base_y", ":r"),
- (try_end),
- (assign, ":base_z", 0),
- (try_for_range, ":i", 0, 3),
- (store_random_in_range, ":r", ":neg_b", ":pos_b"),
- (val_add, ":base_z", ":r"),
- (try_end),
- # ---------- 相对速度部分 ----------
- (store_mul, ":shift_x", ":relvx", ":t_ms"),
- (val_div, ":shift_x", 1000),
- (store_mul, ":shift_y", ":relvy", ":t_ms"),
- (val_div, ":shift_y", 1000),
- (store_mul, ":shift_z", ":relvz", ":t_ms"),
- (val_div, ":shift_z", 1000),
- (assign, ":g_shared", 0),
- (try_for_range, ":i", 0, 3),
- (store_random_in_range, ":r", -1000, 1001),
- (val_add, ":g_shared", ":r"),
- (try_end),
- # rel_axis = shift_axis × g_shared / 1000 × bp_factor / 1000
- (store_mul, ":rel_x", ":shift_x", ":g_shared"),
- (val_div, ":rel_x", 1000),
- (val_mul, ":rel_x", ":bp_factor"),
- (val_div, ":rel_x", 1000),
- (store_mul, ":rel_y", ":shift_y", ":g_shared"),
- (val_div, ":rel_y", 1000),
- (val_mul, ":rel_y", ":bp_factor"),
- (val_div, ":rel_y", 1000),
- (store_mul, ":rel_z", ":shift_z", ":g_shared"),
- (val_div, ":rel_z", 1000),
- (val_mul, ":rel_z", ":bp_factor"),
- (val_div, ":rel_z", 1000),
- (store_add, ":noise_x", ":base_x", ":rel_x"),
- (store_add, ":noise_y", ":base_y", ":rel_y"),
- (store_add, ":noise_z", ":base_z", ":rel_z"),
- # ---------- 自身速度部分 ----------
- (store_mul, ":v_sq_x", ":shooter_vx", ":shooter_vx"),
- (store_mul, ":v_sq_y", ":shooter_vy", ":shooter_vy"),
- (store_mul, ":v_sq_z", ":shooter_vz", ":shooter_vz"),
- (store_add, ":v_sq_sum", ":v_sq_x", ":v_sq_y"),
- (store_add, ":v_sq_sum", ":v_sq_sum", ":v_sq_z"),
- (set_fixed_point_multiplier, 1),
- (store_sqrt, ":speed_mag", ":v_sq_sum"),
- (set_fixed_point_multiplier, 1000),
- # n2base = |v| × t_ms / 1000
- (store_mul, ":n2base", ":speed_mag", ":t_ms"),
- (val_div, ":n2base", 1000),
- (assign, ":gauss_x", 0),
- (try_for_range, ":i", 0, 3),
- (store_random_in_range, ":r", -1000, 1001),
- (val_add, ":gauss_x", ":r"),
- (try_end),
- (assign, ":gauss_y", 0),
- (try_for_range, ":i", 0, 3),
- (store_random_in_range, ":r", -1000, 1001),
- (val_add, ":gauss_y", ":r"),
- (try_end),
- (assign, ":gauss_z", 0),
- (try_for_range, ":i", 0, 3),
- (store_random_in_range, ":r", -1000, 1001),
- (val_add, ":gauss_z", ":r"),
- (try_end),
- # noise2_axis = n2base × gauss_axis / 1000 × h_factor / 1000
- (store_mul, ":noise2_x", ":n2base", ":gauss_x"),
- (val_div, ":noise2_x", 1000),
- (val_mul, ":noise2_x", ":h_factor"),
- (val_div, ":noise2_x", 1000),
- (store_mul, ":noise2_y", ":n2base", ":gauss_y"),
- (val_div, ":noise2_y", 1000),
- (val_mul, ":noise2_y", ":h_factor"),
- (val_div, ":noise2_y", 1000),
- (store_mul, ":noise2_z", ":n2base", ":gauss_z"),
- (val_div, ":noise2_z", 1000),
- (val_mul, ":noise2_z", ":h_factor"),
- (val_div, ":noise2_z", 1000),
- (val_add, ":noise_x", ":noise2_x"),
- (val_add, ":noise_y", ":noise2_y"),
- (val_add, ":noise_z", ":noise2_z"),
- # 总噪声系数 noise_mul
- (val_mul, ":noise_x", 1),
- (val_div, ":noise_x", 1),
- (val_mul, ":noise_y", 1),
- (val_div, ":noise_y", 1),
- (val_mul, ":noise_z", 1),
- (val_div, ":noise_z", 1),
- (agent_set_slot, ":agent_no", 1014, ":noise_x"),
- (agent_set_slot, ":agent_no", 1015, ":noise_y"),
- (agent_set_slot, ":agent_no", 1016, ":noise_z"),
- (agent_set_slot, ":agent_no", 1013, ":now"),
- (try_end),
- (agent_get_slot, ":noise_x", ":agent_no", 1014),
- (agent_get_slot, ":noise_y", ":agent_no", 1015),
- (agent_get_slot, ":noise_z", ":agent_no", 1016),
- (store_mul, ":gravity_dz", ":t_ms", ":t_ms"),
- (val_div, ":gravity_dz", 300),
- (store_add, ":total_offset_x", ":ahead_dx", ":wx"),
- (val_add, ":total_offset_x", ":noise_x"),
- (store_add, ":total_offset_y", ":ahead_dy", ":wy"),
- (val_add, ":total_offset_y", ":noise_y"),
- (store_add, ":total_offset_z", ":ahead_dz", ":noise_z"),
- (val_add, ":total_offset_z", ":gravity_dz"),
- (agent_set_slot, ":agent_no", 1020, ":total_offset_x"),
- (agent_set_slot, ":agent_no", 1021, ":total_offset_y"),
- (agent_set_slot, ":agent_no", 1022, ":total_offset_z"),
- (agent_set_slot, ":agent_no", 1023, ":t_ms"),
- (agent_set_slot, ":agent_no", 1025, 1),
- (else_try),
- (agent_set_slot, ":agent_no", 1025, 0),
- (try_end),
- (agent_set_slot, ":agent_no", 1019, ":now"),
- (try_end),
- # ============================================================
- # 读取缓存
- # ============================================================
- (agent_get_slot, ":los_ok", ":agent_no", 1025),
- (agent_get_slot, ":offset_x", ":agent_no", 1020),
- (agent_get_slot, ":offset_y", ":agent_no", 1021),
- (agent_get_slot, ":offset_z", ":agent_no", 1022),
- (agent_get_slot, ":t_ms", ":agent_no", 1023),
- (position_get_x, ":px", pos1),
- (position_get_y, ":py", pos1),
- (position_get_z, ":pz", pos1),
- (val_add, ":px", ":offset_x"),
- (val_add, ":py", ":offset_y"),
- (val_add, ":pz", ":offset_z"),
- (position_set_x, pos1, ":px"),
- (position_set_y, pos1, ":py"),
- (position_set_z, pos1, ":pz"),
- (agent_set_look_target_position, ":agent_no", pos1),
- # ============================================================
- # 目标切换检测
- # ============================================================
- (agent_get_slot, ":last_target", ":agent_no", 1034),
- (try_begin),
- (neq, ":target", ":last_target"),
- (store_random_in_range, ":switch_cd", 300, 701),
- (store_add, ":switch_until", ":now", ":switch_cd"),
- (agent_set_slot, ":agent_no", 1028, ":switch_until"),
- (agent_set_slot, ":agent_no", 1034, ":target"),
- (try_end),
- # ============================================================
- # 拉弓时间追踪
- # ============================================================
- (agent_get_attack_action, ":cur_action", ":agent_no"),
- (try_begin),
- (eq, ":cur_action", 1),
- (agent_get_slot, ":draw_start", ":agent_no", 1027),
- (try_begin),
- (eq, ":draw_start", 0),
- (agent_set_slot, ":agent_no", 1027, ":now"),
- (assign, ":draw_start", ":now"),
- (store_random_in_range, ":new_req", 1000, 2001),
- (agent_set_slot, ":agent_no", 1012, ":new_req"),
- (try_end),
- (else_try),
- (agent_set_slot, ":agent_no", 1027, 0),
- (assign, ":draw_start", ":now"),
- (try_end),
- (store_sub, ":draw_duration", ":now", ":draw_start"),
- (agent_get_slot, ":cd", ":agent_no", 1012),
- (agent_get_slot, ":switch_until", ":agent_no", 1028),
- # ============================================================
- # 依次执行
- # ============================================================
- # 1. 视线/方位通过 → 保持拉弓
- (try_begin),
- (eq, ":los_ok", 1),
- (agent_set_attack_action, ":agent_no", 3, 1),
- (try_end),
- # 2. 已在拉弓中 → 保持拉弓
- (try_begin),
- (eq, ":cur_action", 1),
- (agent_set_attack_action, ":agent_no", 3, 1),
- (try_end),
- # 3. 拉弓超过 6 秒 → 取消攻击,清拉弓计时
- (try_begin),
- (gt, ":draw_duration", 6000),
- (agent_set_attack_action, ":agent_no", -2, 1),
- (agent_set_slot, ":agent_no", 1027, 0),
- (try_end),
- # 4. 释放条件
- (try_begin),
- (eq, ":los_ok", 1),
- (ge, ":draw_duration", ":cd"),
- (lt, ":dist", 100000),
- (ge, ":now", ":switch_until"),
- (agent_set_attack_action, ":agent_no", 3, 0),
- (agent_set_slot, ":agent_no", 1027, 0),
- (try_end),
- # 5. 视线/方位不通过 + 未在拉弓 → 取消攻击
- (try_begin),
- (eq, ":los_ok", 0),
- (neq, ":cur_action", 1),
- (agent_set_attack_action, ":agent_no", -2, 1),
- (try_end),
- (else_try),
- # ------------------------------------------------------------
- # 分支 3:退出分支
- # ------------------------------------------------------------
- (eq, ":do_stop", 1),
- (agent_set_attack_action, ":agent_no", -2, 1),
- (try_end),
- (try_end),
- (try_end),
- ],
- [])
复制代码 |
| 0.000000 0.000000 0.000000 420 1700 1 1224979098644774912 2365 1 1224979098644774913 12 1 1224979098644774914 1712 1 1224979098644774914 1702 1 1224979098644774914 1704 1 1224979098644774914 2147483679 2 1224979098644774914 1224979098644774912 525 3 1224979098644774915 1224979098644774914 1018 1770 2 1224979098644774916 1224979098644774914 1773 2 1224979098644774917 1224979098644774914 1785 3 1224979098644774918 1224979098644774916 1224979098644774917 4 0 1073742827 0 31 2 1224979098644774918 14 1745 3 1224979098644774914 -2 1 1735 1 1224979098644774914 1732 1 1224979098644774914 505 3 1224979098644774914 1018 0 505 3 1224979098644774914 1025 0 505 3 1224979098644774914 1027 0 505 3 1224979098644774914 1028 0 505 3 1224979098644774914 1034 0 5 0 2133 2 1224979098644774919 0 4 0 1714 2 1224979098644774920 1224979098644774914 32 2 1224979098644774920 -1 1726 3 1224979098644774921 1224979098644774914 0 32 2 1224979098644774921 0 1570 2 1224979098644774922 1224979098644774921 31 2 1224979098644774922 8 2133 2 1224979098644774919 1 3 0 2133 2 1224979098644774923 0 4 0 1763 2 1224979098644774924 1224979098644774914 31 2 1224979098644774924 1 2133 2 1224979098644774923 1 3 0 2133 2 1224979098644774925 0 2133 2 1224979098644774926 0 4 0 31 2 1224979098644774919 0 505 3 1224979098644774914 1018 0 4 0 31 2 1224979098644774915 1 2133 2 1224979098644774926 1 3 0 5 0 31 2 1224979098644774923 1 505 3 1224979098644774914 1018 1 505 3 1224979098644774914 1026 1224979098644774913 2133 2 1224979098644774925 1 5 0 525 3 1224979098644774927 1224979098644774914 1026 2121 3 1224979098644774928 1224979098644774913 1224979098644774927 4 0 2147483678 2 1224979098644774928 500 31 2 1224979098644774915 1 505 3 1224979098644774914 1018 1 2133 2 1224979098644774925 1 5 0 505 3 1224979098644774914 1018 0 4 0 31 2 1224979098644774915 1 2133 2 1224979098644774926 1 3 0 3 0 3 0 4 0 31 2 1224979098644774925 1 1727 3 1224979098644774929 1224979098644774914 1 2147483680 2 1224979098644774929 0 2133 2 1224979098644774930 -1 6 3 1224979098644774931 0 4 1804 3 1224979098644774932 1224979098644774914 1224979098644774931 32 2 1224979098644774932 0 1570 2 1224979098644774933 1224979098644774932 4 0 1073741855 2 1224979098644774933 2 1073741855 2 1224979098644774933 3 31 2 1224979098644774933 4 31 2 1224979098644774930 -1 2133 2 1224979098644774930 1224979098644774932 3 0 3 0 4 0 32 2 1224979098644774930 0 1747 2 1224979098644774914 1224979098644774930 3 0 1745 3 1224979098644774914 -2 1 5 0 31 2 1224979098644774925 1 2080 2 1224979098644774934 1224979098644774914 32 2 1224979098644774934 -1 1702 1 1224979098644774934 1704 1 1224979098644774934 1770 2 1224979098644774935 1224979098644774914 1770 2 1224979098644774936 1224979098644774934 1788 2 1224979098644774935 1224979098644774936 1710 2 1 1224979098644774934 1714 2 1224979098644774937 1224979098644774934 4 0 32 2 1224979098644774937 -1 722 3 1 220 1 5 0 722 3 1 110 1 3 0 1710 2 2 1224979098644774914 722 3 2 200 1 2124 1 1000 726 2 1224979098644774938 1 727 2 1224979098644774939 1 726 2 1224979098644774940 2 727 2 1224979098644774941 2 2121 3 1224979098644774942 1224979098644774938 1224979098644774940 2121 3 1224979098644774943 1224979098644774939 1224979098644774941 2122 3 1224979098644774944 1224979098644774942 1224979098644774942 2122 3 1224979098644774945 1224979098644774943 1224979098644774943 2120 3 1224979098644774946 1224979098644774944 1224979098644774945 2124 1 1 2125 2 1224979098644774947 1224979098644774946 2124 1 1000 525 3 1224979098644774948 1224979098644774914 1019 2121 3 1224979098644774949 1224979098644774913 1224979098644774948 4 0 30 2 1224979098644774949 300 4 0 707 2 2 1 1710 2 7 1224979098644774914 717 3 8 7 1 726 2 1224979098644774950 8 727 2 1224979098644774951 8 2133 2 1224979098644774952 0 4 0 2147483680 2 1224979098644774950 0 2133 2 1224979098644774952 1 5 0 32 2 1224979098644774951 0 2122 3 1224979098644774953 1224979098644774950 1000 2122 3 1224979098644774954 1224979098644774951 268 2147483680 2 1224979098644774953 1224979098644774954 2133 2 1224979098644774952 1 3 0 31 2 1224979098644774952 1 2124 1 1000 1710 2 3 1224979098644774914 1689 2 0 1224979098644774914 716 3 4 3 0 726 2 1224979098644774955 4 727 2 1224979098644774956 4 728 2 1224979098644774957 4 726 2 1224979098644774958 3 727 2 1224979098644774959 3 728 2 1224979098644774960 3 2121 3 1224979098644774955 1224979098644774955 1224979098644774958 2121 3 1224979098644774956 1224979098644774956 1224979098644774959 2121 3 1224979098644774957 1224979098644774957 1224979098644774960 2133 2 1224979098644774961 1224979098644774955 2133 2 1224979098644774962 1224979098644774956 2133 2 1224979098644774963 1224979098644774957 1710 2 5 1224979098644774934 1689 2 0 1224979098644774934 716 3 6 5 0 726 2 1224979098644774964 6 727 2 1224979098644774965 6 728 2 1224979098644774966 6 726 2 1224979098644774967 5 727 2 1224979098644774968 5 728 2 1224979098644774969 5 2121 3 1224979098644774964 1224979098644774964 1224979098644774967 2121 3 1224979098644774965 1224979098644774965 1224979098644774968 2121 3 1224979098644774966 1224979098644774966 1224979098644774969 2121 3 1224979098644774970 1224979098644774964 1224979098644774961 2121 3 1224979098644774971 1224979098644774965 1224979098644774962 2121 3 1224979098644774972 1224979098644774966 1224979098644774963 1718 2 1224979098644774973 1224979098644774914 2170 3 1224979098644774974 33 1224979098644774973 2133 2 1224979098644774975 1224979098644774974 2107 2 1224979098644774975 33 2105 2 1224979098644774975 1000 2709 2 1224979098644774976 1224979098644774921 2107 2 1224979098644774976 1224979098644774975 2108 2 1224979098644774976 1000 2133 2 1224979098644774977 0 4 0 32 2 1224979098644774976 0 2123 3 1224979098644774977 1224979098644774947 1224979098644774976 3 0 2122 3 1224979098644774978 1224979098644774964 1224979098644774977 2108 2 1224979098644774978 1000 2122 3 1224979098644774979 1224979098644774965 1224979098644774977 2108 2 1224979098644774979 1000 2122 3 1224979098644774980 1224979098644774966 1224979098644774977 2108 2 1224979098644774980 1000 2120 3 1224979098644774981 1224979098644774947 135000 2107 2 1224979098644774955 -1 2107 2 1224979098644774955 1224979098644774981 2108 2 1224979098644774955 1500000 2107 2 1224979098644774956 -1 2107 2 1224979098644774956 1224979098644774981 2108 2 1224979098644774956 1500000 525 3 1224979098644774982 1224979098644774914 1013 2121 3 1224979098644774983 1224979098644774913 1224979098644774982 4 0 30 2 1224979098644774983 500 1718 2 1224979098644774984 1224979098644774914 2176 3 1224979098644774985 1224979098644774984 3 2170 3 1224979098644774986 23 1224979098644774984 2124 1 1000 2133 2 1224979098644774987 1224979098644774985 2107 2 1224979098644774987 1000 2125 2 1224979098644774987 1224979098644774987 2122 3 1224979098644774988 1224979098644774987 3 2108 2 1224979098644774988 10 2120 3 1224979098644774989 1000 1224979098644774988 2133 2 1224979098644774990 1000000 2108 2 1224979098644774990 1224979098644774989 2133 2 1224979098644774991 1224979098644774986 2107 2 1224979098644774991 1000 2125 2 1224979098644774991 1224979098644774991 2122 3 1224979098644774992 1224979098644774991 2 2120 3 1224979098644774993 1000 1224979098644774992 2133 2 1224979098644774994 1000000 2108 2 1224979098644774994 1224979098644774993 2123 3 1224979098644774995 1224979098644774947 10 2111 2 1224979098644774995 1 2107 2 1224979098644774995 1224979098644774990 2108 2 1224979098644774995 1000 2111 2 1224979098644774995 1 2133 2 1224979098644774996 1224979098644774995 2107 2 1224979098644774996 -1 2133 2 1224979098644774997 1224979098644774995 2105 2 1224979098644774997 1 2133 2 1224979098644774998 0 6 3 1224979098644774999 0 3 2136 3 1224979098644775000 1224979098644774996 1224979098644774997 2105 2 1224979098644774998 1224979098644775000 3 0 2133 2 1224979098644775001 0 6 3 1224979098644774999 0 3 2136 3 1224979098644775000 1224979098644774996 1224979098644774997 2105 2 1224979098644775001 1224979098644775000 3 0 2133 2 1224979098644775002 0 6 3 1224979098644774999 0 3 2136 3 1224979098644775000 1224979098644774996 1224979098644774997 2105 2 1224979098644775002 1224979098644775000 3 0 2122 3 1224979098644775003 1224979098644774970 1224979098644774977 2108 2 1224979098644775003 1000 2122 3 1224979098644775004 1224979098644774971 1224979098644774977 2108 2 1224979098644775004 1000 2122 3 1224979098644775005 1224979098644774972 1224979098644774977 2108 2 1224979098644775005 1000 2133 2 1224979098644775006 0 6 3 1224979098644774999 0 3 2136 3 1224979098644775000 -1000 1001 2105 2 1224979098644775006 1224979098644775000 3 0 2122 3 1224979098644775007 1224979098644775003 1224979098644775006 2108 2 1224979098644775007 1000 2107 2 1224979098644775007 1224979098644774990 2108 2 1224979098644775007 1000 2122 3 1224979098644775008 1224979098644775004 1224979098644775006 2108 2 1224979098644775008 1000 2107 2 1224979098644775008 1224979098644774990 2108 2 1224979098644775008 1000 2122 3 1224979098644775009 1224979098644775005 1224979098644775006 2108 2 1224979098644775009 1000 2107 2 1224979098644775009 1224979098644774990 2108 2 1224979098644775009 1000 2120 3 1224979098644775010 1224979098644774998 1224979098644775007 2120 3 1224979098644775011 1224979098644775001 1224979098644775008 2120 3 1224979098644775012 1224979098644775002 1224979098644775009 2122 3 1224979098644775013 1224979098644774961 1224979098644774961 2122 3 1224979098644775014 1224979098644774962 1224979098644774962 2122 3 1224979098644775015 1224979098644774963 1224979098644774963 2120 3 1224979098644775016 1224979098644775013 1224979098644775014 2120 3 1224979098644775016 1224979098644775016 1224979098644775015 2124 1 1 2125 2 1224979098644775017 1224979098644775016 2124 1 1000 2122 3 1224979098644775018 1224979098644775017 1224979098644774977 2108 2 1224979098644775018 1000 2133 2 1224979098644775019 0 6 3 1224979098644774999 0 3 2136 3 1224979098644775000 -1000 1001 2105 2 1224979098644775019 1224979098644775000 3 0 2133 2 1224979098644775020 0 6 3 1224979098644774999 0 3 2136 3 1224979098644775000 -1000 1001 2105 2 1224979098644775020 1224979098644775000 3 0 2133 2 1224979098644775021 0 6 3 1224979098644774999 0 3 2136 3 1224979098644775000 -1000 1001 2105 2 1224979098644775021 1224979098644775000 3 0 2122 3 1224979098644775022 1224979098644775018 1224979098644775019 2108 2 1224979098644775022 1000 2107 2 1224979098644775022 1224979098644774994 2108 2 1224979098644775022 1000 2122 3 1224979098644775023 1224979098644775018 1224979098644775020 2108 2 1224979098644775023 1000 2107 2 1224979098644775023 1224979098644774994 2108 2 1224979098644775023 1000 2122 3 1224979098644775024 1224979098644775018 1224979098644775021 2108 2 1224979098644775024 1000 2107 2 1224979098644775024 1224979098644774994 2108 2 1224979098644775024 1000 2105 2 1224979098644775010 1224979098644775022 2105 2 1224979098644775011 1224979098644775023 2105 2 1224979098644775012 1224979098644775024 2107 2 1224979098644775010 1 2108 2 1224979098644775010 1 2107 2 1224979098644775011 1 2108 2 1224979098644775011 1 2107 2 1224979098644775012 1 2108 2 1224979098644775012 1 505 3 1224979098644774914 1014 1224979098644775010 505 3 1224979098644774914 1015 1224979098644775011 505 3 1224979098644774914 1016 1224979098644775012 505 3 1224979098644774914 1013 1224979098644774913 3 0 525 3 1224979098644775010 1224979098644774914 1014 525 3 1224979098644775011 1224979098644774914 1015 525 3 1224979098644775012 1224979098644774914 1016 2122 3 1224979098644775025 1224979098644774977 1224979098644774977 2108 2 1224979098644775025 300 2120 3 1224979098644775026 1224979098644774978 1224979098644774955 2105 2 1224979098644775026 1224979098644775010 2120 3 1224979098644775027 1224979098644774979 1224979098644774956 2105 2 1224979098644775027 1224979098644775011 2120 3 1224979098644775028 1224979098644774980 1224979098644775012 2105 2 1224979098644775028 1224979098644775025 505 3 1224979098644774914 1020 1224979098644775026 505 3 1224979098644774914 1021 1224979098644775027 505 3 1224979098644774914 1022 1224979098644775028 505 3 1224979098644774914 1023 1224979098644774977 505 3 1224979098644774914 1025 1 5 0 505 3 1224979098644774914 1025 0 3 0 505 3 1224979098644774914 1019 1224979098644774913 3 0 525 3 1224979098644775029 1224979098644774914 1025 525 3 1224979098644775030 1224979098644774914 1020 525 3 1224979098644775031 1224979098644774914 1021 525 3 1224979098644775032 1224979098644774914 1022 525 3 1224979098644774977 1224979098644774914 1023 726 2 1224979098644775033 1 727 2 1224979098644775034 1 728 2 1224979098644775035 1 2105 2 1224979098644775033 1224979098644775030 2105 2 1224979098644775034 1224979098644775031 2105 2 1224979098644775035 1224979098644775032 729 2 1 1224979098644775033 730 2 1 1224979098644775034 731 2 1 1224979098644775035 1744 2 1224979098644774914 1 525 3 1224979098644775036 1224979098644774914 1034 4 0 2147483679 2 1224979098644774934 1224979098644775036 2136 3 1224979098644775037 300 701 2120 3 1224979098644775038 1224979098644774913 1224979098644775037 505 3 1224979098644774914 1028 1224979098644775038 505 3 1224979098644774914 1034 1224979098644774934 3 0 1763 2 1224979098644775039 1224979098644774914 4 0 31 2 1224979098644775039 1 525 3 1224979098644775040 1224979098644774914 1027 4 0 31 2 1224979098644775040 0 505 3 1224979098644774914 1027 1224979098644774913 2133 2 1224979098644775040 1224979098644774913 2136 3 1224979098644775041 1000 2001 505 3 1224979098644774914 1012 1224979098644775041 3 0 5 0 505 3 1224979098644774914 1027 0 2133 2 1224979098644775040 1224979098644774913 3 0 2121 3 1224979098644775042 1224979098644774913 1224979098644775040 525 3 1224979098644775043 1224979098644774914 1012 525 3 1224979098644775038 1224979098644774914 1028 4 0 31 2 1224979098644775029 1 1745 3 1224979098644774914 3 1 3 0 4 0 31 2 1224979098644775039 1 1745 3 1224979098644774914 3 1 3 0 4 0 32 2 1224979098644775042 6000 1745 3 1224979098644774914 -2 1 505 3 1224979098644774914 1027 0 3 0 4 0 31 2 1224979098644775029 1 30 2 1224979098644775042 1224979098644775043 2147483678 2 1224979098644774947 100000 30 2 1224979098644774913 1224979098644775038 1745 3 1224979098644774914 3 0 505 3 1224979098644774914 1027 0 3 0 4 0 31 2 1224979098644775029 0 2147483679 2 1224979098644775039 1 1745 3 1224979098644774914 -2 1 3 0 5 0 31 2 1224979098644774926 1 1745 3 1224979098644774914 -2 1 3 0 3 0 3 0 0 |
需要把代码加到可能有骑射手的几个场景下,如果是未修改过的3.9.5原版潘德可以直接用附件中的txt文档替换原来的mission_templates.txt。 |
|