character

package
v0.7.13 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Tmpl

type Tmpl struct {
	Core  *core.Core
	Rand  *rand.Rand
	Index int

	//cooldown related
	ActionCD []int

	AvailableCDCharge []int

	//mods
	Mods          []core.CharStatMod
	PreDamageMods []core.PreDamageMod
	ReactMod      []core.ReactionBonusMod
	Tags          map[string]int
	//Profile info
	Base     core.CharacterBase
	Weapon   core.WeaponProfile
	Stats    [core.EndStatType]float64
	Talents  core.TalentProfile
	SkillCon int
	BurstCon int
	CharZone core.ZoneType

	CDReductionFuncs []core.CDAdjust

	Energy    float64
	EnergyMax float64

	// TODO: maybe should change this to % of max hp
	HPCurrent float64

	//counters
	NormalHitNum  int //how many hits in a normal combo
	NormalCounter int

	//infusion
	Infusion core.WeaponInfusion //TODO currently just overides the old; disregarding any existing
	// contains filtered or unexported fields
}

func NewTemplateChar

func NewTemplateChar(x *core.Core, p core.CharacterProfile) (*Tmpl, error)

func (*Tmpl) ActionFrames

func (t *Tmpl) ActionFrames(a core.ActionType, p map[string]int) (int, int)

func (*Tmpl) ActionInterruptableDelay

func (t *Tmpl) ActionInterruptableDelay(next core.ActionType, p map[string]int) int

func (*Tmpl) ActionReady

func (c *Tmpl) ActionReady(a core.ActionType, p map[string]int) bool

TODO: energy calc mode currently not working. we need to reset action or else we might get charges < 0 while trying to SetCD

func (*Tmpl) ActionStam

func (c *Tmpl) ActionStam(a core.ActionType, p map[string]int) float64

func (*Tmpl) AddCDAdjustFunc

func (c *Tmpl) AddCDAdjustFunc(rd core.CDAdjust)

func (*Tmpl) AddEnergy

func (c *Tmpl) AddEnergy(src string, e float64)

func (*Tmpl) AddMod

func (c *Tmpl) AddMod(mod core.CharStatMod)

func (*Tmpl) AddPreDamageMod

func (c *Tmpl) AddPreDamageMod(mod core.PreDamageMod)

func (*Tmpl) AddReactBonusMod

func (t *Tmpl) AddReactBonusMod(mod core.ReactionBonusMod)

func (*Tmpl) AddTag

func (c *Tmpl) AddTag(key string, val int)

func (*Tmpl) AddTask

func (t *Tmpl) AddTask(fun func(), name string, delay int)

func (*Tmpl) AddWeaponInfuse

func (c *Tmpl) AddWeaponInfuse(inf core.WeaponInfusion)

func (*Tmpl) AdvanceNormalIndex

func (c *Tmpl) AdvanceNormalIndex()

advance normal index, return the current one

func (*Tmpl) Aimed

func (c *Tmpl) Aimed(p map[string]int) (int, int)

func (*Tmpl) Attack

func (c *Tmpl) Attack(p map[string]int) (int, int)

func (*Tmpl) Burst

func (c *Tmpl) Burst(p map[string]int) (int, int)

func (*Tmpl) CalcBaseStats

func (t *Tmpl) CalcBaseStats() error

func (*Tmpl) CharIndex

func (c *Tmpl) CharIndex() int

func (*Tmpl) ChargeAttack

func (c *Tmpl) ChargeAttack(p map[string]int) (int, int)

func (*Tmpl) Charges added in v0.5.12

func (c *Tmpl) Charges(a core.ActionType) int

func (*Tmpl) ConsumeEnergy

func (c *Tmpl) ConsumeEnergy(delay int)

func (*Tmpl) Cooldown

func (c *Tmpl) Cooldown(a core.ActionType) int

func (*Tmpl) CurrentEnergy

func (c *Tmpl) CurrentEnergy() float64

func (*Tmpl) Dash

func (c *Tmpl) Dash(p map[string]int) (int, int)

func (*Tmpl) DeleteMod added in v0.6.2

func (c *Tmpl) DeleteMod(key string)

func (*Tmpl) DeletePreDamageMod added in v0.6.2

func (c *Tmpl) DeletePreDamageMod(key string)

func (*Tmpl) Ele

func (c *Tmpl) Ele() core.EleType

func (*Tmpl) HP

func (c *Tmpl) HP() float64

func (*Tmpl) HighPlungeAttack

func (c *Tmpl) HighPlungeAttack(p map[string]int) (int, int)

func (*Tmpl) Init

func (t *Tmpl) Init()

Character initialization function. Occurs AFTER all char/weapons are initially loaded

func (*Tmpl) Jump added in v0.7.0

func (c *Tmpl) Jump(p map[string]int) (int, int)

func (*Tmpl) Key

func (c *Tmpl) Key() core.CharKey

func (*Tmpl) Level

func (c *Tmpl) Level() int

func (*Tmpl) LowPlungeAttack

func (c *Tmpl) LowPlungeAttack(p map[string]int) (int, int)

func (*Tmpl) MaxEnergy

func (c *Tmpl) MaxEnergy() float64

func (*Tmpl) MaxHP

func (c *Tmpl) MaxHP() float64

