Class: Game_Event

Inherits:
Game_Character show all
Defined in:
docs/01450_Systems_00003_Map_Engine.rb

Overview

Describe an Event during the Map display process

Constant Summary collapse

SURFING_TAG =

Tag inside an event that put it in the surfing state

'surf_'
INVISIBLE_EVENT_NAME =

If named like this, this event is an invisible object

'OBJ_INVISIBLE'
INVISIBLE_EVENT_TAG =

Tag that sets the event in an invisible state (not triggerd unless in front of it)

'invisible_'
AUTO_CHARSET_TAG =

Tag that tells the event to always take the character_name of the first page when page change

'$'
PARTICLE_OFF_TAG =

Tag that tells the event not to push particles when it moves

'[particle=off]'
OFFSET_Y_TAG =

Tag that detect offset_screen_y

/\[offset_y=([0-9\-]+)\]/
OFFSET_X_TAG =

Tag that detect offset_screen_x

/\[offset_x=([0-9\-]+)\]/
NO_SPRITE_TAG =

Tag that forbid the creation of a Sprite_Character for this event

'[sprite=off]'
SYMBOL_ALIAS_TAG =

Tag that give the event an symbol alias

/\[alias=([a-z\-0-9\-_]+)\]/
SET_Z_TAG =

Tag that detect z=

/\[z=([0-9\-]+)\]/
NOSLIDE_TAG =

Tag enabling no slide

'[noslide=on]'
REFLECTION_TAG =

Tag enabling reflection

'[reflection=on]'

Constants inherited from Game_Character

Game_Character::EMPTY_MOVE_ROUTE, Game_Character::PARTICLES_METHODS, Game_Character::SAND_PARTICLE_NAME, Game_Character::SHADOW_DISABLED_UPDATE_VALUES, Game_Character::SNOW_PARTICLE_NAME, Game_Character::SlideTags, Game_Character::StairsTag, Game_Character::SurfLTag, Game_Character::SurfTag

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::Puddle, GameData::SystemTags::RapidsD, GameData::SystemTags::RapidsL, GameData::SystemTags::RapidsR, GameData::SystemTags::RapidsU, GameData::SystemTags::Road, GameData::SystemTags::RocketD, GameData::SystemTags::RocketL, GameData::SystemTags::RocketR, GameData::SystemTags::RocketRD, GameData::SystemTags::RocketRL, GameData::SystemTags::RocketRR, GameData::SystemTags::RocketRU, GameData::SystemTags::RocketU, GameData::SystemTags::SlopesL, GameData::SystemTags::SlopesR, GameData::SystemTags::StairsD, GameData::SystemTags::StairsL, GameData::SystemTags::StairsR, GameData::SystemTags::StairsU, GameData::SystemTags::StopSlide, 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::Whirlpool, GameData::SystemTags::ZTag

Instance Attribute Summary collapse

Attributes inherited from Game_Character

#__bridge, #animation_id, #blend_type, #can_make_footprint, #character_hue, #character_name, #charset_animation, #direction, #direction_fix, #follower, #id, #in_swamp, #is_pokemon, #move_route, #move_route_forcing, #move_route_index, #move_speed, #no_slide, #offset_screen_x, #offset_screen_y, #offset_shadow_screen_x, #offset_shadow_screen_y, #opacity, #particles_disabled, #path, #pattern, #real_x, #real_y, #reflection_enabled, #shadow_disabled, #sliding, #step_anime, #surfing, #through, #tile_id, #transparent, #x, #y, #z

Instance Method Summary collapse

Methods inherited from Game_Character

#animate_from_charset, #bridge_down_check, #bridge_left_check, #bush_depth, #cancel_charset_animation, #contact?, #define_path, #detect_swamp, #each_front_tiles, #each_front_tiles_rect, #emotion, #event_passable_check?, #fishing_creek_amount, #fly_reset_attributes, #follower_check?, #follower_move, #follower_sliding?, #follower_tail, #force_move_route, #front_name_check, #front_system_tag, #front_system_tag_db_symbol, #front_terrain_tag, #front_tile, #front_tile_event, #front_tile_id, #increase_steps, #jump, #jump_bridge_check, #jumping?, #lock, #lock?, #look_this_event, #look_to, #movable?, #move_away_from_player, #move_backward, #move_down, #move_follower_to_character, #move_forward, #move_frequency=, #move_left, #move_lower_left, #move_lower_right, #move_random, #move_random_within_systemtag, #move_random_within_zone, #move_right, #move_toward, #move_toward_player, #move_type_path, #move_up, #move_upper_left, #move_upper_right, #movement_process_end, #moveto, #moving?, #next_event_follower, #original_move_speed, #particle_push, #particle_push_grass, #particle_push_pond, #particle_push_puddle, #particle_push_sand, #particle_push_snow, #particle_push_tall_grass, #particle_push_wetsand, #passable?, #passable_bridge_check?, #passage_surf_check?, #process_slope_y_modifier, #reset_follower, #reset_follower_move, #screen_x, #screen_y, #screen_z, #set_appearance, #set_follower, #set_surfing, #shadow_screen_x, #shadow_screen_y, #sliding?, #slope_check_left, #slope_check_right, #stair_move_left, #stair_move_right, #stop_path, #straighten, #surfing?, #system_tag, #system_tag_db_symbol, #terrain_tag, #turn_180, #turn_away_from_player, #turn_down, #turn_left, #turn_left_90, #turn_random, #turn_right, #turn_right_90, #turn_right_or_left_90, #turn_toward_character, #turn_toward_player, #turn_up, #unlock, #wait_charset_animation, #z_bridge_check

Methods included from GameData::SystemTags

gen, system_tag_db_symbol

Constructor Details

#initialize(map_id, event) ⇒ Game_Event

Initialize the Game_Event with its map_id and its RPG::Event data

Parameters:

  • map_id (Integer)

    id of the map where the event is instanciated

  • event (RPG::Event)

    data of the event



2008
2009
# File 'docs/01450_Systems_00003_Map_Engine.rb', line 2008

def initialize(map_id, event)
end

Instance Attribute Details

#erasedBoolean (readonly)

Returns if the event was erased (needs to be removed from the view).

Returns:

  • (Boolean)

    if the event was erased (needs to be removed from the view)



1998
1999
2000
# File 'docs/01450_Systems_00003_Map_Engine.rb', line 1998

def erased
  @erased
end

#eventRPG::Event (readonly)

Returns the event data from the MAP.

Returns:

  • (RPG::Event)

    the event data from the MAP



1994
1995
1996
# File 'docs/01450_Systems_00003_Map_Engine.rb', line 1994

def event
  @event
end

#invisible_eventBoolean (readonly)

Returns if the event is an invisible event (should be in front of the event to trigger it when it doesn’t have a character_name).

Returns:

  • (Boolean)

    if the event is an invisible event (should be in front of the event to trigger it when it doesn’t have a character_name)



1996
1997
1998
# File 'docs/01450_Systems_00003_Map_Engine.rb', line 1996

def invisible_event
  @invisible_event
end

#listArray<RPG::EventCommand> (readonly)

Returns list of commands that should be executed.

Returns:

  • (Array<RPG::EventCommand>)

    list of commands that should be executed



1990
1991
1992
# File 'docs/01450_Systems_00003_Map_Engine.rb', line 1990

def list
  @list
end

#original_idInteger (readonly)

Returns Original id of the event.

Returns:

  • (Integer)

    Original id of the event



2000
2001
2002
# File 'docs/01450_Systems_00003_Map_Engine.rb', line 2000

def original_id
  @original_id
end

#original_mapInteger (readonly)

Returns Original map id of the event.

Returns:

  • (Integer)

    Original map id of the event



2002
2003
2004
# File 'docs/01450_Systems_00003_Map_Engine.rb', line 2002

def original_map
  @original_map
end

#startingBoolean (readonly)

Returns if the event wants to start.

Returns:

  • (Boolean)

    if the event wants to start



1992
1993
1994
# File 'docs/01450_Systems_00003_Map_Engine.rb', line 1992

def starting
  @starting
end

#sym_aliasSymbol? (readonly)

