feat: 添加技能效果及宠物性别注释
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

This commit is contained in:
xinian
2026-03-07 15:15:15 +08:00
committed by cnb
parent de8ce9fc81
commit bf2325e2ef
5 changed files with 114 additions and 2 deletions

View 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
}

View 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
}

View 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
}

View File

@@ -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
})

View File

@@ -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:"世代" `