本帖最后由 快乐风猫 于 2024-3-1 05:40 编辑
战团里的每个中心 ,城镇,城堡,村子,都是有自己的小金库的,就是slot_town_wealth,但是游戏里除了给slot_town_wealth里面存钱加钱,貌似没有用到这个小金库的地方(好像只有每周给中心里的部队发工资)
有小金库就得利用起来,增加游戏难度,城镇和城堡每周结算的时候给国王上交10%的税(十税一),剩下的90%里面再拿出一半作为领主的额外收入,村庄的收入是直接放进城堡收入的,农民也每次也给城镇产生关税,所以可以排除村庄。
st里搜源代码就行了 ####的是新添加的,其余为原文,提供一个大致的思路,更深层次的可以自己弄
- #If non-player center, adding income to wealth
- (neg|party_slot_eq, ":center_no", slot_town_lord, "trp_player"), #领主不是玩家
- (party_slot_ge, ":center_no", slot_town_lord, 1), #是有领主的
- (party_get_slot, ":cur_wealth", ":center_no", slot_town_wealth),
- (party_get_slot, ":prosperity", ":center_no", slot_town_prosperity),
- (store_mul, ":added_wealth", ":prosperity", 15),
- (val_add, ":added_wealth", 700),
- (try_begin),
- (party_slot_eq, ":center_no", slot_party_type, spt_town),
- (val_mul, ":added_wealth", 3),
- (val_div, ":added_wealth", 2),
- (try_end),
- (val_add, ":cur_wealth", ":added_wealth"),
- (call_script, "script_calculate_weekly_party_wage", ":center_no"),
- (val_sub, ":cur_wealth", reg0),
- (val_max, ":cur_wealth", 0),
- ####
- (party_get_slot, ":fanrong", ":center_no", slot_town_prosperity),
- (val_div, ":fanrong", 20),
-
-
- (try_begin),
- (ge, ":fanrong", 3),#是富有或非常富有的
- (assign,":guowangshouru",0),#设置国王收入
- (store_faction_of_party, ":fac", ":center_no"),#获取中心阵营
- (faction_get_slot, ":faction_leader", ":fac", slot_faction_leader),#获取阵营国王
- (troop_get_slot, ":qian", ":faction_leader", slot_troop_wealth),#获取国王钱
- (store_div,":guowangshouru",":cur_wealth",10),#中心收入的10%
- (val_add, ":qian", ":guowangshouru"),
- (val_max, ":qian", 0),
- (troop_set_slot, ":faction_leader", slot_troop_wealth, ":qian"),#给国王上税
- (val_sub, ":cur_wealth", ":guowangshouru"),
- (try_end),
-
- (try_begin),
- (ge, ":fanrong", 3),#是富有或非常富有的
- (assign,":lingzhushouru",0),#设置领主收入
- (party_get_slot, ":center_lord", ":center_no", slot_town_lord),#获取中心领主 (上面已经排除了玩家,所以这里不包括玩家)
- (troop_get_slot, ":gold", ":center_lord", slot_troop_wealth),#获取领主钱
- (store_div,":lingzhushouru",":cur_wealth",2),#剩余收入的50%
- (val_add, ":gold", ":lingzhushouru"),
- (val_max, ":gold", 0),
- (troop_set_slot, ":center_lord", slot_troop_wealth, ":gold"),#领主获得收入
- (val_sub, ":cur_wealth", ":lingzhushouru"),#中心上完税后的收入
- (try_end),
-
- ####
- (party_set_slot, ":center_no", slot_town_wealth, ":cur_wealth"),#中心最后获得的收入
- (try_end),
复制代码
|