VX 스크립트

전투에 승리하면 아래 화면과 같이 경험치와 아이템을 팝업하는 창을 만드는 스크립트입니다.

그냥 붙여넣기만으로도 사용가능합니다.

한글번역(네이버님의도움 ㄳ)했으니 고치실분은 고쳐쓰셔도 될듯...

 

#==============================================================================
# ★RGSS2
# STR11h_XP결과 윈도우 v1.1 08/01/26
# 서포트:http://otsu.cool.ne.jp/strcatyou/
#
# ·트크르 XP식의 결과(전투 결과)를 재현, 이라고 할까 그대로 이식
#
#------------------------------------------------------------------------------
#
# 갱신 이력
# ◇1.0→1.1
# 아이템 입수시에 효과음을 울릴 수 있게 되었다
# 일부 처리를 재구축
#==============================================================================
# ■ STRRGSS2
#==============================================================================
module STRRGSS2
  STR11H_RSKIP = Input::C # 결과 웨이트의 스킵 버튼
  STR11H_WAIT  = 240      # 결과 웨이트(1/60sec)
  STR11H_NOTW  = false    # 키 입력이 있을 때까지 결과를 다물지 않는다
                          # (결과 웨이트를 무효로 한다)
  STR11H_EXP   = "EXP"    # 결과에 표시하는 경험치의 용어
  # 아이템 입수시의 SE ("파일명", 볼륨, 핏치)
  STR11H_ITEM  = RPG::SE.new("Chime2", 80, 100)
end
#==============================================================================
# ■ Scene_Battle
#==============================================================================
class Scene_Battle < Scene_Base
  #--------------------------------------------------------------------------
  # ★ 앨리어스(alias)
  #--------------------------------------------------------------------------
  # 종료 처리
  alias terminate_str11h terminate
  def terminate
    @result_window.dispose if @result_window != nil
    terminate_str11h
  end
  #--------------------------------------------------------------------------
  # ★ 재정의
  #--------------------------------------------------------------------------
  # 획득한 드롭 아이템의 표시
  # ※드롭 아이템의 배열을 유지할 방법이 없다(?) 모아 두어 어쩔 수 없이 재정의
  def display_drop_items
    drop_items = $game_troop.make_drop_items
    for item in drop_items
      $game_party.gain_item(item, 1)
    end
    exp = $game_troop.exp_total
    gold = $game_troop.gold_total
    @result_window = Window_BattleResult.new(exp, gold, drop_items)
    STRRGSS2::STR11H_ITEM.play if drop_items != []
    w = STRRGSS2::STR11H_WAIT
    # 웨이트
    while w > 0
      update_basic
      w -= 1 unless STRRGSS2::STR11H_NOTW
      break if Input.trigger?(STRRGSS2::STR11H_RSKIP)
    end
  end
end
#==============================================================================
# ■ Window_BattleResult
#==============================================================================
class Window_BattleResult < Window_Base
  #--------------------------------------------------------------------------
  # ● 오브젝트 초기화
  #--------------------------------------------------------------------------
  def initialize(exp, gold, treasures)
    super(0, 0, 320, (treasures.size * WLH) + WLH + 32)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.x = 272 - width / 2
    self.y = 144 - height / 2
    self.y = 4 if self.y < 4
    refresh(exp, gold, treasures)
  end
  #--------------------------------------------------------------------------
  # ● 리프레쉬
  #--------------------------------------------------------------------------
  def refresh(exp, gold, treasures)
    self.contents.clear
    vocabexp = STRRGSS2::STR11H_EXP
    x = 4
    self.contents.font.color = normal_color
    cx = contents.text_size(exp).width
    self.contents.draw_text(x, 0, cx, WLH, exp)
    x += cx + 4
    self.contents.font.color = system_color
    cx = contents.text_size(vocabexp).width
    self.contents.draw_text(x, 0, 64, WLH, vocabexp)
    x += cx + 16
    self.contents.font.color = normal_color
    cx = contents.text_size(gold).width
    self.contents.draw_text(x, 0, cx, WLH, gold)
    x += cx + 4
    self.contents.font.color = system_color
    self.contents.draw_text(x, 0, 128, WLH, Vocab::gold)
    y = WLH
    for item in treasures
      draw_item_name(item, 4, y)
      y += WLH
    end
    Graphics.frame_reset
  end
end

 

Untitled-1 copy.jpg

Who's 카르와푸딩의아틀리에

profile

엘카르디아 제작자 (현재 MV로 리메이크중)

유튜브

https://www.youtube.com/channel/UCMwirNTR-pOEzJNB0jL3y_g

트위터

https://twitter.com/karsis98

블로그

https://blog.naver.com/karsis98

Comment '18'

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 3 습작 2012.12.24 5398
637 기타 Gamepad Extender VX 습작 2015.01.02 672
636 버그픽스 DerVVulfman's Tileset Reader VX Bug Fix 습작 2014.11.16 699
635 아이템 현재있는 파티원 선택 레벨업 아이템 만들기 1 file 싸패 2016.06.06 713
634 메뉴 Etude87_Ace_Style_Formation_Change ver.1.01 습작 2014.10.05 758
633 저장 세이브 파일 개수 16개로 늘리기 (기본 세이브 엔진용) 1 file Bunny_Boy 2015.09.07 816
632 ??? 1 Man... 2008.10.27 1020
631 버그픽스 Graphical Object Global Reference VX by Mithran Alkaid 2014.03.03 1026
630 키입력 No F1, F12 and Alt+Return (Kein F1, F12 und Alt+Eingabe) by cremno 습작 2013.04.19 1046
629 메시지 Etude87 Dialogue History Scene file 습작 2014.07.07 1069
628 메뉴 KGC - 커스텀 메뉴 커멘드 (번역) 1 듀란테 2015.07.27 1077
627 ??(다 영어)여기서 부터 드레그만 빼고 Man... 2008.10.27 1078
626 Scene_Credit script Plug & Play 1 Man... 2008.10.27 1085
625 Multi-threader snippet by Omegazion Man... 2008.10.28 1107
624 메뉴 MOG - Scroll Bar for VX file 습작 2014.07.06 1115
623 Screen Shortcut Script Man... 2008.10.27 1142
622 LevelMe v1.2 3 Man... 2008.10.27 1154
621 Screen Resolution 3 Man... 2008.10.28 1171
620 키입력 Key Simulator by Fantasist 습작 2013.05.01 1176
619 MAX Level Limitation System 3 Man... 2008.10.28 1198
618 Simple Fon Chage 3 Man... 2008.10.28 1212
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