Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
- # Blizz ABS Animated Combo Hud
- # Version: 1.00
- # Author : LiTTleDRAgo
- #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
- #==============================================================================#
- #
- # Explanation :
- # Displays the amount of hits and total damage caused to an enemy.
- #
- # Graphics required:
- #
- # Combo_Damage
- # Combo_Hud
- # Combo_Number
- #
- # All images must be in the Windowskin folder.
- #
- # Special Thanks :
- # Moghunter for XAS Combo Hit
- #
- #==============================================================================#
- module LiTTleDRAgo
- BLIZZ_ABS_COMBO_TIME = 1 # Time displayed on-screen
- BLIZZ_ABS_COMBO_X = 450 # Position of the Combo HUD
- BLIZZ_ABS_COMBO_Y = 30
- end
- #===============================================================================
- # Map_Battler
- #===============================================================================
- class Map_Battler < Game_Character
- if BlizzABS::VERSION >= 2.7
- #--------------------------------------------------------------------------
- # Action Effect
- #--------------------------------------------------------------------------
- alias action_effect_earlier action_effect
- def action_effect(object)
- action_effect_earlier(object)
- combo_displayer
- end
- #--------------------------------------------------------------------------
- # Combo Displayer
- #--------------------------------------------------------------------------
- def combo_displayer
- if self.damage_done?
- if @battler.is_a?(Game_Actor)
- $game_temp.xvtr_max_damage = 0
- $game_temp.xvtrcombo = 0
- else
- $game_temp.xvtr_max_damage += @battler.hpdamage.to_i.abs
- $game_temp.xvtrcombo += 1
- $game_temp.xvtrcombotime = 3
- $game_temp.xvtrcombotime2 = 40 * LiTTleDRAgo::BLIZZ_ABS_COMBO_TIME
- end
- end
- end
- end
- end
- #===============================================================================
- # Combo_Hud
- #===============================================================================
- class Combo_Hud < Sprite
- #--------------------------------------------------------------------------
- # Initialize
- #--------------------------------------------------------------------------
- def initialize
- @viewport = Viewport.new(0, 0, 640, 480)
- @viewport.z = 9999
- super(@viewport)
- @combo_hit = $game_temp.xvtrcombo
- @combo, @total, @hud = Sprite.new, Sprite.new, Sprite.new
- @combo_image = RPG::Cache.windowskin("Combo_Number")
- @total_image = RPG::Cache.windowskin("Combo_damage")
- @hud.bitmap = RPG::Cache.windowskin("Combo_HUD")
- @combo_bitmap = Bitmap.new(@combo_image.width,@combo_image.height)
- @total_bitmap = Bitmap.new(@combo_image.width,@combo_image.height)
- @combo.bitmap = @combo_bitmap
- @total.bitmap = @total_bitmap
- @combo_im_cw = @combo_image.width / 10
- @combo_im_ch = @combo_image.height
- @total_im_cw = @total_image.width / 10
- @total_im_ch = @total_image.height
- @combo_number_text = @combo_hit.abs.to_s.split(//)
- @total_number_text = $game_temp.xvtr_max_damage.abs.to_s.split(//)
- for r in 0..@combo_number_text.size - 1
- @combo_number_abs = @combo_number_text[r].to_i
- @combo_src_rect = Rect.new (@combo_im_cw *
- @combo_number_abs, 0, @combo_im_cw, @combo_im_ch)
- @combo_bitmap.blt(40 + ((@combo_im_cw - 12) * r),
- 0, @combo_image, @combo_src_rect)
- end
- for r in 0..@total_number_text.size - 1
- @total_number_abs = @total_number_text[r].to_i
- @total_src_rect = Rect.new(@total_im_cw *
- @total_number_abs, 0, @total_im_cw, @total_im_ch)
- @total_bitmap.blt(40 + ((@total_im_cw - 12) * r),
- 0, @total_image, @total_src_rect)
- end
- @combo.z, @total.z, @hud.z = 5009, 5009, 5008
- @combo.ox = $game_temp.xvtrhitwin_x
- @combo.oy = $game_temp.xvtrhitwin_y
- @total.ox = $game_temp.xvtrdamwin_x
- @total.oy = $game_temp.xvtrdamwin_y
- @hud.ox = $game_temp.xvtrhudwin_x
- @hud.oy = $game_temp.xvtrhudwin_y
- @combo.zoom_x = $game_temp.xvtrhitwin_zoom_x
- @combo.zoom_y = $game_temp.xvtrhitwin_zoom_y
- @total.zoom_x = $game_temp.xvtrdamwin_zoom_x
- @total.zoom_y = $game_temp.xvtrdamwin_zoom_y
- @combo.opacity = $game_temp.xvtrhitwin_opa
- @total.opacity = $game_temp.xvtrdamwin_opa
- @hud.opacity = $game_temp.xvtrhudwin_opa
- @combo.x = LiTTleDRAgo::BLIZZ_ABS_COMBO_X
- @combo.y = LiTTleDRAgo::BLIZZ_ABS_COMBO_Y
- @total.x = LiTTleDRAgo::BLIZZ_ABS_COMBO_X
- @total.y = LiTTleDRAgo::BLIZZ_ABS_COMBO_Y
- @hud.x = LiTTleDRAgo::BLIZZ_ABS_COMBO_X
- @hud.y = LiTTleDRAgo::BLIZZ_ABS_COMBO_Y
- if @combo_hit <= 0
- @combo.opacity = 0
- @combo.visible = @hud.visible = @total.visible = false
- else
- @combo.visible = @hud.visible = @total.visible = true
- end
- end
- #--------------------------------------------------------------------------
- # Dispose
- #--------------------------------------------------------------------------
- def dispose
- [@combo_bitmap, @combo.bitmap, @combo, @hud.bitmap, @hud, @total_bitmap,
- @total, @viewport].each {|s| s.dispose if s != nil}
- [@combo_bitmap, @combo.bitmap, @combo, @hud.bitmap, @hud, @total_bitmap,
- @total, @viewport].each {|s| s = nil if s != nil}
- end
- #--------------------------------------------------------------------------
- # Refresh
- #--------------------------------------------------------------------------
- def refresh
- @combo_hit = $game_temp.xvtrcombo
- combo_strike_valor = 0.1 *@combo_hit / 10
- $game_temp.xvtrhitwin_zoom_x = 2; $game_temp.xvtrhitwin_zoom_y = 2
- $game_temp.xvtrhitwin_opa = 70; $game_temp.xvtrhitwin_x = 15
- $game_temp.xvtrhitwin_y = -10 ; $game_temp.xvtrhudwin_x = 0
- $game_temp.xvtrhudwin_y = -100; $game_temp.xvtrhudwin_opa = 255
- $game_temp.xvtrdamwin_zoom_x = 1; $game_temp.xvtrdamwin_zoom_y = 1
- $game_temp.xvtrdamwin_opa = 100; $game_temp.xvtrdamwin_x = -85
- $game_temp.xvtrdamwin_y = -80; @combo.bitmap.clear
- @combo_number_text = @combo_hit.abs.to_s.split(//)
- for r in 0..@combo_number_text.size - 1
- @combo_number_abs = @combo_number_text[r].to_i
- @combo_src_rect = Rect.new(@combo_im_cw *
- @combo_number_abs, 0, @combo_im_cw, @combo_im_ch)
- @combo_bitmap.blt(40 + ((@combo_im_cw - 12) * r),
- 0, @combo_image, @combo_src_rect)
- end
- @total.bitmap.clear
- @total_number_text = $game_temp.xvtr_max_damage.abs.to_s.split(//)
- for r in 0..@total_number_text.size - 1
- @total_number_abs = @total_number_text[r].to_i
- @total_src_rect = Rect.new(@total_im_cw *
- @total_number_abs, 0, @total_im_cw, @total_im_ch)
- @total_bitmap.blt(40 + ((@total_im_cw - 12) * r),
- 20, @total_image, @total_src_rect)
- end
- hud_pos_update
- @combo.visible = @hud.visible = @total.visible = true
- end
- #--------------------------------------------------------------------------
- # Hud Pos Update
- #--------------------------------------------------------------------------
- def hud_pos_update
- @combo.ox = $game_temp.xvtrhitwin_x
- @combo.oy = $game_temp.xvtrhitwin_y
- @combo.zoom_x = $game_temp.xvtrhitwin_zoom_x
- @combo.zoom_y = $game_temp.xvtrhitwin_zoom_y
- @combo.opacity = $game_temp.xvtrhitwin_opa
- @hud.ox = $game_temp.xvtrhudwin_x
- @hud.oy = $game_temp.xvtrhudwin_y
- @hud.opacity = $game_temp.xvtrhudwin_opa
- @total.ox = $game_temp.xvtrdamwin_x
- @total.oy = $game_temp.xvtrdamwin_y
- @total.zoom_x = $game_temp.xvtrdamwin_zoom_x
- @total.zoom_y = $game_temp.xvtrdamwin_zoom_y
- @total.opacity = $game_temp.xvtrdamwin_opa
- end
- #--------------------------------------------------------------------------
- # Slide Update
- #--------------------------------------------------------------------------
- def slide_update
- if $game_temp.xvtrcombotime > 0 && $game_temp.xvtrcombo > 0
- if $game_temp.xvtrdamwin_x < -65
- $game_temp.xvtrdamwin_x += 1; $game_temp.xvtrdamwin_opa += 8
- elsif $game_temp.xvtrdamwin_x <= -65
- $game_temp.xvtrdamwin_x, $game_temp.xvtrdamwin_opa = -65, 255
- end
- if $game_temp.xvtrcombotime > 0.1
- $game_temp.xvtrhitwin_zoom_x -= 0.05;$game_temp.xvtrhitwin_zoom_y -= 0.05
- $game_temp.xvtrhitwin_opa += 8
- elsif $game_temp.xvtrcombotime <= 0.1 && $game_temp.xvtrcombo > 0
- $game_temp.xvtrhitwin_zoom_x = $game_temp.xvtrhitwin_zoom_y = 1
- $game_temp.xvtrhitwin_opa = 255; $game_temp.xvtrhitwin_x = 10
- $game_temp.xvtrhitwin_y = -115
- end
- $game_temp.xvtrhitwin_x -= 5 if $game_temp.xvtrhitwin_x > 25
- $game_temp.xvtrhitwin_y -= 5 if $game_temp.xvtrhitwin_y > -105
- elsif @combo.visible == true && $game_temp.xvtrcombotime2 < 80
- $game_temp.xvtrhitwin_x -= 5; $game_temp.xvtrhitwin_opa -= 10
- $game_temp.xvtrdamwin_x -= 3; $game_temp.xvtrdamwin_opa -= 10
- $game_temp.xvtrhudwin_x += 5; $game_temp.xvtrhudwin_opa -= 10
- $game_temp.xvtrcombo = $game_temp.xvtr_max_damage = 0
- @combo_hit = $game_temp.xvtrcombo
- end
- end
- #--------------------------------------------------------------------------
- # Update
- #--------------------------------------------------------------------------
- def update
- @combo.visible = @hud.visible = @total.visible = false if @combo.opacity <= 0
- hud_pos_update; @combo_hit = $game_temp.xvtrcombo if $game_temp.xvtrcombo == 0
- slide_update; refresh if @combo_hit != $game_temp.xvtrcombo && $game_temp.xvtrcombo != 0
- end
- end
- #===============================================================================
- # Scene_Map
- #===============================================================================
- class Scene_Map
- #--------------------------------------------------------------------------
- # Main
- #--------------------------------------------------------------------------
- alias xvtrcombo_main main
- def main
- @combosprite_hud = Combo_Hud.new
- xvtrcombo_main
- @combosprite_hud.dispose
- @combosprite_hud = nil
- end
- #--------------------------------------------------------------------------
- # Update
- #--------------------------------------------------------------------------
- alias xvtrcombo_update update
- def update
- xvtrcombo_update
- $game_temp.xvtrcombotime -= 0.15
- $game_temp.xvtrcombotime2 -= 1
- @combosprite_hud.update
- end
- end
- #==============================================================================
- # Game_Temp
- #==============================================================================
- class Game_Temp
- attr_accessor :xvtrcombo
- attr_accessor :xvtrcombotime
- attr_accessor :xvtrcombotime2
- attr_accessor :xvtrcombowin_x
- attr_accessor :xvtrcombowin_y
- attr_accessor :xvtrcomboopa
- attr_accessor :xvtr_hit
- attr_accessor :xvtr_max_damage
- attr_accessor :xvtrhitwin_x
- attr_accessor :xvtrhitwin_y
- attr_accessor :xvtrhitwin_opa
- attr_accessor :xvtrhitwin_zoom_x
- attr_accessor :xvtrhitwin_zoom_y
- attr_accessor :xvtrdamwin_x
- attr_accessor :xvtrdamwin_y
- attr_accessor :xvtrdamwin_opa
- attr_accessor :xvtrdamwin_zoom_x
- attr_accessor :xvtrdamwin_zoom_y
- attr_accessor :xvtrhudwin_x
- attr_accessor :xvtrhudwin_y
- attr_accessor :xvtrhudwin_opa
- #--------------------------------------------------------------------------
- # Initialize
- #--------------------------------------------------------------------------
- alias drago_xvtrcombo_initialize initialize
- def initialize
- drago_xvtrcombo_initialize
- @xvtrcombo = @xvtrcombotime = @xvtrcombotime2 = 0
- @xvtrcombowin_x = -200; @xvtrhudwin_x = 0
- @xvtrcombowin_y = 0; @xvtrhudwin_y = 0
- @xvtrhitwin_x = 0; @xvtrdamwin_x = 0
- @xvtrhitwin_y = 0; @xvtrdamwin_y = 0
- @xvtrcomboopa = @xvtr_hit = @xvtr_max_damage = 0
- @xvtrhitwin_zoom_x = @xvtrdamwin_zoom_x = 1
- @xvtrhitwin_zoom_y = @xvtrdamwin_zoom_y = 1
- @xvtrhitwin_opa = @xvtrhudwin_opa = @xvtrdamwin_opa = 0
- end
- end
- $drago_xvtr_animated_combo_hit = true
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement