jellyjelly

Jelly's Poison Flash Extension

Sep 9th, 2015
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.56 KB | None | 0 0
  1. #===============================================================================
  2. # ** Jelly's Poison Flash Extension [v1.1]
  3. # Fourm Post: http://goo.gl/QVuvPt
  4. #-------------------------------------------------------------------------------
  5. # - Lets you select a switch to toggle the damage flash from walking while
  6. # poisoned or on a damage tile.
  7. # - Assign a sound to play when the flash occurs.
  8. # - Alter the duration, color and alpha of the flash.
  9. #===============================================================================
  10. # ** Credit
  11. #-------------------------------------------------------------------------------
  12. # - Free to use in commercial and otherwise.
  13. # - A little shoutout to myself is appreciated.
  14. # - What I do require is that if you complete a game I be allowed to list it as
  15. # something my work has been included in. I can be contacted at:
  16. # [email protected] Just make sure to have a relevant subject line!
  17. #===============================================================================
  18. # ** Change Log
  19. #-------------------------------------------------------------------------------
  20. # 9/9/15 - v1.1
  21. # - Settable/togglable sound on proc
  22. # - Settable duration/color/alpha of flash
  23. # 9/8/15 - v1.0
  24. # - Initial toggle support
  25. #===============================================================================
  26. # ** Future Features
  27. #-------------------------------------------------------------------------------
  28. # - Editable amount of damage from damage tiles.
  29. # - Two separate methods for poison and damage tiles procs. Allows for
  30. # separate colors and sounds for each.
  31. # - Frequency of poison/damage tile proc. Editable number of steps for each
  32. # type. Perhaps even a editable range.
  33. # - Use of a picture as the flash.
  34. #===============================================================================
  35. # ** Compatibility
  36. #-------------------------------------------------------------------------------
  37. # This script aliases start_flash_for_damage in Game_Screen, a method I have
  38. # rarely seen used. I doubt it will cause any issues.
  39. #===============================================================================
  40. #EDITABLE================EDITABLE===============EDITABLE================EDITABLE
  41. #========EDITABLE================EDITABLE===============EDITABLE================
  42. #================EDITABLE================EDITABLE===============EDITABLE========
  43. # Configuration Module
  44. #-------------------------------------------------------------------------------
  45. module JELLY
  46. FLASH_SWITCH = 1 # change this number to the switch you wish to toggle the flash
  47. SOUND_SWITCH = 2 # change this number to the switch you wish to toggle the sound that plays on flash
  48. FLASH_SOUND = ["Poison",60,100] # the name of the SE to play, volume, pitch of the SE to be played. MUST be in the SE folder
  49. FLASH_COLOR = [255, 0, 0, 128] # the color and alpha of the flash # default is 255, 0, 0, 128
  50. FLASH_DURATION = 8 # the time (in frames) the flash will be on the screen. If you would like to flash in seconds multiply by 60 # default is 8 frames
  51. end
  52. #===============================================================================
  53. #===============================================================================
  54. #===============================================================================
  55. # EDIT AT OWN RISK
  56. #===============================================================================
  57. # ** Game_Screen
  58. #-------------------------------------------------------------------------------
  59. # This class handles screen maintenance data, such as changes in color tone,
  60. # flashes, etc. It's used within the Game_Map and Game_Troop classes.
  61. #===============================================================================
  62. class Game_Screen
  63. #-----------------------------------------------------------------------------
  64. # * Start Flash (for Poison/Damage Floor)
  65. #-----------------------------------------------------------------------------
  66. def start_flash_for_damage
  67. alias jelly_start_flash_for_damage start_flash_for_damage
  68. if $game_switches[JELLY::FLASH_SWITCH] == true
  69. if $game_switches[JELLY::SOUND_SWITCH] == true
  70. Audio.se_play("Audio/SE/"+JELLY::FLASH_SOUND[0],JELLY::FLASH_SOUND[1],JELLY::FLASH_SOUND[2])
  71. end
  72. start_flash(Color.new(*JELLY::FLASH_COLOR), JELLY::FLASH_DURATION)
  73. end
  74. end
  75. end
Advertisement
Add Comment
Please, Sign In to add comment