Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #==============================================================================
- # ** DRG - Breath Effect
- # Version : 1.01
- # Author : LiTTleDRAgo
- #==============================================================================
- #==============================================================================
- # ** Sprite_Character
- #------------------------------------------------------------------------------
- # This sprite is used to display the character.It observes the Game_Character
- # class and automatically changes sprite conditions.
- #==============================================================================
- class Sprite_Character
- #--------------------------------------------------------------------------
- # * Alias Method
- #--------------------------------------------------------------------------
- alias_method :drg1732013_update, :update
- #--------------------------------------------------------------------------
- # * Frame Update
- #--------------------------------------------------------------------------
- def update
- drg1732013_update
- update_breath
- end
- #--------------------------------------------------------------------------
- # * Update Breath
- #--------------------------------------------------------------------------
- def update_breath
- if sprite_controlable?(@character)
- @zoom_wait,b = [(@zoom_wait||0)-1,0].max, 1.05
- @breath = true
- if self.zoom_y < b && !@up && @zoom_wait == 0
- self.zoom_y += 0.005
- @up, @zoom_wait = true, 20 if self.zoom_y >= b
- elsif self.zoom_y >= 1.0 && @up && @zoom_wait == 0
- self.zoom_y -= 0.005
- @up, @zoom_wait = false,60 if self.zoom_y <= 1.0
- end
- elsif @breath
- @breath = false
- self.zoom_y = @character.instance_variable_get(:@zoom_y) || 1
- end
- end
- #--------------------------------------------------------------------------
- # * sprite_controlable?
- #--------------------------------------------------------------------------
- def sprite_controlable?(character)
- return false if $game_system.map_interpreter.running?
- return false if character.move_route_forcing
- return false if $game_temp.message_window_showing
- return false if character.moving?
- return false if character.transparent
- return false if !character.is_a?(Game_Player)
- return true
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement