From 86066ba0f0c602a9d6cd0c523033bd3a7aa47380 Mon Sep 17 00:00:00 2001 From: milimoe Date: Tue, 8 Jul 2025 23:51:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=81=97=E6=BC=8F=E7=9A=84?= =?UTF-8?q?=E5=8D=87=E7=BA=A7=E9=92=A9=E5=AD=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Entity/Character/Character.cs | 10 ++++++++++ Entity/Skill/Skill.cs | 8 ++++++++ 2 files changed, 18 insertions(+) diff --git a/Entity/Character/Character.cs b/Entity/Character/Character.cs index 9f40818..37da4b0 100644 --- a/Entity/Character/Character.cs +++ b/Entity/Character/Character.cs @@ -1190,6 +1190,7 @@ namespace Milimoe.FunGame.Core.Entity /// 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); + } + } } /// diff --git a/Entity/Skill/Skill.cs b/Entity/Skill/Skill.cs index f56e688..61dde4f 100644 --- a/Entity/Skill/Skill.cs +++ b/Entity/Skill/Skill.cs @@ -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); + } + } } ///