mirror of
https://github.com/oshima-studios/OshimaGameModule.git
synced 2025-04-20 19:09:35 +08:00
修复升级和突破的BUG;添加智力提升加速系数;添加突破材料
This commit is contained in:
parent
3c1cb897af
commit
9a1543f0a2
@ -1484,7 +1484,7 @@ namespace Oshima.Core.Controllers
|
||||
|
||||
if (items.Count() >= useCount)
|
||||
{
|
||||
items = items.Reverse().Take(useCount);
|
||||
items = items.TakeLast(useCount);
|
||||
List<string> msgs = [];
|
||||
int successCount = 0;
|
||||
|
||||
@ -1529,7 +1529,7 @@ namespace Oshima.Core.Controllers
|
||||
pc.Add("user", user);
|
||||
pc.SaveConfig();
|
||||
}
|
||||
return NetworkUtility.JsonSerialize($"使用完毕!使用 {useCount} 件物品,成功 {successCount} 件!\r\n" + string.Join("\r\n", msgs));
|
||||
return NetworkUtility.JsonSerialize($"使用完毕!使用 {useCount} 件物品,成功 {successCount} 件!\r\n" + string.Join("\r\n", msgs.Count > 30 ? msgs.Take(30) : msgs));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1584,7 +1584,7 @@ namespace Oshima.Core.Controllers
|
||||
|
||||
string msg = $"升级完成!角色 [ {character} ] 共提升 {character.Level - originalLevel} 级,当前等级:{character.Level} 级。";
|
||||
|
||||
if (General.GameplayEquilibriumConstant.EXPUpperLimit.TryGetValue(character.Level, out double need))
|
||||
if (character.Level != General.GameplayEquilibriumConstant.MaxLevel && General.GameplayEquilibriumConstant.EXPUpperLimit.TryGetValue(character.Level, out double need))
|
||||
{
|
||||
if (character.EXP < need)
|
||||
{
|
||||
@ -1595,6 +1595,10 @@ namespace Oshima.Core.Controllers
|
||||
msg += $"\r\n角色 [ {character} ] 目前突破进度:{character.LevelBreak + 1}/{General.GameplayEquilibriumConstant.LevelBreakList.Count},需要进行【角色突破】才能继续升级。";
|
||||
}
|
||||
}
|
||||
else if (character.Level == General.GameplayEquilibriumConstant.MaxLevel)
|
||||
{
|
||||
msg += $"\r\n该角色已升级至满级,恭喜!";
|
||||
}
|
||||
|
||||
user.LastTime = DateTime.Now;
|
||||
pc.Add("user", user);
|
||||
@ -1640,7 +1644,7 @@ namespace Oshima.Core.Controllers
|
||||
}
|
||||
|
||||
return NetworkUtility.JsonSerialize($"角色 [ {character} ] 目前突破进度:{character.LevelBreak + 1}/{General.GameplayEquilibriumConstant.LevelBreakList.Count}" +
|
||||
$"\r\n该角色下一个等级突破阶段在 {General.GameplayEquilibriumConstant.LevelBreakList.ToArray()[character.LevelBreak]} 级,所需材料:\r\n" + FunGameService.GetLevelBreakNeedy(character.LevelBreak + 1));
|
||||
$"\r\n该角色下一个等级突破阶段在 {General.GameplayEquilibriumConstant.LevelBreakList.ToArray()[character.LevelBreak + 1]} 级,所需材料:\r\n" + FunGameService.GetLevelBreakNeedy(character.LevelBreak + 1));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1703,7 +1707,7 @@ namespace Oshima.Core.Controllers
|
||||
IEnumerable<Item> items = user.Inventory.Items.Where(i => i.Name == key);
|
||||
if (items.Count() >= needCount)
|
||||
{
|
||||
items = items.Reverse().Take(needCount);
|
||||
items = items.TakeLast(needCount);
|
||||
foreach (Item item in items)
|
||||
{
|
||||
user.Inventory.Items.Remove(item);
|
||||
@ -1723,7 +1727,7 @@ namespace Oshima.Core.Controllers
|
||||
if (originalBreak == character.LevelBreak)
|
||||
{
|
||||
return NetworkUtility.JsonSerialize($"突破失败!角色 [ {character} ] 目前突破进度:{character.LevelBreak + 1}/{General.GameplayEquilibriumConstant.LevelBreakList.Count}。" +
|
||||
$"\r\n该角色下一个等级突破阶段在 {General.GameplayEquilibriumConstant.LevelBreakList.ToArray()[character.LevelBreak]} 级,所需材料:\r\n" + FunGameService.GetLevelBreakNeedy(character.LevelBreak + 1));
|
||||
$"\r\n该角色下一个等级突破阶段在 {General.GameplayEquilibriumConstant.LevelBreakList.ToArray()[character.LevelBreak + 1]} 级,所需材料:\r\n" + FunGameService.GetLevelBreakNeedy(character.LevelBreak + 1));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1733,7 +1737,7 @@ namespace Oshima.Core.Controllers
|
||||
return NetworkUtility.JsonSerialize($"突破成功!角色 [ {character} ] 目前突破进度:{character.LevelBreak + 1}/{General.GameplayEquilibriumConstant.LevelBreakList.Count}。" +
|
||||
$"{(character.LevelBreak + 1 == General.GameplayEquilibriumConstant.LevelBreakList.Count ?
|
||||
"\r\n该角色已完成全部的突破阶段,恭喜!" :
|
||||
$"\r\n该角色下一个等级突破阶段在 {General.GameplayEquilibriumConstant.LevelBreakList.ToArray()[character.LevelBreak]} 级,所需材料:\r\n" + FunGameService.GetLevelBreakNeedy(character.LevelBreak + 1))}");
|
||||
$"\r\n该角色下一个等级突破阶段在 {General.GameplayEquilibriumConstant.LevelBreakList.ToArray()[character.LevelBreak + 1]} 级,所需材料:\r\n" + FunGameService.GetLevelBreakNeedy(character.LevelBreak + 1))}");
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -1765,31 +1769,41 @@ namespace Oshima.Core.Controllers
|
||||
string msg = "";
|
||||
if (user.IsAdmin)
|
||||
{
|
||||
if (FunGameService.AllItems.FirstOrDefault(i => i.Name == itemName) is Item item)
|
||||
PluginConfig pc2 = new("saved", targetid.ToString());
|
||||
pc2.LoadConfig();
|
||||
if (pc2.Count > 0)
|
||||
{
|
||||
PluginConfig pc2 = new("saved", targetid.ToString());
|
||||
pc2.LoadConfig();
|
||||
if (pc2.Count > 0)
|
||||
User user2 = FunGameService.GetUser(pc2);
|
||||
if (itemName == General.GameplayEquilibriumConstant.InGameCurrency)
|
||||
{
|
||||
user2.Inventory.Credits += itemCount;
|
||||
msg = $"已为 [ {user2} ] 生成 {itemCount} {General.GameplayEquilibriumConstant.InGameCurrency}";
|
||||
}
|
||||
else if (itemName == General.GameplayEquilibriumConstant.InGameMaterial)
|
||||
{
|
||||
user2.Inventory.Materials += itemCount;
|
||||
msg = $"已为 [ {user2} ] 生成 {itemCount} {General.GameplayEquilibriumConstant.InGameMaterial}";
|
||||
}
|
||||
else if (FunGameService.AllItems.FirstOrDefault(i => i.Name == itemName) is Item item)
|
||||
{
|
||||
User user2 = FunGameService.GetUser(pc2);
|
||||
for (int i = 0; i < itemCount; i++)
|
||||
{
|
||||
Item newItem = item.Copy();
|
||||
newItem.User = user2;
|
||||
user2.Inventory.Items.Add(newItem);
|
||||
}
|
||||
pc2.Add("user", user2);
|
||||
pc2.SaveConfig();
|
||||
msg = $"已为 [ {user2} ] 生成 {itemCount} 个 [{ItemSet.GetQualityTypeName(item.QualityType)}|{ItemSet.GetItemTypeName(item.ItemType)}] {item.Name}";
|
||||
}
|
||||
else
|
||||
{
|
||||
return NetworkUtility.JsonSerialize($"目标 UID 不存在!");
|
||||
return NetworkUtility.JsonSerialize($"此物品不存在!");
|
||||
}
|
||||
pc2.Add("user", user2);
|
||||
pc2.SaveConfig();
|
||||
}
|
||||
else
|
||||
{
|
||||
return NetworkUtility.JsonSerialize($"此物品不存在!");
|
||||
return NetworkUtility.JsonSerialize($"目标 UID 不存在!");
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -38,35 +38,41 @@ namespace Oshima.Core.Utils
|
||||
1, new()
|
||||
{
|
||||
{ General.GameplayEquilibriumConstant.InGameMaterial, 400 },
|
||||
{ nameof(升华之印), 40 }
|
||||
{ nameof(升华之印), 20 }
|
||||
}
|
||||
},
|
||||
{
|
||||
2, new()
|
||||
{
|
||||
{ General.GameplayEquilibriumConstant.InGameMaterial, 1040 },
|
||||
{ nameof(升华之印), 75 }
|
||||
{ General.GameplayEquilibriumConstant.InGameMaterial, 960 },
|
||||
{ nameof(升华之印), 30 },
|
||||
{ nameof(流光之印), 10 }
|
||||
}
|
||||
},
|
||||
{
|
||||
3, new()
|
||||
{
|
||||
{ General.GameplayEquilibriumConstant.InGameMaterial, 2320 },
|
||||
{ nameof(升华之印), 115 }
|
||||
{ General.GameplayEquilibriumConstant.InGameMaterial, 1760 },
|
||||
{ nameof(升华之印), 40 },
|
||||
{ nameof(流光之印), 20 }
|
||||
}
|
||||
},
|
||||
{
|
||||
4, new()
|
||||
{
|
||||
{ General.GameplayEquilibriumConstant.InGameMaterial, 4880 },
|
||||
{ nameof(升华之印), 160 }
|
||||
{ General.GameplayEquilibriumConstant.InGameMaterial, 2800 },
|
||||
{ nameof(升华之印), 50 },
|
||||
{ nameof(流光之印), 30 },
|
||||
{ nameof(永恒之印), 10 }
|
||||
}
|
||||
},
|
||||
{
|
||||
5, new()
|
||||
{
|
||||
{ General.GameplayEquilibriumConstant.InGameMaterial, 10000 },
|
||||
{ nameof(升华之印), 210 }
|
||||
{ General.GameplayEquilibriumConstant.InGameMaterial, 4080 },
|
||||
{ nameof(升华之印), 60 },
|
||||
{ nameof(流光之印), 40 },
|
||||
{ nameof(永恒之印), 20 }
|
||||
}
|
||||
},
|
||||
};
|
||||
@ -98,7 +104,7 @@ namespace Oshima.Core.Utils
|
||||
Equipment.AddRange([new 攻击之爪5(), new 攻击之爪15(), new 攻击之爪25(), new 攻击之爪35()]);
|
||||
|
||||
Items.AddRange(exItems.Values.Where(i => (int)i.ItemType > 4));
|
||||
Items.AddRange([new 小经验书(), new 中经验书(), new 大经验书(), new 升华之印()]);
|
||||
Items.AddRange([new 小经验书(), new 中经验书(), new 大经验书(), new 升华之印(), new 流光之印(), new 永恒之印()]);
|
||||
|
||||
AllItems.AddRange(Equipment);
|
||||
AllItems.AddRange(Items);
|
||||
|
@ -15,12 +15,12 @@ namespace Oshima.FunGame.OshimaModules.Effects.OpenEffects
|
||||
|
||||
public override void OnEffectGained(Character character)
|
||||
{
|
||||
character.AccelerationCoefficient += 实际加成;
|
||||
character.ExAccelerationCoefficient += 实际加成;
|
||||
}
|
||||
|
||||
public override void OnEffectLost(Character character)
|
||||
{
|
||||
character.AccelerationCoefficient -= 实际加成;
|
||||
character.ExAccelerationCoefficient -= 实际加成;
|
||||
}
|
||||
|
||||
public AccelerationCoefficient(Skill skill, Dictionary<string, object> args, Character? source = null) : base(skill, args)
|
||||
|
@ -18,5 +18,7 @@
|
||||
public enum SpecialItemID : long
|
||||
{
|
||||
升华之印 = 18001,
|
||||
流光之印 = 18002,
|
||||
永恒之印 = 18003,
|
||||
}
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ namespace Oshima.FunGame.OshimaModules.Items
|
||||
{
|
||||
public override long Id => (long)SpecialItemID.升华之印;
|
||||
public override string Name => "升华之印";
|
||||
public override string Description => Skills.Passives.Count > 0 ? Skills.Passives.First().Description : "";
|
||||
public override string Description => "角色突破等阶必备的初级材料。";
|
||||
public override QualityType QualityType => QualityType.White;
|
||||
}
|
||||
}
|
||||
|
13
OshimaModules/Items/SpecialItem/永恒之印.cs
Normal file
13
OshimaModules/Items/SpecialItem/永恒之印.cs
Normal file
@ -0,0 +1,13 @@
|
||||
using Milimoe.FunGame.Core.Entity;
|
||||
using Milimoe.FunGame.Core.Library.Constant;
|
||||
|
||||
namespace Oshima.FunGame.OshimaModules.Items
|
||||
{
|
||||
public class 永恒之印() : Item(ItemType.SpecialItem)
|
||||
{
|
||||
public override long Id => (long)SpecialItemID.永恒之印;
|
||||
public override string Name => "永恒之印";
|
||||
public override string Description => "角色突破等阶必备的高级材料。";
|
||||
public override QualityType QualityType => QualityType.Blue;
|
||||
}
|
||||
}
|
13
OshimaModules/Items/SpecialItem/流光之印.cs
Normal file
13
OshimaModules/Items/SpecialItem/流光之印.cs
Normal file
@ -0,0 +1,13 @@
|
||||
using Milimoe.FunGame.Core.Entity;
|
||||
using Milimoe.FunGame.Core.Library.Constant;
|
||||
|
||||
namespace Oshima.FunGame.OshimaModules.Items
|
||||
{
|
||||
public class 流光之印() : Item(ItemType.SpecialItem)
|
||||
{
|
||||
public override long Id => (long)SpecialItemID.流光之印;
|
||||
public override string Name => "流光之印";
|
||||
public override string Description => "角色突破等阶必备的中级材料。";
|
||||
public override QualityType QualityType => QualityType.Green;
|
||||
}
|
||||
}
|
@ -33,6 +33,8 @@ namespace Oshima.FunGame.OshimaModules
|
||||
(long)ConsumableID.中经验书 => new 中经验书(),
|
||||
(long)ConsumableID.大经验书 => new 大经验书(),
|
||||
(long)SpecialItemID.升华之印 => new 升华之印(),
|
||||
(long)SpecialItemID.流光之印 => new 流光之印(),
|
||||
(long)SpecialItemID.永恒之印 => new 永恒之印(),
|
||||
_ => null,
|
||||
};
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user