[XP] MOVELESS::DAMAGE for Blizz-ABS!

Started by Jragyn, February 26, 2010, 08:55:13 pm

Previous topic - Next topic

Jragyn

February 26, 2010, 08:55:13 pm Last Edit: December 28, 2010, 07:27:44 pm by game_guy
MOVELESS::DAMAGE for Blizz-ABS!
Authors: Blizzard, Jragyn
Version: 1.0
Type: Blizz-ABS Plug-In
Key Term: Blizz-ABS Plugin



Introduction
The script will disable the movement of the damage sprite when displayed on the screen.



Features


  • Fading!
  • Random pop location!




Screenshots
A little difficult to demostrate, but I try anyways:
Spoiler: ShowHide



Demo
There isn't much a need for a full-on Demo.


Script
Spoiler: ShowHide

#===========================#
#  J::DAMAGE for BlizzABS!  #
#    v. 1.0                 #
#      Jragyn, Blizzard     #
#===========================#

=begin
 This script really is more a scriptlet than anything else,
 as it just modifies a few small aesthetic-styled details.
 
 It causes damage to not bounce around anymore, but instead
 just kinda sits there, and fades out. I created it because
 I wanted to see the damage for longer, and now I share it
 with the world!
=end

module JDMG
# This will create a random location for the damage to pop up over the target.
 RANDOM   = true

# This will STOP the damage from physically moving.
 MOVELESS = true
 
# This will drag out the fading a bit longer, so you can see the damage longer.
 FADEOUT  = true
 
end

class Sprite_Damage < Sprite
 
 def initialize(request, viewport = nil)
   super(viewport)
   draw_damage(request)
#=======================================#
#  Though it doesn't move,              #
#  it DOES pick random locations        #
#  from the base area of the sprite     #
#=======================================#
 if JDMG::RANDOM && JDMG::MOVELESS     #
   @map_x = request.x + rand(40) - 20  #
   @map_y = request.y + rand(40) - 40  #
 elsif JDMG::RANDOM                    #
   @map_x = request.x                  #
   @map_y = request.y                  #
 else                                  #
#=======================================#
   @map_x = request.x
   @map_y = request.y
 end
   self.z = 1
   rad = rand(360) * Math::PI / 180
   @vx, @vy = -Math.cos(rad) * 3, Math.sin(rad) * 2
   @counter = Math::PI
   update
 end
 
 def update
   self.x = @map_x - self.bitmap.width / 2 - $game_map.display_x / 4
   self.y = @map_y - self.bitmap.height / 2 - $game_map.display_y / 4
#====================================#
#  Added to remove the move factor!  #
#====================================#
 if JDMG::MOVELESS                  #
 # Nothing                          #
 else                               #
#====================================#
   self.ox, self.oy = @vx * (@counter - Math::PI), @vy * (@counter - Math::PI)
 end
   @counter += 1
   if BlizzABS::Config::BOUNCING_DAMAGE
     self.oy += (Math.sin((@counter - Math::PI) / 5.0) * 800 / (@counter)).abs
     self.opacity -= 15 if @counter > 35
   else
#====================================#
#  Added to remove the move factor!  #
#====================================#
 if JDMG::MOVELESS                  #
 # Nothing                          #
 else                               #
#====================================#
   self.oy += (Math.sin((@counter - Math::PI) / 10.0) * 1200 / (@counter)).abs
 end
#========================================#
#  This piece creates a slower fade out  #
#  compared to original design.          #
#========================================#
 if JDMG::FADEOUT                       #
   self.opacity -= 5 if @counter > 20   #
 else                                   #
#========================================#
   self.opacity -= 15 if @counter > 15  
 end
   end
   if @critical && Graphics.frame_count % 2 == 0
     self.bitmap.hue_change(60)
   end
 end
end



Instructions
It seems to only function when inserted BENEATH the Blizz-ABS system.


Compatibility

--So long as Blizz-ABS has used the damage drawing methods currently in use, this script should work.

--I suppose it wouldn't work if something else was directly modified these methods.

--EXPLICITLY FOR BLIZZ-ABS. (if it need be said)


Credits and Thanks


  • I didn't really write much, but me! Jragyn. Use it wherever, I don't care.
  • Blizzard! Because obviously this piece would have no use/purpose.
  • RMVX! For teaching what little I know about modules and their use :D



Author's Notes
No special notes, just remember: Below Blizz-ABS Or it won't do anything!
Feel free to use this script at your leisure, of course in conjunction with Blizzard's
contracts he mandates with his ABS.
A bright light can either illuminate or blind, but how will you know which until you open your eyes?

G_G

Very nice job! *moves to the database*