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
637 전투 VLAD ABS [액알 시스템] 65 아방스 2009.01.07 12564
636 전투 vampyr SBABS-Requiem ABS 9(액알) 101 file 담먹캐 2009.11.01 12000
635 HUD rpg 만들기 vx - 맵이름 띠우는 스크립트 ^^ 74 아방스 2008.01.27 11924
634 HUD PRABS v1.0 [hud,주석액알,원거리공격,hotkeys,vx] 대박감이다. 47 유칸지 2008.08.13 11114
633 전투 사이드뷰배틀3.3 + ATB1.1 스크립트. 65 할렘 2009.02.01 10946
632 전투 ORBS [새로운 전투 방식] 48 file 아방스 2009.03.04 10210
631 그래픽 3D그래픽 파티클엔진 45 file RPGbooster 2008.10.08 10130
630 전투 rpgvx 간단액알 스크립트 제작: 41 *PS 2008.02.07 9822
629 메뉴 (모그메뉴 풀세트팩 SEL Style.) 유니크급 자료 147 file 할렘 2009.02.07 9558
628 전투 RPG Tankentai SBS 3.3 + ATB Kaduki Eng 58 아방스 2009.02.05 9071
627 전투 ATB전투방식.(사이드뷰X 백발의카임전투방식O) 14 file 이피쿤 2009.06.24 9035
626 메뉴 일본에서 만든 멋있는메뉴변경 스크립트 (한글 VX에서 쓰시면 자동으로 바뀜) 45 유칸지 2008.04.09 8861
625 전투 WGB배틀 시스템. 59 file 카르와푸딩의아틀리에 2009.06.30 8777
624 전투 Crissaegrim ABS 2.0.5 최신 48 file RPGbooster 2008.10.08 8768
623 전투 Requiem ABS 8 - 액션 배틀 시스템 8 36 아방스 2009.06.24 8540
622 전투 RPGTankentai SBS3.3b 버전 (사이드뷰) 21 file 카르와푸딩의아틀리에 2009.07.01 8455
621 전투 사이드뷰 스크립트 [2003 전투 방식] 39 아방스 2008.03.09 8406
620 맵/타일 RPG 만들기 VX 로 구현한 3D~ 42 아방스 2008.09.02 8405
619 메뉴 메뉴변경 스크립트 34 아방스 2008.01.24 7937
618 전투 PRABS 2.0 액션배틀시스템 58 file RPGbooster 2008.10.08 7575
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ... 32 Next
/ 32