VX 스크립트



#=======================================================================
# ● [VX] ◦ On-Screen Shop ◦ □
#-------------------------------------------------------------------
# ◦ by Woratana [woratana@hotmail.com]
# ◦ Thaiware RPG Maker Community
# ◦ Released on: 14/05/2008
# ◦ Version: 1.0
#=======================================================================

class Scene_Shop < Scene_Base
  
  USE_SPRITESET = true
  # Do you want to use real map as background? (tile will animate)
  
  #--------------------------------------------------------------------------
  # * Start processing
  #--------------------------------------------------------------------------
  alias wora_sceshop_str_oshop start
  def start
    wora_sceshop_str_oshop
    @spriteset = Spriteset_Map.new if USE_SPRITESET
    @gold_window.x = Graphics.width - @gold_window.width - 24
    @gold_window.y = Graphics.height - @gold_window.height - 24
    @buy_window.x = @sell_window.x = 0
    @number_window.x = 0
    @dummy_window.y = @help_window.height
    @buy_window.y = @sell_window.y = @help_window.height
    @number_window.y = @status_window.y = @help_window.height
    @buy_window.height = @sell_window.height = 200
    @number_window.height = @status_window.height = 200
    @dummy_window.y = Graphics.height
    @status_window.create_contents
    @help_window.visible = false
  end
  #--------------------------------------------------------------------------
  # * Termination Processing
  #--------------------------------------------------------------------------
  alias wora_sceshop_ter_oshop terminate
  def terminate
    wora_sceshop_ter_oshop
    @spriteset.dispose if USE_SPRITESET
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  alias wora_sceshop_upd_oshop update
  def update
    wora_sceshop_upd_oshop
    if @command_window.active
      @help_window.visible = false
    elsif @buy_window.active
      @help_window.visible = @buy_window.visible
    elsif @sell_window.active
      @help_window.visible = @sell_window.visible
    end
    @spriteset.update if USE_SPRITESET
  end
  #--------------------------------------------------------------------------
  # * Create Command Window
  #--------------------------------------------------------------------------
  def create_command_window
    s1 = Vocab::ShopBuy
    s2 = Vocab::ShopSell
    s3 = Vocab::ShopCancel
    @command_window = Window_Command.new(120, [s1, s2, s3])
    @command_window.y = Graphics.height - @command_window.height - 24
    @command_window.x = 24
    if $game_temp.shop_purchase_only
      @command_window.draw_item(1, false)
    end
  end
end

class Window_ShopNumber < Window_Base
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    y = 64
    self.contents.clear
    draw_item_name(@item, 0, y)
    self.contents.font.color = normal_color
    self.contents.draw_text(212, y, 20, WLH, "×")
    self.contents.draw_text(248, y, 20, WLH, @number, 2)
    self.cursor_rect.set(244, y, 28, WLH)
    draw_currency_value(@price * @number, 4, y + WLH * 2, 264)
  end
end

class Window_ShopStatus < Window_Base
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    if @item != nil
      number = $game_party.item_number(@item)
      self.contents.font.color = system_color
      self.contents.draw_text(4, 0, 200, WLH, Vocab::Possession)
      self.contents.font.color = normal_color
      self.contents.draw_text(4, 0, 200, WLH, number, 2)
      for actor in $game_party.members
        x = 4
        y = WLH * (2 + actor.index)
        draw_actor_parameter_change(actor, x, y)
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Draw Actor's Current Equipment and Parameters
  #--------------------------------------------------------------------------
  def draw_actor_parameter_change(actor, x, y)
    return if @item.is_a?(RPG::Item)
    enabled = actor.equippable?(@item)
    self.contents.font.color = normal_color
    self.contents.font.color.alpha = enabled ? 255 : 128
    self.contents.draw_text(x, y, 200, WLH, actor.name)
    if @item.is_a?(RPG::Weapon)
      item1 = weaker_weapon(actor)
    elsif actor.two_swords_style and @item.kind == 0
      item1 = nil
    else
      item1 = actor.equips[1 + @item.kind]
    end
    if enabled
      if @item.is_a?(RPG::Weapon)
        atk1 = item1 == nil ? 0 : item1.atk
        atk2 = @item == nil ? 0 : @item.atk
        change = atk2 - atk1
      else
        def1 = item1 == nil ? 0 : item1.def
        def2 = @item == nil ? 0 : @item.def
        change = def2 - def1
      end
      if change > 0 # If increase status
        
      elsif change < 0 # If decrease status
        self.contents.font.color.alpha = 128
      else # if not change status
        self.contents.font.color.alpha = 128
      end
      self.contents.draw_text(x, y, 200, WLH, sprintf("%+d", change), 2)
    end
  end
end
   
 
Comment '34'

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 3 습작 2012.12.24 5398
417 아이템 아이템 획득 팝업 스크립트 24 아방스 2009.01.07 3805
416 전투 VLAD ABS [액알 시스템] 65 아방스 2009.01.07 12564
415 이동 및 탈것 VX 기차 스크립트 28 아방스 2009.01.13 4467
414 상태/속성 넓어진 상태창 v1.0 11 file 아방스 2009.01.20 4536
413 메뉴 커서 모양 바꾸는 스크립트 16 아방스 2009.01.20 3958
412 메뉴 레벨업 시 자세한 정보 나오는 스크립트 23 아방스 2009.01.20 3895
411 타이틀/게임오버 타이틀 메뉴 스크립트 50 아방스 2009.01.20 7503
410 메시지 메시지 표시 시스템 [NMS3] 31 아방스 2009.01.24 6248
409 타이틀/게임오버 타이틀 업그레이드 byMOG 16 *ps인간 2009.01.26 5658
408 아이템 레벨,능력치,아이템소지갯수,소지금의 한계돌파스크립트 21 file 이탁 2009.01.28 4547
407 맵/타일 맵에 이벤트 뿌리기 입니다. 7 file 허걱 2009.01.31 3827
406 기타 책 읽기 스크립트. 19 허걱 2009.01.31 4490
405 기타 Staff Roll 13 file 허걱 2009.01.31 3523
404 미니맵 KGC 미니맵 스크립트 (한글번역) 45 file 레오 2009.02.01 6555
403 전투 사이드뷰배틀3.3 + ATB1.1 스크립트. 65 할렘 2009.02.01 10945
402 상점 보관함 스크립트 43 file 허걱 2009.02.02 5161
» 상점 상점을 색다르게 바꿔주는 스크립트 34 file 할렘 2009.02.02 6301
400 메시지 MessageSound v2.0 글자에 소리 다다닥 스크립트 21 할렘 2009.02.02 3510
399 스킬 스킬 필요 조건(번역) 23 file 훈덕 2009.02.03 4644
398 기타 VX서비스팩1 6 훈덕 2009.02.03 2806
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 ... 32 Next
/ 32