Save-Point
Battle Result Plus - Printable Version

+- Save-Point (https://www.save-point.org)
+-- Forum: Archives (https://www.save-point.org/forum-105.html)
+--- Forum: Creation Asylum Archives (https://www.save-point.org/forum-90.html)
+---- Forum: Scripts & Code Snippets (https://www.save-point.org/forum-92.html)
+----- Forum: RPG Maker XP Code (https://www.save-point.org/forum-93.html)
+------ Forum: Enhancement/Modification Scripts (https://www.save-point.org/forum-98.html)
+------ Thread: Battle Result Plus (/thread-6488.html)



Battle Result Plus - Ragnarok Rob - 09-23-2006

Battle Result Window Plus
A kinda nicer-looking Window_BattleResult
by Ragnarok Rob
Sep 23 2006

Version: 1.01

This is a locked, single-post thread from Creation Asylum. Archived here to prevent its loss.
No support is given. If you are the owner of the thread, please contact administration.


Info

This is a better looking version of the battle result window. Instead of that crappy one-lined message box, it is a larger window, divided by little rectangles. Theres a gold section, an experience section, and if you win treasures, a nice section for that too!

Instructions

Just put this anywhere above main!

Compatability Issues

None that i know of...

The Script!
Code:
#==============================================================================
# ** Battle Result Window Plus (WBR+)
#------------------------------------------------------------------------------
#   A cleaner, bigger, and better organized battle result window
#==============================================================================

class Window_BattleResult < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(exp, gold, treasures)
    #Make attributes
    @exp = exp
    @gold = gold
    @treasures = treasures
    #Draw new window
    super(160, 40, 320, @treasures.size * 32 + 200)
    #Make the window's bitmap
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = "Tahoma"
    self.contents.font.size = 22
    self.y = 160 - height / 2
    #Make the bitmap invisible
    self.visible = false
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    #Initialize string-width variables
    wx = contents.text_size("Winnings: ").width
    gx = contents.text_size(@gold.to_s + "   ").width
    tx = contents.text_size("Total: ").width
    ex = contents.text_size(@exp.to_s + " ").width
    #If you win items in battle
    if @treasures.size != 0
      #Set font color
      self.contents.font.color = system_color
      #Draw victory text
      self.contents.draw_text(0, 0, 288, 32, "Victory!", 1)
      #Make division rectangle
      self.contents.fill_rect(0, 32, 288, 2, normal_color)
      #Gold Section
      self.contents.draw_text(0, 34, 288, 32, $data_system.words.gold)
      self.contents.font.color = system_color
      self.contents.draw_text(0, 70, 288, 32, "Winnings: ")
      self.contents.font.color = normal_color
      self.contents.draw_text(wx, 70, 288, 32, @gold.to_s)
      @gold += $game_party.gold
      self.contents.font.color = system_color
      self.contents.draw_text(wx + gx, 70, 288, 32, "Total: ")
      self.contents.font.color = normal_color
      self.contents.draw_text(wx + gx + tx, 70, 288, 32, @gold.to_s)
      self.contents.fill_rect(0, 102, 288, 2, normal_color)
      #Experience Section
      self.contents.font.color = system_color
      self.contents.draw_text(0, 104, 288, 32, "Experience")
      self.contents.font.color = normal_color
      self.contents.draw_text(0, 136, 288, 32, @exp.to_s)
      self.contents.font.color = system_color
      self.contents.draw_text(ex, 136, 288, 32, "Ex Points")
      #Treasures Section
      self.contents.fill_rect(0, 168, 288, 2, normal_color)
      self.contents.draw_text(0, 170, 288, 32, "Treasure")
      x = 4
      y = 202
      for item in @treasures
        draw_item_name(item, x, y)
        y += 32
      end
    #If you don't win any items...ha ha! You lose!...ahem
    else
      #Set font color
      self.contents.font.color = system_color
      #Draw victory text
      self.contents.draw_text(0, 0, 288, 32, "Victory!", 1)
      #Make division rectangle
      self.contents.fill_rect(0, 32, 288, 2, normal_color)
      #Gold Section
      self.contents.draw_text(0, 34, 288, 32, $data_system.words.gold)
      self.contents.font.color = system_color
      self.contents.draw_text(0, 70, 288, 32, "Winnings: ")
      self.contents.font.color = normal_color
      self.contents.draw_text(wx, 70, 288, 32, @gold.to_s)
      @gold += $game_party.gold
      self.contents.font.color = system_color
      self.contents.draw_text(wx + gx, 70, 288, 32, "Total: ")
      self.contents.font.color = normal_color
      self.contents.draw_text(wx + gx + tx, 70, 288, 32, @gold.to_s)
      self.contents.fill_rect(0, 102, 288, 2, normal_color)
      #Experience Section
      self.contents.font.color = system_color
      self.contents.draw_text(0, 104, 288, 32, "Experience")
      self.contents.font.color = normal_color
      self.contents.draw_text(0, 136, 288, 32, @exp.to_s)
      self.contents.font.color = system_color
      self.contents.draw_text(ex, 136, 288, 32, "Ex Points")
    end
  end
end


Next Version?

Hopefully in the next version i'll find a way to make a 2 by X table of items to save size!