Documentation ¶
Index ¶
- Constants
- Variables
- func PrettyPrintStats(stats []float64) string
- func RegisterCharFunc(name string, f NewCharacterFunc)
- func RegisterSetFunc(name string, f NewSetFunc)
- func RegisterWeaponFunc(name string, f NewWeaponFunc)
- func UnfreezeDmg(s *Sim)
- type AbilUsage
- type Action
- type ActionItem
- type ActionType
- type AttackTag
- type Aura
- type CDAdjust
- type CharStatMod
- type CharTask
- type Character
- type CharacterBase
- type CharacterProfile
- type CharacterTemplate
- func (c *CharacterTemplate) ActionFrames(a ActionType, p map[string]int) int
- func (c *CharacterTemplate) ActionReady(a ActionType, p map[string]int) bool
- func (c *CharacterTemplate) ActionStam(a ActionType, p map[string]int) float64
- func (c *CharacterTemplate) AddCDAdjustFunc(rd CDAdjust)
- func (c *CharacterTemplate) AddEnergy(e float64)
- func (c *CharacterTemplate) AddMod(mod CharStatMod)
- func (c *CharacterTemplate) AddTask(f func(), name string, delay int)
- func (c *CharacterTemplate) AddWeaponInfuse(inf WeaponInfusion)
- func (c *CharacterTemplate) AdvanceNormalIndex()
- func (c *CharacterTemplate) Aimed(p map[string]int) int
- func (c *CharacterTemplate) Attack(p map[string]int) int
- func (c *CharacterTemplate) Burst(p map[string]int) int
- func (c *CharacterTemplate) CharIndex() int
- func (c *CharacterTemplate) ChargeAttack(p map[string]int) int
- func (c *CharacterTemplate) Cooldown(a ActionType) int
- func (c *CharacterTemplate) CurrentEnergy() float64
- func (c *CharacterTemplate) Dash(p map[string]int) int
- func (c *CharacterTemplate) Ele() EleType
- func (c *CharacterTemplate) HP() float64
- func (c *CharacterTemplate) HighPlungeAttack(p map[string]int) int
- func (c *CharacterTemplate) Init(index int)
- func (c *CharacterTemplate) LowPlungeAttack(p map[string]int) int
- func (c *CharacterTemplate) MaxHP() float64
- func (c *CharacterTemplate) ModifyHP(amt float64)
- func (c *CharacterTemplate) Name() string
- func (c *CharacterTemplate) ReceiveParticle(p Particle, isActive bool, partyCount int)
- func (c *CharacterTemplate) ReduceActionCooldown(a ActionType, v int)
- func (c *CharacterTemplate) ResetActionCooldown(a ActionType)
- func (c *CharacterTemplate) ResetNormalCounter()
- func (c *CharacterTemplate) SetCD(a ActionType, dur int)
- func (c *CharacterTemplate) Skill(p map[string]int) int
- func (c *CharacterTemplate) Snapshot(name string, a AttackTag, icd ICDTag, g ICDGroup, st StrikeType, e EleType, ...) Snapshot
- func (c *CharacterTemplate) Tag(key string) int
- func (c *CharacterTemplate) TalentLvlAttack() int
- func (c *CharacterTemplate) TalentLvlBurst() int
- func (c *CharacterTemplate) TalentLvlSkill() int
- func (c *CharacterTemplate) Tick()
- func (c *CharacterTemplate) WeaponClass() WeaponClass
- type Condition
- type ConfigArtifact
- type Construct
- type CryoAura
- type DefMod
- type EffectFunc
- type EleType
- type ElectroAura
- type ElectroChargeAura
- type Element
- func (e *Element) Attach(ele EleType, durability float64, f int)
- func (e *Element) ContainsEle(ele EleType) bool
- func (e *Element) E() EleType
- func (e *Element) React(ds Snapshot, s *Sim) Aura
- func (e *Element) Reduce(durability float64, s *Sim)
- func (e *Element) Refresh(durability float64, s *Sim)
- func (e *Element) Remain(f int) float64
- func (e *Element) Tick(s *Sim) bool
- type Enemy
- type EnemyProfile
- type ExprTreeNode
- type Flags
- type FreezeAura
- type GeoConstructType
- type HurtEvent
- type HydroAura
- type ICDGroup
- type ICDTag
- type LogConfig
- type LogSource
- type NewCharacterFunc
- type NewSetFunc
- type NewWeaponFunc
- type NoAura
- type Particle
- type Profile
- type PyroAura
- type ReactionType
- type ResistMod
- type Shield
- type ShieldType
- type Sim
- func (s *Sim) AddDRFunc(f func() float64)
- func (s *Sim) AddEnergyParticles(source string, num int, ele EleType, delay int)
- func (s *Sim) AddEventHook(f func(s *Sim) bool, key string, hook eventHookType)
- func (s *Sim) AddIncHealBonus(f func() float64)
- func (s *Sim) AddOnHurt(f func(s *Sim))
- func (s *Sim) AddShield(shd Shield)
- func (s *Sim) AddShieldBonus(f func() float64)
- func (s *Sim) AddSnapshotHook(f func(ds *Snapshot) bool, key string, hook snapshotHookType)
- func (s *Sim) AddStamMod(f func(a ActionType) float64)
- func (s *Sim) AddStatus(key string, dur int)
- func (s *Sim) AddTask(f TaskFunc, name string, delay int)
- func (s *Sim) ApplyDamage(ds Snapshot) (float64, string)
- func (s *Sim) ApplyReactionDamage(ds Snapshot)
- func (s *Sim) ConstructCount() int
- func (s *Sim) ConstructCountType(t GeoConstructType) int
- func (s *Sim) ConstructTick()
- func (s *Sim) DamageChar(dmg float64, ele EleType)
- func (s *Sim) DamageShields(dmg float64, ele EleType) float64
- func (s *Sim) DeleteStatus(key string)
- func (s *Sim) Destroy(key int) bool
- func (s *Sim) GetShield(t ShieldType) Shield
- func (s *Sim) GroupTagDamageMult(grp ICDGroup, char int) float64
- func (s *Sim) HasConstruct(key int) bool
- func (s *Sim) HealActive(hp float64)
- func (s *Sim) HealAll(hp float64)
- func (s *Sim) HealIndex(index int, hp float64)
- func (s *Sim) IncomingHealBonusMult() float64
- func (s *Sim) IsShielded() bool
- func (s *Sim) NewConstruct(c Construct, refresh bool)
- func (s *Sim) NewNoLimitCons(c Construct, refresh bool)
- func (s *Sim) QueueDamage(ds Snapshot, delay int)
- func (s *Sim) ResetAllNormalCounter()
- func (s *Sim) ResetDamageCounterAfterDelay(grp ICDGroup, char int)
- func (s *Sim) ResetReactionFlags()
- func (s *Sim) ResetTagCounterAfterDelay(tag ICDTag, grp ICDGroup, char int)
- func (s *Sim) Run(length int) (float64, SimStats)
- func (s *Sim) RunHPMode(hp float64) (float64, SimStats)
- func (s *Sim) ShieldTick()
- func (s *Sim) StamPercentMod(a ActionType) float64
- func (s *Sim) StatusActive(key string) bool
- func (s *Sim) WillApplyGauge(tag ICDTag, grp ICDGroup, char int) bool
- type SimStats
- type Snapshot
- type StatType
- type StrikeType
- type TalentProfile
- type Task
- type TaskFunc
- type TemplateShield
- func (t *TemplateShield) CurrentHP() float64
- func (t *TemplateShield) Desc() string
- func (t *TemplateShield) Element() EleType
- func (t *TemplateShield) Expiry() int
- func (t *TemplateShield) Key() int
- func (t *TemplateShield) OnDamage(dmg float64, ele EleType, bonus float64) (float64, bool)
- func (t *TemplateShield) OnExpire()
- func (t *TemplateShield) OnOverwrite()
- func (t *TemplateShield) Type() ShieldType
- type WeaponClass
- type WeaponInfusion
- type WeaponProfile
Constants ¶
const ( WeakDurability = 25 MedDurability = 50 StrongDurability = 100 )
const ( PostSnapshot snapshotHookType = iota PreDamageHook PostDamageHook OnCritDamage PreTransReaction PostTransReaction PreAmpReaction PostAmpReaction //delim EndSnapshotHook )
const ( PreSwapHook eventHookType = iota PostSwapHook PreBurstHook PostBurstHook PreSkillHook PostSkillHook PostAttackHook PostShieldHook PostParticleHook //delim EndEventHook )
const ( WeakAuraBase int64 = 570 MedAuraBase int64 = 360 StrongAuraBase int64 = 225 )
Variables ¶
var EleTypeString = [...]string{
"pyro",
"hydro",
"cryo",
"electro",
"geo",
"anemo",
"dendro",
"physical",
"frozen",
"ec",
"",
}
var ICDGroupDamageSequence = [][]float64{
{1, 1, 1, 1, 1},
{1, 1, 1, 1, 1},
{1, 1, 1, 1, 1},
{1, 1, 1, 1, 1},
{1, 1, 1, 1, 1},
{1, 1, 1, 1, 1},
{1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0},
{1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0},
{1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0},
}
var ICDGroupEleApplicationSequence = [][]int{
{1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0},
{1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0},
{1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0},
{1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0},
{1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0},
{1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0},
{1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0},
{1.0, 1.0},
{1.0, 1.0},
}
var ICDGroupResetTimer = []int{
150,
60,
60,
300,
300,
30,
6,
30,
30,
}
var LogSourceString = [...]string{
"procs",
"damage",
"hurt",
"heal",
"calc",
"reaction",
"element",
"snapshot",
"status",
"action",
"queue",
"energy",
"character",
"enemy",
"hook",
"sim",
"artifact",
"weapon",
"shield",
"construct",
"icd",
}
var StatTypeString = [...]string{
"def%",
"def",
"hp",
"hp%",
"atk",
"atk%",
"er",
"em",
"cr",
"cd",
"heal",
"pyro%",
"hydro%",
"cryo%",
"electro%",
"anemo%",
"geo%",
"ele%",
"phys%",
"dendro%",
"atkspd%",
"dmg%",
}
Functions ¶
func PrettyPrintStats ¶
func RegisterCharFunc ¶
func RegisterCharFunc(name string, f NewCharacterFunc)
func RegisterSetFunc ¶
func RegisterSetFunc(name string, f NewSetFunc)
func RegisterWeaponFunc ¶
func RegisterWeaponFunc(name string, f NewWeaponFunc)
func UnfreezeDmg ¶
func UnfreezeDmg(s *Sim)
Types ¶
type Action ¶
type Action struct { Name string Target string //either character or a sequence name Exec []ActionItem //if len > 1 then it's a sequence IsSeq bool // is this a sequence IsStrict bool //strict sequence? Once bool // is this an opener (execute once) Disabled bool // is this action disabled Pos int //current position in execution, default 0 Last int //last time this was executed (frame) ActionLock int //how many frames this action is locked from executing again ActiveCond string SwapTo string SwapLock int PostAction ActionType Conditions *ExprTreeNode //conditions to be met Raw []string //raw action in string }
type ActionItem ¶
type ActionItem struct { Typ ActionType Param map[string]int Target string // contains filtered or unexported fields }
type ActionType ¶
type ActionType int
const ( ActionSequence ActionType = iota ActionSequenceStrict ActionDelimiter ActionSequenceReset ActionSkill ActionBurst ActionAttack ActionCharge ActionHighPlunge ActionLowPlunge ActionSpecialProc ActionAim ActionSwap ActionSwapLock //force swap lock ActionCancellable // delim cancellable action ActionDash ActionJump ActionOtherEvents //delim for other events ActionHurt //damage characters //delim EndActionType )
func (ActionType) String ¶
func (a ActionType) String() string
type CharStatMod ¶
type Character ¶
type Character interface { Init(index int) //to be called when everything including weapon and artifacts has been loaded Tick() //function to be called every frame //information functions Name() string CharIndex() int Ele() EleType WeaponClass() WeaponClass CurrentEnergy() float64 //current energy TalentLvlSkill() int TalentLvlAttack() int TalentLvlBurst() int HP() float64 MaxHP() float64 ModifyHP(float64) //actions Attack(p map[string]int) int Aimed(p map[string]int) int ChargeAttack(p map[string]int) int HighPlungeAttack(p map[string]int) int LowPlungeAttack(p map[string]int) int Skill(p map[string]int) int Burst(p map[string]int) int Dash(p map[string]int) int //info methods ActionReady(a ActionType, p map[string]int) bool ActionFrames(a ActionType, p map[string]int) int ActionStam(a ActionType, p map[string]int) float64 //char stat mods AddMod(mod CharStatMod) AddWeaponInfuse(inf WeaponInfusion) //cooldown stuff SetCD(a ActionType, dur int) Cooldown(a ActionType) int ResetActionCooldown(a ActionType) ReduceActionCooldown(a ActionType, v int) AddCDAdjustFunc(rd CDAdjust) //status stuff Tag(key string) int //energy ReceiveParticle(p Particle, isActive bool, partyCount int) AddEnergy(e float64) //combat Snapshot(name string, a AttackTag, icd ICDTag, g ICDGroup, st StrikeType, e EleType, d float64, mult float64) Snapshot ResetNormalCounter() }
type CharacterBase ¶
type CharacterProfile ¶
type CharacterProfile struct { Base CharacterBase `yaml:"Base"` Weapon WeaponProfile `yaml:"Weapon"` Talents TalentProfile Stats []float64 Sets map[string]int }
CharacterProfile ...
type CharacterTemplate ¶
type CharacterTemplate struct { S *Sim Index int //this should describe the frame in which the abil becomes available //if frame > current then it's available. no need to decrement this way // CD map[string]int ActionCD []int Mods []CharStatMod Tags map[string]int //Profile info Base CharacterBase Weapon WeaponProfile Stats []float64 Talents TalentProfile SkillCon int BurstCon int CDReductionFuncs []CDAdjust Energy float64 MaxEnergy float64 HPCurrent float64 HPMax float64 //Tasks specific to the character to be executed at set frames Tasks map[int][]CharTask //counters NormalHitNum int //how many hits in a normal combo NormalCounter int //infusion Infusion WeaponInfusion //TODO currently just overides the old; disregarding any existing }
func NewTemplateChar ¶
func NewTemplateChar(s *Sim, p CharacterProfile) (*CharacterTemplate, error)
func (*CharacterTemplate) ActionFrames ¶
func (c *CharacterTemplate) ActionFrames(a ActionType, p map[string]int) int
func (*CharacterTemplate) ActionReady ¶
func (c *CharacterTemplate) ActionReady(a ActionType, p map[string]int) bool
func (*CharacterTemplate) ActionStam ¶
func (c *CharacterTemplate) ActionStam(a ActionType, p map[string]int) float64
func (*CharacterTemplate) AddCDAdjustFunc ¶
func (c *CharacterTemplate) AddCDAdjustFunc(rd CDAdjust)
func (*CharacterTemplate) AddEnergy ¶
func (c *CharacterTemplate) AddEnergy(e float64)
func (*CharacterTemplate) AddMod ¶
func (c *CharacterTemplate) AddMod(mod CharStatMod)
func (*CharacterTemplate) AddTask ¶
func (c *CharacterTemplate) AddTask(f func(), name string, delay int)
func (*CharacterTemplate) AddWeaponInfuse ¶
func (c *CharacterTemplate) AddWeaponInfuse(inf WeaponInfusion)
func (*CharacterTemplate) AdvanceNormalIndex ¶
func (c *CharacterTemplate) AdvanceNormalIndex()
advance normal index, return the current one
func (*CharacterTemplate) CharIndex ¶
func (c *CharacterTemplate) CharIndex() int
func (*CharacterTemplate) ChargeAttack ¶
func (c *CharacterTemplate) ChargeAttack(p map[string]int) int
func (*CharacterTemplate) Cooldown ¶
func (c *CharacterTemplate) Cooldown(a ActionType) int
func (*CharacterTemplate) CurrentEnergy ¶
func (c *CharacterTemplate) CurrentEnergy() float64
func (*CharacterTemplate) Ele ¶
func (c *CharacterTemplate) Ele() EleType
func (*CharacterTemplate) HP ¶
func (c *CharacterTemplate) HP() float64
func (*CharacterTemplate) HighPlungeAttack ¶
func (c *CharacterTemplate) HighPlungeAttack(p map[string]int) int
func (*CharacterTemplate) Init ¶
func (c *CharacterTemplate) Init(index int)
func (*CharacterTemplate) LowPlungeAttack ¶
func (c *CharacterTemplate) LowPlungeAttack(p map[string]int) int
func (*CharacterTemplate) MaxHP ¶
func (c *CharacterTemplate) MaxHP() float64
func (*CharacterTemplate) ModifyHP ¶
func (c *CharacterTemplate) ModifyHP(amt float64)
func (*CharacterTemplate) Name ¶
func (c *CharacterTemplate) Name() string
func (*CharacterTemplate) ReceiveParticle ¶
func (c *CharacterTemplate) ReceiveParticle(p Particle, isActive bool, partyCount int)
func (*CharacterTemplate) ReduceActionCooldown ¶
func (c *CharacterTemplate) ReduceActionCooldown(a ActionType, v int)
func (*CharacterTemplate) ResetActionCooldown ¶
func (c *CharacterTemplate) ResetActionCooldown(a ActionType)
func (*CharacterTemplate) ResetNormalCounter ¶
func (c *CharacterTemplate) ResetNormalCounter()
func (*CharacterTemplate) SetCD ¶
func (c *CharacterTemplate) SetCD(a ActionType, dur int)
func (*CharacterTemplate) Snapshot ¶
func (c *CharacterTemplate) Snapshot(name string, a AttackTag, icd ICDTag, g ICDGroup, st StrikeType, e EleType, d float64, mult float64) Snapshot
func (*CharacterTemplate) Tag ¶
func (c *CharacterTemplate) Tag(key string) int
func (*CharacterTemplate) TalentLvlAttack ¶
func (c *CharacterTemplate) TalentLvlAttack() int
func (*CharacterTemplate) TalentLvlBurst ¶
func (c *CharacterTemplate) TalentLvlBurst() int
func (*CharacterTemplate) TalentLvlSkill ¶
func (c *CharacterTemplate) TalentLvlSkill() int
func (*CharacterTemplate) Tick ¶
func (c *CharacterTemplate) Tick()
func (*CharacterTemplate) WeaponClass ¶
func (c *CharacterTemplate) WeaponClass() WeaponClass
type ConfigArtifact ¶
type Construct ¶
type Construct interface { OnDestruct() Key() int Type() GeoConstructType Expiry() int IsLimited() bool Count() int }
type EffectFunc ¶
type EleType ¶
type EleType int
EleType is a string representing an element i.e. HYDRO/PYRO/etc...
ElementType should be pryo, Hydro, Cryo, Electro, Geo, Anemo and maybe dendro
type ElectroAura ¶
type ElectroAura struct {
*Element
}
func NewElectro ¶
func NewElectro() *ElectroAura
type ElectroChargeAura ¶
type ElectroChargeAura struct { *Element Hydro *HydroAura Electro *ElectroAura NextTick int Snap Snapshot }
func NewEC ¶
func NewEC() *ElectroChargeAura
func (*ElectroChargeAura) ContainsEle ¶
func (e *ElectroChargeAura) ContainsEle(ele EleType) bool
func (*ElectroChargeAura) Init ¶
func (e *ElectroChargeAura) Init(electro *ElectroAura, hydro *HydroAura, ds Snapshot, s *Sim)
func (*ElectroChargeAura) Tick ¶
func (e *ElectroChargeAura) Tick(s *Sim) bool
type Element ¶
type Element struct { Type EleType MaxDurability float64 Durability float64 Start int //when the aura was first added Expiry int //when the aura is gone, use this instead of ticks }
func NewElement ¶
func NewElement() *Element
func (*Element) ContainsEle ¶
func (*Element) React ¶
react with next element, modifying the existing to = whatever the result should be
type Enemy ¶
type Enemy struct { Level int HPMode bool MaxHP float64 HP float64 F *int Log *zap.SugaredLogger //stats Damage float64 //total damage received // contains filtered or unexported fields }
Enemy keeps track of the status of one enemy Enemy
func (*Enemy) DeactivateResMod ¶
type EnemyProfile ¶
EnemyProfile ...
type ExprTreeNode ¶
type ExprTreeNode struct { Left *ExprTreeNode Right *ExprTreeNode IsLeaf bool Op string //&& || ( ) Expr Condition }
type FreezeAura ¶
type FreezeAura struct { *Element OldHydro *HydroAura OldCryo *CryoAura NewHydro *HydroAura NewCryo *CryoAura Expire int }
func NewFreeze ¶
func NewFreeze() *FreezeAura
func (*FreezeAura) ContainsEle ¶
func (f *FreezeAura) ContainsEle(ele EleType) bool
func (*FreezeAura) Init ¶
func (f *FreezeAura) Init(cryo *CryoAura, hydro *HydroAura, dur float64, s *Sim)
func (*FreezeAura) React ¶
func (f *FreezeAura) React(ds Snapshot, s *Sim) Aura
TODO: what happens if we apply new hydro then new cryo all before freeze expires? shouldn't be possible to due cds but right now this code wouldn't retrigger freeze even though it probably should
func (*FreezeAura) Tick ¶
func (f *FreezeAura) Tick(s *Sim) bool
type GeoConstructType ¶
type GeoConstructType int
const ( GeoConstructNingSkill GeoConstructType = iota GeoConstructZhongliSkill GeoConstructTravellerSkill GeoConstructTravellerBurst GeoConstructAlbedoSkill )
type ICDGroup ¶
type ICDGroup int //same ICD group shares the same timer
group dictate both the sequence and the reset timer
type ICDTag ¶
type ICDTag int //same ICD tag shares the same counter
const ( ICDTagNone ICDTag = iota ICDTagNormalAttack ICDTagExtraAttack ICDTagElementalArt ICDTagElementalBurst ICDTagLisaElectro ICDTagYanfeiFire ICDTagVentiBurstAnemo ICDTagVentiBurstPyro ICDTagVentiBurstHydro ICDTagVentiBurstCryo ICDTagVentiBurstElectro ICDTagMonaWaterDamage ICDTagTravelerWakeOfEarth ICDTagKleeFireDamage ICDTagLength )
type LogSource ¶
type LogSource int
const ( LogProcs LogSource = iota LogDamageEvent LogHurtEvent LogHealEvent LogCalc LogReactionEvent LogElementEvent LogSnapshotEvent LogStatusEvent LogActionEvent LogQueueEvent LogEnergyEvent LogCharacterEvent LogEnemyEvent LogHookEvent LogSimEvent LogArtifactEvent LogWeaponEvent LogShieldEvent LogConstructEvent LogICDEvent )
type NewCharacterFunc ¶
type NewCharacterFunc func(s *Sim, p CharacterProfile) (Character, error)
type NewSetFunc ¶
type NewWeaponFunc ¶
type Profile ¶
type Profile struct { Label string `yaml:"Label"` Enemy EnemyProfile `yaml:"Enemy"` InitialActive string `yaml:"InitialActive"` Characters []CharacterProfile `yaml:"Characters"` Rotation []Action Hurt HurtEvent LogConfig LogConfig LogStats bool FixedRand bool //if this is true then use the same seed }
type ReactionType ¶
type ReactionType string
const ( Overload ReactionType = "overload" Superconduct ReactionType = "superconduct" Freeze ReactionType = "freeze" Melt ReactionType = "melt" Vaporize ReactionType = "vaporize" CrystallizeElectro ReactionType = "crystallize-electro" CrystallizeHydro ReactionType = "crystallize-hydro" CrystallizePyro ReactionType = "crystallize-pyro" CrystallizeCryo ReactionType = "crystallize-cryo" SwirlElectro ReactionType = "swirl-electro" SwirlHydro ReactionType = "swirl-hydro" SwirlPyro ReactionType = "swirl-pyro" SwirlCryo ReactionType = "swirl-cryo" ElectroCharged ReactionType = "electrocharged" Shatter ReactionType = "shatter" NoReaction ReactionType = "" FreezeExtend ReactionType = "FreezeExtend" )
type ShieldType ¶
type ShieldType int
const ( ShieldCrystallize ShieldType = iota //lasts 15 seconds ShieldNoelleSkill ShieldNoelleA2 ShieldZhongliJadeShield ShieldDionaSkill ShieldBeidouThunderShield ShieldXinyanSkill ShieldXinyanC2 ShieldKaeyaC4 ShieldYanfeiC4 )
type Sim ¶
type Sim struct { Target *Enemy Status map[string]int ActiveChar string ActiveIndex int CharActiveLength int Chars []Character SwapCD int Stats SimStats //log related Log *zap.SugaredLogger DebugDetail bool //icd related ICDGroupOnTimer [][]bool ICDTagCounter [][]int ICDDamageGroupOnTimer [][]bool ICDDamageGroupCounter [][]int //stam related LastStamUse int Stam float64 StamModifier []func(a ActionType) float64 DRFunc []func() float64 ShieldBonusFunc []func() float64 IncHealBonusFunc []func() float64 //% to add to amount healed //hurt event LastHurt int Hurt HurtEvent OnHurt []func(s *Sim) //reaction related TargetAura Aura Rand *rand.Rand F int GlobalFlags Flags // contains filtered or unexported fields }
Sim keeps track of one simulation
func (*Sim) AddEnergyParticles ¶
func (*Sim) AddEventHook ¶
AddHook adds a hook to sim. Hook will be called based on the type of hook
func (*Sim) AddIncHealBonus ¶
func (*Sim) AddShieldBonus ¶
func (*Sim) AddSnapshotHook ¶
AddCombatHook adds a hook to sim. Hook will be called based on the type of hook
func (*Sim) AddStamMod ¶
func (s *Sim) AddStamMod(f func(a ActionType) float64)
func (*Sim) ApplyDamage ¶
ApplyDamage applies damage to the target given a snapshot
func (*Sim) ApplyReactionDamage ¶
func (*Sim) ConstructCountType ¶
func (s *Sim) ConstructCountType(t GeoConstructType) int
func (*Sim) ConstructTick ¶
func (s *Sim) ConstructTick()
func (*Sim) DamageChar ¶
func (*Sim) DeleteStatus ¶
func (*Sim) GetShield ¶
func (s *Sim) GetShield(t ShieldType) Shield
func (*Sim) HasConstruct ¶
func (*Sim) HealActive ¶
func (*Sim) IncomingHealBonusMult ¶
func (*Sim) IsShielded ¶
func (*Sim) NewConstruct ¶
func (*Sim) NewNoLimitCons ¶
func (*Sim) QueueDamage ¶
func (*Sim) ResetAllNormalCounter ¶
func (s *Sim) ResetAllNormalCounter()
func (*Sim) ResetDamageCounterAfterDelay ¶
func (*Sim) ResetReactionFlags ¶
func (s *Sim) ResetReactionFlags()
func (*Sim) ResetTagCounterAfterDelay ¶
func (*Sim) ShieldTick ¶
func (s *Sim) ShieldTick()
func (*Sim) StamPercentMod ¶
func (s *Sim) StamPercentMod(a ActionType) float64
func (*Sim) StatusActive ¶
type SimStats ¶
type SimStats struct { AuraUptime map[EleType]int `json:"aura_uptime"` //uptime in frames //these follow 4 are available in avg mode as well CharNames []string `json:"char_names"` DamageByChar []map[string]float64 `json:"damage_by_char"` CharActiveTime []int `json:"char_active_time"` AbilUsageCountByChar []map[string]int `json:"abil_usage_count_by_char"` ReactionsTriggered map[ReactionType]int `json:"reactions_triggered"` SimDuration int `json:"sim_duration"` //super detailed data by frame, only in time mode Detailed struct { DamageHist []float64 `json:"damage_hist"` LogDetailed bool `json:"-"` CharActiveFrame [][]int `json:"char_active_frame"` ElementActiveFrame map[EleType][]int `json:"element_active_frame"` AbilUsageByFrame []AbilUsage `json:"abil_usage_frame"` } `json:"detailed"` //final result DPS float64 `json:"dps"` }
type Snapshot ¶
type Snapshot struct { CharLvl int ActorEle EleType Actor string //name of the character triggering the damage ActorIndex int SourceFrame int AnimationFrames int //really only for amos bow... Abil string //name of ability triggering the damage WeaponClass WeaponClass //b.c. Gladiators... AttackTag AttackTag ICDTag ICDTag ICDGroup ICDGroup ImpulseLvl int HitWeakPoint bool Mult float64 //ability multiplier. could set to 0 from initial Mona dmg StrikeType StrikeType Element EleType //element of ability Durability float64 //durability of aura, 0 if nothing applied UseDef bool //default false FlatDmg float64 //flat dmg; so far only zhongli Stats []float64 //total character stats including from artifact, bonuses, etc... BaseAtk float64 //base attack used in calc BaseDef float64 //base def used in calc //reaction flags IsReaction bool ReactionType ReactionType IsMeltVape bool //trigger melt/vape ReactMult float64 //reaction multiplier for melt/vape ReactBonus float64 //reaction bonus %+ such as witch; should be 0 and only affected by hooks }
type StatType ¶
type StatType int
const ( DEFP StatType = iota DEF HP HPP ATK ATKP ER EM CR CD Heal PyroP HydroP CryoP ElectroP AnemoP GeoP EleP PhyP DendroP AtkSpd DmgP //delim EndStatType )
stat types
func StrToStatType ¶
type StrikeType ¶
type StrikeType int
const ( StrikeTypeDefault StrikeType = iota StrikeTypePierce StrikeTypeBlunt StrikeTypeSlash StrikeTypeSpear )
type TalentProfile ¶
type TemplateShield ¶
type TemplateShield struct { Name string Src int ShieldType ShieldType Ele EleType HP float64 Expires int }
func (*TemplateShield) CurrentHP ¶
func (t *TemplateShield) CurrentHP() float64
func (*TemplateShield) Desc ¶
func (t *TemplateShield) Desc() string
func (*TemplateShield) Element ¶
func (t *TemplateShield) Element() EleType
func (*TemplateShield) Expiry ¶
func (t *TemplateShield) Expiry() int
func (*TemplateShield) Key ¶
func (t *TemplateShield) Key() int
func (*TemplateShield) OnExpire ¶
func (t *TemplateShield) OnExpire()
func (*TemplateShield) OnOverwrite ¶
func (t *TemplateShield) OnOverwrite()
func (*TemplateShield) Type ¶
func (t *TemplateShield) Type() ShieldType
type WeaponClass ¶
type WeaponClass string
const ( WeaponClassSword WeaponClass = "sword" WeaponClassClaymore WeaponClass = "claymore" WeaponClassSpear WeaponClass = "spear" WeaponClassBow WeaponClass = "bow" WeaponClassCatalyst WeaponClass = "catalyst" )