scene

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2020 License: MIT Imports: 19 Imported by: 0

Documentation

Index

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 EffectAddAura

func EffectAddAura(spell *Spell, index int32, target SceneUnit) error

3 添加aura

func EffectAddLevelAura

func EffectAddLevelAura(spell *Spell, index int32, target SceneUnit) error

15 根据目标等级添加Aura

func EffectAddStateAura

func EffectAddStateAura(spell *Spell, index int32, target SceneUnit) error

17 添加状态类Aura,并计算状态抗性

func EffectAddWrapAura

func EffectAddWrapAura(spell *Spell, index int32, target SceneUnit) error

22 添加可叠加buff

func EffectAuraNumDmg

func EffectAuraNumDmg(spell *Spell, index int32, target SceneUnit) error

10 根据buff数量计算伤害

func EffectAverageHP

func EffectAverageHP(spell *Spell, index int32, target SceneUnit) error

9 平均血量

func EffectCastSpell

func EffectCastSpell(spell *Spell, index int32, target SceneUnit) error

6 施放技能

func EffectCasterAttDamage

func EffectCasterAttDamage(spell *Spell, index int32, target SceneUnit) error

12 根据施放者某一属性计算伤害

func EffectChangeRageSpell

func EffectChangeRageSpell(spell *Spell, index int32, target SceneUnit) error

21 替换英雄怒气技能

func EffectDamage

func EffectDamage(spell *Spell, index int32, target SceneUnit) error

1 伤害

func EffectDamageRaceMod

func EffectDamageRaceMod(spell *Spell, index int32, target SceneUnit) error

13 种族加成伤害

func EffectDispel

func EffectDispel(spell *Spell, index int32, target SceneUnit) error

7 驱散

func EffectDispelAndWeak

func EffectDispelAndWeak(spell *Spell, index int32, target SceneUnit) error

14 驱散虚弱

func EffectEnrage

func EffectEnrage(spell *Spell, index int32, target SceneUnit) error

5 激怒

func EffectHeal

func EffectHeal(spell *Spell, index int32, target SceneUnit) error

2 治疗

func EffectLevelEnrage

func EffectLevelEnrage(spell *Spell, index int32, target SceneUnit) error

16 根据目标等级激怒

func EffectModAuraDuration

func EffectModAuraDuration(spell *Spell, index int32, target SceneUnit) error

8 强化aura作用时间

func EffectModPctCurHP

func EffectModPctCurHP(spell *Spell, index int32, target SceneUnit) error

23 百分比修改目标当前血量

func EffectNull

func EffectNull(spell *Spell, index int32, target SceneUnit) error

0 无效果

func EffectPetDamage

func EffectPetDamage(spell *Spell, index int32, target SceneUnit) error

19 宠物伤害

func EffectPetHeal

func EffectPetHeal(spell *Spell, index int32, target SceneUnit) error

20 宠物治疗

func EffectPlacate

func EffectPlacate(spell *Spell, index int32, target SceneUnit) error

4 安抚

func EffectRandAura

func EffectRandAura(spell *Spell, index int32, target SceneUnit) error

18 添加随机buff

func EffectTargetAttDamage

func EffectTargetAttDamage(spell *Spell, index int32, target SceneUnit) error

11 根据目标某一属性计算伤害

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 (a *Aura) CalcApplyEffect(register bool, sync bool)

------------------------------------------------------------------------------- 计算效果 -------------------------------------------------------------------------------

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 (a *Aura) IsApplyLockValid() bool

func (*Aura) IsApplyLocked

func (a *Aura) IsApplyLocked() bool

func (*Aura) IsHangup

func (a *Aura) IsHangup() bool

func (*Aura) IsRemoved

func (a *Aura) IsRemoved() bool

func (*Aura) ModDuration

func (a *Aura) ModDuration(modDuration uint32)

------------------------------------------------------------------------------- 强化Aura作用时间 -------------------------------------------------------------------------------

func (*Aura) MorePowerfulThan

func (a *Aura) MorePowerfulThan(aura *Aura) bool

------------------------------------------------------------------------------- 等级比较 -------------------------------------------------------------------------------

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 AuraTrigger struct {
	Aura     *Aura
	EffIndex int32
}

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

type Scene struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func (*Scene) Exit

func (s *Scene) Exit(ctx context.Context)

func (*Scene) GetID

func (s *Scene) GetID() int64

func (*Scene) GetResult

func (s *Scene) GetResult() bool

func (*Scene) IsOnlyRecord

func (s *Scene) IsOnlyRecord() bool

todo

func (*Scene) Main

func (s *Scene) Main(ctx context.Context) error

func (*Scene) Rand

func (s *Scene) Rand(min, max int) int

func (*Scene) Run

func (s *Scene) Run(ctx context.Context) error

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) BeatBack

func (h *SceneHero) BeatBack(target SceneUnit)

func (*SceneHero) CombatCtrl

func (h *SceneHero) CombatCtrl() *CombatCtrl

func (*SceneHero) DoneDamage

func (h *SceneHero) DoneDamage(caster SceneUnit, dmgInfo *CalcDamageInfo)

func (*SceneHero) GetCamp

func (h *SceneHero) GetCamp() int32

func (*SceneHero) GetLevel

func (h *SceneHero) GetLevel() uint32

func (*SceneHero) GetScene

func (h *SceneHero) GetScene() *Scene

func (*SceneHero) GetState64

func (h *SceneHero) GetState64() uint64

func (*SceneHero) Guid

func (h *SceneHero) Guid() uint64

func (*SceneHero) HasImmunityAny

func (h *SceneHero) HasImmunityAny(tp define.EImmunityType, flag uint32) bool

func (*SceneHero) HasState

func (h *SceneHero) HasState(e define.EHeroState) bool

func (*SceneHero) HasStateAny

func (h *SceneHero) HasStateAny(flag uint32) bool

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

type SceneManager struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

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

func (*SceneManager) Main

func (m *SceneManager) Main(ctx context.Context) error

func (*SceneManager) Run

func (m *SceneManager) Run(ctx context.Context) error

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

func (*Spell) CanCast

func (s *Spell) CanCast() error

------------------------------------------------------------------------------- 施放检查 -------------------------------------------------------------------------------

func (*Spell) Cast

func (s *Spell) Cast()

------------------------------------------------------------------------------- 技能施放 -------------------------------------------------------------------------------

type SpellEffectsHandler

type SpellEffectsHandler func(*Spell, int32, SceneUnit) error

技能效果处理函数

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

Jump to

Keyboard shortcuts

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