本帖最后由 三啸 于 2021-11-4 23:56 编辑
众所周知,战团里面说服技能的作用很小,几乎很少有玩家会花费点数去点! 这里只是增加一点说服力的用法!
原来的情况,只要这支部队答应加入,就会全队都加入,现实中思想咋会那么统一呢,所以这里又加了一个数量的随机数,增加说服力的计算,使得说服的使用次数更多一点。
但实际上这段代码,会让俘虏招募的人数比以前更少,属于削弱! 红色代码是我添加的
("camp_recruit_prisoners",0, ##囚犯招募军队
"You offer your prisoners freedom if they agree to join you as soldiers. {s18}",
"none",
[(assign, ":num_regular_prisoner_slots", 0),
(party_get_num_prisoner_stacks, ":num_stacks", "p_main_party"), ###获取队伍的囚犯堆数量
(try_for_range, ":cur_stack", 0, ":num_stacks"),
(party_prisoner_stack_get_troop_id, ":cur_troop_id", "p_main_party", ":cur_stack"),
(neg|troop_is_hero, ":cur_troop_id"),
(val_add, ":num_regular_prisoner_slots", 1),
(try_end),
(try_begin),
(eq, ":num_regular_prisoner_slots", 0),
(jump_to_menu, "mnu_camp_no_prisoners"),
(else_try),
(eq, "$g_prisoner_recruit_troop_id", 0),
(store_current_hours, "$g_prisoner_recruit_last_time"), ###存储当前小时
(store_random_in_range, ":rand", 0, 100), ##取随机数
(store_skill_level, ":persuasion_level", "skl_persuasion", "trp_player"), ##说服等级
(store_sub, ":reject_chance",15, ":persuasion_level"),
(val_mul, ":reject_chance", 4),
(try_begin),
(lt, ":rand", ":reject_chance"),
(assign, "$g_prisoner_recruit_troop_id", -7),
(else_try),
(assign, ":num_regular_prisoner_slots", 0),
(party_get_num_prisoner_stacks, ":num_stacks", "p_main_party"),
(try_for_range, ":cur_stack", 0, ":num_stacks"),
(party_prisoner_stack_get_troop_id, ":cur_troop_id", "p_main_party", ":cur_stack"),
(neg|troop_is_hero, ":cur_troop_id"),
(val_add, ":num_regular_prisoner_slots", 1),
(try_end),
(store_random_in_range, ":random_prisoner_slot", 0, ":num_regular_prisoner_slots"),
(try_for_range, ":cur_stack", 0, ":num_stacks"),
(party_prisoner_stack_get_troop_id, ":cur_troop_id", "p_main_party", ":cur_stack"),
(neg|troop_is_hero, ":cur_troop_id"),
(val_sub, ":random_prisoner_slot", 1),
(lt, ":random_prisoner_slot", 0),
(assign, ":num_stacks", 0),
(assign, "$g_prisoner_recruit_troop_id", ":cur_troop_id"),
(party_prisoner_stack_get_size, "$g_prisoner_recruit_size", "p_main_party", ":cur_stack"),
(try_end),
(try_end),
(try_begin),
(gt, "$g_prisoner_recruit_troop_id", 0),
(store_random_in_range, ":rand2",0,"$g_prisoner_recruit_size"), ##取随机数能招的最大人数和1之前选一个随机数
(val_add,":rand2",1), ##为什么加一能看懂吧,既然执行在这里最少得有一个把,而随机数取前不取后,0-100取随机数最大只能到99 ,所有加一,是保证满员的情况也会出现!
(val_add,":persuasion_level",10), ##每个说服等级加10%的算法
(val_mul,":rand2",":persuasion_level"),
(val_div,":rand2",10),
(val_min, "$g_prisoner_recruit_size",":rand2"), ##两者取小,不能超过最大人数
(party_get_free_companions_capacity, ":capacity", "p_main_party"), ###获取队伍可以招募的同伴自由空间
(val_min, "$g_prisoner_recruit_size", ":capacity"), ###数量和空间对比谁更小
(assign, reg1, "$g_prisoner_recruit_size"),
(gt, "$g_prisoner_recruit_size", 0),
(try_begin),
(gt, "$g_prisoner_recruit_size", 1),
(assign, reg2, 1),
(else_try),
(assign, reg2, 0),
(try_end),
(str_store_troop_name_by_count, s1, "$g_prisoner_recruit_troop_id", "$g_prisoner_recruit_size"), ###存储不带链接的troop总数名称
(str_store_string, s18, "@{reg1} {s1} {reg2?accept:accepts} the offer."),
(else_try),
(str_store_string, s18, "@No one accepts the offer."),
(try_end),
(try_end),
],
[
("camp_recruit_prisoners_accept",[(gt, "$g_prisoner_recruit_troop_id", 0)],"Take them.",
[(remove_troops_from_prisoners, "$g_prisoner_recruit_troop_id", "$g_prisoner_recruit_size"),
(party_add_members, "p_main_party", "$g_prisoner_recruit_troop_id", "$g_prisoner_recruit_size"),
(store_mul, ":morale_change", -3, "$g_prisoner_recruit_size"),
(call_script, "script_change_player_party_morale", ":morale_change"), ##扣减士气
(jump_to_menu, "mnu_camp"),
]
),
("camp_recruit_prisoners_reject",[(gt, "$g_prisoner_recruit_troop_id", 0)],"Reject them.",
[(jump_to_menu, "mnu_camp"),
(assign, "$g_prisoner_recruit_troop_id", 0),
(assign, "$g_prisoner_recruit_size", 0),
]
),
("continue",[(le, "$g_prisoner_recruit_troop_id", 0)],"Go back.",
[(jump_to_menu, "mnu_camp"),
]
),
]
),
|