fix: 修复空提交问题

This commit is contained in:
1
2025-11-21 05:47:51 +00:00
parent 8a10948775
commit 315f720e49
22 changed files with 46 additions and 47 deletions

View File

@@ -7,6 +7,7 @@ import (
)
// 基类特性
// 特性的ID=PET cacthtime+eid 这样保证不重复
type NewSel0 struct {
node.EffectNode
Catchtime int //保存精灵的唯一指令,保证在上场时候正确注入
@@ -16,8 +17,9 @@ type NewSel0 struct {
// 重写回合结束效果,特性都是无线回合类的
// 次数类本质上也是这种
func (e *NewSel0) TurnEnd(opp *input.Input) {
// 特性,无法被切精灵消除
func (e *NewSel0) Switch(in *input.Input, at info.AttackValue, outpet *info.BattlePetEntity) bool {
return true
}
// 免疫"能力(battle_lv)下降"

View File

@@ -29,7 +29,7 @@ func (e *Effect1) OnSkill() bool {
}
e.Input.Heal(
e.Ctx().Our, &action.SelectSkillAction{}, e.Ctx().Our.DamageZone.Damage.Div(decimal.NewFromInt(2)),
e.Ctx().Our, &action.SelectSkillAction{}, e.Ctx().Our.SumDamage.Div(decimal.NewFromInt(2)),
)
return true
}

View File

@@ -28,7 +28,7 @@ func (e *Effect101) OnSkill() bool {
}
e.Input.Heal(
e.Ctx().Our, &action.SelectSkillAction{}, e.Ctx().Our.DamageZone.Damage.Mul(decimal.NewFromInt(int64(e.Args()[0])).Div(decimal.NewFromInt(100))),
e.Ctx().Our, &action.SelectSkillAction{}, e.Ctx().Our.SumDamage.Mul(decimal.NewFromInt(int64(e.Args()[0])).Div(decimal.NewFromInt(100))),
)
return true
}

View File

@@ -28,7 +28,7 @@ func (e *Effect105) OnSkill() bool {
}
e.Input.Heal(
e.Ctx().Our, &action.SelectSkillAction{}, e.Ctx().Our.DamageZone.Damage.Div(decimal.NewFromInt(int64(e.Args()[0]))),
e.Ctx().Our, &action.SelectSkillAction{}, e.Ctx().Our.SumDamage.Div(decimal.NewFromInt(int64(e.Args()[0]))),
)
return true
}

View File

@@ -27,7 +27,7 @@ func (e *Effect107) Skill_Useed() bool {
return true
}
d := e.Ctx().Our.DamageZone.Damage.Cmp(decimal.NewFromInt(int64(e.SideEffectArgs[0])))
d := e.Ctx().Our.SumDamage.Cmp(decimal.NewFromInt(int64(e.SideEffectArgs[0])))
//说明伤害小于N
if d == -1 {

View File

@@ -16,7 +16,7 @@ func init() {
t := &Effect116{
EffectNode: node.EffectNode{},
}
// t.Duration(-1) //设置成无限回合,到回合数就停止
input.InitEffect(input.EffectType.Skill, 116, t)
}
@@ -38,7 +38,7 @@ func (e *Effect116) Skill_Useed() bool {
}
if e.Input.FightC.IsFirst(e.Input.Player) {
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, e.Ctx().Our.DamageZone.Damage.Div(decimal.NewFromInt(5)))
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, e.Ctx().Our.SumDamage.Div(decimal.NewFromInt(5)))
}
return true

View File

@@ -14,7 +14,7 @@ func init() {
t := &Effect117{
EffectNode: node.EffectNode{},
}
// t.Duration(-1) //设置成无限回合,到回合数就停止
input.InitEffect(input.EffectType.Skill, 117, t)
}

View File

@@ -61,7 +61,7 @@ func (e *Effect21) Skill_Use_ex() bool {
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
Type: info.DamageType.Fixed,
Damage: decimal.NewFromInt(int64(e.Ctx().Opp.DamageZone.Damage.IntPart())).Div(decimal.NewFromInt(int64(e.SideEffectArgs[0]))),
Damage: decimal.NewFromInt(int64(e.Ctx().Opp.SumDamage.IntPart())).Div(decimal.NewFromInt(int64(e.SideEffectArgs[0]))),
})
return true
}

View File

@@ -41,7 +41,7 @@ func (e *Effect34) Damage_Floor(t *info.DamageZone) bool {
if e.Ctx().SkillEntity == nil {
return true
}
t.Damage = decimal.NewFromInt(int64(e.Ctx().Opp.DamageZone.Damage.IntPart())).Mul(decimal.NewFromInt(int64(e.SideEffectArgs[0])))
t.Damage = decimal.NewFromInt(int64(e.Ctx().Opp.SumDamage.IntPart())).Mul(decimal.NewFromInt(int64(e.SideEffectArgs[0])))
return true
}

View File

@@ -13,7 +13,7 @@ func init() {
t := &Effect52{
EffectNode: node.EffectNode{},
}
// t.Duration(-1) //设置成无限回合,到回合数就停止
input.InitEffect(input.EffectType.Skill, 52, t)
}

View File

@@ -14,7 +14,6 @@ import (
func init() {
// t.Duration(-1) //设置成无限回合,到回合数就停止
input.InitEffect(input.EffectType.Skill, 57, &Effect57{})
}

View File

@@ -26,7 +26,7 @@ func (e *Effect6) Skill_Useed() bool {
e.Ctx().Our.Damage(e.Ctx().Our, &info.DamageZone{
Type: info.DamageType.Fixed,
//这个对面计算前是在他的回合,所以后手也能拿到伤害
Damage: e.Ctx().Our.DamageZone.Damage.Div(decimal.NewFromInt(int64(e.SideEffectArgs[0]))),
Damage: e.Ctx().Our.SumDamage.Div(decimal.NewFromInt(int64(e.SideEffectArgs[0]))),
})
return true

View File

@@ -14,7 +14,6 @@ import (
func init() {
// t.Duration(-1) //设置成无限回合,到回合数就停止
input.InitEffect(input.EffectType.Skill, 60, &Effect60{})
}

View File

@@ -16,7 +16,7 @@ func init() {
t := &Effect73{
EffectNode: node.EffectNode{},
}
// t.Duration(-1) //设置成无限回合,到回合数就停止
input.InitEffect(input.EffectType.Skill, 73, t)
}
@@ -29,7 +29,7 @@ type Effect73 struct {
func (e *Effect73) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.EffectNode.Duration(e.EffectNode.SideEffectArgs[0]-1)
e.EffectNode.Duration(e.EffectNode.SideEffectArgs[0] - 1)
}
func (e *Effect73) Skill_Use_ex() bool {
@@ -43,7 +43,7 @@ func (e *Effect73) Skill_Use_ex() bool {
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
Type: info.DamageType.Fixed,
Damage: e.Ctx().Opp.DamageZone.Damage.Mul(decimal.NewFromInt(2)),
Damage: e.Ctx().Opp.SumDamage.Mul(decimal.NewFromInt(2)),
})
return true

View File

@@ -14,7 +14,6 @@ import (
func init() {
// t.Duration(-1) //设置成无限回合,到回合数就停止
input.InitEffect(input.EffectType.Skill, 77, &Effect77{})
}

View File

@@ -16,7 +16,7 @@ func init() {
t := &Effect89{
EffectNode: node.EffectNode{},
}
// t.Duration(-1) //设置成无限回合,到回合数就停止
input.InitEffect(input.EffectType.Skill, 89, t)
}
@@ -37,7 +37,7 @@ func (e *Effect89) Skill_Useed() bool {
return true
}
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, e.Ctx().Our.DamageZone.Damage.Div(decimal.NewFromInt(int64(e.Args()[1]))))
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, e.Ctx().Our.SumDamage.Div(decimal.NewFromInt(int64(e.Args()[1]))))
return true
}

View File

@@ -15,7 +15,7 @@ func init() {
t := &Effect91{
EffectNode: node.EffectNode{},
}
// t.Duration(-1) //设置成无限回合,到回合数就停止
input.InitEffect(input.EffectType.Skill, 91, t)
}

View File

@@ -47,7 +47,7 @@ func (f *FightC) processSkillAttack(attacker, defender *input.Input, a *info.Ski
attacker.CalculateCrit(defender, a) //暴击计算
attacker.IsCritical = a.Crit
attacker.DamageZone.Damage = attacker.CalculatePower(defender, a)
attacker.SumDamage = attacker.CalculatePower(defender, a)
//睡眠受击消除
}
@@ -63,7 +63,7 @@ func (f *FightC) processSkillAttack(attacker, defender *input.Input, a *info.Ski
}
//暴击翻倍
attacker.DamageZone.Damage = attacker.DamageZone.Damage.Mul(decimal.NewFromInt(2))
attacker.SumDamage = attacker.SumDamage.Mul(decimal.NewFromInt(2))
}
// attacker.AddEffects(attacker.EffectCache...) //命中再添加效果
@@ -83,7 +83,7 @@ func (f *FightC) processSkillAttack(attacker, defender *input.Input, a *info.Ski
defender.Damage(attacker, &info.DamageZone{
Damage: attacker.DamageZone.Damage,
Damage: attacker.SumDamage,
},
)
//这里其实是受到致死伤害
@@ -266,7 +266,7 @@ func (f *FightC) enterturn(fattack, sattack *action.SelectSkillAction) {
fmt.Println(i,
// "玩家技能:", oldskill.(*info.SkillEntity).ID,
"玩家技能伤害:", attacker.DamageZone.Damage,
"玩家技能伤害:", attacker.SumDamage,
"自身剩余血量:", attacker.CurrentPet.Info.Hp,
"对手剩余血量:", defender.CurrentPet.Info.Hp,
)

View File

@@ -101,7 +101,7 @@ func (our *Input) DelPP(value int) {
// 伤害落实 // 血量扣减节点比如触发回神,反弹也在这里实现
func (our *Input) Damage(in *Input, sub *info.DamageZone) {
if sub.Type == info.DamageType.Red { //每回合计算伤害的时候重置伤害
our.Opp.DamageZone.Damage = sub.Damage
our.Opp.SumDamage = sub.Damage
}
// 对方对我方造成,需要吃到对方的加成
@@ -174,8 +174,8 @@ func (our *Input) Damage(in *Input, sub *info.DamageZone) {
}
if sub.Type == info.DamageType.Red { //红才会产生造成伤害
our.Opp.DamageZone.Damage = sub.Damage // 叠加总伤害 这里相当于记录红伤
our.Opp.AttackValue.LostHp = uint32(our.Opp.DamageZone.Damage.IntPart()) //红伤落实
our.Opp.SumDamage = sub.Damage // 叠加总伤害 这里相当于记录红伤
our.Opp.AttackValue.LostHp = uint32(our.Opp.SumDamage.IntPart()) //红伤落实
}
if uint32(sub.Damage.IntPart()) > our.CurrentPet.Info.Hp {

View File

@@ -26,23 +26,21 @@ type Input struct {
Effects []Effect //effects 实际上全局就是effect无限回合 //effects容器 技能的
EffectCache []Effect //这里是命中前执行的容器,也就是命中前执行的所有逻辑相关,理论上一个effect被激活,就应该同时将其他的effect取消激活
Effect_Lost []Effect
//CanUseSkill bool
//Effect_Lost []Effect
//NewEffects []Effect
// 删掉伤害记录,可以在回调中记录,而不是每次调用记录
SumDamage decimal.Decimal //伤害
// DamageZone struct {
// Damage decimal.Decimal //伤害
// BeforeADD decimal.Decimal //攻击伤害
// BeforeMul decimal.Decimal
// BeforeFloor decimal.Decimal
// BeforeDiv decimal.Decimal
// BeforeSUB decimal.Decimal
// BeforeLock decimal.Decimal //锁伤 先锁受击方,再锁攻击方 受击方免疫也是这么锁 免疫等于锁0
// BeforeLocked decimal.Decimal
// //BeforePost decimal.Decimal
DamageZone struct {
Damage decimal.Decimal //伤害
BeforeADD decimal.Decimal //攻击伤害
BeforeMul decimal.Decimal
BeforeFloor decimal.Decimal
BeforeDiv decimal.Decimal
BeforeSUB decimal.Decimal
BeforeLock decimal.Decimal //锁伤 先锁受击方,再锁攻击方 受击方免疫也是这么锁 免疫等于锁0
BeforeLocked decimal.Decimal
//BeforePost decimal.Decimal
//OldAttack int //攻击伤害被挡前伤害记录
} //伤害容器
// //OldAttack int //攻击伤害被挡前伤害记录
// } //伤害容器
//First bool //是否先手
}
@@ -123,7 +121,7 @@ func (our *Input) ResetAttackValue() {
our.AttackValue.IsCritical = 0
our.AttackValue.GainHp = 0
our.AttackValue.LostHp = 0
our.DamageZone.Damage = decimal.NewFromInt(0)
our.SumDamage = decimal.NewFromInt(0)
//our.CanUseSkill = true
}

View File

@@ -77,6 +77,8 @@ func (e *EffectNode) CanStack(t ...bool) bool {
return e.canStack
}
// 回合类改成int.max,然后魂印类重写切换精灵替换
func (e *EffectNode) Duration(t ...int) int {
if len(t) > 0 {
e.duration = t[0]

View File

@@ -9,7 +9,7 @@ import (
type EnumMilestone int
var MilestoneMode = enum.New[struct {
BOSS EnumMilestone //boss类 地图ID->BOSSID ,胜利次数
BOSS EnumMilestone //boss类 地图ID->BOSSID ,胜利次数 mapid bossid petid防止换boss后数据不可用
ITEM EnumMilestone //物品类 物品ID 使用精灵
Fight EnumMilestone //挑战类 对战模式->对战类型->1是赢,0是总局数
}]()