mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00:00
Fixed rule text generation of Renown.
This commit is contained in:
parent
d33f85d04a
commit
1782832d82
1 changed files with 5 additions and 12 deletions
|
@ -22,12 +22,10 @@ import mage.util.CardUtil;
|
|||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
|
||||
|
||||
public class RenownAbility extends TriggeredAbilityImpl {
|
||||
|
||||
private int renownValue;
|
||||
|
||||
|
||||
public RenownAbility(int renownValue) {
|
||||
super(Zone.BATTLEFIELD, new BecomeRenownSourceEffect(renownValue), false);
|
||||
this.renownValue = renownValue;
|
||||
|
@ -50,7 +48,7 @@ public class RenownAbility extends TriggeredAbilityImpl {
|
|||
|
||||
@Override
|
||||
public boolean checkInterveningIfClause(Game game) {
|
||||
return getSourceObject(game) != null && !((Permanent)getSourceObject(game)).isRenown();
|
||||
return getSourceObject(game) != null && !((Permanent) getSourceObject(game)).isRenown();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -59,11 +57,6 @@ public class RenownAbility extends TriggeredAbilityImpl {
|
|||
&& ((DamagedPlayerEvent) event).isCombatDamage();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "Whenever {this} deals combat damage to a player, " + super.getRule();
|
||||
}
|
||||
|
||||
public int getRenownValue() {
|
||||
return renownValue;
|
||||
}
|
||||
|
@ -95,7 +88,7 @@ class BecomeRenownSourceEffect extends OneShotEffect {
|
|||
if (renownValue == Integer.MAX_VALUE) {
|
||||
renownValue = source.getManaCostsToPay().getX();
|
||||
}
|
||||
new AddCountersSourceEffect(CounterType.P1P1.createInstance(renownValue),true).apply(game, source);
|
||||
new AddCountersSourceEffect(CounterType.P1P1.createInstance(renownValue), true).apply(game, source);
|
||||
permanent.setRenown(true);
|
||||
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.BECOMES_RENOWN, source.getSourceId(), source.getSourceId(), source.getControllerId(), renownValue));
|
||||
return true;
|
||||
|
@ -106,9 +99,9 @@ class BecomeRenownSourceEffect extends OneShotEffect {
|
|||
private String setText(int renownValue) {
|
||||
// Renown 1 (When this creature deals combat damage to a player, if it isn't renowned, put a +1/+1 counter on it and it becomes renowned.)
|
||||
StringBuilder sb = new StringBuilder("Renown ");
|
||||
sb.append(renownValue == Integer.MAX_VALUE ? "X":renownValue)
|
||||
sb.append(renownValue == Integer.MAX_VALUE ? "X" : renownValue)
|
||||
.append(". <i>(When this creature deals combat damage to a player, if it isn't renowned, put ")
|
||||
.append(renownValue == Integer.MAX_VALUE ? "X":CardUtil.numberToText(renownValue, "a"))
|
||||
.append(renownValue == Integer.MAX_VALUE ? "X" : CardUtil.numberToText(renownValue, "a"))
|
||||
.append(" +1/+1 counter on it and it becomes renowned.)</i>").toString();
|
||||
return sb.toString();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue