# Script per avere fino a 8 personaggi nel gruppo V 3.0
# Codice creato da Tio con l'aiuto di Alato
# Per domande o informazioni visitate www.rpgshrine.altervista.org
# Si ringrazia www.phylomortis.com da cui è stato preso lo script per riordinare i personaggi
# ==========
class Game_Party
def add_actor(actor_id)
# Acquisizione Eroe
actor = $game_actors[actor_id]
# Quando ci sono meno di 4 eroi e l'eroe non è già nel gruppo
if @actors.size < 8 and not @actors.include?(actor)
# Aggiungi Eroe
@actors.push(actor)
# Aggiornamento Giocatore
$game_player.refresh
end
end
end
class Window_Base < Window
#--------------------------------------------------------------------------
# - Disegna il nome
# actor : Personaggio
# x : Posizione del disegno: Coordinate X
# y : Posizione del disegno: Coordinate Y
#--------------------------------------------------------------------------
def draw_actor_name(actor, x, y)
self.contents.font.name = "Arial"
self.contents.font.size = 20
self.contents.font.color = system_color
self.contents.draw_text(x, y, 120, 32, actor.name)
end
#--------------------------------------------------------------------------
# - Disegna la classe
# actor : Personaggio
# x : Posizione del disegno: Coordinate X
# y : Posizione del disegno: Coordinate Y
#--------------------------------------------------------------------------
def draw_actor_class(actor, x, y)
self.contents.font.name = "Arial"
self.contents.font.size = 20
self.contents.font.color = normal_color
self.contents.draw_text(x, y, 236, 32, actor.class_name)
end
#--------------------------------------------------------------------------
# - Disegna il livello
# actor : Personaggio
# x : Posizione del disegno: Coordinate X
# y : Posizione del disegno: Coordinate Y
#--------------------------------------------------------------------------
def draw_actor_level(actor, x, y)
self.contents.font.name = "Arial"
self.contents.font.size = 20
self.contents.font.color = system_color
self.contents.draw_text(x, y, 32, 32, "Lv")
self.contents.font.color = normal_color
self.contents.draw_text(x + 32, y, 24, 32, actor.level.to_s, 2)
end
#--------------------------------------------------------------------------
# - Disegna lo stato
# actor : Personaggio
# x : Posizione del disegno: Coordinate X
# y : Posizione del disegno: Coordinate Y
# width : Ampiezza del disegno
#--------------------------------------------------------------------------
def draw_actor_state(actor, x, y, width = 120)
text = make_battler_state_text(actor, width, true)
self.contents.font.name = "Arial"
self.contents.font.size = 20
self.contents.font.color = actor.hp == 0 ? knockout_color : normal_color
self.contents.draw_text(x, y, width, 32, text)
end
#--------------------------------------------------------------------------
# - Disegna i punti EXP
# actor : Personaggio
# x : Posizione del disegno: Coordinate X
# y : Posizione del disegno: Coordinate Y
#--------------------------------------------------------------------------
def draw_actor_exp(actor, x, y)
self.contents.font.name = "Arial"
self.contents.font.size = 20
self.contents.font.color = system_color
self.contents.draw_text(x, y, 40, 32, "EXP")
self.contents.font.color = normal_color
self.contents.draw_text(x + 40, y, 84, 32, actor.exp_s, 2)
self.contents.draw_text(x + 124, y, 12, 32, "/", 1)
self.contents.draw_text(x + 136, y, 84, 32, actor.next_exp_s)
end
#--------------------------------------------------------------------------
# - Disegna i punti HP
# actor : Personaggio
# x : Posizione del disegno: Coordinate X
# y : Posizione del disegno: Coordinate Y
# width : Ampiezza del disegno
#--------------------------------------------------------------------------
def draw_actor_hp(actor, x, y, width = 144)
# Disegna la sequenza dei caratteri: "HP"
self.contents.font.color = system_color
self.contents.font.name = "Arial"
self.contents.font.size = 20
self.contents.draw_text(x, y, 32, 32, $data_system.words.hp)
# Calcola se c'è qualche spazio che disegna i punti MaxHp
if width - 32 >= 108
hp_x = x + width - 108
flag = true
elsif width - 32 >= 48
hp_x = x + width - 48
flag = false
end
# Disegna i punti HP
self.contents.font.color = actor.hp == 0 ? knockout_color :
actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
self.contents.font.name = "Arial"
self.contents.font.size = 20
self.contents.draw_text(hp_x-20, y, 48, 32, actor.hp.to_s, 2)
# Disegna i punti MaxHP
if flag
self.contents.font.color = normal_color
self.contents.font.name = "Arial"
self.contents.font.size = 20
self.contents.draw_text(hp_x + 48-20, y, 12, 32, "/", 1)
self.contents.draw_text(hp_x + 60-20, y, 48, 32, actor.maxhp.to_s)
end
end
#--------------------------------------------------------------------------
# - Disegna i punti MP
# actor : Personaggio
# x : Posizione del disegno: Coordinate X
# y : Posizione del disegno: Coordinate Y
# width : Ampiezza del disegno
#--------------------------------------------------------------------------
def draw_actor_sp(actor, x, y, width = 144)
# Disegna la sequenza dei caratteri: "MP"
self.contents.font.color = system_color
self.contents.font.name = "Arial"
self.contents.font.size = 20
self.contents.draw_text(x, y, 32, 32, $data_system.words.sp)
# Calcola se c'è qualche spazio che disegna i punti MaxMp
if width - 32 >= 108
sp_x = x + width - 108
flag = true
elsif width - 32 >= 48
sp_x = x + width - 48
flag = false
end
# Disegna i punti MP
self.contents.font.color = actor.sp == 0 ? knockout_color :
actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
self.contents.font.name = "Arial"
self.contents.font.size = 20
self.contents.draw_text(sp_x-20, y, 48, 32, actor.sp.to_s, 2)
# Disegna i punti MaxMP
if flag
self.contents.font.color = normal_color
self.contents.font.name = "Arial"
self.contents.font.size = 20
self.contents.draw_text(sp_x + 48-20, y, 12, 32, "/", 1)
self.contents.draw_text(sp_x + 60-20, y, 48, 32, actor.maxsp.to_s)
end
end
#--------------------------------------------------------------------------
# - Disegna un parametro
# actor : Personaggio
# x : Posizione del disegno: Coordinate X
# y : Posizione del disegno: Coordinate Y
# type : Tipo di parametro (0~6)
#--------------------------------------------------------------------------
def draw_actor_parameter(actor, x, y, type)
case type
when 0
parameter_name = $data_system.words.atk
parameter_value = actor.atk
when 1
parameter_name = $data_system.words.pdef
parameter_value = actor.pdef
when 2
parameter_name = $data_system.words.mdef
parameter_value = actor.mdef
when 3
parameter_name = $data_system.words.str
parameter_value = actor.str
when 4
parameter_name = $data_system.words.dex
parameter_value = actor.dex
when 5
parameter_name = $data_system.words.agi
parameter_value = actor.agi
when 6
parameter_name = $data_system.words.int
parameter_value = actor.int
end
self.contents.font.color = system_color
self.contents.font.name = "Arial"
self.contents.font.size = 20
self.contents.draw_text(x, y, 120, 32, parameter_name)
self.contents.font.color = normal_color
self.contents.font.name = "Arial"
self.contents.font.size = 20
self.contents.draw_text(x + 120, y, 36, 32, parameter_value.to_s, 2)
end
#--------------------------------------------------------------------------
# - Disegna il nome di un oggetto
# item : Oggetto
# x : Posizione del disegno: Coordinate X
# y : Posizione del disegno: Coordinate Y
#--------------------------------------------------------------------------
def draw_item_name(item, x, y)
if item == nil
return
end
bitmap = RPG::Cache.icon(item.icon_name)
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
self.contents.font.color = normal_color
self.contents.font.name = "Arial"
self.contents.font.size = 20
self.contents.draw_text(x + 28, y, 212, 32, item.name)
end
end
class Window_Command < Window_Selectable
#--------------------------------------------------------------------------
# - Disegna un oggetto
# index : Numero dell'oggetto
# color : Colore del personaggio
#--------------------------------------------------------------------------
def draw_item(index, color)
self.contents.font.color = color
self.contents.font.name = "Arial"
self.contents.font.size = 20
rect = Rect.new(4, 32 * index, self.contents.width - 8, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
self.contents.draw_text(rect, @commands[index])
end
end
#====================================================
# ■ Window_Steps
#------------------------------------------------------------------------------
# メニュー画面で歩数を表示するウィンドウです。
#====================================================
class Window_Steps < Window_Base
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize
super(0, 0, 160, 74)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "Arial"
self.contents.font.size = 24
refresh
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.color = system_color
self.contents.draw_text(4, 0, 120, 32, "Passi")
self.contents.font.color = normal_color
self.contents.draw_text(4, 10, 120, 32, $game_party.steps.to_s, 2)
end
end
#====================================================
# - Window_Target
#------------------------------------------------------------------------------
# E' lo schermo degli oggetti e delle abilità ed è la finestra dalla quale
# si sceglie il personaggio da usare
#====================================================
class Window_Target < Window_Selectable
#--------------------------------------------------------------------------
# - Inizializzazione dell'oggetto
#--------------------------------------------------------------------------
def initialize
super(0, 0, 280, 480)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "Arial"
self.contents.font.size = 20
self.z += 10
@item_max = $game_party.actors.size
refresh
end
#--------------------------------------------------------------------------
# - Aggiornamento
#--------------------------------------------------------------------------
def refresh
self.contents.clear
for i in 0...$game_party.actors.size
x = 30
y = i * 55
actor = $game_party.actors[i]
draw_actor_graphic(actor, x - 10, y + 55)
draw_actor_name(actor, x, y)
draw_actor_class(actor, x + 80, y)
draw_actor_level(actor, x + 8, y + 18)
draw_actor_state(actor, x + 8, y + 35)
draw_actor_hp(actor, x + 88, y + 18)
draw_actor_sp(actor, x + 88, y + 35)
end
end
#--------------------------------------------------------------------------
# - Aggiornamento del rettangolo del cursore
#--------------------------------------------------------------------------
def update_cursor_rect
# Posizione del cursore: -1 tutte le selezione e sotto
# -2 sono selezioni indipendenti (l'utente stesso)
if @index <= -6
self.cursor_rect.set(0, (@index + 10) * 55, self.width - 32, 62)#
elsif @index == -5
self.cursor_rect.set(0, 0, self.width - 32, @item_max * 55 - 20)#
else
self.cursor_rect.set(0, @index * 55, self.width - 32, 62)#
end
end
end
#====================================================
# - Window_MenuStatus
#------------------------------------------------------------------------------
# E' la finestra che mostra lo stato di un membro del gruppo nella
# schermata di menù
#====================================================
class Window_MenuStatus < Window_Selectable
#--------------------------------------------------------------------------
# - Inizializzazione dell'oggetto
#--------------------------------------------------------------------------
def initialize
super(0, 0, 480, 480)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
self.active = false
self.index = -1
end
#--------------------------------------------------------------------------
# - Aggiornamento
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.name = "Arial"
self.contents.font.size = 24
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
x = 0
y = i * 57
actor = $game_party.actors[i]
draw_actor_graphic(actor, x + 20, y + 45)
draw_actor_name(actor, x + 30, y)
draw_actor_class(actor, x + 30, y + 24)
draw_actor_level(actor, x + 120, y)
draw_actor_state(actor, x + 120, y + 24)
draw_actor_exp(actor, x + 190, y + 24)
draw_actor_hp(actor, x + 190, y )
draw_actor_sp(actor, x + 320, y)
end
end
#--------------------------------------------------------------------------
# - Aggiornamento del rettangolo del cursore
#--------------------------------------------------------------------------
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
else
self.cursor_rect.set(0, @index * 57, self.width - 32, 57)
end
end
end
class Window_Steps < Window_Base
def initialize
super(0, 0, 160, 74)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "Arial"
self.contents.font.size = 24
refresh
end
end
#======
# - Window_PlayTime
#------
# E' la finestra che mostra il tempo di gioco sulla schermata di menù
#======
class Window_PlayTime < Window_Base
#------
# - Inizialiazzazione dell'oggetto
#------
def initialize
super(0, 0, 160, 86)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end
def refresh
self.contents.clear
self.contents.font.color = system_color
self.contents.font.name = "Arial"
self.contents.font.size = 24
# self.back_opacity = 160
self.contents.draw_text(4, 0, 120, 32, "Tempo:")
@total_sec = Graphics.frame_count / Graphics.frame_rate
hour = @total_sec / 60 / 60
min = @total_sec / 60 % 60
sec = @total_sec % 60
# Verifico che sia trascorsa un'ora e calcolo il denaro da sommare
if sec == 59 and min == 59
calcola
end
text = sprintf("%02d:%02d:%02d", hour, min, sec)
self.contents.font.color = normal_color
self.contents.draw_text(4, 28, 120, 32, text, 2)
end
end