121212
This commit is contained in:
@@ -260,7 +260,6 @@ public class UnitUserAttrService(ISqlSugarClient DbClient, IRedisCache redis) :
|
|||||||
|
|
||||||
data.blood = data.blood < 0 ? 0 : data.blood;
|
data.blood = data.blood < 0 ? 0 : data.blood;
|
||||||
result = await redis.AddHashAsync(key, userId, data);
|
result = await redis.AddHashAsync(key, userId, data);
|
||||||
|
|
||||||
if (mustUp)
|
if (mustUp)
|
||||||
{
|
{
|
||||||
var db = DbClient.AsTenant().GetConnectionWithAttr<unit_user_blood>();
|
var db = DbClient.AsTenant().GetConnectionWithAttr<unit_user_blood>();
|
||||||
|
|||||||
@@ -81,17 +81,15 @@ public class FightCompute
|
|||||||
double fight_Harm = harmRide * atkUser.maxAtk;
|
double fight_Harm = harmRide * atkUser.maxAtk;
|
||||||
defHarm +=Convert.ToInt32( 0 - fight_Harm);
|
defHarm +=Convert.ToInt32( 0 - fight_Harm);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
defHarm = defHarm > -1 ? -1 : defHarm;
|
||||||
defHarm = -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
//暴击处理
|
//暴击处理
|
||||||
if (atkUser.Crit > 0)
|
if (atkUser.Crit > 0)
|
||||||
{
|
{
|
||||||
if (randomTrigger(atkUser.Crit))
|
if (randomTrigger(atkUser.Crit))
|
||||||
{
|
{
|
||||||
defHarm = Convert.ToInt32(defHarm * 1.5) ;
|
defHarm += Convert.ToInt32(defHarm * 1.5) ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -270,7 +270,7 @@ public class FightController : ControllerBase
|
|||||||
|
|
||||||
if (otAttr.blood > 0)
|
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 < 0 ? 0 : myAttr.blood;
|
||||||
myAttr.blood = myAttr.blood > myAttr.upBlood ? myAttr.upBlood : myAttr.blood;
|
myAttr.blood = myAttr.blood > myAttr.upBlood ? myAttr.upBlood : myAttr.blood;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user