[XP] Blizz ABS Animated Combo Hud

Started by LiTTleDRAgo, February 11, 2011, 04:23:19 am

Previous topic - Next topic

LiTTleDRAgo

February 11, 2011, 04:23:19 am Last Edit: February 20, 2011, 10:01:18 pm by LiTTleDRAgo
Blizz ABS Animated Combo Hud
Authors: LiTTleDRAgo
Version: 1.00
Type: Blizz-ABS Plugin
Key Term: Blizz-ABS Plugin



Introduction

This is just same as XAS Combo Displayer, except this in Blizz ABS Format


Features


  • Just see screenshot




Screenshots

Spoiler: ShowHide




Demo

---


Script

Spoiler: ShowHide

#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# 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




Instructions

Put below Blizz ABS part 3

Some Default Image Needed

http://www.mediafire.com/?yfklefu9kw39mc9
 
Put them at windowskin folder


Compatibility

Needs Blizz ABS 2.79 or higher, Not tested with SDK


Credits and Thanks


  • LiTTleDRAgo

  • Moghunter for XAS Combo Hit




Author's Notes

Enjoy ~

Blizzard

Oh, shiny. o.o;

Please in future make sure that it's Blizz-ABS Plugin and not Blizz ABS Plugin. Otherwise it will not be recognized by the database index.

I will move this into the database even though the script is not finished yet.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Kagutsuchi

Quote from: Blizzard on February 11, 2011, 04:31:09 am
Oh, shiny. o.o;

Please in future make sure that it's Blizz-ABS Plugin and not Blizz ABS Plugin. Otherwise it will not be recognized by the database index.

I will move this into the database even though the script is not finished yet.

Dunno how you programmed the database indexer, but shouldn't you throw in some "or"?

Awesome script btw, not figured out how to make/use combos yet so dunno if I will use it or not.
(Not that I have looked too much into it yet :P)

LiTTleDRAgo

Spoiler: ShowHide

a normal repeated attack/skill will do that too though, not just combo

Blizzard

February 11, 2011, 06:01:13 am #4 Last Edit: February 11, 2011, 06:04:46 am by Blizzard
Quote from: Kagutsuchi on February 11, 2011, 04:51:49 am
Dunno how you programmed the database indexer, but shouldn't you throw in some "or"?


Why should I? If people don't have enough discipline to write something right, then I guess they don't care if their script gets more downloads and usage or not.
The Key Term is Blizz-ABS Plugin. It's not blizzabs plugin, it's not BlizzABS plugin, it's not BLIZZ-ABS plugin, it's not blizz-ABS Plugin, it's not blizz abs plugin, it's Blizz-ABS Plugin.

All I am asking for is that you type it down properly. Heck, you can even copy-paste it from the template thread. I don't think it is too much to ask.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Kagutsuchi

Blizzard have spoken and it was good.

@LiTTleDRAgo: Try sending Winkio a pm, he deals with blizz abs related problems now.

LiTTleDRAgo

I didn't realize there are such simpler method to aliasing them XD
update the script to version 0.02

RoseSkye


SBR*


elmangakac


LiTTleDRAgo

I'll reupload them tomorrow


------

edit : Image reuploaded

http://www.mediafire.com/?yfklefu9kw39mc9

Killerclaws

Hey, sorry to necropost, but I had a question.
Is there any other way to get the image files? The link just popped up a page that said the files had been removed. I'd really like to use this script(it seems awesome!), so is there any way I could get the images somewhere, or maybe tell me what I'd need to do to make my own? Thanks!