func (*Tmpl) ModIsActive

func (c *Tmpl) ModIsActive(key string) bool

func (*Tmpl) ModifyHP

func (c *Tmpl) ModifyHP(amt float64)

func (*Tmpl) Name

func (c *Tmpl) Name() string

func (*Tmpl) NextNormalCounter added in v0.6.1

func (c *Tmpl) NextNormalCounter() int

func (*Tmpl) PreDamageModIsActive

func (c *Tmpl) PreDamageModIsActive(key string) bool

TODO: This design pattern feels wrong... I think we should have mods be their own separate interface Each mod would then have an "IsActive" function that we pass a character to?

func (*Tmpl) PreDamageSnapshotAdjust

func (c *Tmpl) PreDamageSnapshotAdjust(a *core.AttackEvent, t core.Target) []interface{}

func (*Tmpl) QueueParticle

func (c *Tmpl) QueueParticle(src string, num int, ele core.EleType, delay int)

func (*Tmpl) ReactBonus

func (t *Tmpl) ReactBonus(atk core.AttackInfo) (amt float64)

func (*Tmpl) ReactBonusModIsActive

func (c *Tmpl) ReactBonusModIsActive(key string) bool

func (*Tmpl) ReceiveParticle

func (c *Tmpl) ReceiveParticle(p core.Particle, isActive bool, partyCount int)

func (*Tmpl) ReduceActionCooldown

func (c *Tmpl) ReduceActionCooldown(a core.ActionType, v int)

func (*Tmpl) RemoveTag

func (c *Tmpl) RemoveTag(key string)

func (*Tmpl) ResetActionCooldown

func (c *Tmpl) ResetActionCooldown(a core.ActionType)

func (*Tmpl) ResetNormalCounter

func (c *Tmpl) ResetNormalCounter()

func (*Tmpl) SetAbilCancelFrames added in v0.5.5

func (t *Tmpl) SetAbilCancelFrames(prevAbil core.ActionType, nextAbil core.ActionType, frames int)

func (*Tmpl) SetCD

func (c *Tmpl) SetCD(a core.ActionType, dur int)

SetCD takes two parameters:

  • a core.ActionType: this is the action type we are triggering the cooldown for
  • dur: duration in frames that the cooldown should last for

It is assumed that AvailableCDCharges[a] > 0 (otherwise action should not have been allowed)

SetCD works by adding the cooldown duration to a queue. This is because when there are multiple charges, the game will first finish recharging the first charge before starting the full cooldown for the second charge.

When a cooldown is added to queue for the first time, a queue worker is started. This queue worker will check back at the cooldown specified for the first queued item, and if the queued cooldown did not change, it will increment the number of charges by 1, and reschedule itself to check back for the next item in queue

Sometimes, the queued cooldown gets adjusted via ReduceActionCooldown or ResetActionCooldown. When this happens, the initial queued worker will check back at the wrong time. To prevent this, we use cdQueueWorkerStartedAt[a] which tracks the frame the worker started at. So when ReduceActionCooldown or ResetActionCooldown gets called, we start a new worker, updating cdQueueWorkerStartedAt[a] to represent the new worker start frame. This way the old worker can check this value first and then gracefully exit if it no longer matches its starting frame

func (*Tmpl) SetCDWithDelay

func (c *Tmpl) SetCDWithDelay(a core.ActionType, dur int, delay int)

func (*Tmpl) SetIndex added in v0.5.5

func (t *Tmpl) SetIndex(index int)

func (*Tmpl) SetNormalCancelFrames added in v0.5.5

func (t *Tmpl) SetNormalCancelFrames(normalHitNum int, nextAbil core.ActionType, frames int)

func (*Tmpl) SetNumCharges added in v0.5.12

func (c *Tmpl) SetNumCharges(a core.ActionType, num int)

func (*Tmpl) SetWeaponKey

func (c *Tmpl) SetWeaponKey(k string)

func (*Tmpl) Skill

func (c *Tmpl) Skill(p map[string]int) (int, int)

func (*Tmpl) Snapshot

func (c *Tmpl) Snapshot(a *core.AttackInfo) core.Snapshot

func (*Tmpl) SnapshotStats

func (c *Tmpl) SnapshotStats() ([core.EndStatType]float64, []interface{})

func (*Tmpl) Stat

func (t *Tmpl) Stat(s core.StatType) float64

func (*Tmpl) Tag

func (c *Tmpl) Tag(key string) int

func (*Tmpl) TalentLvlAttack

func (c *Tmpl) TalentLvlAttack() int

func (*Tmpl) TalentLvlBurst

func (c *Tmpl) TalentLvlBurst() int

func (*Tmpl) TalentLvlSkill

func (c *Tmpl) TalentLvlSkill() int

func (*Tmpl) Tick

func (t *Tmpl) Tick()

func (*Tmpl) WeaponClass

func (c *Tmpl) WeaponClass() core.WeaponClass

func (*Tmpl) WeaponInfuseIsActive added in v0.5.5

func (c *Tmpl) WeaponInfuseIsActive(key string) bool

func (*Tmpl) WeaponKey

func (c *Tmpl) WeaponKey() string

func (*Tmpl) Zone

func (c *Tmpl) Zone() core.ZoneType

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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