本帖最后由 ggfgfgf 于 2023-9-30 22:31 编辑
战团原版士气崩溃和没有差不多,经常出现一些离谱情况,比如明明只有几个兵在地图边界,就是硬刚,太不符合现实了,一周几十第纳尔,玩什么命啊
所以做个小玩意,基本根据现实上战场士兵个人感受计算部队逃跑,是整体溃逃,计算具体实力,即步兵全顶级兵,对面全低级骑兵,大概率会跑路。。
欢迎各位骑友测试,报告bug!祝中秋、国庆快乐!
[Module_system]
贴代码:
mission_templates.py 注释下方开头添加
start_agent_run_away = (
10, 0, 0, [(neg|all_enemies_defeated),],
[
(assign,":ally",0),
(assign,":enemy",0),
(assign,":ally_num",0),
(assign,":enemy_num",0),
(try_for_agents,":agent"),
(agent_get_troop_id,":troop",":agent"),
(store_character_level, ":strength", ":troop"),
(troop_get_class,":class",":troop"),
(try_begin),
(eq,":class",grc_cavalry),
(assign,":value",3),
(else_try),
(eq,":class",grc_archers),
(assign,":value",2),
(else_try),
(assign,":value",1),
(try_end),
(val_add,":value",":strength"),
(try_begin),
(agent_is_ally,":agent"),
(val_add,":ally_num",1),
(val_add,":ally",":value"),
(else_try),
(val_add,":enemy_num",1),
(val_add,":enemy",":value"),
(try_end),
(try_end),
(assign,":run",1),
(try_begin),
(lt,":ally_num",30),
(val_mul,":run",-1),
(try_end),
(try_begin),
(lt,":enemy_num",30),
(val_mul,":run",-1),
(try_end),
(try_begin),
(val_sub,":enemy",":ally"),
#(assign,reg7,":enemy"),
#(display_message,"@{reg7}"),
(val_sub,":enemy_num",":ally_num"),
(val_abs,":enemy_num"),
(this_or_next|eq,":run",-1),
(this_or_next|gt,":enemy_num",60),
(this_or_next|lt,":enemy",-400),
(gt,":enemy",400),
#(assign,reg7,":enemy"),
#(display_message,"@{reg7}"),
(try_begin),
(lt,":enemy",-200),
(try_for_agents, ":agent"),
(agent_is_enemy,":agent"),
(agent_is_alive,":agent"),
(agent_is_human,":agent"),
(agent_get_combat_state,":state_no",":agent"),
(neq,":state_no",2),
(neq,":state_no",3),
(neq,":state_no",4),
(agent_start_running_away,":agent"),
(try_end),
(else_try),
(gt,":enemy",200),
(assign,"$run_away",1),
(try_end),
(try_end),
])
player_down = (0, 0, 0,
[
(try_begin),
(main_hero_fallen),
(try_begin),
(eq,"$run_away",1),
(try_for_agents, ":agent"),
(agent_is_ally,":agent"),
(agent_is_alive,":agent"),
(agent_is_human,":agent"),
(agent_clear_scripted_mode,":agent"),
(agent_get_combat_state,":state_no",":agent"),
(neq,":state_no",2),
(neq,":state_no",3),
(neq,":state_no",4),
(agent_start_running_away,":agent"),
(try_end),
(try_end),
(try_end),
], [])
t_mission_begin = (0, 0, ti_once, [],
[
(assign,"$run_away",0),
])
在你需要的战场触发器中添加:
t_mission_begin,
start_agent_run_away,
player_down,
这里以野战(lead_charge)为例
(
"lead_charge",mtf_battle_mode|mtf_synch_inventory,charge,
"You lead your men to battle.",
[
(1,mtef_defenders|mtef_team_0,0,aif_start_alarmed,12,[]),
(0,mtef_defenders|mtef_team_0,0,aif_start_alarmed,0,[]),
(4,mtef_attackers|mtef_team_1,0,aif_start_alarmed,12,[]),
(4,mtef_attackers|mtef_team_1,0,aif_start_alarmed,0,[]),
],
[
(ti_on_agent_spawn, 0, 0, [],
[
(store_trigger_param_1, ":agent_no"),
(call_script, "script_agent_reassign_team", ":agent_no"),
(assign, ":initial_courage_score", 5000),
............
t_mission_begin,#新增代码
start_agent_run_away, #新增代码
player_down,#新增代码
common_battle_order_panel,
common_battle_order_panel_tick,
],
),
|