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 6202
601 전투 SBABS v4 (A-RPG) 5 file 백호 2009.02.22 2055
600 장비 KGC_장비확장 (7/30일자) 12 file 백호 2009.02.22 2055
599 메뉴 Trickster's Plug 'n' Play Gradient Bar 2.0 1 file 백호 2009.02.22 2051
598 전투 SBABS v3 6 file 백호 2009.02.22 2046
597 그래픽 Transition Pack 1.11 by Fantasist Alkaid 2011.01.22 2044
596 메뉴 넷플레이 업그레이드됀 메뉴 스크립트 4 백호 2009.02.22 2040
» HUD HUD Menu 2.0 by Raziel 3 Alkaid 2010.09.07 2038
594 전투 [신기술 체험] Tactical Battle System 9 file 백호 2009.02.22 2034
593 기타 자동미로 12 file 백호 2009.02.22 2031
592 스킬 KGC_CrashSkill(자폭스킬) 4 file 백호 2009.02.22 2029
591 아이템 흠..몬스터도감말고 아이템도감~ 9 백호 2009.02.21 2028
590 상점 ▼▲▼ XRXS36. 숍·변동시장 ▼▲▼ (시세) 8 D.S.Y 2008.12.09 2025
589 메시지 Hermes(Hermes Extends RPGXP Message System) 0.3d by derula Alkaid 2010.09.10 2025
588 기타 요리 시스템 스크립트 12 file 백호 2009.02.21 2023
587 장비 착용한 장비에 따라 모습이 달라지는 스크립트 예제 5 file 게임애호가 2015.02.14 2018
586 이동 및 탈것 테두리 글자 & 그림자 글자 2 file 백호 2009.02.21 2015
585 기타 회복으로 데미지를 받는 좀비 스크립트 7 백호 2009.02.22 2010
584 스킬 MicKo's Skill Tree 1.2 by DerVVulfman 2 Alkaid 2011.03.15 2010
583 메뉴 메뉴....있길래올립니다. 9 벨☆ 2010.01.23 2001
582 이동 및 탈것 이동루트 설정 스크립트-특정범위 13 file 『★Browneyedgirls』 2010.02.18 2000
Board Pagination Prev 1 ... 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 ... 52 Next
/ 52