mirror of
https://github.com/oshima-studios/OshimaGameModule.git
synced 2025-12-05 16:16:35 +00:00
修改市场文本
This commit is contained in:
parent
e743997f65
commit
83c8e6f1cf
19
OshimaModules/Models/ExploreModel.cs
Normal file
19
OshimaModules/Models/ExploreModel.cs
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
using Oshima.Core.Constant;
|
||||||
|
|
||||||
|
namespace Oshima.FunGame.OshimaServers.Model
|
||||||
|
{
|
||||||
|
public class ExploreModel()
|
||||||
|
{
|
||||||
|
public Guid Guid { get; set; } = Guid.NewGuid();
|
||||||
|
public long RegionId { get; set; } = 0;
|
||||||
|
public IEnumerable<long> CharacterIds { get; set; } = [];
|
||||||
|
public DateTime? StartTime { get; set; } = null;
|
||||||
|
public ExploreResult Result { get; set; } = ExploreResult.Nothing;
|
||||||
|
public string String { get; set; } = "";
|
||||||
|
public double CreditsAward { get; set; } = 0;
|
||||||
|
public double MaterialsAward { get; set; } = 0;
|
||||||
|
public Dictionary<string, int> Awards { get; set; } = [];
|
||||||
|
public bool FightWin { get; set; } = false;
|
||||||
|
public double[] AfterFightHPs { get; set; } = [];
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,43 +0,0 @@
|
|||||||
using System.Text;
|
|
||||||
using Milimoe.FunGame.Core.Entity;
|
|
||||||
using Milimoe.FunGame.Core.Library.Constant;
|
|
||||||
using Oshima.Core.Constant;
|
|
||||||
using Oshima.FunGame.OshimaServers.Service;
|
|
||||||
|
|
||||||
namespace Oshima.FunGame.OshimaServers.Model
|
|
||||||
{
|
|
||||||
public class ExploreModel()
|
|
||||||
{
|
|
||||||
public Guid Guid { get; set; } = Guid.NewGuid();
|
|
||||||
public long RegionId { get; set; } = 0;
|
|
||||||
public IEnumerable<long> CharacterIds { get; set; } = [];
|
|
||||||
public DateTime? StartTime { get; set; } = null;
|
|
||||||
public ExploreResult Result { get; set; } = ExploreResult.Nothing;
|
|
||||||
public string String { get; set; } = "";
|
|
||||||
public double CreditsAward { get; set; } = 0;
|
|
||||||
public double MaterialsAward { get; set; } = 0;
|
|
||||||
public Dictionary<string, int> Awards { get; set; } = [];
|
|
||||||
public bool FightWin { get; set; } = false;
|
|
||||||
public double[] AfterFightHPs { get; set; } = [];
|
|
||||||
|
|
||||||
public string GetExploreInfo(IEnumerable<Character> inventoryCharacters, IEnumerable<Region> regions)
|
|
||||||
{
|
|
||||||
StringBuilder sb = new();
|
|
||||||
|
|
||||||
if (CharacterIds.Any())
|
|
||||||
{
|
|
||||||
if (regions.FirstOrDefault(r => r.Id == RegionId) is Region region)
|
|
||||||
{
|
|
||||||
sb.AppendLine($"☆--- 正在探索 {RegionId} 号地区:{region.Name} ---☆");
|
|
||||||
if (StartTime != null)
|
|
||||||
{
|
|
||||||
sb.AppendLine($"探索时间:{StartTime.Value.ToString(General.GeneralDateTimeFormatChinese)}");
|
|
||||||
}
|
|
||||||
sb.AppendLine($"探索角色:{FunGameService.GetCharacterGroupInfoByInventorySequence(inventoryCharacters, CharacterIds, ",")}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return sb.ToString().Trim();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -2875,6 +2875,26 @@ namespace Oshima.FunGame.OshimaServers.Service
|
|||||||
pc.SaveConfig();
|
pc.SaveConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static string GetExploreInfo(ExploreModel model, IEnumerable<Character> inventoryCharacters, IEnumerable<Region> regions)
|
||||||
|
{
|
||||||
|
StringBuilder sb = new();
|
||||||
|
|
||||||
|
if (model.CharacterIds.Any())
|
||||||
|
{
|
||||||
|
if (regions.FirstOrDefault(r => r.Id == model.RegionId) is Region region)
|
||||||
|
{
|
||||||
|
sb.AppendLine($"☆--- 正在探索 {model.RegionId} 号地区:{region.Name} ---☆");
|
||||||
|
if (model.StartTime != null)
|
||||||
|
{
|
||||||
|
sb.AppendLine($"探索时间:{model.StartTime.Value.ToString(General.GeneralDateTimeFormatChinese)}");
|
||||||
|
}
|
||||||
|
sb.AppendLine($"探索角色:{GetCharacterGroupInfoByInventorySequence(inventoryCharacters, model.CharacterIds, ",")}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return sb.ToString().Trim();
|
||||||
|
}
|
||||||
|
|
||||||
public static bool SettleExplore(string exploreId, PluginConfig pc, User user, out string msg)
|
public static bool SettleExplore(string exploreId, PluginConfig pc, User user, out string msg)
|
||||||
{
|
{
|
||||||
bool result = false;
|
bool result = false;
|
||||||
@ -4348,7 +4368,7 @@ namespace Oshima.FunGame.OshimaServers.Service
|
|||||||
{
|
{
|
||||||
foreach (MarketItem marketItem in MarketItemsValid)
|
foreach (MarketItem marketItem in MarketItemsValid)
|
||||||
{
|
{
|
||||||
builder.AppendLine(FunGameService.GetMarketItemInfo(marketItem, true, user?.Id ?? 0));
|
builder.AppendLine(GetMarketItemInfo(marketItem, true, user?.Id ?? 0));
|
||||||
}
|
}
|
||||||
builder.AppendLine("提示:使用【市场查看+序号】查看商品详细信息,使用【市场购买+序号】购买商品。");
|
builder.AppendLine("提示:使用【市场查看+序号】查看商品详细信息,使用【市场购买+序号】购买商品。");
|
||||||
}
|
}
|
||||||
@ -4367,8 +4387,7 @@ namespace Oshima.FunGame.OshimaServers.Service
|
|||||||
StringBuilder builder = new();
|
StringBuilder builder = new();
|
||||||
if (simply)
|
if (simply)
|
||||||
{
|
{
|
||||||
builder.AppendLine($"{item.Id}. {item.Name}");
|
builder.AppendLine($"{item.Id}. [{ItemSet.GetQualityTypeName(item.Item.QualityType)}|{ItemSet.GetItemTypeName(item.Item.ItemType)}] {item.Name}");
|
||||||
builder.AppendLine($"{ItemSet.GetQualityTypeName(item.Item.QualityType)} {ItemSet.GetItemTypeName(item.Item.ItemType)}");
|
|
||||||
string username = item.Username;
|
string username = item.Username;
|
||||||
if (FunGameConstant.UserIdAndUsername.TryGetValue(item.User, out User? user) && user != null)
|
if (FunGameConstant.UserIdAndUsername.TryGetValue(item.User, out User? user) && user != null)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -5676,7 +5676,7 @@ namespace Oshima.FunGame.WebAPI.Controllers
|
|||||||
{
|
{
|
||||||
if (msg2 != "") msg2 += "\r\n";
|
if (msg2 != "") msg2 += "\r\n";
|
||||||
msg2 += $"你暂时无法使用以下角色进行探索:[ {FunGameService.GetCharacterGroupInfoByInventorySequence(user.Inventory.Characters, exploring, " ] / [ ")} ]," +
|
msg2 += $"你暂时无法使用以下角色进行探索:[ {FunGameService.GetCharacterGroupInfoByInventorySequence(user.Inventory.Characters, exploring, " ] / [ ")} ]," +
|
||||||
$"因为这些角色已经参与了另一场探索:\r\n{model.GetExploreInfo(user.Inventory.Characters, FunGameConstant.Regions)}";
|
$"因为这些角色已经参与了另一场探索:\r\n{FunGameService.GetExploreInfo(model, user.Inventory.Characters, FunGameConstant.Regions)}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (msg2 != "")
|
if (msg2 != "")
|
||||||
@ -5761,7 +5761,7 @@ namespace Oshima.FunGame.WebAPI.Controllers
|
|||||||
ExploreModel? model = pc2.Get<ExploreModel>(guid);
|
ExploreModel? model = pc2.Get<ExploreModel>(guid);
|
||||||
if (model is null) continue;
|
if (model is null) continue;
|
||||||
if (msg2 != "") msg2 += "\r\n";
|
if (msg2 != "") msg2 += "\r\n";
|
||||||
msg2 += model.GetExploreInfo(user.Inventory.Characters, FunGameConstant.Regions);
|
msg2 += FunGameService.GetExploreInfo(model, user.Inventory.Characters, FunGameConstant.Regions);
|
||||||
}
|
}
|
||||||
if (msg2 != "")
|
if (msg2 != "")
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user