Class: Interpreter

Inherits:
Interpreter_RMXP show all
Defined in:
scripts/Interpreter_Environnement.rb,
scripts/Game_SelfVariables.rb,
scripts/Interpreter_Pokemon.rb,
scripts/Interpreter_Shortcut.rb

Overview

Interpreter of the event script commands

Constant Summary

Constants inherited from Interpreter_RMXP

Interpreter_RMXP::ItemGetME, Interpreter_RMXP::LiteRGSS2RGSS_Input, Interpreter_RMXP::RGSS2LiteRGSS_Input

Instance Attribute Summary

Attributes inherited from Interpreter_RMXP

#event_id

Instance Method Summary collapse

Methods inherited from Interpreter_RMXP

#clear, #command_101, #command_102, #command_103, #command_104, #command_105, #command_106, #command_111, #command_112, #command_113, #command_115, #command_116, #command_117, #command_118, #command_119, #command_121, #command_122, #command_123, #command_124, #command_125, #command_126, #command_127, #command_128, #command_129, #command_131, #command_132, #command_133, #command_134, #command_135, #command_136, #command_201, #command_202, #command_203, #command_204, #command_205, #command_206, #command_207, #command_208, #command_209, #command_210, #command_221, #command_222, #command_223, #command_224, #command_225, #command_231, #command_232, #command_233, #command_234, #command_235, #command_236, #command_241, #command_242, #command_245, #command_246, #command_247, #command_248, #command_249, #command_250, #command_251, #command_301, #command_302, #command_303, #command_311, #command_312, #command_313, #command_314, #command_315, #command_316, #command_317, #command_318, #command_319, #command_320, #command_321, #command_322, #command_331, #command_332, #command_333, #command_334, #command_335, #command_336, #command_337, #command_338, #command_339, #command_340, #command_351, #command_352, #command_353, #command_354, #command_355, #command_402, #command_403, #command_411, #command_413, #command_601, #command_602, #command_603, #command_end, #command_skip, #execute_command, #get_character, #initialize, #input_button, #iterate_actor, #iterate_battler, #iterate_enemy, #launch_common_event, #operate_value, #running?, #setup, #setup_choices, #setup_starting_event, #update

Constructor Details

This class inherits a constructor from Interpreter_RMXP

Instance Method Details

#add_egg(id) ⇒ PFM::Pokemon? Also known as: ajouter_oeuf

Add an egg to the Party (or in the PC)

Parameters:

  • id (Integer)

    the id of the Pokemon in the database

Returns:

Author:

  • Nuri Yuri

#add_item(item_id, no_delete = false)

Add an item to the bag if possible, will delete the event forever

Parameters:

  • item_id (Integer)

    id of the item in the database

  • no_delete (Boolean) (defaults to: false)

    bypass the deletion of the event

#add_parallax(image, x, y, z, zoom_x = 1, zoom_y = 1, opacity = 255, blend_type = 0)

Add a parallax

Parameters:

  • image (String)

    name of the image in Graphics/Pictures/

  • x (Integer)

    x coordinate of the parallax from the first pixel of the Map (16x16 tiles /!)

  • y (Integer)

    y coordinate of the parallax from the first pixel of the Map (16x16 tiles /!)

  • z (Integer)

    z superiority in the tile viewport

  • zoom_x (Numeric) (defaults to: 1)

    zoom_x of the parallax

  • zoom_y (Numeric) (defaults to: 1)

    zoom_y of the parallax

  • opacity (Integer) (defaults to: 255)

    opacity of the parallax (0~255)

  • blend_type (Integer) (defaults to: 0)

    blend_type of the parallax (0, 1, 2)

#add_pokemon(pokemon_or_id, level = 5, shiny = false) ⇒ PFM::Pokemon? Also known as: ajouter_pokemon, ajouter_stocker_pokemon

Add a pokemon to the party or store it in the PC

Parameters:

  • pokemon_or_id (Integer, PFM::Pokemon)

    the ID of the pokemon in the database or a Pokemon

  • level (Integer) (defaults to: 5)

    the level of the Pokemon (if ID given)

  • shiny (Boolean, Integer) (defaults to: false)

    true means the Pokemon will be shiny, 0 means it'll have no chance to be shiny, other number are the chance (1 / n) the pokemon can be shiny.

Returns:

  • (PFM::Pokemon, nil)

    if nil, the Pokemon couldn't be stored in the PC or added to the party. Otherwise it's the Pokemon that was added.

Author:

  • Nuri Yuri

