## 散弹 但是每一个弹头都是自瞄
散弹 但是每个弹头都是自瞄 并且会锁定不同的敌人
演示视频:
https://github.com/b1inkie/b1inkie.github.io/releases/download/previewvideo1/preview1.mp4
(打不开就算了
**添加方式**: 武器攻击触发器
```python
#------以下为配置部分--------------------------------------------------
(assign,":bullets_num",30), #分裂数量 设置太多可能会卡
(assign,":max_range",10000), #自瞄响应的最大射程 单位 米
#---------------------------------------------------------------------
(assign,":agent_slot_begin",1400), #起始槽位 不和其他slot起冲突时请勿修改
#------以上为配置部分--------------------------------------------------
(val_mul,":max_range",100),
(store_add,":agent_slot_end",":agent_slot_begin",":bullets_num"),
(store_trigger_param_1, ":user"),
(set_fixed_point_multiplier, 10000),
(agent_get_ammo, reg0, ":user", 1),
(agent_get_slot, ":var_1", ":user", 176),
(neg|eq, ":var_1", reg0),
(agent_set_slot, ":user", 176, reg0),
(2076, 42, ":user", 9, 1),
(agent_get_team, ":user_team", ":user"),
#
(try_for_range,":times",0,":bullets_num"),
(try_begin),
(assign, ":max_range_calc", ":max_range"),
(try_for_agents, ":enemies"),
(assign,":break_1",0),
(try_for_range,":slot_no",":agent_slot_begin",":agent_slot_end"),
(agent_get_slot,":enemies_id", ":user", ":slot_no"),
(eq, ":enemies_id", ":enemies"),
(assign,":break_1",1),
(try_end),
(eq, ":break_1", 0),
(agent_is_alive, ":enemies"),
(agent_is_human, ":enemies"),
(agent_get_team, ":enemy_team", ":enemies"),
(teams_are_enemies, ":user_team", ":enemy_team"),
(2076, 0, ":enemies", 9, 1),
(position_has_line_of_sight_to_position, pos42, pos0),
(get_distance_between_positions, ":distance_abs", pos0, pos42),
(lt, ":distance_abs", ":max_range_calc"),
(assign, ":max_range_calc", ":distance_abs"),
(store_add,":cur_slot",":agent_slot_begin",":times"),
(agent_set_slot, ":user", ":cur_slot", ":enemies"),
(try_end),
(try_end),
(try_end),
#
(try_begin),
(agent_slot_eq,":user", ":agent_slot_begin", -1),
(assign, ":tar_enemy", 1),
(agent_get_look_position, pos0, ":user"),
(position_copy_rotation, pos42, pos0),
(try_end),
#
(try_for_range,":slot_no",":agent_slot_begin",":agent_slot_end"),
(agent_get_slot,":enemies_id", ":user", ":slot_no"),
(neq, ":enemies_id", -1),
(neq, ":enemies_id", 0),
(assign,":tar_enemy",":enemies_id"),
(2076, 0, ":enemies_id", 9, 1),
(try_begin),
(agent_slot_eq, ":user", 171, 0),
(agent_get_troop_id, ":var_8", ":user"),
(agent_get_horse, ":var_9", ":user"),
(agent_get_wielded_item, ":var_10", ":user"),
(assign, ":var_11", 10000),
(assign, ":var_12", 10),
(2702, ":var_13", ":var_10"),
(val_add, ":var_13", 4),
(assign, ":var_14", 4),
(try_for_range, ":var_15", 0, ":var_14"),
(troop_get_inventory_slot, ":var_16", ":var_8", ":var_15"),
(eq, ":var_16", ":var_10"),
(try_begin),
(troop_get_inventory_slot_modifier, ":var_17", ":var_8", ":var_15"),
(eq, ":var_17", 17),
(val_add, ":var_13", 4),
(else_try),
(troop_get_inventory_slot_modifier, ":var_17", ":var_8", ":var_15"),
(eq, ":var_17", 19),
(val_add, ":var_13", 2),
(else_try),
(troop_get_inventory_slot_modifier, ":var_17", ":var_8", ":var_15"),
(eq, ":var_17", 18),
(val_add, ":var_13", 1),
(else_try),
(troop_get_inventory_slot_modifier, ":var_17", ":var_8", ":var_15"),
(eq, ":var_17", 32),
(val_add, ":var_13", 1),
(else_try),
(troop_get_inventory_slot_modifier, ":var_17", ":var_8", ":var_15"),
(eq, ":var_17", 33),
(val_add, ":var_13", 1),
(else_try),
(troop_get_inventory_slot_modifier, ":var_17", ":var_8", ":var_15"),
(eq, ":var_17", 35),
(val_add, ":var_13", 1),
(else_try),
(troop_get_inventory_slot_modifier, ":var_17", ":var_8", ":var_15"),
(eq, ":var_17", 36),
(val_add, ":var_13", 2),
(try_end),
(assign, ":var_14", 0),
(try_end),
(val_min, ":var_12", ":var_13"),
(try_begin),
(eq, ":var_12", 1),
(assign, ":var_11", 10580),
(else_try),
(eq, ":var_12", 2),
(assign, ":var_11", 11137),
(else_try),
(eq, ":var_12", 3),
(assign, ":var_11", 11663),
(else_try),
(eq, ":var_12", 4),
(assign, ":var_11", 12166),
(else_try),
(eq, ":var_12", 5),
(assign, ":var_11", 12649),
(else_try),
(eq, ":var_12", 6),
(assign, ":var_11", 13115),
(else_try),
(eq, ":var_12", 7),
(assign, ":var_11", 13567),
(else_try),
(eq, ":var_12", 8),
(assign, ":var_11", 13997),
(else_try),
(eq, ":var_12", 9),
(assign, ":var_11", 14425),
(else_try),
(eq, ":var_12", 10),
(assign, ":var_11", 14834),
(else_try),
(eq, ":var_12", 11),
(assign, ":var_11", 15237),
(else_try),
(eq, ":var_12", 12),
(assign, ":var_11", 15613),
(else_try),
(eq, ":var_12", 13),
(assign, ":var_11", 15992),
(else_try),
(eq, ":var_12", 14),
(assign, ":var_11", 16364),
(else_try),
(eq, ":var_12", 15),
(assign, ":var_11", 16730),
(try_end),
(2709, ":var_18", ":var_10"),
(convert_to_fixed_point, ":var_18"),
(val_mul, ":var_18", 120),
(val_div, ":var_18", 100),
(val_mul, ":var_18", ":var_11"),
(convert_from_fixed_point, ":var_18"),
(agent_set_slot, ":user", 175, ":var_18"),
(try_for_range_backwards, ":var_19", 0, 4),
(agent_get_item_slot, ":var_20", ":user", ":var_19"),
(gt, ":var_20", 1),
(item_get_type, ":var_21", ":var_20"),
(try_begin),
(eq, ":var_21", 9),
(eq, ":var_20", ":var_10"),
(troop_get_inventory_slot_modifier, ":var_22", ":var_8", ":var_19"),
(agent_set_slot, ":user", 172, ":var_22"),
(agent_set_slot, ":user", 174, ":var_10"),
(else_try),
(eq, ":var_21", 8),
(eq, ":var_20", ":var_10"),
(troop_get_inventory_slot_modifier, ":var_22", ":var_8", ":var_19"),
(agent_set_slot, ":user", 172, ":var_22"),
(agent_set_slot, ":user", 174, ":var_10"),
(else_try),
(eq, ":var_21", 16),
(eq, ":var_20", ":var_10"),
(troop_get_inventory_slot_modifier, ":var_22", ":var_8", ":var_19"),
(agent_set_slot, ":user", 172, ":var_22"),
(agent_set_slot, ":user", 174, ":var_10"),
(else_try),
(eq, ":var_21", 6),
(assign, ":var_23", ":var_20"),
(troop_get_inventory_slot_modifier, ":var_24", ":var_8", ":var_19"),
(agent_set_slot, ":user", 171, ":var_24"),
(agent_set_slot, ":user", 173, ":var_23"),
(else_try),
(eq, ":var_21", 5),
(assign, ":var_23", ":var_20"),
(troop_get_inventory_slot_modifier, ":var_24", ":var_8", ":var_19"),
(agent_set_slot, ":user", 171, ":var_24"),
(agent_set_slot, ":user", 173, ":var_23"),
(else_try),
(eq, ":var_21", 18),
(assign, ":var_23", ":var_20"),
(troop_get_inventory_slot_modifier, ":var_24", ":var_8", ":var_19"),
(agent_set_slot, ":user", 171, ":var_24"),
(agent_set_slot, ":user", 173, ":var_23"),
(try_end),
(try_end),
(try_end),
(agent_get_slot, ":var_18", ":user", 175),
(assign, ":var_25", 10000),
(try_begin),
(gt, ":var_9", 1),
(assign, ":var_26", 10),
(try_begin),
(eq, ":var_26", 0),
(assign, ":var_25", 8938),
(else_try),
(eq, ":var_26", 1),
(assign, ":var_25", 9040),
(else_try),
(eq, ":var_26", 2),
(assign, ":var_25", 9147),
(else_try),
(eq, ":var_26", 3),
(assign, ":var_25", 9253),
(else_try),
(eq, ":var_26", 4),
(assign, ":var_25", 9356),
(else_try),
(eq, ":var_26", 5),
(assign, ":var_25", 9455),
(else_try),
(eq, ":var_26", 6),
(assign, ":var_25", 9555),
(else_try),
(eq, ":var_26", 7),
(assign, ":var_25", 9654),
(else_try),
(eq, ":var_26", 8),
(assign, ":var_25", 9751),
(else_try),
(eq, ":var_26", 9),
(assign, ":var_25", 9850),
(else_try),
(eq, ":var_26", 10),
(assign, ":var_25", 9945),
(try_end),
(try_end),
(val_mul, ":var_18", ":var_25"),
(convert_from_fixed_point, ":var_18"),
(try_begin),
(gt, ":tar_enemy", 1),
(agent_get_speed, pos0, ":tar_enemy"),
(position_get_x, ":var_27", pos0),
(position_get_y, ":var_28", pos0),
(store_mul, ":var_1", ":var_27", ":var_27"),
(convert_from_fixed_point, ":var_1"),
(store_mul, ":var_29", ":var_28", ":var_28"),
(convert_from_fixed_point, ":var_29"),
(val_add, ":var_29", ":var_1"),
(try_begin),
(eq, ":var_27", 0),
(assign, ":var_30", 0),
(else_try),
(assign, ":var_30", ":var_28"),
(convert_to_fixed_point, ":var_30"),
(val_div, ":var_30", ":var_27"),
(store_atan, ":var_30", ":var_30"),
(try_begin),
(neg|ge, ":var_28", 0),
(val_add, ":var_30", 1800000),
(try_end),
(val_sub, ":var_30", 900000),
(try_end),
(try_begin),
(gt, ":var_29", 90000),
(2076, 43, ":tar_enemy", 8, 1),
(else_try),
(2076, 43, ":tar_enemy", 9, 1),
(try_end),
(init_position, pos0),
(position_copy_rotation, pos42, pos0),
(position_copy_rotation, pos43, pos0),
(position_move_z, pos43, 14, 1),
(position_move_z, pos42, 14, 1),
(try_begin),
(gt, ":var_29", 0),
(copy_position, pos41, pos43),
(position_get_x, ":var_31", pos41),
(position_get_y, ":var_32", pos41),
(position_get_z, ":var_33", pos41),
(position_get_x, ":var_34", pos42),
(position_get_y, ":var_35", pos42),
(position_get_z, ":var_36", pos42),
(store_sub, ":var_37", ":var_33", ":var_36"),
(store_sub, ":var_38", ":var_31", ":var_34"),
(store_sub, ":var_39", ":var_32", ":var_35"),
(store_mul, ":var_40", ":var_38", ":var_38"),
(store_mul, ":var_41", ":var_39", ":var_39"),
(store_add, ":var_42", ":var_40", ":var_41"),
(store_mul, ":var_43", ":var_18", ":var_18"),
(assign, ":var_44", 10),
(convert_to_fixed_point, ":var_44"),
(store_div, ":var_45", ":var_43", ":var_44"),
(store_mul, ":var_46", ":var_45", ":var_45"),
(store_mul, ":var_47", ":var_45", ":var_37"),
(val_mul, ":var_47", 2),
(store_sub, ":var_48", ":var_46", ":var_42"),
(val_sub, ":var_48", ":var_47"),
(try_begin),
(gt, ":var_48", 0),
(assign, ":var_1", 1),
(convert_to_fixed_point, ":var_1"),
(set_fixed_point_multiplier, 1),
(store_sqrt, ":var_49", ":var_48"),
(store_sub, ":var_50", ":var_45", ":var_49"),
(val_sub, ":var_50", ":var_37"),
(val_div, ":var_50", 100),
(position_move_z, pos41, ":var_50", 1),
(position_move_z, pos41, 4, 0),
(set_fixed_point_multiplier, ":var_1"),
(try_end),
(copy_position, pos0, pos41),
(position_get_z, ":var_1", pos42),
(position_set_z, pos0, ":var_1"),
(get_distance_between_positions, ":distance_abs", pos0, pos42),
(position_transform_position_to_local, pos0, pos42, pos41),
(position_get_z, ":var_37", pos0),
(try_begin),
(neg|ge, ":var_37", 0),
(val_mul, ":var_37", 1),
(try_end),
(val_mul, ":var_37", 100),
(val_div, ":var_37", ":distance_abs"),
(store_atan, ":var_1", ":var_37"),
(store_cos, ":var_1", ":var_1"),
(store_mul, ":var_51", ":var_18", ":var_1"),
(convert_from_fixed_point, ":var_51"),
(copy_position, pos41, pos43),
(position_transform_position_to_local, pos0, pos41, pos42),
(position_get_x, ":var_38", pos0),
(position_get_y, ":var_39", pos0),
(try_begin),
(eq, ":var_38", 0),
(try_begin),
(eq, ":var_39", 0),
(assign, ":var_1", 0),
(else_try),
(gt, ":var_39", 0),
(assign, ":var_1", 900000),
(else_try),
(assign, ":var_1", 2700000),
(try_end),
(else_try),
(convert_to_fixed_point, ":var_39"),
(val_div, ":var_39", ":var_38"),
(store_atan, ":var_1", ":var_39"),
(try_begin),
(neg|ge, ":var_38", 0),
(val_add, ":var_1", 1800000),
(try_end),
(try_end),
(val_add, ":var_1", 900000),
(734, 41, ":var_1"),
(store_mul, ":var_1", ":var_51", ":var_51"),
(store_div, ":var_52", ":var_1", ":var_29"),
(store_sub, ":var_53", ":var_52", 10000),
(assign, ":var_54", ":distance_abs"),
(convert_to_fixed_point, ":var_54"),
(assign, ":var_1", ":var_54"),
(convert_to_fixed_point, ":var_1"),
(store_div, ":var_55", ":var_1", ":var_53"),
(agent_get_position, pos2, ":tar_enemy"),
(init_position, pos0),
(position_copy_origin, pos2, pos41),
(position_transform_position_to_local, pos2, pos41, pos2),
(position_get_rotation_around_z, ":var_56", pos2),
(convert_to_fixed_point, ":var_56"),
(val_add, ":var_56", 900000),
(val_add, ":var_56", ":var_30"),
(try_begin),
(store_cos, ":var_1", ":var_56"),
(eq, ":var_1", 0),
(assign, ":var_38", 0),
(assign, ":var_39", 10000),
(store_sqrt, ":var_1", ":var_52"),
(val_add, ":var_39", ":var_1"),
(try_begin),
(gt, ":var_56", 1800000),
(val_mul, ":var_39", 1),
(try_end),
(val_mul, ":var_39", ":var_55"),
(convert_from_fixed_point, ":var_39"),
(else_try),
(store_tan, ":var_57", ":var_56"),
(try_begin),
(neg|ge, ":var_57", 0),
(val_mul, ":var_57", 1),
(try_end),
(store_mul, ":var_58", ":var_57", ":var_57"),
(convert_from_fixed_point, ":var_58"),
(val_add, ":var_58", 10000),
(assign, ":var_1", ":var_57"),
(convert_to_fixed_point, ":var_1"),
(store_div, ":var_59", ":var_1", ":var_58"),
(val_mul, ":var_59", ":var_55"),
(convert_from_fixed_point, ":var_59"),
(assign, ":var_1", ":var_54"),
(convert_to_fixed_point, ":var_1"),
(store_div, ":var_60", ":var_1", ":var_58"),
(store_mul, ":var_38", ":var_59", ":var_59"),
(convert_from_fixed_point, ":var_38"),
(store_mul, ":var_1", ":var_60", ":var_55"),
(convert_from_fixed_point, ":var_1"),
(val_add, ":var_38", ":var_1"),
(store_sqrt, ":var_38", ":var_38"),
(val_add, ":var_38", ":var_59"),
(try_begin),
(gt, ":var_56", 900000),
(neg|ge, ":var_56", 2700000),
(val_mul, ":var_38", 1),
(try_end),
(store_mul, ":var_39", ":var_38", ":var_57"),
(try_begin),
(neg|ge, ":var_28", 0),
(val_mul, ":var_39", 1),
(try_end),
(convert_from_fixed_point, ":var_39"),
(try_end),
(val_div, ":var_38", 100),
(val_div, ":var_39", 100),
(init_position, pos0),
(position_set_x, pos0, ":var_38"),
(position_set_y, pos0, ":var_39"),
(position_transform_position_to_parent, pos41, pos41, pos0),
(try_end),
(try_begin),
(neg|gt, ":var_29", 0),
(copy_position, pos41, pos43),
(try_end),
(position_get_x, ":var_31", pos41),
(position_get_y, ":var_32", pos41),
(position_get_z, ":var_33", pos41),
(position_get_x, ":var_34", pos42),
(position_get_y, ":var_35", pos42),
(position_get_z, ":var_36", pos42),
(store_sub, ":var_37", ":var_33", ":var_36"),
(store_sub, ":var_38", ":var_31", ":var_34"),
(store_sub, ":var_39", ":var_32", ":var_35"),
(store_mul, ":var_40", ":var_38", ":var_38"),
(store_mul, ":var_41", ":var_39", ":var_39"),
(store_add, ":var_42", ":var_40", ":var_41"),
(store_mul, ":var_43", ":var_18", ":var_18"),
(assign, ":var_44", 10),
(convert_to_fixed_point, ":var_44"),
(store_div, ":var_45", ":var_43", ":var_44"),
(store_mul, ":var_46", ":var_45", ":var_45"),
(store_mul, ":var_47", ":var_45", ":var_37"),
(val_mul, ":var_47", 2),
(store_sub, ":var_48", ":var_46", ":var_42"),
(val_sub, ":var_48", ":var_47"),
(try_begin),
(gt, ":var_48", 0),
(assign, ":var_1", 1),
(convert_to_fixed_point, ":var_1"),
(set_fixed_point_multiplier, 1),
(store_sqrt, ":var_49", ":var_48"),
(store_sub, ":var_50", ":var_45", ":var_49"),
(val_sub, ":var_50", ":var_37"),
(val_div, ":var_50", 100),
(position_move_z, pos41, ":var_50", 1),
(position_move_z, pos41, 4, 0),
(set_fixed_point_multiplier, ":var_1"),
(try_end),
(position_transform_position_to_local, pos48, pos42, pos41),
(position_get_y, ":var_39", pos48),
(position_get_z, ":var_37", pos48),
(try_begin),
(eq, ":var_39", 0),
(try_begin),
(eq, ":var_37", 0),
(assign, ":var_1", 0),
(else_try),
(ge, ":var_37", 0),
(assign, ":var_1", 900000),
(else_try),
(assign, ":var_1", 2700000),
(try_end),
(else_try),
(convert_to_fixed_point, ":var_37"),
(val_div, ":var_37", ":var_39"),
(store_atan, ":var_1", ":var_37"),
(try_begin),
(neg|ge, ":var_39", 0),
(val_add, ":var_1", 1800000),
(try_end),
(try_end),
(position_rotate_x_floating, pos42, ":var_1"),
(position_transform_position_to_local, pos48, pos42, pos41),
(position_get_y, ":var_39", pos48),
(position_get_x, ":var_38", pos48),
(try_begin),
(eq, ":var_38", 0),
(try_begin),
(eq, ":var_39", 0),
(assign, ":var_1", 0),
(else_try),
(ge, ":var_39", 0),
(assign, ":var_1", 900000),
(else_try),
(assign, ":var_1", 2700000),
(try_end),
(else_try),
(convert_to_fixed_point, ":var_39"),
(val_div, ":var_39", ":var_38"),
(store_atan, ":var_1", ":var_39"),
(try_begin),
(neg|ge, ":var_38", 0),
(val_add, ":var_1", 1800000),
(try_end),
(try_end),
(val_sub, ":var_1", 900000),
(734, 42, ":var_1"),
(try_end),
(agent_get_slot, ":var_22", ":user", 172),
(agent_get_slot, ":var_10", ":user", 174),
(agent_get_slot, ":var_24", ":user", 171),
(agent_get_slot, ":var_23", ":user", 173),
(add_missile, ":user", 42, ":var_18", ":var_10", ":var_22", ":var_23", ":var_24"),
(try_end),
(try_for_range,":slot_no",":agent_slot_begin",":agent_slot_end"),
(agent_set_slot,":user", ":slot_no", -1),
(try_end),
```
自瞄部分的代码应该也是中文站的兄弟写的,具体出处时间太久无从考证了,本人骑砍龄比较短,很多大佬我不认识,所以请见谅.
***
附一个网址(若打不开请用chrome或用steam++等加速github):
https://b1inkie.github.io/b1note.github.io/
装备某件物品时增加属性点;添加书籍;全自动武器;自爆步兵;光环:移速BUFF(光写了 没测);散弹 但是每一个弹头都是自瞄;自定义战利品等等功能都可以在这里找到.
若依旧有疑问或需要视频讲解,可以加下面群:
附加半个交流群: 855512521
|