- 好友
- 3
- 在线时间
- 0 小时
- 最后登录
- 2024-5-8
见习骑士
- UID
- 3103735
- 第纳尔
- 1596
- 精华
- 0
- 互助
- 10
- 荣誉
- 1
- 贡献
- 0
- 魅力
- 34
- 注册时间
- 2019-9-10
鲜花( 32) 鸡蛋( 0)
|
发表于 2021-6-2 14:43:11
|
显示全部楼层
script.py搜party_get_ideal_size,这个就是ai部队的最理想的带兵数。
下面有我注释过的,自己改一下。(如果看不懂就不要问我了,或许有人会给你解答)
# script_party_get_ideal_size @used for NPC parties.
# Input: arg1 = party_no
# Output: reg0: ideal size
("party_get_ideal_size",
[
(store_script_param_1, ":party_no"),
#default limit is 30 for any party
(assign, ":limit", 30), # 默认值
(try_begin),
(party_slot_eq, ":party_no", slot_party_type, spt_kingdom_hero_party), # 如果是领主部队
(party_stack_get_troop_id, ":party_leader", ":party_no", 0),
(store_faction_of_party, ":faction_id", ":party_no"),
#default limit is 10 for kingdom lords
(assign, ":limit", 10), # 默认10
#each (leadership level) gives 5 to limit
(store_skill_level, ":skill", "skl_leadership", ":party_leader"),
(store_attribute_level, ":charisma", ":party_leader", ca_charisma),
(val_mul, ":skill", 5), # 统御*5
(val_add, ":limit", ":skill"), # 10+(统御*5)
#each (charisma level) gives 1 to limit
(val_add, ":limit", ":charisma"), # +魅力值
#each (25 renown) gives 1 to limit
(troop_get_slot, ":troop_renown", ":party_leader", slot_troop_renown), # 获取首领声望
(store_div, ":renown_bonus", ":troop_renown", 25), # 声望 / 25
(val_add, ":limit", ":renown_bonus"), # +(声望 / 25)
#if this party is faction leader it takes additional 100 limit
(try_begin),
(faction_slot_eq, ":faction_id", slot_faction_leader, ":party_leader"),
(val_add, ":limit", 100), # 如果是国王,在基础上+100
(try_end),
#if this party is faction marshall it takes additional 20 limit
(try_begin),
(faction_slot_eq, ":faction_id", slot_faction_marshall, ":party_leader"),
(val_add, ":limit", 20), # 如果是元帅,在基础上+20
(try_end),
#party takes additional 20 limit per each castle it's party leader owns
# 领主每拥有一个城堡,就+20
(try_for_range, ":cur_center", castles_begin, castles_end),
(party_slot_eq, ":cur_center", slot_town_lord, ":party_leader"),
(val_add, ":limit", 20),
(try_end),
(try_end),
#if player has level of 0 then ideal limit will be exactly same, if player has level of 80 then ideal limit will be multiplied by 2 ((80 + 80) / 80)
#below code will increase limits a little as the game progresses and player gains level
# 下面的代码会根据玩家的等级而提高ai的人数
(store_character_level, ":level", "trp_player"),
(val_min, ":level", 80),
(store_add, ":level_factor", 80, ":level"),
(val_mul, ":limit", ":level_factor"),
(val_div, ":limit", 80), # 数值越大,人数越少
(assign, reg0, ":limit"),
]),
|
鲜花鸡蛋半世尘埃 在2021-6-3 23:46 送朵鲜花 并说:我非常同意你的观点,送朵鲜花鼓励一下
|