Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:
- # Character Speed Changer
- # Version: 1.10
- # Author : LiTTleDRAgo
- #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:
- #
- # Explanation :
- # This script can change all the character speed by value of variable
- #
- # To decrease the speed, use negative value
- # To increase the speed, use positive value
- #
- # Value will reset to 0 once speed has changed
- #=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
- class Scene_Map
- #--------------------------------------------------------------------------
- # * Constant Variables
- #--------------------------------------------------------------------------
- SPEED_CHANGE_VARIABLE = 1
- SPEED_PLAYER_INCLUDED = true
- #--------------------------------------------------------------------------
- # * Alias Listing
- #--------------------------------------------------------------------------
- alias_method :drg128_upd, :update
- #--------------------------------------------------------------------------
- # * Frame Update
- #--------------------------------------------------------------------------
- def update
- drg128_upd
- change_speed_update
- end
- #--------------------------------------------------------------------------
- # * Change Speed Update
- #--------------------------------------------------------------------------
- def change_speed_update
- change = $game_variables[SPEED_CHANGE_VARIABLE]
- return unless change != 0
- $game_map.events.keys.sort.each {|i|
- move_speed = $game_map.events[i].move_speed
- $game_map.events[i].move_speed = [move_speed +change,0].max
- if SPEED_PLAYER_INCLUDED
- $game_player.move_speed = [$game_player.move_speed +change,0].max
- end }
- $game_variables[SPEED_CHANGE_VARIABLE] = 0
- end
- end
- #==============================================================================
- # ** Game_Character
- #------------------------------------------------------------------------------
- # This class deals with characters. It's used as a superclass for the
- # Game_Player and Game_Event classes.
- #==============================================================================
- class Game_Character
- #--------------------------------------------------------------------------
- # * Public Instance Variables
- #--------------------------------------------------------------------------
- attr_accessor :move_speed
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement