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 6159
801 전투 Star Ocean Battle System 3 file 백호 2009.02.22 1228
800 메뉴 L's Simple Custom Menu #1 R2 (SDK 2.x 필요) Alkaid 2013.01.18 1228
799 변수/스위치 The Self Data Suite by PK8 (XP/VX/VXA) Alkaid 2012.09.14 1232
798 기타 멋진...제작자 정보를 그림으로 1 백호 2009.02.22 1233
797 장비 전체키 이용을 위한 장비창 스크립트 백호 2009.02.21 1234
796 이동 및 탈것 방향키를 누름에따라 점프의 거리가 길어진다 - 출처:엑사포 의 비밀소년님과 연금술사님의 스크립트를 개량함 3 백호 2009.02.21 1234
795 전투 전투위치 보정 스크립트 1 file 백호 2009.02.21 1234
794 전투 전투의 승리마다 행동에 따라서 능력치가 상승한다! 1 백호 2009.02.22 1238
793 기타 제작한 게임의 파일을 모두 exe파일 하나에 쓸어담기 by sheefo@Creation Asylum 1 file 백호 2009.02.22 1239
792 아이템 아이템 단축키로 구입 스크립트 3 백호 2009.02.22 1243
791 이동 및 탈것 밑에 KIN 님의 MP 없어지는 대쉬, 제가 손좀 봤음 1 백호 2009.02.22 1244
790 기타 무기 회피율, 방어구 공격력 지정 스크립트 6 백호 2009.02.22 1244
789 장비 SIBruno's Advanced Equip Screen v2 file 백호 2009.02.22 1246
788 기타 무기 개조 스크립트 file 백호 2009.02.21 1248
787 전투 Custom Debugger, Battle Debugger by RPG Advocate file 백호 2009.02.22 1248
786 저장 StupidStormy36's Custom Save System 2010-10-06(05?) Edition 1 Alkaid 2010.10.07 1249
785 기타 Etude87_Bone_Animation_Character ver.1.2 4 습작 2012.07.06 1255
784 오디오 WhiteFlute - AudioEX (XP/VX/VXA) file Alkaid 2012.12.26 1255
783 HUD 맵명을 표시하는 스크립트 한글로 번역한것 백호 2009.02.21 1257
782 기타 복권 스크립트 6 백호 2009.02.21 1258
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 ... 52 Next
/ 52