介绍:
自制武器熟练度系统,在熟练度达到一定数值后,有几率触发暴击,伤害提高。缺点是伤害提高的幅度有待调整,主要是如果对方血牛的话,一下子打不死。好了,废话不多说,上代码。
搜索 ti_on_agent_hit ,加在最后一个try_end之前。
(try_begin),
(item_get_slot,":proficiency", ":item_id", slot_item_exp),
(assign,reg1,":dest_damage"),
(try_begin),
(eq,":item_id","itm_victor"),
(gt,":proficiency",168), ## 判断武器的熟练度是否达到要求
(store_random_in_range, ":suiji", 1, 21),
(gt,":suiji",19), ## 触发暴击的概率
(call_script,"script_cf_weapons_damage",":item_id",":armor"), ##暴击伤害计算
(else_try),
(eq,":item_id","itm_hades"),
(gt,":proficiency",196),
(store_random_in_range, ":suiji", 1, 28),
(gt,":suiji",25),
(call_script,"script_cf_weapons_damage",":item_id",":armor"),
(else_try),
(eq,":item_id","itm_demon_slayer"),
(gt,":proficiency",128),
(store_random_in_range, ":suiji", 1, 16),
(gt,":suiji",13),
(call_script,"script_cf_weapons_damage",":item_id",":armor"),
(else_try),
(eq,":item_id","itm_cupia_bow"),
(gt,":proficiency",136),
(store_random_in_range, ":suiji", 1, 26),
(gt,":suiji",24),
(call_script,"script_cf_weapons_damage",":item_id",":armor"),
(else_try),
(eq,":item_id","itm_gale_flame"),
(gt,":proficiency",108),
(store_random_in_range, ":suiji", 1, 13),
(gt,":suiji",11),
(call_script,"script_cf_weapons_damage",":item_id",":armor"),
(try_end),
(assign,":dest_damage",reg1),
(val_max, ":dest_damage", 0),
(set_trigger_result, ":dest_damage"),
(try_end),
搜索script_apply_death_effect_on_courage_scores,加在所属的ti_on_agent_killed_or_wounded末尾处。
(try_begin),
(this_or_next|eq,":killer_weapon","武器"),
(this_or_next|eq,":killer_weapon","武器"),
(this_or_next|eq,":killer_weapon","武器"),
(this_or_next|eq,":killer_weapon","武器"),
(this_or_next|eq,":killer_weapon","武器"),
(eq,":killer_weapon","武器"),
(item_get_slot,":weapon", ":killer_weapon", slot_item_exp),
(store_character_level,":level",":dead_agent_troop_id"), ##获取被杀者等级信息
(assign, ":proficiency",0),
(try_begin),
(gt,":level",20), ##根据对方等级决定增加多少经验值
(val_add,":proficiency",5),
(else_try),
(gt,":level",10),
(val_add,":proficiency",3),
(else_try),
(gt,":level",5),
(val_add,":proficiency",2),
(else_try),
(val_add,":proficiency",1),
(try_end),
(val_add, ":weapon", ":proficiency"),
(item_set_slot,":killer_weapon", slot_item_exp ,":weapon"),
(assign, reg2, ":proficiency"),
(display_message,"@Add {reg2} proficiency "),
(try_end),
|
# script_weapons_damage
# Input1: item_id
# Input2: armor
# Output: reg1 = damage
("cf_weapons_damage",
[
(store_script_param, ":item_id", 1),
(store_script_param, ":enemy_armor", 2),
(store_random_in_range, ":suiji", 1, 5),
(ge,":suiji",1),
(item_get_thrust_damage, ":thrust", ":item_id"), ##获得武器攻击力
(item_get_swing_damage, ":swing",":item_id"),
(val_max, ":thrust",":swing"), ##取武器攻击力最大值
(assign,":damage",":thrust"),
(try_begin),
(this_or_next|lt,":thrust",30), ##武器伤害倍率
(lt,":swing",30),
(val_mul,":damage",3),
(else_try),
(this_or_next|lt,":thrust",40),
(lt,":swing",40),
(val_mul,":damage",2),
(else_try),
(this_or_next|lt,":thrust",50),
(lt,":swing",50),
(val_mul,":damage",15),
(val_div,":damage",10),
(else_try),
(val_mul,":damage",12),
(val_div,":damage",10),
(try_end),
(val_mul,":damage",15), ##根据武器伤害和对方防御计算实际伤害
(val_div,":damage",10),
(val_mul,":enemy_armor",12),
(val_div,":enemy_armor",10),
(val_sub,":damage",":enemy_armor"),
(assign, reg1, ":damage"),
]),
搜索game_get_item_extra_text加在最后一个try_end之前。
(try_begin),
(assign, reg1, 0),
(item_get_slot, reg1, ":item_no", slot_item_exp),
(try_begin),
(eq,":item_no","itm_victor"),
(assign, reg2, 210), ##熟练度最大值
(try_begin),
(ge, reg1, 210), ##熟练度最大值
(assign, reg1, "@max"),
(try_end),
(str_store_string, s1, "@proficiency: {reg1}/{reg2}"), ## 熟练度
(str_store_string, s2, "str_victor"), ##文本信息
(val_add, ":cur_text_id", 1),
(eq, ":extra_text_id", ":cur_text_id"),
(set_result_string, "@{s1}^{s2}"),
(set_trigger_result, 0xFF8000),
(else_try),
(eq, ":item_no", "itm_hades"),
(assign, reg2, 245),
(try_begin),
(ge, reg1, 245),
(assign, reg1, "@max"),
(try_end),
(str_store_string, s1, "@proficiency: {reg1}/{reg2}"),
(str_store_string, s2, "str_hades"),
(val_add, ":cur_text_id", 1),
(eq, ":extra_text_id", ":cur_text_id"),
(set_result_string, "@{s1}^{s2}"),
(set_trigger_result, 0xFF8000),
(else_try),
(eq, ":item_no", "itm_demon_slayer"),
(assign, reg2, 160),
(try_begin),
(ge, reg1, 160),
(assign, reg1, "@max"),
(try_end),
(str_store_string, s1, "@proficiency: {reg1}/{reg2}"),
(str_store_string, s2, "str_demon_slayer"),
(val_add, ":cur_text_id", 1),
(eq, ":extra_text_id", ":cur_text_id"),
(set_result_string, "@{s1}^{s2}"),
(set_trigger_result, 0xFF8000),
(else_try),
(eq, ":item_no", "itm_cupia_bow"),
(assign, reg2, 170),
(try_begin),
(ge, reg1, 170),
(assign, reg1, "@max"),
(try_end),
(str_store_string, s1, "@proficiency: {reg1}/{reg2}"),
(str_store_string, s2, "str_cupia_bow"),
(val_add, ":cur_text_id", 1),
(eq, ":extra_text_id", ":cur_text_id"),
(set_result_string, "@{s1}^{s2}"),
(set_trigger_result, 0xFF8000),
(else_try),
(eq, ":item_no", "itm_gale_flame"),
(assign, reg2, 135),
(try_begin),
(ge, reg1, 135),
(assign, reg1, "@max"),
(try_end),
(str_store_string, s1, "@proficiency: {reg1}/{reg2}"),
(str_store_string, s2, "str_gale_flame"),
(val_add, ":cur_text_id", 1),
(eq, ":extra_text_id", ":cur_text_id"),
(set_result_string, "@{s1}^{s2}"),
(set_trigger_result, 0xFF8000),
(else_try),
(eq, ":item_no", "itm_goblin_muramasa"),
(assign, reg2, 100),
(try_begin),
(ge, reg1, 100),
(assign, reg1, "@max"),
(try_end),
(str_store_string, s1, "@proficiency: {reg1}/{reg2}"),
(str_store_string, s2, "str_weapons_dialog"),
(val_add, ":cur_text_id", 1),
(eq, ":extra_text_id", ":cur_text_id"),
(set_result_string, "@{s1}^{s2}"),
(set_trigger_result, 0xFF8000),
(try_end),
(try_end),
|
至于武器啥的,自己设定喽!
|