#add_rename_pokemon(pokemon_or_id, level = 5, shiny = false, num_char = 10) ⇒ PFM::Pokemon? Also known as: ajouter_renommer_pokemon

Add a pokemon to the party or store it in the PC and rename it

Parameters:

  • pokemon_or_id (Integer, PFM::Pokemon)

    the ID of the pokemon in the database or a Pokemon

  • level (Integer) (defaults to: 5)

    the level of the Pokemon (if ID given)

  • shiny (Boolean, Integer) (defaults to: false)

    true means the Pokemon will be shiny, 0 means it'll have no chance to be shiny, other number are the chance (1 / n) the pokemon can be shiny.

  • num_char (Integer) (defaults to: 10)

    the number of character the Pokemon can have in its name.

Returns:

  • (PFM::Pokemon, nil)

    if nil, the Pokemon couldn't be stored in the PC or added to the party. Otherwise it's the Pokemon that was added.

Author:

  • Nuri Yuri

#add_specific_pokemon(hash) ⇒ PFM::Pokemon? Also known as: ajouter_pokemon_param

Add a pokemon (#add_pokemon) with specific informations.

Parameters:

  • hash (Hash)

    the parameters of the Pokemon, see PFM::Pokemon#generate_from_hash.

Returns:

Author:

  • Nuri Yuri

#call_battle_wild(id, level, shiny, no_shiny) #call_battle_wild(id, level, *args) #call_battle_wild(id, level, *args) Also known as: demarrer_combat

Start a wild battle

Overloads:

  • #call_battle_wild(id, level, shiny, no_shiny)

    Parameters:

    • id (Integer)

      id of the Pokemon in the database

    • level (Integer)

      level of the Pokemon

    • shiny (Boolean)

      if the Pokemon is shiny

    • no_shiny (Boolean)

      if the Pokemon cannot be shiny

  • #call_battle_wild(id, level, *args)

    Parameters:

  • #call_battle_wild(id, level, *args)

    Parameters:

    • id (Integer)

      id of the Pokemon in the database

    • level (Integer)

      level of the first Pokemon

    • args (Array<Integer, Integer>)

      array of id, level of the other Pokemon in the wild battle.

Author:

  • Nuri Yuri

#call_party_menu(id_var = ::Yuki::Var::TMP1, party = $actors, mode = :map) Also known as: appel_menu_equipe

Show the party menu in order to select a Pokemon

Parameters:

  • id_var (Integer) (defaults to: ::Yuki::Var::TMP1)

    id of the variable in which the index will be store (-1 = no selection)

  • party (Array<PFM::Pokemon>) (defaults to: $actors)

    the array of Pokemon to show in the menu

  • mode (Symbol) (defaults to: :map)

    the mode of the Menu (:map, :menu, :item, :hold, :battle)

Author:

  • Nuri Yuri

#carte_du_monde(arg = :view) Also known as: world_map

Open the world map

Parameters:

  • arg (Symbol) (defaults to: :view)

    the mode of the world map, :view or :fly

Author:

  • Nuri Yuri

#change_tileset(filename)

Change the tileset

Parameters:

  • filename (String)

    filename of the new tileset

#choice(variable_id, cancel_type, *choices)

Start a choice with more option than RMXP allows.

Parameters:

  • variable_id (Integer)

    the id of the Variable where the choice will be store.

  • cancel_type (Integer)

    the choice that cancel (-1 = no cancel)

  • choices (Array<String>)

    the list of possible choice.

Author:

  • Nuri Yuri

#cry_pokemon(id)

Play the cry of a Pokemon

Parameters:

  • id (Integer)

    the id of the Pokemon in the database

#delete_this_event_forever

Delete the current event forever

#detect_player(nb_pas, direction) ⇒ Boolean

Detect the player in a specific direction

Parameters:

  • nb_pas (Integer)

    the number of step between the event and the player

  • direction (Symbol, Integer)

    the direction : :right, 6, :down, 2, :left, 4, :up or 8

Returns:

  • (Boolean)

Author:

  • Nuri Yuri

#detect_player_circle(r) ⇒ Boolean

Detect the player in a circle around the event

Parameters:

  • r (Numeric)

    the square radius (r = R²) of the circle around the event

Returns:

  • (Boolean)

Author:

  • Nuri Yuri

#detect_player_rect(nx, ny) ⇒ Boolean

Detect the player in a rectangle around the event

Parameters:

  • nx (Integer)

    the x distance of detection between the event and the player

  • ny (Integer)

    the y distance of detection between the event and the player

Returns:

  • (Boolean)

Author:

  • Nuri Yuri

#emotion(type, char_id = 0, wait = 34)

Show an emotion to an event or the player

Parameters:

  • type (Symbol)

    the type of emotion (see wiki)

  • char_id (Integer) (defaults to: 0)

    the ID of the event (> 0), the current event (0) or the player (-1)

  • wait (Integer) (defaults to: 34)

    the number of frame the event will wait after this command.

#empty_and_save_party(id_storage = nil)

Save the team somewhere and make it empty in the point of view of the player.

Parameters:

  • id_storage (String) (defaults to: nil)

    the specific name of the storage, if nil sent to $storage.other_party

Author:

  • Nuri Yuri

#event_calling(common_event, event_id) ⇒ Boolean

Check if an event is calling a common event (in its first non comment commands)

Parameters:

  • common_event (Integer)

    the id of the common event

  • event_id (Integer)

    the id of the event on the MAP

Returns:

  • (Boolean)

#force_save Also known as: forcer_sauvegarde

Save the game without asking

#front_event_calling(common_event) ⇒ Boolean

Check if the front event calls a common event (in its first non comment commands)

Parameters:

  • common_event (Integer)

    the id of the common event in the database

Returns:

  • (Boolean)

Author:

  • Nuri Yuri

#get_local_variable(id_var) ⇒ Object #get_local_variable(id_var, operation, value = nil) ⇒ Object #get_local_variable(id_event, id_var) ⇒ Object #get_local_variable(id_event, id_var, operation, value = nil) ⇒ Object #get_local_variable(id_map, id_event, id_var) ⇒ Object #get_local_variable(id_map, id_event, id_var, operation, value = nil) ⇒ Object Also known as: VL, LV

Overloads:

  • #get_local_variable(id_var) ⇒ Object

    Get a local variable

    Parameters:

    • id_var (Symbol)

      the id of the variable

  • #get_local_variable(id_var, operation, value = nil) ⇒ Object

    Perform an operation on a local variable and get the result

    Parameters:

    • id_var (Symbol)

      the id of the variable

    • operation (Symbol)

      symbol of the operation to do on the variable

    • value (Object) (defaults to: nil)

      value associated to the operation

  • #get_local_variable(id_event, id_var) ⇒ Object

    Get a local variable of a specific event

    Parameters:

    • id_event (Integer)

      the id of the event

    • id_var (Symbol)

      the id of the variable

  • #get_local_variable(id_event, id_var, operation, value = nil) ⇒ Object

    Perform an operation on a local variable of an specific event and get the result

    Parameters:

    • id_event (Integer)

      the id of the event

    • id_var (Symbol)

      the id of the variable

    • operation (Symbol)

      symbol of the operation to do on the variable

    • value (Object) (defaults to: nil)

      value associated to the operation

  • #get_local_variable(id_map, id_event, id_var) ⇒ Object

    Get a local variable of a specific event on a specific map

    Parameters:

    • id_map (Integer)

      the id of the map

    • id_event (Integer)

      the id of the event

    • id_var (Symbol)

      the id of the variable

  • #get_local_variable(id_map, id_event, id_var, operation, value = nil) ⇒ Object

    Perform an operation on a local variable of an specific event on a specific map and get the result

    Parameters:

    • id_map (Integer)

      the id of the map

    • id_event (Integer)

      the id of the event

    • id_var (Symbol)

      the id of the variable

    • operation (Symbol)

      symbol of the operation to do on the variable

    • value (Object) (defaults to: nil)

      value associated to the operation

Returns:

#get_self_switch(self_switch, event_id, map_id = @map_id) ⇒ Boolean Also known as: get_ss

Get the value of a self_switch

Parameters:

  • self_switch (String)

    the name of the self switch (“A”, “B”, “C”, “D”)

  • event_id (Integer)

    the id of the event that see the self switch

  • map_id (Integer) (defaults to: @map_id)

    the id of the map where the event see the self switch

Returns:

  • (Boolean)

    the value of the self switch

Author:

  • Leikt

#gmGame_Map

Return the $game_map

Returns:

#gpGame_Player

Return the $game_player

Returns:

#gsGame_Switches

Return the $game_switches

Returns:

#gtGame_Temp

Return the $game_temp

Returns:

#gvGame_Variables

Return the $game_variables

Returns:

#partyPFM::Pokemon_Party

Return the $pokemon_party

Returns:

#player_spotted?(nb_pas) ⇒ Boolean Also known as: trainer_spotted

Detect if the event can spot the player and move to the player

Parameters:

  • nb_pas (Integer)

    number of step the event should do to spot the player

Returns:

  • (Boolean)

    if the event spot the player or not

Author:

  • Nuri Yuri

#quest_book Also known as: livre_quetes

Show the quest book

#rename_pokemon(index_or_pokemon, num_char = 10) Also known as: renommer_pokemon

Show the rename interface of a Pokemon

Parameters:

  • index_or_pokemon (Integer, PFM::Pokemon)

    the Pokemon or the index of the Pokemon in the party (0~5)

  • num_char (Integer) (defaults to: 10)

    the number of character the Pokemon can have in its name.

Author:

  • Nuri Yuri

#retreive_saved_party(id_storage = nil)

Retreive the saved team when emptied ( /!\ empty the current team)

Parameters:

  • id_storage (String) (defaults to: nil)

    the specific name of the storage, if nil sent to $storage.other_party

Author:

  • Nuri Yuri

#retreive_stolen_pokemon(id_storage = nil)

Retreive previously stolen Pokemon ( /!\ uses #add_pokemon)

Parameters:

  • id_storage (String) (defaults to: nil)

    the specific name of the storage, if nil sent to $storage.other_party

Author:

  • Nuri Yuri

#set_local_variable(value, id_var, id_event = @event_id, id_map = @map_id) Also known as: set_VL, set_LV

Get a local variable

Parameters:

  • value (Object)

    the new value of the variable

  • id_var (Symbol)

    the id of the variable

  • id_event (Integer) (defaults to: @event_id)

    the id of the event

  • id_map (Integer) (defaults to: @map_id)

    the id of the map

#set_self_switch(value, self_switch, event_id, map_id = @map_id) Also known as: set_ss

Set the value of a self_switch

Parameters:

  • value (Boolean)

    the new value of the switch

  • self_switch (String)

    the name of the self switch (“A”, “B”, “C”, “D”)

  • event_id (Integer)

    the id of the event that see the self switch

  • map_id (Integer) (defaults to: @map_id)

    the id of the map where the event see the self switch

Author:

  • Leikt

#skill_learn(pokemon, id_skill) Also known as: enseigner_capacite

Learn a skill to a Pokemon

Parameters:

  • pokemon (PFM::Pokemon)

    the Pokemon that will learn the skill (use $actors for a Pokemon in the party).

  • id_skill (Integer)

    the id of the skill in the database

Author:

  • Nuri Yuri

#start_pc Also known as: demarrer_pc

Start the storage PC

#start_trade(server)

Start an online Trade

Parameters:

  • server (Boolean)

    if the player is the server

#steal_pokemon(indexes, id_storage = nil, no_save = false)

Save some Pokemon of the team somewhere and remove them from the party

Parameters:

  • id_storage (String) (defaults to: nil)

    the specific name of the storage, if nil sent to $storage.other_party

  • indexes (Array, Range)

    list of index in the team

  • no_save (Boolean) (defaults to: false)

    if the Pokémon are not saved.

Author:

  • Nuri Yuri

#store_pokemon(pokemon_or_id, level = 5, shiny = false) ⇒ PFM::Pokemon? Also known as: stocker_pokemon

Store a Pokemon in the PC

Parameters:

  • pokemon_or_id (Integer, PFM::Pokemon)

    the ID of the pokemon in the database or a Pokemon

  • level (Integer) (defaults to: 5)

    the level of the Pokemon (if ID given)

  • shiny (Boolean, Integer) (defaults to: false)

    true means the Pokemon will be shiny, 0 means it'll have no chance to be shiny, other number are the chance (1 / n) the pokemon can be shiny.

Returns:

  • (PFM::Pokemon, nil)

    if nil, the Pokemon couldn't be stored in the PC. Otherwise it's the Pokemon that was added.

Author:

  • Nuri Yuri

#withdraw_pokemon(id, counter = 1) Also known as: retirer_pokemon

withdraw a Pokemon from the Party

Parameters:

  • id (Integer)

    the id of the Pokemon you want to withdraw

  • counter (Integer) (defaults to: 1)

    the number of Pokemon with this id to withdraw

Author:

  • Nuri Yuri

#withdraw_pokemon_at(index) Also known as: retirer_pokemon_index

withdraw a Pokemon from the party at a specific position in the Party

Parameters:

  • index (Integer)

    the position (0~5) in the party.