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

Instance Method Summary collapse

Constructor Details

#initialize(quest_id) ⇒ Quest

Create a new quest

Parameters:

  • quest_id (Integer)

    ID of the quest



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

def initialize(quest_id)
end

Instance Attribute Details

#quest_idInteger (readonly)

Get the quest id

Returns:

  • (Integer)


193
194
195
# File 'docs/4_Systems_800_Quest.rb', line 193

def quest_id
  @quest_id
end

Instance Method Details

#checked_by_player

Marks the quest as seen



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

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.



221
222
# File 'docs/4_Systems_800_Quest.rb', line 221

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:



202
203
# File 'docs/4_Systems_800_Quest.rb', line 202

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)


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

def data_set(*path, value)
end

#distribute_earnings

Distribute the earning of the quest



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

def distribute_earnings
end

#finished?Boolean

Tell if all the objective of the quest are finished

Returns:

  • (Boolean)


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

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)


213
214
# File 'docs/4_Systems_800_Quest.rb', line 213

def objective?(objective_method_name, *args)
end

#objective_catch_pokemon_test(pkm, pokemon) ⇒ Boolean

Check the specific pokemon criterion in catch_pokemon

Parameters:

  • pkm (Hash, Integer)

    the criterions of the Pokemon

    The criterions 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 criterions

Returns:

  • (Boolean)

    if the Pokemon pokemon check the criterions



249
250
# File 'docs/4_Systems_800_Quest.rb', line 249

def objective_catch_pokemon_test(pkm, pokemon)
end

#objective_text_listArray<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)>)


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

def objective_text_list
end