combat

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultFightHistory = 0
View Source
const DefaultIdleTimeout = 15 * time.Second

Variables

This section is empty.

Functions

This section is empty.

Types

type BreakdownStats

type BreakdownStats struct {
	Name      string
	Damage    int
	Hits      int
	Crits     int
	MinHit    int
	MaxHit    int
	FirstSeen time.Time
	LastSeen  time.Time
	Children  map[string]*BreakdownStats
}

func (BreakdownStats) ActiveDuration

func (s BreakdownStats) ActiveDuration() time.Duration

func (BreakdownStats) DPS

func (s BreakdownStats) DPS() float64

func (BreakdownStats) SortedChildren

func (s BreakdownStats) SortedChildren() []BreakdownStats

type Cast

type Cast struct {
	Time    time.Time
	Source  string
	Ability string
}

type Death

type Death struct {
	Time   time.Time
	Victim string
	Killer string
}

type DisplaySection

type DisplaySection struct {
	Fight   *Fight
	Current bool
}

type Event

type Event struct {
	Time           time.Time
	Source         string
	Target         string
	Amount         int
	Attack         string
	Ability        string
	Critical       bool
	Passive        bool
	DamageOverTime bool
	Incidental     bool
	DirectCast     bool
}

type Fight

type Fight struct {
	Mob                     string
	Meter                   *Meter
	Death                   Death
	EndReason               string
	LastYouIntentionalOrder uint64
}

func (*Fight) ActiveDuration

func (f *Fight) ActiveDuration() time.Duration

type FightTracker

type FightTracker struct {
	// contains filtered or unexported fields
}

func NewFightTracker

func NewFightTracker() *FightTracker

func NewFightTrackerWithHistory

func NewFightTrackerWithHistory(historyLimit int) *FightTracker

func (*FightTracker) AddCast

func (t *FightTracker) AddCast(cast Cast)

func (*FightTracker) AddDamage

func (t *FightTracker) AddDamage(event Event)

func (*FightTracker) AddDamageWithIdle

func (t *FightTracker) AddDamageWithIdle(event Event, idleTimeout time.Duration)

func (*FightTracker) AddDeath

func (t *FightTracker) AddDeath(death Death)

func (*FightTracker) DisplayFight

func (t *FightTracker) DisplayFight() (*Fight, bool)

func (*FightTracker) DisplaySections

func (t *FightTracker) DisplaySections() []DisplaySection

func (*FightTracker) EndIdle

func (t *FightTracker) EndIdle(now time.Time, idleTimeout time.Duration) bool

func (*FightTracker) EndIdleAtLogTime

func (t *FightTracker) EndIdleAtLogTime(logTime time.Time, idleTimeout time.Duration) bool

func (*FightTracker) ForgetEnemies

func (t *FightTracker) ForgetEnemies(timestamp time.Time)

type Meter

type Meter struct {
	// contains filtered or unexported fields
}

func NewMeter

func NewMeter() *Meter

func (*Meter) Add

func (m *Meter) Add(event Event)

func (*Meter) Ended

func (m *Meter) Ended() time.Time

func (*Meter) Events

func (m *Meter) Events() int

func (*Meter) Players

func (m *Meter) Players() []PlayerStats

func (*Meter) Started

func (m *Meter) Started() time.Time

type PlayerStats

type PlayerStats struct {
	Name      string
	Damage    int
	Hits      int
	Crits     int
	MinHit    int
	MaxHit    int
	FirstSeen time.Time
	LastSeen  time.Time
	Breakdown map[string]*BreakdownStats
	EngagedAt time.Time
	// LastIntentionalDamage records the latest direct, non-incidental damage
	// initiated by this combatant. Passive shields, DoTs, ripostes, and other
	// incidental hits do not advance it.
	LastIntentionalDamage time.Time
}

func (PlayerStats) ActiveDuration

func (s PlayerStats) ActiveDuration() time.Duration

func (PlayerStats) DPS

func (s PlayerStats) DPS() float64

func (PlayerStats) DPSForDuration

func (s PlayerStats) DPSForDuration(duration time.Duration) float64

func (PlayerStats) DamageBreakdown

func (s PlayerStats) DamageBreakdown() []BreakdownStats

func (PlayerStats) EngagedDPS

func (s PlayerStats) EngagedDPS(ended time.Time) (float64, bool)

Jump to

Keyboard shortcuts

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