mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 19:41:59 -08:00
Fix TODO on Siege Behemoth
This commit is contained in:
parent
9108104fe5
commit
e0932efa8b
1 changed files with 44 additions and 12 deletions
|
|
@ -3,19 +3,21 @@ package mage.cards.s;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.DamageAsThoughNotBlockedAbility;
|
import mage.abilities.common.DamageAsThoughNotBlockedAbility;
|
||||||
import mage.abilities.common.SimpleStaticAbility;
|
import mage.abilities.common.SimpleStaticAbility;
|
||||||
import mage.abilities.condition.common.SourceAttackingCondition;
|
import mage.abilities.condition.common.SourceAttackingCondition;
|
||||||
import mage.abilities.decorator.ConditionalContinuousEffect;
|
import mage.abilities.decorator.ConditionalContinuousEffect;
|
||||||
|
import mage.abilities.effects.AsThoughEffectImpl;
|
||||||
import mage.abilities.effects.common.continuous.GainAbilityControlledEffect;
|
import mage.abilities.effects.common.continuous.GainAbilityControlledEffect;
|
||||||
import mage.abilities.keyword.HexproofAbility;
|
import mage.abilities.keyword.HexproofAbility;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.*;
|
||||||
import mage.constants.SubType;
|
|
||||||
import mage.constants.Duration;
|
|
||||||
import mage.constants.Zone;
|
|
||||||
import mage.filter.common.FilterCreaturePermanent;
|
import mage.filter.common.FilterCreaturePermanent;
|
||||||
|
import mage.game.Game;
|
||||||
|
import mage.game.permanent.Permanent;
|
||||||
|
import mage.players.Player;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
@ -34,15 +36,9 @@ public final class SiegeBehemoth extends CardImpl {
|
||||||
|
|
||||||
// Hexproof
|
// Hexproof
|
||||||
this.addAbility(HexproofAbility.getInstance());
|
this.addAbility(HexproofAbility.getInstance());
|
||||||
|
|
||||||
// As long as Siege Behemoth is attacking, for each creature you control, you may have that creature assign its combat damage as though it weren't blocked.
|
// As long as Siege Behemoth is attacking, for each creature you control, you may have that creature assign its combat damage as though it weren't blocked.
|
||||||
// TODO: DamageAsThoughNotBlockedAbility should be done by rule modifying effect instead of adding ability (if controlled creature looses all abilities it should'nt loose this effect)
|
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SiegeBehemothEffect()));
|
||||||
this.addAbility(new SimpleStaticAbility(
|
|
||||||
Zone.BATTLEFIELD,
|
|
||||||
new ConditionalContinuousEffect(
|
|
||||||
new GainAbilityControlledEffect(DamageAsThoughNotBlockedAbility.getInstance(), Duration.WhileOnBattlefield, filter),
|
|
||||||
SourceAttackingCondition.instance,
|
|
||||||
"As long as {this} is attacking, for each creature you control, you may have that creature assign its combat damage as though it weren't blocked"
|
|
||||||
)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public SiegeBehemoth(final SiegeBehemoth card) {
|
public SiegeBehemoth(final SiegeBehemoth card) {
|
||||||
|
|
@ -54,3 +50,39 @@ public final class SiegeBehemoth extends CardImpl {
|
||||||
return new SiegeBehemoth(this);
|
return new SiegeBehemoth(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class SiegeBehemothEffect extends AsThoughEffectImpl {
|
||||||
|
|
||||||
|
public SiegeBehemothEffect() {
|
||||||
|
super(AsThoughEffectType.DAMAGE_NOT_BLOCKED, Duration.WhileOnBattlefield, Outcome.Damage);
|
||||||
|
this.staticText = "As long as {this} is attacking, for each creature you control, you may have that creature assign its combat damage as though it weren't blocked";
|
||||||
|
}
|
||||||
|
|
||||||
|
public SiegeBehemothEffect(SiegeBehemothEffect effect) {
|
||||||
|
super(effect);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) {
|
||||||
|
Permanent sourcePermanent = source.getSourcePermanentIfItStillExists(game);
|
||||||
|
if (sourcePermanent != null && sourcePermanent.isAttacking()){
|
||||||
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
|
Permanent otherCreature = game.getPermanent(sourceId);
|
||||||
|
if (controller != null && otherCreature != null && otherCreature.isControlledBy(controller.getId())){
|
||||||
|
return controller.chooseUse(Outcome.Damage, "Do you wish to assign damage for "
|
||||||
|
+ otherCreature.getLogName() + " as though it weren't blocked?", source, game);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean apply(Game game, Ability source) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SiegeBehemothEffect copy() {
|
||||||
|
return new SiegeBehemothEffect(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue