XP 스크립트

이벤트 커멘드 「조건 분기」에서 4개째의 방어용 기구가 인식되지 않는XP자체의 버그를 수정.
이벤트 커멘드 「스크립트」로 , 1행째에 false 가 돌아가는 스크립트를 기술하면(자) 다운 당하는XP자체의 버그를 수정.
배틀 이벤트로 「문장 표시」 「애니메이션 표시」를 실시하면 이상하게 무거워지는XP자체의 버그를 수정.
전투중에 엑터를 제외해 , 재차 더하면(자) 버틀러 그래픽이 사라지는XP자체의 버그를 수정.
전투 개시 트란지션 변경 기능을 추가.
전투 배경 전체화 기능을 추가.
전투시의 스테이터스 윈도우 투과 기능을 추가.


※ Main 바로 위에 삽입해주세요.
=======================================================================



#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#_/    ◆기본 설정 강화 - KGC_Base Reinforce◆
#_/----------------------------------------------------------------------------
#_/  RPGXP의 기본 기능을 미묘하게 강화합니다. (버그 수정도 있어)
#_/  Reinforces some basic functions of "RPG Maker XP".
#_/  (There are some bag fixes.)
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

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

module KGC
  # ◆전투 배경 전체화
  BR_BATTLEBACK_FULL = true
  # ◆메인 국면시에 윈도우 투과
  #  BR_BATTLEBACK_FULL 가 true 때 에 유효.
  BR_WINDOW_CLEAR_MAIN_PHASE = true
  # ◆메인 국면시에 윈도우 배경만 반투과
  #  BR_WINDOW_CLEAR_MAIN_PHASE 가 false 때 에 유효.
  BR_WINDOW_BACK_CLEAR_MAIN_PHASE = true

  # ◆전투 개시 트란지션(nil 으로 해제)
  BR_BATTLE_START_TRANSITION = "016-Diamond02"
end

#### BR_BATTLEBACK_FULL
### Makes battleback full screen.

#### BR_WINDOW_CLEAR_MAIN_PHASE
### Makes windows transparency at the Main-Phase in battle.
# When BR_BATTLEBACK_FULL is true, this is effective.

#### BR_BATTLE_START_TRANSITION
### Transition of battle beginning. (nil : release)

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

$imported = {} if $imported == nil
$imported["Base Reinforce"] = true

#==============================================================================
# ■ RPG::Sprite
#==============================================================================

class RPG::Sprite
  def animation_set_sprites(sprites, cell_data, position)
    for i in 0..15
      sprite = sprites[i]
      pattern = cell_data[i, 0]
      if sprite == nil || pattern == nil || pattern == -1
        sprite.visible = false if sprite != nil
        next
      end
      sprite.visible = true
      sprite.src_rect.set(pattern % 5 * 192, pattern / 5 * 192, 192, 192)
      if position == 3
        if self.viewport != nil
          sprite.x = self.viewport.rect.width / 2
          sprite.y = self.viewport.rect.height / 2
        else
          sprite.x, sprite.y = 320, 240
        end
      else
        sprite.x = self.x - self.ox + self.src_rect.width / 2
        sprite.y = self.y - self.oy + self.src_rect.height / 2
        sprite.y -= self.src_rect.height / 4 if position == 0
        sprite.y += self.src_rect.height / 4 if position == 2
      end
      sprite.x += cell_data[i, 1]
      sprite.y += cell_data[i, 2]
      sprite.z = 2000
      sprite.ox = sprite.oy = 96
      sprite.zoom_x = cell_data[i, 3] / 100.0
      sprite.zoom_y = cell_data[i, 3] / 100.0
      sprite.angle = cell_data[i, 4]
      sprite.mirror = (cell_data[i, 5] == 1)
      sprite.opacity = cell_data[i, 6] * self.opacity / 255.0
      sprite.blend_type = cell_data[i, 7]
    end
  end
end

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

#==============================================================================
# ■ Sprite_Battler
#==============================================================================

