Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if true # << Make true to use this script, false to disable.
- #===============================================================================
- #
- # ☆ $D13x - Epic Data Popups
- # -- Author : Dekita
- # -- Version : 1.0
- # -- Level : Easy / Normal
- # -- Requires : N/A
- # -- Engine : RPG Maker VX Ace.
- #
- #===============================================================================
- # ☆ Import
- #-------------------------------------------------------------------------------
- $D13x={}if$D13x==nil
- $D13x[:Epic_Popups]=true
- #===============================================================================
- # ☆ Updates
- #-------------------------------------------------------------------------------
- # D /M /Y
- # ??/??/2o13 - Started, Finished,
- #
- #===============================================================================
- # ☆ Introduction
- #-------------------------------------------------------------------------------
- # This script creates some cool popups for the main party leader.
- #
- # Pops shows are things like; exp gained, level up, SP pts gained, DP pts gained,
- # mhp, mmp and params.
- #
- # VERY helpful for any ABS.
- #
- #===============================================================================
- # ★☆★☆★☆★☆★☆★☆★☆★ TERMS AND CONDITIONS: ☆★☆★☆★☆★☆★☆★☆★☆★☆
- #===============================================================================
- # 1. You MUST give credit to "Dekita" !!
- # 2. You are NOT allowed to repost this script.(or modified versions)
- # 3. You are NOT allowed to convert this script.
- # 4. You are NOT allowed to use this script for Commercial games.
- # 5. ENJOY!
- #
- # "FINE PRINT"
- # By using this script you hereby agree to the above terms and conditions,
- # if any violation of the above terms occurs "legal action" may be taken.
- # Not understanding the above terms and conditions does NOT mean that
- # they do not apply to you.
- # If you wish to discuss the terms and conditions in further detail you can
- # contact me at http://dekitarpg.wordpress.com/
- #
- #===============================================================================
- # ☆ Instructions
- #-------------------------------------------------------------------------------
- # Place Below " ▼ Materials " and Above " ▼ Main " in your script editor.
- #
- #===============================================================================
- # ☆ Script Calls
- #-------------------------------------------------------------------------------
- # $game_temp.show_data_pops
- # ^- Ensures data popups are shown.
- #
- # $game_temp.hide_data_pops
- # ^- Ensures data popups are now shown.
- #
- # $game_temp.alt_data_pops
- # ^- alternates hide / show data pops
- #
- # $game_temp.data_pops_on?
- # ^- Returns true / false depending on whether data pops are being shown.
- #
- #===============================================================================
- # ☆ Notetags ( default )
- #-------------------------------------------------------------------------------
- # N/A
- #
- #===============================================================================
- # ☆ HELP
- #-------------------------------------------------------------------------------
- # N/A
- #
- #===============================================================================
- module Data_Popups
- #===============================================================================
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- Show_on_Map = true
- Show_in_Battle = true
- #-----------------------------------------------------------------------------
- # Position after offset slide.
- #-----------------------------------------------------------------------------
- X_Pos = 542 # X Position
- Y_Pos = 360 # Y Position
- #-----------------------------------------------------------------------------
- # Offset Slide happens before the item fadeout
- #-----------------------------------------------------------------------------
- X_Offset = -60 # X Slide
- Y_Offset = -40 # Y Slide
- #-----------------------------------------------------------------------------
- # Move happens during the item fadeout
- #-----------------------------------------------------------------------------
- X_Move = 0 # X Move Speed
- Y_Move = -1 # Y Move Speed
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- Init_Opacity = 0
- Fade_Speed = 2.5
- #-----------------------------------------------------------------------------
- # Z Value
- #-----------------------------------------------------------------------------
- Authority = 100
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- Font = ["Gabrielle", "VL Gothic", "Arial"]
- Font_Size = 16
- Font_Bold = true
- Font_Italic = false
- Value_Size = 12
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- Gold_Icon = [361,0] # [icon index, hue]
- Gold_Color = Text_Color::Gold
- #-----------------------------------------------------------------------------
- # :data => [show]
- #-----------------------------------------------------------------------------
- Settings ={
- :exp => [true],
- :level => [true],
- :dp => [true],
- :sp => [true],
- :mhp => [true],
- :mmp => [true],
- :mtp => [true],
- :params => [true],
- }
- #-----------------------------------------------------------------------------
- # = ['Name' , icon, hue, Text Color::Color , show_gain]
- #-----------------------------------------------------------------------------
- Level = ['Level', 97, 0, Text_Color::Green , true]
- DP = ['DP' , 97, 0, Text_Color::Gold , true]
- SP = ['SP' , 97, 0, Text_Color::Turquoise , true]
- #####################
- # CUSTOMISATION END #
- end #####################
- #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★#
- # #
- # http://dekitarpg.wordpress.com/ #
- # #
- #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆#
- #===============================================================================#
- # ARE YOU MODIFYING BEYOND THIS POINT? \.\. #
- # YES?\.\. #
- # OMG, REALLY? \| #
- # WELL SLAP MY FACE AND CALL ME A DRAGONITE.\..\.. #
- # I REALLY DIDN'T THINK YOU HAD IT IN YOU.\..\.. #
- #===============================================================================#
- class Game_Temp
- #===============================================================================
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- alias :init_datapops :initialize
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def initialize
- @can_data_pop = true
- init_datapops
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def data_pops_on?
- @can_data_pop
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def show_data_pops
- @can_data_pop = true
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def hide_data_pops
- @can_data_pop = false
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def alt_data_pops
- @can_data_pop = !@can_data_pop
- end
- end
- #===============================================================================
- class All_De_Pops
- #===============================================================================
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- attr_reader :name
- attr_reader :icon_hue
- attr_reader :icon_index
- attr_reader :item_disp_color
- end
- #===============================================================================
- class Popup_Level < All_De_Pops
- #===============================================================================
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def initialize
- @name = Data_Popups::Level[0]
- @icon_hue = Data_Popups::Level[2]
- @icon_index = Data_Popups::Level[1]
- @item_disp_color = Data_Popups::Level[3]
- end
- end
- #===============================================================================
- class Popup_DP < All_De_Pops
- #===============================================================================
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def initialize
- @name = Data_Popups::DP[0]
- @icon_hue = Data_Popups::DP[2]
- @icon_index = Data_Popups::DP[1]
- @item_disp_color = Data_Popups::DP[3]
- end
- end
- #===============================================================================
- class Popup_SP < All_De_Pops
- #===============================================================================
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def initialize
- @name = Data_Popups::SP[0]
- @icon_hue = Data_Popups::SP[2]
- @icon_index = Data_Popups::SP[1]
- @item_disp_color = Data_Popups::SP[3]
- end
- end
- #===============================================================================
- class Popup_Statistic < All_De_Pops
- #===============================================================================
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def initialize(type,id)
- case type
- when :params then stat = Vocanicon.param(id)
- when :xparams then stat = Vocanicon.xparam(id)
- when :sparams then stat = Vocanicon.sparam(id)
- when :max_tp then stat = Vocanicon::TP
- when :exp then stat = Vocanicon::Exp
- end
- @name = stat[0]
- if (type == :params) && (id == 0 || 1 || 2 ) || (type == :max_tp)
- @name = "Max " + stat[0]
- end
- @icon_hue = stat[3]
- @icon_index = stat[2]
- @item_disp_color = stat[1]
- end
- end
- #===============================================================================
- class Epic_Pop_Data
- #===============================================================================
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def initialize
- @timer_d = 24
- @timer = 0
- @actor = $game_party.leader
- @exp = @actor.exp
- @level = @actor.level
- @points = @actor.points
- @sklpts = @actor.skill_points
- @mhp = @actor.mhp
- @mmp = @actor.mmp
- @mtp = @actor.maximum_tp
- @params = []
- 6.times do |i|
- @params[i] = @actor.param(i+2)
- end
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def update
- @timer -= 1
- return if @timer > 0
- @timer = @timer_d
- if Data_Popups::Settings[:exp][0]
- return if update_exp
- end
- if Data_Popups::Settings[:level][0]
- return if update_level
- end
- if Data_Popups::Settings[:dp][0]
- return if update_points
- end
- if Data_Popups::Settings[:sp][0]
- return if update_sklpts
- end
- if Data_Popups::Settings[:mhp][0]
- return if update_mhp
- end
- if Data_Popups::Settings[:mmp][0]
- return if update_mmp
- end
- if Data_Popups::Settings[:mtp][0]
- return if update_mtp
- end
- if Data_Popups::Settings[:params][0]
- return if update_params
- end
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def update_exp
- return false unless @exp != @actor.exp
- gain = @actor.exp-@exp
- # gain = nil unless Data_Popups::Level[4]
- make_popup(:exp,nil,gain.to_i)
- @exp = @actor.exp
- return true
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def update_level
- return false unless @level != @actor.level
- gain = @actor.level-@level
- gain = nil unless Data_Popups::Level[4]
- make_popup(:level,nil,gain.to_i)
- @level = @actor.level
- @exp = @actor.exp
- return true
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def update_points
- return false unless @points != @actor.points
- gain = @actor.points-@points
- gain = nil unless Data_Popups::DP[4]
- make_popup(:points,nil,gain.to_i)
- @points = @actor.points
- return true
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def update_sklpts
- return false unless @sklpts != @actor.skill_points
- gain = @actor.skill_points-@sklpts
- make_popup(:sklpts,nil,gain.to_i)
- @sklpts = @actor.skill_points
- return true
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def update_mhp
- return false unless @mhp != @actor.mhp
- gain = @actor.mhp-@mhp
- make_popup(:params,0,gain.to_i)
- @mhp = @actor.mhp
- return true
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def update_mmp
- return false unless @mmp != @actor.mmp
- gain = @actor.mmp-@mmp
- make_popup(:params,1,gain.to_i)
- @mmp = @actor.mmp
- return true
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def update_mtp
- return false unless @mtp != @actor.maximum_tp
- gain = @actor.maximum_tp-@mtp
- make_popup(:max_tp,0,gain.to_i)
- @mtp = @actor.maximum_tp
- return true
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def update_params
- return_val = true
- 6.times do |i|
- next unless return_val
- next unless @params[i] != @actor.param(i+2)
- gain = @actor.param(i+2)-@params[i]
- make_popup(:params,i+2,gain.to_i)
- @params[i] = @actor.param(i+2)
- return_val = false
- end
- return return_val
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def make_popup(type,id,value)
- return unless $game_temp.item_pops_on?
- case type
- when :level then item = Popup_Level.new
- when :points then item = Popup_DP.new
- when :sklpts then item = Popup_SP.new
- when :params, :max_tp, :exp
- item = Popup_Statistic.new(type,id)
- end
- return unless item
- # play_pop_noise(type)
- display_popup(item,value)
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def play_pop_noise(type)
- v = Item_Popping::Sound_Fx[type]
- Audio.se_play("Audio\\SE\\#{v[0]}",v[1],v[2])
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def display_popup(item,value)
- SceneManager.scene.spriteset.init_data_popups(item,value)
- end
- end
- #===============================================================================
- class Sprite_PopData < Sprite
- #===============================================================================
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- attr_reader :finished
- #-----------------------------------------------------------------------------
- # Initialize
- #-----------------------------------------------------------------------------
- def initialize(vp=nil,item=nil,amo=0)
- super(vp)
- self.x = Data_Popups::X_Pos - Data_Popups::X_Offset
- self.y = Data_Popups::Y_Pos - Data_Popups::Y_Offset
- self.opacity = Data_Popups::Init_Opacity
- self.bitmap = Bitmap.new(152,24)
- self.z = 300
- init_icon(item.icon_index,item.icon_hue)
- init_text(item)
- init_amount(item,amo)
- @starting = true
- @finished = false
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def init_icon(icon=0,hue=0)
- @icon = Cache.icon(IconEvents::Set,hue)
- rect = Rect.new(icon % 16 * 24, icon / 16 * 24, 24, 24)
- self.bitmap.blt(0, 0, @icon, rect)
- @icon.dispose
- @icon = nil
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def init_text(item)
- x = item.icon_index != 0 ? 24 : 0
- self.bitmap.font.name = Data_Popups::Font
- self.bitmap.font.size = Data_Popups::Font_Size
- self.bitmap.font.bold = Data_Popups::Font_Bold
- self.bitmap.font.italic = Data_Popups::Font_Italic
- self.bitmap.font.color = item.item_disp_color
- self.bitmap.draw_text(x,-2,128,24, item.name)
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def init_amount(item,amount)
- x = item.icon_index != 0 ? 20 : 0
- return unless amount
- self.bitmap.font.name = Data_Popups::Font
- self.bitmap.font.size = Data_Popups::Value_Size
- self.bitmap.font.bold = Data_Popups::Font_Bold
- self.bitmap.font.italic = Data_Popups::Font_Italic
- self.bitmap.font.color = item.item_disp_color
- amount > 0 ? amount = "+#{amount}" : "-#{amount}"
- self.bitmap.draw_text(x,8,128,24,amount)
- end
- #-----------------------------------------------------------------------------
- # Dispose
- #-----------------------------------------------------------------------------
- def dispose
- super
- if self.bitmap != nil
- self.bitmap.dispose
- end
- end
- #-----------------------------------------------------------------------------
- # Update
- #-----------------------------------------------------------------------------
- def update
- super
- if @starting
- self.x += 1 if self.x < Data_Popups::X_Pos
- self.y += 1 if self.y < Data_Popups::Y_Pos
- self.x -= 1 if self.x > Data_Popups::X_Pos
- self.y -= 1 if self.y > Data_Popups::Y_Pos
- else
- self.x += Data_Popups::X_Move
- self.y += Data_Popups::Y_Move
- end
- if @starting
- self.opacity += (Data_Popups::Fade_Speed*2)
- @starting = false if self.opacity >= 255
- else
- self.opacity -= Data_Popups::Fade_Speed
- if self.opacity <= 0
- @finished = true
- end
- end
- end
- end
- #===============================================================================
- module Spriteset_DataPopup
- #===============================================================================
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def load_datapop_data
- disp_data_popups
- @data_pops = []
- @datapopup_vp = Viewport.new(0,0,152, Graphics.height)
- @datapopup_vp.z = Data_Popups::Authority
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def init_data_popups(item,amo=0)
- return unless amo != 0
- @data_pops << Sprite_PopData.new(@datapopup_vp,item,amo)
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def disp_data_popups
- return unless @data_pops
- @data_pops.each do |i|
- next unless i.disposed?
- i.dispose
- @data_pops.delete(i)
- end
- @datapopup_vp.dispose
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def updt_data_popups
- return load_datapop_data unless @data_pops
- @data_pops.each do |i|
- next if i.disposed?
- i.update
- i.dispose if i.finished
- end
- end
- end
- #===============================================================================
- module Spriteset_DataPopup
- #===============================================================================
- def load_datapop_data
- disp_data_popups
- @data_pops = []
- # @datapopup_vp = Viewport.new(0,0,152, Graphics.height)
- # @datapopup_vp.z = Data_Popups::Authority
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def init_data_popups(item,amo=0)
- return unless amo != 0
- @data_pops << Sprite_PopData.new(@deki_vp,item,amo)
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def disp_data_popups
- return unless @data_pops
- @data_pops.each do |i|
- next unless i.disposed?
- i.dispose
- @data_pops.delete(i)
- end
- # @datapopup_vp.dispose
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def updt_data_popups
- return load_datapop_data unless @data_pops
- @data_pops.each do |i|
- next if i.disposed?
- i.update
- i.dispose if i.finished
- end
- end
- end
- #===============================================================================
- module Spriteset_DataPop
- #===============================================================================
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- include Spriteset_DataPopup
- #-----------------------------------------------------------------------------
- # Initialize
- #-----------------------------------------------------------------------------
- def init_datapop
- @data_pop = Epic_Pop_Data.new
- load_datapop_data
- end
- #-----------------------------------------------------------------------------
- # Dispose
- #-----------------------------------------------------------------------------
- def disp_datapop
- disp_data_popups
- end
- #-----------------------------------------------------------------------------
- # Update
- #-----------------------------------------------------------------------------
- def updt_datapop
- updt_data_popups
- @data_pop.update
- end
- end
- #===============================================================================
- class Spriteset_Map
- #===============================================================================
- #-----------------------------------------------------------------------------
- # Included Modules
- #-----------------------------------------------------------------------------
- include Spriteset_DataPop
- #-----------------------------------------------------------------------------
- # Alias List
- #-----------------------------------------------------------------------------
- alias :init_otherpop :initialize
- alias :disp_otherpop :dispose
- alias :updt_otherpop :update
- #-----------------------------------------------------------------------------
- # Initialize
- #-----------------------------------------------------------------------------
- def initialize
- init_datapop if Data_Popups::Show_on_Map
- init_otherpop
- end
- #-----------------------------------------------------------------------------
- # Dispose
- #-----------------------------------------------------------------------------
- def dispose
- disp_datapop if Data_Popups::Show_on_Map
- disp_otherpop
- end
- #-----------------------------------------------------------------------------
- # Update
- #-----------------------------------------------------------------------------
- def update
- updt_datapop if Data_Popups::Show_on_Map
- updt_otherpop
- end
- end
- #===============================================================================
- class Spriteset_Battle
- #===============================================================================
- #-----------------------------------------------------------------------------
- # Included Modules
- #-----------------------------------------------------------------------------
- include Spriteset_DataPop
- #-----------------------------------------------------------------------------
- # Alias List
- #-----------------------------------------------------------------------------
- alias :init_otherpop :initialize
- alias :disp_otherpop :dispose
- alias :updt_otherpop :update
- #-----------------------------------------------------------------------------
- # Initialize
- #-----------------------------------------------------------------------------
- def initialize
- init_datapop if Data_Popups::Show_in_Battle
- init_otherpop
- end
- #-----------------------------------------------------------------------------
- # Dispose
- #-----------------------------------------------------------------------------
- def dispose
- disp_datapop if Data_Popups::Show_in_Battle
- disp_otherpop
- end
- #-----------------------------------------------------------------------------
- # Update
- #-----------------------------------------------------------------------------
- def update
- updt_datapop if Data_Popups::Show_in_Battle
- updt_otherpop
- end
- end
- #==============================================================================#
- # http://dekitarpg.wordpress.com/ #
- #==============================================================================#
- end # if true # << Make true to use this script, false to disable.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement