技能实现
This commit is contained in:
@@ -13,7 +13,7 @@ type Effect10 struct {
|
|||||||
|
|
||||||
func newp(t1 info.EnumBattleStatus) *Effect10 {
|
func newp(t1 info.EnumBattleStatus) *Effect10 {
|
||||||
t := &Effect10{
|
t := &Effect10{
|
||||||
Status: info.PetStatus.Paralysis,
|
Status: t1,
|
||||||
}
|
}
|
||||||
t.Effect = t
|
t.Effect = t
|
||||||
return t
|
return t
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package effect
|
package effect
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"blazing/logic/service/fight/info"
|
|
||||||
"blazing/logic/service/fight/input"
|
"blazing/logic/service/fight/input"
|
||||||
"blazing/logic/service/fight/node"
|
"blazing/logic/service/fight/node"
|
||||||
)
|
)
|
||||||
@@ -32,8 +31,9 @@ func init() {
|
|||||||
Max: 180,
|
Max: 180,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
func (e *Effect61) PreSkill(opp *input.Input, skill *info.SkillEntity) {
|
func (e *Effect61) Skill_Hit(ctx input.Ctx) bool {
|
||||||
|
|
||||||
skill.Power = int(e.Input.FightC.GetRand().Int31n(int32(e.Max)-int32(e.Min)+1) + int32(e.Min))
|
ctx.SkillEntity.Power = int(e.Input.FightC.GetRand().Int31n(int32(e.Max)-int32(e.Min)+1) + int32(e.Min))
|
||||||
|
return true
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package effect
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"blazing/common/utils"
|
"blazing/common/utils"
|
||||||
"blazing/logic/service/fight/info"
|
|
||||||
"blazing/logic/service/fight/input"
|
"blazing/logic/service/fight/input"
|
||||||
"blazing/logic/service/fight/node"
|
"blazing/logic/service/fight/node"
|
||||||
)
|
)
|
||||||
@@ -24,18 +23,18 @@ type Effect9 struct {
|
|||||||
UseSkillCount int //技能使用了多少次,切换后置0
|
UseSkillCount int //技能使用了多少次,切换后置0
|
||||||
}
|
}
|
||||||
|
|
||||||
func (e *Effect9) PreSkill(opp *input.Input, skill *info.SkillEntity) {
|
func (e *Effect9) Skill_Hit(ctx input.Ctx) bool {
|
||||||
if e.Skillid != 0 && skill.ID != e.Skillid {
|
if e.Skillid != 0 && ctx.SkillEntity.ID != e.Skillid {
|
||||||
e.NotALive()
|
e.NotALive()
|
||||||
e.UseSkillCount = 0
|
e.UseSkillCount = 0
|
||||||
return
|
return true
|
||||||
|
|
||||||
}
|
}
|
||||||
e.Skillid = skill.ID
|
e.Skillid = ctx.SkillEntity.ID
|
||||||
add := e.EffectNode.SideEffectArgs[0] * e.UseSkillCount
|
add := e.EffectNode.SideEffectArgs[0] * e.UseSkillCount
|
||||||
|
|
||||||
skill.Power += utils.Min(add, e.EffectNode.SideEffectArgs[1])
|
ctx.SkillEntity.Power += utils.Min(add, e.EffectNode.SideEffectArgs[1])
|
||||||
|
|
||||||
e.UseSkillCount++
|
e.UseSkillCount++
|
||||||
|
return true
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ func (u *Input) Damage(ctx Ctx) {
|
|||||||
}
|
}
|
||||||
ctx.Input.DamageZone.BeforeLocked = ctx.DamageZone.Damage
|
ctx.Input.DamageZone.BeforeLocked = ctx.DamageZone.Damage
|
||||||
if ok {
|
if ok {
|
||||||
ok = u.Exec(func(t Effect) bool {
|
u.Exec(func(t Effect) bool {
|
||||||
|
|
||||||
t.Damage_Locked(ctx)
|
t.Damage_Locked(ctx)
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import (
|
|||||||
"blazing/logic/service/fight/info"
|
"blazing/logic/service/fight/info"
|
||||||
|
|
||||||
"blazing/modules/blazing/model"
|
"blazing/modules/blazing/model"
|
||||||
"reflect"
|
|
||||||
|
|
||||||
"github.com/brunoga/deep"
|
"github.com/brunoga/deep"
|
||||||
"github.com/tnnmigga/enum"
|
"github.com/tnnmigga/enum"
|
||||||
@@ -104,23 +103,6 @@ func (c *Input) GetCurrAttr(id int) *model.PetInfo {
|
|||||||
|
|
||||||
//todo 获取后GetEffect
|
//todo 获取后GetEffect
|
||||||
}
|
}
|
||||||
func getTypeName(v interface{}) string {
|
|
||||||
// 获取类型信息
|
|
||||||
t := reflect.TypeOf(v)
|
|
||||||
|
|
||||||
// 如果是指针类型,需要先获取其指向的元素类型
|
|
||||||
if t.Kind() == reflect.Ptr {
|
|
||||||
t = t.Elem()
|
|
||||||
}
|
|
||||||
|
|
||||||
// 如果是结构体类型,返回其名称
|
|
||||||
if t.Kind() == reflect.Struct {
|
|
||||||
return t.Name()
|
|
||||||
}
|
|
||||||
|
|
||||||
// 非结构体类型返回空或对应的类型名
|
|
||||||
return t.Kind().String()
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *Input) AddEffect(e *EffectID) {
|
func (c *Input) AddEffect(e *EffectID) {
|
||||||
if e.ID == 0 {
|
if e.ID == 0 {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ func (e *EffectNode) OnSwitchIn(ctx input.Ctx) bool {
|
|||||||
|
|
||||||
func (e *EffectNode) OnSwitchOut(ctx input.Ctx) bool {
|
func (e *EffectNode) OnSwitchOut(ctx input.Ctx) bool {
|
||||||
//下场默认清除effect
|
//下场默认清除effect
|
||||||
if e.Owner { //清除对方的我方施加uff
|
if e.GetInput().UserID == ctx.Player.GetInfo().UserID { //清除对方的我方施加uff
|
||||||
e.NotALive()
|
e.NotALive()
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
|
|||||||
Reference in New Issue
Block a user