class Sprite_Battler < RPG::Sprite
  #--------------------------------------------------------------------------
  # ● 프레임 갱신
  #--------------------------------------------------------------------------
  alias update_KGC_Base_Reinforce update
  def update
    # 버틀러가 nil 의 경우
    if @battler == nil
      @battler_name = nil
      @battler_hue = nil
    end

    update_KGC_Base_Reinforce
  end
end

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

#==============================================================================
# ■ Spriteset_Battle
#==============================================================================

if KGC::BR_BATTLEBACK_FULL
class Spriteset_Battle
  #--------------------------------------------------------------------------
  # ● 프레임 갱신
  #--------------------------------------------------------------------------
  alias update_KGC_Base_Reinforce update
  def update
    # 원의 처리를 실행
    update_KGC_Base_Reinforce

    @viewport1.rect.height = 480
    # 배틀 백이 변경되었을 경우
    if @battleback_name2 != $game_temp.battleback_name
      # 전체화
      @battleback_name2 = $game_temp.battleback_name
      mag_x = 640.0 / @battleback_sprite.bitmap.width
      mag_y = 480.0 / @battleback_sprite.bitmap.height
      @battleback_sprite.zoom_x = mag_x
      @battleback_sprite.zoom_y = mag_y
    end
  end
end
end

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

#==============================================================================
# ■ Window_BattleStatus
#==============================================================================

class Window_BattleStatus < Window_Base
  #--------------------------------------------------------------------------
  # ● 프레임 갱신
  #--------------------------------------------------------------------------
  def update
    super
    # 메인 국면 때는 불투명도를 약간 내리는(하는 김에 윈도우 소거)
    if $game_temp.battle_main_phase
      self.contents_opacity -= 2 if self.contents_opacity > 224
      if self.opacity > 0 && KGC::BR_BATTLEBACK_FULL && KGC::BR_WINDOW_CLEAR_MAIN_PHASE
        self.opacity -= 16
      end
      if self.back_opacity > 128 && KGC::BR_BATTLEBACK_FULL && KGC::BR_WINDOW_BACK_CLEAR_MAIN_PHASE
        self.back_opacity -= 8
      end
    else
      self.contents_opacity += 2 if self.contents_opacity < 255
      if self.opacity < 255 && KGC::BR_BATTLEBACK_FULL && KGC::BR_WINDOW_CLEAR_MAIN_PHASE
        self.opacity += 16
      end
      if self.back_opacity < 255 && KGC::BR_BATTLEBACK_FULL && KGC::BR_WINDOW_BACK_CLEAR_MAIN_PHASE
        self.back_opacity += 8
      end
    end
  end
  #--------------------------------------------------------------------------
  # ● 이름의 묘화
  #--------------------------------------------------------------------------
  def draw_actor_name(actor, x, y)
    self.contents.font.color = normal_color
    self.contents.draw_shadow_text(x, y, 120, 32, actor.name)
  end
  #--------------------------------------------------------------------------
  # ● 스테이트의 묘화
  #--------------------------------------------------------------------------
  def draw_actor_state(actor, x, y, width = 120)
    text = make_battler_state_text(actor, width, true)
    self.contents.font.color = actor.dead? ? knockout_color : normal_color
    self.contents.draw_shadow_text(x, y, width, 32, text)
  end
end

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

