1212
This commit is contained in:
@@ -70,7 +70,7 @@ public class MapController : ControllerBase
|
||||
|
||||
#region 地图导向处理
|
||||
|
||||
bool isSelfMap = false;
|
||||
bool isSelfMap = string.IsNullOrEmpty(map);
|
||||
if (!isSelfMap)
|
||||
{
|
||||
//血量为0得时候地图点为本身
|
||||
@@ -78,7 +78,7 @@ public class MapController : ControllerBase
|
||||
if (myBlood.blood < 1)
|
||||
{
|
||||
//设置默认地图点
|
||||
await _mapService.SetUserMapDefult(userId);
|
||||
await _mapService.SetUserMapDefault(userId);
|
||||
isSelfMap = true;
|
||||
gameTips = "➢当前体力为0,恢复一下吧!";
|
||||
}
|
||||
@@ -147,6 +147,8 @@ public class MapController : ControllerBase
|
||||
|
||||
var userFight = await _fightService.GetUserFight(userId);
|
||||
string fightId = userFight.Count > 0 ? userFight[0] : "";
|
||||
var mapGoods = await _fightService.GetMapFightGoods(mapInfo.mapId);
|
||||
mapGoods = mapGoods.FindAll(it => it.userId == "0" || it.userId == userId).Take(3).ToList();
|
||||
|
||||
object ret = new
|
||||
{
|
||||
@@ -159,6 +161,7 @@ public class MapController : ControllerBase
|
||||
noReadMsg = noReadMsg[3],
|
||||
business,
|
||||
mapRes,
|
||||
mapGoods,
|
||||
broadcast,
|
||||
monster = monsterData,
|
||||
fightId,
|
||||
@@ -733,4 +736,42 @@ public class MapController : ControllerBase
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 地图物品
|
||||
|
||||
/// <summary>
|
||||
/// 拾取地图物品
|
||||
/// </summary>
|
||||
/// <param name="mgId"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public async Task<IPoAction> GetMapGoods(string mgId)
|
||||
{
|
||||
string userId = StateHelper.userId;
|
||||
var onMap = await _mapService.GetUserOnMapId(userId);
|
||||
var goods = await _fightService.GetFightGoodsInfo(onMap, mgId);
|
||||
if (goods == null)
|
||||
{
|
||||
return PoAction.Message("物品已被拾取!");
|
||||
}
|
||||
|
||||
if (await _weightService.CheckUserWeight(userId, goods.code, goods.par, goods.count))
|
||||
{
|
||||
await _fightService.RemoveFightGoods(onMap, mgId);
|
||||
if (await GameBus.UpdateBag(userId, 1, goods.code, goods.par, goods.count, "城市地图拾取"))
|
||||
{
|
||||
return PoAction.Ok(true, $"成功拾取:{goods.name}×{goods.count}!");
|
||||
}
|
||||
else
|
||||
{
|
||||
return PoAction.Message("拾取失败,请稍后尝试!");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return PoAction.Message("背包暂无空间!");
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
Reference in New Issue
Block a user