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
174 전투 [액알]neo_a-rpg_module_1[1][1].2 스크립트 83 file 은빛바람 2009.10.03 8298
173 전투 [신기술 체험] 강회된 횡스크롤 액알 13 file 백호 2009.02.22 6841
172 전투 액알 스크립트 24 백호 2009.02.22 6013
171 전투 ABS_v3액션 알피지 46 file 알피지GM 2010.03.07 5806
170 전투 SBABS 버전3.2 - 액알 스크립트 시스템 설명 13 아방스 2007.11.09 5685
169 전투 [RTAB]HP/SH/EXP 게이지바 ver 1.00 44 file 환상 러브텔 2010.05.22 5338
168 전투 사이드뷰 배틀 (2003 형식으 전투)| 12 file 아방스 2007.11.09 4744
167 전투 사이드뷰 방식 스크립트. 8 file 백호 2009.02.21 4637
166 전투 ABP 액알 (Action Battle Player) 14 file 백호 2009.02.22 4556
165 전투 XAS 여러가지버전. 9 §포뇨§ 2010.02.23 4395
164 전투 XAS Hero Edition v3.82 19 아방스 2010.12.27 4346
163 전투 사이드뷰 전투(보행그래픽) 15 file 백호 2009.02.21 4244
162 전투 ATB시스템 입니다. [스샷 첨부] 17 백호 2009.02.22 4182
161 전투 깔끔한형식의 Asan'Tear배틀시스탬 4 file 콩밥 2010.09.29 4124
160 전투 에너미들도 게이지바 달고싶다~!! 14 file 백호 2009.02.21 4100
159 전투 중복일지도 모르는 ATB 전투 11 file 백호 2009.02.22 4057
158 전투 xas히어로에디션 3.4 14 ps인간 2009.01.04 4044
157 전투 Blizz-ABS 1.95 27 아방스 2008.03.05 4028
156 전투 일본사이트에서 찾은 턴제 스크립트 23 file 백호 2009.02.21 3997
155 전투 RTAB 1.16ver 12 file 백호 2009.02.22 3960
Board Pagination Prev 1 2 3 4 5 6 7 8 9 Next
/ 9