Class: PFM::Quests

Inherits:
Object show all
Defined in:
docs/01450_Systems_08000_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/01450_Systems_08000_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/01450_Systems_08000_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/01450_Systems_08000_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/01450_Systems_08000_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/01450_Systems_08000_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/01450_Systems_08000_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/01450_Systems_08000_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/01450_Systems_08000_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/01450_Systems_08000_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/01450_Systems_08000_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



106
107
# File 'docs/01450_Systems_08000_Quest.rb', line 106

def check_quest(quest_id)
end

#check_up_signal

Check the signals and display them



102
103
# File 'docs/01450_Systems_08000_Quest.rb', line 102

def check_up_signal
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)


125
126
# File 'docs/01450_Systems_08000_Quest.rb', line 125

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/01450_Systems_08000_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/01450_Systems_08000_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)


116
117
# File 'docs/01450_Systems_08000_Quest.rb', line 116

def failed?(quest_id)
end

#failed_quest(quest_id)



46
47
# File 'docs/01450_Systems_08000_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)


111
112
# File 'docs/01450_Systems_08000_Quest.rb', line 111

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/01450_Systems_08000_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



121
122
# File 'docs/01450_Systems_08000_Quest.rb', line 121

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/01450_Systems_08000_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/01450_Systems_08000_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/01450_Systems_08000_Quest.rb', line 99

def hatch_egg
end

#import_from_dot24

Import the quest data from dot 24 version of PSDK



128
129
# File 'docs/01450_Systems_08000_Quest.rb', line 128

def import_from_dot24
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/01450_Systems_08000_Quest.rb', line 92

def see_pokemon(pokemon_symbol)
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/01450_Systems_08000_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/01450_Systems_08000_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/01450_Systems_08000_Quest.rb', line 28

def start(quest_id)
end

#update_quest_data_for_studio

Update teh quest data for Studio



131
132
# File 'docs/01450_Systems_08000_Quest.rb', line 131

def update_quest_data_for_studio
end