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 메뉴 SG_Artifact Colors by sandgolem (SDK 호환) 1 백호 2009.02.22 1003
920 그래픽 Drago - Custom Resolution II 1 Alkaid 2014.09.10 1004
919 기타 프레임 적용 스크립트 1 file 백호 2009.02.21 1007
918 스킬 Equipment Skills 2.0 by SephirothSpawn file 백호 2009.02.22 1007
917 전투 랜덤 전투음악 by Fomar0153@rmxp.org 1 백호 2009.02.22 1008
916 기타 분류 별로 윈도우 스킨 다르게 사용하기 file 백호 2009.02.21 1015
915 기타 강제 종료시키기 1 file 백호 2009.02.22 1015
914 전투 방어시에 속성 저항,스테이트무시 스크립트 1 백호 2009.02.22 1017
913 기타 제련시스템 수정본입니다. 3 file 백호 2009.02.21 1020
912 기타 능력치 무한대 스크립트 (따로 넣을필요없음) 2 백호 2009.02.21 1027
» 전투 SG_Auto battle by sandgolem (SDK호환) 백호 2009.02.22 1031
910 아이템 아이템을 사용하여 기술 습득하기 (기술문서 아이템) 2 file 백호 2009.02.21 1033
909 기타 Random Character Generator by SephirothSpawn (SDK호환) 1 백호 2009.02.22 1040
908 타이틀/게임오버 타이틀과 타이틀 BGM 랜덤으로 변경하는 스크립트 2 file 백호 2009.02.21 1045
907 파티 파티원 포션 나눠먹기 스크립트 1 file 백호 2009.02.22 1046
906 기타 기본설정 강화ㄴ 1 백호 2009.02.21 1047
905 이동 및 탈것 이동루트에 애니메이션커맨드 추가 1 file 백호 2009.02.21 1047
904 기타 [KGC] 개요 스크립트 2 백호 2009.02.21 1048
903 메뉴 링메뉴+음악도입스크립트 백호 2009.02.21 1051
902 저장 [KGC] 스크립트 저장된 리셋 불어오기 [스샷첨부] 1 file 백호 2009.02.22 1052
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