Documentation ¶
Index ¶
- 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
- 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
- type AuraOption
- 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
- type AuraTrigger
- type CalcDamageInfo
- type 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
- 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
- func (h *SceneCreature) BeatBack(target SceneUnit)
- func (c *SceneCreature) CombatCtrl() *CombatCtrl
- func (h *SceneCreature) DoneDamage(caster SceneUnit, dmgInfo *CalcDamageInfo)
- func (c *SceneCreature) GetCamp() int32
- func (c *SceneCreature) GetLevel() uint32
- func (c *SceneCreature) GetScene() *Scene
- func (h *SceneCreature) GetState64() uint64
- func (c *SceneCreature) Guid() uint64
- func (h *SceneCreature) HasImmunityAny(tp define.EImmunityType, flag uint32) bool
- func (c *SceneCreature) HasState(e define.EHeroState) bool
- func (h *SceneCreature) HasStateAny(flag uint32) bool
- func (h *SceneCreature) OnBeDamaged(caster SceneUnit, dmgInfo *CalcDamageInfo)
- func (h *SceneCreature) OnDamage(target SceneUnit, dmgInfo *CalcDamageInfo)
- func (c *SceneCreature) Opts() *UnitOptions
- func (c *SceneCreature) UpdateSpell()
- type SceneHero
- 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
- 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
- type SceneOptions
- type SceneUnit
- type Spell
- type SpellEffectsHandler
- type SpellOption
- 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
- type UnitOption
- 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
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuraEffectAbsorbAllDmg ¶
func AuraEffectAbsorbAllDmg(aura *Aura, step define.EAuraEffectStep, index int32, param1 interface{}, param2 interface{}) define.EAuraAddResult
------------------------------------------------------------------------------- 全类型伤害吸收 -------------------------------------------------------------------------------
func AuraEffectChgMelee ¶
func AuraEffectChgMelee(aura *Aura, step define.EAuraEffectStep, index int32, param1 interface{}, param2 interface{}) define.EAuraAddResult
------------------------------------------------------------------------------- 替换普通攻击 -------------------------------------------------------------------------------
func AuraEffectDmgAccumulate ¶
func AuraEffectDmgAccumulate(aura *Aura, step define.EAuraEffectStep, index int32, param1 interface{}, param2 interface{}) define.EAuraAddResult
------------------------------------------------------------------------------- 累计伤害 -------------------------------------------------------------------------------
func AuraEffectDmgAttMod ¶
func AuraEffectDmgAttMod(aura *Aura, step define.EAuraEffectStep, index int32, param1 interface{}, param2 interface{}) define.EAuraAddResult
------------------------------------------------------------------------------- 改变伤害属性 -------------------------------------------------------------------------------
func AuraEffectDmgFix ¶
func AuraEffectDmgFix(aura *Aura, step define.EAuraEffectStep, index int32, param1 interface{}, param2 interface{}) define.EAuraAddResult
------------------------------------------------------------------------------- 限量伤害(改变原伤害) -------------------------------------------------------------------------------
func AuraEffectDmgMod ¶
func AuraEffectDmgMod(aura *Aura, step define.EAuraEffectStep, index int32, param1 interface{}, param2 interface{}) define.EAuraAddResult
------------------------------------------------------------------------------- 伤害转换(总量一定) -------------------------------------------------------------------------------
func AuraEffectImmunity ¶
func AuraEffectImmunity(aura *Aura, step define.EAuraEffectStep, index int32, param1 interface{}, param2 interface{}) define.EAuraAddResult
------------------------------------------------------------------------------- 免疫变更 -------------------------------------------------------------------------------
func AuraEffectLimitAttack ¶
func AuraEffectLimitAttack(aura *Aura, step define.EAuraEffectStep, index int32, param1 interface{}, param2 interface{}) define.EAuraAddResult
------------------------------------------------------------------------------- 限制攻击力 -------------------------------------------------------------------------------
func AuraEffectMeleeSpell ¶
func AuraEffectMeleeSpell(aura *Aura, step define.EAuraEffectStep, index int32, param1 interface{}, param2 interface{}) define.EAuraAddResult
------------------------------------------------------------------------------- 释放普通攻击 -------------------------------------------------------------------------------
func AuraEffectModAtt ¶
func AuraEffectModAtt(aura *Aura, step define.EAuraEffectStep, index int32, param1 interface{}, param2 interface{}) define.EAuraAddResult
------------------------------------------------------------------------------- 属性改变 -------------------------------------------------------------------------------
func AuraEffectModAttByAlive ¶
func AuraEffectModAttByAlive(aura *Aura, step define.EAuraEffectStep, index int32, param1 interface{}, param2 interface{}) define.EAuraAddResult
------------------------------------------------------------------------------- 根据当前友方存活人数,计算属性改 -------------------------------------------------------------------------------
func AuraEffectModAttByEnemyAlive ¶
func AuraEffectModAttByEnemyAlive(aura *Aura, step define.EAuraEffectStep, index int32, param1 interface{}, param2 interface{}) define.EAuraAddResult
------------------------------------------------------------------------------- 根据当前敌方存活人数,计算属性改 -------------------------------------------------------------------------------
func AuraEffectNewDmg ¶
func AuraEffectNewDmg(aura *Aura, step define.EAuraEffectStep, index int32, param1 interface{}, param2 interface{}) define.EAuraAddResult
------------------------------------------------------------------------------- 生成伤害(原伤害不变) -------------------------------------------------------------------------------
func AuraEffectNull ¶
func AuraEffectNull(aura *Aura, step define.EAuraEffectStep, index int32, param1 interface{}, param2 interface{}) define.EAuraAddResult
func AuraEffectPeriodDamage ¶
func AuraEffectPeriodDamage(aura *Aura, step define.EAuraEffectStep, index int32, param1 interface{}, param2 interface{}) define.EAuraAddResult
------------------------------------------------------------------------------- 周期伤害 -------------------------------------------------------------------------------
func AuraEffectPeriodHeal ¶
func AuraEffectPeriodHeal(aura *Aura, step define.EAuraEffectStep, index int32, param1 interface{}, param2 interface{}) define.EAuraAddResult
------------------------------------------------------------------------------- 周期治疗 -------------------------------------------------------------------------------
func AuraEffectShield ¶
func AuraEffectShield(aura *Aura, step define.EAuraEffectStep, index int32, param1 interface{}, param2 interface{}) define.EAuraAddResult
------------------------------------------------------------------------------- 血盾 -------------------------------------------------------------------------------
func AuraEffectSpell ¶
func AuraEffectSpell(aura *Aura, step define.EAuraEffectStep, index int32, param1 interface{}, param2 interface{}) define.EAuraAddResult
------------------------------------------------------------------------------- 施放技能 -------------------------------------------------------------------------------
func AuraEffectState ¶
func AuraEffectState(aura *Aura, step define.EAuraEffectStep, index int32, param1 interface{}, param2 interface{}) define.EAuraAddResult
------------------------------------------------------------------------------- 改变状态 -------------------------------------------------------------------------------
func EffectAddLevelAura ¶
15 根据目标等级添加Aura
func EffectAddStateAura ¶
17 添加状态类Aura,并计算状态抗性
func EffectAddWrapAura ¶
22 添加可叠加buff
func EffectAuraNumDmg ¶
10 根据buff数量计算伤害
func EffectAverageHP ¶
9 平均血量
func EffectCastSpell ¶
6 施放技能
func EffectCasterAttDamage ¶
12 根据施放者某一属性计算伤害
func EffectChangeRageSpell ¶
21 替换英雄怒气技能
func EffectDamageRaceMod ¶
13 种族加成伤害
func EffectDispelAndWeak ¶
14 驱散虚弱
func EffectLevelEnrage ¶
16 根据目标等级激怒
func EffectModAuraDuration ¶
8 强化aura作用时间
func EffectModPctCurHP ¶
23 百分比修改目标当前血量
func EffectPetDamage ¶
19 宠物伤害
func EffectRandAura ¶
18 添加随机buff
Types ¶
type Aura ¶
type Aura struct { EffectTimes uint8 // 剩余作用次数 CurDuration uint8 // 当前剩余回合数 AddEffLock int16 // 追加时效果锁 SpellType define.ESpellType Multiple [define.SpellEffectNum]float32 CurPoint [define.SpellEffectNum]int32 EffMisc [define.SpellEffectNum]int32 // 效果变量 TriggerCount [define.SpellEffectNum]uint32 // 每回合已触发次数 UpdateTime int32 TriggerCd [define.SpellEffectNum]int32 // 触发CD // contains filtered or unexported fields }
func (*Aura) AddRemoveMode ¶
func (a *Aura) AddRemoveMode(mode define.EAuraRemoveMode)
func (*Aura) CalAuraEffect ¶
func (a *Aura) CalAuraEffect(step define.EAuraEffectStep, effIndex int32, param1 interface{}, param2 interface{}) define.EAuraAddResult
func (*Aura) CalDamage ¶
func (a *Aura) CalDamage(baseDamage int64, damageInfo *CalcDamageInfo, target SceneUnit)
------------------------------------------------------------------------------- 计算伤害 -------------------------------------------------------------------------------
func (*Aura) CalHeal ¶
func (a *Aura) CalHeal(baseHeal int32, damageInfo *CalcDamageInfo, target SceneUnit)
------------------------------------------------------------------------------- 计算治疗 -------------------------------------------------------------------------------
func (*Aura) CalcApplyEffect ¶
------------------------------------------------------------------------------- 计算效果 -------------------------------------------------------------------------------
func (*Aura) CheckWrapResult ¶
func (a *Aura) CheckWrapResult(aura *Aura) define.EAuraWrapResult
------------------------------------------------------------------------------- 叠加结果 -------------------------------------------------------------------------------
func (*Aura) DecRemoveMode ¶
func (a *Aura) DecRemoveMode(mode define.EAuraRemoveMode)
func (*Aura) Disperse ¶
func (a *Aura) Disperse()
------------------------------------------------------------------------------- 驱散 -------------------------------------------------------------------------------
func (*Aura) GetRemoveMode ¶
func (a *Aura) GetRemoveMode() define.EAuraRemoveMode
func (*Aura) Init ¶
func (a *Aura) Init(opts ...AuraOption)
------------------------------------------------------------------------------- 初始化 -------------------------------------------------------------------------------
func (*Aura) InvalidApplyLock ¶
func (a *Aura) InvalidApplyLock()
func (*Aura) IsApplyLockValid ¶
func (*Aura) IsApplyLocked ¶
func (*Aura) ModDuration ¶
------------------------------------------------------------------------------- 强化Aura作用时间 -------------------------------------------------------------------------------
func (*Aura) MorePowerfulThan ¶
------------------------------------------------------------------------------- 等级比较 -------------------------------------------------------------------------------
func (*Aura) Opts ¶
func (a *Aura) Opts() *AuraOptions
func (*Aura) RoundEnd ¶
func (a *Aura) RoundEnd()
------------------------------------------------------------------------------- 回合结束 -------------------------------------------------------------------------------
func (*Aura) SyncAuraToClient ¶
func (a *Aura) SyncAuraToClient(step define.EAuraSyncStep)
------------------------------------------------------------------------------- 同步客户端 -------------------------------------------------------------------------------
type AuraEffectsHandler ¶
type AuraEffectsHandler func(*Aura, define.EAuraEffectStep, int32, interface{}, interface{}) define.EAuraAddResult
技能效果处理函数
type AuraOption ¶
type AuraOption func(*AuraOptions)
func WithAuraAmount ¶
func WithAuraAmount(amount int32) AuraOption
func WithAuraCaster ¶
func WithAuraCaster(caster SceneUnit) AuraOption
func WithAuraCurWrapTimes ¶
func WithAuraCurWrapTimes(curWrapTimes uint8) AuraOption
func WithAuraEntry ¶
func WithAuraEntry(entry *define.AuraEntry) AuraOption
func WithAuraLevel ¶
func WithAuraLevel(level uint32) AuraOption
func WithAuraOwner ¶
func WithAuraOwner(owner SceneUnit) AuraOption
func WithAuraRagePctMod ¶
func WithAuraRagePctMod(ragePctMod float32) AuraOption
func WithAuraSlotIndex ¶
func WithAuraSlotIndex(index int8) AuraOption
func WithAuraSpellType ¶
func WithAuraSpellType(tp define.ESpellType) AuraOption
type AuraOptions ¶
type AuraOptions struct { Owner SceneUnit Caster SceneUnit Amount int32 Level uint32 RagePctMod float32 CurWrapTimes uint8 SpellType define.ESpellType SlotIndex int8 // Aura栏位序号 Entry *define.AuraEntry }
func DefaultAuraOptions ¶
func DefaultAuraOptions() *AuraOptions
type AuraTrigger ¶
type CalcDamageInfo ¶
type CalcDamageInfo struct { Type define.EDmgInfoType // 伤害方式 //tagHeroLocation stCaster; //tagHeroLocation stTarget; SchoolType define.ESchoolType // 伤害类型 Damage int64 // 伤害量 SpellId uint32 // 技能ID ProcCaster uint32 ProcTarget uint32 ProcEx uint32 // 技能结果类型掩码 }
------------------------------------------------------------------------------- 伤害信息 -------------------------------------------------------------------------------
func (*CalcDamageInfo) Reset ¶
func (d *CalcDamageInfo) Reset()
type CombatCtrl ¶
type CombatCtrl struct {
// contains filtered or unexported fields
}
func NewCombatCtrl ¶
func NewCombatCtrl(owner SceneUnit) *CombatCtrl
func (*CombatCtrl) AddAura ¶
func (c *CombatCtrl) AddAura(auraId uint32, caster SceneUnit, amount int32, level uint32, spellType define.ESpellType, ragePctMod float32, wrapTime int32) define.EAuraAddResult
------------------------------------------------------------------------------- 添加Aura -------------------------------------------------------------------------------
func (*CombatCtrl) AddAuraState ¶
func (c *CombatCtrl) AddAuraState(auraState int32)
------------------------------------------------------------------------------- aura state -------------------------------------------------------------------------------
func (*CombatCtrl) CalAuraEffect ¶
func (c *CombatCtrl) CalAuraEffect(curRound int32)
------------------------------------------------------------------------------- 计算aura效果 -------------------------------------------------------------------------------
func (*CombatCtrl) CalDecByTargetPoint ¶
func (c *CombatCtrl) CalDecByTargetPoint(spellBase *define.SpellBase, points []int32, multiple []float32, level uint32)
------------------------------------------------------------------------------- 根据目标等级计算效果 -------------------------------------------------------------------------------
func (*CombatCtrl) CalSpellPoint ¶
func (c *CombatCtrl) CalSpellPoint(spellBase *define.SpellBase, points []int32, multiple []float32, level uint32)
------------------------------------------------------------------------------- 计算效果参数 -------------------------------------------------------------------------------
func (*CombatCtrl) CastSpell ¶
func (c *CombatCtrl) CastSpell(spellId uint32, caster, target SceneUnit, triggered bool) error
------------------------------------------------------------------------------- 施放技能 -------------------------------------------------------------------------------
func (*CombatCtrl) ClearAllAura ¶
func (c *CombatCtrl) ClearAllAura()
func (*CombatCtrl) DecAuraState ¶
func (c *CombatCtrl) DecAuraState(auraState int32)
func (*CombatCtrl) DispelAura ¶
func (c *CombatCtrl) DispelAura(dispelType uint32, num uint32) bool
------------------------------------------------------------------------------- 驱散 -------------------------------------------------------------------------------
func (*CombatCtrl) GetAuraByIDCaster ¶
func (c *CombatCtrl) GetAuraByIDCaster(auraId uint32, caster SceneUnit) *Aura
------------------------------------------------------------------------------- 是否有指定TypeID的aura -------------------------------------------------------------------------------
func (*CombatCtrl) GetPositiveAndNegativeNum ¶
func (c *CombatCtrl) GetPositiveAndNegativeNum(posNum int32, negNum int32) (newPosNum int32, newNegNum int32)
------------------------------------------------------------------------------- 增益和减益buff数量 -------------------------------------------------------------------------------
func (*CombatCtrl) HasAuraState ¶
func (c *CombatCtrl) HasAuraState(auraState int32) bool
func (*CombatCtrl) HasAuraStateAny ¶
func (c *CombatCtrl) HasAuraStateAny(auraStateMask uint32) bool
func (*CombatCtrl) ModAuraDuration ¶
func (c *CombatCtrl) ModAuraDuration(modType uint32, modDuration uint32)
------------------------------------------------------------------------------- 强化作用时间 -------------------------------------------------------------------------------
func (*CombatCtrl) RegisterAura ¶
func (c *CombatCtrl) RegisterAura(aura *Aura)
------------------------------------------------------------------------------- 注册Aura -------------------------------------------------------------------------------
func (*CombatCtrl) RemoveAura ¶
func (c *CombatCtrl) RemoveAura(aura *Aura, mode define.EAuraRemoveMode) bool
------------------------------------------------------------------------------- 移除Aura -------------------------------------------------------------------------------
func (*CombatCtrl) TriggerByAuraState ¶
func (c *CombatCtrl) TriggerByAuraState(state int32, add bool)
------------------------------------------------------------------------------- aura state改变触发 -------------------------------------------------------------------------------
func (*CombatCtrl) TriggerByBehaviour ¶
func (c *CombatCtrl) TriggerByBehaviour(behaviour define.EBehaviourType, target SceneUnit, procCaster, procEx uint32, spellType define.ESpellType) (triggerCount int32)
------------------------------------------------------------------------------- 行为触发 -------------------------------------------------------------------------------
func (*CombatCtrl) TriggerByDmgMod ¶
func (c *CombatCtrl) TriggerByDmgMod(caster bool, target SceneUnit, dmgInfo *CalcDamageInfo)
func (*CombatCtrl) TriggerByServentState ¶
func (c *CombatCtrl) TriggerByServentState(state define.EHeroState, add bool)
------------------------------------------------------------------------------- 状态改变触发 -------------------------------------------------------------------------------
func (*CombatCtrl) TriggerBySpellResult ¶
func (c *CombatCtrl) TriggerBySpellResult(isCaster bool, target SceneUnit, dmgInfo *CalcDamageInfo)
------------------------------------------------------------------------------- 技能结果触发 -------------------------------------------------------------------------------
func (*CombatCtrl) UnregisterAura ¶
func (c *CombatCtrl) UnregisterAura(aura *Aura)
func (*CombatCtrl) Update ¶
func (c *CombatCtrl) Update()
type Scene ¶
func (*Scene) SendDamage ¶
func (s *Scene) SendDamage(dmgInfo *CalcDamageInfo)
type SceneCreature ¶
type SceneCreature struct {
// contains filtered or unexported fields
}
func (*SceneCreature) BeatBack ¶
func (h *SceneCreature) BeatBack(target SceneUnit)
func (*SceneCreature) CombatCtrl ¶
func (c *SceneCreature) CombatCtrl() *CombatCtrl
func (*SceneCreature) DoneDamage ¶
func (h *SceneCreature) DoneDamage(caster SceneUnit, dmgInfo *CalcDamageInfo)
func (*SceneCreature) GetCamp ¶
func (c *SceneCreature) GetCamp() int32
func (*SceneCreature) GetLevel ¶
func (c *SceneCreature) GetLevel() uint32
func (*SceneCreature) GetScene ¶
func (c *SceneCreature) GetScene() *Scene
func (*SceneCreature) GetState64 ¶
func (h *SceneCreature) GetState64() uint64
func (*SceneCreature) Guid ¶
func (c *SceneCreature) Guid() uint64
func (*SceneCreature) HasImmunityAny ¶
func (h *SceneCreature) HasImmunityAny(tp define.EImmunityType, flag uint32) bool
func (*SceneCreature) HasState ¶
func (c *SceneCreature) HasState(e define.EHeroState) bool
func (*SceneCreature) HasStateAny ¶
func (h *SceneCreature) HasStateAny(flag uint32) bool
func (*SceneCreature) OnBeDamaged ¶
func (h *SceneCreature) OnBeDamaged(caster SceneUnit, dmgInfo *CalcDamageInfo)
func (*SceneCreature) OnDamage ¶
func (h *SceneCreature) OnDamage(target SceneUnit, dmgInfo *CalcDamageInfo)
func (*SceneCreature) Opts ¶
func (c *SceneCreature) Opts() *UnitOptions
func (*SceneCreature) UpdateSpell ¶
func (c *SceneCreature) UpdateSpell()
type SceneHero ¶
type SceneHero struct {
// contains filtered or unexported fields
}
func (*SceneHero) CombatCtrl ¶
func (h *SceneHero) CombatCtrl() *CombatCtrl
func (*SceneHero) DoneDamage ¶
func (h *SceneHero) DoneDamage(caster SceneUnit, dmgInfo *CalcDamageInfo)
func (*SceneHero) GetState64 ¶
func (*SceneHero) HasImmunityAny ¶
func (h *SceneHero) HasImmunityAny(tp define.EImmunityType, flag uint32) bool
func (*SceneHero) HasStateAny ¶
func (*SceneHero) OnBeDamaged ¶
func (h *SceneHero) OnBeDamaged(caster SceneUnit, dmgInfo *CalcDamageInfo)
func (*SceneHero) OnDamage ¶
func (h *SceneHero) OnDamage(target SceneUnit, dmgInfo *CalcDamageInfo)
func (*SceneHero) Opts ¶
func (h *SceneHero) Opts() *UnitOptions
func (*SceneHero) UpdateSpell ¶
func (h *SceneHero) UpdateSpell()
type SceneManager ¶
func NewSceneManager ¶
func NewSceneManager() *SceneManager
func (*SceneManager) CreateScene ¶
func (m *SceneManager) CreateScene(ctx context.Context, sceneId int64, sceneType int32, opts ...SceneOption) (*Scene, error)
func (*SceneManager) Exit ¶
func (m *SceneManager) Exit()
func (*SceneManager) GetScene ¶
func (m *SceneManager) GetScene(sceneId int64) *Scene
type SceneOption ¶
type SceneOption func(*SceneOptions)
func WithSceneAttackId ¶
func WithSceneAttackId(id int64) SceneOption
func WithSceneAttackUnitList ¶
func WithSceneAttackUnitList(list []*pbCombat.UnitInfo) SceneOption
func WithSceneDefenceId ¶
func WithSceneDefenceId(id int64) SceneOption
func WithSceneDefenceUnitList ¶
func WithSceneDefenceUnitList(list []*pbCombat.UnitInfo) SceneOption
func WithSceneEntry ¶
func WithSceneEntry(entry *define.SceneEntry) SceneOption
type SceneOptions ¶
type SceneOptions struct { AttackId int64 DefenceId int64 AttackUnitList []*pbCombat.UnitInfo DefenceUnitList []*pbCombat.UnitInfo Entry *define.SceneEntry }
func DefaultSceneOptions ¶
func DefaultSceneOptions() *SceneOptions
type SceneUnit ¶
type SceneUnit interface { Guid() uint64 GetLevel() uint32 GetScene() *Scene GetCamp() int32 UpdateSpell() CombatCtrl() *CombatCtrl Opts() *UnitOptions HasState(define.EHeroState) bool HasStateAny(uint32) bool HasImmunityAny(define.EImmunityType, uint32) bool GetState64() uint64 BeatBack(SceneUnit) DoneDamage(SceneUnit, *CalcDamageInfo) OnDamage(SceneUnit, *CalcDamageInfo) OnBeDamaged(SceneUnit, *CalcDamageInfo) }
type Spell ¶
type Spell struct {
// contains filtered or unexported fields
}
func NewSpell ¶
func NewSpell(opts ...SpellOption) *Spell
type SpellOption ¶
type SpellOption func(*SpellOptions)
func WithSpellAmount ¶
func WithSpellAmount(amount int32) SpellOption
func WithSpellCaster ¶
func WithSpellCaster(caster SceneUnit) SpellOption
func WithSpellEntry ¶
func WithSpellEntry(entry *define.SpellEntry) SpellOption
func WithSpellLevel ¶
func WithSpellLevel(level uint32) SpellOption
func WithSpellTarget ¶
func WithSpellTarget(target SceneUnit) SpellOption
func WithSpellTriggered ¶
func WithSpellTriggered(triggered bool) SpellOption
func WithSpellType ¶
func WithSpellType(tp define.ESpellType) SpellOption
type SpellOptions ¶
type SpellOptions struct { Caster SceneUnit Target SceneUnit Triggered bool Amount int32 SpellType define.ESpellType Level uint32 Entry *define.SpellEntry }
func DefaultSpellOptions ¶
func DefaultSpellOptions() *SpellOptions
type UnitOption ¶
type UnitOption func(*UnitOptions)
func WithAttManager ¶
func WithAttManager(attId int32) UnitOption
func WithUnitAttList ¶
func WithUnitAttList(attList []*pbGame.Att) UnitOption
func WithUnitAttValue ¶
func WithUnitAttValue(value []int64) UnitOption
func WithUnitCombatCtrl ¶
func WithUnitCombatCtrl(ctrl *CombatCtrl) UnitOption
func WithUnitEntry ¶
func WithUnitEntry(entry *define.UnitEntry) UnitOption
func WithUnitPosition ¶
func WithUnitPosition(pos []float32) UnitOption
func WithUnitPositionString ¶
func WithUnitPositionString(pos string) UnitOption
func WithUnitScene ¶
func WithUnitScene(scene *Scene) UnitOption
func WithUnitTypeId ¶
func WithUnitTypeId(typeId int32) UnitOption
type UnitOptions ¶
type UnitOptions struct { TypeId int32 AttValue []int64 Position [3]float32 Entry *define.UnitEntry AttManager *att.AttManager Scene *Scene CombatCtrl *CombatCtrl State *bitset.BitSet Immunity [define.ImmunityType_End]*bitset.BitSet }
func DefaultUnitOptions ¶
func DefaultUnitOptions() *UnitOptions