这是用RMXP写的召唤兽系统,可以用来做宠物小精灵、暗黑协奏曲等需要使魔或将敌人感化为我方角色的游戏。
修改了一个类 Game_Actor,自己新写了一个类 CallGuardian。将下列脚本插入到工程最后,再将Game_Actor替换掉即可
具体用法与代码如下:
- #==============================================================================# ■ CallGuardian 召唤兽脚本#------------------------------------------------------------------------------# 可用来在战斗中召唤一个助阵的家伙,战斗结束后自动消失。可结合魔法、物品使用# 本脚本由66RPG唐门草楹(哈里)提供,若使用请在说明文件或制作组字幕中注明,谢谢#============================================================================== #==========================使用方法(请务必看懂)============================ # # 如果要在物品或特技中使用,需要通过公共事件调用脚本。脚本内容为: # #"CallGuardian.new.main(int guardianPlayer,int guardianNo,int ifReality)" # # 此脚本可以召唤敌人和我方队员。召唤有两种,一种是召唤本体(战斗后不消失), #还有一种召唤是召唤(或者说是复制)映像(战斗后消失),细分为以下三种情况 # # 1.如果召唤的是我方队员的本体,那么该队员原本应该不在队伍中,否则召唤无效果。 # # 2.如果召唤的是一个怪物并,那么本脚本实际上是先把一个敌人的属性信息复制到数 #据库-角色的对应编号位置,然后将该队员加入到队伍中。默认是战斗结束后召唤兽留在队 #伍中,如果想制作战斗结束后召唤兽消失,请在战斗结束后利用公共事件或脚本将该编号 #的队员从队伍中去掉。如果该PLAYER编号的信息没有被再次召唤,那么这个召唤兽可以被 #反复召唤出来(实际上就相当于在游戏中增加了一个角色) # # 3.如果召唤的是我方角色的一个映像,那么本脚本实际上是将某个角色的信息做了一 #份拷贝放到了数据库-角色的对应编号位置。其实可以做到重复召唤的,不过要在此脚本的 #基础上动点手脚(用一个递增的变量作为召唤者的角色编号) # # 接下来是三个参数的含义: # guardianPlayer 代表在数据库-角色编号为此变量数值的位置创建一个召唤兽对象 # guardianNo 代表创建的召唤兽对象的本体编号。正数对应数据库-敌人列表,负数对应数据库-角色 列表 # ifReality 代表是否为本体。0为映像,1为本体 # # 例: # CallGuardian.new.main(9,1,0) 在默认工程中代表创建9号角色为1号敌人(幽灵)的映像召唤进队伍 # CallGuardian.new.main(10,-1,0) 在默认工程中代表创建10号角色为1号角色(阿尔西斯)的映像召唤进队伍 # CallGuardian.new.main(0,-1,1) 将1号队员召唤进队伍参加战斗(只要ifReality变量为1,guardianNo变量必须是负数,guardianPlayer变量不会用到) # #============================================================================ class CallGuardian def main(guardianPlayer,guardianNO,ifReality) #召唤我方队员本体 if guardianNO < 0 and ifReality ==1 then $game_party.add_actor(guardianNO*(-1)) elsif guardianNO < 0 and ifReality == 0 then #召唤我方队员映像 $data_actors[guardianPlayer] = $data_actors[guardianNO*(-1)] $game_party.add_actor(guardianPlayer) elsif guardianNO > 0 #召唤敌人 actor = Game_Actor.new(guardianPlayer) actor.EnemyToActor(guardianNO) # 同伴人数未满 4 人、本角色不在队伍中的情况下 if $game_party.actors.size < 4 and not $game_party.actors.include?(actor) # 添加角色 $game_party.actors.push(actor) # 还原主角 $game_player.refresh end end end end复制代码
复制代码- #==============================================================================# ■ Game_Actor# 本脚本由66RPG 唐门草楹 贡献,利用请注明出处,谢谢~#------------------------------------------------------------------------------# 处理角色的类。本类在 Game_Actors 类 ($game_actors)# 的内部使用、Game_Party 类请参考 ($game_party) 。#==============================================================================class Game_Actor < Game_Battler #-------------------------------------------------------------------------- # ● 定义实例变量 #-------------------------------------------------------------------------- attr_reader :name # 名称 attr_reader :character_name # 角色 文件名 attr_reader :character_hue # 角色 色相 attr_reader :class_id # 职业 ID attr_reader :weapon_id # 武器 ID attr_reader :armor1_id # 盾 ID attr_reader :armor2_id # 头防具 ID attr_reader :armor3_id # 身体体防具 ID attr_reader :armor4_id # 装饰品 ID attr_reader :level # 等级 attr_reader :exp # EXP attr_reader :skills # 特技 #-------------------------------------------------------------------------- # ● 初始化对像 # actor_id : 角色 ID #-------------------------------------------------------------------------- def initialize(actor_id) super() setup(actor_id) end #-------------------------------------------------------------------------- # ● 设置 # actor_id : 角色 ID #-------------------------------------------------------------------------- def setup(actor_id) actor = $data_actors[actor_id] @ifActor = true @actor_id = actor_id @name = actor.name @character_name = actor.character_name @character_hue = actor.character_hue @battler_name = actor.battler_name @battler_hue = actor.battler_hue @class_id = actor.class_id @weapon_id = actor.weapon_id @armor1_id = actor.armor1_id @armor2_id = actor.armor2_id @armor3_id = actor.armor3_id @armor4_id = actor.armor4_id @level = actor.initial_level @exp_list = Array.new(101) make_exp_list @exp = @exp_list[@level] @skills = [] @hp = maxhp @sp = maxsp @states = [] @states_turn = {} @maxhp_plus = 0 @maxsp_plus = 0 @str_plus = 0 @dex_plus = 0 @agi_plus = 0 @int_plus = 0 # 学会特技 for i in 1..@level for j in $data_classes[@class_id].learnings if j.level == i learn_skill(j.skill_id) end end end # 刷新自动状态 update_auto_state(nil, $data_armors[@armor1_id]) update_auto_state(nil, $data_armors[@armor2_id]) update_auto_state(nil, $data_armors[@armor3_id]) update_auto_state(nil, $data_armors[@armor4_id]) end #-------------------------------------------------------------------------- # ● 获取角色 ID #-------------------------------------------------------------------------- def id if @ifActor then return @actor_id else return @enemy_id end end #-------------------------------------------------------------------------- # ● 获取索引 #-------------------------------------------------------------------------- def index return $game_party.actors.index(self) end #-------------------------------------------------------------------------- # ● 计算 EXP #-------------------------------------------------------------------------- def make_exp_list actor = $data_actors[@actor_id] @exp_list[1] = 0 pow_i = 2.4 + actor.exp_inflation / 100.0 for i in 2..100 if i > actor.final_level @exp_list[i] = 0 else n = actor.exp_basis * ((i + 3) ** pow_i) / (5 ** pow_i) @exp_list[i] = @exp_list[i-1] + Integer(n) end end end #-------------------------------------------------------------------------- # ● 取得属性修正值 # element_id : 属性 ID #-------------------------------------------------------------------------- def element_rate(element_id) if @ifActor then # 获取对应属性有效度的数值 table = [0,200,150,100,50,0,-100] result = table[$data_classes[@class_id].element_ranks[element_id]] # 防具能防御本属性的情况下效果减半 for i in [@armor1_id, @armor2_id, @armor3_id, @armor4_id] armor = $data_armors[i] if armor != nil and armor.guard_element_set.include?(element_id) result /= 2 end end # 状态能防御本属性的情况下效果减半 for i in @states if $data_states[i].guard_element_set.include?(element_id) result /= 2 end end # 过程结束 return result else # 获取对应属性有效度的数值 table = [0,200,150,100,50,0,-100] result = table[$data_enemies[@enemy_id].element_ranks[element_id]] # 状态能防御本属性的情况下效果减半 for i in @states if $data_states[i].guard_element_set.include?(element_id) result /= 2 end end # 过程结束 return result end end #-------------------------------------------------------------------------- # ● 获取属性有效度 #-------------------------------------------------------------------------- def state_ranks if @ifActor then return $data_classes[@class_id].state_ranks else return $data_enemies[@enemy_id].state_ranks end end #-------------------------------------------------------------------------- # ● 判定防御属性 # state_id : 属性 ID #-------------------------------------------------------------------------- def state_guard?(state_id) if @ifActor then for i in [@armor1_id, @armor2_id, @armor3_id, @armor4_id] armor = $data_armors[i] if armor != nil if armor.guard_state_set.include?(state_id) return true end end end return false else return false end end #-------------------------------------------------------------------------- # ● 获取普通攻击属性 #-------------------------------------------------------------------------- def element_set if @ifActor then weapon = $data_weapons[@weapon_id] return weapon != nil ? weapon.element_set : [] else return [] end end #-------------------------------------------------------------------------- # ● 获取普通攻击状态变化 (+) #-------------------------------------------------------------------------- def plus_state_set if @ifActor then weapon = $data_weapons[@weapon_id] return weapon != nil ? weapon.plus_state_set : [] else return [] end end #-------------------------------------------------------------------------- # ● 获取普通攻击状态变化 (-) #-------------------------------------------------------------------------- def minus_state_set if @ifActor then weapon = $data_weapons[@weapon_id] return weapon != nil ? weapon.minus_state_set : [] else return [] end end #-------------------------------------------------------------------------- # ● 获取 MaxHP #-------------------------------------------------------------------------- def maxhp n = [[base_maxhp + @maxhp_plus, 1].max, 9999].min for i in @states n *= $data_states[i].maxhp_rate / 100.0 end n = [[Integer(n), 1].max, 9999].min return n end #-------------------------------------------------------------------------- # ● 获取基本 MaxHP #-------------------------------------------------------------------------- def base_maxhp if @ifActor then return $data_actors[@actor_id].parameters[0, @level] else return $data_enemies[@enemy_id].maxhp end end #-------------------------------------------------------------------------- # ● 获取基本 MaxSP #-------------------------------------------------------------------------- def base_maxsp if @ifActor then return $data_actors[@actor_id].parameters[1, @level] else return $data_enemies[@enemy_id].maxsp end end #-------------------------------------------------------------------------- # ● 获取基本力量 #-------------------------------------------------------------------------- def base_str if @ifActor then n = $data_actors[@actor_id].parameters[2, @level] weapon = $data_weapons[@weapon_id] armor1 = $data_armors[@armor1_id] armor2 = $data_armors[@armor2_id] armor3 = $data_armors[@armor3_id] armor4 = $data_armors[@armor4_id] n += weapon != nil ? weapon.str_plus : 0 n += armor1 != nil ? armor1.str_plus : 0 n += armor2 != nil ? armor2.str_plus : 0 n += armor3 != nil ? armor3.str_plus : 0 n += armor4 != nil ? armor4.str_plus : 0 return [[n, 1].max, 999].min else return $data_enemies[@enemy_id].str end end #-------------------------------------------------------------------------- # ● 获取基本灵巧 #-------------------------------------------------------------------------- def base_dex if @ifActor then n = $data_actors[@actor_id].parameters[3, @level] weapon = $data_weapons[@weapon_id] armor1 = $data_armors[@armor1_id] armor2 = $data_armors[@armor2_id] armor3 = $data_armors[@armor3_id] armor4 = $data_armors[@armor4_id] n += weapon != nil ? weapon.dex_plus : 0 n += armor1 != nil ? armor1.dex_plus : 0 n += armor2 != nil ? armor2.dex_plus : 0 n += armor3 != nil ? armor3.dex_plus : 0 n += armor4 != nil ? armor4.dex_plus : 0 return [[n, 1].max, 999].min else return $data_enemies[@enemy_id].dex end end #-------------------------------------------------------------------------- # ● 获取基本速度 #-------------------------------------------------------------------------- def base_agi if @ifActor then n = $data_actors[@actor_id].parameters[4, @level] weapon = $data_weapons[@weapon_id] armor1 = $data_armors[@armor1_id] armor2 = $data_armors[@armor2_id] armor3 = $data_armors[@armor3_id] armor4 = $data_armors[@armor4_id] n += weapon != nil ? weapon.agi_plus : 0 n += armor1 != nil ? armor1.agi_plus : 0 n += armor2 != nil ? armor2.agi_plus : 0 n += armor3 != nil ? armor3.agi_plus : 0 n += armor4 != nil ? armor4.agi_plus : 0 return [[n, 1].max, 999].min else return $data_enemies[@enemy_id].agi end end #-------------------------------------------------------------------------- # ● 获取基本魔力 #-------------------------------------------------------------------------- def base_int if @ifActor then n = $data_actors[@actor_id].parameters[5, @level] weapon = $data_weapons[@weapon_id] armor1 = $data_armors[@armor1_id] armor2 = $data_armors[@armor2_id] armor3 = $data_armors[@armor3_id] armor4 = $data_armors[@armor4_id] n += weapon != nil ? weapon.int_plus : 0 n += armor1 != nil ? armor1.int_plus : 0 n += armor2 != nil ? armor2.int_plus : 0 n += armor3 != nil ? armor3.int_plus : 0 n += armor4 != nil ? armor4.int_plus : 0 return [[n, 1].max, 999].min else return $data_enemies[@enemy_id].int end end #-------------------------------------------------------------------------- # ● 获取基本攻击力 #-------------------------------------------------------------------------- def base_atk if @ifActor then weapon = $data_weapons[@weapon_id] return weapon != nil ? weapon.atk : 0 else return $data_enemies[@enemy_id].atk end end #-------------------------------------------------------------------------- # ● 获取基本物理防御 #-------------------------------------------------------------------------- def base_pdef if @ifActor then weapon = $data_weapons[@weapon_id] armor1 = $data_armors[@armor1_id] armor2 = $data_armors[@armor2_id] armor3 = $data_armors[@armor3_id] armor4 = $data_armors[@armor4_id] pdef1 = weapon != nil ? weapon.pdef : 0 pdef2 = armor1 != nil ? armor1.pdef : 0 pdef3 = armor2 != nil ? armor2.pdef : 0 pdef4 = armor3 != nil ? armor3.pdef : 0 pdef5 = armor4 != nil ? armor4.pdef : 0 return pdef1 + pdef2 + pdef3 + pdef4 + pdef5 else return $data_enemies[@enemy_id].pdef end end #-------------------------------------------------------------------------- # ● 获取基本魔法防御 #-------------------------------------------------------------------------- def base_mdef if @ifActor then weapon = $data_weapons[@weapon_id] armor1 = $data_armors[@armor1_id] armor2 = $data_armors[@armor2_id] armor3 = $data_armors[@armor3_id] armor4 = $data_armors[@armor4_id] mdef1 = weapon != nil ? weapon.mdef : 0 mdef2 = armor1 != nil ? armor1.mdef : 0 mdef3 = armor2 != nil ? armor2.mdef : 0 mdef4 = armor3 != nil ? armor3.mdef : 0 mdef5 = armor4 != nil ? armor4.mdef : 0 return mdef1 + mdef2 + mdef3 + mdef4 + mdef5 else return $data_enemies[@enemy_id].mdef end end #-------------------------------------------------------------------------- # ● 获取基本回避修正 #-------------------------------------------------------------------------- def base_eva if @ifActor then armor1 = $data_armors[@armor1_id] armor2 = $data_armors[@armor2_id] armor3 = $data_armors[@armor3_id] armor4 = $data_armors[@armor4_id] eva1 = armor1 != nil ? armor1.eva : 0 eva2 = armor2 != nil ? armor2.eva : 0 eva3 = armor3 != nil ? armor3.eva : 0 eva4 = armor4 != nil ? armor4.eva : 0 return eva1 + eva2 + eva3 + eva4 else return $data_enemies[@enemy_id].eva end end #-------------------------------------------------------------------------- # ● 普通攻击 获取攻击方动画 ID #-------------------------------------------------------------------------- def animation1_id if @ifActor then weapon = $data_weapons[@weapon_id] return weapon != nil ? weapon.animation1_id : 0 else return $data_enemies[@enemy_id].animation1_id end end #-------------------------------------------------------------------------- # ● 普通攻击 获取对像方动画 ID #-------------------------------------------------------------------------- def animation2_id if @ifActor then weapon = $data_weapons[@weapon_id] return weapon != nil ? weapon.animation2_id : 0 else return $data_enemies[@enemy_id].animation2_id end end #-------------------------------------------------------------------------- # ● 获取类名 #-------------------------------------------------------------------------- def class_name if @ifActor then return $data_classes[@class_id].name else return "召唤兽" end end #-------------------------------------------------------------------------- # ● 获取 EXP 字符串 #-------------------------------------------------------------------------- def exp_s return @exp_list[@level+1] > 0 ? @exp.to_s : "-------" end #-------------------------------------------------------------------------- # ● 获取下一等级的 EXP 字符串 #-------------------------------------------------------------------------- def next_exp_s return @exp_list[@level+1] > 0 ? @exp_list[@level+1].to_s : "-------" end #-------------------------------------------------------------------------- # ● 获取离下一等级还需的 EXP 字符串 #-------------------------------------------------------------------------- def next_rest_exp_s return @exp_list[@level+1] > 0 ? (@exp_list[@level+1] - @exp).to_s : "-------" end #-------------------------------------------------------------------------- # ● 更新自动状态 # old_armor : 卸下防具 # new_armor : 装备防具 #-------------------------------------------------------------------------- def update_auto_state(old_armor, new_armor) # 强制解除卸下防具的自动状态 if old_armor != nil and old_armor.auto_state_id != 0 remove_state(old_armor.auto_state_id, true) end # 强制附加装备防具的自动状态 if new_armor != nil and new_armor.auto_state_id != 0 add_state(new_armor.auto_state_id, true) end end #-------------------------------------------------------------------------- # ● 装备固定判定 # equip_type : 装备类型 #-------------------------------------------------------------------------- def equip_fix?(equip_type) case equip_type when 0 # 武器 return $data_actors[@actor_id].weapon_fix when 1 # 盾 return $data_actors[@actor_id].armor1_fix when 2 # 头 return $data_actors[@actor_id].armor2_fix when 3 # 身体 return $data_actors[@actor_id].armor3_fix when 4 # 装饰品 return $data_actors[@actor_id].armor4_fix end return false end #-------------------------------------------------------------------------- # ● 变更装备 # equip_type : 装备类型 # id : 武器 or 防具 ID (0 为解除装备) #-------------------------------------------------------------------------- def equip(equip_type, id) case equip_type when 0 # 武器 if id == 0 or $game_party.weapon_number(id) > 0 $game_party.gain_weapon(@weapon_id, 1) @weapon_id = id $game_party.lose_weapon(id, 1) end when 1 # 盾 if id == 0 or $game_party.armor_number(id) > 0 update_auto_state($data_armors[@armor1_id], $data_armors[id]) $game_party.gain_armor(@armor1_id, 1) @armor1_id = id $game_party.lose_armor(id, 1) end when 2 # 头 if id == 0 or $game_party.armor_number(id) > 0 update_auto_state($data_armors[@armor2_id], $data_armors[id]) $game_party.gain_armor(@armor2_id, 1) @armor2_id = id $game_party.lose_armor(id, 1) end when 3 # 身体 if id == 0 or $game_party.armor_number(id) > 0 update_auto_state($data_armors[@armor3_id], $data_armors[id]) $game_party.gain_armor(@armor3_id, 1) @armor3_id = id $game_party.lose_armor(id, 1) end when 4 # 装饰品 if id == 0 or $game_party.armor_number(id) > 0 update_auto_state($data_armors[@armor4_id], $data_armors[id]) $game_party.gain_armor(@armor4_id, 1) @armor4_id = id $game_party.lose_armor(id, 1) end end end #-------------------------------------------------------------------------- # ● 可以装备判定 # item : 物品 #-------------------------------------------------------------------------- def equippable?(item) # 武器的情况 if item.is_a?(RPG::Weapon) # 包含当前的职业可以装备武器的场合 if $data_classes[@class_id].weapon_set.include?(item.id) return true end end # 防具的情况 if item.is_a?(RPG::Armor) # 不包含当前的职业可以装备武器的场合 if $data_classes[@class_id].armor_set.include?(item.id) return true end end return false end #-------------------------------------------------------------------------- # ● 更改 EXP # exp : 新的 EXP #-------------------------------------------------------------------------- def exp=(exp) if @ifActor then @exp = [[exp, 9999999].min, 0].max # 升级 while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0 @level += 1 # 学会特技 for j in $data_classes[@class_id].learnings if j.level == @level learn_skill(j.skill_id) end end end # 降级 while @exp < @exp_list[@level] @level -= 1 end # 修正当前的 HP 与 SP 超过最大值 @hp = [@hp, self.maxhp].min @sp = [@sp, self.maxsp].min end end #-------------------------------------------------------------------------- # ● 更改等级 # level : 新的等级 #-------------------------------------------------------------------------- def level=(level) # 检查上下限 level = [[level, $data_actors[@actor_id].final_level].min, 1].max # 更改 EXP self.exp = @exp_list[level] end #-------------------------------------------------------------------------- # ● 觉悟特技 # skill_id : 特技 ID #-------------------------------------------------------------------------- def learn_skill(skill_id) if skill_id > 0 and not skill_learn?(skill_id) @skills.push(skill_id) @skills.sort! end end #-------------------------------------------------------------------------- # ● 遗忘特技 # skill_id : 特技 ID #-------------------------------------------------------------------------- def forget_skill(skill_id) @skills.delete(skill_id) end #-------------------------------------------------------------------------- # ● 已经学会的特技判定 # skill_id : 特技 ID #-------------------------------------------------------------------------- def skill_learn?(skill_id) return @skills.include?(skill_id) end #-------------------------------------------------------------------------- # ● 可以使用特技判定 # skill_id : 特技 ID #-------------------------------------------------------------------------- def skill_can_use?(skill_id) if not skill_learn?(skill_id) return false end return super end #-------------------------------------------------------------------------- # ● 更改名称 # name : 新的名称 #-------------------------------------------------------------------------- def name=(name) @name = name end #-------------------------------------------------------------------------- # ● 更改职业 ID # class_id : 新的职业 ID #-------------------------------------------------------------------------- def class_id=(class_id) if $data_classes[class_id] != nil @class_id = class_id # 避开无法装备的物品 unless equippable?($data_weapons[@weapon_id]) equip(0, 0) end unless equippable?($data_armors[@armor1_id]) equip(1, 0) end unless equippable?($data_armors[@armor2_id]) equip(2, 0) end unless equippable?($data_armors[@armor3_id]) equip(3, 0) end unless equippable?($data_armors[@armor4_id]) equip(4, 0) end end end #-------------------------------------------------------------------------- # ● 更改图形 # character_name : 新的角色 文件名 # character_hue : 新的角色 色相 # battler_name : 新的战斗者 文件名 # battler_hue : 新的战斗者 色相 #-------------------------------------------------------------------------- def set_graphic(character_name, character_hue, battler_name, battler_hue) @character_name = character_name @character_hue = character_hue @battler_name = battler_name @battler_hue = battler_hue end #-------------------------------------------------------------------------- # ● 取得战斗画面的 X 坐标 #-------------------------------------------------------------------------- def screen_x # 返回计算后的队伍 X 坐标的排列顺序 if self.index != nil return self.index * 160 + 80 else return 0 end end #-------------------------------------------------------------------------- # ● 取得战斗画面的 Y 坐标 #-------------------------------------------------------------------------- def screen_y return 464 end #-------------------------------------------------------------------------- # ● 取得战斗画面的 Z 坐标 #-------------------------------------------------------------------------- def screen_z # 返回计算后的队伍 Z 坐标的排列顺序 if self.index != nil return 4 - self.index else return 0 end end #-------------------------------------------------------------------------- # ● 设置 MaxHP # maxhp : 新的 MaxHP #-------------------------------------------------------------------------- def maxhp=(maxhp) @maxhp_plus += maxhp - self.maxhp @maxhp_plus = [[@maxhp_plus, -9999].max, 9999].min @hp = [@hp, self.maxhp].min end #-------------------------------------------------------------------------- #● 由一个敌人变来的角色 #-------------------------------------------------------------------------- def EnemyToActor(guardianNO) @ifActor = false enemy = $data_enemies[guardianNO] @enemy_id = guardianNO @name = enemy.name @character_name = enemy.battler_name @character_hue = enemy.battler_hue @battler_name = enemy.battler_name @battler_hue = enemy.battler_hue @weapon_id = 0 @armor1_id = 0 @armor2_id = 0 @armor3_id = 0 @armor4_id = 0 @level = 1 @exp_list = Array.new(101) for i in 1..100 @exp_list[i] = 999999 end @exp = 0 @skills = [] @hp = enemy.maxhp @sp = enemy.maxsp @states = [] @states_turn = {} @maxhp_plus = 0 @maxsp_plus = 0 @str_plus = 0 @dex_plus = 0 @agi_plus = 0 @int_plus = 0 actions = $data_enemies[@enemy_id].actions for action in actions # 确认种类条件 if action.kind != 1 then next end # 确认回合条件 n = $game_temp.battle_turn a = action.condition_turn_a b = action.condition_turn_b if (b == 0 and n != a) or (b > 0 and (n < 1 or n < a or n % b != a % b)) next end # 确认 HP 条件 if self.hp * 100.0 / self.maxhp > action.condition_hp next end # 确认等级条件 if $game_party.max_level < action.condition_level next end # 确认开关条件 switch_id = action.condition_switch_id if switch_id > 0 and $game_switches[switch_id] == false next end # 符合条件 : 添加本特技 learn_skill(action.skill_id) end endend复制代码
复制代码以下是利用该脚本实现的 战斗中 召唤队友、角色映像复制、召唤特定使魔 的效果图
具体使用方法请参见范例程序~
本帖来自P1论坛作者唐门草楹,因Project1站服务器在国外有时候访问缓慢不方便作者交流学习,经联系P1站长fux2同意署名转载一起分享游戏制作经验,共同为国内独立游戏作者共同创造良好交流环境,原文地址:
https://rpg.blue/forum.php?mod=viewthread&tid=253985 若有侵权,发帖作者可联系底部站长QQ在线咨询功能删除,谢谢。