class Game_Temp
alias initialize_old initialize
attr_accessor :badges
attr_accessor :id1
attr_accessor :id2
attr_accessor :id3
attr_accessor :id4
attr_accessor :id5
def initialize
@badges = []
@id1 = rand(9)
@id2 = rand(9)
@id3 = rand(9)
@id4 = rand(9)
@id5 = rand(9)
initialize_old
end
end
class Window_Base < Window
def black
return Color.new(96,96,96,255)
end
end
class Window_Trainercard < Window_Base
def initialize
super(0,0,480,320)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
self.z = 9999
self.opacity = 0
self.back_opacity = 0
refresh
end
def refresh
self.contents.clear
#set's font color to black, defined at the top
self.contents.font.color = black
#set the x,y,width,height to a value
x = 24 and y = 54 and w = 200 and h = 32
#draw actor id
t = $game_temp
self.contents.draw_text(220, 4, w, h, "Trainer ID " + t.id1.to_s + t.id2.to_s + t.id3.to_s + t.id4.to_s + t.id5.to_s)
#draw actor name
self.contents.draw_text(x,y,w,h,"Name " + $game_party.actors[0].name, 0)
#draw money
self.contents.draw_text(x,y+47,w,h, "Money")
c = $game_party.gold.to_s.size
#draw the value of the money
self.contents.draw_text(x+106 - c,y+47,w,h, "$" + $game_party.gold.to_s)
#draw pokedex
self.contents.draw_text(x,y+79,w,h, "PokeDex")
#store number of current actors minus 1in "i"
i = $game_party.actors.size - 1
c = $game_party.actors.size.to_f
#draw the number stored in "i"
self.contents.draw_text(x+106 - c,y+80,w,h, i.to_s)
#draw PlayTime
self.contents.draw_text(x,y+111,w,h, "PlayTime")
@total_sec = Graphics.frame_count / Graphics.frame_rate
hour = @total_sec / 60 / 60
min = @total_sec / 60 % 60
sec = @total_sec % 60
#store value in "text"
text = sprintf("%02d:%02d:%02d", hour, min, sec)
c = text.size
self.contents.draw_text(x+106 - c, y+111,w,h, text)
end
def update
super
if Graphics.frame_count / Graphics.frame_rate != @total_sec
refresh
end
end
end
class Scene_Trainercard
def main
@win = Window_Trainercard.new
@win.x = 80
@win.y = 80
@win.z = 9998
@card = Sprite.new
@card.bitmap = RPG::Cache.picture("trainercard")
@card.x = 80
@card.y = 80
@card.z = 9996
@bg = Sprite.new
@bg.bitmap = RPG::Cache.picture("background")
@bg.z = 9995
@trainer = Sprite.new
@trainer.x = 398
@trainer.y = 160
@trainer.z = 9997
if $game_switches[1] == true
@trainer.bitmap = RPG::Cache.picture("boy")
end
if $game_switches[2] == true
@trainer.bitmap = RPG::Cache.picture("girl")
end
@badge1 = Sprite.new
@badge2 = Sprite.new
@badge3 = Sprite.new
@badge4 = Sprite.new
@badge5 = Sprite.new
@badge6 = Sprite.new
@badge7 = Sprite.new
@badge8 = Sprite.new
if $game_temp.badges[1] == true
@badge1.bitmap = RPG::Cache.icon("badge1")
@badge1.x = 132
@badge1.y = 308
@badge1.z = 9999
end
if $game_temp.badges[2] == true
@badge2.bitmap = RPG::Cache.icon("badge2")
@badge2.x = 132 + (48 * 1)
@badge2.y = 308
@badge2.z = 9999
end
if $game_temp.badges[3] == true
@badge3.bitmap = RPG::Cache.icon("badge3")
@badge3.x = 132 + (48 * 2)
@badge3.y = 308
@badge3.z = 9999
end
if $game_temp.badges[4] == true
@badge4.bitmap = RPG::Cache.icon("badge4")
@badge4.x = 132 + (48 * 3)
@badge4.y = 308
@badge4.z = 9999
end
if $game_temp.badges[5] == true
@badge5.bitmap = RPG::Cache.icon("badge5")
@badge5.x = 132 + (48 * 4)
@badge5.y = 308
@badge5.z = 9999
end
if $game_temp.badges[6] == true
@badge6.bitmap = RPG::Cache.icon("badge6")
@badge6.x = 132 + (48 * 5)
@badge6.y = 308
@badge6.z = 9999
end
if $game_temp.badges[7] == true
@badge7.bitmap = RPG::Cache.icon("badge7")
@badge7.x = 132 + (48 * 6)
@badge7.y = 308
@badge7.z = 9999
end
if $game_temp.badges[8] == true
@badge8.bitmap = RPG::Cache.icon("badge8")
@badge8.x = 132 + (48 * 7)
@badge8.y = 308
@badge8.z = 9999
end
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@win.dispose
@card.dispose
@bg.dispose
@trainer.dispose
@badge1.dispose
@badge2.dispose
@badge3.dispose
@badge4.dispose
@badge5.dispose
@badge6.dispose
@badge7.dispose
@badge8.dispose
end
#--------------------------------------------------------------------------
# ? ??????
#--------------------------------------------------------------------------
def update
@win.update
@card.update
@bg.update
@trainer.update
@badge1.update
@badge2.update
@badge3.update
@badge4.update
@badge5.update
@badge6.update
@badge7.update
@badge8.update
if Input.press?(Input::B)
$scene = Scene_Map.new
end
end
end