Introdução
Esse script é bem legal desenterrei do fundo do baú, simples também mais útil para RPGs que usa mais de 4 personagens.
Ele faz você poder trocar o personagem caso não queira um queira outros.
Screenshots
Script
Créditos
Criador do Script: João Neto
Eu, por disponibilizar
Esse script é bem legal desenterrei do fundo do baú, simples também mais útil para RPGs que usa mais de 4 personagens.
Ele faz você poder trocar o personagem caso não queira um queira outros.
Screenshots
- Spoiler:
Script
- Spoiler:
- Código:
#e###############################################################
#e################
#Mudar Grupo - Por João Neto #################
#e################
#mr_mcloud@hotmail.com
######################
#e###############################################################
#e#
#Este código permite que você mude seu grupo de heróis, ######
#e# deixando o
#restante da equipe armazenada para uma nova ######
#e# troca. Para chamar
#esta função, use um chamar Script com ####
#e# a linha:
####
#e# $scene = Scene_MontaGrupo.new
####
#e# e Para armazenar diretamente os heróis fora da
#equipe, ####
#e# basta usar a seguinte linha:
####
#e# $reserve_party.add_actor(n) onde n é o id do herói.
####
#e###############################################################
#e###############################################################
class
Window_Heros < Window_Selectable
def initialize(who=0)
super(0,
0, 186, 160)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size =
$fontsize
if who == 0
@equipe = $game_party
else
@equipe = $reserve_party
end
refresh
self.active =
false
self.index = -1
end
def refresh
self.contents.clear
@item_max = @equipe.actors.size
for i in
0...@equipe.actors.size
x = 4
y = i * 32
text =
@equipe.actors[i].name
actor = @equipe.actors[i]
bitmap =
RPG::Cache.character(actor.character_name, actor.character_hue)
cw =
bitmap.width / 4
ch = bitmap.height / 8
src_rect = Rect.new(0,
0, cw, ch)
self.contents.blt(0, y, bitmap, src_rect)
self.contents.draw_text(32 , y, 120, 32, text, 0)
end
end
def
update_cursor_rect
if @index < 0
self.cursor_rect.empty
else
self.cursor_rect.set(0, @index * 32, self.width - 32, 32)
end
end
end
class Scene_MontaGrupo
def main
@spriteset =
Spriteset_Map.new
$game_system.se_play($data_system.decision_se)
s1 = "Adicionar heróis"
s2 = "Remover Heróis"
@cmd =
Window_Command.new(186,[s1,s2])
@party = Window_Heros.new
@party.y = 96
@party2 = Window_Heros.new(1)
@party2.y = 160 +
96
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@party.dispose
@party2.dispose
@cmd.dispose
@spriteset.dispose
end
def
update
@spriteset.update
@cmd.update
@party.update
@party2.update
if @cmd.active
update_cmd
elsif
@party.active
update_party
elsif @party2.active
update_party2
end
end
def update_cmd
if
Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene =
Scene_Map.new
end
if Input.trigger?(Input::C)
case
@cmd.index
when 0
if $game_party.actors.size == 4
$game_system.se_play($data_system.buzzer_se)
return
else
$game_system.se_play($data_system.decision_se)
@cmd.active = false
@party2.active = true
@party2.index = 0
end
when 1
if
$reserve_party.actors.size == 4
$game_system.se_play($data_system.buzzer_se)
return
else
$game_system.se_play($data_system.decision_se)
@cmd.active = false
@party.active = true
@party.index = 0
end
end
end
end
def update_party
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@cmd.active = true
@party.active = false
@party.index = -1
end
if
Input.trigger?(Input::C)
if $reserve_party.actors.size == 4 or
$game_party.actors.size == 1
$game_system.se_play($data_system.buzzer_se)
return
else
$game_system.se_play($data_system.decision_se)
hero =
$game_party.actors[@party.index].id
$game_party.remove_actor(hero)
$reserve_party.add_actor(hero)
@party.refresh
@party2.refresh
end
end
end
def update_party2
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@cmd.active = true
@party2.active = false
@party2.index = -1
end
if
Input.trigger?(Input::C)
if $game_party.actors.size == 4
$game_system.se_play($data_system.buzzer_se)
return
else
$game_system.se_play($data_system.decision_se)
hero =
$reserve_party.actors[@party2.index].id
$reserve_party.remove_actor(hero)
$game_party.add_actor(hero)
@party.refresh
@party2.refresh
end
end
end
end
#e############### Classes com alteração
#######################
class Scene_Title
alias new_cmd
command_new_game
def command_new_game
$reserve_party =
Game_Party.new
new_cmd
end
end
class Scene_Save <
Scene_File
alias w_f_d write_save_data
def write_save_data(file)
w_f_d(file)
Marshal.dump($reserve_party, file)
end
end
class
Scene_Load < Scene_File
alias r_s_d read_save_data
def
read_save_data(file)
r_s_d(file)
$reserve_party =
Marshal.load(file)
end
end
#e#############################################################
Créditos
Criador do Script: João Neto
Eu, por disponibilizar