model

package
v0.0.0-...-f6fd52c Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2026 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BorderTexture = texture.NewTextureFromFile("asset/skillborder.png")
View Source
var BuffFilter = map[int64]bool{}

BuffFilter contains all useless buff id: https://github.com/Xinrea/ffreplay/issues/17

View Source
var MapCache = map[int]MapPresetItem{}
View Source
var MarkerTextures = []*ebiten.Image{}
View Source
var WorldMarkerConfigs = map[WorldMarkerType]*WorldMarkerConfig{}

Functions

func Init

func Init()

func SetBuffInfoCache

func SetBuffInfoCache(id int64, info *BasicBuffInfo)

Types

type ActionInfo

type ActionInfo struct {
	ID    int64
	Name  string
	IsGCD bool
}

func GetAction

func GetAction(id int64) *ActionInfo

type BasicBuffInfo

type BasicBuffInfo struct {
	ID   int64
	Name string
	Icon string
}

func GetBuffInfo

func GetBuffInfo(id int64) *BasicBuffInfo

type Buff

type Buff struct {
	Type   BuffType
	ID     int64
	Name   string
	Icon   string
	Stacks int
	Remain int64
	// buff duration in ms
	Duration       int64
	ApplyTick      int64
	ECS            *ecs.ECS                                              `json:"-"`
	Source         *donburi.Entry                                        `json:"-"`
	Target         *donburi.Entry                                        `json:"-"`
	ProcessDamage  func(damage *Damage)                                  `json:"-"`
	ProcessHeal    func(heal *Heal)                                      `json:"-"`
	RemoveCallback func(*Buff, *ecs.ECS, *donburi.Entry, *donburi.Entry) `json:"-"`
}

func (Buff) Expired

func (b Buff) Expired(now int64) bool

func (*Buff) Remove

func (b *Buff) Remove()

func (Buff) Texture

func (b Buff) Texture() *ebiten.Image

func (*Buff) UpdateRemain

func (b *Buff) UpdateRemain(now int64)

type BuffList

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

func NewBuffList

func NewBuffList() *BuffList

func (*BuffList) Add

func (bl *BuffList) Add(buff *Buff)

func (*BuffList) Buffs

func (bl *BuffList) Buffs() []*Buff

func (*BuffList) Clear

func (bl *BuffList) Clear()

func (*BuffList) DeBuffs

func (bl *BuffList) DeBuffs() (ret []*Buff)

func (*BuffList) ProcessDamage

func (bl *BuffList) ProcessDamage(damage *Damage)

func (*BuffList) ProcessHeal

func (bl *BuffList) ProcessHeal(heal *Heal)

func (*BuffList) Refresh

func (bl *BuffList) Refresh(buff *Buff)

func (*BuffList) Remove

func (bl *BuffList) Remove(buff *Buff)

func (*BuffList) SetBuffs

func (bl *BuffList) SetBuffs(buffs []*Buff)

func (*BuffList) Update

func (bl *BuffList) Update(now int64)

func (*BuffList) UpdateExpire

func (bl *BuffList) UpdateExpire(now int64)

func (*BuffList) UpdateStack

func (bl *BuffList) UpdateStack(id int64, stack int)

type BuffType

type BuffType int
const (
	NormalBuff BuffType = iota
	Debuff
)

type CameraData

type CameraData struct {
	ViewPort   f64.Vec2
	Position   vector.Vector
	ZoomFactor int
	Rotation   float64
}

func (*CameraData) ScreenToWorld

func (c *CameraData) ScreenToWorld(x, y float64) (float64, float64)

func (*CameraData) Update

func (c *CameraData) Update(v f64.Vec2)

func (*CameraData) WindowSize

func (c *CameraData) WindowSize() (float64, float64)

func (*CameraData) WorldMatrix

func (c *CameraData) WorldMatrix() ebiten.GeoM

func (*CameraData) WorldMatrixInverted

func (c *CameraData) WorldMatrixInverted() ebiten.GeoM

func (*CameraData) WorldToScreen

func (c *CameraData) WorldToScreen(x, y float64) (float64, float64)

type Damage

type Damage struct {
	Type   DamageType
	Amount int
}

type DamageTaken

type DamageTaken struct {
	Tick         int64
	Type         DamageType
	SourceID     int64
	Ability      Skill
	Amount       int64
	Multiplier   float64
	RelatedBuffs []*BasicBuffInfo
}

type DamageType

type DamageType int
const (
	Physical DamageType = 128
	Magical  DamageType = 1024
	Special  DamageType = 32
)

type Event

type Event struct {
	Offset   int64
	Duration int64
	Begin    EventCallback
	Update   EventCallback
	Finish   EventCallback

	Started  bool
	Finished bool
}

func (Event) DurationTick

func (e Event) DurationTick() int64

func (Event) OffsetTick

func (e Event) OffsetTick() int64

type EventCallback

type EventCallback func(
	ecs *ecs.ECS,
	caster *donburi.Entry,
	casterInstance int,
	target *donburi.Entry,
	targetInstance int,
)

type GlobalData

type GlobalData struct {
	// Real tick * 10 for fine speed control
	RenderNPC    bool
	ReplayMode   bool
	Tick         int64
	Speed        int64
	TargetPlayer *donburi.Entry
	LimitBreak   int
	Bar          int
	Debug        bool
	RangeDisplay bool
	// should not process any event when UI is on focus
	UIFocus bool
	// Phases is a tick array for phase change
	Phases         []int64
	FightDuration  atomic.Int64
	Loaded         atomic.Bool
	LoadCount      atomic.Int32
	LoadTotal      int
	ShowTargetRing bool
	// WorldMarker selected
	WorldMarkerSelected int
	// marker for system reset
	Reset atomic.Bool
}

type Heal

type Heal struct {
	Amount int
}

type Instance

type Instance struct {
	Face   float64
	Object object.Object

	// btick and etick should be set when preloading fflogs
	// the first tick when game object is showed
	BTick int64
	// the last tick when game object is showed
	ETick int64
	// contains filtered or unexported fields
}

func (*Instance) AddDamageTaken

func (i *Instance) AddDamageTaken(damage DamageTaken)

func (*Instance) AddTether

func (i *Instance) AddTether(tether *Instance)

func (*Instance) Cast

func (i *Instance) Cast(gameSkill *Skill)

func (*Instance) ClearTether

func (i *Instance) ClearTether()

func (*Instance) DoneCast

func (i *Instance) DoneCast()

func (*Instance) GetCast

func (i *Instance) GetCast() *Skill

func (*Instance) GetHistoryCast

func (i *Instance) GetHistoryCast(tick int64) []*Skill

func (*Instance) GetHistoryDamageTaken

func (i *Instance) GetHistoryDamageTaken(n int) []DamageTaken

GetHistoryDamageTaken returns the last n damage taken history.

func (*Instance) GetTethers

func (i *Instance) GetTethers() []*Instance

func (*Instance) IsActive

func (i *Instance) IsActive(tick int64) bool

func (*Instance) Reset

func (i *Instance) Reset()

type MapBoundary

type MapBoundary struct {
	ID   int   `json:"mapID"`
	MinX int64 `json:"mapMinX"`
	MaxX int64 `json:"mapMaxX"`
	MinY int64 `json:"mapMinY"`
	MaxY int64 `json:"mapMaxY"`
}

type MapConfig

type MapConfig struct {
	CurrentMap   int
	CurrentPhase int
	Maps         map[int]MapItem
	Phases       []MapItem
}

type MapData

type MapData struct {
	Config *MapConfig
}

type MapItem

type MapItem struct {
	ID      int
	Texture *ebiten.Image
	Scale   float64
	Offset  struct {
		X float64
		Y float64
	}
}

type MapPreset

type MapPreset struct {
	Maps []MapPresetItem
}

type MapPresetItem

type MapPresetItem struct {
	ID     int
	Path   string
	Offset struct {
		X float64
		Y float64
	}
	Phases []struct {
		Path   string
		Offset struct {
			X float64
			Y float64
		}
	}
}

func (MapPresetItem) Load

func (m MapPresetItem) Load() *MapConfig

type Skill

type Skill struct {
	ID          int64
	Name        string
	Icon        string
	StartTick   int64
	Cast        int64
	Recast      int64
	IsGCD       bool
	EffectRange object.Object

	Initialize func(r object.Object, facing float64, pos vector.Vector)
}

func (Skill) Texture

func (s Skill) Texture() *ebiten.Image

type SpriteData

type SpriteData struct {
	Texture     *ebiten.Image
	Scale       float64
	Instances   []*Instance
	Initialized bool
}

SpriteData is a struct that contains texture, face, and object. Face is the radian relative to the north direction, range: [-pi, pi].

func (SpriteData) Render

func (s SpriteData) Render(camera *CameraData, screen *ebiten.Image)

type StatusData

type StatusData struct {
	GameID   int64
	ID       int64
	Name     string
	Role     role.RoleType
	HP       int
	MaxHP    int
	Mana     int
	MaxMana  int
	BuffList *BuffList
	Marker   int
	// contains filtered or unexported fields
}

func (*StatusData) IsDead

func (r *StatusData) IsDead() bool

func (*StatusData) Reset

func (r *StatusData) Reset()

func (StatusData) RoleTexture

func (r StatusData) RoleTexture() *ebiten.Image

func (*StatusData) SetDeath

func (r *StatusData) SetDeath(b bool)

func (*StatusData) TakeDamage

func (r *StatusData) TakeDamage(d Damage)

func (*StatusData) TakeHeal

func (r *StatusData) TakeHeal(h Heal)

type TimelineData

type TimelineData struct {
	Name           string
	StartTick      int64
	Caster         *donburi.Entry
	CasterInstance int
	Target         *donburi.Entry
	TargetInstance int
	Events         []Event
}

func (TimelineData) Begin

func (t TimelineData) Begin(ecs *ecs.ECS, index int)

func (TimelineData) EndTick

func (t TimelineData) EndTick() int64

func (TimelineData) Finish

func (t TimelineData) Finish(ecs *ecs.ECS, index int)

func (*TimelineData) InstanceWith

func (t *TimelineData) InstanceWith(
	tick int64,
	caster *donburi.Entry,
	casterInstance int,
	target *donburi.Entry,
	targetInstance int,
) *TimelineData

func (TimelineData) IsDone

func (t TimelineData) IsDone(tick int64) bool

func (*TimelineData) Reset

func (t *TimelineData) Reset()

func (TimelineData) Update

func (t TimelineData) Update(ecs *ecs.ECS, index int)

type VelocityData

type VelocityData struct {
	AX, AY, X, Y float64
}

func (*VelocityData) Clear

func (v *VelocityData) Clear()

func (*VelocityData) Normalize

func (v *VelocityData) Normalize(m float64)

type WorldMarkerConfig

type WorldMarkerConfig struct {
	Type            WorldMarkerType
	Texture         *ebiten.Image
	Background      *ebiten.Image
	BackgroundColor color.NRGBA
}

type WorldMarkerData

type WorldMarkerData struct {
	Type     WorldMarkerType
	Position f64.Vec2
}

type WorldMarkerType

type WorldMarkerType int
const (
	WorldMarkerA WorldMarkerType = iota
	WorldMarkerB
	WorldMarkerC
	WorldMarkerD
	WorldMarker1
	WorldMarker2
	WorldMarker3
	WorldMarker4
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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