game

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ScoreMax = 350
)

Functions

func InitGame

func InitGame()

InitGame sets up all game state for a fresh game. Call once before MainLoop.

func Run

func Run()

Types

type BlowRes

type BlowRes int

type MeleeMsg

type MeleeMsg []MeleePart

A MeleeMsg is a sequence of parts that combine to form one message

type MeleePart

type MeleePart struct {
	Text   string
	Marker int // -1 = normal text, fWep = weapon, fDef = defender
}

MeleePart is a fragment of a melee message (either a string or fWep/fDef marker)

type MeleeSet

type MeleeSet []MeleeMsg

MeleeSet is a set of alternative messages for one outcome type

type MeleeTable

type MeleeTable [9]MeleeSet

MeleeTable is indexed by BlowRes-1 (Missed=0, Unconscious=1, Killed=2, LightWound=3, HeavyWound=4, Stagger=5, LoseWeapon=6, Hesitate=7, SittingDuck=8)

type VillainEntry

type VillainEntry struct {
	Villain *Object
	Best    *Object // best weapon against this villain
	BestAdv int     // advantage conferred by best weapon
	Prob    int     // probability of waking if unconscious
	Msgs    *MeleeTable
}

VillainEntry holds a villain's combat parameters

type ZorkData

type ZorkData struct {
	// ---- Game progress ----
	Dead    bool
	Deaths  int
	WonGame bool

	// ---- Misc counters ----
	HelloSailor  int
	IsSprayed    bool
	FumbleNumber int
	FumbleProb   int
	DescObj      *Object

	// ---- Dungeon flags ----
	TrollFlag         bool
	CyclopsFlag       bool
	MagicFlag         bool
	LowTide           bool
	DomeFlag          bool
	EmptyHanded       bool
	LLDFlag           bool
	RainbowFlag       bool
	DeflateFlag       bool
	CoffinCure        bool
	GrateRevealed     bool
	KitchenWindowFlag bool
	CageTop           bool
	RugMoved          bool
	GrUnlock          bool
	CycloWrath        int
	MirrorMung        bool
	GateFlag          bool
	GatesOpen         bool
	WaterLevel        int
	MatchCount        int
	EggSolve          bool
	ThiefHere         bool
	ThiefEngrossed    bool
	LoudFlag          bool
	SingSong          bool
	BuoyFlag          bool
	BeachDig          int
	LightShaft        int
	LampTableIdx      int
	CandleTableIdx    int
	XB                bool
	XC                bool
	Deflate           bool
	LoadAllowed       int
	LoadMax           int

	// ---- Combat ----
	Villains []*VillainEntry
}

ZorkData holds all Zork I specific mutable state that is not part of the generic engine. Stored in G.GameData during play.

Jump to

Keyboard shortcuts

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