Versions in this module Expand all Collapse all v1 v1.0.1 Nov 25, 2020 Changes in this version + func AuraEffectAbsorbAllDmg(aura *Aura, step define.EAuraEffectStep, index int32, param1 interface{}, ...) define.EAuraAddResult + func AuraEffectChgMelee(aura *Aura, step define.EAuraEffectStep, index int32, param1 interface{}, ...) define.EAuraAddResult + func AuraEffectDmgAccumulate(aura *Aura, step define.EAuraEffectStep, index int32, param1 interface{}, ...) define.EAuraAddResult + func AuraEffectDmgAttMod(aura *Aura, step define.EAuraEffectStep, index int32, param1 interface{}, ...) define.EAuraAddResult + func AuraEffectDmgFix(aura *Aura, step define.EAuraEffectStep, index int32, param1 interface{}, ...) define.EAuraAddResult + func AuraEffectDmgMod(aura *Aura, step define.EAuraEffectStep, index int32, param1 interface{}, ...) define.EAuraAddResult + func AuraEffectImmunity(aura *Aura, step define.EAuraEffectStep, index int32, param1 interface{}, ...) define.EAuraAddResult + func AuraEffectLimitAttack(aura *Aura, step define.EAuraEffectStep, index int32, param1 interface{}, ...) define.EAuraAddResult + func AuraEffectMeleeSpell(aura *Aura, step define.EAuraEffectStep, index int32, param1 interface{}, ...) define.EAuraAddResult + func AuraEffectModAtt(aura *Aura, step define.EAuraEffectStep, index int32, param1 interface{}, ...) define.EAuraAddResult + func AuraEffectModAttByAlive(aura *Aura, step define.EAuraEffectStep, index int32, param1 interface{}, ...) define.EAuraAddResult + func AuraEffectModAttByEnemyAlive(aura *Aura, step define.EAuraEffectStep, index int32, param1 interface{}, ...) define.EAuraAddResult + func AuraEffectNewDmg(aura *Aura, step define.EAuraEffectStep, index int32, param1 interface{}, ...) define.EAuraAddResult + func AuraEffectNull(aura *Aura, step define.EAuraEffectStep, index int32, param1 interface{}, ...) define.EAuraAddResult + func AuraEffectPeriodDamage(aura *Aura, step define.EAuraEffectStep, index int32, param1 interface{}, ...) define.EAuraAddResult + func AuraEffectPeriodHeal(aura *Aura, step define.EAuraEffectStep, index int32, param1 interface{}, ...) define.EAuraAddResult + func AuraEffectShield(aura *Aura, step define.EAuraEffectStep, index int32, param1 interface{}, ...) define.EAuraAddResult + func AuraEffectSpell(aura *Aura, step define.EAuraEffectStep, index int32, param1 interface{}, ...) define.EAuraAddResult + func AuraEffectState(aura *Aura, step define.EAuraEffectStep, index int32, param1 interface{}, ...) define.EAuraAddResult + func EffectAddAura(spell *Spell, index int32, target SceneUnit) error + func EffectAddLevelAura(spell *Spell, index int32, target SceneUnit) error + func EffectAddStateAura(spell *Spell, index int32, target SceneUnit) error + func EffectAddWrapAura(spell *Spell, index int32, target SceneUnit) error + func EffectAuraNumDmg(spell *Spell, index int32, target SceneUnit) error + func EffectAverageHP(spell *Spell, index int32, target SceneUnit) error + func EffectCastSpell(spell *Spell, index int32, target SceneUnit) error + func EffectCasterAttDamage(spell *Spell, index int32, target SceneUnit) error + func EffectChangeRageSpell(spell *Spell, index int32, target SceneUnit) error + func EffectDamage(spell *Spell, index int32, target SceneUnit) error + func EffectDamageRaceMod(spell *Spell, index int32, target SceneUnit) error + func EffectDispel(spell *Spell, index int32, target SceneUnit) error + func EffectDispelAndWeak(spell *Spell, index int32, target SceneUnit) error + func EffectEnrage(spell *Spell, index int32, target SceneUnit) error + func EffectHeal(spell *Spell, index int32, target SceneUnit) error + func EffectLevelEnrage(spell *Spell, index int32, target SceneUnit) error + func EffectModAuraDuration(spell *Spell, index int32, target SceneUnit) error + func EffectModPctCurHP(spell *Spell, index int32, target SceneUnit) error + func EffectNull(spell *Spell, index int32, target SceneUnit) error + func EffectPetDamage(spell *Spell, index int32, target SceneUnit) error + func EffectPetHeal(spell *Spell, index int32, target SceneUnit) error + func EffectPlacate(spell *Spell, index int32, target SceneUnit) error + func EffectRandAura(spell *Spell, index int32, target SceneUnit) error + func EffectTargetAttDamage(spell *Spell, index int32, target SceneUnit) error + type Aura struct + AddEffLock int16 + CurDuration uint8 + CurPoint [define.SpellEffectNum]int32 + EffMisc [define.SpellEffectNum]int32 + EffectTimes uint8 + Multiple [define.SpellEffectNum]float32 + SpellType define.ESpellType + TriggerCd [define.SpellEffectNum]int32 + TriggerCount [define.SpellEffectNum]uint32 + UpdateTime int32 + func (a *Aura) AddRemoveMode(mode define.EAuraRemoveMode) + func (a *Aura) CalAuraEffect(step define.EAuraEffectStep, effIndex int32, param1 interface{}, ...) define.EAuraAddResult + func (a *Aura) CalDamage(baseDamage int64, damageInfo *CalcDamageInfo, target SceneUnit) + func (a *Aura) CalHeal(baseHeal int32, damageInfo *CalcDamageInfo, target SceneUnit) + func (a *Aura) CalcApplyEffect(register bool, sync bool) + func (a *Aura) CheckWrapResult(aura *Aura) define.EAuraWrapResult + func (a *Aura) DecRemoveMode(mode define.EAuraRemoveMode) + func (a *Aura) Disperse() + func (a *Aura) GetRemoveMode() define.EAuraRemoveMode + func (a *Aura) Init(opts ...AuraOption) + func (a *Aura) InvalidApplyLock() + func (a *Aura) IsApplyLockValid() bool + func (a *Aura) IsApplyLocked() bool + func (a *Aura) IsHangup() bool + func (a *Aura) IsRemoved() bool + func (a *Aura) ModDuration(modDuration uint32) + func (a *Aura) MorePowerfulThan(aura *Aura) bool + func (a *Aura) Opts() *AuraOptions + func (a *Aura) RoundEnd() + func (a *Aura) SyncAuraToClient(step define.EAuraSyncStep) + type AuraEffectsHandler func(*Aura, define.EAuraEffectStep, int32, interface{}, interface{}) define.EAuraAddResult + type AuraOption func(*AuraOptions) + func WithAuraAmount(amount int32) AuraOption + func WithAuraCaster(caster SceneUnit) AuraOption + func WithAuraCurWrapTimes(curWrapTimes uint8) AuraOption + func WithAuraEntry(entry *define.AuraEntry) AuraOption + func WithAuraLevel(level uint32) AuraOption + func WithAuraOwner(owner SceneUnit) AuraOption + func WithAuraRagePctMod(ragePctMod float32) AuraOption + func WithAuraSlotIndex(index int8) AuraOption + func WithAuraSpellType(tp define.ESpellType) AuraOption + type AuraOptions struct + Amount int32 + Caster SceneUnit + CurWrapTimes uint8 + Entry *define.AuraEntry + Level uint32 + Owner SceneUnit + RagePctMod float32 + SlotIndex int8 + SpellType define.ESpellType + func DefaultAuraOptions() *AuraOptions + type AuraTrigger struct + Aura *Aura + EffIndex int32 + type CalcDamageInfo struct + Damage int64 + ProcCaster uint32 + ProcEx uint32 + ProcTarget uint32 + SchoolType define.ESchoolType + SpellId uint32 + Type define.EDmgInfoType + func (d *CalcDamageInfo) Reset() + type CombatCtrl struct + func NewCombatCtrl(owner SceneUnit) *CombatCtrl + func (c *CombatCtrl) AddAura(auraId uint32, caster SceneUnit, amount int32, level uint32, ...) define.EAuraAddResult + func (c *CombatCtrl) AddAuraState(auraState int32) + func (c *CombatCtrl) CalAuraEffect(curRound int32) + func (c *CombatCtrl) CalDecByTargetPoint(spellBase *define.SpellBase, points []int32, multiple []float32, level uint32) + func (c *CombatCtrl) CalSpellPoint(spellBase *define.SpellBase, points []int32, multiple []float32, level uint32) + func (c *CombatCtrl) CastSpell(spellId uint32, caster, target SceneUnit, triggered bool) error + func (c *CombatCtrl) ClearAllAura() + func (c *CombatCtrl) DecAuraState(auraState int32) + func (c *CombatCtrl) DispelAura(dispelType uint32, num uint32) bool + func (c *CombatCtrl) GetAuraByIDCaster(auraId uint32, caster SceneUnit) *Aura + func (c *CombatCtrl) GetPositiveAndNegativeNum(posNum int32, negNum int32) (newPosNum int32, newNegNum int32) + func (c *CombatCtrl) HasAuraState(auraState int32) bool + func (c *CombatCtrl) HasAuraStateAny(auraStateMask uint32) bool + func (c *CombatCtrl) ModAuraDuration(modType uint32, modDuration uint32) + func (c *CombatCtrl) RegisterAura(aura *Aura) + func (c *CombatCtrl) RemoveAura(aura *Aura, mode define.EAuraRemoveMode) bool + func (c *CombatCtrl) TriggerByAuraState(state int32, add bool) + func (c *CombatCtrl) TriggerByBehaviour(behaviour define.EBehaviourType, target SceneUnit, procCaster, procEx uint32, ...) (triggerCount int32) + func (c *CombatCtrl) TriggerByDmgMod(caster bool, target SceneUnit, dmgInfo *CalcDamageInfo) + func (c *CombatCtrl) TriggerByServentState(state define.EHeroState, add bool) + func (c *CombatCtrl) TriggerBySpellResult(isCaster bool, target SceneUnit, dmgInfo *CalcDamageInfo) + func (c *CombatCtrl) UnregisterAura(aura *Aura) + func (c *CombatCtrl) Update() + type Scene struct + func (s *Scene) Exit(ctx context.Context) + func (s *Scene) GetID() int64 + func (s *Scene) GetResult() bool + func (s *Scene) IsOnlyRecord() bool + func (s *Scene) Main(ctx context.Context) error + func (s *Scene) Rand(min, max int) int + func (s *Scene) Run(ctx context.Context) error + func (s *Scene) SendDamage(dmgInfo *CalcDamageInfo) + type SceneCreature struct + func (c *SceneCreature) CombatCtrl() *CombatCtrl + func (c *SceneCreature) GetCamp() int32 + func (c *SceneCreature) GetLevel() uint32 + func (c *SceneCreature) GetScene() *Scene + func (c *SceneCreature) Guid() uint64 + func (c *SceneCreature) HasState(e define.EHeroState) bool + func (c *SceneCreature) Opts() *UnitOptions + func (c *SceneCreature) UpdateSpell() + func (h *SceneCreature) BeatBack(target SceneUnit) + func (h *SceneCreature) DoneDamage(caster SceneUnit, dmgInfo *CalcDamageInfo) + func (h *SceneCreature) GetState64() uint64 + func (h *SceneCreature) HasImmunityAny(tp define.EImmunityType, flag uint32) bool + func (h *SceneCreature) HasStateAny(flag uint32) bool + func (h *SceneCreature) OnBeDamaged(caster SceneUnit, dmgInfo *CalcDamageInfo) + func (h *SceneCreature) OnDamage(target SceneUnit, dmgInfo *CalcDamageInfo) + type SceneHero struct + func (h *SceneHero) BeatBack(target SceneUnit) + func (h *SceneHero) CombatCtrl() *CombatCtrl + func (h *SceneHero) DoneDamage(caster SceneUnit, dmgInfo *CalcDamageInfo) + func (h *SceneHero) GetCamp() int32 + func (h *SceneHero) GetLevel() uint32 + func (h *SceneHero) GetScene() *Scene + func (h *SceneHero) GetState64() uint64 + func (h *SceneHero) Guid() uint64 + func (h *SceneHero) HasImmunityAny(tp define.EImmunityType, flag uint32) bool + func (h *SceneHero) HasState(e define.EHeroState) bool + func (h *SceneHero) HasStateAny(flag uint32) bool + func (h *SceneHero) OnBeDamaged(caster SceneUnit, dmgInfo *CalcDamageInfo) + func (h *SceneHero) OnDamage(target SceneUnit, dmgInfo *CalcDamageInfo) + func (h *SceneHero) Opts() *UnitOptions + func (h *SceneHero) UpdateSpell() + type SceneManager struct + func NewSceneManager() *SceneManager + func (m *SceneManager) CreateScene(ctx context.Context, sceneId int64, sceneType int32, opts ...SceneOption) (*Scene, error) + func (m *SceneManager) Exit() + func (m *SceneManager) GetScene(sceneId int64) *Scene + func (m *SceneManager) Main(ctx context.Context) error + func (m *SceneManager) Run(ctx context.Context) error + type SceneOption func(*SceneOptions) + func WithSceneAttackId(id int64) SceneOption + func WithSceneAttackUnitList(list []*pbCombat.UnitInfo) SceneOption + func WithSceneDefenceId(id int64) SceneOption + func WithSceneDefenceUnitList(list []*pbCombat.UnitInfo) SceneOption + func WithSceneEntry(entry *define.SceneEntry) SceneOption + type SceneOptions struct + AttackId int64 + AttackUnitList []*pbCombat.UnitInfo + DefenceId int64 + DefenceUnitList []*pbCombat.UnitInfo + Entry *define.SceneEntry + func DefaultSceneOptions() *SceneOptions + type SceneUnit interface + BeatBack func(SceneUnit) + CombatCtrl func() *CombatCtrl + DoneDamage func(SceneUnit, *CalcDamageInfo) + GetCamp func() int32 + GetLevel func() uint32 + GetScene func() *Scene + GetState64 func() uint64 + Guid func() uint64 + HasImmunityAny func(define.EImmunityType, uint32) bool + HasState func(define.EHeroState) bool + HasStateAny func(uint32) bool + OnBeDamaged func(SceneUnit, *CalcDamageInfo) + OnDamage func(SceneUnit, *CalcDamageInfo) + Opts func() *UnitOptions + UpdateSpell func() + type Spell struct + func NewSpell(opts ...SpellOption) *Spell + func (s *Spell) CanCast() error + func (s *Spell) Cast() + type SpellEffectsHandler func(*Spell, int32, SceneUnit) error + type SpellOption func(*SpellOptions) + func WithSpellAmount(amount int32) SpellOption + func WithSpellCaster(caster SceneUnit) SpellOption + func WithSpellEntry(entry *define.SpellEntry) SpellOption + func WithSpellLevel(level uint32) SpellOption + func WithSpellTarget(target SceneUnit) SpellOption + func WithSpellTriggered(triggered bool) SpellOption + func WithSpellType(tp define.ESpellType) SpellOption + type SpellOptions struct + Amount int32 + Caster SceneUnit + Entry *define.SpellEntry + Level uint32 + SpellType define.ESpellType + Target SceneUnit + Triggered bool + func DefaultSpellOptions() *SpellOptions + type UnitOption func(*UnitOptions) + func WithAttManager(attId int32) UnitOption + func WithUnitAttList(attList []*pbGame.Att) UnitOption + func WithUnitAttValue(value []int64) UnitOption + func WithUnitCombatCtrl(ctrl *CombatCtrl) UnitOption + func WithUnitEntry(entry *define.UnitEntry) UnitOption + func WithUnitPosition(pos []float32) UnitOption + func WithUnitPositionString(pos string) UnitOption + func WithUnitScene(scene *Scene) UnitOption + func WithUnitTypeId(typeId int32) UnitOption + type UnitOptions struct + AttManager *att.AttManager + AttValue []int64 + CombatCtrl *CombatCtrl + Entry *define.UnitEntry + Immunity [define.ImmunityType_End]*bitset.BitSet + Position [3]float32 + Scene *Scene + State *bitset.BitSet + TypeId int32 + func DefaultUnitOptions() *UnitOptions