Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:
- # Multi Treasure Info
- # Version: 2.5
- # Author : LiTTleDRAgo
- #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:
- module DRG_TREASURE_INFO
- MTI_HUD_X = 0
- MTI_HUD_Y = 320
- MTI_TIME = 2
- WINDOW_PRIORITY_Z = 99999
- FONT = ['Monotype Corsiva',Font.default_name]
- SIZE = 20
- ACT_SE = 'Mana - Menu-01'
- end
- ($imported ||= {})[:drago_multi_treasure_info] = 2.5
- #==============================================================================
- # ■ MTI
- #==============================================================================
- class Mti < Sprite
- include DRG_TREASURE_INFO
- #--------------------------------------------------------------------------
- # ● Initialize
- #--------------------------------------------------------------------------
- def init
- setup
- @inf = Sprite.new
- @inf.bitmap = Bitmap.new(120,70)
- @inf.z = 2 + WINDOW_PRIORITY_Z
- @inf.x = MTI_HUD_X
- @inf.y = MTI_HUD_Y
- @inf.bitmap.font.name = 'Georgia'
- @inf.bitmap.font.size = 30
- @inf.bitmap.font.italic = true
- @inf.bitmap.font.color = Color.new(255, 255, 128, 255)
- @inf.bitmap.draw_text(5, 4, 120, 40, 'Get',0)
- @inf.opacity = 0
- @inf.visible = true
- end
- #-------------------------------------------------------------------------
- # ● Setup
- #--------------------------------------------------------------------------
- def setup
- $game_temp.mti_text_x = 0
- $game_temp.mti_text_y = -80
- $game_temp.mti_text_zoom_x = 1.00
- $game_temp.mti_text_zoom_y = 1.00
- end
- #--------------------------------------------------------------------------
- # ● Update
- #--------------------------------------------------------------------------
- def update
- super
- update_start_move
- if $game_temp.mti_text.is_a?(Array) && $game_temp.mti_text.size > 0
- refresh
- end
- end
- #--------------------------------------------------------------------------
- # ● Dispose
- #--------------------------------------------------------------------------
- def dispose
- return super if @text.nil?
- @text.each {|i| i.disposed? || i.dispose }
- @inf && (@inf.disposed? || @inf.dispose)
- super
- end
- #--------------------------------------------------------------------------
- # ● Refresh
- #--------------------------------------------------------------------------
- def refresh
- init if @inf.nil? || @inf.disposed? || !$game_temp.mti_text_zoom_x
- $game_temp.mti_text.each_with_index do |e,i|
- count = @text.size
- if @text[count].nil?
- @text[count] = Sprite.new
- @text[count].bitmap = Bitmap.new(120,40)
- @text[count].z = 2 + WINDOW_PRIORITY_Z
- @text[count].bitmap.font.name = FONT
- @text[count].bitmap.font.size = SIZE
- end
- @text[count].bitmap.clear
- @text[count].opacity = 0
- @text[count].zoom_x = 1.50
- @text[count].z = @inf.z - 1
- @text[count].x = @inf.x + 20
- @text[count].y = @inf.y
- @text[count].ox = @inf.ox + $game_temp.mti_text_x
- @text[count].oy = @inf.oy + $game_temp.mti_text_y
- @text[count].zoom_x = $game_temp.mti_text_zoom_x
- @text[count].zoom_y = $game_temp.mti_text_zoom_y
- @text[count].bitmap.draw_text(0, 0, 120, 40, e.to_s,0)
- @text[count].visible = true
- if count == 0
- @time[count] = [$game_temp.mti_text_time*40, 0].max + ((count+1) * 15)
- else
- @time[count] = [$game_temp.mti_text_time*40, @time[count-1]].max + 15
- end
- end
- $game_temp.mti_text.clear
- end
- #--------------------------------------------------------------------------
- # ● Update Start Move
- #--------------------------------------------------------------------------
- def update_start_move
- @text ||= []
- @time ||= []
- @text.each_index do |i|
- if !@time[i].nil? and @time[i] > 0
- time = i == 0 ? true : @time[i] < ($game_temp.mti_text_time * 40) + 15
- if time
- if @text[i].opacity < 255
- @text[i].opacity += 10
- else
- @text[i].oy += 1
- end
- end
- @time[i] -= 1
- else
- if @text[i].opacity > 0
- @text[i].opacity -= 8
- @text[i].oy += 1
- else
- @text[i].visible = false
- @text[i].dispose
- @time[i] = nil
- end
- end
- end
- @text.reject! {|s| s.disposed? }
- @time.compact!
- if @text.size > 0
- @inf || init
- @inf.opacity += 10 if @inf.opacity < 255
- else
- if @inf && !@inf.disposed?
- @inf.opacity -= 10 if @inf.opacity > 0
- if @inf.opacity == 0
- @inf.dispose
- @inf = nil
- end
- end
- end
- end
- end
- #===============================================================================
- # ■ Interpreter
- #===============================================================================
- class Interpreter
- #--------------------------------------------------------------------------
- # ● multi_treasure_info_popup(text)
- #--------------------------------------------------------------------------
- def multi_treasure_info_popup(text)
- $game_temp.mti_text ||= []
- $game_temp.mti_text << text
- $game_temp.mti_text_time = DRG_TREASURE_INFO::MTI_TIME
- $game_temp.mti_text_x ||= 0
- $game_temp.mti_text_y ||= 0
- play_se_itm
- end
- #--------------------------------------------------------------------------
- # ● Play SE
- #--------------------------------------------------------------------------
- def play_se_itm
- Audio.se_play('Audio/SE/'+DRG_TREASURE_INFO::ACT_SE , 70, 100) rescue nil
- end
- #--------------------------------------------------------------------------
- # * Change Items
- #--------------------------------------------------------------------------
- ['125','126','127','128'].each_with_index {|i,s| eval "
- alias drg158_#{i} command_#{i} unless method_defined?(:drg158_#{i})
- def command_#{i}
- value = #{s} == 0 ?
- operate_value(@parameters[0], @parameters[1], @parameters[2]) :
- operate_value(@parameters[1], @parameters[2], @parameters[3])
- text =#{s}==1 ? 'Items' : #{s}==2 ? 'Weapons' : 'Armors'
- text =#{s}!=0 ? load_data('Data/'+text+'.rxdata')[@parameters[0]].name : ''
- text =#{s}==0 ? $data_system.words.gold.to_s : text
- text =value.to_s + ' x ' + text
- multi_treasure_info_popup(text) if value > 0
- drg158_#{i}
- end#"}
- end
- #==============================================================================
- # ■ Scene_Map
- #==============================================================================
- class Scene_Map
- #--------------------------------------------------------------------------
- # ● Main
- #--------------------------------------------------------------------------
- alias drgXp_mti_main main unless method_defined?(:drgXp_mti_main)
- alias drgXp_mti_update update unless method_defined?(:drgXp_mti_update)
- def main
- drgXp_mti_main
- @mti.dispose
- end
- #--------------------------------------------------------------------------
- # ● Update
- #--------------------------------------------------------------------------
- def update
- drgXp_mti_update
- @mti.nil? ? @mti = Mti.new : @mti.update
- end
- end
- #==============================================================================
- # ■ Game_Temp
- #==============================================================================
- class Game_Temp
- attr_accessor :mti_text_x,:mti_text_y,
- :mti_text_zoom_x,:mti_text_zoom_y,
- :mti_text,:mti_text_time
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement