Pomogła: 232 razy Dołączyła: 18 Wrz 2007 Posty: 2424
Wysłany: Nie 11 Paź, 2009 21:31
Rozszerzone okno statusu
~ Rozszerzone okno statusu ~
Krótki opis
Skrypt dodaje w menu rozszerzone okno statusu (patrz screenshot)
Autor skryptu
KGC
Tłumaczenie i przeróbki
Ayene [yurika@o2.pl]
Kompatybilność
Tylko VX.
UWAGA!!! Do prawidłowego działania wymagane jest umieszczenie w projekcie gry dodatkowego skryptu rozszerzającego możliwości graficzne RPG Makera oraz umieszczenie w folderze z grą biblioteki 'TRGSSX.dll'. Dodatki dostępne są tutaj
Skrypt
Spoiler:
Kod:
# ==========================================================
# ~ Rozszerzone okno statusu ~
# Data publikacji: 11.10.2009
# Autor: KGC
# Tłumaczenie i poprawki: Ayene [yurika@o2.pl]
# Zapraszam na stronę UltimaForum - http://www.ultimateam.pl
# ==========================================================
# Instalacja: Umieść ten skrypt nad Main w Edytorze Skryptu.
# Do poprawnego działania wymagane jest umieszczenie w projekcie gry skryptu
# Bitmapa (by KGC). Skrypt dostępny jest na stronie www.ultimateam.pl
# ==========================================================
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# --------------------------- POCZĄTEK SKRYPTU ---------------------------------
$data_states = load_data("Data/States.rvdata") if $data_states == nil
$data_system = load_data("Data/System.rvdata") if $data_system == nil
module KGC
module ExtendedStatusScene
# ---------------------------- POCZĄTEK EDYCJI ---------------------------------
# Tekst w profilu
PROFILE = []
# W tym miejscu można wpisać tekst, który ma się wyświetlać w profilu.
# Poniższy fragment skryptu należy wypełnić według wzoru:
# PROFILE[ID] = 'Tekst w Profilu'
# Dozwolone jest formatownie tekstu - zmiana koloru (\C[numer]
# Wyświetlanie imienia bohatera - \N[ID]
# Przejście do następnej linijki - \|
PROFILE[1] =
'Name: \N[1]\|' +
'\|' +
'\C[2]Skrypt wyświetla rozszerzony status bohatera\C[0]\|' +
'\|' +
'www.ultimateam.pl'
PROFILE[2] =
'Name: \N[1]\|' +
'\C[2]Wpisz co chcesz\C[0]\|' +
'\|' +
'Tutaj wpisz informacje o bohaterze z ID 1 \|' +
'To jest kolejna linijka tekstu'
# Styl wyświetlania odporności
# 0 .. Układ graficzny
# 1 .. Wykaz procentowy
# 2 .. Układ graficzny i wykaz procentowy
RESIST_STYLE = 2
# Styl wykazu procentowego
# 0 .. wykazuje procentowo szansę uzyskania przez bohatera konkretnego stanu
# np. jeśli bohater w bazie danych ma ustawioną odporność na status 'śmierć'
# i ma ona wartość A, oznacza to, że bohater ma 100% szansy na jego uzyskanie.
# 1 .. wykazuje procentowo szansę obrony przed konkretnym statusem
# np. jeśli bohater w bazie danych ma ustawioną odporność na status 'śmierć'
# i ma ona wartość A, oznacza to, że bohater ma 0% szansy na obronę przed nim.
RESIST_NUM_STYLE = 1
# Zakres statusów/odporności
# od 1 do tylu ile jest w bazie danych
STATE_RANGE = [1...$data_states.size]
# ----------------------------- KONIEC EDYCJI ----------------------------------
end
end
# -----------NIE EDYTUJ PONIŻEJ, CHYBA ŻE WIESZ CO ROBISZ ^^--------------------
$imported = {} if $imported == nil
$imported["ExtendedStatusScene"] = true
module KGC::ExtendedStatusScene
module_function
#--------------------------------------------------------------------------
# - Konwertowanie zasięgu na liczbę
#--------------------------------------------------------------------------
def convert_integer_array(array, type = nil)
result = []
array.each { |i|
case i
when Range
result |= i.to_a
when Integer
result |= [i]
end
}
case type
when :element
result.delete_if { |x| x >= $data_system.elements.size }
when :state
result.delete_if { |x|
x >= $data_states.size ||
$data_states[x].nonresistance ||
$data_states[x].priority == 0
}
end
return result
end
# Sprawdzanie listy atrybutów
CHECK_ELEMENT_LIST = convert_integer_array(ELEMENT_RANGE, :element)
# Sprawdzanie listy statusów
CHECK_STATE_LIST = convert_integer_array(STATE_RANGE, :state)
# Styl wyświetlania
case RESIST_STYLE
when 0
RESIST_STYLE_SYMBOL = :num
when 1
RESIST_STYLE_SYMBOL = :chart
else
RESIST_STYLE_SYMBOL = :both
end
end
#=========================================================
# Window_StatusCommand
#------------------------------------------------------------------------------
# Dodanie nowych opcji do okna statusu
#=========================================================
class Window_StatusCommand < Window_Command
#--------------------------------------------------------------------------
# - Rozpoczęcie
#--------------------------------------------------------------------------
def initialize
commands = []
KGC::ExtendedStatusScene::COMMANDS.each { |c|
commands << KGC::ExtendedStatusScene::COMMAND_NAME[c]
}
super(160, commands)
self.height = WLH * 5 + 32
self.active = true
end
#--------------------------------------------------------------------------
# - Dodanie nowych komend
#--------------------------------------------------------------------------
def command
return KGC::ExtendedStatusScene::COMMANDS[index]
end
#--------------------------------------------------------------------------
# - Nstępna strona
#--------------------------------------------------------------------------
def cursor_pagedown
return if Input.repeat?(Input::R)
super
end
#--------------------------------------------------------------------------
# - Poprzednia strona
#--------------------------------------------------------------------------
def cursor_pageup
return if Input.repeat?(Input::L)
super
end
end
unless $imported["GenericGauge"]
self.contents.draw_text(x, y + WLH * 0, 240, WLH, s1, 2)
self.contents.draw_text(x, y + WLH * 1, 240, WLH, s2, 2)
end
end
end
#=========================================================
# Window_StatusDetail
#------------------------------------------------------------------------------
# Dodanie okna wyświetlającego szczegółowe informacje o bohaterze.
#=========================================================
@state_chart_sprite = Sprite_Base.new
@state_chart_sprite.bitmap = Bitmap.new(height - 32, height - 32)
@state_chart_sprite.ox = @state_chart_sprite.width / 2
@state_chart_sprite.oy = @state_chart_sprite.height / 2
@state_chart_sprite.blend_type = 1
@state_chart_sprite.opacity = 0
@state_chart_sprite.visible = false
end
#--------------------------------------------------------------------------
# - Zamknięcie
#--------------------------------------------------------------------------
def dispose
@element_chart_sprite.bitmap.dispose
@element_chart_sprite.dispose
@state_chart_sprite.bitmap.dispose
@state_chart_sprite.dispose
super
end
#--------------------------------------------------------------------------
# - Wartość Z
#--------------------------------------------------------------------------
def z=(value)
super(value)
@element_chart_sprite.z = z + 1 if @element_chart_sprite != nil
@state_chart_sprite.z = z + 1 if @state_chart_sprite != nil
end
#--------------------------------------------------------------------------
# - Kategorie
#--------------------------------------------------------------------------
def category=(category)
return if @category == category
@category = category
refresh
end
#--------------------------------------------------------------------------
# - Odświeżanie
#--------------------------------------------------------------------------
def refresh
@element_chart_sprite.visible = false
@state_chart_sprite.visible = false
return if @category == nil
self.contents.clear
case @category
when :param
draw_parameter_list
when :resist
draw_resistance
when :element_resist
draw_element_resistance(0, 0,
KGC::ExtendedStatusScene::RESIST_STYLE_SYMBOL)
when :state_resist
draw_state_resistance(0, 0,
KGC::ExtendedStatusScene::RESIST_STYLE_SYMBOL)
when :profile
draw_profile
end
Graphics.frame_reset
end
#--------------------------------------------------------------------------
# - Tworzenie listy parametrów
#--------------------------------------------------------------------------
def draw_parameter_list
y = 0
KGC::ExtendedStatusScene::PARAMS.each { |param|
draw_parameter(param, 0, y)
y += WLH
}
x = 192
contents.font.color = system_color
contents.draw_text(x, 0, 120, WLH, Vocab::equip)
@actor.equips.each_with_index { |item, i|
draw_item_name(item, x, WLH * (i + 1))
}
contents.font.color = normal_color
end
#--------------------------------------------------------------------------
# - Tworzenie parametrów
#--------------------------------------------------------------------------
def draw_parameter(param, x, y)
case param
when :atk
draw_actor_parameter(@actor, x, y, 0)
when :def
draw_actor_parameter(@actor, x, y, 1)
when :spi
draw_actor_parameter(@actor, x, y, 2)
when :agi
draw_actor_parameter(@actor, x, y, 3)
when :hit
draw_actor_parameter(@actor, x, y, 4)
when :eva
draw_actor_parameter(@actor, x, y, 5)
when :cri
draw_actor_parameter(@actor, x, y, 6)
when :cp
return unless $imported["SkillCPSystem"]
return unless KGC::SkillCPSystem::SHOW_STATUS_CP
draw_actor_cp(@actor, x, y, 156)
when :ep
return unless $imported["EquipExtension"]
return unless KGC::EquipExtension::SHOW_STATUS_EP
draw_actor_ep(@actor, x, y, 156)
end
end
#--------------------------------------------------------------------------
# - Tworzenie parametrów bohatera
#--------------------------------------------------------------------------
def draw_actor_parameter(actor, x, y, type)
return super(actor, x, y, type) if type <= 3
names = KGC::ExtendedStatusScene::PARAMETER_NAME
case type
when 4
parameter_name = names[:hit]
parameter_value = actor.hit
when 5
parameter_name = names[:eva]
parameter_value = actor.eva
when 6
parameter_name = names[:cri]
parameter_value = actor.cri
end
self.contents.font.color = system_color
self.contents.draw_text(x, y, 120, WLH, parameter_name)
self.contents.font.color = normal_color
self.contents.draw_text(x + 120, y, 36, WLH, parameter_value, 2)
end
#--------------------------------------------------------------------------
# - Tworzenie odporności
#--------------------------------------------------------------------------
def draw_resistance
case KGC::ExtendedStatusScene::RESIST_STYLE
when 0
type = :num
else
type = :chart
end
x = 0
contents.font.color = system_color
contents.draw_text(x, 0, 120, WLH,
KGC::ExtendedStatusScene::PARAMETER_NAME[:element_resist])
contents.font.color = normal_color
x = draw_element_resistance(x, WLH, type)
contents.font.color = normal_color
end
#--------------------------------------------------------------------------
# - Tworzenie odporności na atrybuty
#--------------------------------------------------------------------------
def draw_element_resistance(x, y, type)
if KGC::ExtendedStatusScene::CHART_HIGHQUALITY
Bitmap.smoothing_mode = TRGSSX::SM_ANTIALIAS
end
if [:chart, :both].include?(type) && $imported["BitmapExtension"]
x = draw_element_resistance_chart(x, y)
@element_chart_sprite.visible = true
end
if [:num, :both].include?(type)
x = draw_element_resistance_num(x, y)
end
Bitmap.smoothing_mode = TRGSSX::SM_DEFAULT
return x
end
#--------------------------------------------------------------------------
# - Tworzenie wykresu odporności na atrybuty
#--------------------------------------------------------------------------
def draw_element_resistance_chart(x, y)
r = (contents.height - y - 56) / 2
cx = x + r + 28
cy = y + r + 28
pw = (Bitmap.smoothing_mode == TRGSSX::SM_ANTIALIAS ? 2 : 1)
elements = KGC::ExtendedStatusScene::CHECK_ELEMENT_LIST
draw_chart_line(cx, cy, r, elements.size, 3, pw)
# wykres
points = []
elements.each_with_index { |e, i|
n = @actor.element_rate(e)
n = 100 - n if KGC::ExtendedStatusScene::RESIST_NUM_STYLE == 1
n = [[n, -100].max, 200].min
dr = r * (n + 100) / 100 / 3
rad = Math::PI * (360.0 * i / elements.size - 90.0) / 180.0
dx = cx + Integer(dr * Math.cos(-rad))
dy = cy + Integer(dr * Math.sin(rad))
points << [dx, dy]
return (x + cx + r + 42)
end
#--------------------------------------------------------------------------
# - Tworzenie wykazu procentowego odporności na atrybuty
#--------------------------------------------------------------------------
def draw_element_resistance_num(x, y)
origin_y = y
contents.font.color = normal_color
KGC::ExtendedStatusScene::CHECK_ELEMENT_LIST.each { |i|
if y + WLH > contents.height
x += 84
y = origin_y
end
draw_icon(KGC::ExtendedStatusScene::ELEMENT_ICON[i], x, y)
n = @actor.element_rate(i)
n = 100 - n if KGC::ExtendedStatusScene::RESIST_NUM_STYLE == 1
rate = sprintf("%4d%%", n)
contents.draw_text(x + 24, y, 52, WLH, rate, 2)
y += WLH
}
return (x + 96)
end
#--------------------------------------------------------------------------
# - Tworzenie odporności na statusy
#--------------------------------------------------------------------------
def draw_state_resistance(x, y, type)
if KGC::ExtendedStatusScene::CHART_HIGHQUALITY
Bitmap.smoothing_mode = TRGSSX::SM_ANTIALIAS
end
if [:chart, :both].include?(type) && $imported["BitmapExtension"]
x = draw_state_resistance_chart(x, y)
@state_chart_sprite.visible = true
end
if [:num, :both].include?(type)
x = draw_state_resistance_num(x, y)
end
Bitmap.smoothing_mode = TRGSSX::SM_DEFAULT
return x
end
#--------------------------------------------------------------------------
# - Tworzenie wykresu odporności na statusy
#--------------------------------------------------------------------------
def draw_state_resistance_chart(x, y)
r = (contents.height - y - 56) / 2
cx = x + r + 28
cy = y + r + 28
pw = (Bitmap.smoothing_mode == TRGSSX::SM_ANTIALIAS ? 2 : 1)
states = KGC::ExtendedStatusScene::CHECK_STATE_LIST
draw_chart_line(cx, cy, r, states.size, 2, pw)
# wykres
points = []
states.each_with_index { |s, i|
state = $data_states[s]
n = @actor.state_probability(s)
n = 100 - n if KGC::ExtendedStatusScene::RESIST_NUM_STYLE == 1
dr = r * n / 100
rad = Math::PI * (360.0 * i / states.size - 90.0) / 180.0
dx = cx + Integer(dr * Math.cos(-rad))
dy = cy + Integer(dr * Math.sin(rad))
points << [dx, dy]
Znalazłem problem. Ten skrypt nie działa z skryptem rozszerzenia ekwipunku http://www.ultimateam.pl/viewtopic.php?t=2171 . Gdy nie ma rozszerzenia ekwipunku wszystko działa a jak wgram rozszerzenie ekwipunku już nie działa. Da radę zrobić żeby one oba razem działały?
Mam błąd!
Co zrobić, aby zamiast profil tam pisało bohater, i zamiast atrybuty to umiejętności? Bo jak zmieniam w skrypcie to zaraz po otworzeniu projektu wyskakuje to:
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