mirror of
https://github.com/project-redbud/FunGame-Core.git
synced 2025-12-05 00:06:02 +00:00
添加遗漏的升级钩子
This commit is contained in:
parent
72d29cff5f
commit
86066ba0f0
@ -1190,6 +1190,7 @@ namespace Milimoe.FunGame.Core.Entity
|
||||
/// <param name="checkLevelBreak"></param>
|
||||
public void OnLevelUp(int level = 0, bool checkLevelBreak = true)
|
||||
{
|
||||
bool isUp = false;
|
||||
int count = 0;
|
||||
while (true)
|
||||
{
|
||||
@ -1213,6 +1214,7 @@ namespace Milimoe.FunGame.Core.Entity
|
||||
{
|
||||
EXP -= need;
|
||||
Level++;
|
||||
isUp = true;
|
||||
OnAttributeChanged();
|
||||
Recovery();
|
||||
}
|
||||
@ -1221,6 +1223,14 @@ namespace Milimoe.FunGame.Core.Entity
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (isUp)
|
||||
{
|
||||
Effect[] effects = [.. Effects.Where(e => e.IsInEffect)];
|
||||
foreach (Effect e in effects)
|
||||
{
|
||||
e.OnOwnerLevelUp(this, Level);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@ -288,6 +288,14 @@ namespace Milimoe.FunGame.Core.Entity
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Level > 0 && Character != null)
|
||||
{
|
||||
Effect[] effects = [.. Character.Effects.Where(e => e.IsInEffect)];
|
||||
foreach (Effect e in effects)
|
||||
{
|
||||
e.OnSkillLevelUp(Character, Level);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user