本帖最后由 黑暗路西法 于 2023-9-30 22:05 编辑
因为我自己的mod新版本添加了一套战斗伤害判断系统,所以顺便发中文站看有没有人需要
已经把我mod中的特殊判定去掉,纯净框架版
本体是一个script,然后在mt里加一个common判定,引用到场景里
- ("cf_battle_buffs",[
- (store_script_param, ":inflicted_agent", 1),
- (store_script_param, ":dealer_agent", 2),
- (store_script_param, ":inflicted_damage", 3),
- (store_script_param, ":player_agent", 4),
- (assign,":ranged",0),
- (agent_get_troop_id, ":inflicted_troop", ":inflicted_agent"),
- (agent_get_horse, ":agent_is_riding", ":inflicted_agent"),
- (gt, ":inflicted_damage", 0),
- (try_begin), #报错保险
- (agent_get_wielded_item, ":dealer_item_id", ":dealer_agent", 0),
- (gt,":dealer_item_id",0),
- (item_get_type, ":item_type",":dealer_item_id"),
- (else_try),
- (assign,":dealer_item_id",0),
- (assign,":item_type", itp_type_two_handed_wpn),
- (try_end),
- (item_get_slot,":magic_atk",":dealer_item_id",slot_item_magic_atk), #获取原伤害的千分之x作为魔法伤害附加
- (val_mul,":magic_atk",":inflicted_damage"),
- (val_div,":magic_atk",1000),
- (store_skill_level, ":ironflesh_level", "skl_ironflesh", ":inflicted_troop"),#获取铁骨等级作为近战免伤依据
- (store_skill_level, ":athletics_level", "skl_athletics", ":inflicted_troop"),#获取跑动等级作为远程减伤依据
- (agent_get_troop_id,":inflicted_agent_trp",":inflicted_agent"),#获取troop id
- (agent_get_troop_id,":dealer_agent_trp",":dealer_agent"),
- (try_begin),
- (troop_get_slot,":side_def",":inflicted_agent_trp",slot_troop_melee_protect), #获取额外减伤
- (eq, "$less_hurt_ironflesh", 1), #铁骨减伤开关,留不留看你
- (gt, ":dealer_item_id", -1),
- (ge, ":ironflesh_level", 0),
- (this_or_next|eq, ":item_type", itp_type_one_handed_wpn),
- (this_or_next|eq, ":item_type", itp_type_two_handed_wpn),
- (eq, ":item_type", itp_type_polearm),
- (assign,":melee",1),
- (try_begin), #不骑马一级2%,否则0.75%
- (eq, ":agent_is_riding", -1),
- (store_mul, ":reduced_damage", ":ironflesh_level", 200),
- (else_try),
- (store_mul, ":reduced_damage", ":ironflesh_level", 75),
- (try_end),
- (else_try),
- (troop_get_slot,":side_def",":inflicted_agent_trp",slot_troop_ranged_protect), #获取远程减伤,弓弩投
- (eq, "$less_hurt_athletics", 1), #同开关
- (gt, ":dealer_item_id", -1),
- (ge, ":athletics_level", 0),
- (this_or_next|eq, ":item_type", itp_type_bow),
- (this_or_next|eq, ":item_type", itp_type_crossbow),
- (eq, ":item_type", itp_type_thrown),
- (assign,":ranged",1),
- (try_begin), #不骑马才有免伤
- (eq, ":agent_is_riding", -1),
- (store_mul, ":reduced_damage", ":athletics_level", 300),
- (try_end),
- (else_try),
- (troop_get_slot,":side_def",":inflicted_agent_trp",slot_troop_ranged_protect),
- (eq, "$less_hurt_athletics", 1),
- (gt, ":dealer_item_id", -1),
- (ge, ":athletics_level", 0),
- (this_or_next|eq, ":item_type", itp_type_pistol),
- (eq, ":item_type", itp_type_musket),
- (assign,":ranged",1),
- (try_begin), #不骑马才有免伤,一级1%
- (eq, ":agent_is_riding", -1),
- (store_mul, ":reduced_damage", ":athletics_level", 100),
- (try_end),
- (try_end),
- (val_add,":reduced_damage",":side_def"),
- (troop_get_slot,":crush",":dealer_agent_trp",slot_troop_arm_penetrate), #计算攻击者伤害穿透
- (val_sub,":reduced_damage",":crush"),
- (val_max,":reduced_damage",-2500), #最多+25%伤害,-98%伤害
- (val_min,":reduced_damage",9800),
- (val_mul, ":reduced_damage", ":inflicted_damage"),
- (val_div, ":reduced_damage", 10000),
- (val_sub, ":inflicted_damage", ":reduced_damage"),
- (val_add,":inflicted_damage",":magic_atk"), #魔伤加回去
-
- (try_begin),
- (gt,":magic_atk",0),
- (eq,":dealer_agent",":player_agent"), #通知玩家魔法伤害
- (assign,reg21,":magic_atk"),
- (display_message,"@create {reg21} magatk",0x33CCFF),
- (else_try),
- (gt,":magic_atk",0),
- (eq,":inflicted_agent",":player_agent"),
- (assign,reg21,":magic_atk"),
- (display_message,"@earn {reg21} magatk",0x33CCFF),
- (else_try),
- (try_end),
-
-
- (troop_get_slot,":all_def",":inflicted_agent_trp",slot_troop_all_protect),#计算特殊抗性
- (val_mul, ":all_def", ":inflicted_damage"),
- (val_div, ":all_def", 10000),
- (val_sub, ":inflicted_damage", ":all_def"),
-
- (troop_get_slot,":all_def",":inflicted_agent_trp",slot_troop_block),#计算格免
- (val_sub, ":inflicted_damage", ":all_def"),
- (val_max,":inflicted_damage", 0),
-
- (try_begin),
- (agent_slot_ge, ":inflicted_agent",slot_agent_war_shield,1), #agent护盾计算
- (agent_get_slot, ":val", ":inflicted_agent",slot_agent_war_shield),
- (try_begin),
- (gt,":val",":inflicted_damage"),
- (val_sub,":val",":inflicted_damage"),
- (assign,":inflicted_damage",0),
- (agent_set_slot, ":inflicted_agent",slot_agent_war_shield, ":val"),
- (else_try),
- (val_sub,":inflicted_damage",":val"),
- (agent_set_slot, ":inflicted_agent",slot_agent_war_shield,0),
- (try_end),
- (try_end),
-
- (try_begin),
- (troop_slot_ge,":dealer_agent_trp",slot_troop_sp_buff,1), #获取攻击者是不是特殊trp进行伤前后计算
- (try_end),
-
-
- (try_begin),
- (troop_slot_ge,":inflicted_agent_trp",slot_troop_sp_buff,1), #获取受击者是不是特殊trp进行伤前后计算
- (try_end),
- (try_begin),
- (team_slot_eq,":d_team",slot_team_xxxx,1), #一些team slot的位置,可以用来上集体buff
- (try_end),
- (set_trigger_result, ":inflicted_damage"), #伤判
- (try_begin),
- (troop_slot_ge,":inflicted_agent_trp",slot_troop_sp_buff,1), #获取受击者是不是特殊trp进行伤判后计算
- (try_end),
-
- (try_begin),
- (item_slot_ge,":dealer_item_id",slot_item_sp_buff,1), #获取攻击者的物品id,看是不是特殊武器以便进行后续计算
- (try_end),
-
- ]),
复制代码
common_battle_damage = (
ti_on_agent_hit, 0.000000, 0.000000,
[
(store_trigger_param_1, ":inflicted_agent"),
(store_trigger_param_2, ":dealer_agent"),
(store_trigger_param_3, ":inflicted_damage"),
(get_player_agent_no, ":player_agent"),
(gt,":inflicted_damage",0),
(agent_is_human, ":dealer_agent"),#防止造成伤害的是马匹找不到原始trp信息
(agent_is_human, ":inflicted_agent"),
(call_script,"script_cf_battle_buffs",":inflicted_agent",":dealer_agent",":inflicted_damage",":player_agent"),
],[])
就差不多完事了
然后每个slot的设置这块
slot_troop_melee_protect = 200 ##近战穿透,按照万分之x填
slot_troop_ranged_protect = 201 #远程穿透,按照万分之x填
slot_troop_all_protect = 202 #特殊抗性,按照万分之x填
slot_troop_arm_penetrate = 203 #伤害穿透,按照万分之x填
slot_troop_arm_shield = 204 #护盾,直接填值
slot_troop_block = 205 #格免,直接填值
slot_troop_sp_buff =206 #大于1的情况下该兵种进入特殊判定
slot_agent_war_shield = 40#agent护盾
TEAM SLOTS没怎么用,可以大大滴加
然后是item的魔攻
slot_item_magic_atk #按照百分之x填
非要说这osp其实没什么特别的,主要优点是如果完全没想法用我参考的比从零开始写快一点
|