diff --git a/Service/Application.Domain/Services/Interface/Fight/IGameFightService.cs b/Service/Application.Domain/Services/Interface/Fight/IGameFightService.cs index cf5eb18..3101c5d 100644 --- a/Service/Application.Domain/Services/Interface/Fight/IGameFightService.cs +++ b/Service/Application.Domain/Services/Interface/Fight/IGameFightService.cs @@ -28,6 +28,7 @@ public interface IGameFightService Task GetFightGoodsInfo(string mapId, string mgId); Task RemoveFightGoods(string mapId, string mgId); Task AutoUseDrug(UserAttrModel user, game_fight_data fight); + Task HandelFightEnd(string userId, List data); #endregion } \ No newline at end of file diff --git a/Service/Application.Domain/Services/Interface/User/IUnitUserAttrService.cs b/Service/Application.Domain/Services/Interface/User/IUnitUserAttrService.cs index 2de3433..f0f3480 100644 --- a/Service/Application.Domain/Services/Interface/User/IUnitUserAttrService.cs +++ b/Service/Application.Domain/Services/Interface/User/IUnitUserAttrService.cs @@ -79,6 +79,7 @@ public interface IUnitUserAttrService Task> GetUserLoadState(string userId); Task AddUserLoadState(string userId, string name, string code); + Task AddUserLoadState(string userId, List codes); Task RandomRemoveUserLoadState(string userId, int count); Task RemoveUserLoadState(string userId); diff --git a/Service/Application.Domain/Services/Service/Equ/GameEquService.cs b/Service/Application.Domain/Services/Service/Equ/GameEquService.cs index c9600d0..47b7472 100644 --- a/Service/Application.Domain/Services/Service/Equ/GameEquService.cs +++ b/Service/Application.Domain/Services/Service/Equ/GameEquService.cs @@ -51,6 +51,7 @@ public class GameEquService(ISqlSugarClient DbClient, IRedisCache redis) : IGame .WhereIF(isRemLock, it => it.isLock == 0) .WhereIF(!string.IsNullOrEmpty(equName), it => it.equName.Contains(equName) || it.unitEquName.Contains(equName)) + .OrderByDescending(it => it.isOn) .OrderByDescending(it => it.lev) .OrderByDescending(it => it.ueId).ToPageListAsync(PageIndex, PageSize, Total); } diff --git a/Service/Application.Domain/Services/Service/Fight/GameFightService.cs b/Service/Application.Domain/Services/Service/Fight/GameFightService.cs index cc4ad15..3a3c538 100644 --- a/Service/Application.Domain/Services/Service/Fight/GameFightService.cs +++ b/Service/Application.Domain/Services/Service/Fight/GameFightService.cs @@ -563,5 +563,10 @@ public class GameFightService(ISqlSugarClient DbClient, IRedisCache redis) : IGa #endregion + public async Task HandelFightEnd(string userId, List data) + { + await Task.CompletedTask; + } + #endregion } \ No newline at end of file diff --git a/Service/Application.Domain/Services/Service/Goods/GameGoodsService.cs b/Service/Application.Domain/Services/Service/Goods/GameGoodsService.cs index 7ff6e8c..5e9d4ee 100644 --- a/Service/Application.Domain/Services/Service/Goods/GameGoodsService.cs +++ b/Service/Application.Domain/Services/Service/Goods/GameGoodsService.cs @@ -257,24 +257,23 @@ public class GameGoodsService(ISqlSugarClient DbClient, IRedisCache redis) : IGa { if (_drugConfig.type == nameof(GameEnum.GameStockType.Number)) { - if (string.IsNullOrEmpty(scene)) + var attrService = App.GetService(); + var userStock = await attrService.GetUserStock(userId); + if (userStock.Count(it => it.goodsId == goodsId.ToString()) > 0) { - var attrService = App.GetService(); - var userStock = await attrService.GetUserStock(userId); - if (userStock.Count(it => it.goodsId == goodsId.ToString()) > 0) - { - result = "您已经使用过该药品啦!"; - } + result = "您已经使用过该药品啦!"; } - else + + if (!string.IsNullOrEmpty(scene)) { //要判断使用个数 - if (_drugConfig.use > 0) + int useCount = Convert.ToInt32(_drugConfig.use); + if (useCount > 0) { var count = await GetUserDrugLockCount(userId, goodsId, scene); - if (count >= _drugConfig.use) + if (count >= Convert.ToInt32(useCount)) { - result = $"当前最多可用{_drugConfig.use}个该物品!"; + result = $"当前最多可用{useCount}个该物品!"; } } } diff --git a/Service/Application.Domain/Services/Service/User/UnitUserAttrService.cs b/Service/Application.Domain/Services/Service/User/UnitUserAttrService.cs index b9f0698..3dfa3b5 100644 --- a/Service/Application.Domain/Services/Service/User/UnitUserAttrService.cs +++ b/Service/Application.Domain/Services/Service/User/UnitUserAttrService.cs @@ -805,7 +805,44 @@ public class UnitUserAttrService(ISqlSugarClient DbClient, IRedisCache redis) : return result; } + public async Task AddUserLoadState(string userId, List codes) + { + foreach (var code in codes) + { + string name = string.Empty; + switch (code) + { + case "Slow": + name = "迟缓"; + break; + case "Poison": + name = "中毒"; + break; + + case "Curse": + name = "诅咒"; + break; + + case "Weaken": + name = "弱化"; + break; + + case "Depressed": + name = "消沉"; + break; + + case "Breach": + name = "突破"; + break; + + case "PalsyAtk": + name = "麻痹"; + break; + } + await AddUserLoadState(userId, name, code); + } + } public async Task RandomRemoveUserLoadState(string userId, int count) { var data = await GetUserLoadState(userId); @@ -831,6 +868,7 @@ public class UnitUserAttrService(ISqlSugarClient DbClient, IRedisCache redis) : string key = string.Format(UserCache.BaseCacheKeys, "AttrData", "LoadState"); await redis.DelHashAsync(key, userId); } + #endregion } \ No newline at end of file diff --git a/Service/Application.Web/Controllers/Pub/FightController.cs b/Service/Application.Web/Controllers/Pub/FightController.cs index 574fe11..bd2054f 100644 --- a/Service/Application.Web/Controllers/Pub/FightController.cs +++ b/Service/Application.Web/Controllers/Pub/FightController.cs @@ -158,6 +158,8 @@ public class FightController : ControllerBase myHarm += await _fightService.GetUserFightHarm(userId); otHarm = fightResult.otHarm; await _attrService.UpdateUserBlood(userId, 1, fightResult.myHarm); + await _attrService.AddUserLoadState(userId, fightResult.myStateData); + await _fightService.HandelFightEnd(userId, fightResult.myRemData); } var myAttr = await _attrService.GetUserAttrModel(userId, fight.scene); @@ -179,6 +181,8 @@ public class FightController : ControllerBase { await _fightService.SetUserFightHarm(fight.mainId, fightResult.otHarm); await _attrService.UpdateUserBlood(fight.mainId, 1, fightResult.otHarm); + await _attrService.AddUserLoadState(fight.mainId, fightResult.otStateData); + await _fightService.HandelFightEnd(fight.mainId, fightResult.otRemData); } otAttr = await _attrService.GetUserAttrModel(fight.mainId, fight.scene); @@ -224,7 +228,7 @@ public class FightController : ControllerBase { decimal diff = myAttr.agility - otAttr.agility; decimal bl = diff / otAttr.agility; - cool = Convert.ToInt32((1-bl) * 1000.0m); + cool = Convert.ToInt32((1 - bl) * 1000.0m); cool = cool < 10 ? 10 : cool; cool = cool > 1000 ? 1000 : cool; } @@ -300,7 +304,7 @@ public class FightController : ControllerBase { if (await _fightService.RemoveUserFight(userId, fightId)) { - await _fightService.SetFightWin(fight, fight.mainId,false); + await _fightService.SetFightWin(fight, fight.mainId, false); await _fightService.RemoveFightHarm(fightId, userId); //移除伤害 var nextFight = myFight.FindAll(it => it != fightId); string nextId = nextFight.Count > 0 ? nextFight[0] : ""; diff --git a/Web/src/pages/fight/result.vue b/Web/src/pages/fight/result.vue index 5263bab..ffd8e6d 100644 --- a/Web/src/pages/fight/result.vue +++ b/Web/src/pages/fight/result.vue @@ -77,6 +77,9 @@ const awardTipsStr = (data: any) => { if (data.code == 'Default') { result += "掉落物品:
" let awData: Array = data.award; + if (awData.length == 0) { + return ""; + } awData.forEach(it => { result += `${it.name}×${it.count}、`; }) diff --git a/Web/src/pages/user/book.vue b/Web/src/pages/user/book.vue index 440e8f7..5bec04e 100644 --- a/Web/src/pages/user/book.vue +++ b/Web/src/pages/user/book.vue @@ -12,12 +12,19 @@ 说明:保存书签的方式有两种:
1.保存本页面为书签
2.复制上方地址,进行保存。
+ +
+ ➣进入游戏
- +
+
+ 小G报时({{ TimeExtend.Now("HH:mm") }}) +
+

官方QQ群:931835791