XP 스크립트

http://www.gamebaker.com/rmxp/scripts/auto-battle.htm
  또다른 자동전투 스크립트입니다.  턴 시작시 나오는 커맨드에서 자동전투를 선택시 하위 메뉴에서 '전원 공격' '전원 방어' '이전 커맨드 반복'을 선택할 수 있습니다.(참고로 턴 시작 커맨드창에서 Esc를 누르면 '도주'를, Q를 누르면 '이전 커맨드 반복'을 선택할 수 있음.  그 외 단축키가 더 있는지는 알아서....)


#=============================================================================
# ** SG Auto Battle
#=============================================================================
# sandgolem
# Version 1
# 6.06.06
#=============================================================================
#
# To check for updates or find more scripts, visit:
# http://www.gamebaker.com/rmxp/scripts/
#
# To use this script, copy it and insert it in a new section above "Main",
# but under the default scripts and the SDK if you're using it.
#
# Have problems? You can leave me a message at:
# http://www.gamebaker.com/users/sandgolem
#
#=============================================================================

#--------------------------------------------------------------------------
# * SDK Log Script
#--------------------------------------------------------------------------
begin
  SDK.log("SG Auto Battle", "sandgolem", 1, "6.06.06")
  if SDK.state("SG Auto Battle") != true
    @sg_autobattle_disabled = true
  end
  rescue
end

#--------------------------------------------------------------------------
# * Begin SDK Enable Test
#--------------------------------------------------------------------------
if !@sg_autobattle_disabled

class Window_PartyCommand < Window_Selectable

  def initialize
    super(0, 0, 640, 64)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.back_opacity = 160
    @commands = ["Automatic", "Command", "Run Away"]
    @item_max = 3
    @column_max = 3
    draw_item(0, normal_color)
    draw_item(1, normal_color)
    draw_item(2, $game_temp.battle_can_escape ? normal_color : disabled_color)
    self.index = 1
    self.visible = false
    self.active = false
  end

  def draw_item(index, color)
    self.contents.font.color = color
    rect = Rect.new(65 + index * 170, 0, 150, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    self.contents.draw_text(rect, @commands[index], 1)
  end

  def update_cursor_rect
    self.cursor_rect.set(65 + index * 170, 0, 150, 32)
  end
end

class Game_Actor < Game_Battler
  attr_accessor :sg_previous_action
  attr_accessor :sg_previous_secondary
  attr_accessor :sg_previous_targets
end

class Window_SG_Autobattle < Window_Selectable
 
  def initialize
    super(64,59,182,128)
    @item_max = 3
    @commands = ['Attack','Repeat','Wait']
    self.contents = Bitmap.new(150,96)
    self.visible = false
    self.back_opacity = 160
    redraw
    self.index = 0
  end

  def redraw
    self.contents.clear
    for i in 0...@item_max
      draw_item(i, normal_color)
    end
  end
 
  def draw_item(index, color)
    self.contents.font.color = color
    rect = Rect.new(4,32*index,self.contents.width-8,32)
    self.contents.fill_rect(rect,Color.new(0, 0, 0, 0))
    self.contents.draw_text(rect,@commands[index],1)
  end

  def disable_item(index)
    draw_item(index, disabled_color)
  end
end

class Scene_Battle
  alias sandgolem_autobattle_battle_main main
  def main
    @sg_autowindow = Window_SG_Autobattle.new
    @sg_autowindow.active = false
    @sg_autowindow.visible = false
    sandgolem_autobattle_battle_main
    @sg_autowindow.dispose
  end
 
  alias sandgolem_autobattle_battle_update update
  def update
    sandgolem_autobattle_battle_update
    if @sg_autowindow.active
      if @sg_autowindow.visible
        sg_update_autowindow
        @sg_autowindow.update
      else
        @sg_autowindow.visible = true
      end
    end
  end
 
  def sg_update_autowindow
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.buzzer_se)
      @sg_autowindow.active = false
      @sg_autowindow.visible = false
      @party_command_window.active = true
      @party_command_window.index = 1
      @phase = 2
    end
    if Input.trigger?(Input::C)
      case @sg_autowindow.index
      when 0
        sg_phase2_allbasic(0)
      when 1
        if $game_temp.battle_turn != 0
          sg_phase2_lastaction
        else
          $game_system.se_play($data_system.buzzer_se)
        end
      when 2
        sg_phase2_allbasic(1)
      end
    end
  end

  def sg_autowindow_setup
    $game_system.se_play($data_system.decision_se)
    @party_command_window.active = false
    @sg_autowindow.active = true
    @phase = 1337
    if $game_temp.battle_turn != 0
      @sg_autowindow.redraw
      @sg_autowindow.index = 1
    else
      @sg_autowindow.disable_item(1)
    end
  end

  def update_phase2
    if Input.trigger?(Input::L)
      @party_command_window.index = 0
      sg_autowindow_setup
    end
    if Input.trigger?(Input::B)
      @party_command_window.index = 2
    end
    if Input.trigger?(Input::C)
      case @party_command_window.index
      when 0
        sg_autowindow_setup
      when 1
        $game_system.se_play($data_system.decision_se)
        start_phase3
      when 2
        sg_update2_escape_check
      end
      return
    end
  end
 
  def sg_update2_escape_check
    if $game_temp.battle_can_escape == false
      $game_system.se_play($data_system.buzzer_se)
      return
    end
    $game_system.se_play($data_system.decision_se)
    update_phase2_escape
  end
 
  alias sandgolem_autobattle_battle_sp4 start_phase4
  def start_phase4
    @sg_autowindow.active = false
    @sg_autowindow.visible = false
    for i in $game_party.actors
      i.sg_previous_action = i.current_action.kind
      case i.current_action.kind
      when 0
        i.sg_previous_secondary = i.current_action.basic
      when 1
        i.sg_previous_secondary = i.current_action.skill_id
      when 2
        i.sg_previous_secondary = i.current_action.item_id
      end
      i.sg_previous_targets = i.current_action.target_index
    end
    sandgolem_autobattle_battle_sp4
  end
 
  def sg_phase2_allbasic(sg_temp)
    $game_system.se_play($data_system.decision_se)
    for i in $game_party.actors
      i.current_action.kind = 0
      i.current_action.basic = sg_temp
    end
    start_phase4
  end
 
  def sg_phase2_lastaction
    $game_system.se_play($data_system.decision_se)
    for i in $game_party.actors
      if i.sg_previous_action != nil
        i.current_action.kind = i.sg_previous_action
        case i.current_action.kind
        when 0
          i.current_action.basic = i.sg_previous_secondary
        when 1
          i.current_action.skill_id = i.sg_previous_secondary
        when 2
          i.current_action.item_id = i.sg_previous_secondary
        end
        i.current_action.target_index = i.sg_previous_targets
      else
        i.current_action.kind = 0
        i.current_action.basic = 0
      end
    end
    start_phase4
  end
