mirror of
https://github.com/correl/mage.git
synced 2024-12-26 19:16:54 +00:00
* Rampaging Cyclops - Fixed that its power was not reduced if blocked by 2 or more blockers.
This commit is contained in:
parent
8f45bb71f4
commit
ec90f35e0f
1 changed files with 4 additions and 17 deletions
|
@ -34,11 +34,11 @@ import mage.abilities.common.SimpleStaticAbility;
|
||||||
import mage.abilities.condition.Condition;
|
import mage.abilities.condition.Condition;
|
||||||
import mage.abilities.decorator.ConditionalContinuousEffect;
|
import mage.abilities.decorator.ConditionalContinuousEffect;
|
||||||
import mage.abilities.effects.common.continuous.BoostSourceEffect;
|
import mage.abilities.effects.common.continuous.BoostSourceEffect;
|
||||||
import mage.constants.SubType;
|
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Duration;
|
import mage.constants.Duration;
|
||||||
|
import mage.constants.SubType;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.combat.CombatGroup;
|
import mage.game.combat.CombatGroup;
|
||||||
|
@ -83,24 +83,11 @@ enum RampagingCyclopsCondition implements Condition {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Permanent permanent = game.getBattlefield().getPermanent(source.getSourceId());
|
Permanent permanent = game.getBattlefield().getPermanent(source.getSourceId());
|
||||||
if (permanent == null) {
|
if (permanent == null || !permanent.isAttacking()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
for (CombatGroup group : game.getCombat().getBlockingGroups()) {
|
CombatGroup combatGroup = game.getCombat().findGroup(permanent.getId());
|
||||||
if (group.getAttackers().contains(permanent.getId())) {
|
return combatGroup != null && combatGroup.getBlockers().size() > 1;
|
||||||
int blockerCount = 0;
|
|
||||||
for (UUID blockerId : group.getBlockers()) {
|
|
||||||
Permanent blocker = game.getPermanent(blockerId);
|
|
||||||
if (blocker != null) {
|
|
||||||
blockerCount++;
|
|
||||||
}
|
|
||||||
if (blockerCount > 1) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue