XP 스크립트

#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#_/  ◆많은 사람 파티 - KGC_LargeParty◆
#_/----------------------------------------------------------------------------
#_/ 5명 이상의 대규모 파티를 구축 가능하게 합니다.
#_/  (파티 편성을 사용하는 경우 ,[MenuAlter]와의 병용을 추천)
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

# 도입이 끝난 플래그를 온
$imported["LargeParty"] = true

#==============================================================================
# ★ 커스터마이즈 항목 ★
#==============================================================================

# 전투 멤버 최대수(스크립트는 5명용으로 특화)
$max_member = 5

#==============================================================================
# ■ Game_Actor
#------------------------------------------------------------------------------
#  엑터를 취급하는 클래스입니다. 이 클래스는 Game_Actors 클래스 ($game_actors)
# 의 내부에서 사용되어 Game_Party 클래스 ($game_party)로부터도 참조됩니다.
#==============================================================================

class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  # ● 배틀 화면 X 좌표의 취득
  #--------------------------------------------------------------------------
  def screen_x
    # 파티내의 줄 순서로부터 X 좌표를 계산해 돌려준다
    if self.index ! = nil
      return self.index * 120 + 80
    else
      return 0
    end
  end
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

#==============================================================================
# ■ Game_Party
#------------------------------------------------------------------------------
#  파티를 취급하는 클래스입니다. 골드나 아이템등의 정보가 포함됩니다. 이 쿠
# 라스의 인스턴스는 $game_party 로 참조됩니다.
#==============================================================================

class Game_Party
  #--------------------------------------------------------------------------
  # ● 공개 인스턴스 변수
  #--------------------------------------------------------------------------
  attr_accessor :battle_actors            # 전투 멤버
  attr_accessor :party_actors             # 파티내의 전엑터
  #--------------------------------------------------------------------------
  # ● 오브젝트 초기화
  #--------------------------------------------------------------------------
  alias initialize_KGC_LargeParty initialize
  def initialize
    # 원래 처리를 실행
    initialize_KGC_LargeParty

    # 전투 멤버의 배열을 작성
    @battle_actors = []
    # 파티 멤버 전원의 배열을 작성
    @party_actors = []
  end
  #--------------------------------------------------------------------------
  # ● 초기 파티의 셋업
  #--------------------------------------------------------------------------
  def setup_starting_members
    @battle_actors = []
    @party_actors = []
    for i in $data_system.party_members
      @battle_actors.push($game_actors[i])
      @party_actors.push($game_actors[i])
    end
  end
  #--------------------------------------------------------------------------
  # ● 전투 테스트용 파티의 셋업
  #--------------------------------------------------------------------------
  def setup_battle_test_members
    @battle_actors = []
    @party_actors = []
    for battler in $data_system.test_battlers
      actor = $game_actors[battler.actor_id]
      actor.level = battler.level
      gain_weapon(battler.weapon_id , 1)
      gain_armor(battler.armor1_id , 1)
      gain_armor(battler.armor2_id , 1)
      gain_armor(battler.armor3_id , 1)
      gain_armor(battler.armor4_id , 1)
      actor.equip(0, battler.weapon_id)
      actor.equip(1, battler.armor1_id)
      actor.equip(2, battler.armor2_id)
      actor.equip(3, battler.armor3_id)
      actor.equip(4, battler.armor4_id)
      actor.recover_all
      @battle_actors.push(actor)
      @party_actors.push(actor)
    end
    @items = {}
    for i in 1...$data_items.size
      if $data_items[i]. name ! = ""
        occasion = $data_items[i]. occasion
        if occasion == 0 or occasion == 1
          @items[i] = 99
        end
      end
    end
  end
  #--------------------------------------------------------------------------
  # ● 파티 멤버의 리프레쉬
  #--------------------------------------------------------------------------
  def refresh
    # 게임 데이터를 로드한 직후는 엑터 오브젝트가
    # $game_actors 로부터 분리해 버리고 있다.
    # 로드마다 엑터를 재설정하는 것으로 문제를 회피한다.
    new_battle_actors = []
    for i in 0...@battle_actors.size
      if $data_actors[@battle_actors[i]. id] ! = nil
        new_battle_actors.push($game_actors[@battle_actors[i]. id])
      end
    end
    new_party_actors = []
    for i in 0...@party_actors.size
      if $data_actors[@party_actors[i]. id] ! = nil
        new_party_actors.push($game_actors[@party_actors[i]. id])
      end
    end
    @battle_actors = new_battle_actors
    @party_actors = new_party_actors
  end
  #--------------------------------------------------------------------------
  # ● 엑터의 취득
  #--------------------------------------------------------------------------
  def actors
    # 전투중의 경우
    if $game_temp.in_battle
      return @battle_actors
    else
      return @party_actors
    end
  end
  #--------------------------------------------------------------------------
  # ● 최대 레벨의 취득
  #--------------------------------------------------------------------------
  def max_level
    # 파티 인원수가 0 명의 경우
    if self.actors.size == 0
      return 0
    end
    # 로컬 변수 level 를 초기화
    level = 0
    # 파티 멤버의 최대 레벨을 요구한다
    for actor in self.actors
      if level < actor.level
        level = actor.level
      end
    end
    return level
  end
  #--------------------------------------------------------------------------
  # ● 엑터를 가세한다
  #     actor_id : 엑터 ID
  #--------------------------------------------------------------------------
  def add_actor(actor_id)
    # 엑터를 취득
    actor = $game_actors[actor_id]
    # 파티 인원수가 최대수미만으로 ,  이 엑터가 파티에 없는 경우
    if @battle_actors.size < $max_member and not @battle_actors.include? (actor)
      # 전투 멤버와 파티에 엑터를 추가
      @battle_actors.push(actor)
      @party_actors.push(actor)
    else
      # 파티 멤버에게만 엑터를 추가
      @party_actors.push(actor)
    end
    # 플레이어를 리프레쉬
    $game_player.refresh
  end
  #--------------------------------------------------------------------------
  # ● 엑터를 제외한다
  #     actor_id : 엑터 ID
  #--------------------------------------------------------------------------
  def remove_actor(actor_id)
    actor = $game_actors[actor_id]
    # 엑터가 전투 멤버에게 있는 경우
    if @battle_actors.include? (actor)
      # 엑터를 삭제
      @battle_actors.delete(actor)
      @party_actors.delete(actor)
      # 후보 멤버로부터 적당하게 1명 가져온다
      for i in 0...@party_actors.size
        actor = @party_actors[i]
        # 전투 멤버에게 포함되지 않는 경우
        unless @battle_actors.include? (actor)
          # 전투 멤버에게 추가
          @battle_actors.push(actor)
          break
        end
      end
    else
      # 파티로부터 엑터를 삭제
      @party_actors.delete(actor)
    end
    # 플레이어를 리프레쉬
    $game_player.refresh
  end
  #--------------------------------------------------------------------------
  # ● 전원의 액션 클리어
  #--------------------------------------------------------------------------
  def clear_actions
    # 파티 전원의 액션을 클리어
    for actor in self.actors
      actor.current_action.clear
    end
  end
  #--------------------------------------------------------------------------
  # ● 커맨드 입력 가능 판정
  #--------------------------------------------------------------------------
  def inputable?
    # 혼자라도 커맨드 입력 가능하면 true 를 돌려준다
    for actor in self.actors
      if actor.inputable?
        return true
      end
    end
    return false
  end
  #--------------------------------------------------------------------------
  # ● 전멸 판정
  #--------------------------------------------------------------------------
  def all_dead?
    # 파티 인원수가 0 명의 경우
    if $game_party.actors.size == 0
      return false
    end
    # HP 0 이상의 엑터가 파티에 있는 경우
    for actor in self.actors
      if actor.hp > 0
        return false
      end
    end
    # 전멸
    return true
  end
  #--------------------------------------------------------------------------
  # ● 슬립 데미지 체크 (맵용)
  #--------------------------------------------------------------------------
  def check_map_slip_damage
    for actor in self.actors
      if actor.hp > 0 and actor.slip_damage?
        actor.hp -= [actor.maxhp / 100, 1]. max
        if actor.hp == 0
          $game_system.se_play($data_system.actor_collapse_se)
        end
        $game_screen.start_flash(Color.new(255,0,0,128) , 4)
        $game_temp.gameover = $game_party.all_dead?
      end
    end
  end
  #--------------------------------------------------------------------------
  # ● 대상 엑터의 랜덤인 결정
  #     hp0 : HP 0 의 엑터에게 한정한다
  #--------------------------------------------------------------------------
  def random_target_actor(hp0 = false)
    # 룰렛을 초기화
    roulette = []
    # 루프
    for actor in self.actors
      # 조건에 해당하는 경우
      if (not hp0 and actor.exist? ) or (hp0 and actor.hp0? )
        # 엑터의 클래스의 [위치] 를 취득
        position = $data_classes[actor.class_id]. position
        # 전위 때 n = 4,  중웨이 때 n = 3,  후위 때 n = 2
        n = 4 - position
        # 룰렛에 엑터를 n 회추가
        n.times do
          roulette.push(actor)
        end
      end
    end
    # 룰렛의 사이즈가 0 의 경우
    if roulette.size == 0
      return nil
    end
    # 룰렛을 돌려 ,  엑터를 결정
    return roulette[rand(roulette.size)]
  end
  #--------------------------------------------------------------------------
  # ● 대상 엑터의 순조로운 결정
  #     actor_index : 엑터 인덱스
  #--------------------------------------------------------------------------
  def smooth_target_actor(actor_index)
    # 엑터를 취득
    actor = self.actors[actor_index]
    # 엑터가 존재하는 경우
    if actor ! = nil and actor.exist?
      return actor
    end
    # 루프
    for actor in self.actors
      # 엑터가 존재하는 경우
      if actor.exist?
        return actor
      end
    end
  end
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

#==============================================================================
# ■ Spriteset_Battle
#------------------------------------------------------------------------------
#  배틀 화면의 스프라이트를 정리한 클래스입니다. 이 클래스는 Scene_Battle 곳간
# 스의 내부에서 사용됩니다.
#==============================================================================

class Spriteset_Battle
  #--------------------------------------------------------------------------
  # ● 그 외 스프라이트 작성  (호출원:initialize)
  #--------------------------------------------------------------------------
  alias create_etc_sprite_KGC_LargeParty create_etc_sprite
  def create_etc_sprite
    # 원래 처리를 실행
    create_etc_sprite_KGC_LargeParty

    # 엑터 스프라이트를 작성
    @actor_sprites = []
    for i in 0...$max_member
      @actor_sprites.push(Sprite_Battler.new(@viewport2))
    end
  end
  #--------------------------------------------------------------------------
  # ● 프레임 갱신
  #--------------------------------------------------------------------------
  alias update_KGC_LargeParty update
  def update
    # 원래 처리를 실행
    update_KGC_LargeParty

    # 엑터 스프라이트의 내용을 갱신 (엑터의 교체에 대응)
    for i in 0...@actor_sprites.size
      @actor_sprites[i]. battler = $game_party.actors[i]
    end
  end
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

#==============================================================================
# ■ Window_BattleStatus
#------------------------------------------------------------------------------
#  배틀 화면에서 파티 멤버의 스테이터스를 표시하는 윈도우입니다.
#==============================================================================

class Window_BattleStatus < Window_Base
  #--------------------------------------------------------------------------
  # ● 오브젝트 초기화
  #--------------------------------------------------------------------------
  alias initialize_KGC_LargeParty initialize
  def initialize
    # 원래 처리를 실행
    initialize_KGC_LargeParty

    # 레벨업 플래그를 재작성
    @level_up_flags = []
    for i in 0...$max_member
      @level_up_flags[i] = false
    end
  end
  #--------------------------------------------------------------------------
  # ● HP 의 묘화
  #     actor : 엑터
  #     x     : 묘화처 X 좌표
  #     y     : 묘화처 Y 좌표
  #     width : 묘화처의 폭
  #--------------------------------------------------------------------------
  def draw_actor_hp(actor , x, y, width = 144)
    # HP/SP게이지를 도입하고 있는 경우
    if $imported["HPSPGauge"]
      gauge = RPG::Cache.picture("gauge.png")
      self.contents.blt(x + 31 + width - 144, y + 27, gauge , Rect.new(0, 0, 102, 6))
      gw = actor.hp * 100 / actor.maxhp
      self.contents.blt(x + 32 + width - 144, y + 28, gauge , Rect.new(@gauge_x , 6 , gw , 4))
    end
    # HP 를 묘화
    self.contents.font.color = actor.hp == 0 ?  knockout_color :
      actor.hp <= actor.maxhp / 4 ?  crisis_color : normal_color
    self.contents.draw_shadow_text(x, y, 48, 32, actor.hp.to_s , 2)
    # MaxHP 를 묘화
    self.contents.font.color = normal_color
    self.contents.draw_shadow_text(x + 48, y, 12, 32, "/", 1)
    self.contents.draw_shadow_text(x + 60, y, 48, 32, actor.maxhp.to_s)
  end
  #--------------------------------------------------------------------------
  # ● SP 의 묘화
  #     actor : 엑터
  #     x     : 묘화처 X 좌표
  #     y     : 묘화처 Y 좌표
  #     width : 묘화처의 폭
  #--------------------------------------------------------------------------
  def draw_actor_sp(actor , x, y, width = 144)
    # HP/SP게이지를 도입하고 있는 경우
    if $imported["HPSPGauge"]
      gauge = RPG::Cache.picture("gauge.png")
      self.contents.blt(x + 31 + width - 144, y + 27, gauge , Rect.new(0, 0, 102, 6))
      gw = actor.sp * 100 / actor.maxsp
      self.contents.blt(x + 32 + width - 144, y + 28, gauge , Rect.new(@gauge_x , 10 , gw , 4))
    end
    # SP 를 묘화
    self.contents.font.color = actor.sp == 0 ?  knockout_color :
      actor.sp <= actor.maxsp / 4 ?  crisis_color : normal_color
    self.contents.draw_shadow_text(x, y, 48, 32, actor.sp.to_s , 2)
    # MaxSP 를 묘화
    self.contents.font.color = normal_color
    self.contents.draw_shadow_text(x + 48, y, 12, 32, "/", 1)
    self.contents.draw_shadow_text(x + 60, y, 48, 32, actor.maxsp.to_s)
  end
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

