本帖最后由 a1550887802 于 2024-8-31 19:06 编辑
("cf_light_weapons_system_a",
[
(try_for_agents, ":agent"),
(agent_is_human, ":agent"),
(agent_is_alive, ":agent"),
(agent_get_wielded_item, ":wielded_item", ":agent"),
(gt, ":wielded_item", -1),
(agent_get_slot, ":shoot_num", ":agent", slot_agent_linkspr_no_a),
(item_get_type, ":item_type", ":wielded_item"),
(this_or_next|eq, ":item_type", itp_type_pistol),
(this_or_next|eq, ":item_type", itp_type_crossbow),
(this_or_next|eq, ":item_type", itp_type_bow),
(eq, ":item_type", itp_type_musket),
(try_begin),
(gt, ":shoot_num", 1),
(gt, ":wielded_item", -1),
(try_for_range, ":item_slot", 0, 4),
(agent_get_item_slot, ":wielded_item_id",":agent",":item_slot"),
(eq, ":wielded_item", ":wielded_item_id"),
(agent_get_item_cur_ammo, ":cur_ammo", ":agent",":item_slot"),
(try_end),
(try_begin),
(this_or_next|le, ":cur_ammo", 0),
(lt,":cur_ammo",":shoot_num"),
(agent_set_slot, ":agent", slot_agent_linkspr_no_a,0),
(try_end),
(try_for_range, ":item_slot", 0, 4),
(agent_get_item_slot, ":wielded_item_id",":agent",":item_slot"),
(gt, ":wielded_item_id", -1),
(item_get_type, ":slot_type", ":wielded_item_id"),
(try_begin),
(this_or_next|eq, ":item_type", itp_type_pistol),
(eq, ":item_type", itp_type_musket),
(eq, ":slot_type", itp_type_bullets),
(assign,":ammo",":wielded_item_id"),
(else_try),
(eq, ":item_type", itp_type_crossbow),
(eq, ":slot_type", itp_type_bolts),
(assign,":ammo",":wielded_item_id"),
(else_try),
(eq, ":item_type", itp_type_bow),
(eq, ":slot_type", itp_type_arrows),
(assign,":ammo",":wielded_item_id"),
(try_end),
(try_end),
(gt, ":cur_ammo", 0),
(try_begin),
(eq, ":item_type", itp_type_pistol),
(agent_set_animation, ":agent", "anim_ready_pistol", 1),
(else_try),
(agent_set_animation, ":agent", "anim_ready_musket", 1),
(try_end),
(set_fixed_point_multiplier, 1),
(assign,":accuracy" ,750),
(convert_to_fixed_point, ":accuracy"),
(agent_set_accuracy_modifier, ":agent", ":accuracy"),
(agent_get_look_position, pos59, ":agent"),
(agent_get_bone_position, 58, ":agent", 19, 1),
(set_fixed_point_multiplier, 1),
(item_get_accuracy,":accuracy", ":wielded_item"),
(try_begin),
(lt,":accuracy",90),
(val_sub,":accuracy",100),
(val_abs,":accuracy"),
(else_try),
(assign,":accuracy",10),
(try_end),
(assign,":accuracy_up" ,":accuracy"),
(assign,":accuracy_down" ,":accuracy"),
(val_mul,":accuracy_down",-1),
(set_fixed_point_multiplier, 1),
(position_move_y, pos58, 100),
(position_move_x, pos58, -8),
(position_copy_rotation, pos58, pos59),
(particle_system_burst, "psys_gourd_smoke", pos58, 1),
(store_random_in_range, ":var_15", ":accuracy_down", ":accuracy_up"),
(store_random_in_range, ":var_16", ":accuracy_down", ":accuracy_up"),
(set_fixed_point_multiplier, 10),
(position_rotate_x_floating, pos58, ":var_16"),
(position_rotate_z_floating, pos58, ":var_15"),
(item_get_missile_speed, ":missile_speed", ":wielded_item"),
(set_fixed_point_multiplier, 1),
(convert_to_fixed_point, ":missile_speed"),
(play_sound_at_position, "snd_release_crossbow", pos58, 0),
(add_missile, ":agent", pos58, ":missile_speed", ":wielded_item", 0, ":ammo", 0),
(agent_get_wielded_item, ":wielded", ":agent"),
(try_for_range, ":item_slot", 0, 4),
(agent_get_item_slot, ":wielded_item_id",":agent",":item_slot"),
(eq, ":wielded", ":wielded_item_id"),
(agent_get_item_cur_ammo, ":var_8", ":agent",":item_slot"),
(try_end),
(val_sub, ":var_8", 1),
(agent_set_ammo, ":agent", ":wielded", ":var_8"),
(val_sub, ":shoot_num", 1),
(agent_set_slot, ":agent", slot_agent_linkspr_no_a,":shoot_num"),
(le, ":shoot_num", 1),
(agent_set_animation, ":agent", "anim_release_musket", 1),
(else_try),#
(agent_get_slot, ":var_5", ":agent", slot_agent_linkspr_no_a),
(le, ":shoot_num", 1),
(agent_get_wielded_item, ":wielded_item", ":agent"),
(gt, ":wielded_item", -1),
(set_fixed_point_multiplier, 1),
(agent_set_slot, ":agent", slot_agent_linkspr_no_a, 0),
(item_get_accuracy,":accuracy", ":wielded_item"),
(agent_set_accuracy_modifier, ":agent", ":accuracy"),#
(try_end),
(try_end),
]),
#######################
|