end

#--------------------------------------------------------------------------
# * End SDK Enable Test
#--------------------------------------------------------------------------
end

Who's 백호

?

이상혁입니다.

http://elab.kr


List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 습작 2012.12.24 6153
921 전체화면 스크립트[해상도 스크립트랑 중복사용 불가] 24 file - 하늘 - 2009.08.06 3975
920 전투 RTAB 1.16ver 12 file 백호 2009.02.22 3960
919 장비 CSSR8-장비품 생산&강화 시스템 18 file 백호 2009.02.22 3959
918 영상 플래시 동영상 재생 스크립트 사용법 및 다운로드 8 아방스 2010.11.02 3919
917 아이템 심플 액알 [리젠, 아이템 드롭] 18 file 백호 2009.02.21 3917
916 HUD [VX 가능] 이벤트 이름 띄우기 41 file 독도2005 2009.08.22 3902
915 전투 XAS Hero Edition Ver. 3.91 3 프리즌커피 2011.12.23 3894
914 기타 [자작]데미지표시 19 file JACKY 2012.02.15 3842
913 스킬 약간 수정한 심플액알(크리티컬,스킬) 10 백호 2009.02.22 3836
912 이동 및 탈것 아하! 그렇구나의 3D 신기술 체험 2 23 아하!잘봤어요. 2010.02.28 3815
911 기타 3D스크립트 48 file ok하승헌 2010.02.18 3808
910 기타 [게이지바]HelloCoaVer4.0 업데이트 속도 변경 [오랜만의 업데이트] 30 file 코아 코스튬 2011.04.02 3790
909 전투 보행그래픽으로 싸우는 턴알 17 백호 2009.02.22 3782
908 파티 KGC-대규모파티 25 rgnrk001 2010.03.01 3771
907 이동 및 탈것 동료들끼리 따라오는 스크립트 41 file ◐아이흥행 2010.01.23 3714
906 기타 만화형태 말칸 스크립트 28 file 백호 2009.02.22 3705
905 [스마슈님 제공] 부활스크립트 19 file 아방스 2007.11.09 3705
904 저장 [ AutoSave ]오토세이브, 뜻 그대로 자동저장스크립트 17 file 제로스S2 2009.08.06 3694
903 sbabs - 몬스터 게이지 표시 스크립트 13 file 아방스 2007.11.09 3668
902 기타 [신기술 체험] RPGXP 3D 9 file 백호 2009.02.22 3635
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