#==============================================================================
# ■ Window_BattleMember
#------------------------------------------------------------------------------
#  전투용 멤버를 표시하는 윈도우입니다.
#==============================================================================

class Window_BattleMember < Window_Selectable
  #--------------------------------------------------------------------------
  # ● 오브젝트 초기화
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, 640, 224)
    @column_max = 4
    @actors = $game_party.battle_actors
    @item_max = $max_member
    bw = 152 * @column_max
    bh = ( (@item_max - 1) / @column_max + 1) * 192
    self.contents = Bitmap.new(bw , bh)
    refresh
    self.active = true
    self.index = 0
  end
  #--------------------------------------------------------------------------
  # ● 리프레쉬
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    self.contents.font.size = 20
    for i in 0...@item_max
      x = i % @column_max * 152 + 8
      y = i / @column_max * 192 + 64
      # 엑터가 존재하는 경우
      if i < @actors.size
        actor = @actors[i]
        # draw_actor_graphic 를 조금 개조
        bitmap = RPG::Cache.battler(actor.battler_name , actor.battler_hue)
        cw = bitmap.width; ch = bitmap.height
        ch = 192 if ch > 192
        src_rect = Rect.new(0, 0, cw , ch)
        self.contents.blt(x, y - 64, bitmap , src_rect)
        # 그 외의 정보
        draw_actor_name(actor , x, y)
        draw_actor_class(actor , x, y + 20)
        draw_actor_level(actor , x, y + 44)
        draw_actor_state(actor , x + 64, y + 44)
        draw_actor_hp(actor , x, y + 68)
        draw_actor_sp(actor , x, y + 92)
      else
        self.contents.font.color = system_color
        self.contents.draw_frame_text(x, y, 144, 32, "-EMPTY-", 1)
      end
    end
  end
  #--------------------------------------------------------------------------
  # ● 커서 구형 갱신
  #--------------------------------------------------------------------------
  def update_cursor_rect
    # 커서 위치가 0 미만의 경우
    if @index < 0
      self.cursor_rect.empty
      return
    end
    # 커서의 폭을 계산
    cursor_width = 152
    # 커서의 좌표를 계산
    x = @index % @column_max * 152
    y = @index / @column_max * 192 - self.oy
    # 커서의 구형을 갱신
    self.cursor_rect.set(x, y, cursor_width , 192)
    self.oy = @index / @column_max * 192
  end
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

#==============================================================================
# ■ Window_PartyMember
#------------------------------------------------------------------------------
#  파티 멤버를 표시하는 윈도우입니다.
#==============================================================================

