232323
This commit is contained in:
@@ -28,6 +28,7 @@ public interface IGameFightService
|
||||
Task<game_map_goods> GetFightGoodsInfo(string mapId, string mgId);
|
||||
Task RemoveFightGoods(string mapId, string mgId);
|
||||
Task AutoUseDrug(UserAttrModel user, game_fight_data fight);
|
||||
Task HandelFightEnd(string userId, List<dynamic> data);
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -79,6 +79,7 @@ public interface IUnitUserAttrService
|
||||
|
||||
Task<List<unit_user_load>> GetUserLoadState(string userId);
|
||||
Task<bool> AddUserLoadState(string userId, string name, string code);
|
||||
Task AddUserLoadState(string userId, List<string> codes);
|
||||
Task<bool> RandomRemoveUserLoadState(string userId, int count);
|
||||
Task RemoveUserLoadState(string userId);
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -563,5 +563,10 @@ public class GameFightService(ISqlSugarClient DbClient, IRedisCache redis) : IGa
|
||||
|
||||
#endregion
|
||||
|
||||
public async Task HandelFightEnd(string userId, List<dynamic> data)
|
||||
{
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -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<IUnitUserAttrService>();
|
||||
var userStock = await attrService.GetUserStock(userId);
|
||||
if (userStock.Count(it => it.goodsId == goodsId.ToString()) > 0)
|
||||
{
|
||||
var attrService = App.GetService<IUnitUserAttrService>();
|
||||
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}个该物品!";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -805,7 +805,44 @@ public class UnitUserAttrService(ISqlSugarClient DbClient, IRedisCache redis) :
|
||||
|
||||
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)
|
||||
{
|
||||
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
|
||||
}
|
||||
@@ -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] : "";
|
||||
|
||||
@@ -77,6 +77,9 @@ const awardTipsStr = (data: any) => {
|
||||
if (data.code == 'Default') {
|
||||
result += "<span>掉落物品:</span><br>"
|
||||
let awData: Array<any> = data.award;
|
||||
if (awData.length == 0) {
|
||||
return "";
|
||||
}
|
||||
awData.forEach(it => {
|
||||
result += `${it.name}×${it.count}、`;
|
||||
})
|
||||
|
||||
@@ -12,12 +12,19 @@
|
||||
说明:保存书签的方式有两种:<br>
|
||||
1.保存本页面为书签<br>
|
||||
2.复制上方地址,进行保存。<br>
|
||||
</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>
|
||||
<script setup lang="ts">
|
||||
definePageMeta({
|
||||
layout: layout.default,
|
||||
layout: layout.empty,
|
||||
middleware: 'page-loading'
|
||||
})
|
||||
const url = ref('');
|
||||
|
||||
@@ -117,35 +117,35 @@ export class EquTool {
|
||||
result = `${tips}`;
|
||||
}
|
||||
else if (lev > 4 && lev <= 20) {
|
||||
let igName = ["红", "橙", "黄", "绿", "青", "蓝", "紫", "粉", "幻", "天", "弑", "神", "灵", "真", "玄", "尊"];
|
||||
let igName = ["红の", "橙の", "黄の", "绿の", "青の", "蓝の", "紫の", "粉の", "幻の", "天の", "弑の", "神の", "灵の", "真の", "玄の", "尊の"];
|
||||
result = `${tips}${igName[lev - 5]}`;
|
||||
}
|
||||
else if (lev > 20 && lev <= 30) {
|
||||
result = `${tips}尊`;
|
||||
result = `${tips}尊の`;
|
||||
}
|
||||
else if (lev > 30 && lev <= 40) {
|
||||
result = `<i class='tq'></i>${tips}天启`;
|
||||
result = `<i class='tq'></i>${tips}天启の`;
|
||||
}
|
||||
else if (lev > 40 && lev <= 50) {
|
||||
result = `<i class='ty'></i>${tips}天陨`;
|
||||
result = `<i class='ty'></i>${tips}天陨の`;
|
||||
}
|
||||
else if (lev > 50 && lev <= 60) {
|
||||
result = `<i class='ms'></i>${tips}灭世`;
|
||||
result = `<i class='ms'></i>${tips}灭世の`;
|
||||
}
|
||||
else if (lev > 60 && lev <= 70) {
|
||||
result = `<i class='zx'></i>${tips}诛仙`;
|
||||
result = `<i class='zx'></i>${tips}诛仙の`;
|
||||
}
|
||||
else if (lev > 70 && lev <= 80) {
|
||||
result = `<i class='sy'></i>${tips}神音`;
|
||||
result = `<i class='sy'></i>${tips}神音の`;
|
||||
}
|
||||
else if (lev > 80 && lev <= 90) {
|
||||
result = `<i class='gw'></i>${tips}归无`;
|
||||
result = `<i class='gw'></i>${tips}归无の`;
|
||||
}
|
||||
else if (lev > 90 && lev <= 99) {
|
||||
result = `<i class='ly'></i>${tips}灵韵`;
|
||||
result = `<i class='ly'></i>${tips}灵韵の`;
|
||||
}
|
||||
else {
|
||||
result = `<i class='hm'></i>${tips}鸿蒙`;
|
||||
result = `<i class='hm'></i>${tips}鸿蒙の`;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user