mirror of
https://github.com/project-redbud/FunGame-Core.git
synced 2025-12-05 08:09: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>
|
/// <param name="checkLevelBreak"></param>
|
||||||
public void OnLevelUp(int level = 0, bool checkLevelBreak = true)
|
public void OnLevelUp(int level = 0, bool checkLevelBreak = true)
|
||||||
{
|
{
|
||||||
|
bool isUp = false;
|
||||||
int count = 0;
|
int count = 0;
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
@ -1213,6 +1214,7 @@ namespace Milimoe.FunGame.Core.Entity
|
|||||||
{
|
{
|
||||||
EXP -= need;
|
EXP -= need;
|
||||||
Level++;
|
Level++;
|
||||||
|
isUp = true;
|
||||||
OnAttributeChanged();
|
OnAttributeChanged();
|
||||||
Recovery();
|
Recovery();
|
||||||
}
|
}
|
||||||
@ -1221,6 +1223,14 @@ namespace Milimoe.FunGame.Core.Entity
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (isUp)
|
||||||
|
{
|
||||||
|
Effect[] effects = [.. Effects.Where(e => e.IsInEffect)];
|
||||||
|
foreach (Effect e in effects)
|
||||||
|
{
|
||||||
|
e.OnOwnerLevelUp(this, Level);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <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>
|
/// <summary>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user