mirror of
https://github.com/oshima-studios/OshimaGameModule.git
synced 2026-01-20 22:48:23 +00:00
优化商店显示
This commit is contained in:
parent
c94c9b1c2f
commit
b962f0a2b3
@ -27,6 +27,12 @@ namespace Oshima.FunGame.OshimaModules.Regions
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public virtual string GetCurrencyInfo(PluginConfig pc, User user, string storeName)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
public virtual void SaveGlobalStore(Store store, string storeName)
|
||||
{
|
||||
|
||||
|
||||
@ -142,7 +142,7 @@ namespace Oshima.FunGame.OshimaModules.Regions
|
||||
foreach (OshimaRegion region in items.Keys)
|
||||
{
|
||||
store.AddItem(items[region], -1);
|
||||
store.SetPrice(i, "锻造积分", 3 * ((int)region.Difficulty + 1));
|
||||
store.SetPrice(i, "锻造积分", 2 * ((int)region.Difficulty + 1));
|
||||
i++;
|
||||
}
|
||||
return store;
|
||||
|
||||
@ -2071,12 +2071,12 @@ namespace Oshima.FunGame.OshimaServers.Service
|
||||
}
|
||||
stores.Add("daily", daily);
|
||||
SetLastStore(user, true, "", "");
|
||||
return daily.ToString(user);
|
||||
return daily.ToString(user) + $"\r\n现有{General.GameplayEquilibriumConstant.InGameCurrency}:{user.Inventory.Credits:0.##}\r\n现有{General.GameplayEquilibriumConstant.InGameMaterial}:{user.Inventory.Materials:0.##}";
|
||||
}
|
||||
else
|
||||
{
|
||||
SetLastStore(user, true, "", "");
|
||||
return daily.ToString(user);
|
||||
return daily.ToString(user) + $"\r\n现有{General.GameplayEquilibriumConstant.InGameCurrency}:{user.Inventory.Credits:0.##}\r\n现有{General.GameplayEquilibriumConstant.InGameMaterial}:{user.Inventory.Materials:0.##}";
|
||||
}
|
||||
}
|
||||
|
||||
@ -2732,6 +2732,7 @@ namespace Oshima.FunGame.OshimaServers.Service
|
||||
Item? itemDrop = region.Items.Where(i => qualityType == QualityType.Blue ? (int)i.QualityType <= (int)qualityType : (int)i.QualityType == (int)qualityType).OrderBy(o => Random.Shared.Next()).FirstOrDefault();
|
||||
if (itemDrop != null)
|
||||
{
|
||||
model.Awards[itemDrop.Name] = 1;
|
||||
string itemquality = ItemSet.GetQualityTypeName(itemDrop.QualityType);
|
||||
string itemtype = ItemSet.GetItemTypeName(itemDrop.ItemType) + (itemDrop.ItemType == ItemType.Weapon && itemDrop.WeaponType != WeaponType.None ? "-" + ItemSet.GetWeaponTypeName(itemDrop.WeaponType) : "");
|
||||
if (itemtype != "") itemtype = $"|{itemtype}";
|
||||
@ -3997,7 +3998,7 @@ namespace Oshima.FunGame.OshimaServers.Service
|
||||
}
|
||||
}
|
||||
|
||||
public static string CheckRegionStore(EntityModuleConfig<Store> stores, User user, string storeRegion, string storeName, out bool exist)
|
||||
public static string CheckRegionStore(EntityModuleConfig<Store> stores, PluginConfig pc, User user, string storeRegion, string storeName, out bool exist)
|
||||
{
|
||||
string msg = "";
|
||||
exist = false;
|
||||
@ -4008,6 +4009,15 @@ namespace Oshima.FunGame.OshimaServers.Service
|
||||
Store? store = value.VisitStore(stores, user, storeName);
|
||||
exist = store != null;
|
||||
msg = store?.ToString(user) ?? "";
|
||||
string currencyInfo = value.GetCurrencyInfo(pc, user, storeName);
|
||||
if (exist && msg != "")
|
||||
{
|
||||
if (currencyInfo.Trim() == "")
|
||||
{
|
||||
currencyInfo = $"现有{General.GameplayEquilibriumConstant.InGameCurrency}:{user.Inventory.Credits:0.##}\r\n现有{General.GameplayEquilibriumConstant.InGameMaterial}:{user.Inventory.Materials:0.##}";
|
||||
}
|
||||
msg += "\r\n" + currencyInfo;
|
||||
}
|
||||
}
|
||||
|
||||
if (!exist)
|
||||
@ -4371,9 +4381,9 @@ namespace Oshima.FunGame.OshimaServers.Service
|
||||
int count1 = 30;
|
||||
int count2 = 30;
|
||||
DateTime d1 = DateTime.Today.AddHours(11);
|
||||
DateTime d2 = DateTime.Today.AddHours(13);
|
||||
DateTime d2 = DateTime.Today.AddHours(13).AddMinutes(59);
|
||||
DateTime d3 = DateTime.Today.AddHours(17);
|
||||
DateTime d4 = DateTime.Today.AddHours(19);
|
||||
DateTime d4 = DateTime.Today.AddHours(19).AddMinutes(59);
|
||||
if (now >= d1 && now <= d2 && (!pc.TryGetValue("lunch", out value) || (value is bool lunch && !lunch)))
|
||||
{
|
||||
int exploreTimes = FunGameConstant.MaxExploreTimes + count1;
|
||||
|
||||
@ -7070,7 +7070,7 @@ namespace Oshima.FunGame.WebAPI.Controllers
|
||||
|
||||
EntityModuleConfig<Store> stores = new("stores", userid.ToString());
|
||||
stores.LoadConfig();
|
||||
string msg = FunGameService.CheckRegionStore(stores, user, storeRegion, storeName, out _);
|
||||
string msg = FunGameService.CheckRegionStore(stores, pc, user, storeRegion, storeName, out _);
|
||||
|
||||
FunGameService.SetUserConfigAndReleaseSemaphoreSlim(userid, pc, user);
|
||||
return msg;
|
||||
@ -7119,7 +7119,7 @@ namespace Oshima.FunGame.WebAPI.Controllers
|
||||
}
|
||||
else
|
||||
{
|
||||
string msg2 = FunGameService.CheckRegionStore(stores, user, storeRegion, storeName, out bool exist);
|
||||
string msg2 = FunGameService.CheckRegionStore(stores, pc, user, storeRegion, storeName, out bool exist);
|
||||
msg = exist ? $"正在获取最新商店数据,请稍后查看。" : msg2;
|
||||
}
|
||||
|
||||
@ -7185,7 +7185,7 @@ namespace Oshima.FunGame.WebAPI.Controllers
|
||||
}
|
||||
else
|
||||
{
|
||||
string msg2 = FunGameService.CheckRegionStore(stores, user, storeRegion, storeName, out bool exist);
|
||||
string msg2 = FunGameService.CheckRegionStore(stores, pc, user, storeRegion, storeName, out bool exist);
|
||||
msg = exist ? $"正在获取最新商店数据,请稍后查看。" : msg2;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user