go_dreamfactory/modules/battle/fight/skill/fightskill.go
2022-09-14 11:31:00 +08:00

79 lines
1.5 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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() {
}