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 전투 흠.. 아직도 이 스크립트가 없군요 ㅋㅋ(제가올림..) 1 file 백호 2009.02.21 3335
173 전투 횡스크롤형식의 스크립트 7 백호 2009.02.21 2972
172 전투 펫 시스템(ABS 3.4v포함) 23 file 백호 2009.02.22 3458
171 전투 턴제 전투메시지 스크립트 10 file 백호 2009.02.21 2199
170 전투 쿼터뷰 전투 스크립트 3 file 백호 2009.02.21 2870
169 전투 캐릭터고르기스크립트? ps인간 2009.01.23 3263
168 전투 캐릭터가 착용한 무기에 따라 배틀러 무기도 바꿔주는 스크립트 6 file 백호 2009.02.21 2518
167 전투 추적 공격 스크립트 백호 2009.02.21 1459
166 전투 중복일지도 모르는 ATB 전투 11 file 백호 2009.02.22 4057
165 전투 전투후 경험치 분배와 레벨업시 HP/SP 전회복 15 백호 2009.02.21 2377
164 전투 전투중의 윈도우 전부 투명화 3 file 백호 2009.02.21 1879
163 전투 전투중에 장비들 교체하기 file 레이스89 2017.08.19 593
162 전투 전투의 커맨드에 따라 능력치를 상승 백호 2009.02.22 904
161 전투 전투의 승리마다 행동에 따라서 능력치가 상승한다! 1 백호 2009.02.22 1238
160 전투 전투위치 보정 스크립트 1 file 백호 2009.02.21 1234
159 전투 전투에서도 맵 BGM 연결하는 스크립트 2 file 백호 2009.02.21 1129
158 전투 전투시 아이콘 윈도우 2 file 백호 2009.02.21 1650
157 전투 전투시 미묘한 효과 스크립트 file 백호 2009.02.21 1468
156 전투 전투불능 케릭터 강제삭제 7 독도2005 2008.10.05 1918
155 전투 전투배경확장 한글 3 백호 2009.02.22 1472
Board Pagination Prev 1 2 3 4 5 6 7 8 9 Next
/ 9