XP 스크립트

class Window_Base < Window
  SYSTEM_WORD_EVA = "Evade" #
  #--------------------------------------------------------------------------
  # * Draw Parameter
  #     actor : actor
  #     x     : draw spot x-coordinate
  #     y     : draw spot y-coordinate
  #     type  : parameter type (0-6)
  #--------------------------------------------------------------------------
  def draw_actor_parameter(actor, x, y, type)
    case type
    when 0
      parameter_name = $data_system.words.atk
      parameter_value = actor.atk
    when 1
      parameter_name = $data_system.words.pdef
      parameter_value = actor.pdef
    when 2
      parameter_name = $data_system.words.mdef
      parameter_value = actor.mdef
    when 3
      parameter_name = $data_system.words.str
      parameter_value = actor.str
    when 4
      parameter_name = $data_system.words.dex
      parameter_value = actor.dex
    when 5
      parameter_name = $data_system.words.agi
      parameter_value = actor.agi
    when 6
      parameter_name = $data_system.words.int
      parameter_value = actor.int
    when 7 #
      parameter_name = SYSTEM_WORD_EVA #
      parameter_value = actor.eva #
    end
    self.contents.font.color = system_color
    self.contents.draw_text(x, y, 120, 32, parameter_name)
    self.contents.font.color = normal_color
    self.contents.draw_text(x + 120, y, 36, 32, parameter_value.to_s, 2)
  end
end

 

#==============================================================================
# InfoWindow
#==============================================================================
class Window_Info < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(0, 384, 640, 96)
    #Create Bitmap
    self.contents = Bitmap.new(width - 32, height - 32)
    #Z-Pos
    self.z = 100
    self.back_opacity = 160
    #Refresh and add the contents to window
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    #Clear Bitmap
    self.contents.clear
    #Add Contents
    self.contents.font.color = system_color
    self.contents.draw_text(4,0,120,32,'Location')
    self.contents.font.color = normal_color
    self.contents.draw_text(96,0,360,32,'Put your Location')
   
    #Draw Steps
    self.contents.font.color = system_color
    self.contents.draw_text(4,32,120,32,'Steps')
    self.contents.font.color = normal_color
    self.contents.draw_text(48,32, 120, 32, $game_party.steps.to_s, 2)
   
    #Draw Play Time
    self.contents.font.color = system_color
    self.contents.draw_text(200,32,120,32,'Play Time')
    @total_sec = Graphics.frame_count / Graphics.frame_rate
    hour = @total_sec / 60 / 60
    min = @total_sec / 60 % 60
    sec = @total_sec % 60
    text = sprintf("%02d:%02d:%02d", hour, min, sec)
    self.contents.font.color = normal_color
    self.contents.draw_text(310, 32, 120, 32, text)
   
    #Draw Gold
    #Advanced Gold Display mini-script by Dubealex.
    case $game_party.gold
    when 0..9999
      gold = $game_party.gold
    when 10000..99999
      gold = $game_party.gold.to_s
      array = gold.split(//)
      gold = array[0].to_s+array[1].to_s+","+array[2].to_s+array[3].to_s+array[4].to_s
    when 100000..999999
      gold = $game_party.gold.to_s
      array = gold.split(//)
      gold = array[0].to_s+array[1].to_s+array[2].to_s+","+array[3].to_s+array[4].to_s+array[5].to_s
    when 1000000..9999999
      gold = $game_party.gold.to_s
      array = gold.split(//)
      gold = array[0].to_s+","+array[1].to_s+array[2].to_s+array[3].to_s+","+array[4].to_s+array[5].to_s+array[6].to_s
    end   
    self.contents.font.color = system_color
    gold_word = $data_system.words.gold.to_s + " :"
    cx = contents.text_size(gold_word).width
    cx2=contents.text_size(gold.to_s).width
    self.contents.draw_text(412,32,120-cx-2,32,gold_word)
    self.contents.font.color = normal_color
    self.contents.draw_text(600-cx2+2, 32, cx2, 32, gold.to_s, 2)
   
    #Draw Variable
    self.contents.font.color = system_color
    self.contents.draw_text(412,0,120,32,'Variable Name')
    self.contents.font.color = normal_color
    self.contents.draw_text(540,0,120,32,'Variable')
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    super
    if Graphics.frame_count / Graphics.frame_rate != @total_sec
      refresh
    end
  end
end

 

#==============================================================================
# MenuStatus
#==============================================================================
class Window_NewMenuStatus < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(160, 0, 480, 320)
    #Create Bitmap
    self.contents = Bitmap.new(width - 32, height - 32)
    #Z-Pos
    self.z = 100
    self.back_opacity = 160
    #Refresh and add the contents to window
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    #Clear Bitmap
    self.contents.clear
    actor = $game_party.actors[0]
    draw_actor_graphic(actor, 32, 64)
    draw_actor_name(actor, 75, 0)
    draw_actor_class(actor, 240, 0)
    draw_actor_level(actor, 75, 32)
    draw_actor_state(actor, 240, 32)
    draw_actor_exp(actor, 75, 64)
    draw_actor_hp(actor, 32,100)
    draw_actor_sp(actor, 240,100)
    draw_actor_parameter(actor, 32, 150, 0)
    draw_actor_parameter(actor, 32, 182, 1)
    draw_actor_parameter(actor, 32, 214, 2)
    draw_actor_parameter(actor, 32, 246, 7) #Evade
    draw_actor_parameter(actor, 240, 150, 3)
    draw_actor_parameter(actor, 240, 182, 4)
    draw_actor_parameter(actor, 240, 214, 5)
    draw_actor_parameter(actor, 240, 246, 6)
  end
end

 

#==============================================================================
# Scene_Menu
#==============================================================================
class Scene_Menu
  def initialize(menu_index = 0)
    @menu_index = menu_index
  end
  #--------------------------------------------------------------------------
  # * Main - Handles drawing/disposing windows and the main loop
  #--------------------------------------------------------------------------
  def main
    #Draw Windows
    main_draw
    #Execute transition
    Graphics.transition
    #Main Loop
    loop do
      #Main Loop
      main_loop
      break if main_scenechange?
    end
    #Prepare for transition
    Graphics.freeze
    #Dispose Windows
    main_dispose
  end
  #--------------------------------------------------------------------------
  # * Main Draw - Handles drawing windows
  #--------------------------------------------------------------------------
  def main_draw
    #Draw Background
    @background = Spriteset_Map.new
   
    #Draw Windows
    # InfoWindow
    @info_window = Window_Info.new
    # MenuStatus
    @status_window = Window_NewMenuStatus.new   
 
    # MenuCommand
    s1='Item'
    s2='Skill'
    s3='Equip'
    s4='Player'
    s5='Option'
    s6='System'
   
    z1='Status'
    z2='Quest Log'
   
    o1='Save'
    o2='Load'
    o3='Exit'
   
    @command_window = Window_Command.new(160,[s1,s2,s3,s4,s5,s6])
    @command_window.back_opacity = 160
    @command_window.index = @menu_index
    # If number of party members is 0
    if $game_party.actors.size == 0
      # Disable items, skills, equipment, and status
      @command_window.disable_item(0)
      @command_window.disable_item(1)
      @command_window.disable_item(2)
      @command_window.disable_item(3)
    end
   
    @player_command_window = Window_Command.new(160,[z1,z2])
    @player_command_window.back_opacity = 160
    @player_command_window.visible = false
    @player_command_window.active = false
    @player_command_window.x = 100
    @player_command_window.y = 120
   
    @sys_command_window = Window_Command.new(128,[o1,o2,o3])
    @sys_command_window.back_opacity = 160
    @sys_command_window.visible = false
    @sys_command_window.active = false
    @sys_command_window.x=100
    @sys_command_window.y=180
    if $game_system.save_disabled
      @sys_command_window.disable_item(0)
    end
  end
  #--------------------------------------------------------------------------
  # * Main Scene Change
  #--------------------------------------------------------------------------
  def main_scenechange?
    # Abort loop if screen is changed
    if $scene != self
      return true
    end
    return false
  end
  #--------------------------------------------------------------------------
  # * Main Dispose
  #--------------------------------------------------------------------------
  def main_dispose
    #Dispose Background
    @background.dispose
   
    # Dispose All Windows
    # Dispose InfoWindow
    @info_window.dispose
    # Dispose MenuStatus
    @status_window.dispose
    # Dispose MenuCommand
    @command_window.dispose
    @player_command_window.dispose
    @sys_command_window.dispose
  end
  #--------------------------------------------------------------------------
  # * Main Loop
  #--------------------------------------------------------------------------
  def main_loop
    # Update game screen
    Graphics.update
    # Update input information
    Input.update
    # Frame update
    update
  end
  #--------------------------------------------------------------------------
  # * Update
  #--------------------------------------------------------------------------
  def update
    # Update Windows
    update_windows
   
    if @player_command_window.active
      @player_command_window.z = +500
    end
   
    if @sys_command_window.active
      @sys_command_window.z = +500
    end
   
    # If command window is active: call update_command
    if @command_window.active
      update_command
      return
    end
    # If player menu window is active: call update_player_command
    if @player_command_window.active
      update_player_command
      return
    end
    # If system menu window is active: call update_sys_command
    if @sys_command_window.active
      update_sys_command
      return
    end
    # If status window is active: call update_status
    if @status_window.active
      update_status
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Window Update
  #--------------------------------------------------------------------------
  def update_windows
    # Update MenuCommand
    @command_window.update if @command_window.visible
    @player_command_window.update if @player_command_window.visible
    @sys_command_window.update if @sys_command_window.visible
    @info_window.update
    @status_window.update
  end
  #--------------------------------------------------------------------------
  # * Update Menu Command
  #--------------------------------------------------------------------------
  def update_command
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)     
      # Switch to map screen
      $scene = Scene_Map.new
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)# If command other than save or end game, and party members = 0
      if $game_party.actors.size == 0 and @command_window.index < 4
        # Play buzzer SE
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      # Branch by command window cursor position
      case @command_window.index
      when 0 # Item
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to item screen
        $scene = Scene_Item.new
      when 1 # Skill
        # If this actor's action limit is 2 or more
        if $game_party.actors[0].restriction >= 2
          # Play buzzer SE
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to skill screen
        $scene = Scene_Skill.new
      when 2 # Equip
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to equipment screen
        $scene = Scene_Equip.new
      when 3 # Player
        $game_system.se_play($data_system.decision_se)
        @player_command_window.active = true
        @player_command_window.visible = true
        @command_window.active = false
      when 4 # Option
        #$game_system.se_play($data_system.decision_se)
        #Put your Option Scene
      when 5 # System
        $game_system.se_play($data_system.decision_se)
        @sys_command_window.active = true
        @sys_command_window.visible = true
        @command_window.active = false
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Update PlayerCommand Window
  #--------------------------------------------------------------------------
  def update_player_command
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      @command_window.active = true
      @player_command_window.active = false
      @player_command_window.visible = false
      @player_command_window.index = 0
      @player_command_window.z = 0
      return
    end 
   
    if Input.trigger?(Input::C)
      case @player_command_window.index     
      when 0 #Status
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to status screen
        $scene = Scene_Status.new
      when 1 #Quest Log
        # Play decision SE
        #$game_system.se_play($data_system.decision_se)
        #Put your Quest Scene
      end
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Update SysCommand Window
  #--------------------------------------------------------------------------
  def update_sys_command
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      @command_window.active = true
      @sys_command_window.active = false
      @sys_command_window.visible = false
      @sys_command_window.index = 0
      @sys_command_window.z = 0
      return
    end 
   
    if Input.trigger?(Input::C)
      case @sys_command_window.index     
      when 0 #Save
        # If saving is forbidden
        if $game_system.save_disabled
          # Play buzzer SE
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to save screen
        $scene = Scene_Save.new
      when 1 #Load
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to load screen
        $scene = Scene_Load.new
      when 2 #Exit 
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to end game screen
        $scene = Scene_End.new
      end
      return
    end
  end
end

 

class Scene_Save < Scene_File
  alias save_on_decision on_decision
  alias save_on_cancel on_cancel
  #--------------------------------------------------------------------------
  # * Decision Processing
  #--------------------------------------------------------------------------
  def on_decision(filename)
    save_on_decision(filename)
    $scene = Scene_Menu.new(5)
  end
  #--------------------------------------------------------------------------
  # * Cancel Processing
  #--------------------------------------------------------------------------
  def on_cancel
    save_on_cancel
    $scene = Scene_Menu.new(5)
  end
end


class Scene_Load < Scene_File
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  alias load_initialize initialize
  alias load_on_cancel on_cancel
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    @scene = $scene
    load_initialize
  end
  #--------------------------------------------------------------------------
  # * Cancel Processing
  #--------------------------------------------------------------------------
  def on_cancel
    load_on_cancel
    $scene = @scene
  end
end


출처: 네이버 지식 인 ^^

Who's WMN

?
 
 

  W M  N  
                  자료공유

Comment '6'

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 습작 2012.12.24 6153
1021 아이템 흠..몬스터도감말고 아이템도감~ 9 백호 2009.02.21 2028
1020 전투 흠.. 아직도 이 스크립트가 없군요 ㅋㅋ(제가올림..) 1 file 백호 2009.02.21 3335
1019 전투 횡스크롤형식의 스크립트 7 백호 2009.02.21 2973
1018 기타 횡스크롤 스크립트 한국말 번역. 15 file 백호 2009.02.21 3311
1017 기타 회복으로 데미지를 받는 좀비 스크립트 7 백호 2009.02.22 2004
1016 메뉴 화살표 모양 셀렉트 커서 사용 2 백호 2009.02.22 2118
1015 그래픽 화면을 부드럽게 해주는스크립트[ 아주 유용] 56 file - 하늘 - 2009.08.05 6561
1014 미니맵 화면에 축소된 미니맵을 표시하는 스크립트 - 한글 번역 - 6 file 백호 2009.02.21 2560
1013 화면에 축소된 맵을 표시하는 스크립트 7 file 백호 2009.02.21 2394
1012 기타 홈페이지 띄우기 (VX 상관없음.) 6 KNAVE 2009.08.25 2137
1011 메뉴 혹시있나해서-_-.. 대화창에 테두리치기 스크립트 7 백호 2009.02.22 2592
1010 기타 현재시간표시 33 file 코아 코스튬 2010.10.09 2529
1009 기타 현재 맵BGM을 그대로 전투 BGM으로 연결 from phylomortis.com 백호 2009.02.22 1180
1008 이름입력 한글조합입력기(영어가능) file 조규진1 2019.11.10 497
1007 메시지 한글자씩 뜨는 스크립트 6 백호 2009.02.21 3001
1006 키입력 한글입력스크립트 16 file 아방스 2007.11.09 11823
1005 키입력 한글입력기(자음, 모음 분리. 아마 중복일 듯...) 11 캉쿤 2011.09.13 3225
1004 키입력 한글입력기 6 백호 2009.02.22 4302
1003 이름입력 한글이름 입력기 스크립트 14 백호 2009.02.22 4205
1002 메시지 한글 채팅 스크립트 32 file こなた 2009.01.22 4947
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