/** * Will set the Infect Status to the Given int * Giving a -1 will make this Enemy Permanently Infected */ public void setInfectStatus(int newInfectStatus) { infectedTimer = newInfectStatus; if (infectedTimer > 0) { infectCloud.visible = true; infectBar.visible = true; if (infectBar.getMaxSegments() < infectedTimer) { infectBar.setMaxSegments(infectedTimer); infectBar.setFilledSegments(infectedTimer); } else { infectBar.setFilledSegments(infectedTimer); } } else { infectCloud.visible = false; infectBar.visible = false; infectBar.setMaxSegments(1); infectedTimer = 0; } }