feat: 添加技能效果及宠物性别注释
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
This commit is contained in:
37
logic/service/fight/effect/effect_413.go
Normal file
37
logic/service/fight/effect/effect_413.go
Normal file
@@ -0,0 +1,37 @@
|
||||
package effect
|
||||
|
||||
import (
|
||||
"blazing/logic/service/fight/info"
|
||||
"blazing/logic/service/fight/input"
|
||||
"blazing/logic/service/fight/node"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
||||
input.InitEffect(input.EffectType.Skill, 413, &Effect413{
|
||||
EffectNode: node.EffectNode{},
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
type Effect413 struct {
|
||||
node.EffectNode
|
||||
}
|
||||
|
||||
func (e *Effect413) OnSkill() bool {
|
||||
var isprop bool
|
||||
for _, v := range e.Ctx().Opp.Prop {
|
||||
if v > 0 {
|
||||
isprop = true
|
||||
}
|
||||
}
|
||||
|
||||
if isprop {
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
|
||||
Type: info.DamageType.Fixed,
|
||||
Damage: e.Ctx().Opp.CurrentPet.GetHP().Div(e.Args()[0]),
|
||||
})
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
43
logic/service/fight/effect/effect_426.go
Normal file
43
logic/service/fight/effect/effect_426.go
Normal file
@@ -0,0 +1,43 @@
|
||||
package effect
|
||||
|
||||
import (
|
||||
"blazing/logic/service/fight/input"
|
||||
"blazing/logic/service/fight/node"
|
||||
)
|
||||
|
||||
func init() {
|
||||
t := &Effect426{
|
||||
EffectNode: node.EffectNode{},
|
||||
}
|
||||
|
||||
input.InitEffect(input.EffectType.Skill, 426, t)
|
||||
|
||||
}
|
||||
|
||||
type Effect426 struct {
|
||||
node.EffectNode
|
||||
}
|
||||
|
||||
// 默认添加回合
|
||||
func (e *Effect426) SetArgs(t *input.Input, a ...int) {
|
||||
|
||||
e.EffectNode.SetArgs(t, a...)
|
||||
e.EffectNode.Duration(e.EffectNode.SideEffectArgs[0])
|
||||
|
||||
}
|
||||
|
||||
func (e *Effect426) SkillHit_ex() bool {
|
||||
|
||||
//fmt.Println(e.Ctx().SkillEntity)
|
||||
if e.Ctx().SkillEntity == nil {
|
||||
return true
|
||||
}
|
||||
success, _, _ := e.Input.Player.Roll(int(e.Args()[1].IntPart()), 100)
|
||||
if !success {
|
||||
return true
|
||||
}
|
||||
|
||||
e.Ctx().SkillEntity.SetMiss()
|
||||
|
||||
return true
|
||||
}
|
||||
32
logic/service/fight/effect/effect_82.go
Normal file
32
logic/service/fight/effect/effect_82.go
Normal file
@@ -0,0 +1,32 @@
|
||||
package effect
|
||||
|
||||
import (
|
||||
"blazing/logic/service/fight/info"
|
||||
"blazing/logic/service/fight/input"
|
||||
"blazing/logic/service/fight/node"
|
||||
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
func init() {
|
||||
input.InitEffect(input.EffectType.Skill, 82, &Effect82{})
|
||||
|
||||
}
|
||||
|
||||
type Effect82 struct {
|
||||
node.EffectNode
|
||||
can bool
|
||||
}
|
||||
|
||||
func (e *Effect82) Damage_Mul(t *info.DamageZone) bool {
|
||||
if t.Type != info.DamageType.Red {
|
||||
return true
|
||||
}
|
||||
if e.Ctx().Opp.CurrentPet.Info.Gender == 1 {
|
||||
t.Damage = t.Damage.Mul(alpacadecimal.NewFromInt(2))
|
||||
}
|
||||
if e.Ctx().Opp.CurrentPet.Info.Gender == 2 {
|
||||
t.Damage = t.Damage.Div(alpacadecimal.NewFromInt(2))
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -70,7 +70,7 @@ func init() {
|
||||
registerStatusFunc(102, func(i, o *input.Input) bool {
|
||||
return o.StatEffect_Exist(info.PetStatus.Paralysis)
|
||||
})
|
||||
|
||||
initskill(129, &Effect129{})
|
||||
registerStatusFunc(132, func(i, o *input.Input) bool {
|
||||
return i.CurrentPet.Info.Hp < o.CurrentPet.Info.Hp
|
||||
})
|
||||
|
||||
@@ -53,7 +53,7 @@ type PetInfo struct {
|
||||
|
||||
// 名字:默认为全0,补齐到16字节(固定长度 → [16]byte)
|
||||
Name string `struc:"[16]byte" json:"Name,omitempty"`
|
||||
Gender int `struc:"uint16" fieldDesc:"性别" `
|
||||
Gender int `struc:"uint16" fieldDesc:"性别" ` //0:无性别,1:雄性, 2:雌性
|
||||
//generation
|
||||
|
||||
Generation uint16 `fieldDesc:"世代" `
|
||||
|
||||
Reference in New Issue
Block a user