Documentation ¶
Index ¶
- type Tmpl
- func (t *Tmpl) ActionFrames(a core.ActionType, p map[string]int) (int, int)
- func (t *Tmpl) ActionInterruptableDelay(next core.ActionType, p map[string]int) int
- func (c *Tmpl) ActionReady(a core.ActionType, p map[string]int) bool
- func (c *Tmpl) ActionStam(a core.ActionType, p map[string]int) float64
- func (c *Tmpl) AddCDAdjustFunc(rd core.CDAdjust)
- func (c *Tmpl) AddEnergy(src string, e float64)
- func (c *Tmpl) AddMod(mod core.CharStatMod)
- func (c *Tmpl) AddPreDamageMod(mod core.PreDamageMod)
- func (t *Tmpl) AddReactBonusMod(mod core.ReactionBonusMod)
- func (c *Tmpl) AddTag(key string, val int)
- func (t *Tmpl) AddTask(fun func(), name string, delay int)
- func (c *Tmpl) AddWeaponInfuse(inf core.WeaponInfusion)
- func (c *Tmpl) AdvanceNormalIndex()
- func (c *Tmpl) Aimed(p map[string]int) (int, int)
- func (c *Tmpl) Attack(p map[string]int) (int, int)
- func (c *Tmpl) Burst(p map[string]int) (int, int)
- func (t *Tmpl) CalcBaseStats() error
- func (c *Tmpl) CharIndex() int
- func (c *Tmpl) ChargeAttack(p map[string]int) (int, int)
- func (c *Tmpl) Charges(a core.ActionType) int
- func (c *Tmpl) ConsumeEnergy(delay int)
- func (c *Tmpl) Cooldown(a core.ActionType) int
- func (c *Tmpl) CurrentEnergy() float64
- func (c *Tmpl) Dash(p map[string]int) (int, int)
- func (c *Tmpl) DeleteMod(key string)
- func (c *Tmpl) DeletePreDamageMod(key string)
- func (c *Tmpl) Ele() core.EleType
- func (c *Tmpl) HP() float64
- func (c *Tmpl) HighPlungeAttack(p map[string]int) (int, int)
- func (t *Tmpl) Init()
- func (c *Tmpl) Jump(p map[string]int) (int, int)
- func (c *Tmpl) Key() core.CharKey
- func (c *Tmpl) Level() int
- func (c *Tmpl) LowPlungeAttack(p map[string]int) (int, int)
- func (c *Tmpl) MaxEnergy() float64
- func (c *Tmpl) MaxHP() float64
- func (c *Tmpl) ModIsActive(key string) bool
- func (c *Tmpl) ModifyHP(amt float64)
- func (c *Tmpl) Name() string
- func (c *Tmpl) NextNormalCounter() int
- func (c *Tmpl) PreDamageModIsActive(key string) bool
- func (c *Tmpl) PreDamageSnapshotAdjust(a *core.AttackEvent, t core.Target) []interface{}
- func (c *Tmpl) QueueParticle(src string, num int, ele core.EleType, delay int)
- func (t *Tmpl) ReactBonus(atk core.AttackInfo) (amt float64)
- func (c *Tmpl) ReactBonusModIsActive(key string) bool
- func (c *Tmpl) ReceiveParticle(p core.Particle, isActive bool, partyCount int)
- func (c *Tmpl) ReduceActionCooldown(a core.ActionType, v int)
- func (c *Tmpl) RemoveTag(key string)
- func (c *Tmpl) ResetActionCooldown(a core.ActionType)
- func (c *Tmpl) ResetNormalCounter()
- func (t *Tmpl) SetAbilCancelFrames(prevAbil core.ActionType, nextAbil core.ActionType, frames int)
- func (c *Tmpl) SetCD(a core.ActionType, dur int)
- func (c *Tmpl) SetCDWithDelay(a core.ActionType, dur int, delay int)
- func (t *Tmpl) SetIndex(index int)
- func (t *Tmpl) SetNormalCancelFrames(normalHitNum int, nextAbil core.ActionType, frames int)
- func (c *Tmpl) SetNumCharges(a core.ActionType, num int)
- func (c *Tmpl) SetWeaponKey(k string)
- func (c *Tmpl) Skill(p map[string]int) (int, int)
- func (c *Tmpl) Snapshot(a *core.AttackInfo) core.Snapshot
- func (c *Tmpl) SnapshotStats() ([core.EndStatType]float64, []interface{})
- func (t *Tmpl) Stat(s core.StatType) float64
- func (c *Tmpl) Tag(key string) int
- func (c *Tmpl) TalentLvlAttack() int
- func (c *Tmpl) TalentLvlBurst() int
- func (c *Tmpl) TalentLvlSkill() int
- func (t *Tmpl) Tick()
- func (c *Tmpl) WeaponClass() core.WeaponClass
- func (c *Tmpl) WeaponInfuseIsActive(key string) bool
- func (c *Tmpl) WeaponKey() string
- func (c *Tmpl) Zone() core.ZoneType
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 (*Tmpl) ActionFrames ¶
func (*Tmpl) ActionInterruptableDelay ¶
func (*Tmpl) ActionReady ¶
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 (*Tmpl) AddCDAdjustFunc ¶
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) AddWeaponInfuse ¶
func (c *Tmpl) AddWeaponInfuse(inf core.WeaponInfusion)
func (*Tmpl) AdvanceNormalIndex ¶
func (c *Tmpl) AdvanceNormalIndex()
advance normal index, return the current one
func (*Tmpl) CalcBaseStats ¶
func (*Tmpl) ConsumeEnergy ¶
func (*Tmpl) CurrentEnergy ¶
func (*Tmpl) DeletePreDamageMod ¶ added in v0.6.2
func (*Tmpl) Init ¶
func (t *Tmpl) Init()
Character initialization function. Occurs AFTER all char/weapons are initially loaded
func (*Tmpl) ModIsActive ¶
func (*Tmpl) NextNormalCounter ¶ added in v0.6.1
func (*Tmpl) PreDamageModIsActive ¶
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 (*Tmpl) ReactBonus ¶
func (t *Tmpl) ReactBonus(atk core.AttackInfo) (amt float64)
func (*Tmpl) ReactBonusModIsActive ¶
func (*Tmpl) ReceiveParticle ¶
func (*Tmpl) ReduceActionCooldown ¶
func (c *Tmpl) ReduceActionCooldown(a core.ActionType, v int)
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) 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 (*Tmpl) SnapshotStats ¶
func (c *Tmpl) SnapshotStats() ([core.EndStatType]float64, []interface{})
func (*Tmpl) TalentLvlAttack ¶
func (*Tmpl) TalentLvlBurst ¶
func (*Tmpl) TalentLvlSkill ¶
func (*Tmpl) WeaponClass ¶
func (c *Tmpl) WeaponClass() core.WeaponClass