Advertisement
TheSixth

Timed Enemy Drops for Falcao's ABS

Aug 26th, 2016
629
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. =begin
  2. Timed Enemy Drops v1.1
  3. Made by: Sixth
  4.  
  5. Just a little snippet to make the enemy drops timed in Falcao's ABS.
  6. Once the timer runs out, the item drop will disappear automatically.
  7.  
  8. You can edit the erase timer and the fade out speed at the end of
  9. the timer as well on the commented lines if you want.
  10.  
  11. Put this snippet below the default ABS scripts!
  12.  
  13. =end
  14.  
  15. class Sprite_EnemyDrop < Sprite
  16.  
  17.   alias add_erasetime9271 initialize
  18.   def initialize(viewport, event, item)
  19.     @etime = 1200 # Time in frames to stay on screen (60 frames = 1 second)
  20.     @ftime = 60   # Fade out duration in frames.
  21.     add_erasetime9271(viewport, event, item)
  22.   end
  23.  
  24.   alias upd_erasetime7726 update
  25.   def update
  26.     upd_erasetime7726
  27.     if @etime > 0
  28.       @etime -= 1
  29.       if @etime <= @ftime
  30.         self.opacity -= 255.to_f/@ftime unless self.disposed?
  31.       end
  32.     else
  33.       complete_action(false)
  34.     end
  35.   end
  36.  
  37. end
Advertisement
RAW Paste Data Copied
Advertisement