Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #==============================================================================#
- # Multi Treasure Info #
- # Version: 2.0 #
- # By LiTTleDRAgo #
- #==============================================================================#
- module DRG_TREASURE_INFO
- MTI_HUD_X = -20
- MTI_HUD_Y = 420 - 100
- MTI_TIME = 1
- WINDOW_PRIORITY_Z = 99999
- FONT = 'Monotype Corsiva'
- SIZE = 20
- ACT_SE = 'Mana - Menu-01'
- end
- #==============================================================================
- # ■ 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.oy = -MTI_HUD_Y + 50
- @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_circle_gradient(24, 24, 25, Color.gray,45,1)
- @inf.bitmap.draw_text(5, 4, 120, 40, 'Get',0)
- @inf.opacity = 0
- end
- #--------------------------------------------------------------------------
- # ● Setup
- #--------------------------------------------------------------------------
- def setup
- $game_temp.mti_text_x = 0
- $game_temp.mti_text_y = 0
- $game_temp.mti_text_zoom_x = 1.00
- $game_temp.mti_text_zoom_y = 1.00
- $game_temp.mti_text_opa = 0
- end
- #--------------------------------------------------------------------------
- # ● Update
- #--------------------------------------------------------------------------
- def update
- super
- update_start_move
- refresh if $game_temp.mti_start
- end
- #--------------------------------------------------------------------------
- # ● Dispose
- #--------------------------------------------------------------------------
- def dispose
- return super if @text.nil?
- @text.each {|i| i.dispose if !i.nil?}
- @inf.dispose if !@inf.nil?
- super
- end
- #--------------------------------------------------------------------------
- # ● Refresh
- #--------------------------------------------------------------------------
- def refresh
- $game_temp.mti_start = false
- init if @inf.nil?
- (@count.nil? || @count >= 5) ? @count = 0 : @count += 1
- 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 = 100
- @text[@count].zoom_x = 1.50
- @text[@count].oy = -MTI_HUD_Y + 5 + $game_temp.mti_text_y
- @text[@count].ox = -MTI_HUD_X - 50 + $game_temp.mti_text_x
- @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, $game_temp.mti_text.to_s,0)
- @text[@count].visible = true
- @time[@count] = MTI_TIME * 40
- end
- #--------------------------------------------------------------------------
- # ● Update Start Move
- #--------------------------------------------------------------------------
- def update_start_move
- @text,@time = [],[] if @text.nil? or @time.nil?
- v = @count.nil? ? 0 : @count
- return if @text[v].nil?
- if !@time[v].nil? and @time[v] > 0
- if @text[v].opacity < 255
- @text[v].oy = -MTI_HUD_Y + 5 + $game_temp.mti_text_y
- @text.each_index {|i|
- if v != i && !@text[i].nil?
- @text[i].oy += 1
- @text[i].opacity -= 5 if @text[v-i].opacity > 0
- end}
- @text[v].opacity += 10
- end
- @inf.opacity += 10 if @inf.opacity < 255
- else
- @text.each_index {|i|
- if @text[i].opacity > 0
- @text[i].opacity -= 5
- @text[i].oy += 1
- else
- @text[i].visible = false
- end}
- @inf.opacity -= 10 if @inf.opacity > 0
- end
- @time[v] -= 1 if @time[v] > 0
- end
- end
- #===============================================================================
- # ■ Interpreter
- #===============================================================================
- class Interpreter
- #--------------------------------------------------------------------------
- # ● multi_treasure_info_popup(text)
- #--------------------------------------------------------------------------
- def multi_treasure_info_popup(text)
- $game_temp.mti_text = text
- $game_temp.mti_text_time = 40 * DRG_TREASURE_INFO::MTI_TIME
- $game_temp.mti_start = true
- end
- #--------------------------------------------------------------------------
- # ● Play SE
- #--------------------------------------------------------------------------
- def play_se_itm
- Audio.se_play('Audio/SE/'+DRG_TREASURE_INFO::ACT_SE , 70, 100) rescue nil
- end
- #--------------------------------------------------------------------------
- # ● Change Gold
- #--------------------------------------------------------------------------
- alias drgXp_command_125 command_125
- def command_125
- drgXp_command_125
- value = operate_value(@parameters[0], @parameters[1], @parameters[2])
- text = value.to_s + ' ' + $data_system.words.gold
- multi_treasure_info_popup(text) if value > 0
- end
- #--------------------------------------------------------------------------
- # ● Display Item Animaton
- #--------------------------------------------------------------------------
- alias drgXp_display_item_animaton display_item_animaton
- def display_item_animaton(damage_item,gold_effect,value,item_name)
- drgXp_display_item_animaton(damage_item,gold_effect,value,item_name)
- if damage_item == nil
- text = value.to_s + ' x ' + item_name
- multi_treasure_info_popup(text) if value > 0
- play_se_itm if value > 0
- elsif gold_effect != nil
- text = gold_effect.to_s + ' ' + $data_system.words.gold
- multi_treasure_info_popup(text) if value > 0
- play_se_itm if value > 0
- end
- end
- #--------------------------------------------------------------------------
- # ● Command_127 (WEAPON)
- #--------------------------------------------------------------------------
- alias drgXp_item_command_127 command_127
- def command_127
- drgXp_item_command_127
- value = operate_value(@parameters[1], @parameters[2], @parameters[3])
- item_name = load_data('Data/Weapons.rxdata')
- text = value.to_s + ' x ' + item_name[@parameters[0]].name
- multi_treasure_info_popup(text) if value > 0
- end
- #--------------------------------------------------------------------------
- # ● Command_128 (ARMOR)
- #--------------------------------------------------------------------------
- alias drgXp_command_128 command_128
- def command_128
- drgXp_command_128
- value = operate_value(@parameters[1], @parameters[2], @parameters[3])
- item_name = load_data('Data/Armors.rxdata')
- text = value.to_s + ' x ' + item_name[@parameters[0]].name
- multi_treasure_info_popup(text) if value > 0
- end
- end
- #==============================================================================
- # ■ Scene_Map
- #==============================================================================
- class Scene_Map
- #--------------------------------------------------------------------------
- # ● Main
- #--------------------------------------------------------------------------
- alias drgXp_mti_main main
- def main
- drgXp_mti_main
- @mti.dispose
- end
- #--------------------------------------------------------------------------
- # ● Update
- #--------------------------------------------------------------------------
- alias drgXp_mti_update 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_opa,:mti_text,:mti_text_time,:mti_start
- end
- $drago_multi_treasure_info = true
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement