diff --git a/Service/Application.Domain/Services/Service/User/UnitUserAttrService.cs b/Service/Application.Domain/Services/Service/User/UnitUserAttrService.cs index 9b561f2..15757ed 100644 --- a/Service/Application.Domain/Services/Service/User/UnitUserAttrService.cs +++ b/Service/Application.Domain/Services/Service/User/UnitUserAttrService.cs @@ -260,7 +260,6 @@ public class UnitUserAttrService(ISqlSugarClient DbClient, IRedisCache redis) : data.blood = data.blood < 0 ? 0 : data.blood; result = await redis.AddHashAsync(key, userId, data); - if (mustUp) { var db = DbClient.AsTenant().GetConnectionWithAttr(); diff --git a/Service/Application.Domain/Tool/Base/FightCompute.cs b/Service/Application.Domain/Tool/Base/FightCompute.cs index 435c93a..996c5e1 100644 --- a/Service/Application.Domain/Tool/Base/FightCompute.cs +++ b/Service/Application.Domain/Tool/Base/FightCompute.cs @@ -81,17 +81,15 @@ public class FightCompute double fight_Harm = harmRide * atkUser.maxAtk; defHarm +=Convert.ToInt32( 0 - fight_Harm); } - else - { - defHarm = -1; - } + + defHarm = defHarm > -1 ? -1 : defHarm; //暴击处理 if (atkUser.Crit > 0) { if (randomTrigger(atkUser.Crit)) { - defHarm = Convert.ToInt32(defHarm * 1.5) ; + defHarm += Convert.ToInt32(defHarm * 1.5) ; } } diff --git a/Service/Application.Web/Controllers/Pub/FightController.cs b/Service/Application.Web/Controllers/Pub/FightController.cs index 017d3fc..5e31703 100644 --- a/Service/Application.Web/Controllers/Pub/FightController.cs +++ b/Service/Application.Web/Controllers/Pub/FightController.cs @@ -270,7 +270,7 @@ public class FightController : ControllerBase if (otAttr.blood > 0) { - myAttr.blood = myAttr.blood + fightResult.otHarm; + myAttr.blood = myAttr.blood + fightResult.myHarm; myAttr.blood = myAttr.blood < 0 ? 0 : myAttr.blood; myAttr.blood = myAttr.blood > myAttr.upBlood ? myAttr.upBlood : myAttr.blood;