public void shieldVillage() { if (GameData.villageShield()) { showNotif("Shield is already activated."); } else if (shieldMana <= GameData.mana()) { Sfx.playShield(); GameData.setVillageShield(true); GameData.setShieldDuration(3600); showShieldBuff(); if (GameData.mana() - shieldMana < 0) { GameData.setMana(0); manaBar.addAction(scaleTo(0f, 1f, 1f)); } else { GameData.setMana(GameData.mana() - shieldMana); lobby.updateLabels(); } mana.setText(GameData.mana() + "/" + GameData.maxMana()); closeUi(); } else { showMagicAd(); int neededMana = shieldMana - GameData.mana(); showNotif("Need " + neededMana + " more mana."); } }
public void shieldReady() { if (GameData.villageShield()) { Gdx.app.log("Seconds", lobby.timepassed + ""); minusDur = lobby.seconds - GameData.logInTime(); GameData.setShieldDuration(GameData.shieldDuration() - (int) lobby.timepassed); if (GameData.shieldDuration() > 0) { showShieldBuff(); } else { GameData.setVillageShield(false); } } }