mirror of
https://github.com/magefree/mage.git
synced 2025-12-30 07:22:03 -08:00
* Added Fumiko, the Lowblood-
This commit is contained in:
parent
3c7b414ee6
commit
ad2c062552
4 changed files with 167 additions and 10 deletions
|
|
@ -0,0 +1,55 @@
|
|||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
package mage.abilities.effects.common.combat;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.RequirementEffect;
|
||||
import mage.constants.Duration;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class AttacksIfAbleAllEffect extends RequirementEffect<AttacksIfAbleAllEffect> {
|
||||
|
||||
private final FilterCreaturePermanent filter;
|
||||
|
||||
public AttacksIfAbleAllEffect(FilterCreaturePermanent filter) {
|
||||
super(Duration.WhileOnBattlefield);
|
||||
staticText = new StringBuilder(filter.getMessage()).append(" attack each turn if able").toString();
|
||||
this.filter = filter;
|
||||
}
|
||||
|
||||
public AttacksIfAbleAllEffect(final AttacksIfAbleAllEffect effect) {
|
||||
super(effect);
|
||||
this.filter = effect.filter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AttacksIfAbleAllEffect copy() {
|
||||
return new AttacksIfAbleAllEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(Permanent permanent, Ability source, Game game) {
|
||||
return filter.match(permanent, source.getSourceId(), source.getControllerId(), game);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean mustAttack(Game game) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean mustBlock(Game game) {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -27,21 +27,37 @@
|
|||
*/
|
||||
package mage.abilities.keyword;
|
||||
|
||||
import mage.constants.Duration;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.dynamicvalue.common.StaticValue;
|
||||
import mage.abilities.effects.common.continious.BoostSourceEffect;
|
||||
import mage.constants.Duration;
|
||||
import mage.game.Game;
|
||||
|
||||
public class BushidoAbility extends BlocksOrBecomesBlockedTriggeredAbility {
|
||||
private int value;
|
||||
|
||||
private DynamicValue value;
|
||||
private String rule = null;
|
||||
|
||||
public BushidoAbility(int value) {
|
||||
this(new StaticValue(value));
|
||||
rule = new StringBuilder("Bushido ").append(value).toString();
|
||||
}
|
||||
|
||||
public BushidoAbility(DynamicValue value) {
|
||||
super(new BoostSourceEffect(value, value, Duration.EndOfTurn), false);
|
||||
if (rule == null) {
|
||||
rule = new StringBuilder("{this} has bushido X, where X is ").append(value.getMessage()).toString();
|
||||
}
|
||||
rule = new StringBuilder(rule).append(" <i>(When this blocks or becomes blocked, it gets +").append(value.toString()).append("/+").append(value.toString()).append(" until end of turn.)</i>").toString();
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public BushidoAbility(final BushidoAbility ability) {
|
||||
super(ability);
|
||||
this.value = ability.value;
|
||||
this.rule = ability.rule;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -49,12 +65,12 @@ public class BushidoAbility extends BlocksOrBecomesBlockedTriggeredAbility {
|
|||
return new BushidoAbility(this);
|
||||
}
|
||||
|
||||
public int getValue() {
|
||||
return value;
|
||||
public int getValue(Ability source, Game game) {
|
||||
return value.calculate(game, source);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "Bushido " + value + " <i>(When this blocks or becomes blocked, it gets +" + value + "/+" + value + " until end of turn.)</i>";
|
||||
return rule;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue