#============================================================================== # Zenith RGSS12 召喚 ver1.20 #   by 水夜 #  http://zenith.ifdef.jp/ #------------------------------------------------------------------------------ # 戦闘中に特定のアクターを召喚する。 #============================================================================== #============================================================================== # □ カスタマイズポイント #============================================================================== module ZENITH12 # 召喚されたアクターの自動全回復タイミング #  0:自動全回復しない 1:召喚終了時に全回復 2:戦闘終了時に全回復 RECOVER_TYPE = 1 # 召喚中は、召喚に使用したスキル・アイテムをリストから消す # (ただし、スキルの場合、リストからスキルが消えるのは使用者のみです) SKILL_ITEM_LOSE = false end #============================================================================== # Sprite_Battler修正 # 戦闘中のアクター入れ替えで # 「アクターを外す→再度加える」とするとバトラーが消えるバグを修正 #============================================================================== class Sprite_Battler < RPG::Sprite alias zenith_debug_update update def update # バトラーが nil の場合 if @battler == nil @battler_name = nil @battler_hue = nil end zenith_debug_update end end class Game_Party attr_accessor :summon_member # 召喚前のメンバー attr_accessor :summon_skill # 召喚に使用したスキル attr_accessor :summon_item # 召喚に使用したアイテム #-------------------------------------------------------------------------- # ● 召喚によるアクター入れ替え #-------------------------------------------------------------------------- def summon_change(actor_id, type, summoner) # 召喚タイプによって分岐 case type # 召喚アクターのみ when 0 @actors = [$game_actors[actor_id]] # 召喚者+召喚アクター when 1 @actors = [summoner, $game_actors[actor_id]] # パーティーメンバー+召喚アクター when 2 add_actor(actor_id) # 召喚者と召喚アクターを入れ替え when 3 index = @actors.index(summoner) @actors[index] = $game_actors[actor_id] end # 召喚されたアクターを記憶 @summon_actor = $game_actors[actor_id] end #-------------------------------------------------------------------------- # ● 召喚終了によるメンバー復帰 #-------------------------------------------------------------------------- def summon_end if @summon_member != nil if ZENITH12::RECOVER_TYPE == 1 @summon_actor.recover_all end if @summon_skill != [] @summon_skill[0].learn_skill(@summon_skill[1]) end if @summon_item != [] $game_party.gain_item(@summon_item[0], @summon_item[1]) end @actors = @summon_member @summon_member = nil @summon_actor = nil end end end class Scene_Battle #-------------------------------------------------------------------------- # ● 召喚 #-------------------------------------------------------------------------- def summon(actor_id, type) unless $game_party.actors.include?($game_actors[actor_id]) # 多重召喚を防止 if @summon_actor != nil $game_party.summon_end end $game_party.summon_member = [] # 召喚前のメンバー記憶 for i in 0...$game_party.actors.size $game_party.summon_member[i] = $game_party.actors[i] end # アクター入れ替え $game_party.summon_change(actor_id, type, @active_battler) # 召喚されたアクターを記憶 @summon_actor = $game_actors[actor_id] if @summon_actors == nil @summon_actors = [] end @summon_actors.push(@summon_actor) @summon_actors.uniq! $game_party.summon_skill = [] $game_party.summon_item = [] if ZENITH12::SKILL_ITEM_LOSE case @active_battler.current_action.kind when 1 # スキル $game_party.summon_skill[0] = @active_battler $game_party.summon_skill[1] = @skill.id @active_battler.forget_skill(@skill.id) when 2 # アイテム $game_party.summon_item[0] = @item.id $game_party.summon_item[1] = $game_party.item_number(@item.id) $game_party.lose_item(@item.id, $game_party.summon_item[1]) end end end end #-------------------------------------------------------------------------- # ● メイン処理 #-------------------------------------------------------------------------- alias zenith12_main main def main $game_party.summon_skill = [] $game_party.summon_item = [] zenith12_main $game_party.summon_end if ZENITH12::RECOVER_TYPE == 2 and @summon_actors != nil for i in @summon_actors i.recover_all end end @summon_actor = nil @summon_actors = nil end #-------------------------------------------------------------------------- # ● 勝敗判定 #-------------------------------------------------------------------------- alias zenith12_judge judge def judge if @summon_actor != nil and @summon_actor.dead? $game_party.summon_end $game_party.summon_skill = [] $game_party.summon_item = [] @summon_actor = nil @status_window.refresh end zenith12_judge end end