Permanent
Creation

RPGツクールXP/VX用のRGSS素材です。
一部英語版対応です。 (A few materials can be used for English RPG MAKER XP/VX.)
競合率はルファーの独断と偏見なのでたまにハズレます。


#==============================================================================
# ■ ダブルプレイヤーモード (分割定義 6)
#------------------------------------------------------------------------------
#  2 つのデータを読み込んで対戦するシーンクラスの定義です。
# ゲーム内で使うには、 $scene = Scene_DoublePlayersLoad.new というスクリプトを
# どこかに挿入する必要があります。
# (C) ルファー
# HP  https://tkoolerlufar.pages.dev/
#==============================================================================

#----------------------------------------------------------------------------
# ◆ Scene_DoublePlayersBattle クラス
#----------------------------------------------------------------------------
class Scene_DoublePlayersBattle
  #--------------------------------------------------------------------------
  # ● メイン処理
  #--------------------------------------------------------------------------
  def main
    $game_temp.in_battle = true
    $game_temp.battle_turn = 0
    $game_temp.battle_main_phase = false
    @help_window = Window_Help.new
    @p1_status_window = Window_DoublePlayersStatus.new(0)
    @p2_status_window = Window_DoublePlayersStatus.new(1)
    @command_window = Window_DoublePlayersCommand.new
    @spriteset = Spriteset_DoublePlayers.new
    @wait_count = 0
    if $data_system.battle_transition == ""
      Graphics.transition(20)
    else
      Graphics.transition(40, "Graphics/Transitions/" +
        $data_system.battle_transition)
    end
    start_phase1
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    @help_window.dispose
    @p1_status_window.dispose
    @p2_status_window.dispose
    @command_window.dispose
    @spriteset.dispose
  end
  #--------------------------------------------------------------------------
  # ● 勝敗判定
  #--------------------------------------------------------------------------
  def judge
    if $game_doubleplayers[0].all_dead? ||
       $game_doubleplayers[0].actors.size == 0 and
       $game_doubleplayers[1].all_dead? ||
       $game_doubleplayers[1].actors.size == 0
      @winner = -1
      start_phase4
      return true
    end
    if $game_doubleplayers[1].all_dead? or
       $game_doubleplayers[1].actors.size == 0
      @winner = 0
      start_phase4
      return true
    end
    if $game_doubleplayers[0].all_dead? or
       $game_doubleplayers[0].actors.size == 0
      @winner = 1
      start_phase4
      return true
    end
    return false
  end
  #--------------------------------------------------------------------------
  # ● バトル終了
  #--------------------------------------------------------------------------
  def battle_end
    for i in 0..1
      $game_doubleplayers[i].clear_actions
    end
    $game_temp.doubleplayers_mode = false
    $scene = Lfer::DP_END_SCENE.new
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新
  #--------------------------------------------------------------------------
  def update
    @help_window.update
    @p1_status_window.update
    @p2_status_window.update
    @spriteset.update
    if $game_temp.transition_processing
      $game_temp.transition_processing = false
      if $game_temp.transition_name == ""
        Graphics.transition(20)
      else
        Graphics.transition(40, "Graphics/Transitions/" +
          $game_temp.transition_name)
      end
    end
    if @spriteset.effect?
      return
    end
    if @wait_count > 0
      @wait_count -= 1
      return
    end
    case @phase
    when 1
      update_phase1
    when 2
      update_phase2
    when 3
      update_phase3
    when 4
      update_phase4
    end
  end
end

戻る