entity

package
v0.0.0-...-11e9a73 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Functions to configure the basics of different entity types

Index

Constants

This section is empty.

Variables

Functions

func NewChest

func NewChest(g interfaces.Game) interfaces.Entity

func NewGargoyle

func NewGargoyle(g interfaces.Game) interfaces.Entity

func NewShade

func NewShade(g interfaces.Game) interfaces.Entity

func NewShielder

func NewShielder(g interfaces.Game) interfaces.Entity

Types

type Entity

type Entity struct {
	EntityId, BoardId, X, Y, Ardour, MaxArdour int
	Game                                       interfaces.Game
	Name, Type, Subtype                        string
	Tangible, Dead                             bool
	DeathFunction                              func()
	TroddenFunction                            func(interfaces.Entity)
	RepositionFunction                         func(fromBId, fromX, fromY, toBId, toX, toY int)
	TurnFunction                               func(int) bool
	ActionQueue                                []interfaces.Action
}

func New

func New(entid int, g interfaces.Game) *Entity

func NewAbilityTrigger

func NewAbilityTrigger(g interfaces.Game, abilityCode string) *Entity

func NewBoulder

func NewBoulder(g interfaces.Game, roll interfaces.Direction) *Entity

Spawns a rolling boulder in a given direction, which is one of * N, E, S, or W

func NewBoulderTrap

func NewBoulderTrap(g interfaces.Game, wallDir interfaces.Direction) *Entity

Makes a boulder trap that throws a boulder from the nearest wall * in the given direction

func NewCaltropTrap

func NewCaltropTrap(g interfaces.Game) *Entity

func NewInertStatue

func NewInertStatue(g interfaces.Game) *Entity

func NewSprungTrap

func NewSprungTrap(g interfaces.Game) *Entity

func NewStairsUp

func NewStairsUp(g interfaces.Game) *Entity

func NewTeleportTrap

func NewTeleportTrap(g interfaces.Game, x, y int) *Entity

func NewTree

func NewTree(g interfaces.Game) *Entity

func (*Entity) ChangeArdour

func (e *Entity) ChangeArdour(difference int) int

func (*Entity) Die

func (e *Entity) Die()

func (*Entity) GetActionQueue

func (e *Entity) GetActionQueue() []interfaces.Action

func (*Entity) GetArdour

func (e *Entity) GetArdour() int

func (*Entity) GetEntityId

func (e *Entity) GetEntityId() int

func (*Entity) GetMaxArdour

func (e *Entity) GetMaxArdour() int

func (*Entity) GetName

func (e *Entity) GetName() string

func (*Entity) GetPosition

func (e *Entity) GetPosition() (boardid, x, y int)

func (*Entity) GetStringActionQueue

func (e *Entity) GetStringActionQueue() []string

func (*Entity) GetSubtype

func (e *Entity) GetSubtype() string

func (*Entity) GetType

func (e *Entity) GetType() string

func (*Entity) IsDead

func (e *Entity) IsDead() bool

func (*Entity) IsTangible

func (e *Entity) IsTangible() bool

func (*Entity) PopAction

func (e *Entity) PopAction() interfaces.Action

func (*Entity) RunTurn

func (me *Entity) RunTurn(tick int) bool

Runs custom code for the entity's turn. Useful for programming monsters * and the like. * * Returns true if it did something that should be announced to the players.

func (*Entity) SetActionQueue

func (e *Entity) SetActionQueue(aq []interfaces.Action)

func (*Entity) SetArdour

func (e *Entity) SetArdour(ardour int)

func (*Entity) SetEntityId

func (e *Entity) SetEntityId(id int)

TODO should force entity to be unique

func (*Entity) SetMaxArdour

func (e *Entity) SetMaxArdour(ardour int)

func (*Entity) SetName

func (e *Entity) SetName(name string)

func (*Entity) SetPosition

func (e *Entity) SetPosition(boardId, x, y int)

func (*Entity) SetSubtype

func (e *Entity) SetSubtype(t string)

func (*Entity) SetTangible

func (e *Entity) SetTangible(tangible bool)

func (*Entity) SetType

func (e *Entity) SetType(t string)

func (*Entity) SwapPositionWith

func (e *Entity) SwapPositionWith(other interfaces.Entity)

func (*Entity) Trodden

func (e *Entity) Trodden(by interfaces.Entity)

Jump to

Keyboard shortcuts

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