class Window_PartyMember < Window_Selectable
  #--------------------------------------------------------------------------
  # ● 오브젝트 초기화
  #--------------------------------------------------------------------------
  def initialize
    super(0, 224, 640, 256)
    @column_max = 4
    @actors = $game_party.party_actors
    bw = 152 * @column_max
    bh = ( (@actors.size - 1) / @column_max + 1) * 112
    self.contents = Bitmap.new(bw , bh)
    refresh
    self.active = false
    self.index = -1
  end
  #--------------------------------------------------------------------------
  # ● 아이템의 취득
  #--------------------------------------------------------------------------
  def item
    return @data[self.index]
  end
  #--------------------------------------------------------------------------
  # ● 리프레쉬
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    self.contents.font.size = 16
    @item_max = @actors.size
    @data = []
    for i in 0...@actors.size
      x = i % @column_max * 152 + 8
      y = i / @column_max * 112 + 16
      actor = @actors[i]
      @data.push(actor)
      # 전투용 멤버에게 포함되어 있는 경우
      if $game_party.battle_actors.include? (actor)
        self.contents.font.color = system_color
        self.contents.draw_shadow_text(x, y - 16, 148, 32, "Entered. ", 1)
      else
        # draw_actor_graphic 를 조금(? ) 개조
        bitmap = RPG::Cache.battler(actor.battler_name , actor.battler_hue)
        cw = bitmap.width; ch = bitmap.height
        src_rect = Rect.new(0, 0, cw , ch)
        dest_rect = Rect.new(x + 144 - cw / 2, y - 16, cw / 2, ch / 2)
        self.contents.stretch_blt(dest_rect , bitmap , src_rect)
      end
      draw_actor_name(actor , x, y)
      draw_actor_class(actor , x, y + 16)
      draw_actor_level(actor , x, y + 32)
      draw_actor_state(actor , x + 64, y + 32)
      draw_actor_hp(actor , x, y + 48)
      draw_actor_sp(actor , x, y + 64)
    end
  end
  #--------------------------------------------------------------------------
  # ● HP 의 묘화
  #--------------------------------------------------------------------------
  def draw_actor_hp(actor , x, y, width = 144)
    # 캐릭터 라인 "HP" 를 묘화
    self.contents.font.color = system_color
    self.contents.draw_shadow_text(x, y, 32, 32, $data_system.words.hp)
    hp_x = x + width - 108
    # HP 를 묘화
    self.contents.font.color = actor.hp == 0 ?  knockout_color :
      actor.hp <= actor.maxhp / 4 ?  crisis_color : normal_color
    self.contents.draw_shadow_text(hp_x , y, 48, 32, actor.hp.to_s , 2)
    # MaxHP 를 묘화
    self.contents.font.color = normal_color
    self.contents.draw_shadow_text(hp_x + 48, y, 12, 32, "/", 1)
    self.contents.draw_shadow_text(hp_x + 60, y, 48, 32, actor.maxhp.to_s)
  end
  #--------------------------------------------------------------------------
  # ● SP 의 묘화
  #--------------------------------------------------------------------------
  def draw_actor_sp(actor , x, y, width = 144)
    # 캐릭터 라인 "SP" 를 묘화
    self.contents.font.color = system_color
    self.contents.draw_shadow_text(x, y, 32, 32, $data_system.words.sp)
    sp_x = x + width - 108
    # SP 를 묘화
    self.contents.font.color = actor.sp == 0 ?  knockout_color :
      actor.sp <= actor.maxsp / 4 ?  crisis_color : normal_color
    self.contents.draw_shadow_text(sp_x , y, 48, 32, actor.sp.to_s , 2)
    # MaxSP 를 묘화
    self.contents.font.color = normal_color
    self.contents.draw_shadow_text(sp_x + 48, y, 12, 32, "/", 1)
    self.contents.draw_shadow_text(sp_x + 60, y, 48, 32, actor.maxsp.to_s)
  end
  #--------------------------------------------------------------------------
  # ● 커서 구형 갱신
  #--------------------------------------------------------------------------
  def update_cursor_rect
    # 커서 위치가 0 미만의 경우
    if @index < 0
      self.cursor_rect.empty
      return
    end
    # 커서의 폭을 계산
    cursor_width = 152
    # 커서의 좌표를 계산
    x = @index % @column_max * 152
    y = 0
    # 커서의 구형을 갱신
    self.cursor_rect.set(x, y, cursor_width , 112)
    self.oy = @index / @column_max * 112
  end
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

#==============================================================================
# ■ Window_Target
#------------------------------------------------------------------------------
#  아이템 화면과 스킬 화면에서 ,  사용 대상의 엑터를 선택하는 윈도우입니다.
#==============================================================================

class Window_Target < Window_Selectable
  #--------------------------------------------------------------------------
  # ● 오브젝트 초기화
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, 336, 480)
    self.contents = Bitmap.new(width - 32,
      $game_party.party_actors.size * 116 - 16)
    self.z += 10
    @item_max = $game_party.party_actors.size
    refresh
  end
  #--------------------------------------------------------------------------
  # ● 리프레쉬
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    for i in 0...$game_party.party_actors.size
      x = 4
      y = i * 116
      # 비전투 멤버는 배경을 어둡게 한다
      if i >= $game_party.battle_actors.size
        self.contents.fill_rect(0, y, width - 32, 116, Color.new(0, 0, 0, 96))
      end
      actor = $game_party.party_actors[i]
      draw_actor_name(actor , x, y)
      draw_actor_class(actor , x + 144, y)
      draw_actor_level(actor , x + 8, y + 32)
      draw_actor_state(actor , x + 8, y + 64)
      draw_actor_hp(actor , x + 152, y + 32)
      draw_actor_sp(actor , x + 152, y + 64)
    end
  end
  #--------------------------------------------------------------------------
  # ● 커서 구형 갱신
  #--------------------------------------------------------------------------
  def update_cursor_rect
    # 커서 위치 -1 는 전선택
    if @index < 0
      self.cursor_rect.set(0, 0, self.width - 32, @item_max * 116 - 20)
   return
    end
    # 현재의 행을 취득
    row = @index
    # 현재의 행이 ,  표시되고 있는 선두의 행보다 전의 경우
    if row < self.top_row
      # 현재의 행이 선두가 되도록(듯이) 스크롤
      self.top_row = row
    end
    # 현재의 행이 ,  표시되고 있는 최후미의 행부터 뒤의 경우
    if row > self.top_row + (self.page_row_max - 1)
      # 현재의 행이 최후미가 되도록(듯이) 스크롤
      self.top_row = row - (self.page_row_max - 1)
    end
    # 커서의 폭을 계산
    cursor_width = self.width - 32
    # 커서의 좌표를 계산
    x = @index % @column_max * (cursor_width + 32)
    y = @index / @column_max * 116 - self.oy
    # 커서의 구형을 갱신
    self.cursor_rect.set(x, y, self.width - 32, 96)
  end
  #--------------------------------------------------------------------------
  # ● 선두의 행의 취득
  #--------------------------------------------------------------------------
  def top_row
    # 윈도우 내용의 전송원 Y 좌표를 ,  1 행의 높이 116 으로 나눈다
    return self.oy / 116
  end
  #--------------------------------------------------------------------------
  # ● 선두의 행의 설정
  #     row : 선두에 표시하는 행
  #--------------------------------------------------------------------------
  def top_row=(row)
    # row 가 0 미만의 경우는 0 에 수정
    if row < 0
      row = 0
    end
    # row 가 row_max - 1 초과의 경우는 row_max - 1 에 수정
    if row > row_max - 1
      row = row_max - 1
    end
    # row 에 1 행의 높이 116 을 걸어 윈도우 내용의 전송원 Y 좌표로 한다
    self.oy = row * 116
  end
  #--------------------------------------------------------------------------
  # ● 1 페이지에 표시할 수 있는 행수의 취득
  #--------------------------------------------------------------------------
  def page_row_max
    return 4
  end
  #--------------------------------------------------------------------------
  # ● 행수의 취득
  #--------------------------------------------------------------------------
  def row_max
    return $game_party.party_actors.size
  end
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

#==============================================================================
# ■ Scene_PartyForm
#------------------------------------------------------------------------------
#  파티 편성을 실시하는 클래스입니다.
#==============================================================================

