Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #==============================================================================
- # ■ Simple Dash Effect ver.0.00 by Kanji the Grass
- # This work is provided under the MTCM Blue License
- # https://en.materialcommons.tk/mtcm-b-summary/
- # Credits display: Kanji the Grass
- #------------------------------------------------------------------------------
- # Character can run at an angle visually while dashing.
- # You adjust HORZ_ANGLE if it looks unnatural (default, 7)
- #==============================================================================
- module KNS
- DASH_SPEED = 1.8 # Dash speed, default is 1
- HORZ_ANGLE = 7 # Angle for character sprite when dash to side (left/ right)
- VERT_ZOOM_Y = 0.91 # Value of the vertical zoom when dashing.
- end
- class Game_CharacterBase
- include KNS
- attr_accessor :zoom_y, :angle
- #--------------------------------------------------------------------------
- # ● Get move speed
- #--------------------------------------------------------------------------
- def real_move_speed
- @move_speed + (dash? ? DASH_SPEED : 0)
- end
- #--------------------------------------------------------------------------
- # ● Public member variable
- #--------------------------------------------------------------------------
- alias kdash__init_public_members init_public_members
- def init_public_members
- kdash__init_public_members
- @zoom_y, @angle = 1, 0
- end
- #--------------------------------------------------------------------------
- # ● Frame update
- #--------------------------------------------------------------------------
- alias kdash__update update
- def update
- kdash__update
- update_dash
- end
- #--------------------------------------------------------------------------
- # ☆ Update dash
- #--------------------------------------------------------------------------
- def update_dash
- if $game_player.dash? && moving?
- @zoom_y = @direction % 6 == 2 ? VERT_ZOOM_Y : 1
- @angle = HORZ_ANGLE * case @direction when 4;1 when 6;-1 else 0 end
- else @angle, @zoom_y = 0, 1 end if [Game_Player, Game_Follower].include?(self.class)
- end
- end
- class Sprite_Character
- #--------------------------------------------------------------------------
- # ● Other update
- #--------------------------------------------------------------------------
- alias kdash__update_other update_other
- def update_other
- kdash__update_other
- self.angle, self.zoom_y = @character.angle || 0, @character.zoom_y || 1
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement