quests

package
v0.9.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 14, 2025 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QuestTokenSeparator = `-`
)

Variables

This section is empty.

Functions

func GetQuestCt

func GetQuestCt(includeSecret bool) int

func IsTokenAfter

func IsTokenAfter(currentToken string, nextToken string) bool

func LoadDataFiles

func LoadDataFiles()

file self loads due to init()

func PartsToToken

func PartsToToken(questId int, questStep string) string

func TokenToParts

func TokenToParts(questToken string) (questId int, questStep string)

Types

type Quest

type Quest struct {
	QuestId     int
	Name        string
	Description string
	Secret      bool        // Secret quests are useful for marking some progress without making it known to the player
	Steps       []QuestStep // String identifiers for each step required to complete the quest
	Rewards     QuestReward
}

func GetAllQuests

func GetAllQuests() []Quest

func GetQuest

func GetQuest(questToken string) *Quest

func (*Quest) Filename

func (r *Quest) Filename() string

func (*Quest) Filepath

func (r *Quest) Filepath() string

func (*Quest) Id

func (r *Quest) Id() int

func (*Quest) Validate

func (r *Quest) Validate() error

type QuestReward

type QuestReward struct {
	QuestId       string // new questId to give ( {id}-{step} format )
	Gold          int    // zero or more gold to give.
	ItemId        int    // itemId to give
	BuffId        int    // buffId to apply
	Experience    int    // experience to give
	SkillInfo     string // skill to give, format: skillId:skillLevel such as "map:1"
	PlayerMessage string // string to display to player
	RoomMessage   string // string to display to room
	RoomId        int    // roomId to move player to
}

type QuestStep

type QuestStep struct {
	Id          string // A way to identify this step of the quest such as "start"
	Description string // A description of the step
	Hint        string // A hint to accomplish this step (optional)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL