根据提供的code differences信息,我无法看到具体的代码变更内容。由于code differences部分为空白,我将提供一个通用的示例格式:
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

```
docs(readme): 更新文档说明

- 添加了项目使用说明
- 补充了配置项解释
- 修正了错误的示例代码
```

注意:由于没有具体的代码差异信息,无法生成准确的commit
This commit is contained in:
昔念
2026-03-09 22:36:30 +08:00
parent d360a85963
commit ce279cd992
27 changed files with 575 additions and 377 deletions

File diff suppressed because one or more lines are too long

View File

@@ -19,12 +19,20 @@ func (h Controller) HanLiuQiang(data *C2S_2608, c *player.Player) (result *fight
return
}
if cool.Config.ServerInfo.IsVip != 0 {
c.ItemAdd(500655, 1)
pet := model.GenPetInfo(315, 31, -1, -1, 100, nil, 0)
pet.FixShiny()
c.Service.Pet.PetAdd(pet)
if cool.Config.ServerInfo.IsVip == 0 {
return
}
c.ItemAdd(500655, 1)
pet := model.GenPetInfo(426, 31, -1, -1, 100, nil, 0)
c.Service.Pet.PetAdd(pet)
pet = model.GenPetInfo(1567, 31, -1, -1, 100, nil, 0)
c.Service.Pet.PetAdd(pet)
pet = model.GenPetInfo(505, 31, -1, -1, 100, nil, 0)
c.Service.Pet.PetAdd(pet)
return result, -1
}

View File

@@ -0,0 +1,46 @@
package effect
import (
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
)
// 1044 - 吸取对手能力提升状态吸取成功则下n回合造成的伤害翻倍
type Effect1044 struct {
node.EffectNode
damageMultiplierActive bool
multiplierDuration int
}
func (e *Effect1044) OnSkill() bool {
// 检查对手是否有能力提升状态可以吸取
var sub bool
for i, v := range e.Ctx().Opp.Prop[:] {
if v > 0 {
sub = true
e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), v)
e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), 0)
}
}
if sub {
e.GenSub(&Effect1044_sub{}, int(e.Args()[1].IntPart()))
}
return true
}
type Effect1044_sub struct {
node.EffectNode
}
func (e *Effect1044_sub) Damage_Mul(_ *info.DamageZone) bool {
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 1044, &Effect1044{})
}

View File

@@ -0,0 +1,52 @@
package effect
import (
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
)
// 156 - n回合内使得对手所有能力增强效果失效
type Effect156 struct {
node.EffectNode
}
func (e *Effect156) Skill_Use() bool {
for i, v := range e.Ctx().Opp.Prop[:] {
if v > 0 {
e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), 0)
}
}
e.Ctx().Opp.AddEffect(e.Ctx().Our, e.GenSub(&Effect156_sub{}, e.SideEffectArgs[0]))
return true
}
type Effect156_sub struct {
node.EffectNode
duy int
//bindpet *info.BattlePetEntity
//bind *input.Input
// Hide bool // 是否隐藏 正常是命中就可用,镇魂歌是回合数到才可用
}
func (e *Effect156_sub) EFFect_Befer(in *input.Input, effEffect input.Effect) bool {
if in != e.Ctx().Our {
return true
}
if input.IS_Stat(effEffect) {
return false
}
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 156, &Effect156{})
}

View File

@@ -0,0 +1,39 @@
package effect
import (
"blazing/logic/service/fight/action"
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
"github.com/alpacahq/alpacadecimal"
)
// 170 - 若先出手则免疫当回合伤害并回复1/n的最大体力值
type Effect170 struct {
node.EffectNode
}
func (e *Effect170) Skill_Use() bool {
if e.IsFirst() { // 先出手
// 回复1/n的最大体力值
maxHp := e.Ctx().Our.CurrentPet.GetMaxHP()
healAmount := maxHp.Div(e.Args()[1]) // 1/n
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, healAmount)
}
return true
}
func (e *Effect170) DamageLockEx(t *info.DamageZone) bool {
if e.IsFirst() && t.Type == info.DamageType.Red { // 先出手
t.Damage = alpacadecimal.Zero
}
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 170, &Effect170{})
}

