Documentation ¶
Overview ¶
Package combat handles all combat related functionalities including
- target tracking
- target selection
- hitbox collision checking
- attack queueing
Index ¶
- Variables
- func WillCollide(p AttackPattern, t Target, index int) bool
- type AttackCB
- type AttackCBFunc
- type AttackEvent
- type AttackInfo
- type AttackPattern
- func NewCircleHit(trg Positional, r float64, self bool, targets ...TargettableType) AttackPattern
- func NewDefBoxHit(w, h float64, self bool, targets ...TargettableType) AttackPattern
- func NewDefCircHit(r float64, self bool, targets ...TargettableType) AttackPattern
- func NewDefSingleTarget(ind int, typ TargettableType) AttackPattern
- type AttackTag
- type CharHandler
- type Character
- type Circle
- type Durability
- type Handler
- func (c *Handler) AbsorbCheck(p AttackPattern, prio ...attributes.Element) attributes.Element
- func (h *Handler) AddTarget(t Target)
- func (h *Handler) ApplyAttack(a *AttackEvent) float64
- func (c *Handler) EnemiesWithinRadius(x, y, r float64) []int
- func (c *Handler) EnemyByDistance(x, y float64, excl int) []int
- func (c *Handler) EnemyExcl(self int) []int
- func (h *Handler) KillTarget(i int) bool
- func (h *Handler) Player() Target
- func (h *Handler) PrimaryTarget() Target
- func (c *Handler) RandomEnemyTarget() int
- func (c *Handler) RandomTargetIndex(typ TargettableType) int
- func (h *Handler) SetTargetPos(i int, x, y float64) bool
- func (h *Handler) Target(i int) Target
- func (h *Handler) Targets() []Target
- func (h *Handler) TargetsCount() int
- func (h *Handler) Tick()
- type ICDGroup
- type ICDTag
- type Opt
- type Positional
- type ReactionType
- type Rectangle
- type SelfDamage
- type Shape
- type SingleTarget
- type Snapshot
- type StrikeType
- type Target
- type TargettableType
Constants ¶
This section is empty.
Variables ¶
View Source
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, 0.0, 0.0, 0.0},
{1, 1, 1, 1, 1},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, 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, 1.0},
{1.0, 1.0},
}
View Source
var ICDGroupResetTimer = []int{
150,
60,
60,
300,
300,
30,
6,
18,
120,
30,
30,
}
Functions ¶
func WillCollide ¶
func WillCollide(p AttackPattern, t Target, index int) bool
Types ¶
type AttackCB ¶
type AttackCB struct { Target Target AttackEvent *AttackEvent Damage float64 IsCrit bool }
type AttackCBFunc ¶
type AttackCBFunc func(AttackCB)
type AttackEvent ¶
type AttackEvent struct { Info AttackInfo Pattern AttackPattern // Timing AttackTiming Cancelled bool //provide a way to cancel an attack event Snapshot Snapshot SourceFrame int //source frame Callbacks []AttackCBFunc `json:"-"` }
type AttackInfo ¶
type AttackInfo struct { ActorIndex int //character this attack belongs to DamageSrc int //source of this attack (i.e. index of core.Targets); always 0 for player, 1+ for the rest Abil string //name of ability triggering the damage AttackTag AttackTag ICDTag ICDTag ICDGroup ICDGroup Element attributes.Element //element of ability Durability Durability //durability of aura, 0 if nothing applied NoImpulse bool HitWeakPoint bool Mult float64 //ability multiplier. could set to 0 from initial Mona dmg StrikeType StrikeType UseDef bool //we use this instead of flatdmg to make sure stat snapshotting works properly FlatDmg float64 //flat dmg; IgnoreDefPercent float64 //by default this value is 0; if = 1 then the attack will ignore defense; raiden c2 should be set to 0.6 (i.e. ignore 60%) IgnoreInfusion bool //amp info Amped bool //new flag used by new reaction system AmpMult float64 //amplier AmpType ReactionType //melt or vape i guess //special flag for sim generated attack SourceIsSim bool DoNotLog bool //hitlag stuff HitlagHaltFrames float64 //this is the number of frames to pause by HitlagFactor float64 //this is factor to slow clock by CanBeDefenseHalted bool //for whacking ruin gaurds IsDeployable bool //if this is true, then hitlag does not affect owner HitlagOnHeadshotOnly bool //if this is true, will only apply if HitWeakpoint is also true }
type AttackPattern ¶
type AttackPattern struct { Shape Shape Targets [TargettableTypeCount]bool SelfHarm bool }
func NewCircleHit ¶
func NewCircleHit(trg Positional, r float64, self bool, targets ...TargettableType) AttackPattern
func NewDefBoxHit ¶
func NewDefBoxHit(w, h float64, self bool, targets ...TargettableType) AttackPattern
func NewDefCircHit ¶
func NewDefCircHit(r float64, self bool, targets ...TargettableType) AttackPattern
func NewDefSingleTarget ¶
func NewDefSingleTarget(ind int, typ TargettableType) AttackPattern
type AttackTag ¶
type AttackTag int //attacktag is used instead of actions etc..
const ( AttackTagNone AttackTag = iota AttackTagNormal AttackTagExtra AttackTagPlunge AttackTagElementalArt AttackTagElementalArtHold AttackTagElementalBurst AttackTagWeaponSkill AttackTagMonaBubbleBreak AttackTagNoneStat ReactionAttackDelim AttackTagOverloadDamage AttackTagSuperconductDamage AttackTagECDamage AttackTagShatter AttackTagSwirlPyro AttackTagSwirlHydro AttackTagSwirlCryo AttackTagSwirlElectro AttackTagLength )
type CharHandler ¶
type Character ¶
type Character interface {
ApplyAttackMods(a *AttackEvent, t Target) []interface{}
}
type Circle ¶
type Circle struct {
// contains filtered or unexported fields
}
func (*Circle) IntersectCircle ¶
type Durability ¶
type Durability float64
type Handler ¶
func (*Handler) AbsorbCheck ¶
func (c *Handler) AbsorbCheck(p AttackPattern, prio ...attributes.Element) attributes.Element
func (*Handler) ApplyAttack ¶
func (h *Handler) ApplyAttack(a *AttackEvent) float64
func (*Handler) EnemiesWithinRadius ¶
EnemiesWithinRadius returns an array of indices of the enemies within radius r
func (*Handler) EnemyByDistance ¶
EnemyByDistance returns an array of indices of the enemies sorted by distance
func (*Handler) KillTarget ¶ added in v1.1.2
func (*Handler) PrimaryTarget ¶
func (*Handler) RandomEnemyTarget ¶
func (*Handler) RandomTargetIndex ¶
func (c *Handler) RandomTargetIndex(typ TargettableType) int
func (*Handler) TargetsCount ¶
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 ICDTagElementalArtAnemo ICDTagElementalArtPyro ICDTagElementalArtHydro ICDTagElementalArtCryo ICDTagElementalArtElectro ICDTagElementalBurst ICDTagElementalBurstAnemo ICDTagElementalBurstPyro ICDTagElementalBurstHydro ICDTagElementalBurstCryo ICDTagElementalBurstElectro ICDTagDash ICDTagLisaElectro ICDTagYanfeiFire ICDTagYelanBreakthrough ICDTagYelanBurst ICDTagMonaWaterDamage ICDTagTravelerWakeOfEarth ICDTagKleeFireDamage ICDTagTartagliaRiptideFlash ICDReactionDamageDelim ICDTagOverloadDamage ICDTagSuperconductDamage ICDTagECDamage ICDTagShatter ICDTagSwirlPyro ICDTagSwirlHydro ICDTagSwirlCryo ICDTagSwirlElectro ICDTagLength )
type Positional ¶
type Positional interface {
Pos() (x, y float64)
}
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 Rectangle ¶
type Rectangle struct {
// contains filtered or unexported fields
}
func (*Rectangle) IntersectCircle ¶
func (*Rectangle) IntersectRectangle ¶
type SelfDamage ¶
type SelfDamage struct{}
this is for attack that only hits self
func (*SelfDamage) IntersectCircle ¶
func (c *SelfDamage) IntersectCircle(in Circle) bool
func (*SelfDamage) IntersectRectangle ¶
func (c *SelfDamage) IntersectRectangle(in Rectangle) bool
type SingleTarget ¶
type SingleTarget struct {
Target int
}
func (*SingleTarget) IntersectCircle ¶
func (s *SingleTarget) IntersectCircle(in Circle) bool
func (*SingleTarget) IntersectRectangle ¶
func (s *SingleTarget) IntersectRectangle(in Rectangle) bool
func (*SingleTarget) Pos ¶
func (s *SingleTarget) Pos() (float64, float64)
func (*SingleTarget) String ¶
func (s *SingleTarget) String() string
type Snapshot ¶
type Snapshot struct { CharLvl int ActorEle attributes.Element ExtraIndex int //this is currently purely for Kaeya icicle ICD Cancelled bool //set to true if this snap should be ignored Stats [attributes.EndStatType]float64 //total character stats including from artifact, bonuses, etc... BaseAtk float64 //base attack used in calc BaseDef float64 BaseHP float64 SourceFrame int // frame snapshot was generated at Logs []interface{} // logs for the snapshot }
type StrikeType ¶
type StrikeType int
const ( StrikeTypeDefault StrikeType = iota StrikeTypePierce StrikeTypeBlunt StrikeTypeSlash StrikeTypeSpear )
type Target ¶
type Target interface { Index() int //should correspond to index SetIndex(index int) //update the current index IsAlive() bool MaxHP() float64 HP() float64 Type() TargettableType //type of target Shape() Shape // shape of target Pos() (float64, float64) // center of target SetPos(x, y float64) // move target //apply attack to target Attack(*AttackEvent, glog.Event) (float64, bool) //aura checks AuraContains(e ...attributes.Element) bool Tick() //called every tick //getting rid of Kill() }
type TargettableType ¶
type TargettableType int
const ( TargettableEnemy TargettableType = iota TargettablePlayer TargettableObject TargettableTypeCount )
Click to show internal directories.
Click to hide internal directories.