class Interpreter
#==============================================================================
# ■□■□■ Interpreter 3 ■□■□■
#==============================================================================
  #--------------------------------------------------------------------------
  # ● 조건 분기
  #--------------------------------------------------------------------------
  def command_111
    # 로컬 변수 result 를 초기화
    result = false
    # 조건 판정
    case @parameters[0]
    when 0  # 스윗치
      result = ($game_switches[@parameters[1]] == (@parameters[2] == 0))
    when 1  # 변수
      value1 = $game_variables[@parameters[1]]
      if @parameters[2] == 0
        value2 = @parameters[3]
      else
        value2 = $game_variables[@parameters[3]]
      end
      case @parameters[4]
      when 0  # 와 동치
        result = (value1 == value2)
      when 1  # 이상
        result = (value1 >= value2)
      when 2  # 이하
        result = (value1 <= value2)
      when 3  # 초
        result = (value1 > value2)
      when 4  # 미만
        result = (value1 < value2)
      when 5  # 이외
        result = (value1 != value2)
      end
    when 2  # 셀프 스윗치
      if @event_id > 0
        key = [$game_map.map_id, @event_id, @parameters[1]]
        if @parameters[2] == 0
          result = ($game_self_switches[key] == true)
        else
          result = ($game_self_switches[key] != true)
        end
      end
    when 3  # 타이머
      if $game_system.timer_working
        sec = $game_system.timer / Graphics.frame_rate
        if @parameters[2] == 0
          result = (sec >= @parameters[1])
        else
          result = (sec <= @parameters[1])
        end
      end
    when 4  # 엑터
      actor = $game_actors[@parameters[1]]
      if actor != nil
        case @parameters[2]
        when 0  # 파티에 있는
          result = ($game_party.actors.include?(actor))
        when 1  # 이름
          result = (actor.name == @parameters[3])
        when 2  # 스킬
          result = (actor.skill_learn?(@parameters[3]))
        when 3  # 무기
          result = (actor.weapon_id == @parameters[3])
        when 4  # 방어용 기구
          result = (actor.armor1_id == @parameters[3] or
                    actor.armor2_id == @parameters[3] or
                    actor.armor3_id == @parameters[3] or
                    actor.armor4_id == @parameters[3])
        when 5  # 스테이트
          result = (actor.state?(@parameters[3]))
        end
      end
    when 5  # 에너미
      enemy = $game_troop.enemies[@parameters[1]]
      if enemy != nil
        case @parameters[2]
        when 0  # 출현하고 있는
          result = (enemy.exist?)
        when 1  # 스테이트
          result = (enemy.state?(@parameters[3]))
        end
      end
    when 6  # 캐릭터
      character = get_character(@parameters[1])
      if character != nil
        result = (character.direction == @parameters[2])
      end
    when 7  # 골드
      if @parameters[2] == 0
        result = ($game_party.gold >= @parameters[1])
      else
        result = ($game_party.gold <= @parameters[1])
      end
    when 8  # 아이템
      result = ($game_party.item_number(@parameters[1]) > 0)
    when 9  # 무기
      result = ($game_party.weapon_number(@parameters[1]) > 0)
    when 10  # 방어용 기구
      result = ($game_party.armor_number(@parameters[1]) > 0)
    when 11  # 버튼
      result = (Input.press?(@parameters[1]))
    when 12  # 스크립트
      result = eval(@parameters[1])
    end
    # 판정 결과를 해시에 격납
    @branch[@list[@index].indent] = result
    # 판정 결과가 진이었던 경우
    if @branch[@list[@index].indent] == true
      # 분기 데이터를 삭제
      @branch.delete(@list[@index].indent)
      # 계속
      return true
    end
    # 조건에 해당하지 않는 경우 : 커멘드 스킵
    return command_skip
  end
#==============================================================================
# ■□■□■ Interpreter 7 ■□■□■
#==============================================================================
  #--------------------------------------------------------------------------
  # ● 스크립트
  #--------------------------------------------------------------------------
  def command_355
    # script 에 1 행목을 설정
    script = @list[@index].parameters[0] + "n"
    # 루프
    loop {
      # 다음의 이벤트 커멘드가 스크립트 2 행 눈 이후의 경우
      if @list[@index+1].code == 655
        # script 에 2 행목 이후를 추가
        script += @list[@index+1].parameters[0] + "n"
      # 이벤트 커멘드가 스크립트 2 행 눈 이후가 아닌 경우
      else
        # 루프 중단
        break
      end
      # 인덱스를 진행시키는
      @index += 1
    }
    # 평가
    result = eval(script)
    # 계속
    return true
  end
end

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

