aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.Client/Common/Tutorial/EffectChangedTask.cpp
diff options
context:
space:
mode:
authordaoge_cmd <3523206925@qq.com>2026-03-01 12:16:08 +0800
committerdaoge_cmd <3523206925@qq.com>2026-03-01 12:16:08 +0800
commitb691c43c44ff180d10e7d4a9afc83b98551ff586 (patch)
tree3e9849222cbc6ba49f2f1fc6e5fe7179632c7390 /Minecraft.Client/Common/Tutorial/EffectChangedTask.cpp
parentdef8cb415354ac390b7e89052a50605285f1aca9 (diff)
Initial commit
Diffstat (limited to 'Minecraft.Client/Common/Tutorial/EffectChangedTask.cpp')
-rw-r--r--Minecraft.Client/Common/Tutorial/EffectChangedTask.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/Minecraft.Client/Common/Tutorial/EffectChangedTask.cpp b/Minecraft.Client/Common/Tutorial/EffectChangedTask.cpp
new file mode 100644
index 00000000..5f1b5b20
--- /dev/null
+++ b/Minecraft.Client/Common/Tutorial/EffectChangedTask.cpp
@@ -0,0 +1,31 @@
+#include "stdafx.h"
+#include "..\..\..\Minecraft.World\net.minecraft.world.effect.h"
+#include "EffectChangedTask.h"
+
+EffectChangedTask::EffectChangedTask(Tutorial *tutorial, int descriptionId, MobEffect *effect, bool apply,
+ bool enablePreCompletion, bool bShowMinimumTime, bool bAllowFade, bool bTaskReminders )
+ : TutorialTask(tutorial,descriptionId,enablePreCompletion,NULL,bShowMinimumTime,bAllowFade,bTaskReminders)
+{
+ m_effect = effect;
+ m_apply = apply;
+}
+
+bool EffectChangedTask::isCompleted()
+{
+ return bIsCompleted;
+}
+
+void EffectChangedTask::onEffectChanged(MobEffect *effect, bool bRemoved /*=false*/)
+{
+ if(effect == m_effect)
+ {
+ if(m_apply == !bRemoved)
+ {
+ bIsCompleted = true;
+ }
+ else
+ {
+ bIsCompleted = false;
+ }
+ }
+} \ No newline at end of file