View File

@@ -0,0 +1,31 @@
package effect
import (
"blazing/logic/service/fight/action"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
)
// 177 - n回合内若对手MISS则自身恢复1/m的最大体力值
type Effect177 struct {
node.EffectNode
}
func (e *Effect177) Skill_Use_ex() bool {
if e.Ctx().SkillEntity != nil && e.Ctx().SkillEntity.AttackTime == 0 {
maxHp := e.Ctx().Our.CurrentPet.GetMaxHP()
healAmount := maxHp.Div(e.Args()[1]) // 1/m
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, healAmount)
}
return true
}
func (e *Effect177) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.EffectNode.Duration(a[0]) // 持续n回合
}
func init() {
input.InitEffect(input.EffectType.Skill, 177, &Effect177{})
}

View File

@@ -0,0 +1,31 @@
package effect
import (
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
)
// 188 - 若对手处于异常状态,则威力翻倍并消除对手相应的防御能力提升效果
type Effect188 struct {
node.EffectNode
}
func (e *Effect188) SkillHit() bool {
if e.Ctx().SkillEntity == nil {
return true
}
if e.Ctx().Opp.StatEffect_Exist_all() { // 对手处于异常状态
// 威力翻倍
e.Ctx().SkillEntity.XML.Power *= 2
// 消除对手相应的防御能力提升效果
e.Ctx().Opp.SetProp(e.Ctx().Our, 1, 0)
}
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 188, &Effect188{})
}

View File

@@ -0,0 +1,34 @@
package effect
import (
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
)
// 420 - 使用了该技能后,若受到消除强化类技能攻击,则对方则对方攻击和特攻等级+/-n
type Effect420 struct {
node.EffectNode
}
func (e *Effect420) PropBefer(in *input.Input, prop int8, level int8) bool {
if in == e.Ctx().Our {
return true
}
//能力下降类
if level == 0 {
e.Ctx().Opp.SetProp(e.Ctx().Our, 0, int8(e.SideEffectArgs[0]))
e.Ctx().Opp.SetProp(e.Ctx().Our, 1, int8(e.SideEffectArgs[0]))
}
return true
}
func (e *Effect420) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.EffectNode.Duration(-1) // 持续n回合
}
func init() {
input.InitEffect(input.EffectType.Skill, 420, &Effect420{})
}

View File

@@ -0,0 +1,31 @@
package effect
import (
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
"github.com/gogf/gf/v2/util/grand"
)
// 425 - 随机使对手n项属性m并将该属性附加给自己
type Effect425 struct {
node.EffectNode
}
func (e *Effect425) Skill_Use() bool {
numStats := int(e.Args()[0].IntPart()) // n项属性
changeValue := int8(e.Args()[1].IntPart()) // m
// 随机选择n项属性
for i := 0; i < numStats; i++ {
t := int8(grand.Intn(6))
e.Ctx().Opp.SetProp(e.Ctx().Our, t, changeValue)
e.Ctx().Our.SetProp(e.Ctx().Our, t, -changeValue)
}
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 425, &Effect425{})
}

View File

@@ -12,11 +12,13 @@ type Effect456 struct {
}
func (e *Effect456) OnSkill() bool {
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
if e.Ctx().Opp.CurrentPet.GetHP().Cmp(e.Args()[0]) > 0 {
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
Type: info.DamageType.Fixed,
Damage: e.Args()[0],
})
Type: info.DamageType.Fixed,
Damage: e.Args()[0],
})
}
return true
}

View File

