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
94 전투 Advanced Individual Battle Command v2.1 by Trickster@rmxp.org (SDK호환) 1 file 백호 2009.02.22 1189
» 전투 SG_Auto battle by sandgolem (SDK호환) 백호 2009.02.22 1031
92 전투 전투의 승리마다 행동에 따라서 능력치가 상승한다! 1 백호 2009.02.22 1238
91 전투 데미지 출력 스크립트 6 백호 2009.02.22 1810
90 전투 RPG Advocate의 데모에서 발췌한 사이드뷰용 전투상태창 4 file 백호 2009.02.22 3597
89 전투 보행그래픽으로 싸우는 턴알 17 백호 2009.02.22 3782
88 전투 ATB전투 5 백호 2009.02.22 3369
87 전투 전투의 커맨드에 따라 능력치를 상승 백호 2009.02.22 904
86 전투 SBABS v3 6 file 백호 2009.02.22 2046
85 전투 S ABS_NonSDK(구버전용) 5 file 백호 2009.02.22 1494
84 전투 S ABS_NonSDK ver 1 file 백호 2009.02.22 1458
83 전투 Steal Script 5.5 by trickster@rmxp.net (SDK호환) file 백호 2009.02.22 1206
82 전투 마법검 스크립트 1 백호 2009.02.22 1425
81 전투 배틀 포인트 1 백호 2009.02.22 918
80 전투 배틀샵 스크립트 1 백호 2009.02.22 1126
79 전투 Advanced Limit Breaks (KGC스크립트를 SDK호환용으로 손질한 것) 백호 2009.02.22 1214
78 전투 ATB시스템 입니다. [스샷 첨부] 17 백호 2009.02.22 4182
77 전투 자동전투 from RPG 쯔꾸르 XP RGSS Wiki 1 file 백호 2009.02.22 2621
76 전투 RTAB방식의 CBS 스크립트 Final-2 5 file 백호 2009.02.22 1943
75 전투 Custom Debugger, Battle Debugger by RPG Advocate file 백호 2009.02.22 1248
Board Pagination Prev 1 2 3 4 5 6 7 8 9 Next
/ 9