本帖最后由 快乐风猫 于 2024-2-6 22:36 编辑
突发奇想战场里,骑克射,射克步,步克枪,枪克骑 ,更能体现各王国的兵种优势,玩家在野战前也能更谨慎的选择合适的队伍进行战斗,通过兵种类型和所用的武器来判断是什么兵种,
兵种克制:骑兵X步兵,步兵X射手,射手X骑兵,从步兵里分出一个单独的枪兵用作克制骑兵,骑射手不作处理,因为骑射已经很变态了,不能再加强了
领主受伤身亡:相较于抓住领主处决,我觉得在战场中的战斗也影响领主的生死比较真实,战斗中领主被击晕后为受伤状态,战后领主逃跑或被俘虏都有几率重伤身亡
.......................
代码如下
- kezhi = (
- ti_on_agent_hit, 0, 0,
- [
- (store_trigger_param_1, ":shoushang"),#受击者
- (store_trigger_param_2, ":gongji"),#攻击者
- (store_trigger_param_3, ":zhi"),#伤害
- (agent_is_human,":shoushang"),#是人类
- (agent_is_human,":gongji"),#是人类
- (agent_is_alive,":shoushang"),#是存活的
- (agent_is_alive,":gongji"),#是存活的
- (agent_get_class ,":bingzhong", ":shoushang"),#获取受击者兵种类型
- (agent_get_class ,":bingzhong_1", ":gongji"),#获取攻击者兵种类型
- (try_begin),
- ##骑兵只能用近战武器对步兵造成伤害,骑射手为正常伤害
- (eq,":bingzhong_1",grc_cavalry),#攻击者是骑兵
- (eq,":bingzhong",grc_infantry),#受击者是步兵
- (agent_get_wielded_item,":wuqi",":shoushang",0),#获取步兵装备的武器
- (item_get_type, ":leixing", ":wuqi"),
- (neg|eq,":leixing",itp_type_polearm),#不是长杆(区分枪兵与普通步兵作用)
- (agent_get_wielded_item,":wuqi2",":gongji",0),#获取骑兵装备的武器
- (item_get_type, ":leixing2", ":wuqi2"),
- (neg|eq,":leixing2",itp_type_bow),#不能是弓骑兵
- (neg|eq,":leixing2",itp_type_crossbow),#不能是弩骑兵
- (assign,":shanghai",":zhi"),#获取伤害
- (val_div, ":shanghai", 5),#造成20%额外伤害
- (store_agent_hit_points, ":hp", ":shoushang", 1),
- (val_sub, ":hp", ":shanghai"),
- (val_max, ":hp", 0),#取较大值
- (agent_set_hit_points, ":shoushang", ":hp", 1),
- (assign, reg1,":shanghai"),#输出数据
- (display_message, "@骑 兵 对 步 兵 造 成 {reg1}点 伤 害 !", 0xFF0000),
- (else_try),
- (eq,":bingzhong_1",grc_infantry),#攻击者是步兵
- (eq,":bingzhong",grc_archers),#受击者是射手
- ##不判断射手武器,只判断兵种类型,检测是射手都会受到步兵额外伤害(包括弓箭手+弩手+投掷)
- (agent_get_wielded_item,":wuqi",":gongji",0),#获取步兵装备的武器
- (item_get_type, ":leixing", ":wuqi"),
- (neg|eq,":leixing",itp_type_polearm),#不是长杆(区分枪兵与普通步兵作用)
- (assign,":shanghai",":zhi"),#获取伤害
- (val_div, ":shanghai", 5),#造成20%额外伤害
- (store_agent_hit_points, ":hp", ":shoushang", 1),
- (val_sub, ":hp", ":shanghai"),
- (val_max, ":hp", 0),#取较大值
- (agent_set_hit_points, ":shoushang", ":hp", 1),
- (assign, reg1,":shanghai"),#输出数据
- (display_message, "@步 兵 对 射 手 造 成 {reg1}点 伤 害 !", 0xFF0000),
- (else_try),
- (eq,":bingzhong_1",grc_archers),#攻击者是射手
- (eq,":bingzhong",grc_cavalry),#受击者是骑兵
- ##不判断骑兵武器,只判断兵种类型,检测是有马的单位都可以造成额外伤害(包括骑射手)
- (agent_get_wielded_item,":wuqi",":gongji",0),#获取射手装备的武器
- (item_get_type, ":leixing", ":wuqi"),
- (this_or_next|eq, ":leixing",itp_type_bow),#是弓
- (this_or_next|eq, ":leixing",itp_type_crossbow),#是弩
- (eq, ":leixing",itp_type_thrown),#是投掷武器
- ##判断射手武器,只能以弓箭、弩、投掷武器造成额外伤害(其余武器不生效)
- (assign,":shanghai",":zhi"),#获取伤害
- (val_div, ":shanghai", 5),#造成20%额外伤害
- (store_agent_hit_points, ":hp", ":shoushang", 1),
- (val_sub, ":hp", ":shanghai"),
- (val_max, ":hp", 0),#取较大值
- (agent_set_hit_points, ":shoushang", ":hp", 1),
- (assign, reg1,":shanghai"),#输出数据
- (display_message, "@射 手 对 骑 兵 造 成 {reg1}点 伤 害 !", 0xFF0000),
- (else_try),
- (eq,":bingzhong_1",grc_infantry),#攻击者是枪兵
- (eq,":bingzhong",grc_cavalry),#受击者是骑兵
- (agent_get_wielded_item,":wuqi",":gongji",0),
- (item_get_type, ":leixing", ":wuqi"),
- (eq,":leixing", itp_type_polearm),#获取步兵武器(只能是长杆武器才能造成额外伤害)
- (assign,":shanghai",":zhi"),#获取伤害
- (val_div, ":shanghai", 5),#造成20%额外伤害
- (store_agent_hit_points, ":hp", ":shoushang", 1),
- (val_sub, ":hp", ":shanghai"),
- (val_max, ":hp", 0),#取较大值
- (agent_set_hit_points, ":shoushang", ":hp", 1),
- (assign, reg1,":shanghai"),#输出数据
- (display_message, "@枪 兵 对 骑 兵 造 成 {reg1}点 伤 害 !", 0xFF0000),
- (try_end),
-
- ], [])
复制代码
|
代码如下
slot_troop_shoushang = 170
加一个新的slot槽
- shasi = (
- ti_on_agent_killed_or_wounded, 0, 0, [],
- [
- (store_trigger_param_1, ":agent_1"),#受伤
- (store_trigger_param_2, ":agent_2"),#攻击
- (agent_get_troop_id,":troop",":agent_1"),#获取被杀者troopID
- (agent_get_troop_id,":troop_2",":agent_2"),#获取攻击者troopID
- (try_for_range, ":hero", active_npcs_begin, active_npcs_end),#循环所有活跃NPC
- (try_begin),
- (troop_slot_eq, ":troop_2", slot_troop_occupation, slto_kingdom_hero),#攻击者是一位领主
- (eq,":troop",":hero"),#受伤的是活跃的NPC
- (store_character_level,":dengji",":troop"),#获取被杀者等级
- (troop_set_slot, ":troop", slot_troop_shoushang, 1),#记录受伤的领主
- (troop_get_slot, ":troop_renown", ":troop_2", slot_troop_renown),#获取击杀者声望
- (store_mul,":shengwang",":dengji",5),#击杀者获得被杀者等级✖5的声望奖励
- (val_add,":troop_renown",":shengwang"),#叠加声望
- (troop_set_slot, ":troop_2", slot_troop_renown, ":troop_renown"),#获得声望
- (else_try),#如果攻击者是士兵
- (eq,":troop",":hero"),#受伤的是活跃的NPC
- (store_character_level,":dengji",":troop"),#获取被杀者等级
- (troop_set_slot, ":troop", slot_troop_shoushang, 1),#记录受伤的领主
- (try_end),
- (try_end),
- ])
复制代码- #script_get_troop_clear
- ("get_troop_clear",
- [
- (store_script_param_1, ":clear_lord"),
- (try_begin),
- (store_troop_faction,":l_fac", ":clear_lord"),#获取兵种阵营
- (faction_get_slot, ":l_fac_leader", ":l_fac", slot_faction_leader),#获取阵营国王
- (try_for_range,":cur_center", centers_begin, centers_end),#循环中心
- (store_faction_of_party,":cur_faction",":cur_center"),#获取中心阵营
- (eq, ":cur_faction", ":l_fac"),#阵营相同
- (party_slot_eq,":cur_center",slot_town_lord, ":clear_lord"),#兵种是中心领主
- (call_script,"script_give_center_to_lord", ":cur_center",":l_fac_leader", 0),#把中心移交国王
- (try_end),
- (call_script,"script_change_troop_faction", ":clear_lord","fac_no_faction"),#改变兵种的阵营
- (troop_set_slot,":clear_lord",slot_troop_occupation,slto_inactive),#设置兵种是不活跃的
- (troop_set_note_available, ":clear_lord",0),#设置兵种信息不可用
- (troop_set_faction, ":clear_lord", "fac_no_faction"),#设置兵种阵营
- (troop_set_slot,":clear_lord",slot_troop_renown, -1),#设置兵种声望
- (troop_set_slot, ":clear_lord", slot_troop_father, -1),#无父亲
- (troop_set_slot, ":clear_lord", slot_troop_mother, -1),#无母亲
- (troop_set_slot, ":clear_lord", slot_troop_guardian, -1),
- (troop_set_slot, ":clear_lord", slot_troop_spouse, -1),
- (troop_set_slot, ":clear_lord", slot_troop_betrothed, -1),
- (troop_set_slot, ":clear_lord", slot_troop_prisoner_of_party, -1),#没有被俘虏
- (troop_set_slot, ":clear_lord", slot_troop_wealth, 0),#清楚钱
- (troop_get_slot,":lord_party", ":clear_lord", slot_troop_leaded_party),#获取兵种领导的队伍
- (try_begin),
- (party_is_active,":lord_party"),#队伍是活跃的
- (neq, ":lord_party", "p_main_party"),#不等于玩家队伍
- (remove_party,":lord_party"),#将队伍清除
- (troop_set_slot,":clear_lord",slot_troop_leaded_party, -1),#设置兵种不可以带兵
- (try_end),
- (try_end),
- ]),
复制代码- (24, 0, 0.0,
- [],
- [
- (try_for_range, ":hero", active_npcs_begin, active_npcs_end),#循环所有活跃NPC
- (troop_get_slot, ":shoushang", ":hero", slot_troop_shoushang),#领主是否在战斗中负伤
- (ge,":shoushang",1),#如果是负伤的状态
- (store_random_in_range, ":jilv", 1, 101),
- (try_begin),
- (is_between,":jilv",1,6),#5%的几率重伤身亡
- (call_script, "script_get_troop_clear",":hero"),#不治身亡
- (str_store_troop_name,s10,":hero"),
- (display_message, "@{s10}在 最 近 的 一 次 战 斗 中 受 伤 ,不 幸 重 伤 而 亡 !", 0xFF0000),
- (else_try),
- (is_between,":jilv",7,101),#95%的几率治愈伤势
- (troop_set_slot, ":hero", slot_troop_shoushang, -1),#治愈伤势
- (str_store_troop_name,s10,":hero"),
- (display_message, "@{s10}在 最 近 的 一 次 战 斗 中 受 伤 ,现 在 已 经 痊 愈 !", 0xFF0000),
- (try_end),
- (try_end),
- ]),
复制代码
清除领主用的脚本途方便就引用了@sheng1021z 的帖子一个简单的脚本,供大家学习使用
|
|