This commit is contained in:
Putoo
2026-07-18 20:42:25 +08:00
parent 8d1ab092f2
commit 338ccd807c
3 changed files with 4 additions and 7 deletions

View File

@@ -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<unit_user_blood>();

View File

@@ -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) ;
}
}

View File

@@ -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;