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 5408
117 오디오 사운드테스트 스크립트 13 file 카르와푸딩의아틀리에 2009.08.19 2106
116 전투 Animated Battlers VX 3.7 by DerVVulfman Alkaid 2012.09.07 2102
115 전투 Team_Ilias's_Old_Project_Demo 4 습작 2012.07.11 2101
114 기타 이벤트 위치 저장 스크립트 10 Tofuman 2008.12.11 2096
113 기타 적 선택시 스킬창 비표시 + 타겟 플래쉬 7 훈덕 2009.06.14 2094
112 기타 앞에있는 이벤트 아이디 찾기 6 허걱 2009.08.21 2091
111 기타 스크린샷 기능 14 비극ㆍ 2010.04.19 2090
110 장비 카드 슬롯 장비 스크립트[수정] 2 빙하 2012.11.11 2058
109 전투 VX_SRPG2 by tomoaky 1 습작 2013.05.13 2053
108 스킬 Learn Skills By Use 10 비극ㆍ 2010.04.19 2037
107 기타 Lock Screen 3 비극ㆍ 2010.04.19 2012
106 전투 Requiem ABS Hero Edition by Falcao 습작 2013.05.13 2009
105 기타 みんと씨의 RMVX 샘플 프로젝트 1.11 (2009-11-05) 6 Alkaid 2010.09.13 2005
104 장비 Equipment Constraints 2.5b by Modern Algebra 3 Alkaid 2010.09.17 2001
103 기타 TagNote v2.0 5 Man... 2008.10.28 1996
102 변수/스위치 맵에 변수와 스위치 설정하기.. 5 정의로운녀석 2008.07.22 1984
101 기타 Modified Advanced Weather Script VX 1.1 3 file Alkaid 2010.10.08 1967
100 이동 및 탈것 장소이동시 효과 없애기 10 file 허걱 2013.05.05 1963
99 스킬 Grid Inventory 1.0f by Modern Algebra 2 Alkaid 2010.09.05 1960
98 이름입력 Etude87_HG_Hangul_Name_Scene file 습작 2012.06.14 1948
Board Pagination Prev 1 ... 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 Next
/ 32