修复了传入 skillsDefined 时没有按定义的 args 构造特效;添加经验值相关的功能

This commit is contained in:
milimoe 2024-12-17 01:31:32 +08:00
parent 154f837962
commit d1eed22ee7
Signed by: milimoe
GPG Key ID: 05D280912DA6C69E
7 changed files with 50 additions and 18 deletions

View File

@ -48,22 +48,6 @@ namespace Oshima.Core.WebAPI
Ignore.InitIgnore(); Ignore.InitIgnore();
FunGameService.InitFunGame(); FunGameService.InitFunGame();
FunGameActionQueue.InitFunGameActionQueue(); FunGameActionQueue.InitFunGameActionQueue();
List<(int start, int end, double expPerLevel)> levelRanges = [
(1, 9, 1000),
(10, 19, 1500),
(20, 29, 2000),
(30, 39, 3000),
(40, 49, 4000),
(50, 59, 5000)
];
foreach (var (start, end, expPerLevel) in levelRanges)
{
for (int level = start; level <= end; level++)
{
General.GameplayEquilibriumConstant.EXPUpperLimit[level] = expPerLevel;
}
}
General.GameplayEquilibriumConstant.EXPUpperLimit[60] = 9999999999999;
TaskScheduler.Shared.AddTask("重置每日运势", new TimeSpan(0, 0, 0), () => TaskScheduler.Shared.AddTask("重置每日运势", new TimeSpan(0, 0, 0), () =>
{ {
Controller.WriteLine("已重置所有人的今日运势"); Controller.WriteLine("已重置所有人的今日运势");

View File

@ -1017,6 +1017,13 @@ namespace Oshima.Core.Utils
{ {
{ "mp", Math.Clamp(Random.Shared.NextDouble(), 0.09, 0.18) } { "mp", Math.Clamp(Random.Shared.NextDouble(), 0.09, 0.18) }
} }
},
{
EffectID.GetEP,
new()
{
{ "ep", Random.Shared.Next(20, 40) }
}
} }
}; };
} }

View File

@ -199,6 +199,11 @@
/// 立即获得能量值参数ep /// 立即获得能量值参数ep
/// </summary> /// </summary>
GetEP = 8705, GetEP = 8705,
/// <summary>
/// 立即获得经验值参数exp
/// </summary>
GetEXP = 8706,
/// <summary> /// <summary>
/// 主动特效终点 /// 主动特效终点

View File

@ -8,7 +8,7 @@ namespace Oshima.FunGame.OshimaModules.Effects.ItemEffects
{ {
public override long Id => (long)EffectID.GetEP; public override long Id => (long)EffectID.GetEP;
public override string Name => "立即获得能量值"; public override string Name => "立即获得能量值";
public override string Description => $"立即获得角色 {实际获得:0.##} 点能量值。" + (Source != null && Skill.Character != Source ? $"来自:[ {Source} ]" + (Skill.Item != null ? $" 的 [ {Skill.Item.Name} ]" : "") : ""); public override string Description => $"角色立即获得 {实际获得:0.##} 点能量值。" + (Source != null && Skill.Character != Source ? $"来自:[ {Source} ]" + (Skill.Item != null ? $" 的 [ {Skill.Item.Name} ]" : "") : "");
public override EffectType EffectType => EffectType.Item; public override EffectType EffectType => EffectType.Item;
private readonly double = 0; private readonly double = 0;

View File

@ -0,0 +1,35 @@
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
using Oshima.FunGame.OshimaModules.Effects.OpenEffects;
namespace Oshima.FunGame.OshimaModules.Effects.ItemEffects
{
public class GetEXP : Effect
{
public override long Id => (long)EffectID.GetEXP;
public override string Name => "立即获得经验值";
public override string Description => $"角色立即获得 {实际获得:0.##} 点经验值。" + (Source != null && Skill.Character != Source ? $"来自:[ {Source} ]" + (Skill.Item != null ? $" 的 [ {Skill.Item.Name} ]" : "") : "");
public override EffectType EffectType => EffectType.Item;
private readonly double = 0;
public GetEXP(Skill skill, Dictionary<string, object> args, Character? source = null) : base(skill, args)
{
GamingQueue = skill.GamingQueue;
Source = source;
if (Values.Count > 0)
{
string key = Values.Keys.FirstOrDefault(s => s.Equals("exp", StringComparison.CurrentCultureIgnoreCase)) ?? "";
if (key.Length > 0 && double.TryParse(Values[key].ToString(), out double exp) && exp > 0)
{
= exp;
}
}
}
public override void OnSkillCasted(Character caster, List<Character> targets, Dictionary<string, object> others)
{
caster.EXP += ;
}
}
}

View File

@ -117,6 +117,7 @@ namespace Oshima.FunGame.OshimaModules
EffectID.RecoverHP2 => new RecoverHP2(skill, dict), EffectID.RecoverHP2 => new RecoverHP2(skill, dict),
EffectID.RecoverMP2 => new RecoverMP2(skill, dict), EffectID.RecoverMP2 => new RecoverMP2(skill, dict),
EffectID.GetEP => new GetEP(skill, dict), EffectID.GetEP => new GetEP(skill, dict),
EffectID.GetEXP => new GetEXP(skill, dict),
_ => null _ => null
}; };
} }

View File

@ -26,7 +26,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
public override string Name => Skill.Name; public override string Name => Skill.Name;
public override string Description => $"每时间提升 {伤害提升 * 100:0.##}% 所有伤害,无上限,但受到伤害时效果清零。" + ( > 0 ? $"(当前总提升:{累计伤害 * 100:0.##}%" : ""); public override string Description => $"每时间提升 {伤害提升 * 100:0.##}% 所有伤害,无上限,但受到伤害时效果清零。" + ( > 0 ? $"(当前总提升:{累计伤害 * 100:0.##}%" : "");
private readonly double = 0.04; private readonly double = 0.03;
private double = 0; private double = 0;
public override double AlterActualDamageAfterCalculation(Character character, Character enemy, double damage, bool isNormalAttack, bool isMagicDamage, MagicType magicType, DamageResult damageResult, ref bool isEvaded, Dictionary<Effect, double> totalDamageBonus) public override double AlterActualDamageAfterCalculation(Character character, Character enemy, double damage, bool isNormalAttack, bool isMagicDamage, MagicType magicType, DamageResult damageResult, ref bool isEvaded, Dictionary<Effect, double> totalDamageBonus)