From 35865db2ceee38e161c7dbcb0824e6aff0b7e1ac Mon Sep 17 00:00:00 2001 From: Veradictus Date: Thu, 28 Sep 2023 01:46:52 -0600 Subject: [PATCH] fix: effect potions --- .../server/data/plugins/items/effectpotion.ts | 36 ++++++++++++++++--- packages/server/src/info/formulas.ts | 11 ++++-- 2 files changed, 40 insertions(+), 7 deletions(-) diff --git a/packages/server/data/plugins/items/effectpotion.ts b/packages/server/data/plugins/items/effectpotion.ts index df03854be3..f6079eb2cd 100644 --- a/packages/server/data/plugins/items/effectpotion.ts +++ b/packages/server/data/plugins/items/effectpotion.ts @@ -30,19 +30,47 @@ export default class EffectPotion implements Plugin { private getEffect(): Modules.Effects { switch (this.effect) { case 'accuracy': { - return Modules.Effects.AccuracyPotion; + return Modules.Effects.AccuracyBuff; } case 'strength': { - return Modules.Effects.StrengthPotion; + return Modules.Effects.StrengthBuff; } case 'defense': { - return Modules.Effects.DefensePotion; + return Modules.Effects.DefenseBuff; + } + + case 'magic': { + return Modules.Effects.MagicBuff; + } + + case 'archery': { + return Modules.Effects.ArcheryBuff; + } + + case 'accuracysuper': { + return Modules.Effects.AccuracySuperBuff; + } + + case 'strengthsuper': { + return Modules.Effects.StrengthSuperBuff; + } + + case 'defensesuper': { + return Modules.Effects.DefenseSuperBuff; + } + + case 'magicsuper': { + return Modules.Effects.MagicSuperBuff; + } + + case 'archerysuper': { + return Modules.Effects.ArcherySuperBuff; } default: { - return Modules.Effects.StrengthPotion; + return Modules.Effects.StrengthBuff; } } } diff --git a/packages/server/src/info/formulas.ts b/packages/server/src/info/formulas.ts index 3e6141b076..49b2a0daf6 100644 --- a/packages/server/src/info/formulas.ts +++ b/packages/server/src/info/formulas.ts @@ -121,10 +121,12 @@ export default { } // Increase accuracy if the attacker has the accuracy potion effect. - if (attacker.status.has(Modules.Effects.AccuracyPotion)) accuracy -= 0.07; + if (attacker.status.has(Modules.Effects.AccuracyBuff)) accuracy -= 0.07; + if (attacker.status.has(Modules.Effects.AccuracySuperBuff)) accuracy -= 0.12; // Decrease accuracy if the target has the defense potion effect. - if (target.status.has(Modules.Effects.DefensePotion)) accuracy += 0.08; + if (target.status.has(Modules.Effects.DefenseBuff)) accuracy += 0.08; + if (target.status.has(Modules.Effects.DefenseSuperBuff)) accuracy += 0.12; // Increase accuracy if the target has the terror effect. if (target.status.has(Modules.Effects.Terror)) accuracy -= 0.4; @@ -186,7 +188,10 @@ export default { } // Apply a 10% damage boost if the character has the strength potion effect. - if (character.status.has(Modules.Effects.StrengthPotion)) damage *= 1.1; + if (character.status.has(Modules.Effects.StrengthBuff)) damage *= 1.1; + + // Apply 15% damage boost if the character has the super strength potion effect. + if (character.status.has(Modules.Effects.StrengthSuperBuff)) damage *= 1.15; // Ensure the damage is not negative. if (damage < 0) damage = 0;