XP 스크립트

Source Thread: http://www.rmvxp.com/showthread.php?t=613
(1.2 is here: http://www.creationasylum.net/forum/index.php?showtopic=9869&st=0)

  맵 화면상에서 현재 파티에 있는 액터의 HP/SP/EXP를 보여줍니다.  HUD는 스위치를 사용하여 on/off 가능.  2.0은 기존버전의 랙 문제와 버그를 수정한 것입니다.(문제는 이 이후로 업데이트된 것을 본 적이 없다는 것이지만)


 

#==============================================================================
# ** Hud Menu
#==============================================================================
# Raziel
# Version 2.0
# 2007-08-18
#------------------------------------------------------------------------------
#===============================================================================
# * Module Raz_Hud
#===============================================================================

module Raz_Hud
#switch to show/hide the hud
SWITCH_ID = 1
#set it to true to center the hud if there are less than four party members
Center_hud = true
end
#==============================================================================
# ** Scene_Map
#------------------------------------------------------------------------------
# This class performs map screen processing.
#==============================================================================

class Scene_Map
#----------------------------------------------------------------------------
# * Alias Listings
#----------------------------------------------------------------------------
alias raz_hud_main main
alias raz_hud_update update
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
@hud_dummy = []
for i in 0...$game_party.actors.size
@hud_dummy[i] = Window_Dummy.new(i)
end
@hud_window = Window_HUD.new
raz_hud_main
@hud_window.dispose
@hud_dummy.each { |hud| hud.dispose }
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
@hud_dummy.each {|hud| hud.visible = $game_switches[Raz_Hud::SWITCH_ID]}
if @hud_dummy[$game_party.actors.size] != nil
@hud_dummy.each{|hud| hud.dispose}
@hud_dummy = []
for i in 0...$game_party.actors.size
@hud_dummy[i] = Window_Dummy.new(i)
end
end
@hud_window.update
raz_hud_update
end
end
#===============================================================================
# * Window_HUD
#===============================================================================

class Window_HUD < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(0, 0, 800, 600)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = 0
self.visible = $game_switches[Raz_Hud::SWITCH_ID]
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
@old_hp, @old_sp, @old_exp, @old_size = [],[],[],$game_party.actors.size
for actor in $game_party.actors
@old_hp << actor.hp; @old_sp << actor.sp; @old_exp << actor.exp
a = $game_party.actors.size - 1
center = Raz_Hud::Center_hud == true ? (240 - (a * 80)) : 0
x = ($game_party.actors.index(actor) * 160 + 25) + center
self.contents.font.size = 21
draw_actor_graphic(actor, x - 15, 445)
self.contents.font.color = normal_color
self.contents.draw_text(x - 25, 360, 100, 32, actor.name)
draw_slant_bar(x + 8, 396, actor.hp, actor.maxhp, 100, 6)
draw_slant_bar(x + 8, 416, actor.sp, actor.maxsp, 100, 6, Color.new(0, 0, 150), Color.new(60, 155, 155))
now_exp = actor.level == 99 ? 1 : actor.now_exp
next_exp = actor.level == 99 ? 1 : actor.next_exp
draw_slant_bar(x + 8, 436, now_exp, next_exp, 100, 6, Color.new(0, 150, 0), Color.new(60, 255, 60))
self.contents.font.size = 16
draw_actor_state(actor, x + 45, 360)
self.contents.font.color = normal_color
self.contents.font.bold = true
self.contents.font.color = actor.hp == 0 ? knockout_color : actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
self.contents.draw_text(x + 16, 382, 100, 32, "#{actor.hp}/#{actor.maxhp}", 1)
self.contents.font.color = actor.sp == 0 ? crisis_color : actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
self.contents.draw_text(x + 16, 402, 100, 32, "#{actor.sp}/#{actor.maxsp}", 1)
self.contents.font.color = system_color
self.contents.font.size = 20
self.contents.font.bold = false
self.contents.draw_text(x, 384, 50, 32, $data_system.words.hp)
self.contents.draw_text(x, 404, 50, 32, $data_system.words.sp)
self.contents.draw_text(x, 424, 50, 32, "Exp")
end
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
refresh if @old_size != $game_party.actors.size
@old_hp.each_with_index {|hp, index| refresh if hp != $game_party.actors[index].hp}
@old_sp.each_with_index {|sp, index| refresh if sp != $game_party.actors[index].sp}
@old_exp.each_with_index {|exp, index| refresh if exp != $game_party.actors[index].exp}
self.visible = $game_switches[Raz_Hud::SWITCH_ID]
end
end
#===============================================================================
# * Window_Dummy
#===============================================================================

class Window_Dummy < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
# size: Party's size
#--------------------------------------------------------------------------
def initialize(size)
@old_size = $game_party.actors.size
x = Raz_Hud::Center_hud == true ? 240 - ($game_party.actors.size - 1) * 80 : 0
super(160 * size + x, 372,160, 108)
self.visible = $game_switches[Raz_Hud::SWITCH_ID]
self.opacity = 200
end
end
#==============================================================================
# ** Window_Base
#------------------------------------------------------------------------------
# This class is for all in-game windows.
#==============================================================================

class Window_Base < Window
#--------------------------------------------------------------------------
# * Draw Slant Bar (by SephirothSpawn)
#--------------------------------------------------------------------------
def draw_slant_bar(x, y, min, max, width = 152, height = 6,
bar_color = Color.new(150, 0, 0, 255), end_color = Color.new(255, 255, 60, 255))
for i in 0..height
self.contents.fill_rect(x + i, y + height - i, width + 1, 1, Color.new(50, 50, 50, 255))
end
for i in 1..(height - 1)
r = 100 * (height - i) / height + 0 * i / height
g = 100 * (height - i) / height + 0 * i / height
b = 100 * (height - i) / height + 0 * i / height
a = 255 * (height - i) / height + 255 * i / height
self.contents.fill_rect(x + i, y + height - i, width, 1, Color.new(r, b, g, a))
end
for i in 1..( (min / max.to_f) * width - 1)
for j in 1..(height - 1)
r = bar_color.red * (width - i) / width + end_color.red * i / width
g = bar_color.green * (width - i) / width + end_color.green * i / width
b = bar_color.blue * (width - i) / width + end_color.blue * i / width
a = bar_color.alpha * (width - i) / width + end_color.alpha * i / width
self.contents.fill_rect(x + i + j, y + height - j, 1, 1, Color.new(r, g, b, a))
end
end
end
end
#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
# This class handles the actor. It's used within the Game_Actors class
# ($game_actors) and refers to the Game_Party class ($game_party).
#==============================================================================

class Game_Actor
#--------------------------------------------------------------------------
# * Now Exp
#--------------------------------------------------------------------------
def now_exp
return @exp - @exp_list[@level]
end
#--------------------------------------------------------------------------
# * Next Exp
#--------------------------------------------------------------------------
def next_exp
return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
end
end
Comment '3'

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 습작 2012.12.24 6153
841 기타 Complete Climate and Time System 1.2 by ForeverZer0 1 Alkaid 2010.09.17 1310
840 액터 Actor Customization 6.0.2 by Synthesize 4 file Alkaid 2010.09.17 1911
839 그래픽 MAWS: Modified Advanced Weather Script 1.2 by Agckuu Coceg 2 file Alkaid 2010.09.13 1969
838 메뉴 L's Custom Menu #3: 1인용 메뉴 Revision 1 3 Alkaid 2010.09.12 2360
837 저장 Advanced Save Menu 편집한 것. (SDK2용) Alkaid 2010.09.11 1219
836 HUD MOG_Active_Hud 3 file Bera 2010.09.11 2468
835 HUD MOG_C_HUD. 6 file Bera 2010.09.11 2329
834 액터 크리쳐 합체, 'SW_CreatureMix(for_rmxp)' by SiotWarrior 21 file 시옷전사 2010.09.11 2777
833 메뉴 L's Custom Menu #4: 'Compact' (SDK 2.x 필수) Alkaid 2010.09.11 1755
832 전투 Minkoff's Animated Battlers - Enhanced 13.2 by DerVVulfman Alkaid 2010.09.10 1687
831 전투 CTB by Charlie Fleed 3.1 - FF10 스타일의 전투시스템 6 Alkaid 2010.09.10 2974
830 전투 Mr. Mo's ABS 5.5 13 Alkaid 2010.09.10 3459
829 전투 DerVVulfman's addons for Mr.Mo's ABS file Alkaid 2010.09.10 1645
828 메시지 Hermes(Hermes Extends RPGXP Message System) 0.3d by derula Alkaid 2010.09.10 2023
827 아이템 Categorized Items Menu 1.3 by albertfish 1 file Alkaid 2010.09.09 1795
826 기타 간단한 Scene_Base Alkaid 2010.09.09 1390
825 메뉴 Ring menu edit (Non-SDK ver.) Alkaid 2010.09.08 1538
824 메뉴 Ring menu edit for SDK2 (Original by Hypershadow180) file Alkaid 2010.09.08 1374
823 메시지 Universal Message System 1.8.0 by ccoa 1 file Alkaid 2010.09.08 2183
822 그래픽 Weather Script(버전 불명) by ccoa 1 file Alkaid 2010.09.08 1571
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