@@ -16,7 +16,7 @@ type Effect461 struct {
func (e *Effect461) Skill_Use() bool {
maxHp := e.Ctx().Our.CurrentPet.GetMaxHP()
currentHp := e.Ctx().Our.CurrentPet.GetHP()
threshold := maxHp.Div(e.Args()[1]) // 1/m
threshold := maxHp.Div(e.Args()[0]) // 1/m
if currentHp.Cmp(threshold) < 0 {
e.can = true

View File

@@ -0,0 +1,38 @@
package effect
import (
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
"github.com/alpacahq/alpacadecimal"
)
// 462 - n回合内受攻击时反弹m点固定伤害
type Effect462 struct {
node.EffectNode
}
func (e *Effect462) Skill_Use_ex() bool {
// 反弹m点固定伤害
bounceDamage := alpacadecimal.NewFromInt(int64(e.Args()[1].IntPart()))
damageZone := &info.DamageZone{
Type: info.DamageType.Fixed,
Damage: alpacadecimal.Min(e.Ctx().Opp.SumDamage, bounceDamage),
}
e.Ctx().Opp.Damage(e.Ctx().Our, damageZone)
return true
}
func (e *Effect462) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.EffectNode.Duration(a[0]) // 持续n回合
}
func init() {
input.InitEffect(input.EffectType.Skill, 462, &Effect462{})
}

View File

@@ -0,0 +1,38 @@
package effect
import (
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
)
// 469 - m回合内若对手使用属性技能则n%几率另对手XX
type Effect469 struct {
node.EffectNode
}
func (e *Effect469) Skill_Use_ex() bool {
if e.Ctx().SkillEntity != nil && e.Ctx().SkillEntity.Category() == info.Category.STATUS {
chance := e.Args()[1].IntPart() // n%
success, _, _ := e.Input.Player.Roll(int(chance), 100)
if success {
effectType := int(e.Args()[2].IntPart()) // XX类型
statusEffect := e.Ctx().Our.InitEffect(input.EffectType.Status, effectType)
if statusEffect != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, statusEffect)
}
}
}
return true
}
func (e *Effect469) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.EffectNode.Duration(a[0]) // 持续m回合
}
func init() {
input.InitEffect(input.EffectType.Skill, 469, &Effect469{})
}

View File

@@ -0,0 +1,50 @@
package effect
import (
"blazing/logic/service/fight/action"
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
)
// 475 - 若造成的伤害不足m则下n回合的攻击必定致命一击
type Effect475 struct {
node.EffectNode
damageThreshold int
critDuration int
}
func (e *Effect475) Skill_Use() bool {
damageThreshold := int(e.Args()[0].IntPart())
damageDone := e.Ctx().Our.SumDamage
if damageDone.IntPart() < int64(damageThreshold) {
critDuration := int(e.Args()[1].IntPart())
e.GenSub(&Effect475_sub{}, critDuration)
}
return true
}
type Effect475_sub struct {
node.EffectNode
}
func (e *Effect475_sub) ActionStart(a, b *action.SelectSkillAction) bool {
//fmt.Println(e.Ctx().SkillEntity)
if e.Ctx().SkillEntity == nil {
return true
}
if e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
e.Ctx().SkillEntity.XML.CritRate = 16
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 475, &Effect475{})
}

View File

@@ -0,0 +1,28 @@
package effect
import (
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
)
// 483 - -1 -1 -1 -1 -1 -1后出手时弱化效果翻倍
type Effect483 struct {
node.EffectNode
}
func (e *Effect483) OnSkill() bool {
for i, v := range e.SideEffectArgs {
if !e.IsFirst() { // 后出手
v = v * 2
}
e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), int8(v))
}
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 483, &Effect483{})
}

View File

@@ -0,0 +1,37 @@
package effect
import (
"blazing/logic/service/fight/action"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
)
// 485 - 消除对手能力强化状态,若消除成功,则自身恢复所有体力
type Effect485 struct {
node.EffectNode
}
func (e *Effect485) Skill_Use() bool {
isfff := false
for i, v := range e.Ctx().Opp.Prop[:] {
if v > 0 {
isfff = true
e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), 0)
}
}
if isfff {
// 恢复自身所有体力
maxHp := e.Ctx().Our.CurrentPet.GetMaxHP()
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, maxHp)
}
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 485, &Effect485{})
}

View File

@@ -0,0 +1,36 @@
package effect
import (
"blazing/logic/service/fight/action"
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
)
// 492 - 2回合内若对手使用属性技能自身立刻恢复1/m体力且防御+x特防+y
type Effect492 struct {
node.EffectNode
}
func (e *Effect492) Skill_Use_ex() bool {
if e.Ctx().SkillEntity != nil && e.Ctx().SkillEntity.Category() == info.Category.STATUS {
// 恢复1/m体力
maxHp := e.Ctx().Our.CurrentPet.GetMaxHP()
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, maxHp.Div(e.Args()[1]))
e.Ctx().Our.SetProp(e.Ctx().Our, int8(e.Args()[2].IntPart()), int8(e.Args()[3].IntPart()))
e.Ctx().Our.SetProp(e.Ctx().Our, int8(e.Args()[4].IntPart()), int8(e.Args()[5].IntPart()))
}
return true
}
func (e *Effect492) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.EffectNode.Duration(a[0]) // 持续2回合
}
func init() {
input.InitEffect(input.EffectType.Skill, 492, &Effect492{})
}

View File

@@ -0,0 +1,29 @@
package effect
import (
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
)
// 516 - 1 1 1 1 1 1 1 体力低于1/n时强化效果翻倍
type Effect516 struct {
node.EffectNode
}
func (e *Effect516) Skill_Use() bool {
maxHp := e.Ctx().Our.CurrentPet.GetMaxHP()
currentHp := e.Ctx().Our.CurrentPet.GetHP()
threshold := maxHp.Div(e.Args()[6]) // 1/n
for i, v := range e.SideEffectArgs[:6] {
if currentHp.Cmp(threshold) < 0 {
v *= 2
}
e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), int8(v))
}
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 516, &Effect516{})
}

View File

@@ -1,84 +1,11 @@
package effect
import (
"blazing/logic/service/fight/action"
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
"github.com/alpacahq/alpacadecimal"
)
// 483 - -1 -1 -1 -1 -1 -1后出手时弱化效果翻倍
type Effect483 struct {
node.EffectNode
}
func (e *Effect483) OnSkill() bool {
if e.Ctx().Our.Speed < e.Ctx().Opp.Speed { // 后出手
// 这里是标记后出手时弱化效果翻倍的逻辑
// 实际的翻倍逻辑需要在应用弱化效果的地方实现
e.Ctx().Our.DoubleNegativeEffects = true
}
return true
}
// 485 - 消除对手能力强化状态,若消除成功,则自身恢复所有体力
type Effect485 struct {
node.EffectNode
}
func (e *Effect485) OnSkill() bool {
if !e.Hit() {
return true
}
// 检查是否有能力强化状态可以消除
if e.Ctx().Opp.CurrentPet.HasPositiveBuff() {
// 消除对手的能力强化状态
e.Ctx().Opp.RemoveAllPositiveBuffs()
// 恢复自身所有体力
maxHp := e.Ctx().Our.CurrentPet.GetMaxHP()
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, maxHp)
}
return true
}
// 188 - 若对手处于异常状态,则威力翻倍并消除对手相应的防御能力提升效果
type Effect188 struct {
node.EffectNode
}
func (e *Effect188) SkillHit() bool {
if e.Ctx().SkillEntity == nil {
return true
}
if e.Ctx().Opp.CurrentPet.HasAnyStatus() { // 对手处于异常状态
// 威力翻倍
e.Ctx().SkillEntity.Power *= 2
// 消除对手相应的防御能力提升效果
e.Ctx().Opp.RemovePositiveBuffs()
}
return true
}
// 420 - 使用了该技能后,若受到消除强化类技能攻击,则对方则对方攻击和特攻等级+/-n
type Effect420 struct {
node.EffectNode
}
func (e *Effect420) OnSkill() bool {
// 这里注册监听对手强化消除事件的逻辑
// 暂时使用一个flag标记
e.Ctx().Our.TriggerOnBuffRemoved = true
return true
}
// 407 - 下回合起每回合XX等级+n持续m回合
type Effect407 struct {
node.EffectNode
@@ -102,60 +29,6 @@ func (e *Effect407) OnSkill() bool {
return true
}
// 462 - n回合内受攻击时反弹m点固定伤害
type Effect462 struct {
node.EffectNode
}
func (e *Effect462) Skill_Use_ex() bool {
if !e.Hit() {
return true
}
// 反弹m点固定伤害
bounceDamage := alpacadecimal.NewFromInt(int64(e.Args()[1].IntPart()))
damageZone := &info.DamageZone{
Type: info.DamageType.Fixed,
Damage: bounceDamage,
}
e.Ctx().Opp.Damage(e.Ctx().Our, damageZone)
return true
}
func (e *Effect462) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.EffectNode.Duration(a[0]) // 持续n回合
}
// 1044 - 吸取对手能力提升状态吸取成功则下n回合造成的伤害翻倍
type Effect1044 struct {
node.EffectNode
damageMultiplierActive bool
multiplierDuration int
}
func (e *Effect1044) OnSkill() bool {
// 检查对手是否有能力提升状态可以吸取
if e.Ctx().Opp.CurrentPet.HasPositiveBuff() {
// 吸取对手的能力提升状态
e.Ctx().Our.StealPositiveBuffsFrom(e.Ctx().Opp)
// 下n回合造成的伤害翻倍
e.damageMultiplierActive = true
e.multiplierDuration = int(e.Args()[0].IntPart())
// 添加一个临时效果来处理伤害翻倍
damageDoubleEffect := e.Ctx().Our.InitEffect(input.EffectType.Status, int(info.PetStatus.DamageDouble))
if damageDoubleEffect != nil {
damageDoubleEffect.Duration(e.multiplierDuration)
e.Ctx().Our.AddEffect(e.Ctx().Our, damageDoubleEffect)
}
}
return true
}
// 523 - 若当回合未击败对手则自身1 1 1 1 1 1能力+1
type Effect523 struct {
node.EffectNode
@@ -186,51 +59,6 @@ func (e *Effect523) Action_end_ex() bool {
return true
}
// 177 - n回合内若对手MISS则自身恢复1/m的最大体力值
type Effect177 struct {
node.EffectNode
}
func (e *Effect177) Skill_Use_ex() bool {
if e.Ctx().Opp.LastAttackMissed {
maxHp := e.Ctx().Our.CurrentPet.GetMaxHP()
healAmount := maxHp.Div(e.Args()[1]) // 1/m
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, healAmount)
}
return true
}
func (e *Effect177) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.EffectNode.Duration(a[0]) // 持续n回合
}
// 475 - 若造成的伤害不足m则下n回合的攻击必定致命一击
type Effect475 struct {
node.EffectNode
damageThreshold int
critDuration int
}
func (e *Effect475) SkillHit_ex() bool {
damageThreshold := int(e.Args()[0].IntPart())
damageDone := e.Ctx().Our.SumDamage
if damageDone.IntPart() < int64(damageThreshold) {
critDuration := int(e.Args()[1].IntPart())
// 添加必定暴击效果
critEffect := e.Ctx().Our.InitEffect(input.EffectType.Status, int(info.PetStatus.MustCrit))
if critEffect != nil {
critEffect.Duration(critDuration)
e.Ctx().Our.AddEffect(e.Ctx().Our, critEffect)
}
}
return true
}
// 440 - n回合内对手使用技能消耗的PP值变为m倍
type Effect440 struct {
node.EffectNode
@@ -241,24 +69,6 @@ func (e *Effect440) SetArgs(t *input.Input, a ...int) {
e.EffectNode.Duration(a[0]) // 持续n回合
}
// 516 - 1 1 1 1 1 1 1 体力低于1/n时强化效果翻倍
type Effect516 struct {
node.EffectNode
}
func (e *Effect516) OnSkill() bool {
maxHp := e.Ctx().Our.CurrentPet.GetMaxHP()
currentHp := e.Ctx().Our.CurrentPet.GetHP()
threshold := maxHp.Div(e.Args()[0]) // 1/n
if currentHp.Cmp(threshold) < 0 {
// 体力低于1/n时设置强化效果翻倍
e.Ctx().Our.BoostPositiveEffects = true
}
return true
}
// 457 - 复制对手释放的技能(组队对战时无效)
type Effect457 struct {
node.EffectNode
@@ -276,41 +86,6 @@ func (e *Effect457) Skill_Use_ex() bool {
return true
}
// 492 - 2回合内若对手使用属性技能自身立刻恢复1/m体力且防御+x特防+y
type Effect492 struct {
node.EffectNode
}
func (e *Effect492) Skill_Use_ex() bool {
if e.Ctx().SkillEntity != nil && e.Ctx().SkillEntity.Category() == info.Category.STATUS {
// 恢复1/m体力
maxHp := e.Ctx().Our.CurrentPet.GetMaxHP()
healAmount := maxHp.Div(e.Args()[0])
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, healAmount)
// 防御+x
defUpEffect := e.Ctx().Our.InitEffect(input.EffectType.Status, int(info.PetStatus.DefUp))
if defUpEffect != nil {
defUpEffect.SetArgs(e.Ctx().Our, int(e.Args()[1].IntPart())) // x
e.Ctx().Our.AddEffect(e.Ctx().Our, defUpEffect)
}
// 特防+y
spDefUpEffect := e.Ctx().Our.InitEffect(input.EffectType.Status, int(info.PetStatus.SpDefUp))
if spDefUpEffect != nil {
spDefUpEffect.SetArgs(e.Ctx().Our, int(e.Args()[2].IntPart())) // y
e.Ctx().Our.AddEffect(e.Ctx().Our, spDefUpEffect)
}
}
return true
}
func (e *Effect492) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.EffectNode.Duration(2) // 持续2回合
}
// 138 - 先出手时n回合自己不会受到对手攻击性技能伤害并反弹对手1/n造成的伤害
type Effect138 struct {
node.EffectNode
@@ -340,50 +115,6 @@ func (e *Effect138) SetArgs(t *input.Input, a ...int) {
e.EffectNode.Duration(a[0]) // 持续n回合
}
// 469 - m回合内若对手使用属性技能则n%几率另对手XX
type Effect469 struct {
node.EffectNode
}
func (e *Effect469) Skill_Use_ex() bool {
if e.Ctx().SkillEntity != nil && e.Ctx().SkillEntity.Category() == info.Category.STATUS {
chance := e.Args()[1].IntPart() // n%
success, _, _ := e.Input.Player.Roll(int(chance), 100)
if success {
effectType := int(e.Args()[2].IntPart()) // XX类型
statusEffect := e.Ctx().Our.InitEffect(input.EffectType.Status, effectType)
if statusEffect != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, statusEffect)
}
}
}
return true
}
func (e *Effect469) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.EffectNode.Duration(a[0]) // 持续m回合
}
// 156 - n回合内使得对手所有能力增强效果失效
type Effect156 struct {
node.EffectNode
}
func (e *Effect156) OnSkill() bool {
// 使对手的所有能力增强效果失效
e.Ctx().Opp.DisablePositiveBuffs()
return true
}
func (e *Effect156) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.EffectNode.Duration(a[0]) // 持续n回合
}
// 197 - n回合内若被对方击败则对手所有能力加强状态消失
type Effect197 struct {
node.EffectNode
@@ -403,68 +134,6 @@ func (e *Effect197) SetArgs(t *input.Input, a ...int) {
e.EffectNode.Duration(a[0]) // 持续n回合
}
// 170 - 若先出手则免疫当回合伤害并回复1/n的最大体力值
type Effect170 struct {
node.EffectNode
}
func (e *Effect170) OnSkill() bool {
if e.Ctx().Our.Speed > e.Ctx().Opp.Speed { // 先出手
// 免疫当回合伤害
e.Ctx().Our.ImmuneDamageThisTurn = true
// 回复1/n的最大体力值
maxHp := e.Ctx().Our.CurrentPet.GetMaxHP()
healAmount := maxHp.Div(e.Args()[1]) // 1/n
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, healAmount)
}
return true
}
// 425 - 随机使对手n项属性m并将该属性附加给自己
type Effect425 struct {
node.EffectNode
}
func (e *Effect425) OnSkill() bool {
numStats := int(e.Args()[0].IntPart()) // n项属性
changeValue := int(e.Args()[1].IntPart()) // m
// 定义可变化的属性列表
stats := []int{
int(info.PetStatus.AtkUp),
int(info.PetStatus.DefUp),
int(info.PetStatus.SpAtkUp),
int(info.PetStatus.SpDefUp),
int(info.PetStatus.SpeedUp),
int(info.PetStatus.AccuracyUp),
}
// 随机选择n项属性
for i := 0; i < numStats && i < len(stats); i++ {
randomIndex := int(e.Input.FightC.GetRand().Int31n(int32(len(stats))))
selectedStat := stats[randomIndex]
// 对对手施加降低效果
oppEffect := e.Ctx().Our.InitEffect(input.EffectType.Status, selectedStat)
if oppEffect != nil {
oppEffect.SetArgs(e.Ctx().Our, -changeValue) // 负值表示降低
e.Ctx().Opp.AddEffect(e.Ctx().Our, oppEffect)
}
// 对自己施加提升效果
selfEffect := e.Ctx().Our.InitEffect(input.EffectType.Status, selectedStat)
if selfEffect != nil {
selfEffect.SetArgs(e.Ctx().Our, changeValue) // 正值表示提升
e.Ctx().Our.AddEffect(e.Ctx().Our, selfEffect)
}
}
return true
}
// 412 - 若自身体力小于1/n则每次攻击不消耗PP值
type Effect412 struct {
node.EffectNode

View File

@@ -28,7 +28,7 @@ func (e *Effect405) OnSkill() bool {
if e.IsFirst() == e.isfrist {
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
Type: info.DamageType.Fixed,
Damage: e.Ctx().Opp.CurrentPet.GetHP().Div(e.Args()[0]),
Damage: e.Args()[0],
})
}

View File

@@ -70,14 +70,8 @@ func (e *Effect62) OnSkill() bool {
// bind: ctx.Input,
}
ee.duy = e.EffectNode.SideEffectArgs[0]
ee.EffectNode.Duration(math.MaxInt) //给对方挂3回合子buff
tt := e.ID()
tt.SetEffectType(input.EffectType.Sub)
ee.ID(tt)
//e.e.EffectNode.Duration(e.EffectNode.SideEffectArgs[0])
//给对方添加我方施加的buff
ee.SetArgs(e.Ctx().Our, e.SideEffectArgs...)
e.GenSub(ee, math.MaxInt)
e.Ctx().Opp.AddEffect(e.Ctx().Our, ee)
return true
}

View File

@@ -28,16 +28,9 @@ func init() {
func (e *Effect69) OnSkill() bool {
t := &Effect69_sub{
e.Ctx().Opp.AddEffect(e.Ctx().Our, e.GenSub(&Effect69_sub{
EffectNode: node.EffectNode{},
}
tt := e.ID()
tt.SetEffectType(input.EffectType.Sub)
t.ID(tt)
t.SetArgs(e.Input, e.SideEffectArgs...)
t.Duration(e.SideEffectArgs[0])
e.Ctx().Opp.AddEffect(e.Ctx().Our, t)
}, e.SideEffectArgs[0]))
return true
}

View File

@@ -23,14 +23,14 @@ func init() {
// 命中之后
// 特攻+2速度+1命中+1
func (e *Effect79) Skill_Use() bool {
func (e *Effect79) OnSkill() bool {
e.Ctx().Our.SetProp(e.Ctx().Our, 2, 2)
e.Ctx().Our.SetProp(e.Ctx().Our, 4, 1)
e.Ctx().Our.SetProp(e.Ctx().Our, 5, 1)
e.Ctx().Our.Damage(e.Ctx().Our, &info.DamageZone{
Type: info.DamageType.Fixed,
Damage: alpacadecimal.NewFromInt(int64(e.Ctx().Our.CurrentPet.Info.MaxHp)).Div(alpacadecimal.NewFromInt(2)),
Damage: e.Ctx().Our.CurrentPet.GetHP().Div(alpacadecimal.NewFromInt(2)),
})
return true
}

View File

@@ -138,7 +138,7 @@ func (e *Effect144) EFFect_Befer(in *input.Input, effEffect input.Effect) bool {
* 牺牲全部体力造成对手250~300点伤害造成致命伤害时对手剩下1点体力
*/
type Effect112 struct {
SelfKill
node.EffectNode
}
func init() {
@@ -157,7 +157,7 @@ func (e *Effect112) Skill_Use() bool {
n := int64(e.Input.FightC.GetRand().Int31n(int32(50+1))) + 250
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
Type: info.DamageType.Fixed,
Damage: alpacadecimal.Max(alpacadecimal.NewFromInt(n), e.Ctx().Opp.CurrentPet.GetHP().Sub(alpacadecimal.NewFromInt(1))),
Damage: alpacadecimal.Min(alpacadecimal.NewFromInt(n), e.Ctx().Opp.CurrentPet.GetHP().Sub(alpacadecimal.NewFromInt(1))),
})
e.Ctx().Our.CurrentPet.NotAlive = true
return true

View File

@@ -46,10 +46,11 @@ func (f *FightC) processSkillAttack(attacker, defender *input.Input, skill *info
//技能失效+效果失效
attacker.AttackTime = skill.AttackTime
attacker.SkillID = uint32(skill.XML.ID) //获取技能ID
if skill.AttackTime != 0 { //如果命中
var SumDamage alpacadecimal.Decimal
if skill.AttackTime != 0 { //如果命中
attacker.CalculateCrit(defender, skill) //暴击计算
attacker.IsCritical = skill.Crit
attacker.SumDamage = attacker.CalculatePower(defender, skill)
SumDamage = attacker.CalculatePower(defender, skill)
}
//还原属性
@@ -64,7 +65,7 @@ func (f *FightC) processSkillAttack(attacker, defender *input.Input, skill *info
defender.Prop[3] = 0
}
//暴击翻倍
attacker.SumDamage = attacker.SumDamage.Mul(alpacadecimal.NewFromInt(2))
SumDamage = SumDamage.Mul(alpacadecimal.NewFromInt(2))
}
//到这里已经是强制miss或者命中,所以根本不存在强制miss改命中的情况,因为miss的时候不会执行到这里
@@ -90,7 +91,8 @@ func (f *FightC) processSkillAttack(attacker, defender *input.Input, skill *info
})
defender.Damage(attacker, &info.DamageZone{
Damage: attacker.SumDamage,
Damage: SumDamage,
Type: info.DamageType.Red,
})
}

View File

@@ -80,10 +80,10 @@ func (our *Input) DelPP(value int) {
// 这个方法是对对方造成伤害
// 伤害落实 // 血量扣减节点比如触发回神,反弹也在这里实现
func (our *Input) Damage(in *Input, sub *info.DamageZone) {
if sub.Type == info.DamageType.Red { //每回合计算伤害的时候重置伤害
our.Opp.SumDamage = sub.Damage
// if sub.Type == info.DamageType.Red { //每回合计算伤害的时候重置伤害
// our.Opp.SumDamage = sub.Damage
}
// }
// 对方对我方造成,需要吃到对方的加成
var ok bool
if our != in {

View File

@@ -1,7 +1,6 @@
package node
import (
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
)
@@ -40,6 +39,17 @@ func (e *EffectNode) Skill_Can() bool {
return e.Input.CurrentPet.HP != 0
}
func (e *EffectNode) GenSub(t input.Effect, Duration int) input.Effect {
tt := e.ID()
tt.SetEffectType(input.EffectType.Sub)
t.ID(tt)
t.SetArgs(e.Input, e.SideEffectArgs...)
return t
}
// func (e *EffectNode) Skill_Use_ex() bool {
// return true
// }
@@ -58,9 +68,9 @@ func (e *EffectNode) Skill_Can() bool {
// return true
// }
type Effect interface {
OnMiss(opp *input.Input, skill *info.SkillEntity)
OnHit(opp *input.Input, skill *info.SkillEntity)
OnDefeat(opp *input.Input, skill *info.SkillEntity) bool //如果需要死亡
OnAlive(opp *input.Input, skill *info.SkillEntity) bool //如果需要存活
}
// type Effect interface {
// OnMiss(opp *input.Input, skill *info.SkillEntity)
// OnHit(opp *input.Input, skill *info.SkillEntity)
// OnDefeat(opp *input.Input, skill *info.SkillEntity) bool //如果需要死亡
// OnAlive(opp *input.Input, skill *info.SkillEntity) bool //如果需要存活
// }