This commit is contained in:
1
2026-01-21 20:46:05 +00:00
parent 97f70731b5
commit 0a0e1bf8c0
26 changed files with 236 additions and 227 deletions

View File

@@ -3,9 +3,6 @@ package input
import (
"blazing/common/utils"
"blazing/logic/service/fight/info"
"blazing/modules/player/model"
"fmt"
"github.com/alpacahq/alpacadecimal"
"github.com/brunoga/deep"
@@ -165,23 +162,17 @@ func IS_Stat(v Effect) bool {
//
func (our *Input) GetCurrAttr(id int) model.PetInfo {
//todo 获取前GetEffect
return our.CurrentPet.Info
//todo 获取后GetEffect
}
// 比较两个[]int是否内容相等
func equalInts(a, b []alpacadecimal.Decimal) bool {
// 先判断长度是否相等
if len(a) != len(b) {
return false
}
// 逐个比较元素
for i := range a {
if a[i].IntPart() != b[i].IntPart() {
if a[i].Cmp(b[i]) != 0 {
return false
}
}
@@ -218,7 +209,7 @@ func (our *Input) AddEffect(in *Input, e Effect) Effect {
if v.ID().Base == e.ID().Base && //找到相同的效果id
v.Alive() && //如果之前的效果还存活
equalInts(v.Args(), e.Args()) { //如果层数可以叠加或者是无限层数
fmt.Println("重复效果", e.ID().Suffix(), v.ID().Suffix())
//fmt.Println("重复效果", e.ID().Suffix(), v.ID().Suffix())
if !v.CanStack() { //说明进行了替换
v.Alive(false) //不允许叠层,取消效果