From 9290d6700081652c76ad275df7c1136c0d457e4f Mon Sep 17 00:00:00 2001 From: Danewolf Date: Wed, 23 Aug 2023 07:20:48 +0000 Subject: [PATCH] Antipoison effects now trigger for the correct durations --- .../main/content/data/consumables/Consumables.java | 11 +++++++---- .../data/consumables/effects/AddTimerEffect.kt | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Server/src/main/content/data/consumables/Consumables.java b/Server/src/main/content/data/consumables/Consumables.java index 22a5eeb32..551fd1d0e 100644 --- a/Server/src/main/content/data/consumables/Consumables.java +++ b/Server/src/main/content/data/consumables/Consumables.java @@ -10,6 +10,9 @@ import content.data.consumables.effects.KegOfBeerEffect; import java.util.HashMap; +import static core.tools.TickUtilsKt.minutesToTicks; +import static core.tools.TickUtilsKt.secondsToTicks; + /** * Represents a repository of active consumables in the framework. */ @@ -320,10 +323,10 @@ public enum Consumables { SUPER_STRENGTH(new Potion(new int[] {2440, 157, 159, 161}, new SkillEffect(Skills.STRENGTH, 3, 0.2))), SUPER_ATTACK(new Potion(new int[] {2436, 145, 147, 149}, new SkillEffect(Skills.ATTACK, 3, 0.2))), SUPER_DEFENCE(new Potion(new int[] {2442, 163, 165, 167}, new SkillEffect(Skills.DEFENCE, 3, 0.2))), - ANTIPOISON(new Potion(new int[] {2446, 175, 177, 179}, new AddTimerEffect("poison:immunity", 143))), - ANTIPOISON_(new Potion(new int[] {5943, 5945, 5947, 5949}, new AddTimerEffect("poison:immunity", 863))), - ANTIPOISON__(new Potion(new int[] {5952, 5954, 5956, 5958}, new AddTimerEffect("poison:immunity", 2000))), - SUPER_ANTIP(new Potion(new int[] {2448, 181, 183, 185}, new AddTimerEffect("poison:immunity", 1000))), + ANTIPOISON(new Potion(new int[] {2446, 175, 177, 179}, new AddTimerEffect("poison:immunity", secondsToTicks(90)))), + ANTIPOISON_(new Potion(new int[] {5943, 5945, 5947, 5949}, new AddTimerEffect("poison:immunity", minutesToTicks(9)))), + ANTIPOISON__(new Potion(new int[] {5952, 5954, 5956, 5958}, new AddTimerEffect("poison:immunity", minutesToTicks(12)))), + SUPER_ANTIP(new Potion(new int[] {2448, 181, 183, 185}, new AddTimerEffect("poison:immunity", minutesToTicks(6)))), RELICYM(new Potion(new int[] {4842, 4844, 4846, 4848}, new MultiEffect(new SetAttributeEffect("disease:immunity", 300), new RemoveTimerEffect("disease")))), AGILITY(new Potion(new int[] {3032, 3034, 3036, 3038}, new SkillEffect(Skills.AGILITY, 3, 0))), HUNTER(new Potion(new int[] {9998, 10000, 10002, 10004}, new SkillEffect(Skills.HUNTER, 3, 0))), diff --git a/Server/src/main/content/data/consumables/effects/AddTimerEffect.kt b/Server/src/main/content/data/consumables/effects/AddTimerEffect.kt index fc0e5426c..29167ee1e 100644 --- a/Server/src/main/content/data/consumables/effects/AddTimerEffect.kt +++ b/Server/src/main/content/data/consumables/effects/AddTimerEffect.kt @@ -7,7 +7,7 @@ import core.game.node.entity.player.Player class AddTimerEffect (val identifier: String, vararg val args: Any) : ConsumableEffect() { override fun activate (p: Player) { - val timer = spawnTimer (identifier, args) ?: return + val timer = spawnTimer (identifier, *args) ?: return registerTimer (p, timer) } }