Returns The symbol alias of the event.

Returns:

  • (Symbol, nil)

    The symbol alias of the event



2004
2005
2006
# File 'docs/01450_Systems_00003_Map_Engine.rb', line 2004

def sym_alias
  @sym_alias
end

#triggerInteger? (readonly)

Returns Type of trigger for the event (0: Action key, 1: Player contact, 2: Event contact, 3: Autorun, 4: Parallel process).

Returns:

  • (Integer, nil)

    Type of trigger for the event (0: Action key, 1: Player contact, 2: Event contact, 3: Autorun, 4: Parallel process)



1988
1989
1990
# File 'docs/01450_Systems_00003_Map_Engine.rb', line 1988

def trigger
  @trigger
end

Instance Method Details

#activated?Boolean

Check if the character is activate. Useful to make difference between event without active page and others.

Returns:

  • (Boolean)


2058
2059
# File 'docs/01450_Systems_00003_Map_Engine.rb', line 2058

def activated?
end

#can_be_shown?Boolean

Tell if the event can have a sprite or not

Returns:

  • (Boolean)


2018
2019
# File 'docs/01450_Systems_00003_Map_Engine.rb', line 2018

def can_be_shown?
end

#can_parallel_execute?Boolean

Tell if the event can execute in parallel process or automatic process

Returns:

  • (Boolean)


2015
2016
# File 'docs/01450_Systems_00003_Map_Engine.rb', line 2015

def can_parallel_execute?
end

#check_event_trigger_auto

Check if the event starts automaticaly and start if so



2042
2043
# File 'docs/01450_Systems_00003_Map_Engine.rb', line 2042

def check_event_trigger_auto
end

#check_event_trigger_touch(x, y)

Check if the event touch the player and start it if so

Parameters:

  • x (Integer)

    the x position to check

  • y (Integer)

    the y position to check



2039
2040
# File 'docs/01450_Systems_00003_Map_Engine.rb', line 2039

def check_event_trigger_touch(x, y)
end

#clear_starting

Sets @starting to false allowing the event to move with its default move route



2021
2022
# File 'docs/01450_Systems_00003_Map_Engine.rb', line 2021

def clear_starting
end

#erase

Remove the event from the map



2031
2032
# File 'docs/01450_Systems_00003_Map_Engine.rb', line 2031

def erase
end

#find_path(to:, radius: 0, tries: Pathfinding::TRY_COUNT, type: nil)

Use path finding to locate the current event move else

Examples:

find path to x=10 y=15 with an error radius of 5 tiles

find_path(to:[10,15], radius:5)

Parameters:

  • to (Array<Integer, Integer>, Game_Character)

    the target, [x, y] or Game_Character object

  • radius (Integer) (defaults to: 0)

    <default : 0> the distance from the target to consider it as reached

  • tries (Integer, Symbol) (defaults to: Pathfinding::TRY_COUNT)

    <default : 5> the number of tries allowed to this request, use :infinity to unlimited try count

  • type (Symbol) (defaults to: nil)


2054
2055
# File 'docs/01450_Systems_00003_Map_Engine.rb', line 2054

def find_path(to:, radius: 0, tries: Pathfinding::TRY_COUNT, type: nil)
end

#initialize_parse_name

Parse the event name in order to setup the event particularity



2011
2012
# File 'docs/01450_Systems_00003_Map_Engine.rb', line 2011

def initialize_parse_name
end

#over_trigger?Boolean

Tells if the Event cannot start

Returns:

  • (Boolean)


2025
2026
# File 'docs/01450_Systems_00003_Map_Engine.rb', line 2025

def over_trigger?
end

#refresh

Refresh the event : check if an other page is valid and if so, refresh the graphics and command list



2034
2035
# File 'docs/01450_Systems_00003_Map_Engine.rb', line 2034

def refresh
end

#start

Starts the event if possible



2028
2029
# File 'docs/01450_Systems_00003_Map_Engine.rb', line 2028

def start
end

#update

Update the Game_Character and its internal Interpreter



2045
2046
# File 'docs/01450_Systems_00003_Map_Engine.rb', line 2045

def update
end