Class: Game_Character
- Includes:
- GameData::SystemTags
- Defined in:
- scripts/00650 MapSystem/00100 Game_Character_1.rb,
scripts/00650 MapSystem/00110 Game_Character_2.rb,
scripts/00650 MapSystem/00150 Game_Character_Ext.rb,
scripts/00650 MapSystem/00120 Game_Character_move.rb,
scripts/00650 MapSystem/00125 Game_Character_turn.rb,
scripts/00650 MapSystem/00140 Game_Character_state.rb,
scripts/00650 MapSystem/00155 Game_Character_bridge.rb,
scripts/00650 MapSystem/00105 Game_Character_passable.rb,
scripts/00650 MapSystem/00145 Game_Character_follower.rb,
scripts/00650 MapSystem/00160 Game_Character_particles.rb,
scripts/00650 MapSystem/00130 Game_Character_appearance.rb,
scripts/00650 MapSystem/00170 Game_Character_pathfinding.rb
Overview
Class that describe and manipulate a Character (Player/Events)
Direct Known Subclasses
Constant Summary collapse
- StairsTag =
Array of SystemTag that define stairs
[StairsL, StairsD, StairsU, StairsR]
- SlideTags =
SystemTags that triggers “sliding” state
[TIce, RapidsL, RapidsR, RapidsU, RapidsD]
- SurfTag =
SystemTags that trigger Surfing
[TPond, TSea]
- SurfLTag =
SystemTags that does not trigger leaving water
SurfTag + [BridgeUD, BridgeRL, RapidsL, RapidsR, RapidsU, RapidsD, AcroBikeRL, AcroBikeUD, WaterFall, JumpD, JumpL, JumpR, JumpU]
- PARTICLES_METHODS =
Constant defining all the particle method to call
{ TGrass => :particle_push_grass, TTallGrass => :particle_push_tall_grass, TSand => :particle_push_sand, TSnow => :particle_push_snow, TPond => :particle_push_pond, TWetSand => :particle_push_wetsand }
- SAND_PARTICLE_NAME =
Constant telling the sand particle name to push (according to the direction)
{ 2 => :sand_d, 4 => :sand_l, 6 => :sand_r, 8 => :sand_u }
- SNOW_PARTICLE_NAME =
Constant telling the snow particle name to push (according to the direction)
{ 2 => :snow_d, 4 => :snow_l, 6 => :snow_r, 8 => :snow_u }
- SHADOW_DISABLED_UPDATE_VALUES =
Values that allows the shadow_disabled update in set_appearance
[false, true, nil]
- EMPTY_MOVE_ROUTE =
RPG::MoveRoute.new
Constants included from GameData::SystemTags
GameData::SystemTags::AcroBike, GameData::SystemTags::AcroBikeRL, GameData::SystemTags::AcroBikeUD, GameData::SystemTags::BridgeRL, GameData::SystemTags::BridgeUD, GameData::SystemTags::CrackedSoil, GameData::SystemTags::DeepSwamp, GameData::SystemTags::Empty, GameData::SystemTags::HeadButt, GameData::SystemTags::Hole, GameData::SystemTags::JumpD, GameData::SystemTags::JumpL, GameData::SystemTags::JumpR, GameData::SystemTags::JumpU, GameData::SystemTags::MachBike, GameData::SystemTags::RapidsD, GameData::SystemTags::RapidsL, GameData::SystemTags::RapidsR, GameData::SystemTags::RapidsU, GameData::SystemTags::Road, GameData::SystemTags::SlopesL, GameData::SystemTags::SlopesR, GameData::SystemTags::StairsD, GameData::SystemTags::StairsL, GameData::SystemTags::StairsR, GameData::SystemTags::StairsU, GameData::SystemTags::SwampBorder, GameData::SystemTags::TCave, GameData::SystemTags::TGrass, GameData::SystemTags::TIce, GameData::SystemTags::TMount, GameData::SystemTags::TPond, GameData::SystemTags::TSand, GameData::SystemTags::TSea, GameData::SystemTags::TSnow, GameData::SystemTags::TTallGrass, GameData::SystemTags::TUnderWater, GameData::SystemTags::TWetSand, GameData::SystemTags::WaterFall, GameData::SystemTags::ZTag
Instance Attribute Summary collapse
-
#__bridge
The bridge state.
-
#animation_id ⇒ Integer
ID of the animation to play on the character.
-
#blend_type ⇒ Integer
readonly
Blending of the event (0 is the only one that actually works).
-
#can_make_footprint ⇒ Boolean
Tell if the character can make footprint on the ground or not.
-
#character_hue ⇒ Intger
Must be 0.
-
#character_name ⇒ String
Name of the character graphic used to display the event.
-
#direction ⇒ Integer
Direction where the event is looking (2 = down, 6 = right, 4 = left, 8 = up).
-
#direction_fix ⇒ Boolean
readonly
If the direction is fixed.
-
#follower ⇒ Game_Character?
readonly
The follower.
-
#id ⇒ Integer
readonly
Id of the event in the map.
-
#in_swamp ⇒ Integer, false
If the character is in swamp tile and the power of the swamp tile.
-
#is_pokemon ⇒ Boolean
If the character is a Pokemon (affect the step anime).
-
#move_route
readonly
The current move route.
-
#move_route_forcing ⇒ Boolean
readonly
If the character is forced to move using a specific route.
-
#move_route_index
readonly
The current move route index.
-
#move_speed ⇒ Integer
Dynamic move_speed value of the Game_Character, return a different value than @move_speed.
-
#offset_screen_y ⇒ Integer?
Offset y of the character on the screen.
-
#offset_shadow_screen_y ⇒ Integer?
Offset y of the character on the screen.
-
#opacity ⇒ Integer
Opacity of the event when it's shown.
-
#particles_disabled ⇒ Boolean
If the particles are disabled for the Character.
-
#path ⇒ Array<RPG::MoveCommand>, ...
The current path.
-
#pattern ⇒ Integer
readonly
Current pattern of the character graphic shown.
-
#real_x ⇒ Integer
readonly
“real” X position of the event, usually x * 128.
-
#real_y ⇒ Integer
readonly
“real” Y position of the event, usually y * 128.
-
#shadow_disabled ⇒ Boolean
If the shadow should be shown or not.
-
#sliding
The current sliding state.
-
#step_anime ⇒ Boolean
If the event has a patern animation while staying.
-
#surfing
writeonly
The current surfing state.
-
#through ⇒ Boolean
If the character is traversable and it can walk through any tiles.
-
#tile_id ⇒ Integer
readonly
ID of the tile shown as the event (0 = no tile).
-
#transparent ⇒ Boolean
If the event is invisible.
-
#x ⇒ Integer
X position of the event in the current map.
-
#y ⇒ Integer
Y position of the event in the current map.
-
#z ⇒ Integer
Z priority of the event.
Instance Method Summary collapse
-
#activated? ⇒ Boolean
Check if the character is activate.
-
#animate_from_charset(lines, duration, reverse: false, repeat: false) ⇒ Boolean
Set the charset animation.
-
#bridge_down_check(z)
(also: #bridge_up_check)
Adjust the Character informations related to the brige when it moves down (or up).
-
#bridge_left_check(z)
(also: #bridge_right_check)
Adjust the Character informations related to the brige when it moves left (or right).
-
#bush_depth ⇒ Integer
bush_depth of the sprite of the character.
-
#cancel_charset_animation
Cancel the charset animation.
-
#check_event_trigger_touch(*args)
Define the function check_event_trigger_touch to prevent bugs.
-
#contact?(x, y, z) ⇒ Boolean
Check if it's possible to have contact interaction with this Game_Character at certain coordinates.
-
#define_path(path)
Define the path from path_finding.
-
#detect_swamp
Detect if the event walks in a swamp or a deep swamp and change the Game_Character states.
-
#emotion(type, wait = 34, params = {})
Show an emotion to an event or the player.
-
#event_passable_check?(new_x, new_y, z, game_map) ⇒ Boolean
Check the passage related to events.
-
#find_path(to:, radius: 0, tries: Pathfinding::TRY_COUNT, type: nil, tags: :DEFAULT)
Request a path to the target and follow it as soon as it found.
-
#follower_check?(new_x, new_y, z) ⇒ Boolean
Check the passage related to events.
-
#follower_move
Move a follower.
-
#follower_sliding? ⇒ Boolean
Check if the follower slides.
-
#follower_tail ⇒ Game_Character, self
Return the tail of the following queue.
-
#force_move_route(move_route)
Force the character to adopt a move route and save the original one.
-
#front_name_check(name) ⇒ Boolean
(also: #front_name_detect)
Check a the #front_event has a specific name.
-
#front_system_tag ⇒ Integer
Return the SystemTag in the front of the Game_Character.
-
#front_tile ⇒ Array(Integer, Integer)
Return tile position in front of the player.
-
#front_tile_event ⇒ Game_Event?
Return the event that stand in the front of the Player.
-
#front_tile_id ⇒ Integer, 0
Return the id of the #front_tile_event.
-
#increase_steps
Increase step prototype (sets @stop_count to 0).
-
#initialize ⇒ Game_Character
constructor
Default initializer.
-
#jump(x_plus, y_plus, follow_move = true) ⇒ Boolean
Make the Game_Character jump.
-
#jump_bridge_check(x_plus, y_plus)
Perform the bridge check for the jump operation.
-
#jumping? ⇒ Boolean
is the character jumping ?.
-
#lock
Make the character look the player during a dialog.
-
#lock? ⇒ Boolean
Is the character locked ? (looking to the player when it's activated).
-
#look_to(event_id)
Look directly to a specific event.
-
#movable? ⇒ Boolean
Is the character able to execute a move action.
-
#move_away_from_player
Move the Game_Character away from the player.
-
#move_backward
Move the Game_Character backward.
-
#move_down(turn_enabled = true)
Move Game_Character down.
-
#move_follower_to_character
Warp the follower to the event it follows.
-
#move_forward
Move the Game_Character forward.
-
#move_frequency=(value)
Set the move_frequency (and define the max_stop_count value).
-
#move_left(turn_enabled = true)
Move Game_Character left.
-
#move_lower_left
Move the Game_Character lower left.
-
#move_lower_right
Move the Game_Character lower right.
-
#move_random
Move the Game_Character to a random direction.
-
#move_right(turn_enabled = true)
Move Game_Character right.
- #move_toward(tx, ty)
-
#move_toward_player
Move the Game_Character toward the player.
-
#move_type_path
Movement induced by the Path Finding.
-
#move_up(turn_enabled = true)
Move Game_Character up.
-
#move_upper_left
Move the Game_Character upper left.
-
#move_upper_right
Move the Game_Character upper right.
-
#movement_process_end(no_follower_move = false)
End of the movement process.
-
#moveto(x, y)
Warps the character on the Map to specific coordinates.
-
#moving? ⇒ Boolean
is the character moving ?.
-
#particle_push
Push a particle to the particle stack if possible.
-
#particle_push_grass
Push a grass particle.
-
#particle_push_pond
Push a pond particle.
-
#particle_push_sand
Push a sand particle.
-
#particle_push_snow
Push a snow particle.
-
#particle_push_tall_grass
Push a tall grass particle.
-
#particle_push_wetsand
Push a wet sand particle.
-
#passable?(x, y, d, skip_event = false) ⇒ Boolean
Is the tile in front of the character passable ?.
-
#passable_bridge_check?(x, y, d, new_x, new_y, z, game_map, sys_tag) ⇒ Boolean
Check the bridge related passabilities.
-
#passage_surf_check?(sys_tag) ⇒ Boolean
Check the surf related passabilities.
- #process_slope_y_modifier(y_modifier)
-
#reset_follower_move
Remove the memorized moves of the follower.
-
#screen_x ⇒ Integer
Return the x position of the sprite on the screen.
-
#screen_y ⇒ Integer
Return the y position of the sprite on the screen.
-
#screen_z(_height = 0) ⇒ Integer
Return the z superiority of the sprite of the character.
-
#set_appearance(character_name, character_hue = 0)
Define the new appearance of the character.
-
#set_follower(follower)
Define the follower of the event.
-
#set_surfing
Set the Game_Character in the “surfing” mode (not able to walk on ground but able to walk on water).
-
#shadow_screen_x ⇒ Integer
Return the x position of the shadow of the character on the screen.
-
#shadow_screen_y ⇒ Integer
Return the y position of the shadow of the character on the screen.
-
#sliding? ⇒ Boolean
Check if the Game_Character slides.
-
#slope_check_left(write = true)
Update the slope values when moving to left.
-
#slope_check_right(write = true) ⇒ Integer
Update the slope values when moving to right, and return y slope modifier.
-
#stair_move_left ⇒ Boolean
Try to move the Game_Character on a stair to the left.
-
#stair_move_right ⇒ Boolean
Try to move the Game_Character on a stair to the right.
-
#stop_path
Stop following the path if there is one and clear the agent.
-
#straighten
Adjust the character position.
-
#surfing? ⇒ Boolean
Check if the Game_Character is in the “surfing” mode.
-
#system_tag ⇒ Integer
Return the SystemTag where the Game_Character stands.
-
#terrain_tag ⇒ Integer?
current terrain tag on which the character steps.
-
#turn_180
Turn 180°.
-
#turn_away_from_player
Turn away from the player.
-
#turn_down
Turn down unless direction fix.
-
#turn_left
Turn left unless direction fix.
-
#turn_left_90
Turn 90° to the left of the Game_Character.
-
#turn_random
Turn in a random direction.
-
#turn_right
Turn right unless direction fix.
-
#turn_right_90
Turn 90° to the right of the Game_Character.
-
#turn_right_or_left_90
Turn random right or left 90°.
-
#turn_toward_character(character)
Turn toward another character.
-
#turn_toward_player
Turn toward the player.
-
#turn_up
Turn up unless direction fix.
-
#unlock
Release the character, can perform its natural movements.
-
#update
Update the Game_Character (manages movements and some animations).
-
#z_bridge_check(sys_tag)
Check bridge information and adjust the z position of the Game_Character.
Methods included from GameData::SystemTags
Constructor Details
#initialize ⇒ Game_Character
Default initializer
Instance Attribute Details
#__bridge
The bridge state
#animation_id ⇒ Integer
Returns ID of the animation to play on the character.
#blend_type ⇒ Integer (readonly)
Returns blending of the event (0 is the only one that actually works).
#can_make_footprint ⇒ Boolean
Returns tell if the character can make footprint on the ground or not.
#character_hue ⇒ Intger
Returns must be 0.
#character_name ⇒ String
Returns name of the character graphic used to display the event.
#direction ⇒ Integer
Returns direction where the event is looking (2 = down, 6 = right, 4 = left, 8 = up).
#direction_fix ⇒ Boolean (readonly)
If the direction is fixed
#follower ⇒ Game_Character? (readonly)
Returns the follower.
#id ⇒ Integer (readonly)
Id of the event in the map
#in_swamp ⇒ Integer, false
Returns if the character is in swamp tile and the power of the swamp tile.
#is_pokemon ⇒ Boolean
Returns if the character is a Pokemon (affect the step anime).
#move_route (readonly)
The current move route
#move_route_forcing ⇒ Boolean (readonly)
Returns if the character is forced to move using a specific route.
#move_route_index (readonly)
The current move route index
#move_speed ⇒ Integer
Dynamic move_speed value of the Game_Character, return a different value than @move_speed
#offset_screen_y ⇒ Integer?
Returns offset y of the character on the screen.
#offset_shadow_screen_y ⇒ Integer?
Returns offset y of the character on the screen.
#opacity ⇒ Integer
Returns opacity of the event when it's shown.
#particles_disabled ⇒ Boolean
Returns if the particles are disabled for the Character.
#path ⇒ Array<RPG::MoveCommand>, ...
The current path
#pattern ⇒ Integer (readonly)
Returns current pattern of the character graphic shown.
#real_x ⇒ Integer (readonly)
Returns “real” X position of the event, usually x * 128.
#real_y ⇒ Integer (readonly)
Returns “real” Y position of the event, usually y * 128.
#shadow_disabled ⇒ Boolean
Returns if the shadow should be shown or not.
#sliding
The current sliding state
#step_anime ⇒ Boolean
Returns if the event has a patern animation while staying.
#surfing=(value) (writeonly)
The current surfing state
#through ⇒ Boolean
Returns if the character is traversable and it can walk through any tiles.
#tile_id ⇒ Integer (readonly)
Returns ID of the tile shown as the event (0 = no tile).
#transparent ⇒ Boolean
Returns if the event is invisible.
#x ⇒ Integer
Returns X position of the event in the current map.
#y ⇒ Integer
Returns Y position of the event in the current map.
#z ⇒ Integer
Returns Z priority of the event.
Instance Method Details
#activated? ⇒ Boolean
Check if the character is activate. Useful to make difference between event without active page and others.
#animate_from_charset(lines, duration, reverse: false, repeat: false) ⇒ Boolean
Set the charset animation. It can be needed to set the event in direction fixed.
#bridge_down_check(z) Also known as: bridge_up_check
Adjust the Character informations related to the brige when it moves down (or up)
#bridge_left_check(z) Also known as: bridge_right_check
Adjust the Character informations related to the brige when it moves left (or right)
#bush_depth ⇒ Integer
bush_depth of the sprite of the character
#cancel_charset_animation
Cancel the charset animation
#check_event_trigger_touch(*args)
Define the function check_event_trigger_touch to prevent bugs
#contact?(x, y, z) ⇒ Boolean
Check if it's possible to have contact interaction with this Game_Character at certain coordinates
#define_path(path)
Define the path from path_finding
#detect_swamp
Detect if the event walks in a swamp or a deep swamp and change the Game_Character states.
#emotion(type, wait = 34, params = {})
Show an emotion to an event or the player
#event_passable_check?(new_x, new_y, z, game_map) ⇒ Boolean
Check the passage related to events
#find_path(to:, radius: 0, tries: Pathfinding::TRY_COUNT, type: nil, tags: :DEFAULT)
Request a path to the target and follow it as soon as it found
#follower_check?(new_x, new_y, z) ⇒ Boolean
Check the passage related to events
#follower_move
Move a follower
#follower_sliding? ⇒ Boolean
Check if the follower slides
#follower_tail ⇒ Game_Character, self
Return the tail of the following queue
#force_move_route(move_route)
Force the character to adopt a move route and save the original one
#front_name_check(name) ⇒ Boolean Also known as: front_name_detect
Check a the #front_event has a specific name
#front_system_tag ⇒ Integer
Return the SystemTag in the front of the Game_Character
#front_tile_event ⇒ Game_Event?
Return the event that stand in the front of the Player
#front_tile_id ⇒ Integer, 0
Return the id of the #front_tile_event
#increase_steps
Increase step prototype (sets @stop_count to 0)
#jump(x_plus, y_plus, follow_move = true) ⇒ Boolean
Make the Game_Character jump
#jump_bridge_check(x_plus, y_plus)
Perform the bridge check for the jump operation
#jumping? ⇒ Boolean
is the character jumping ?
#lock
Make the character look the player during a dialog
#lock? ⇒ Boolean
in this state, the character is not able to perform automatic moveroute (rmxp conf)
Is the character locked ? (looking to the player when it's activated)
#look_to(event_id)
Look directly to a specific event
#movable? ⇒ Boolean
Is the character able to execute a move action
#move_away_from_player
Move the Game_Character away from the player
#move_backward
Move the Game_Character backward
#move_down(turn_enabled = true)
Move Game_Character down
#move_follower_to_character
Warp the follower to the event it follows
#move_forward
Move the Game_Character forward
#move_frequency=(value)
Set the move_frequency (and define the max_stop_count value)
#move_left(turn_enabled = true)
Move Game_Character left
#move_lower_left
Move the Game_Character lower left
#move_lower_right
Move the Game_Character lower right
#move_random
Move the Game_Character to a random direction
#move_right(turn_enabled = true)
Move Game_Character right
#move_toward(tx, ty)
#move_toward_player
Move the Game_Character toward the player
#move_type_path
Movement induced by the Path Finding
#move_up(turn_enabled = true)
Move Game_Character up
#move_upper_left
Move the Game_Character upper left
#move_upper_right
Move the Game_Character upper right
#movement_process_end(no_follower_move = false)
End of the movement process
#moveto(x, y)
Warps the character on the Map to specific coordinates. Adjust the z position of the character.
#moving? ⇒ Boolean
is the character moving ?
#particle_push
Push a particle to the particle stack if possible
#particle_push_grass
Push a grass particle
#particle_push_pond
Push a pond particle
#particle_push_sand
Push a sand particle
#particle_push_snow
Push a snow particle
#particle_push_tall_grass
Push a tall grass particle
#particle_push_wetsand
Push a wet sand particle
#passable?(x, y, d, skip_event = false) ⇒ Boolean
Is the tile in front of the character passable ?
#passable_bridge_check?(x, y, d, new_x, new_y, z, game_map, sys_tag) ⇒ Boolean
Check the bridge related passabilities
#passage_surf_check?(sys_tag) ⇒ Boolean
Check the surf related passabilities
#process_slope_y_modifier(y_modifier)
#reset_follower_move
Remove the memorized moves of the follower
#screen_x ⇒ Integer
Return the x position of the sprite on the screen
#screen_y ⇒ Integer
Return the y position of the sprite on the screen
#screen_z(_height = 0) ⇒ Integer
Return the z superiority of the sprite of the character
#set_appearance(character_name, character_hue = 0)
Define the new appearance of the character
#set_follower(follower)
Define the follower of the event
#set_surfing
Set the Game_Character in the “surfing” mode (not able to walk on ground but able to walk on water)
#shadow_screen_x ⇒ Integer
Return the x position of the shadow of the character on the screen
#shadow_screen_y ⇒ Integer
Return the y position of the shadow of the character on the screen
#sliding? ⇒ Boolean
Check if the Game_Character slides
#slope_check_left(write = true)
Update the slope values when moving to left
#slope_check_right(write = true) ⇒ Integer
Update the slope values when moving to right, and return y slope modifier
#stair_move_left ⇒ Boolean
Try to move the Game_Character on a stair to the left
#stair_move_right ⇒ Boolean
Try to move the Game_Character on a stair to the right
#stop_path
Stop following the path if there is one and clear the agent
#straighten
Adjust the character position
#surfing? ⇒ Boolean
Check if the Game_Character is in the “surfing” mode
#system_tag ⇒ Integer
Return the SystemTag where the Game_Character stands
#terrain_tag ⇒ Integer?
current terrain tag on which the character steps
#turn_180
Turn 180°
#turn_away_from_player
Turn away from the player
#turn_down
Turn down unless direction fix
#turn_left
Turn left unless direction fix
#turn_left_90
Turn 90° to the left of the Game_Character
#turn_random
Turn in a random direction
#turn_right
Turn right unless direction fix
#turn_right_90
Turn 90° to the right of the Game_Character
#turn_right_or_left_90
Turn random right or left 90°
#turn_toward_character(character)
Turn toward another character
#turn_toward_player
Turn toward the player
#turn_up
Turn up unless direction fix
#unlock
Release the character, can perform its natural movements
#update
Update the Game_Character (manages movements and some animations)
#z_bridge_check(sys_tag)
Check bridge information and adjust the z position of the Game_Character