From bed49c0230adf5691a79d8d374a9f0837c779e69 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Fri, 17 May 2024 17:05:21 -0500 Subject: [PATCH] stealth breaking when attacking --- src/engine/jobs/AttackJob.java | 5 +++++ src/engine/mobileAI/utilities/CombatUtilities.java | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/engine/jobs/AttackJob.java b/src/engine/jobs/AttackJob.java index affed880..28b72aed 100644 --- a/src/engine/jobs/AttackJob.java +++ b/src/engine/jobs/AttackJob.java @@ -9,9 +9,11 @@ package engine.jobs; +import engine.Enum; import engine.gameManager.CombatManager; import engine.job.AbstractJob; import engine.objects.AbstractCharacter; +import engine.objects.PlayerCharacter; public class AttackJob extends AbstractJob { @@ -29,6 +31,9 @@ public class AttackJob extends AbstractJob { @Override protected void doJob() { CombatManager.doCombat(this.source, slot); + if(this.source.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)) + if(((PlayerCharacter)this.source).getHidden() > 0) + this.source.removeEffectBySource(Enum.EffectSourceType.Invisibility,41,true); } public boolean success() { diff --git a/src/engine/mobileAI/utilities/CombatUtilities.java b/src/engine/mobileAI/utilities/CombatUtilities.java index 021082cd..b5cc958a 100644 --- a/src/engine/mobileAI/utilities/CombatUtilities.java +++ b/src/engine/mobileAI/utilities/CombatUtilities.java @@ -304,7 +304,6 @@ public class CombatUtilities { if (targetMob.isSiege()) return; } - } public static float determineDamage(Mob agent) {