This commit is contained in:
Putoo
2026-07-07 11:51:45 +08:00
parent 49ac29c50a
commit 7f29fd46b8
10 changed files with 84 additions and 25 deletions

View File

@@ -28,6 +28,7 @@ public interface IGameFightService
Task<game_map_goods> GetFightGoodsInfo(string mapId, string mgId); Task<game_map_goods> GetFightGoodsInfo(string mapId, string mgId);
Task RemoveFightGoods(string mapId, string mgId); Task RemoveFightGoods(string mapId, string mgId);
Task AutoUseDrug(UserAttrModel user, game_fight_data fight); Task AutoUseDrug(UserAttrModel user, game_fight_data fight);
Task HandelFightEnd(string userId, List<dynamic> data);
#endregion #endregion
} }

View File

@@ -79,6 +79,7 @@ public interface IUnitUserAttrService
Task<List<unit_user_load>> GetUserLoadState(string userId); Task<List<unit_user_load>> GetUserLoadState(string userId);
Task<bool> AddUserLoadState(string userId, string name, string code); Task<bool> AddUserLoadState(string userId, string name, string code);
Task AddUserLoadState(string userId, List<string> codes);
Task<bool> RandomRemoveUserLoadState(string userId, int count); Task<bool> RandomRemoveUserLoadState(string userId, int count);
Task RemoveUserLoadState(string userId); Task RemoveUserLoadState(string userId);

View File

@@ -51,6 +51,7 @@ public class GameEquService(ISqlSugarClient DbClient, IRedisCache redis) : IGame
.WhereIF(isRemLock, it => it.isLock == 0) .WhereIF(isRemLock, it => it.isLock == 0)
.WhereIF(!string.IsNullOrEmpty(equName), .WhereIF(!string.IsNullOrEmpty(equName),
it => it.equName.Contains(equName) || it.unitEquName.Contains(equName)) it => it.equName.Contains(equName) || it.unitEquName.Contains(equName))
.OrderByDescending(it => it.isOn)
.OrderByDescending(it => it.lev) .OrderByDescending(it => it.lev)
.OrderByDescending(it => it.ueId).ToPageListAsync(PageIndex, PageSize, Total); .OrderByDescending(it => it.ueId).ToPageListAsync(PageIndex, PageSize, Total);
} }

View File

@@ -563,5 +563,10 @@ public class GameFightService(ISqlSugarClient DbClient, IRedisCache redis) : IGa
#endregion #endregion
public async Task HandelFightEnd(string userId, List<dynamic> data)
{
await Task.CompletedTask;
}
#endregion #endregion
} }

View File

@@ -256,8 +256,6 @@ public class GameGoodsService(ISqlSugarClient DbClient, IRedisCache redis) : IGa
else if (_drugConfig.cls == nameof(GoodsEnum.DrugCls.BloodStock)) else if (_drugConfig.cls == nameof(GoodsEnum.DrugCls.BloodStock))
{ {
if (_drugConfig.type == nameof(GameEnum.GameStockType.Number)) if (_drugConfig.type == nameof(GameEnum.GameStockType.Number))
{
if (string.IsNullOrEmpty(scene))
{ {
var attrService = App.GetService<IUnitUserAttrService>(); var attrService = App.GetService<IUnitUserAttrService>();
var userStock = await attrService.GetUserStock(userId); var userStock = await attrService.GetUserStock(userId);
@@ -265,16 +263,17 @@ public class GameGoodsService(ISqlSugarClient DbClient, IRedisCache redis) : IGa
{ {
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); var count = await GetUserDrugLockCount(userId, goodsId, scene);
if (count >= _drugConfig.use) if (count >= Convert.ToInt32(useCount))
{ {
result = $"当前最多可用{_drugConfig.use}个该物品!"; result = $"当前最多可用{useCount}个该物品!";
} }
} }
} }

View File

@@ -805,7 +805,44 @@ public class UnitUserAttrService(ISqlSugarClient DbClient, IRedisCache redis) :
return result; return result;
} }
public async Task AddUserLoadState(string userId, List<string> 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<bool> RandomRemoveUserLoadState(string userId, int count) public async Task<bool> RandomRemoveUserLoadState(string userId, int count)
{ {
var data = await GetUserLoadState(userId); var data = await GetUserLoadState(userId);
@@ -832,5 +869,6 @@ public class UnitUserAttrService(ISqlSugarClient DbClient, IRedisCache redis) :
await redis.DelHashAsync(key, userId); await redis.DelHashAsync(key, userId);
} }
#endregion #endregion
} }

View File

@@ -158,6 +158,8 @@ public class FightController : ControllerBase
myHarm += await _fightService.GetUserFightHarm(userId); myHarm += await _fightService.GetUserFightHarm(userId);
otHarm = fightResult.otHarm; otHarm = fightResult.otHarm;
await _attrService.UpdateUserBlood(userId, 1, fightResult.myHarm); 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); var myAttr = await _attrService.GetUserAttrModel(userId, fight.scene);
@@ -179,6 +181,8 @@ public class FightController : ControllerBase
{ {
await _fightService.SetUserFightHarm(fight.mainId, fightResult.otHarm); await _fightService.SetUserFightHarm(fight.mainId, fightResult.otHarm);
await _attrService.UpdateUserBlood(fight.mainId, 1, 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); otAttr = await _attrService.GetUserAttrModel(fight.mainId, fight.scene);

View File

@@ -77,6 +77,9 @@ const awardTipsStr = (data: any) => {
if (data.code == 'Default') { if (data.code == 'Default') {
result += "<span>掉落物品:</span><br>" result += "<span>掉落物品:</span><br>"
let awData: Array<any> = data.award; let awData: Array<any> = data.award;
if (awData.length == 0) {
return "";
}
awData.forEach(it => { awData.forEach(it => {
result += `${it.name}×${it.count}`; result += `${it.name}×${it.count}`;
}) })

View File

@@ -13,11 +13,18 @@
1.保存本页面为书签<br> 1.保存本页面为书签<br>
2.复制上方地址,进行保存<br> 2.复制上方地址,进行保存<br>
</div> </div>
<div class="content">
<Abar href="/map">进入游戏</Abar>
</div>
<div class="clear"></div>
<div class="timeService">
小G报时({{ TimeExtend.Now("HH:mm") }})
</div>
<p style="font-weight:bold;font-size:14px">官方QQ群931835791</p>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
definePageMeta({ definePageMeta({
layout: layout.default, layout: layout.empty,
middleware: 'page-loading' middleware: 'page-loading'
}) })
const url = ref(''); const url = ref('');

View File

@@ -117,35 +117,35 @@ export class EquTool {
result = `${tips}`; result = `${tips}`;
} }
else if (lev > 4 && lev <= 20) { else if (lev > 4 && lev <= 20) {
let igName = ["红", "橙", "黄", "绿", "青", "蓝", "紫", "粉", "幻", "天", "弑", "神", "灵", "真", "玄", "尊"]; let igName = ["红", "橙", "黄", "绿", "青", "蓝", "紫", "粉", "幻", "天", "弑", "神", "灵", "真", "玄", "尊"];
result = `${tips}${igName[lev - 5]}`; result = `${tips}${igName[lev - 5]}`;
} }
else if (lev > 20 && lev <= 30) { else if (lev > 20 && lev <= 30) {
result = `${tips}`; result = `${tips}`;
} }
else if (lev > 30 && lev <= 40) { else if (lev > 30 && lev <= 40) {
result = `<i class='tq'></i>${tips}天启`; result = `<i class='tq'></i>${tips}天启`;
} }
else if (lev > 40 && lev <= 50) { else if (lev > 40 && lev <= 50) {
result = `<i class='ty'></i>${tips}天陨`; result = `<i class='ty'></i>${tips}天陨`;
} }
else if (lev > 50 && lev <= 60) { else if (lev > 50 && lev <= 60) {
result = `<i class='ms'></i>${tips}灭世`; result = `<i class='ms'></i>${tips}灭世`;
} }
else if (lev > 60 && lev <= 70) { else if (lev > 60 && lev <= 70) {
result = `<i class='zx'></i>${tips}诛仙`; result = `<i class='zx'></i>${tips}诛仙`;
} }
else if (lev > 70 && lev <= 80) { else if (lev > 70 && lev <= 80) {
result = `<i class='sy'></i>${tips}神音`; result = `<i class='sy'></i>${tips}神音`;
} }
else if (lev > 80 && lev <= 90) { else if (lev > 80 && lev <= 90) {
result = `<i class='gw'></i>${tips}归无`; result = `<i class='gw'></i>${tips}归无`;
} }
else if (lev > 90 && lev <= 99) { else if (lev > 90 && lev <= 99) {
result = `<i class='ly'></i>${tips}灵韵`; result = `<i class='ly'></i>${tips}灵韵`;
} }
else { else {
result = `<i class='hm'></i>${tips}鸿蒙`; result = `<i class='hm'></i>${tips}鸿蒙`;
} }
return result; return result;
} }