mirror of
https://github.com/oshima-studios/OshimaGameModule.git
synced 2025-08-02 03:52:59 +00:00
修复了传入 skillsDefined 时没有按定义的 args 构造特效;添加经验值相关的功能
This commit is contained in:
parent
154f837962
commit
d1eed22ee7
@ -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("已重置所有人的今日运势");
|
||||||
|
@ -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) }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -199,6 +199,11 @@
|
|||||||
/// 立即获得能量值,参数:ep
|
/// 立即获得能量值,参数:ep
|
||||||
/// </summary>
|
/// </summary>
|
||||||
GetEP = 8705,
|
GetEP = 8705,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 立即获得经验值,参数:exp
|
||||||
|
/// </summary>
|
||||||
|
GetEXP = 8706,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 主动特效终点
|
/// 主动特效终点
|
||||||
|
@ -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;
|
||||||
|
35
OshimaModules/Effects/ItemEffects/GetEXP.cs
Normal file
35
OshimaModules/Effects/ItemEffects/GetEXP.cs
Normal 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 += 实际获得;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -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
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -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)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user