core

package
v0.0.0-...-dff1495 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package core provides core functionality for a simulation:

  • combat
  • tasks
  • event handling
  • logging
  • constructs (really should be just generic objects?)
  • status

Index

Constants

View Source
const MaxTeamSize = 4

Variables

View Source
var (
	NewCharFuncMap = make(map[keys.Char]NewCharacterFunc)
)

Functions

func RegisterCharFunc

func RegisterCharFunc(char keys.Char, f NewCharacterFunc)

func RegisterSetFunc

func RegisterSetFunc(set keys.Set, f NewSetFunc)

func RegisterWeaponFunc

func RegisterWeaponFunc(weap keys.Weapon, f NewWeaponFunc)

Types

type Core

type Core struct {
	F     int
	Flags Flags
	Seed  int64
	Rand  *rand.Rand
	// various functionalities of core
	Log        glog.Logger    // we use an interface here so that we can pass in a nil logger for all except 1 run
	Events     *event.Handler // track events: subscribe/unsubscribe/emit
	Status     *status.Handler
	Tasks      *task.Handler
	Combat     *combat.Handler
	Constructs *construct.Handler
	Player     *player.Handler
}

func New

func New(opt Opt) (*Core, error)

func (*Core) AddChar

func (c *Core) AddChar(p info.CharacterProfile) (int, error)

func (*Core) Init

func (c *Core) Init() error

func (*Core) QueueAttack

func (c *Core) QueueAttack(
	a combat.AttackInfo,
	p combat.AttackPattern,
	snapshotDelay int,
	dmgDelay int,
	callbacks ...combat.AttackCBFunc,
)

func (*Core) QueueAttackEvent

func (c *Core) QueueAttackEvent(ae *combat.AttackEvent, dmgDelay int)

func (*Core) QueueAttackWithSnap

func (c *Core) QueueAttackWithSnap(
	a combat.AttackInfo,
	s combat.Snapshot,
	p combat.AttackPattern,
	dmgDelay int,
	callbacks ...combat.AttackCBFunc,
)

func (*Core) QueueParticle

func (c *Core) QueueParticle(src string, num float64, ele attributes.Element, delay int)

func (*Core) SetupOnNormalHitEnergy

func (c *Core) SetupOnNormalHitEnergy()

func (*Core) Tick

func (c *Core) Tick() error

type Flags

type Flags struct {
	LogDebug          bool // Used to determine logging level
	DamageMode        bool // for hp mode
	DefHalt           bool // for hitlag
	EnableHitlag      bool // hitlag enabled
	IgnoreBurstEnergy bool // for ignoring energy when using burst
	Custom            map[string]float64
}

type NewCharacterFunc

type NewCharacterFunc func(core *Core, char *character.CharWrapper, p info.CharacterProfile) error

type NewSetFunc

type NewSetFunc func(core *Core, char *character.CharWrapper, count int, param map[string]int) (info.Set, error)

type NewWeaponFunc

type NewWeaponFunc func(core *Core, char *character.CharWrapper, p info.WeaponProfile) (info.Weapon, error)

type Opt

type Opt struct {
	Seed              int64
	Debug             bool
	EnableHitlag      bool
	DefHalt           bool
	DamageMode        bool
	IgnoreBurstEnergy bool
	Delays            info.Delays
}

type Reactable

type Reactable interface {
	React(a *combat.AttackEvent)
	AuraContains(e ...attributes.Element) bool
	Tick()
}

Directories

Path Synopsis
Package action describes the valid actions that any character may take
Package action describes the valid actions that any character may take
Code generated by "pipeline"; DO NOT EDIT.
Code generated by "pipeline"; DO NOT EDIT.
Package combat handles all combat related functionalities including
Package combat handles all combat related functionalities including
Code generated by "pipeline"; DO NOT EDIT.
Code generated by "pipeline"; DO NOT EDIT.
Package player contains player related tracking and functionalities: - tracking characters on the team - handling animations state - handling normal attack state - handling character stats and attributes - handling shielding
Package player contains player related tracking and functionalities: - tracking characters on the team - handling animations state - handling normal attack state - handling character stats and attributes - handling shielding
animation
package animation provides a simple way of tracking the current animation state at any given frame, as well as if the current frame is in animation lock or not
package animation provides a simple way of tracking the current animation state at any given frame, as well as if the current frame is in animation lock or not
shield
Package shield provide a handler to keep track of shields and add shields etc...
Package shield provide a handler to keep track of shields and add shields etc...

Jump to

Keyboard shortcuts

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