Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #==============================================================================
- # Flash Selected Enemy
- # Version: 1.0
- # Author: modern algebra (rmrk.net)
- # Date: September 1, 2009
- #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- # Description:
- #
- # This script blinks the battler of the enemy when it is hovered over in the
- # targetting window of the battle scene.
- #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- # Instructions:
- #
- # This script is plug & play. Just put it somewhere below Materials and
- # above Main in the Script Editor (F11).
- #
- # If you wish to configure the rest period between flashes, or the type of
- # flash (blink or whiten), then go to line 27
- #==============================================================================
- #==============================================================================
- # ** Global Constants
- #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- # new constants - FSE_REST_FRAMES; FSE_FLASH_TYPE
- #==============================================================================
- FSE_REST_FRAMES = 4 # The number of frames between battler flashes
- FSE_FLASH_TYPE = 1 # The type of effect. 1 => Whiten; 2 => Blink
- #==============================================================================
- # ** Game Battler
- #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- # Summary of Changes:
- # attr_accessor - stop_effect
- # aliased method - initialize
- #==============================================================================
- class Game_Battler
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- # * Public Instance Variables
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- attr_accessor :stop_effect # boolean to turn off any effect immediately
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- # * Object Initialization
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- alias malgbra_init_btllerblinkenmy_0nf3 initialize unless $@
- def initialize (*args)
- @stop_effect = false # Initialize stop effect boolean
- malgbra_init_btllerblinkenmy_0nf3 (*args) # Run Original Method
- end
- end
- #==============================================================================
- # ** Sprite Battler
- #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- # Summary of Changes:
- # aliased method - update_effect
- #==============================================================================
- class Sprite_Battler
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- # * Stop Effect
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- alias malgbr_updeffct_blnksenmy_9hv2 update_effect unless $@
- def update_effect (*args)
- # Stop effect if set to stop
- if @battler.stop_effect
- @effect_duration = 1
- @battler.stop_effect = false
- end
- # Run Original Method
- malgbr_updeffct_blnksenmy_9hv2 (*args)
- end
- end
- #==============================================================================
- # ** Scene_Battle
- #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- # Summary of Changes:
- # aliased method - start_target_enemy_selection, end_target_enemy_selection,
- # update_target_enemy_selection
- #==============================================================================
- class Scene_Battle
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- # * Start Target Enemy Selection
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- alias malgbr_blinkenmytrgt_strtslct_6dc2 start_target_enemy_selection unless $@
- def start_target_enemy_selection (*args)
- @fse_effect_frames = FSE_FLASH_TYPE == 1 ? 16 : 20
- @blink_frames = @fse_effect_frames + FSE_REST_FRAMES # Initialize blink count
- # Run Original Method
- malgbr_blinkenmytrgt_strtslct_6dc2 (*args)
- end
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- # * Update Target Enemy Selection
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- alias modrna_enmyblink_updtrgtselct_9la2 update_target_enemy_selection unless $@
- def update_target_enemy_selection (*args)
- old_enemy = @target_enemy_window.enemy
- # Run Original Method
- modrna_enmyblink_updtrgtselct_9la2 (*args)
- # If target has changed
- if @target_enemy_window.nil? || old_enemy != @target_enemy_window.enemy
- # Stop that enemy from blinking
- old_enemy.stop_effect = true
- return if @target_enemy_window.nil?
- # start other blink
- @blink_frames = @fse_effect_frames + FSE_REST_FRAMES
- end
- # Blink selected battler when count is up
- if @blink_frames >= @fse_effect_frames + FSE_REST_FRAMES
- @blink_frames = 0
- if FSE_FLASH_TYPE == 1 # White Flash
- @target_enemy_window.enemy.white_flash = true
- elsif FSE_FLASH_TYPE == 2 # Blink
- @target_enemy_window.enemy.blink = true
- end
- end
- @blink_frames += 1
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment