All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
fix(fight): 修复单输入战斗中效果处理逻辑错误 - 在Effect201的OnSkill方法中调整了多输入战斗检查的位置, 确保单输入战斗中的单目标效果被正确忽略 - 添加了针对单输入战斗中单目标效果的测试用例 - 移除了重复的多输入战斗检查代码 feat(fight): 添加战斗初始化时捕获标识
50 lines
962 B
Go
50 lines
962 B
Go
package player
|
|
|
|
import (
|
|
configmodel "blazing/modules/config/model"
|
|
playermodel "blazing/modules/player/model"
|
|
"testing"
|
|
)
|
|
|
|
func TestIsMatchFirstSpritesRequiresLivingLeadPet(t *testing.T) {
|
|
player := &Player{
|
|
baseplayer: baseplayer{
|
|
Info: &playermodel.PlayerInfo{
|
|
PetList: []playermodel.PetInfo{
|
|
{ID: 1001, Hp: 0},
|
|
{ID: 2002, Hp: 100},
|
|
},
|
|
},
|
|
},
|
|
}
|
|
|
|
event := configmodel.Event{
|
|
FirstSprites: []int32{1001},
|
|
}
|
|
|
|
if player.IsMatch(event) {
|
|
t.Fatalf("expected dead lead pet to fail FirstSprites match")
|
|
}
|
|
}
|
|
|
|
func TestIsMatchFirstSpritesAcceptsLivingLeadPet(t *testing.T) {
|
|
player := &Player{
|
|
baseplayer: baseplayer{
|
|
Info: &playermodel.PlayerInfo{
|
|
PetList: []playermodel.PetInfo{
|
|
{ID: 1001, Hp: 100},
|
|
{ID: 2002, Hp: 100},
|
|
},
|
|
},
|
|
},
|
|
}
|
|
|
|
event := configmodel.Event{
|
|
FirstSprites: []int32{1001},
|
|
}
|
|
|
|
if !player.IsMatch(event) {
|
|
t.Fatalf("expected living lead pet to pass FirstSprites match")
|
|
}
|
|
}
|