Opis:
Ten skrypt generuje nam paski HP, MP, siły, szybkości i wszystkich innych statów w menu statusu. Mnóstwo opcji konfiguracji - od koloru począwszy, na kształcie i położeniu skończywszy
#==============================================================================
# ** Syvkal's Menu Bars
#------------------------------------------------------------------------------
# by Syvkal
# Version 4.1
# 05-20-08
#==============================================================================
#
# - WPROWADZENIE -
#
# Skrypt wprowadza serię pasków Plug'n'Play
# Paski zainspirował CogWheel, ale kodowanie jest moje
# (poza naprawieniem gradient_fill_rect' przez Wortanę )
#
#------------------------------------------------------------------------------
#
# - UŻYTKOWANIE -
#
# Skrypt działa już po wklejeniu go do edytora
# Możesz konfigurować go w sekcji KONFIGURACJA
# Aczkolwiek możliwe jest również tworzenie własnych pasków
#
# ---------------------------------------------------
#
#==========================================================================
# INFORMACJE ZAWARTE PONIŻEJ SĄ PRZYDATNE GŁÓWNIE SKRYPTEROM
# Co znaczy, ze nie musisz ich czytać :P
#==========================================================================
# By wstawić pasek użyj:
# draw_custom_gauge
#
# A potem:
# (value, max, x, y, color1, color2, width, height, slanted, vertical)
#
# value : źródło wartości
# max : wartość maksymalna
# x : koordynata x
# y : koordynata y
# color1 : kolor gradientu 1 Użyj Color.new(r,g,b,a)
# color2 : kolor gradientu 2 LUB koloru z palety
# width : szerokość
# height : wysokość
# slanted : skosy końcówek
# vertical : pasek wertykalnie
#
# ---------------------------------------------------
#
# By wstawić pierścień:
# draw_custom_ring
#
# A potem:
# (value, max, x, y, color1, color2, radius, height, amount, start, reverse)
#
# value : źródło wartości
# max : max wartość
# x : koordynata x
# y : koordynata y
# color1 : kolor 1
# color2 :kolor2
# radius : Promień
# height : Wysokość
# amount : rozmiar pierścienia -domyślnie 360�
# start : pozycja startu - max 360�
# reverse : odwrócenie
#
#------------------------------------------------------------------------------
#
# - DLA SKRYPTERÓW -
#
# Dodałem kilka dodatkowych funkcji, aby skrypterom by z łatwością korzystali z pasków
# Widząc, jak paski można wyciągnąć Normalnie, w pionie lub w pierścieniu dodałem
# Funkcję pozwalającą wyłączyćpaskiprzy sporządzaniu aktorów HP, MP itd.
# Podczas rysowania aktorów HP itp. wystarczy dodać 'true' na końcu. Jak to:
# draw_actor_hp(actor, x, y, width, true)
#
# Dodatkowo odseparowałem poszczególne paski:
#
# draw_actor_hp_gauge(actor, x, y, width) Pasek normalny
# draw_actor_hp_gauge(actor, x, y, width, true) Wartykalny
# draw_actor_hp_ring(actor, x, y, radius, height, amount, start) Pierścień
#
#------------------------------------------------------------------------------
#
# - WYWOŁYWANIE SKRYPTU -
#
# Nie trzeba w zasadzie wywoływać żadnych skryptów
# Jakkolwiek możesz zmienić stałe w trakcie gry
# Zrobisz to wywołując w evencie skrypt:
#
# Na przykład:
# COG::HPMPSLANT = true
#
# zetnie końcówki pasków HP i MP pod skosem
# Ustaw na false by przywrócić proste paski
#
#==============================================================================
module BAR
#===================================================#
# ** KONFIGURACJA ** #
#===================================================#
# Parameter Max Value
P_MAX = 200
# The system uses a 'rate' feature. It is set when drawing a bar
# The 'rate' is how much the bar is filled as a decimal (max : 1)
# This is used to enable color change as the bar decreased in amount
$rate = 0 # Don't touch this
# The system uses a series of CONSTANTS that can be edited here
# They control the basic gauge colors and the manner the gauge is filled:
#===================================================#
# ** Z A A W A N S O W A N A K O N F I G U R A C J A ** #
#===================================================#
# System pozwala na zmianę kolorów stąd
# Funkcja miała być użyta zamiast stałych, więc $rate nadal działa
# Edytuj tylko jeśli wiesz co robisz:
def self::hpcolor1 # HP Guage Color1
return Color.new(80 - 24 * $rate, 80 * $rate, 14 * $rate, 192)
end
def self::hpcolor2 # HP Guage Color2
return Color.new(240 - 72 * $rate, 240 * $rate, 62 * $rate, 192)
end
def self::mpcolor1 # MP Guage Color1
return Color.new(14 * $rate, 80 - 24 * $rate, 80 * $rate, 192)
end
def self::mpcolor2 # MP Guage Color2
return Color.new(62 * $rate, 240 - 72 * $rate, 240 * $rate, 192)
end
def self::expcolor1 # EXP Guage Color1
Color.new(80 * $rate, 80 - 80 * $rate ** 2, 80 - 80 * $rate, 192)
end
def self::expcolor2 # EXP Guage Color2
Color.new(240 * $rate, 240 - 240 * $rate ** 2, 240 - 240 * $rate, 192)
end
#===================================================#
# ** KONIEC KONFIGURACJI ** #
#===================================================#
end
#==============================================================================
#==============================================================================
# NIŻEJ EDYTUJESZ NA WŁASNĄ ODPOWIEDZIALNOŚĆ!
#==============================================================================
#==============================================================================
#==============================================================================
#==============================================================================
#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
# Added EXP and Next Level EXP for numeric for calculations
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# * Get EXP - numeric for calculations
#--------------------------------------------------------------------------
def now_exp
return @exp - @exp_list[@level]
end
#--------------------------------------------------------------------------
# * Get Next Level EXP - numeric for calculations
#--------------------------------------------------------------------------
def next_exp
return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
end
end
#==============================================================================
# ** Window_Base
#------------------------------------------------------------------------------
# Added the 'Draw' functions for each gauge
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# * Includes The BAR Module
#--------------------------------------------------------------------------
include BAR
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias draw_actor_parameter_original draw_actor_parameter
#--------------------------------------------------------------------------
# * Draw HP gauge
# vertical : draw bar vertically
#--------------------------------------------------------------------------
def draw_actor_hp_gauge(actor, x, y, width = 120, vertical = false)
$rate = actor.hp.to_f / actor.maxhp
gw = width * actor.hp / actor.maxhp
w = vertical ? 6 : width; h = vertical ? width : 6
HPMPSLANT ? self.contents.cogwheel_fill_slant(x, y + WLH - 8, gw, w, h, BAR::hpcolor1, BAR::hpcolor2, vertical) :
self.contents.cogwheel_fill_rect(x, y + WLH - 8, gw, w, h, BAR::hpcolor1, BAR::hpcolor2, vertical)
end
#--------------------------------------------------------------------------
# * Draw MP gauge
# vertical : draw bar vertically
#--------------------------------------------------------------------------
def draw_actor_mp_gauge(actor, x, y, width = 120, vertical = false)
$rate = actor.mp.to_f / [actor.maxmp, 1].max
gw = width * actor.mp / [actor.maxmp, 1].max
w = vertical ? 6 : width; h = vertical ? width : 6
HPMPSLANT ? self.contents.cogwheel_fill_slant(x, y + WLH - 8, gw, w, h, BAR::mpcolor1, BAR::mpcolor2, vertical) :
self.contents.cogwheel_fill_rect(x, y + WLH - 8, gw, w, h, BAR::mpcolor1, BAR::mpcolor2, vertical)
end
#--------------------------------------------------------------------------
# * Draw Exp gauge
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# width : Width
# vertical : draw bar vertically
#--------------------------------------------------------------------------
def draw_actor_exp_gauge(actor, x, y, width = 170, vertical = false)
$rate = actor.now_exp.to_f / [actor.next_exp, 1].max
gw = width * actor.now_exp / [actor.next_exp, 1].max
w = vertical ? 6 : width; h = vertical ? width : 6
EXPSLANT ? self.contents.cogwheel_fill_slant(x, y + WLH - 8, gw, w, h, BAR::expcolor1, BAR::expcolor2, vertical) :
self.contents.cogwheel_fill_rect(x, y + WLH - 8, gw, w, h, BAR::expcolor1, BAR::expcolor2, vertical)
end
#--------------------------------------------------------------------------
# * Draw Parameters
# hide_bar : draw Parameters without gauge
#--------------------------------------------------------------------------
def draw_actor_parameter(actor, x, y, type, hide_bar = false)
hide_bar ? nil : draw_actor_parameter_gauge(actor, x, y, type)
draw_actor_parameter_original(actor, x, y, type)
end
#--------------------------------------------------------------------------
# * Draw Parameters gauge
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# type : Type of parameters (0-3)
# width : Width
# vertical : draw bar vertically
#--------------------------------------------------------------------------
def draw_actor_parameter_gauge(actor, x, y, type, width = 160, vertical = false)
case type
when 0
e1 = actor.atk
gc1 = ATKCOLOR1.is_a?(Integer) ? text_color(ATKCOLOR1) : ATKCOLOR1
gc2 = ATKCOLOR2.is_a?(Integer) ? text_color(ATKCOLOR2) : ATKCOLOR2
when 1
e1 = actor.def
gc1 = DEFCOLOR1.is_a?(Integer) ? text_color(DEFCOLOR1) : DEFCOLOR1
gc2 = DEFCOLOR2.is_a?(Integer) ? text_color(DEFCOLOR2) : DEFCOLOR2
when 2
e1 = actor.spi
gc1 = SPICOLOR1.is_a?(Integer) ? text_color(SPICOLOR1) : SPICOLOR1
gc2 = SPICOLOR2.is_a?(Integer) ? text_color(SPICOLOR2) : SPICOLOR2
when 3
e1 = actor.agi
gc1 = AGICOLOR1.is_a?(Integer) ? text_color(AGICOLOR1) : AGICOLOR1
gc2 = AGICOLOR2.is_a?(Integer) ? text_color(AGICOLOR2) : AGICOLOR2
end
e2 = P_MAX
rate = [e1.to_f / e2.to_f, 1].min
gw = width * [e1.to_f / e2.to_f, 1].min
r = gc2.red * rate
g = (gc2.green - 72) * rate
b = gc2.blue * rate
a = gc2.alpha
w = vertical ? 6 : width; h = vertical ? width : 6
PARSLANT ? self.contents.cogwheel_fill_slant(x, y + WLH - 8, gw, w, h, gc1, Color.new(r, g, b, a), vertical) :
self.contents.cogwheel_fill_rect(x, y + WLH - 8, gw, w, h, gc1, Color.new(r, g, b, a), vertical)
end
#--------------------------------------------------------------------------
# * Draw Custom gauge
# value : bar calculation value
# max : bar max value
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# color1 : bar gradient color 1
# color2 : bar gradient color 2
# width : Width
# height : Height
# slanted : draw slanted bar
# vertical : draw bar vertically
#--------------------------------------------------------------------------
def draw_custom_gauge(value, max, x, y, color1, color2, width=120, height=6, slanted = false, vertical = false)
rate = [value.to_f / max.to_f, 1].min
gw = width * [value.to_f / max.to_f, 1].min
gc1 = color1.is_a?(Integer) ? text_color(color1) : color1
gc2 = color2.is_a?(Integer) ? text_color(color2) : color2
r = gc2.red * rate
g = (gc2.green - 72) * rate
b = gc2.blue * rate
a = gc2.alpha
w = vertical ? 6 : width; h = vertical ? width : 6
slanted ? self.contents.cogwheel_fill_slant(x, y + WLH - 8, gw, w, h, gc1, Color.new(r, g, b, a), vertical) :
self.contents.cogwheel_fill_rect(x, y + WLH - 8, gw, w, h, gc1, Color.new(r, g, b, a), vertical)
end
#--------------------------------------------------------------------------
# * Draw Limit Break gauge
# vertical : draw bar vertically
#--------------------------------------------------------------------------
def draw_actor_lb(actor, x, y, width = 120, vertical = false)
return unless actor.lb_gauge_visible?
st1 = lb_gauge_normal_start_color; st2 = lb_gauge_max_start_color
ed1 = lb_gauge_normal_end_color; ed2 = lb_gauge_max_end_color
rate = actor.limitbreak.to_f / [LB_MAX, 1].max
gw = width * actor.limitbreak / LB_MAX
gc1 = (gw == width ? st2 : Color.new(st1.red,st1.green-(10*rate),st1.blue-(10*rate), 192))
gc2 = (gw == width ? ed2 : Color.new(ed1.red,ed1.green-(10*rate),ed1.blue-(10*rate), 192))
w = vertical ? 6 : width; h = vertical ? width : 6
DVVLBSLANT ? self.contents.cogwheel_fill_slant(x, y + WLH - 8, gw, w, h, gc1, gc2, vertical) :
self.contents.cogwheel_fill_rect(x, y + WLH - 8, gw, w, h, gc1, gc2, vertical)
end
#--------------------------------------------------------------------------
# * Draw HP gauge ring
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# radius : distance from center point
# height : Height
# amount : size of ring - default 360�
# start : start position - max 360�
# reverse : draw ring in reverse
#--------------------------------------------------------------------------
def draw_actor_hp_ring(actor, x, y, radius, height, amount = 360, start = 0, reverse = false)
$rate = actor.hp.to_f / actor.maxhp
gw = amount * actor.hp / actor.maxhp
self.contents.cogwheel_fill_ring(x, y, gw, radius, height, BAR::hpcolor1, BAR::hpcolor2, amount, start, reverse)
end
#--------------------------------------------------------------------------
# * Draw MP gauge ring
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# radius : distance from center point
# height : Height
# amount : size of ring - default 360�
# start : start position - max 360�
# reverse : draw ring in reverse
#--------------------------------------------------------------------------
def draw_actor_mp_ring(actor, x, y, radius, height, amount = 360, start = 0, reverse = false)
$rate = actor.mp.to_f / [actor.maxmp, 1].max
gw = amount * actor.mp / [actor.maxmp, 1].max
self.contents.cogwheel_fill_ring(x, y, gw, radius, height, BAR::mpcolor1, BAR::mpcolor2, amount, start, reverse)
end
#--------------------------------------------------------------------------
# * Draw Exp gauge ring
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# radius : distance from center point
# height : Height
# amount : size of ring - default 360�
# start : start position - max 360�
# reverse : draw ring in reverse
#--------------------------------------------------------------------------
def draw_actor_exp_ring(actor, x, y, radius, height, amount = 360, start = 0, reverse = false)
$rate = actor.now_exp.to_f / [actor.next_exp, 1].max
gw = amount * actor.now_exp / [actor.next_exp, 1].max
self.contents.cogwheel_fill_ring(x, y, gw, radius, height, BAR::expcolor1, BAR::expcolor2, amount, start, reverse)
end
#--------------------------------------------------------------------------
# * Draw Custom gauge ring
# value : bar calculation value
# max : bar max value
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# color1 : bar gradient color 1
# color2 : bar gradient color 2
# radius : distance from center point
# height : Height
# amount : size of ring - default 360�
# start : start position - max 360�
# reverse : draw ring in reverse
#--------------------------------------------------------------------------
def draw_custom_ring(value, max, x, y, color1, color2, radius, height, amount = 360, start = 0, reverse = false)
rate = [value.to_f / max.to_f, 1].min
gw = amount * [value.to_f / max.to_f, 1].min
gc1 = color1.is_a?(Integer) ? text_color(color1) : color1
gc2 = color2.is_a?(Integer) ? text_color(color2) : color2
r = gc2.red * rate
g = (gc2.green - 72) * rate
b = gc2.blue * rate
a = gc2.alpha
self.contents.cogwheel_fill_ring(x, y, gw, radius, height, gc1, Color.new(r, g, b, a), amount, start, reverse)
end
#--------------------------------------------------------------------------
# * Draw HP
# hide_bar : draw Parameters without gauge
#--------------------------------------------------------------------------
def draw_actor_hp(actor, x, y, width = 120, hide_bar = false)
hide_bar ? nil : draw_actor_hp_gauge(actor, x, y, width)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 30, WLH, Vocab::hp_a)
self.contents.font.color = hp_color(actor)
last_font_size = self.contents.font.size
xr = x + width
if width < 120
self.contents.draw_text(xr - 44, y, 44, WLH, actor.hp, 2)
else
self.contents.draw_text(xr - 99, y, 44, WLH, actor.hp, 2)
self.contents.font.color = normal_color
self.contents.draw_text(xr - 55, y, 11, WLH, "/", 2)
self.contents.draw_text(xr - 44, y, 44, WLH, actor.maxhp, 2)
end
end
#--------------------------------------------------------------------------
# * Draw MP
# hide_bar : draw Parameters without gauge
#--------------------------------------------------------------------------
def draw_actor_mp(actor, x, y, width = 120, hide_bar = false)
hide_bar ? nil : draw_actor_mp_gauge(actor, x, y, width)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 30, WLH, Vocab::mp_a)
self.contents.font.color = mp_color(actor)
last_font_size = self.contents.font.size
xr = x + width
if width < 120
self.contents.draw_text(xr - 44, y, 44, WLH, actor.mp, 2)
else
self.contents.draw_text(xr - 99, y, 44, WLH, actor.mp, 2)
self.contents.font.color = normal_color
self.contents.draw_text(xr - 55, y, 11, WLH, "/", 2)
self.contents.draw_text(xr - 44, y, 44, WLH, actor.maxmp, 2)
end
end
#--------------------------------------------------------------------------
# * Draw Exp
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# width : Width
# hide_bar : draw Parameters without gauge
#--------------------------------------------------------------------------
def draw_actor_exp(actor, x, y, width = 170, hide_bar = false)
hide_bar ? nil : draw_actor_exp_gauge(actor, x, y, width)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 45, WLH, "Exp")
self.contents.font.color = normal_color
xr = x + width
if width < 170
self.contents.draw_text(xr - 60, y, 60, WLH, actor.next_rest_exp_s, 2)
else
self.contents.draw_text(xr - 131, y, 60, WLH, actor.exp_s, 2)
self.contents.draw_text(xr - 71, y, 11, WLH, "/", 2)
self.contents.draw_text(xr - 60, y, 60, WLH, actor.next_exp_s, 2)
end
end
end
#==============================================================================
# ** Window_SkillStatus
#------------------------------------------------------------------------------
# Edited so te Bars don't cut off
#==============================================================================
class Window_SkillStatus < Window_Base
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
draw_actor_name(@actor, 4, 0)
draw_actor_level(@actor, 140, 0)
draw_actor_hp(@actor, 238, 0)
draw_actor_mp(@actor, 390, 0)
end
end
#==============================================================================
# ** Bitmap
#------------------------------------------------------------------------------
# Added gauge Calculations
#==============================================================================
class Bitmap
#--------------------------------------------------------------------------
# * Includes The BAR Module
#--------------------------------------------------------------------------
include BAR
#--------------------------------------------------------------------------
# * Wortana's 'gradient_fill_rect' Bug Fix
#--------------------------------------------------------------------------
alias gradient_original gradient_fill_rect unless method_defined?('gradient_original')
def gradient_fill_rect(*args)
args.pop if !args.last if args.size == 4 || 7 and !args.last
gradient_original(*args)
end
#--------------------------------------------------------------------------
# * CogWheel Style Fill of Rect
#--------------------------------------------------------------------------
def cogwheel_fill_rect(x, y, gw, width, height, gc1, gc2, up = false)
rect_border(x-2, y-2, width+4, height+4, COLOR1, CORNER)
rect_border(x-1, y-1, width+2, height+2, COLOR2, CORNER)
gradient_fill_rect(x, y, width, height, COLOR3, COLOR4, EMPTY)
gradient_fill_rect(x, y, up ? width : gw, up ? gw : height, gc1, gc2, FILLER)
end
#--------------------------------------------------------------------------
# * CogWheel Style Fill of Slanted Rect
#--------------------------------------------------------------------------
def cogwheel_fill_slant(x, y, gw, width, height, gc1, gc2, up = false)
bgx = up ? 2 : 4; bdx = up ? 1 : 2
bgy = up ? 4 : 2; bdy = up ? 2 : 1
bgw = up ? 4 : 8; bdw = up ? 2 : 4
bgh = up ? 8 : 4; bdh = up ? 4 : 2
slant_border(x-bgx, y-bgy, width+bgw, height+bgh, COLOR1, up)
slant_border(x-bdx, y-bdy, width+bdw, height+bdh, COLOR2, up)
gradient_fill_slant(x, y, width, height, COLOR3, COLOR4, EMPTY, up)
gradient_fill_slant(x, y,up ? width : gw,up ? gw : height, gc1, gc2, FILLER, up)
end
#--------------------------------------------------------------------------
# * CogWheel Style Fill of Ring
#--------------------------------------------------------------------------
def cogwheel_fill_ring(x, y, gw, radius, height, gc1, gc2, amount = 360, start = 0, reverse = false)
fill_ring(x-2, y-2, radius, height+4, COLOR1, amount, start, reverse)
fill_ring(x-1, y-1, radius, height+2, COLOR2, amount, start, reverse)
if amount >= 220
gradient_fill_ring(x, y, radius, height, COLOR3, COLOR4, [amount/2, 180].min, start, reverse)
gradient_fill_ring(x, y, radius, height, COLOR4, COLOR3, [amount/2, 180].min, start+(amount/2), reverse)
else
gradient_fill_ring(x, y, radius, height, COLOR3, COLOR4, [amount, 360].min, start, reverse)
end
if gw >= 220
gw1 = amount/2; gw2 = gw / 2
gradient_fill_ring(x, y, radius, height, gc1, gc2, gw1, start, reverse)
gradient_fill_ring(x, y, radius, height, gc2, gc1, gw2, start +(amount/2), reverse)
else
gradient_fill_ring(x, y, radius, height, gc1, gc2, gw, start, reverse)
end
end
#--------------------------------------------------------------------------
# * Fill of Border
#--------------------------------------------------------------------------
def rect_border(x, y, width, height, gc1, edge = false)
fill_rect(x + (edge ? 1 : 0), y, width - (edge ? 2 : 0), 2, gc1)
fill_rect(x + (edge ? 1 : 0), y+(height-2), width - (edge ? 2 : 0), 2, gc1)
fill_rect(x, y+1, 2, height-2, gc1)
fill_rect(x +(width-2), y+1, 2, height-2, gc1)
end
#--------------------------------------------------------------------------
# * Gradient Fill of Slanted Rect
#--------------------------------------------------------------------------
def gradient_fill_slant(x, y, width, height, gc1, gc2, vertical = false, up = false)
if up
for i in 1..width
if vertical
gradient_fill_rect(x + width - i, y+i+1, 1, (height-2)-width, gc1, gc2, vertical)
else
color = get_gradient_pixel(gc1, gc2, width, i)
fill_rect(x + width - i, y+i+1, 1, (height-2)-width, color)
end
end
else
for i in 1..height
if vertical
color = get_gradient_pixel(gc1, gc2, height, i)
fill_rect(x+i+1, y + height - i, (width-2)-height, 1, color)
else
gradient_fill_rect(x+i+1, y + height - i, (width-2)-height, 1, gc1, gc2)
end
end
end
end
#--------------------------------------------------------------------------
# * Fill of Slanted Rect
#--------------------------------------------------------------------------
def fill_slant(x, y, width, height, gc1, up = false)
oh = up ? width : height
for i in 1..oh
if up
fill_rect(x + width -i, y+i, 1, height-width, gc1)
else
fill_rect(x+i, y + height -i, width-height, 1, gc1)
end
end
end
#--------------------------------------------------------------------------
# * Fill of Slanted Border
#--------------------------------------------------------------------------
def slant_border(x, y, width, height, gc1, up = false)
oh = up ? width : height
for i in 1..oh-2
if up
fill_rect(x + width-1 -i, y+((height-1)-width)+i, 1, 2, gc1)
fill_rect(x + width-1 -i, y+1+i, 1, 2, gc1)
fill_rect(x + width-1, y+1, 1, height-width, gc1)
fill_rect(x, y+width, 1, height-width, gc1)
else
fill_rect(x+((width-1)-height)+i, y + height-1 -i, 2, 1, gc1)
fill_rect(x+1+i, y + height-1 -i, 2, 1, gc1)
fill_rect(x+1, y + height -1, width-height, 1, gc1)
fill_rect(x+height, y, width-height, 1, gc1)
end
end
end
#--------------------------------------------------------------------------
# * Fill of Ring
#--------------------------------------------------------------------------
def fill_ring(ox, oy, radius, height, gc1, amount = 360, start = 0, reverse = false)
d = 2.0 * Math::PI / 360
for i in 1..[amount, 360].min
s = i + start
if reverse
x = ox + ( radius * Math.sin( d * s ) ).to_i
y = oy - ( radius * Math.cos( d * s ) ).to_i
else
x = ox - ( radius * Math.cos( d * s ) ).to_i
y = oy + ( radius * Math.sin( d * s ) ).to_i
end
fill_rect(x, y, height, height, gc1)
end
end
#--------------------------------------------------------------------------
# * Gradient Fill of Ring
#--------------------------------------------------------------------------
def gradient_fill_ring(ox, oy, radius, height, gc1, gc2, amount = 360, start = 0, reverse = false)
d = 2.0 * Math::PI / 360
for i in 1..amount
s = i + start
if reverse
x = ox + ( radius * Math.sin( d * s ) ).to_i
y = oy - ( radius * Math.cos( d * s ) ).to_i
else
x = ox - ( radius * Math.cos( d * s ) ).to_i
y = oy + ( radius * Math.sin( d * s ) ).to_i
end
color = get_gradient_pixel(gc1, gc2, amount, i)
fill_rect(x, y, height, height, color)
end
end
#--------------------------------------------------------------------------
# * Get Pixel Color for Gradient Fill
#--------------------------------------------------------------------------
def get_gradient_pixel(gc1, gc2, amount, i)
red = gc1.red * (amount - i) / amount + gc2.red * i / amount
green = gc1.green * (amount - i) / amount + gc2.green * i / amount
blue = gc1.blue * (amount - i) / amount + gc2.blue * i / amount
alpha = gc1.alpha * (amount - i) / amount + gc2.alpha * i / amount
return Color.new(red, green, blue, alpha)
end
end
Użycie:(dzięki Ayene)
By paski HP i MP przedstawić w formie pierścieni otwórz Window_status i znajdź:
Dla HP:
Wertuję anglojęzyczne strony o makerze i wrzucam co ciekawsze, przetłumaczone skrypty
Mam w zanadrzu jeden potężny system czasu (pogoda zależna od pór roku, dni, miesiące, lata, bonus do walki w dzień...), ale nie chce mi się tłumaczyć na razie
________________________
"Na trolla pewne są tylko dwie pewne metody, jedna samopowtarzalna i druga, wymagająca przeładowania ręcznego."
Pomógł: 3 razy Dołączył: 22 Gru 2009 Posty: 262 Skąd: Warszawa
Wysłany: Czw 30 Cze, 2011 08:59
Yhm... Jak tak patrzę to mam nadzieję że z tymi paskami na dole też się da tak zrobić. ;)
Czy jest może taki skrypt na XP czy będzie trzeba samemu tłumaczyć?
PS. Przy przerobieniu skrypt mógłby się nadawać do gier w którym duże znaczenie ma magia i alchemia, ale nie wiem czy da się tak skrypt edytować, na takie... Hmm... Naczynia do mikstur. ;/
No oczywiście jak kto chce, byle by przerabianie go wyszło. :P
Ten skrypt daje spore pole do popisu skrypterom. Wszelkie HUDy, paski statusu, głodu, czego dusza zapragnie są możliwe. Podejrzewam, że probówki wypełniające się czymśtam również są możliwe do zrobienia
________________________
"Na trolla pewne są tylko dwie pewne metody, jedna samopowtarzalna i druga, wymagająca przeładowania ręcznego."
Pomógł: 3 razy Dołączył: 22 Gru 2009 Posty: 262 Skąd: Warszawa
Wysłany: Czw 30 Cze, 2011 15:23
Oczywiście, tylko najpierw trzeba skonstruować... Jak będę miał czas to się zajmę mniejwięcej przepisywaniem tego skryptu do XP... Ale kiedy to nastąpi. :I
Wertuję anglojęzyczne strony o makerze i wrzucam co ciekawsze, przetłumaczone skrypty
Mam w zanadrzu jeden potężny system czasu (pogoda zależna od pór roku, dni, miesiące, lata, bonus do walki w dzień...), ale nie chce mi się tłumaczyć na razie
Gdzieś widziałem ten skrypt ,ale się mi też nie chciało tłumaczyć.
Hmm... Może w... Konfiguracji? Coś mi się zdaje, że z taką nazwą powinno dać się coś zrobić. W końcu konfiguracja od konfigurowania, czyli że coś zmienić można...
Kod:
def self::hpcolor1 # HP Guage Color1
return Color.new(80 - 24 * $rate, 80 * $rate, 14 * $rate, 192)
end
def self::hpcolor2 # HP Guage Color2
return Color.new(240 - 72 * $rate, 240 * $rate, 62 * $rate, 192)
end
________________________
"Na trolla pewne są tylko dwie pewne metody, jedna samopowtarzalna i druga, wymagająca przeładowania ręcznego."
Pomógł: 26 razy Dołączył: 25 Wrz 2011 Posty: 236 Skąd: ty się tu wziąłeś?
Wysłany: Sob 19 Lis, 2011 07:57
Sorry za odkop ,ale mam kilka problemów.
Pierwszy to taki,że okręgi nachodzą na paski statusów.Da się to jakoś rozwiązać?
Drugi to taki,że w mojej grze zazwyczaj statystyk nie ma po 200,330 itd,tylko 30,50 itd.Problem polega na tym,że w ogóle nie widać pasków,gdy jest,dajmy na to,10.Czy jest możliwość naprawienia tego?
Nie możesz pisać nowych tematów Nie możesz odpowiadać w tematach Nie możesz zmieniać swoich postów Nie możesz usuwać swoich postów Nie możesz głosować w ankietach Nie możesz załączać plików na tym forum Możesz ściągać załączniki na tym forum