- 好友
- 0
- 在线时间
- 0 小时
- 最后登录
- 2024-10-27
随仆
- UID
- 3280741
- 第纳尔
- 277
- 精华
- 0
- 互助
- 2
- 荣誉
- 0
- 贡献
- 0
- 魅力
- 1
- 注册时间
- 2021-10-21
鲜花( 1) 鸡蛋( 0)
|
原创是【新提醒】武装士兵(物品兑换兵种) - MOD制作区存档 - 骑马与砍杀中文站论坛 - Powered by Discuz! (mountblade.com.cn)这个大佬发的教学,我给稍稍改了,如果侵权请联系我删除。修改后不用自己出装备,只要付钱就行了。(相当于钱是来买装备的)而且,我这个需要两位新兵才能换一名高级兵,相当于裁撤老弱,挑选精华了。但有个bug,这代码会向下取整,就是说只有一位新兵时会被诈骗掉,希望有大佬能指出这bug怎么修复。现在进入正题。同时修改思路我还参考了这位大佬的帖子【新提醒】医治士兵(7月15修改) - MOD制作资料区 - 骑马与砍杀中文站论坛 - Powered by Discuz! (mountblade.com.cn)。
在module_game_menus.py中加入这几段代码:
("camp_arms",[],"arms.",
[(jump_to_menu,"mnu_camp_arms"),
]
),##添加到营地菜单
然后到menu最后]之前添加。
("camp_arms",0,
"what do you want to the armed forces?",
"none",
[
],
[("camp_national_army",[
(main_party_has_troop,"trp_swadian_recruit")#拥有兵种
],"national army.",
[
(party_count_companions_of_type,reg1,"p_main_party","trp_swadian_recruit"),#获取兵种数量
(try_begin),
(assign, ":limit", reg1),
(store_div, ":zong", ":limit", 2),#兵种数量除以2
(assign, reg0, ":zong"),
(assign, ":sheng", 500),#升一个兵500块
(store_mul,":xiao",reg0,":sheng"),#需要的总金额
(store_troop_gold,":player_gold_now","trp_player"),#获取玩家的钱
(ge,":player_gold_now",":xiao"),
(troop_remove_gold, "trp_player", ":xiao"),#扣钱
(party_add_members,"p_main_party","trp_swadian_man_at_arms",reg0),#移除新兵
(party_remove_members,"p_main_party","trp_swadian_recruit",reg1),#加入老兵
(else_try),
(jump_to_menu,"mnu_camp"),
(display_message,"@no_money",0xFFFFFFFF),
(try_end),
),
("camp_money_to_morale_back",[],"Go back.",#返回
[(jump_to_menu, "mnu_camp"),
]
),
]
),
以上为代码部分,标红的代码是我改的,剩下都是原创大佬自己的代码。
|
|