class Scene_PartyForm
  #--------------------------------------------------------------------------
  # ● 메인 처리
  #--------------------------------------------------------------------------
  def main
    # 스프라이트 세트를 작성
    @spriteset = Spriteset_Map.new
    # 편성용의 윈도우를 작성
    @battle_window = Window_BattleMember.new
    @battle_window.back_opacity = 160
    @party_window = Window_PartyMember.new
    @party_window.back_opacity = 160
    # 확인 윈도우를 작성
    commands = ["?? ??", "?? ??", "??"]
    @check_window = Window_Command.new( 160, commands)
    @check_window.back_opacity = 160
    @check_window.x = (640 - @check_window.width) / 2
    @check_window.y = (480 - @check_window.height) / 2
    @check_window.z = 2000
    @check_window.visible = false
    @check_window.active = false
    # 편성전의 파티를 보존
    @battle_actors = $game_party.battle_actors.dup
    @party_actors = $game_party.party_actors.dup
    # 트란지션 실행
    Graphics.transition
    # 메인 루프
    loop do
      # 게임 화면을 갱신
      Graphics.update
      # 입력 정보를 갱신
      Input.update
      # 프레임 갱신
      update
      # 화면이 바뀌면(자) 루프를 중단
      if $scene ! = self
        break
      end
    end
    # 트란지션 준비
    Graphics.freeze
    # 윈도우를 해방
    @battle_window.dispose
    @party_window.dispose
    @check_window.dispose
    @spriteset.dispose
  end
  #--------------------------------------------------------------------------
  # ● 프레임 갱신
  #--------------------------------------------------------------------------
  def update
    # 윈도우를 갱신
    @battle_window.update
    @party_window.update
    @check_window.update
    # 전투 멤버 윈도우가 액티브의 경우: update_battle 를 부른다
    if @battle_window.active
      update_battle
      return
    end
    # 파티 윈도우가 액티브의 경우: update_party 를 부른다
    if @party_window.active
      update_party
      return
    end
    #확인 윈도우가 액티브의 경우: update_check 를 부른다
    if @check_window.active
      update_check
      return
    end
  end
  #--------------------------------------------------------------------------
  # ● 프레임 갱신 (전투 멤버 윈도우가 액티브의 경우)
  #--------------------------------------------------------------------------
  def update_battle
    # A 버튼이 밀렸을 경우
    if Input.trigger? (Input::A)
      # 선택한 엑터가 존재하지 않는 경우
      if $game_party.battle_actors[@battle_window.index] == nil
        # 버저 SE 를 연주
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      # 결정 SE 를 연주
      $game_system.se_play($data_system.decision_se)
      # 선택한 엑터를 전투 멤버로부터 제외한다
      $game_party.battle_actors[@battle_window.index] = nil
      # nil 를 삭제
      $game_party.battle_actors.delete(nil)
      # 리프레쉬
      @battle_window.refresh
      @party_window.refresh
      return
    end
    # B 버튼이 밀렸을 경우
    if Input.trigger? (Input::B)
      # 캔슬 SE 를 연주
      $game_system.se_play($data_system.cancel_se)
      # 확인 윈도우를 리프레쉬
      @check_window.refresh
      # 전투 멤버가 없는 경우
      if $game_party.battle_actors.size == 0
        @check_window.disable_item(0)
      end
      # 확인 윈도우를 액티브화
      @battle_window.active = false
      @check_window.visible = true
      @check_window.active = true
      return
    end
    # C 버튼이 밀렸을 경우
    if Input.trigger? (Input::C)
      # 결정 SE 를 연주
      $game_system.se_play($data_system.decision_se)
      # 파티 윈도우를 액티브화
      @battle_window.active = false
      @party_window.active = true
      @party_window.index = 0 if @party_window.index == -1
      return
    end
  end
  #--------------------------------------------------------------------------
  # ● 프레임 갱신 (파티 윈도우가 액티브의 경우)
  #--------------------------------------------------------------------------
  def update_party
    # B 버튼이 밀렸을 경우
    if Input.trigger? (Input::B)
      # 캔슬 SE 를 연주
      $game_system.se_play($data_system.cancel_se)
      # 전투 멤버 윈도우를 액티브화
      @battle_window.active = true
      @party_window.active = false
      return
    end
    # C 버튼이 밀렸을 경우
    if Input.trigger? (Input::C)
      # 선택한 엑터를 취득
      actor = @party_window.item
      # 엑터가 전투 멤버에게 포함되는 경우
      if $game_party.battle_actors.include? (actor)
        # 버저 SE 를 연주
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      # 결정 SE 를 연주
      $game_system.se_play($data_system.decision_se)
      # 엑터를 교체
      $game_party.battle_actors[@battle_window.index] = actor
      # nil 를 삭제
      $game_party.battle_actors.delete(nil)
      # 파티의 줄 순서를 고친다
      party = $game_party.party_actors.dup
      $game_party.party_actors = []
      for actor in $game_party.battle_actors
        $game_party.party_actors.push(actor)
      end
      for actor in party
        unless $game_party.battle_actors.include? (actor)
          $game_party.party_actors.push(actor)
        end
      end
      # 리프레쉬
      @battle_window.refresh
      @party_window.refresh
      # 전투 멤버 윈도우를 액티브화
      @battle_window.active = true
      @party_window.active = false
      return
    end
  end
  #--------------------------------------------------------------------------
  # ● 프레임 갱신 (확인 윈도우가 액티브의 경우)
  #--------------------------------------------------------------------------
  def update_check
    # B 버튼이 밀렸을 경우
    if Input.trigger? (Input::B)
      # 캔슬 SE 를 연주
      $game_system.se_play($data_system.cancel_se)
      # 전투 멤버 윈도우를 액티브화
      @battle_window.active = true
      @check_window.visible = false
      @check_window.active = false
      return
    end
    # C 버튼이 밀렸을 경우
    if Input.trigger? (Input::C)
      # 커서 위치에서 분기
      case @check_window.index
      when 0  # 편성 완료
        # 전투 멤버가 없는 경우
        if $game_party.battle_actors.size == 0
          # 버저 SE 를 연주
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        # 결정 SE 를 연주
        $game_system.se_play($data_system.decision_se)
        # 파티의 줄 순서를 고친다
        party = $game_party.party_actors.dup
        $game_party.party_actors = []
        for actor in $game_party.battle_actors
          $game_party.party_actors.push(actor)
        end
        for actor in party
          unless $game_party.battle_actors.include? (actor)
            $game_party.party_actors.push(actor)
          end
        end
        # 리프레쉬
        $game_player.refresh
        # 메뉴 화면에 되돌린다
        $scene = Scene_Menu.new(6)
      when 1  # 편성 중단
        # 결정 SE 를 연주
        $game_system.se_play($data_system.decision_se)
        # 파티를 편성전 상태에 되돌린다
        $game_party.battle_actors = @battle_actors.dup
        $game_party.party_actors = @party_actors.dup
        # 메뉴 화면에 되돌린다
        $scene = Scene_Menu.new(6)
      when 2  # 캔슬
        # 결정 SE 를 연주
        $game_system.se_play($data_system.decision_se)
        # 전투 멤버 윈도우를 액티브화
        @battle_window.active = true
        @check_window.visible = false
        @check_window.active = false
      end
      return
    end
  end