class Scene_Battle
#==============================================================================
# ■□■□■ Scene_Battle 1 ■□■□■
#==============================================================================
  #--------------------------------------------------------------------------
  # ● 메인 처리
  #--------------------------------------------------------------------------
  def main
    # 트란지션 실행
    if KGC::BR_BATTLE_START_TRANSITION != nil
      Graphics.transition(40, "Graphics/Transitions/" + KGC::BR_BATTLE_START_TRANSITION)
    end
    # 트란지션 준비
    Graphics.freeze
    # 전투용의 각종 일시 데이터를 초기화
    $game_temp.in_battle = true
    $game_temp.battle_turn = 0
    $game_temp.battle_event_flags.clear
    $game_temp.battle_abort = false
    $game_temp.battle_main_phase = false
    $game_temp.battleback_name = $game_map.battleback_name
    $game_temp.forcing_battler = nil
    # 배틀 이벤트용 interpreter를 초기화
    $game_system.battle_interpreter.setup(nil, 0)
    # 무리를 준비
    @troop_id = $game_temp.battle_troop_id
    $game_troop.setup(@troop_id)
    # 엑터 커멘드 윈도우를 작성
    s1 = $data_system.words.attack
    s2 = $data_system.words.skill
    s3 = $data_system.words.guard
    s4 = $data_system.words.item
    @actor_command_window = Window_Command.new(160, [s1, s2, s3, s4])
    @actor_command_window.y = 160
    @actor_command_window.back_opacity = 160
    @actor_command_window.active = false
    @actor_command_window.visible = false
    # 그 외의 윈도우를 작성
    @party_command_window = Window_PartyCommand.new
    @help_window = Window_Help.new
    @help_window.back_opacity = 160
    @help_window.visible = false
    @status_window = Window_BattleStatus.new
    @message_window = Window_Message.new
    # 스프라이트 세트를 작성
    @spriteset = Spriteset_Battle.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
    # 맵을 리프레쉬
    $game_map.refresh
    # 트란지션 준비
    Graphics.freeze
    # 윈도우를 해방
    @actor_command_window.dispose if @actor_command_window != nil
    @party_command_window.dispose
    @help_window.dispose
    @status_window.dispose
    @message_window.dispose
    @skill_window.dispose if @skill_window != nil
    @item_window.dispose if @item_window != nil
    @result_window.dispose if @result_window != nil
    # 스프라이트 세트를 해방
    @spriteset.dispose
    # 타이틀 화면으로 전환하고 안의 경우
    if $scene.is_a?(Scene_Title)
      # 화면을 페이드아웃
      Graphics.transition
      Graphics.freeze
    end
    # 전투 테스트로부터 게임 오버 화면 이외에 바꾸고 안의 경우
    if $BTEST && !$scene.is_a?(Scene_Gameover)
      $scene = nil
    end
  end
  #--------------------------------------------------------------------------
  # ● 프레임 갱신
  #--------------------------------------------------------------------------
  def update
    # 배틀 이벤트 실행중의 경우
    if $game_system.battle_interpreter.running?
      @running = true
      # interpreter를 갱신
      $game_system.battle_interpreter.update
      # 액션을 강제당하고 있는 버틀러가 존재하지 않는 경우
      if $game_temp.forcing_battler == nil
        # 배틀 이벤트의 실행이 끝났을 경우
        unless $game_system.battle_interpreter.running?
          # 전투 계속의 경우 , 배틀 이벤트의 셋업을 재실행
          unless judge
            setup_battle_event
          end
        end
        # 애프터 배틀 국면이 아니고 , 메세지가 표시되어 있지 않은
        # 한편 애니메이션 표시중이 아닌 경우
        if @phase != 5 && !@message_window.visible && !@spriteset.effect?
          # 스테이터스 윈도우를 리프레쉬
          @status_window.refresh
        end
      end
    elsif @running
      # 스테이터스 윈도우를 리프레쉬
      @status_window.refresh
      @running = false
    end
    # 시스템 (타이머), 화면을 갱신
    $game_system.update
    $game_screen.update
    # 타이머가 0 가 되었을 경우
    if $game_system.timer_working and $game_system.timer == 0
      # 배틀 중단
      $game_temp.battle_abort = true
    end
    # 윈도우를 갱신
    @help_window.update
    @party_command_window.update
    @actor_command_window.update if @actor_command_window != nil
    @status_window.update
    @message_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 $game_temp.message_window_showing
      return
    end
    # 효과 표시중의 경우
    if @spriteset.effect?
      return
    end
    # 게임 오버의 경우
    if $game_temp.gameover
      # 게임 오버 화면으로 전환하고
      $scene = Scene_Gameover.new
      return
    end
    # 타이틀 화면에 되돌리는 경우
    if $game_temp.to_title
      # 타이틀 화면으로 전환하고
      $scene = Scene_Title.new
      return
    end
    # 배틀 중단의 경우
    if $game_temp.battle_abort
      # 배틀 개시전의 것 BGM 에 되돌리는
      $game_system.bgm_play($game_temp.map_bgm)
      # 배틀 종료
      battle_end(1)
      return
    end
    # 웨이트중의 경우
    if @wait_count > 0
      # 웨이트 카운트를 줄이는
      @wait_count -= 1
      return
    end
    # 액션을 강제당하고 있는 버틀러가 존재하지 않고 ,
    # 한편 배틀 이벤트가 실행중의 경우
    if $game_temp.forcing_battler == nil and
      $game_system.battle_interpreter.running?
      return
    end
    # 국면에 의해 분기
    case @phase
    when 1  # 프레바트르페즈
      update_phase1
    when 2  # 파티 커멘드 국면
      update_phase2
    when 3  # 엑터 커멘드 국면
      update_phase3
    when 4  # 메인 국면
      update_phase4
    when 5  # 애프터 배틀 국면
      update_phase5
    end
  end
  #--------------------------------------------------------------------------
  # ● 배틀 종료
  #    result : 결과 (0:승리 1:도주 2:패배)
  #--------------------------------------------------------------------------
  alias battle_end_KGC_Base battle_end
  def battle_end(result)
    # 오토 스테이트를 갱신
    for actor in $game_party.actors
      for i in 1...($imported["EquipExtension"] ? actor.equip_type.size : 5)
        actor.update_auto_state(nil, $data_armors[
          $imported["EquipExtension"] ? actor.armor_id[i] :
          eval("actor.armor#{i}_id")])
      end
    end

    # 원의 처리를 실행
    battle_end_KGC_Base(result)
  end
