character

package
v1.8.4 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2023 License: MIT Imports: 17 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AttackMod

type AttackMod struct {
	Amount AttackModFunc
	modifier.Base
}

type AttackModFunc

type AttackModFunc func(atk *combat.AttackEvent, t combat.Target) ([]float64, bool)

type CharWrapper

type CharWrapper struct {
	Index int

	Character

	//base characteristics
	Base     profile.CharacterBase
	Weapon   weapon.WeaponProfile
	Talents  profile.TalentProfile
	CharZone profile.ZoneType
	CharBody profile.BodyType
	SkillCon int
	BurstCon int

	Equip struct {
		Weapon weapon.Weapon
		Sets   map[keys.Set]artifact.Set
	}

	//current status
	ParticleDelay int // character custom particle delay
	Energy        float64
	EnergyMax     float64
	HPCurrent     float64

	//normal attack counter
	NormalHitNum  int //how many hits in a normal combo
	NormalCounter int

	//tags
	Tags      map[string]int
	BaseStats [attributes.EndStatType]float64
	// contains filtered or unexported fields
}

func New

func New(
	p profile.CharacterProfile,
	f *int,
	debug bool,
	log glog.Logger,
	events event.Eventter,
	task task.Tasker,
) (*CharWrapper, error)

func (*CharWrapper) AddAttackMod

func (c *CharWrapper) AddAttackMod(mod AttackMod)

func (*CharWrapper) AddCooldownMod

func (c *CharWrapper) AddCooldownMod(mod CooldownMod)

func (*CharWrapper) AddDamageReductionMod

func (c *CharWrapper) AddDamageReductionMod(mod DamageReductionMod)

func (*CharWrapper) AddEnergy

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

func (*CharWrapper) AddHealBonusMod

func (c *CharWrapper) AddHealBonusMod(mod HealBonusMod)

func (*CharWrapper) AddReactBonusMod

func (c *CharWrapper) AddReactBonusMod(mod ReactBonusMod)

func (*CharWrapper) AddStatMod

func (c *CharWrapper) AddStatMod(mod StatMod)

func (*CharWrapper) AddStatus

func (c *CharWrapper) AddStatus(key string, dur int, hitlag bool)

func (*CharWrapper) ApplyAttackMods

func (c *CharWrapper) ApplyAttackMods(a *combat.AttackEvent, t combat.Target) []interface{}

func (*CharWrapper) ApplyHitlag

func (c *CharWrapper) ApplyHitlag(factor, dur float64)

ApplyHitlag adds hitlag to the character for specified duration

func (*CharWrapper) CDReduction

func (c *CharWrapper) CDReduction(a action.Action, dur int) int

func (*CharWrapper) ConsumeEnergy

func (c *CharWrapper) ConsumeEnergy(delay int)

func (*CharWrapper) CooldownModIsActive

func (e *CharWrapper) CooldownModIsActive(key string) bool

func (*CharWrapper) DamageReduction

func (c *CharWrapper) DamageReduction(char int) (amt float64)

func (*CharWrapper) DamageReductionModIsActive

func (e *CharWrapper) DamageReductionModIsActive(key string) bool

func (*CharWrapper) DeleteAttackMod

func (c *CharWrapper) DeleteAttackMod(key string)

func (*CharWrapper) DeleteCooldownMod

func (c *CharWrapper) DeleteCooldownMod(key string)

func (*CharWrapper) DeleteDamageReductionMod

func (c *CharWrapper) DeleteDamageReductionMod(key string)

func (*CharWrapper) DeleteHealBonusMod

func (c *CharWrapper) DeleteHealBonusMod(key string)

func (*CharWrapper) DeleteReactBonusMod

func (c *CharWrapper) DeleteReactBonusMod(key string)

func (*CharWrapper) DeleteStatMod

func (c *CharWrapper) DeleteStatMod(key string)

func (*CharWrapper) DeleteStatus

func (c *CharWrapper) DeleteStatus(key string)

func (*CharWrapper) ExtendStatus

func (c *CharWrapper) ExtendStatus(key string, ext int) bool

func (*CharWrapper) FramePausedOnHitlag

func (c *CharWrapper) FramePausedOnHitlag() bool

func (*CharWrapper) HealBonus

func (c *CharWrapper) HealBonus() (amt float64)

func (*CharWrapper) HealBonusModIsActive

func (e *CharWrapper) HealBonusModIsActive(key string) bool

func (*CharWrapper) MaxHP

func (c *CharWrapper) MaxHP() float64

func (*CharWrapper) ModifyHP

func (c *CharWrapper) ModifyHP(amt float64)

func (*CharWrapper) QueueCharTask

func (c *CharWrapper) QueueCharTask(f func(), delay int)

func (*CharWrapper) ReactBonus

func (c *CharWrapper) ReactBonus(atk combat.AttackInfo) (amt float64)

TODO: consider merging this with just attack mods? reaction bonus should maybe just be it's own stat instead of being a separate mod really

func (*CharWrapper) ReactBonusModIsActive added in v1.2.8

func (e *CharWrapper) ReactBonusModIsActive(key string) bool

func (*CharWrapper) ReceiveParticle

func (c *CharWrapper) ReceiveParticle(p Particle, isActive bool, partyCount int)

func (*CharWrapper) RemoveTag

func (c *CharWrapper) RemoveTag(key string)

func (*CharWrapper) SetArtifactSet

func (c *CharWrapper) SetArtifactSet(key keys.Set, set artifact.Set)

func (*CharWrapper) SetIndex

func (c *CharWrapper) SetIndex(index int)

func (*CharWrapper) SetTag

func (c *CharWrapper) SetTag(key string, val int)

func (*CharWrapper) SetWeapon

func (c *CharWrapper) SetWeapon(w weapon.Weapon)

func (*CharWrapper) Stat

func (h *CharWrapper) Stat(s attributes.Stat) float64

func (*CharWrapper) StatModIsActive

func (e *CharWrapper) StatModIsActive(key string) bool

func (*CharWrapper) Stats

func (c *CharWrapper) Stats() ([attributes.EndStatType]float64, []interface{})

func (*CharWrapper) StatusDuration added in v1.1.8

func (c *CharWrapper) StatusDuration(key string) int

func (*CharWrapper) StatusExpiry

func (c *CharWrapper) StatusExpiry(key string) int

func (*CharWrapper) StatusIsActive

func (e *CharWrapper) StatusIsActive(key string) bool

func (*CharWrapper) Tag

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

func (*CharWrapper) TalentLvlAttack

func (c *CharWrapper) TalentLvlAttack() int

func (*CharWrapper) TalentLvlBurst

func (c *CharWrapper) TalentLvlBurst() int

func (*CharWrapper) TalentLvlSkill

func (c *CharWrapper) TalentLvlSkill() int

func (*CharWrapper) Tick

func (c *CharWrapper) Tick()

func (*CharWrapper) UpdateBaseStats

func (c *CharWrapper) UpdateBaseStats() error

type Character

type Character interface {
	Init() error //init function built into every char to setup any variables etc.

	Attack(p map[string]int) action.ActionInfo
	Aimed(p map[string]int) action.ActionInfo
	ChargeAttack(p map[string]int) action.ActionInfo
	HighPlungeAttack(p map[string]int) action.ActionInfo
	LowPlungeAttack(p map[string]int) action.ActionInfo
	Skill(p map[string]int) action.ActionInfo
	Burst(p map[string]int) action.ActionInfo
	Dash(p map[string]int) action.ActionInfo
	Walk(p map[string]int) action.ActionInfo
	Jump(p map[string]int) action.ActionInfo

	ActionStam(a action.Action, p map[string]int) float64

	ActionReady(a action.Action, p map[string]int) (bool, action.ActionFailure)
	SetCD(a action.Action, dur int)
	Cooldown(a action.Action) int
	ResetActionCooldown(a action.Action)
	ReduceActionCooldown(a action.Action, v int)
	Charges(a action.Action) int

	Snapshot(a *combat.AttackInfo) combat.Snapshot

	AddEnergy(src string, amt float64)

	ApplyHitlag(factor, dur float64)

	Condition([]string) (any, error)

	ResetNormalCounter()
	NextNormalCounter() int
}

type CooldownMod

type CooldownMod struct {
	Amount CooldownModFunc
	modifier.Base
}

type CooldownModFunc

type CooldownModFunc func(a action.Action) float64

type DamageReductionMod

type DamageReductionMod struct {
	Amount DamageReductionModFunc
	modifier.Base
}

type DamageReductionModFunc

type DamageReductionModFunc func() (float64, bool)

type HealBonusMod

type HealBonusMod struct {
	Amount HealBonusModFunc
	modifier.Base
}

type HealBonusModFunc

type HealBonusModFunc func() (float64, bool)

type Particle

type Particle struct {
	Source string
	Num    float64
	Ele    attributes.Element
}

type ReactBonusMod

type ReactBonusMod struct {
	Amount ReactBonusModFunc
	modifier.Base
}

type ReactBonusModFunc

type ReactBonusModFunc func(combat.AttackInfo) (float64, bool)

type StatMod

type StatMod struct {
	AffectedStat attributes.Stat
	Amount       StatModFunc
	modifier.Base
}

type StatModFunc

type StatModFunc func() ([]float64, bool)

type Status

type Status struct {
	modifier.Base
}

Status is basic mod for keeping track Status; usually affected by hitlag

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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