end

 

 

 

 

 

일본어이지만 한글로 번역기로 돌렸습니다. <-두둥.

참고로 이거 하나 집어넣는다고 해서 파티편성 메뉴가 나오지 않는 것 같습니다.

KGC- menualter를 이용하거나 스크립트를 스스로 다룰 수 있다면 메뉴에서 파티편성을 스스로 만들도록 합시다.

 

p.s: 중복이면 나중에 확인 후 지우겠습니다. (검색 한번 해보고 올리는 겁니다.)

Comment '25'

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 습작 2012.12.24 6153
921 기타 Defining Encounter Areas by RPG Advocate (사용법 첨부) file 백호 2009.02.22 1201
920 전투 DerVVulfman's addons for Mr.Mo's ABS file Alkaid 2010.09.10 1645
919 기타 Difficulty Options by SephirothSpawn 백호 2009.02.22 869
918 기타 Drago - Custom Resolution by LiTTleDRAgo Alkaid 2014.02.13 1110
917 그래픽 Drago - Custom Resolution II 1 Alkaid 2014.09.10 1004
916 기타 Dynamic Stores by Astro_mech@rmxp.net 1 file 백호 2009.02.22 878
915 아이템 Easy Item & Gold Gain by SephirothSpawn (SDK호환) 백호 2009.02.22 880
914 기타 Economy System by Nick@Creation Asylum 1 file 백호 2009.02.22 934
913 맵/타일 Editor Tiles by PK8 (XP/VX/VXA) Alkaid 2012.09.11 1868
912 기타 Encounter Control by SephirothSpawn (SDK호환) 4 file 백호 2009.02.22 1157
911 기타 endroll 주석 번역 6 file insertend 2010.05.15 1638
910 스킬 Equipment Skills 2.0 by SephirothSpawn file 백호 2009.02.22 1007
909 장비 Equipment Upgrade System 1.1 by Charlie Fleed Alkaid 2010.11.18 1928
908 기타 Etude87_Bone_Animation_Character ver.1.2 4 습작 2012.07.06 1255
907 전투 Etude87_Custom_Slip_Damage_XP ver.1.0 5 습작 2012.08.26 1857
906 메뉴 Etude87_Horror_Menu_XP ver.1.1 15 file 습작 2012.08.04 2762
905 메시지 Etude87_Item_Choice_XP ver.1.10 13 file 습작 2013.05.19 2178
904 맵/타일 Etude87_Map_Remember_XP ver.1.2 2 습작 2012.07.17 1614
903 변수/스위치 Etude87_Variables_XP 2 습작 2011.12.26 2104
902 메뉴 Event Spawner 1 file 백호 2009.02.22 979
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ... 52 Next
/ 52