private void applyEndOfRoundEffects() {
for (Slot slot : this) {
// Condition effects
for (Iterator<ConditionEffect> conditionEffectIterator = slot.leader().getConditionEffects().iterator(); conditionEffectIterator.hasNext();) {
ConditionEffect conditionEffect = conditionEffectIterator.next();
if (Math.random() <= conditionEffect.persistanceChance()) {
log(slot.leader().name() + conditionEffect.getPersistanceMessage());
if (conditionEffect.damagePercentage() > 0) {
int damage = (int) (slot.leader().maxHealth() * conditionEffect.damagePercentage());
slot.leader().takeDamage(damage);
log(slot.leader().name() + " took " + damage + " damage!");
}
}
else {
log(slot.leader().name() + conditionEffect.getDissipationMessage());
conditionEffectIterator.remove();
}
}
// Slot effects