Class: PFM::Quests::Quest

Inherits:
Object show all
Defined in:
docs/4_Systems_800_Quest.rb

Overview

Class describing a running quest

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(quest_id) ⇒ Quest

Create a new quest

Parameters:

  • quest_id (Integer) —

    ID of the quest



200
201
# File 'docs/4_Systems_800_Quest.rb', line 200

def initialize(quest_id)
end

Instance Attribute Details

#quest_id ⇒ Integer (readonly)

Get the quest id

Returns:

  • (Integer)


197
198
199
# File 'docs/4_Systems_800_Quest.rb', line 197

def quest_id
  @quest_id
end

Class Method Details

.pokemon_from_data(data, level)

Get Pokémon from data

Parameters:

  • data (Integer, Symbol, Hash, Studio::Group::Encounter) —

    data of the Pokémon to give

  • level (Integer) —

    The level of the Pokémon (only used if the data is an Integer or a Symbol)



259
260
# File 'docs/4_Systems_800_Quest.rb', line 259

def pokemon_from_data(data, level)
end

Instance Method Details

#checked_by_player

Marks the quest as seen



235
236
# File 'docs/4_Systems_800_Quest.rb', line 235

def checked_by_player
end

#custom_objective?(objective_method_name, objective_nb) ⇒ Boolean

Test if a quest has a specific custom objective.

Parameters:

  • objective_method_name (Symbol) —

    The name of the method to call to validate the objective.

  • objective_nb (Integer) —

    The number of the objective to test.

Returns:

  • (Boolean) —

    True if the quest has the custom objective, false otherwise.



225
226
# File 'docs/4_Systems_800_Quest.rb', line 225

def custom_objective?(objective_method_name, objective_nb)
end

#data_get(*path, default) ⇒ Object, default

Get a specific data information

Parameters:

  • path (Array<Symbol, Integer>) —

    path used to obtain the data

  • default (Object) —

    default value

Returns:



206
207
# File 'docs/4_Systems_800_Quest.rb', line 206

def data_get(*path, default)
end

#data_set(*path, value)

Set a specific data information

Parameters:

  • path (Array<Symbol, Integer>) —

    path used to obtain the data

  • value (Object)


211
212
# File 'docs/4_Systems_800_Quest.rb', line 211

def data_set(*path, value)
end

#distribute_earnings

Distribute the earning of the quest



228
229
# File 'docs/4_Systems_800_Quest.rb', line 228

def distribute_earnings
end

#finished? ⇒ Boolean

Tell if all the objective of the quest are finished

Returns:

  • (Boolean)


232
233
# File 'docs/4_Systems_800_Quest.rb', line 232

def finished?
end

#objective?(objective_method_name, *args) ⇒ Boolean

Test if the quest has a specific kind of objective

Parameters:

  • objective_method_name (Symbol) —

    name of the method to call to validate the objective

  • args (Array) —

    double check to ensure the arguments match the test

Returns:

  • (Boolean)


217
218
# File 'docs/4_Systems_800_Quest.rb', line 217

def objective?(objective_method_name, *args)
end

#objective_catch_pokemon_test(pkm, pokemon) ⇒ Boolean

Check each specific pokemon criterion in catch_pokemon

Parameters:

  • pkm (Hash, Integer) —

    the criteria of the Pokemon

    The criteria are :

    nature: opt Integer # ID of the nature of the Pokemon
    type: opt Integer # One required type id
    min_level: opt Integer # The minimum level the Pokemon should have
    max_level: opt Integer # The maximum level the Pokemon should have
    level: opt Integer # The level the Pokemon must be
  • pokemon (PFM::Pokemon) —

    the Pokemon that should be check with the criteria

Returns:

  • (Boolean) —

    if the Pokemon check the criteria



253
254
# File 'docs/4_Systems_800_Quest.rb', line 253

def objective_catch_pokemon_test(pkm, pokemon)
end

#objective_text_list ⇒ Array<Array(String, Boolean)>

Note:

Does not return text of hidden objectives

Get the list of objective texts with their validation state

Returns:

  • (Array<Array(String, Boolean)>)


240
241
# File 'docs/4_Systems_800_Quest.rb', line 240

def objective_text_list
end