骑砍战团MOD开发(22)-九枪环马战车横扫战场

发布时间:2023年12月18日

骑砍1战团mod开发-九枪环马战车横扫战场_哔哩哔哩_bilibili

?一.初始化战车

  # spawn_gty_horse_spear
  # Input: none
  # Output: none 
  ("spawn_gty_horse_spear", [
    (init_position, pos1),
    (get_player_agent_no, ":player_agent"),
    (agent_get_horse, ":player_horse", ":player_agent"),
    (agent_get_position, pos1, ":player_horse"),
    (neq, ":player_horse", -1),
    (try_for_range, ":index", 0, 9),
       (try_begin),
          (lt, ":index", 3),
          (try_begin),
             (eq, ":index", 0),
             (position_move_z, pos1, 100, 0),
             (position_move_y, pos1, 100, 0),
             (position_move_x, pos1, -150, 0),
          (try_end),
          (position_move_y, pos1, -50, 0),
          (init_position, pos2),
          (position_copy_origin, pos2, pos1),
          (position_copy_rotation, pos2, pos1),
          (position_move_y, pos2, 0, 1),
          (position_rotate_x, pos2, 0),
          (set_spawn_position, pos2),
          (spawn_scene_prop, "spr_gty_horse_spear"),
       (else_try),
          (lt, ":index", 6),
          (try_begin),
             (eq, ":index", 3),
             (position_move_y, pos1, -50, 0),
             (position_move_x, pos1, 300, 0),
          (try_end),
          (position_move_y, pos1, 50, 0),
          (init_position, pos2),
          (position_copy_origin, pos2, pos1),
          (position_copy_rotation, pos2, pos1),
          (position_move_y, pos2, 0, 1),
          (position_rotate_z, pos2, 180),
          (position_rotate_x, pos2, 0),
          (set_spawn_position, pos2),
          (spawn_scene_prop, "spr_gty_horse_spear"),
       (else_try),
          (lt, ":index", 9),
          (try_begin),
             (eq, ":index", 6),
             (position_move_z, pos1, 40, 0),
             (position_move_y, pos1, 170, 0),
             (position_move_x, pos1, -220, 0),
          (try_end),
          (position_move_x, pos1, 40, 0),
          (init_position, pos2),
          (position_copy_origin, pos2, pos1),
          (position_copy_rotation, pos2, pos1),
          (position_move_y, pos2, 0, 1),
          (position_rotate_z, pos2, -90),
          (position_rotate_x, pos2, 0),
          (set_spawn_position, pos2),
          (spawn_scene_prop, "spr_gty_horse_spear"),
       (try_end),
    (try_end),
  ]),

二.战车移动

  # refresh_gty_horse_spear_position
  # Input: none
  # Output: none 
  ("refresh_gty_horse_spear_position", [
    (init_position, pos3),
    (store_mul, ":rotate_angle", 10, "$gty_horse_spear_rotate_index"),
    (get_player_agent_no, ":player_agent"),
    (agent_get_horse, ":player_horse", ":player_agent"),
    (neq, ":player_horse", -1),
    (agent_get_position, pos3, ":player_horse"),
    (assign, ":index", 0),
    (try_for_prop_instances, ":instance_no", "spr_gty_horse_spear"),
       (try_begin),
          (lt, ":index", 3),
          (try_begin),
             (eq, ":index", 0),
             (position_move_z, pos3, 100, 0),
             (position_move_y, pos3, 100, 0),
             (position_move_x, pos3, -150, 0),
          (try_end),
          (position_move_y, pos3, -50, 0),
          (init_position, pos4),
          (position_copy_origin, pos4, pos3),
          (position_copy_rotation, pos4, pos3),
          (position_move_y, pos4, 0, 1),
          (position_rotate_x, pos4, ":rotate_angle"),
          (prop_instance_set_position, ":instance_no", pos4),
       (else_try),
          (lt, ":index", 6),
          (try_begin),
             (eq, ":index", 3),
             (position_move_y, pos3, -50, 0),
             (position_move_x, pos3, 300, 0),
          (try_end),
          (position_move_y, pos3, 50, 0),
          (init_position, pos4),
          (position_copy_origin, pos4, pos3),
          (position_copy_rotation, pos4, pos3),
          (position_move_y, pos4, 0, 1),
          (position_rotate_z, pos4, 180),
          (position_rotate_x, pos4, ":rotate_angle"),
          (prop_instance_set_position, ":instance_no", pos4),
       (else_try),
          (lt, ":index", 9),
          (try_begin),
             (eq, ":index", 6),
             (position_move_z, pos3, 40, 0),
             (position_move_y, pos3, 170, 0),
             (position_move_x, pos3, -220, 0),
          (try_end),
          (position_move_x, pos3, 40, 0),
          (init_position, pos4),
          (position_copy_origin, pos4, pos3),
          (position_copy_rotation, pos4, pos3),
          (position_move_y, pos4, 0, 1),
          (position_rotate_z, pos4, -90),
          (position_rotate_x, pos4, ":rotate_angle"),
          (prop_instance_set_position, ":instance_no", pos4),
       (try_end),
       (val_add, ":index", 1),
    (try_end),
  ]),

三.战车伤害检测

#damage detect
(0, 0, 0, [],[ 
   (init_position, pos7),
   (init_position, pos8),
   (get_player_agent_no, ":player_agent"),
   (try_for_prop_instances, ":instance_no", "spr_gty_horse_spear"),
      (prop_instance_get_position, pos7, ":instance_no"),
      (try_for_agents, ":agent_no"),
         (neg|agent_is_ally, ":agent_no"),
		 (agent_is_alive, ":agent_no"),
         (agent_get_position, pos8, ":agent_no"),
         (get_distance_between_positions, ":distance", pos7, pos8),
         (try_begin),
            (lt, ":distance", 200),
            (agent_deliver_damage_to_agent, ":player_agent", ":agent_no", 30, "itm_khergit_arrows"),
         (try_end),
      (try_end),
  (try_end),
]),

文章来源:https://blog.csdn.net/qq_35829452/article/details/135065025
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。