VX 스크립트

말그대로... 게이지에 몬스터와 만나려면 몇걸음 남았는지

게이지 형식으로 메뉴에 표시하는 스크립트입니다.

그러니까... 걍 MAIN위에 붙여넣으시면 알아서 게이지를 형성합니다아>.

좀 쓸모 없을 지도 모르지만,, 뭐 아이템에 콜 스크립트로 쓰실 수도 있으니... 아이템에 이용하셔도 될듯..

 

#===============================================================================
# Encounter Gauge by Deriru
# Version 1.0
# How to install:
# --Put under Materials and above Main
#
# Enabling/Disabling Gauge:
# Script: $EncGaugeCtrl.turn_on or $EncGaugeCtrl.turn_off
#
# Checking the Gauge if disabled/enabled(use as a conditional branch)
# Script: $EncGaugeCtrl.is_on? or $EncGaugeCtrl.is_off?
#===============================================================================

#-------------------------------------------------------------------------------
# DO NOT TOUCH PARTS BELOW PLEASE!
#-------------------------------------------------------------------------------
module Deriru
module EncGauge
#-------------------------------------------------------------------------------
# DO NOT TOUCH PARTS ABOVE PLEASE!
#-------------------------------------------------------------------------------

#===============================================================================
# Setup Begin
#-------------------------------------------------------------------------------
# X and Y of the gauge.
# X range: 0 to 400
# Y range: 0 to 350
#-------------------------------------------------------------------------------
GX = 0
GY = 0
#-------------------------------------------------------------------------------
# Opacity when player is underneath the gauge.
#-------------------------------------------------------------------------------
BEHIND_OPAC = 128
#-------------------------------------------------------------------------------
# Maps that are encounter areas.
#-------------------------------------------------------------------------------
ENCMAPS = [1]
#-------------------------------------------------------------------------------
# Color for the border of the Gauge
#-------------------------------------------------------------------------------
BORDER = Color.new(0,0,0,255)
#-------------------------------------------------------------------------------
# Set to false if you do not want to see the gauge in non-encounter areas.
#-------------------------------------------------------------------------------
SHOW_TOWN = true
#-------------------------------------------------------------------------------
# Color of the Gauge
#-------------------------------------------------------------------------------
LV = Array.new # DO NOT TOUCH!
LV[0] = Color.new(225,255,255,128) # No encounter
LV[1] = Color.new(0,255,0,128) # 0/5 of encounter
LV[2] = Color.new(0,128,0,128) # 1/5 of encounter
LV[3] = Color.new(128,128,0,128) # 2/5 of encounter
LV[4] = Color.new(128,0,0,128) # 3/5 of encounter
LV[5] = Color.new(225,0,0,128) # 4/5 of encounter
#-------------------------------------------------------------------------------
# Setup End
#===============================================================================
#-------------------------------------------------------------------------------
# DO NOT TOUCH PARTS BELOW PLEASE!
#-------------------------------------------------------------------------------
end
end

class Window_DeriruEncHUD < Window_Base

$encgauge = true
MYX = Deriru::EncGauge::GX
MYY = Deriru::EncGauge::GY
if MYX > 400
MYX = 400
elsif MYX < 0
MYX = 0
end
if MYY > 350
MYY = 350
elsif MYY < 0
MYY = 0
end
def initialize
super(MYX,Deriru::EncGauge::GY,150,120)
self.z = 1
self.opacity = 0
end

def refresh(color)
self.contents.clear
if Deriru::EncGauge::ENCMAPS.include?($game_map.map_id)
redraw(color,true)
else
redraw(0,false)
end
end

def redraw(color, encmap)
if encmap == true
enc_gauge = @enc_need - @enc_step
enc_gauge = 1 if enc_gauge < 1
gauge = 100 * enc_gauge / (@enc_need - 1)
self.contents.fill_rect(0,20,104,13,Deriru::EncGauge::BORDER)
self.contents.gradient_fill_rect(2,22,gauge,9,Deriru::EncGauge::LV[1],Deriru::EncGauge::LV[color])
self.contents.draw_text(0,0,300,32,"Encounter")
else
self.contents.fill_rect(0,20,104,13,Deriru::EncGauge::BORDER)
self.contents.fill_rect(2,22,100,9,Deriru::EncGauge::LV[0])
self.contents.draw_text(0,0,300,32,"No Encounter")
end
end

def clearself
self.contents.dispose
end

def setopac(num)
self.contents_opacity = num
end

def update_enc
@enc_need = $game_map.encounter_step
@enc_step = $game_player.encounter_count
one_fifth = Integer(@enc_need/5)
two_fifth = Integer(@enc_need/2.5)
three_fifth = Integer(@enc_need/1.67)
four_fifth = Integer(@enc_need/1.25)
if @enc_step < one_fifth
self.refresh(5)
elsif @enc_step < two_fifth
self.refresh(4)
elsif @enc_step < three_fifth
self.refresh(3)
elsif @enc_step < four_fifth
self.refresh(2)
else
self.refresh(1)
end
end

end

class Scene_Map < Scene_Base

alias der_start start
def start
der_start
if $encgauge == true
if Deriru::EncGauge::SHOW_TOWN == true
@enchud = Window_DeriruEncHUD.new if @enchud == nil
@enchud.update_enc if @enchud != nil
else
if Deriru::EncGauge::ENCMAPS.include?($game_map.map_id)
@enchud = Window_DeriruEncHUD.new if @enchud == nil
@enchud.update_enc if @enchud != nil
end
end
else
if @enchud != nil
@enchud.dispose
@enchud = nil
end
end
end

alias der_update update
def update
der_update
if $encgauge == true
if Deriru::EncGauge::SHOW_TOWN == true
@enchud = Window_DeriruEncHUD.new if @enchud == nil
@enchud.update_enc if @enchud != nil
else
if Deriru::EncGauge::ENCMAPS.include?($game_map.map_id)
@enchud = Window_DeriruEncHUD.new if @enchud == nil
@enchud.update_enc if @enchud != nil
else
@enchud.contents.dispose if @enchud != nil
@enchud = nil if @enchud != nil
end
end
if $game_player.screen_x + 16 > Deriru::EncGauge::GX + 48 and
$game_player.screen_y + 4 > Deriru::EncGauge::GY + 48 and
$game_player.screen_x - 16 < Deriru::EncGauge::GX + 120 and
$game_player.screen_y - 28 < Deriru::EncGauge::GY + 48
@enchud.setopac(Deriru::EncGauge::BEHIND_OPAC) if @enchud != nil
else
@enchud.setopac(255) if @enchud != nil
end
else
if @enchud != nil
@enchud.dispose
@enchud = nil
end
end
end

alias der_terminate terminate
def terminate
if @enchud != nil
@enchud.dispose
@enchud = nil
end
der_terminate
end



end

class EncCtrl
def turn_on
$encgauge = true
end
def turn_off
$encgauge = false
end
def is_on?
if $encgauge == true
return true
else
return false
end
end
def is_off?
if $encgauge == false
return true
else
return false
end
end
end

$EncGaugeCtrl = EncCtrl.new



Deriru님이 만드신 인카운터 게이지 스크립틉니다.

유옹하게 쓰시길 바라겠습니다.

Comment '2'

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 3 습작 2012.12.24 5398
517 장비 루시퍼님이올리신 rei의 보이는 장비 아주 조금 해석본 2 file 비류 2010.01.08 2184
516 기타 전투후 이어지는 베경음 9 비극ㆍ 2010.04.19 2190
515 전투 Slip_Damage_Ex - 슬립데미지 확장기능 (상태별 슬립데미지 적용) 7 허걱 2012.07.24 2194
514 메시지 Advanced Text System 3.0b by Modern Algebra 3 file Alkaid 2010.09.05 2206
513 기타 이벤트 제작용 소품 모음 스크립트 12 시트르산 2010.09.10 2209
512 메시지 문장 및 페이스 정렬 바꾸기 (Neonblack's Text Alignment and Face Flip script) MinaAubert 2012.09.19 2214
511 기타 Fullscreen++ by Zeus81 (VX/VXA) 2 Alkaid 2012.09.01 2230
510 변수/스위치 VX Script Fix - Variable Operation (by Yeyinde) 8 WMN 2008.04.06 2267
509 전투 오버 드라이브 프로블럼 2 Man... 2008.10.28 2268
508 기타 블록 미니게임 11 file 사람이라면? 2010.08.15 2269
507 타이틀/게임오버 타이틀에서 홈페이지 연결 17 비극ㆍ 2010.04.19 2271
506 전투 대미지%MP흡수 스크립트 4 Evangelista 2009.08.31 2279
505 AntiLag_1.2h 23 file RPGbooster 2008.10.08 2284
504 장비 YERD - Extra Equipment Options ReDONE 7 훈덕 2009.11.08 2287
503 기타 2 Players Engine 11 레이니케 2008.03.28 2294
502 메시지 Advanced Text System 3.0c by Modern Algebra 3 file Alkaid 2010.09.08 2302
501 메시지 Universal Message System 0.3.0(beta) by ccoa 3 file Alkaid 2010.09.08 2304
500 기타 스크립트로 커먼 이벤트 실행 [수정] 3 허걱 2009.08.17 2311
» 기타 (좀 이상한 or 쓸모없을 듯 한)화면상에 몬스터와 만나려면 몇걸음 남았는지 표시하는 스크립트! 2 루시페르 2009.06.06 2318
498 이동 및 탈것 스위치 on일때 못 움직이게...(이동고정) 6 허걱 2009.07.14 2322
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