8 personaggi nel party
Pagina 1 di 1
8 personaggi nel party
8 personaggi nel party
Autore Tio
Script:
Poi in Scene_title sostituite:
Poi andate in Scene_Battle 1 e nel metodo principale (dopo def main) aggiungete questa riga:
A questo punto, dovrete sostituire $game_party con $battle_party in alcune classi. Per farlo aprite una classe (per esempio Scene_Battle 1), clickate col destro del mouse in mezzo al codice e selezionate "sostituisci": nella prima casella mettete $game_party nella seconda $battle_party. Ora basta premere sostituisci tutto per inserire $battle_party all'interno di Scene_Battle 1, e basta aprire la pagina delle altre classi per poter sostituire (sempre sostituisci tutto).
Autore Tio
Script:
- Spoiler:
- Codice:
#
# 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, 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, y, 12, 32, "/", 1)
self.contents.draw_text(hp_x + 60, 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, 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, y, 12, 32, "/", 1)
self.contents.draw_text(sp_x + 60, 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
Poi create un'altra pagina subito dopo e inserite questo codice:
CODICE
class Scene_Menu
# --------------------------------
def initialize(menu_index = 0)
@menu_index = menu_index
@changer = 0
@where = 0
@checker = 0
end
# --------------------------------
def main
s1 = $data_system.words.item
s2 = $data_system.words.skill
s3 = $data_system.words.equip
s4 = "Status"
s5 = "Ordina"
s6 = "Salva"
s7 = "Esci"
@command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7])
@command_window.index = @menu_index
if $game_party.actors.size == 0
@command_window.disable_item(0)
@command_window.disable_item(1)
@command_window.disable_item(2)
@command_window.disable_item(3)
end
if $game_system.save_disabled
@command_window.disable_item(4)
end
if $game_party.actors.size == 1
@command_window.disable_item(6)
end
@playtime_window = Window_PlayTime.new
@playtime_window.x = 0
@playtime_window.y = 256
@gold_window = Window_Gold.new
@gold_window.x = 0
@gold_window.y = 416
@steps_window = Window_Steps.new
@steps_window.x = 0
@steps_window.y = 342
@status_window = Window_MenuStatus.new
@status_window.x = 160
@status_window.y = 0
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@command_window.dispose
@playtime_window.dispose
@steps_window.dispose
@gold_window.dispose
@status_window.dispose
end
# --------------------------------
def update
@command_window.update
@playtime_window.update
@gold_window.update
@steps_window.update
@status_window.update
if @command_window.active
update_command
return
end
if @status_window.active
update_status
return
end
end
# --------------------------------
def update_command
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Map.new
return
end
if Input.trigger?(Input::C)
if $game_party.actors.size == 0 and @command_window.index < 4
$game_system.se_play($data_system.buzzer_se)
return
end
if $game_party.actors.size == 1 and @command_window.index ==6
$game_system.se_play($data_system.buzzer_se)
return
end
case @command_window.index
when 0
$game_system.se_play($data_system.decision_se)
$scene = Scene_Item.new
when 1
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 2
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 3
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 4
$game_system.se_play($data_system.decision_se)
@checker = 0
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 5
if $game_system.save_disabled
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
$scene = Scene_Save.new
when 6
$game_system.se_play($data_system.decision_se)
$scene = Scene_End.new
end
return
end
end
# --------------------------------
def update_status
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@command_window.active = true
@status_window.active = false
@status_window.index = -1
return
end
if Input.trigger?(Input::C)
case @command_window.index
when 1
if $game_party.actors[@status_window.index].restriction >= 2
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
$scene = Scene_Skill.new(@status_window.index)
when 2
$game_system.se_play($data_system.decision_se)
$scene = Scene_Equip.new(@status_window.index)
when 3
$game_system.se_play($data_system.decision_se)
$scene = Scene_Status.new(@status_window.index)
when 4
$game_system.se_play($data_system.decision_se)
if @checker == 0
@changer = $game_party.actors[@status_window.index]
@where = @status_window.index
@checker = 1
else
$game_party.actors[@where] = $game_party.actors[@status_window.index]
$game_party.actors[@status_window.index] = @changer
@checker = 0
@status_window.refresh
end
end
return
end
end
end
Poi nel Game_party prima dell'ultimo End aggiungete:
[spoiler]- Codice:
def setup_battle_members
@actors = []
if $game_party.actors.size > 3
for i in 0..3
@actors.push($game_party.actors[i])
end
else
for i in 0..($game_party.actors.size - 1)
@actors.push($game_party.actors[i])
end
end
end
Poi in Scene_title sostituite:
- Codice:
$game_party = Game_Party.new
- Codice:
$game_party = Game_Party.new
$battle_party = Game_Party.new
Poi andate in Scene_Battle 1 e nel metodo principale (dopo def main) aggiungete questa riga:
- Codice:
$battle_party.setup_battle_members
A questo punto, dovrete sostituire $game_party con $battle_party in alcune classi. Per farlo aprite una classe (per esempio Scene_Battle 1), clickate col destro del mouse in mezzo al codice e selezionate "sostituisci": nella prima casella mettete $game_party nella seconda $battle_party. Ora basta premere sostituisci tutto per inserire $battle_party all'interno di Scene_Battle 1, e basta aprire la pagina delle altre classi per poter sostituire (sempre sostituisci tutto).
Yushi II- Data d'iscrizione : 09.07.11
Età : 34
Pagina 1 di 1
Permessi in questa sezione del forum:
Non puoi rispondere agli argomenti in questo forum.
|
|