#===============================================================================
# Character Motion Stop For VX
#-------------------------------------------------------------------------------
# Author: RedSuns S.H.Chan(zeldafd@66rpg)
# Description: make the action of character more diersification
# Version: 1.0 - Beta
#===============================================================================
#===============================================================================
# Constant: ENABLE_CUSTOM_CHARACTER_ACTION
#-------------------------------------------------------------------------------
# Type: Boolean
#-------------------------------------------------------------------------------
# Description:
# Set it to true if you want to enable this system
#===============================================================================
ENABLE_CUSTOM_CHARACTER_ACTION = true
#===============================================================================
# Class: Game_Character
#-------------------------------------------------------------------------------
# Description:
# Define the action of the character which on the map
#===============================================================================
class Game_Character
#===============================================================================
# Public member: sprite
#-------------------------------------------------------------------------------
# Type: Sprite_Character
#-------------------------------------------------------------------------------
# Description:
# Store the instance of character sprite
#===============================================================================
attr_accessor :sprite
#=============================================================================
# Method: initialize(void)
#-----------------------------------------------------------------------------
# Description:
# Initialize all public member
#-----------------------------------------------------------------------------
# return: void
#=============================================================================
def initialize
@id = 0
@x = 0
@y = 0
@real_x = 0
@real_y = 0
@tile_id = 0
@character_name = ""
@character_index = 0
@opacity = 255
@blend_type = 0
@direction = 2
@pattern = 1
@move_route_forcing = false
@priority_type = 1
@through = false
@bush_depth = 0
@animation_id = 0
@balloon_id = 0
@transparent = false
@original_direction = 2 # Original direction
@original_pattern = 1 # Original pattern
@move_type = 0 # Movement type
@move_speed = 4 # Movement speed
@move_frequency = 6 # Movement frequency
@move_route = nil # Move route
@move_route_index = 0 # Move route index
@original_move_route = nil # Original move route
@original_move_route_index = 0 # Original move route index
@walk_anime = true # Walking animation
@step_anime = false # Stepping animation
@direction_fix = false # Fixed direction
@anime_count = 0 # Animation count
@stop_count = 0 # Stop count
@jump_count = 0 # Jump count
@jump_peak = 0 # Jump peak count
@wait_count = 0 # Wait count
@locked = false # Locked flag
@prelock_direction = 0 # Direction before lock
@move_failed = false # Movement failed flag
@index = 0
@stop_action = false
end
#=============================================================================
# Method: update_stop(void)
#-----------------------------------------------------------------------------
# Description:
# Auto call while character is not jumping or moving
#-----------------------------------------------------------------------------
# return: void
#=============================================================================
alias vx_update_stop update_stop
def update_stop
if ENABLE_CUSTOM_CHARACTER_ACTION
vx_update_stop
if ! moving? && ! jumping?
@index += 1
if @index > 50
@index = 0
if ! @stop_action
@stop_action = true
else
@stop_action = false
end
end
if @stop_action
self.sprite.zoom_y = 1.09
else
self.sprite.zoom_y = 1
end
end
else
vx_update_stop
end
end
end
#===============================================================================
# Class: Spriteset_Map
#-------------------------------------------------------------------------------
# Description:
# Define the create activity of character's sprite class instance
#===============================================================================
class Spriteset_Map
#=============================================================================
# Method: create_characters(void)
#-----------------------------------------------------------------------------
# Description:
# Auto call by Spriteset_Map to create all character sprite
#-----------------------------------------------------------------------------
# return: void
#=============================================================================
alias vx_create_characters create_characters
def create_characters
if ENABLE_CUSTOM_CHARACTER_ACTION
@character_sprites = []
for i in $game_map.events.keys.sort
$game_map.events[i].sprite = Sprite_Character.new(@viewport1, $game_map.events[i])
@character_sprites.push($game_map.events[i].sprite)
end
for vehicle in $game_map.vehicles
vehicle.sprite = Sprite_Character.new(@viewport1, vehicle)
@character_sprites.push(vehicle.sprite)
end
$game_player.sprite = Sprite_Character.new(@viewport1, $game_player)
@character_sprites.push($game_player.sprite)
else
vx_create_chracters
end
end
end