79 lines
1.5 KiB
Go
79 lines
1.5 KiB
Go
package skill
|
||
|
||
import (
|
||
"go_dreamfactory/modules/battle/fight/core"
|
||
cfg "go_dreamfactory/sys/configure/structs"
|
||
)
|
||
|
||
/// <summary>
|
||
/// 主动/队长技能
|
||
/// </summary>
|
||
/// <remarks>
|
||
/// 遍历触发子技能
|
||
/// </remarks>
|
||
type FightSkill struct {
|
||
OwnerRole core.IFightRole
|
||
CD int32
|
||
SkillConf *cfg.GameSkillAtkData
|
||
}
|
||
|
||
/// <summary>
|
||
/// 触发
|
||
/// 遍历所有ChildSkills,生成对应的实例,并Emit触发
|
||
/// </summary>
|
||
func (this *FightSkill) Emit() {
|
||
|
||
}
|
||
|
||
/// <summary>
|
||
/// 减少CD回合数
|
||
/// </summary>
|
||
/// <returns>新的回合数</returns>
|
||
func (this *FightSkill) MinusCD(val int32) int32 {
|
||
if this.CD > 0 {
|
||
this.CD -= val
|
||
if this.CD < 0 {
|
||
this.CD = 0
|
||
}
|
||
this.SetCD(this.CD)
|
||
}
|
||
return this.CD
|
||
}
|
||
|
||
/// <summary>
|
||
/// 增加CD回合数
|
||
/// </summary>
|
||
/// <returns>新的回合数</returns>
|
||
func (this *FightSkill) ResetCD() int32 {
|
||
this.CD = this.SkillConf.CD
|
||
this.SetCD(this.CD)
|
||
return this.CD
|
||
}
|
||
|
||
/// <summary>
|
||
/// 设置CD回合数为新的值
|
||
/// </summary>
|
||
/// <param name="newVal"></param>
|
||
/// <returns></returns>
|
||
func (this *FightSkill) SetCD(newVal int32) int32 {
|
||
this.CD = newVal
|
||
//记录战报
|
||
com := new(core.ComSetSkillCD)
|
||
com.From = this.OwnerRole.GetData().Rid
|
||
com.Skillid = this.SkillConf.Id
|
||
com.Nv = byte(newVal)
|
||
// this.OwnerRole.GetFightBase().FightLog.AddCommand(com)
|
||
|
||
return this.CD
|
||
}
|
||
|
||
/// <summary>发送技能日志</summary>
|
||
func (this *FightSkill) Clear() {
|
||
|
||
}
|
||
|
||
/// <summary>发送技能日志</summary>
|
||
func (this *FightSkill) SendSkillLog() {
|
||
|
||
}
|