Class: PFM::Quests

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

Overview

The quest management

The main object is stored in $quests and PFM.game_state.quests

Defined Under Namespace

Classes: Quest

Constant Summary collapse

AUTO_CHECK_SIGNAL_ON_TEST =

Tell if the system should check the signal when we test finished?(id) or failed?(id)

true
AUTO_CHECK_SIGNAL_ON_ALL_OBJECTIVE_VALIDATED =

Tell if the system should check the signal when we check the quest termination

false

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeQuests

Create a new Quest management object



23
24
# File 'docs/4_Systems_800_Quest.rb', line 23

def initialize
end

Instance Attribute Details

#active_questsHash<Integer => Quest>

The list of active_quests

Returns:

  • (Hash<Integer => Quest>)


12
13
14
# File 'docs/4_Systems_800_Quest.rb', line 12

def active_quests
  @active_quests
end

#failed_questsHash<Integer => Quest>

The list of failed_quests

Returns:

  • (Hash<Integer => Quest>)


18
19
20
# File 'docs/4_Systems_800_Quest.rb', line 18

def failed_quests
  @failed_quests
end

#finished_questsHash<Integer => Quest>

The list of finished_quests

Returns:

  • (Hash<Integer => Quest>)


15
16
17
# File 'docs/4_Systems_800_Quest.rb', line 15

def finished_quests
  @finished_quests
end

#signalHash<start: Array<Integer>, finish: Array<Integer>, failed: Array<Integer>>

The signals that inform the game what quest started or has been finished

Returns:

  • (Hash<start: Array<Integer>, finish: Array<Integer>, failed: Array<Integer>>)


21
22
23
# File 'docs/4_Systems_800_Quest.rb', line 21

def signal
  @signal
end

Instance Method Details

#active_quest(quest_id) ⇒ Quest

Return an active quest by its id

Parameters:

  • quest_id (Integer)

Returns:



33
34
# File 'docs/4_Systems_800_Quest.rb', line 33

def active_quest(quest_id)
end

#add_item(item_id)

Inform the manager that an item has been added to the bag of the Player

Parameters:

  • item_id (Integer)

    ID of the item in the database



80
81
# File 'docs/4_Systems_800_Quest.rb', line 80

def add_item(item_id)
end

#beat_npc(quest_id, npc_name_index) ⇒ Boolean

Inform the manager that a NPC has been beaten

Parameters:

  • quest_id (Integer)

    the ID of the quest in the database

  • npc_name_index (Integer)

    the index of the name of the NPC in the quest data

Returns:

  • (Boolean)

    if the quest has been updated



70
71
# File 'docs/4_Systems_800_Quest.rb', line 70

def beat_npc(quest_id, npc_name_index)
end

#beat_pokemon(pokemon_symbol)

Inform the manager that a Pokemon has been beaten

Parameters:

  • pokemon_symbol (Symbol)

    db_symbol of the Pokemon in the database



84
85
# File 'docs/4_Systems_800_Quest.rb', line 84

def beat_pokemon(pokemon_symbol)
end

#catch_pokemon(pokemon)

Inform the manager that a Pokemon has been captured

Parameters:



88
89
# File 'docs/4_Systems_800_Quest.rb', line 88

def catch_pokemon(pokemon)
end

#check_quest(quest_id)

Check if a quest is done or not

Parameters:

  • quest_id (Integer)

    ID of the quest in the database



126
127
# File 'docs/4_Systems_800_Quest.rb', line 126

def check_quest(quest_id)
end

#check_up_signal

Checks if there are any quests that have started or finished. If there are, it displays the quest information and updates the quest status.



122
123
# File 'docs/4_Systems_800_Quest.rb', line 122

def check_up_signal
end

#complete_custom_objective(quest_id, objective_nb) ⇒ Boolean

Completes a custom objective for a given quest.

Parameters:

  • quest_id (Integer/Symbol)

    The ID or db_symbol of the quest in the database.

  • objective_nb (Integer)

    The number of the objective to complete.

Returns:

  • (Boolean)

    True if the objective was completed successfully, false otherwise.



118
119
# File 'docs/4_Systems_800_Quest.rb', line 118

def complete_custom_objective(quest_id, objective_nb)
end

#earnings_got?(quest_id) ⇒ Boolean

Does the earning of a quest has been taken

Parameters:

  • quest_id (Integer)

    ID of the quest in the database

Returns:

  • (Boolean)


145
146
# File 'docs/4_Systems_800_Quest.rb', line 145

def earnings_got?(quest_id)
end

#egg_found Also known as: get_egg

Inform the manager an egg has been found



95
96
# File 'docs/4_Systems_800_Quest.rb', line 95

def egg_found
end

#fail_quest(quest_id) ⇒ Quest

Fail a quest Return a failed quest by its id

Parameters:

  • quest_id (Integer)

Returns:



44
45
# File 'docs/4_Systems_800_Quest.rb', line 44

def fail_quest(quest_id)
end

#failed?(quest_id) ⇒ Boolean

Is a quest failed ?

Parameters:

  • quest_id (Integer)

    ID of the quest in the database

Returns:

  • (Boolean)


136
137
# File 'docs/4_Systems_800_Quest.rb', line 136

def failed?(quest_id)
end

#failed_quest(quest_id)



46
47
# File 'docs/4_Systems_800_Quest.rb', line 46

def failed_quest(quest_id)
end

#finished?(quest_id) ⇒ Boolean

Is a quest finished ?

Parameters:

  • quest_id (Integer)

    ID of the quest in the database

Returns:

  • (Boolean)


131
132
# File 'docs/4_Systems_800_Quest.rb', line 131

def finished?(quest_id)
end

#finished_quest(quest_id) ⇒ Quest

Return a finished quest by its id

Parameters:

  • quest_id (Integer)

Returns:



38
39
# File 'docs/4_Systems_800_Quest.rb', line 38

def finished_quest(quest_id)
end

#get_earnings(quest_id) ⇒ Boolean

Get the earnings of a quest

Parameters:

  • quest_id (Integer)

    ID of the quest in the database

Returns:

  • (Boolean)

    if the earning were givent to the player



141
142
# File 'docs/4_Systems_800_Quest.rb', line 141

def get_earnings(quest_id)
end

#get_goal_data_index(quest_id, goal_index) ⇒ Integer

Get the goal data index (if array like items / speak_to return the index of the goal in the array info from data/quest data)

Parameters:

  • quest_id (Integer)

    the ID of the quest in the database

  • goal_index (Integer)

    the index of the goal in the goal order

Returns:

  • (Integer)


64
65
# File 'docs/4_Systems_800_Quest.rb', line 64

def get_goal_data_index(quest_id, goal_index)
end

#goal_shown?(quest_id, goal_index) ⇒ Boolean

Tell if a goal is shown or not

Parameters:

  • quest_id (Integer)

    the ID of the quest in the database

  • goal_index (Integer)

    the index of the goal in the goal order

Returns:

  • (Boolean)


57
58
# File 'docs/4_Systems_800_Quest.rb', line 57

def goal_shown?(quest_id, goal_index)
end

#hatch_egg

Inform the manager an egg has hatched



99
100
# File 'docs/4_Systems_800_Quest.rb', line 99

def hatch_egg
end

#import_from_dot24

Import the quest data from dot 24 version of PSDK



148
149
# File 'docs/4_Systems_800_Quest.rb', line 148

def import_from_dot24
end

#new?(quest_id) ⇒ Boolean

Checks if a quest is new

Parameters:

  • quest_id (Integer/Symbol)

    ID or db_symbol of the quest in the database

Returns:

  • (Boolean)

    true if the quest has not been seen, false otherwise



110
111
# File 'docs/4_Systems_800_Quest.rb', line 110

def new?(quest_id)
end

#see_pokemon(pokemon_symbol)

Inform the manager that a Pokemon has been seen

Parameters:

  • pokemon_symbol (Symbol)

    db_symbol of the Pokemon in the database



92
93
# File 'docs/4_Systems_800_Quest.rb', line 92

def see_pokemon(pokemon_symbol)
end

#seen_by_player(quest_id) ⇒ Boolean

Tell the quest it has been seen by the player

Parameters:

  • quest_id (Integer/Symbol)

    ID or db_symbol of the quest in the database

Returns:

  • (Boolean)

    if the quest wasn’t already seen by the player



104
105
# File 'docs/4_Systems_800_Quest.rb', line 104

def seen_by_player(quest_id)
end

#show_goal(quest_id, goal_index)

Show a goal of a quest

Parameters:

  • quest_id (Integer)

    the ID of the quest in the database

  • goal_index (Integer)

    the index of the goal in the goal order



51
52
# File 'docs/4_Systems_800_Quest.rb', line 51

def show_goal(quest_id, goal_index)
end

#speak_to_npc(quest_id, npc_name_index) ⇒ Boolean

Inform the manager that a NPC has been spoken to

Parameters:

  • quest_id (Integer)

    the ID of the quest in the database

  • npc_name_index (Integer)

    the index of the name of the NPC in the quest data

Returns:

  • (Boolean)

    if the quest has been updated



76
77
# File 'docs/4_Systems_800_Quest.rb', line 76

def speak_to_npc(quest_id, npc_name_index)
end

#start(quest_id) ⇒ Boolean

Start a new quest if possible

Parameters:

  • quest_id (Integer)

    the ID of the quest in the database

Returns:

  • (Boolean)

    if the quest started



28
29
# File 'docs/4_Systems_800_Quest.rb', line 28

def start(quest_id)
end

#update_quest_data_for_studio

Update teh quest data for Studio



151
152
# File 'docs/4_Systems_800_Quest.rb', line 151

def update_quest_data_for_studio
end