battle

package
v0.0.0-...-0a454e0 Latest Latest
Warning

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

Go to latest
Published: May 12, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Battle

type Battle struct {
	Player     data.Character
	Monster    data.Character
	BattleText []string
	State      BattleState
	Winner     string
}

func NewBattle

func NewBattle(player, monster data.Character) *Battle

func (*Battle) BattleTurn

func (b *Battle) BattleTurn(action []string)

func (*Battle) GetBattleData

func (b *Battle) GetBattleData() BattleData

type BattleData

type BattleData struct {
	PlayerName  string
	PlayerHP    string
	MonsterName string
	MonsterHP   string
	BattleState string
	Winner      string
	BattleText  []string
	Spells      map[string]string
}

type BattleState

type BattleState int
const (
	Win BattleState = iota
	Lose
	InProgress
	Escaped
)

type ConditionCheck

type ConditionCheck struct {
	IsFree    bool
	CanCast   bool
	IsCharmed bool
}

Jump to

Keyboard shortcuts

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