QuestTracker

Keeps track of player quest progress

Constructor

new QuestTracker(player, active, completed)

Parameters:
Name Type Description
player Player
active Array
completed Array
Properties:
Name Type Description
player Player
completedQuests Map
activeQuests Map

Methods

canStart(quest) → {boolean}

Parameters:
Name Type Description
quest Quest
Returns:
boolean

complete(qid)

Parameters:
Name Type Description
qid string

emit(event, …args)

Proxy events to all active quests

Parameters:
Name Type Attributes Description
event string
args * <repeatable>

hydrate(state, questData)

Parameters:
Name Type Description
state GameState
questData object

Data pulled from the pfile

isActive(qid) → {boolean}

Parameters:
Name Type Description
qid string
Returns:
boolean

isComplete(qid) → {boolean}

Parameters:
Name Type Description
qid string
Returns:
boolean

serialize() → {object}

Returns:
object

start(queset)

Parameters:
Name Type Description
queset Quest