I have already created the basics for window structures and the scene ...
Then, how can I show the scene i created after the battle?
And how can i show the items obtained during battle?
And lastly, how can i show the skills learned if there is any skill learned after battle. ex. Leveling up.
Thank you.
Here is the script im working on :
CODE
#==============================================================================
# * Battle Statistics Window
#==============================================================================
class BRWindow < Window_Base
def initialize
super(0, 0, 640, 70)
self.contents = Bitmap.new(width-32, height-32)
self.contents.font.name = "Calibri"
self.contents.font.size = 30
self.visible = true
refresh_BR
end
def refresh_BR
self.contents.clear
cx = contents.text_size("Battle Statistics").width
self.contents.draw_text(225, 0, cx, 32, "Battle Statistics")
end
end
#==============================================================================
# * Items Gained Window
#==============================================================================
class Items_GoldWindow < Window_Base
def initialize (gold, treasures)
@gold = gold
@treasures = treasures
end
def initialize
super(0, 70, 250, 350)
self.contents = Bitmap.new(width-32, height-32)
self.contents.font.name = "Calibri"
self.contents.font.size = 30
self.visible = true
refresh_IG
end
def refresh_IG
self.contents.clear
self.contents.draw_text(40, 0, 150, 32, "Items and Gold Obtained")
self.contents.draw_text(0, 40, 150, 32, $data_system.words.gold)
self.contents.draw_text(0, 72, 150, 32, @gold.to_s)
self.contents.draw_text(0, 104, 150, 32, $data_system.words.item)
end
end
#==============================================================================
# Experience Gained Window
#==============================================================================
# * Window Initialization
class Exp_Window < Window_Base
def initialize(exp)
@exp = exp
end
def initialize
super(250, 70, 390, 350)
self.contents = Bitmap.new(width-32, height-32)
self.contents.font.name = "Calibri"
self.contents.font.size = 30
self.visible = true
refresh_Exp
end
def refresh_Exp
self.contents.clear
self.contents.draw_text(120, 0, 150, 32, "Experience Gained")
for i in 0...$game_party.actors.size
x = 20
y = (i * 60) + 50
actor = $game_party.actors[i]
self.contents.font.color = text_color(3)
self.contents.font.size = 28
self.contents.draw_text(x, y, 150, 32, $game_party.actors[i].name)
self.contents.font.color = text_color(6)
self.contents.font.size = 18
self.contents.draw_text(x, y + 20, 150, 32, actor.class_name)
self.contents.font.size = 16
cx = self.contents.text_size(@exp.to_s).width
self.contents.draw_text(150, 90, cx, 32, @exp.to_s)
self.contents.font.size = 16
self.contents.draw_text(115, 20, 150, 32, "Experience Left Till Level Up")
self.contents.font.size = 25
draw_actor_exp(actor, x + 90, y)
end
end
end
#==============================================================================
# Battle System Message Window
#==============================================================================
class BS_Window < Window_Base
def initialize
super(0, 420, 640, 60)
self.contents = Bitmap.new(width-32, height-32)
self.contents.font.name = "Calibri"
self.contents.font.size = 20
self.visible = true
refresh_BS
end
def refresh_BS
self.contents.clear
self.contents.draw_text(0, 0, 150, 32, "Battle Info")
end
end
#==============================================================================
# Battle Result Scene
#==============================================================================
class Scene_BattleResult
def main
# make window for BRWindow, Items_GoldWindow, Exp_Window and BS_Window
@br_window = BRWindow.new
@ig_window = Items_GoldWindow.new
@exp_window = Exp_Window.new
@bs_window = BS_Window.new
# graphics transition
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
# prepare for transition
Graphics.freeze
# dispose windows
@br_window.dispose
@ig_window.dispose
@exp_window.dispose
@bs_window.dispose
end
# * Define Update
def update
@ig_window.update
@exp_window.update
@bs_window.update
if Input.trigger?(Input::B) or if Input.trigger?(Input::C)
# Play Decision SE
$game_system.se_play($data_system.decision_se)
# Switch to Scene Map
$scene = Scene_Map.new
end
end
end
end
# * Battle Statistics Window
#==============================================================================
class BRWindow < Window_Base
def initialize
super(0, 0, 640, 70)
self.contents = Bitmap.new(width-32, height-32)
self.contents.font.name = "Calibri"
self.contents.font.size = 30
self.visible = true
refresh_BR
end
def refresh_BR
self.contents.clear
cx = contents.text_size("Battle Statistics").width
self.contents.draw_text(225, 0, cx, 32, "Battle Statistics")
end
end
#==============================================================================
# * Items Gained Window
#==============================================================================
class Items_GoldWindow < Window_Base
def initialize (gold, treasures)
@gold = gold
@treasures = treasures
end
def initialize
super(0, 70, 250, 350)
self.contents = Bitmap.new(width-32, height-32)
self.contents.font.name = "Calibri"
self.contents.font.size = 30
self.visible = true
refresh_IG
end
def refresh_IG
self.contents.clear
self.contents.draw_text(40, 0, 150, 32, "Items and Gold Obtained")
self.contents.draw_text(0, 40, 150, 32, $data_system.words.gold)
self.contents.draw_text(0, 72, 150, 32, @gold.to_s)
self.contents.draw_text(0, 104, 150, 32, $data_system.words.item)
end
end
#==============================================================================
# Experience Gained Window
#==============================================================================
# * Window Initialization
class Exp_Window < Window_Base
def initialize(exp)
@exp = exp
end
def initialize
super(250, 70, 390, 350)
self.contents = Bitmap.new(width-32, height-32)
self.contents.font.name = "Calibri"
self.contents.font.size = 30
self.visible = true
refresh_Exp
end
def refresh_Exp
self.contents.clear
self.contents.draw_text(120, 0, 150, 32, "Experience Gained")
for i in 0...$game_party.actors.size
x = 20
y = (i * 60) + 50
actor = $game_party.actors[i]
self.contents.font.color = text_color(3)
self.contents.font.size = 28
self.contents.draw_text(x, y, 150, 32, $game_party.actors[i].name)
self.contents.font.color = text_color(6)
self.contents.font.size = 18
self.contents.draw_text(x, y + 20, 150, 32, actor.class_name)
self.contents.font.size = 16
cx = self.contents.text_size(@exp.to_s).width
self.contents.draw_text(150, 90, cx, 32, @exp.to_s)
self.contents.font.size = 16
self.contents.draw_text(115, 20, 150, 32, "Experience Left Till Level Up")
self.contents.font.size = 25
draw_actor_exp(actor, x + 90, y)
end
end
end
#==============================================================================
# Battle System Message Window
#==============================================================================
class BS_Window < Window_Base
def initialize
super(0, 420, 640, 60)
self.contents = Bitmap.new(width-32, height-32)
self.contents.font.name = "Calibri"
self.contents.font.size = 20
self.visible = true
refresh_BS
end
def refresh_BS
self.contents.clear
self.contents.draw_text(0, 0, 150, 32, "Battle Info")
end
end
#==============================================================================
# Battle Result Scene
#==============================================================================
class Scene_BattleResult
def main
# make window for BRWindow, Items_GoldWindow, Exp_Window and BS_Window
@br_window = BRWindow.new
@ig_window = Items_GoldWindow.new
@exp_window = Exp_Window.new
@bs_window = BS_Window.new
# graphics transition
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
# prepare for transition
Graphics.freeze
# dispose windows
@br_window.dispose
@ig_window.dispose
@exp_window.dispose
@bs_window.dispose
end
# * Define Update
def update
@ig_window.update
@exp_window.update
@bs_window.update
if Input.trigger?(Input::B) or if Input.trigger?(Input::C)
# Play Decision SE
$game_system.se_play($data_system.decision_se)
# Switch to Scene Map
$scene = Scene_Map.new
end
end
end
end