end

Who's 백호

?

이상혁입니다.

http://elab.kr


List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 습작 2012.12.24 6153
321 전투 SG_Batte Retry ver.4 by sandgolem 2 백호 2009.02.22 1457
320 저장 SG_Automatic Save 백호 2009.02.22 970
319 전투 SG_Auto battle by sandgolem (SDK호환) 백호 2009.02.22 1031
318 전투 SG_Attack Break by sandgolem (SDK호환) 백호 2009.02.22 813
317 메뉴 SG_Artifact Colors by sandgolem (SDK 호환) 1 백호 2009.02.22 1003
316 기타 SFont 사용 스크립트 by Trickster Alkaid 2010.10.05 1512
315 기타 Seph's Test Bed v.4 (파일첨부) (SDK2.x용) Alkaid 2010.10.08 1533
314 Seph's Test Bed 0.4 (SDK2 호환, Method & Class Library 2 WMN 2008.04.06 1330
313 기타 Selected phyolomortis.com scripts 1 file 백호 2009.02.22 789
312 전투 SBABS게이지바 file 백호 2009.02.21 2285
311 전투 SBABS 버전3.2 - 액알 스크립트 시스템 설명 13 아방스 2007.11.09 5685
310 SBABS 버전3.2 - 액알 스크립트 사용법 34 아방스 2007.11.09 5631
309 전투 SBABS v4 (A-RPG) 5 file 백호 2009.02.22 2055
308 전투 SBABS v3 6 file 백호 2009.02.22 2046
307 sbabs - 몬스터 게이지 표시 스크립트 13 file 아방스 2007.11.09 3668
306 기타 sandgolem Script Archive (RMXP SDK 1.5 이상 필요) file Alkaid 2011.02.17 1453
305 전투 S.G DamageShield Script 백호 2009.02.22 935
304 전투 S ABS_NonSDK(구버전용) 5 file 백호 2009.02.22 1494
303 전투 S ABS_NonSDK ver 1 file 백호 2009.02.22 1458
302 메뉴 Ryex's Collapsing CMS 2.51 3 Alkaid 2010.09.05 1667
Board Pagination Prev 1 ... 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 ... 52 Next
/ 52