mirror of
https://github.com/magefree/mage.git
synced 2026-01-25 20:59:14 -08:00
add Renown hint (similar to Monstrous one) (#10644)
This commit is contained in:
parent
fa72e243e9
commit
8128e9935d
2 changed files with 30 additions and 3 deletions
|
|
@ -0,0 +1,24 @@
|
||||||
|
package mage.abilities.hint.common;
|
||||||
|
|
||||||
|
import mage.abilities.Ability;
|
||||||
|
import mage.abilities.condition.common.RenownedSourceCondition;
|
||||||
|
import mage.abilities.hint.ConditionHint;
|
||||||
|
import mage.abilities.hint.Hint;
|
||||||
|
import mage.game.Game;
|
||||||
|
|
||||||
|
public enum RenownedHint implements Hint {
|
||||||
|
instance;
|
||||||
|
private static final ConditionHint hint = new ConditionHint(RenownedSourceCondition.instance,
|
||||||
|
"{this} is renowned", null,
|
||||||
|
"{this} isn't renowned", null, true);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getText(Game game, Ability ability) {
|
||||||
|
return hint.getText(game, ability);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Hint copy() {
|
||||||
|
return instance;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -4,6 +4,7 @@ import mage.abilities.Ability;
|
||||||
import mage.abilities.TriggeredAbilityImpl;
|
import mage.abilities.TriggeredAbilityImpl;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||||
|
import mage.abilities.hint.common.RenownedHint;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.counters.CounterType;
|
import mage.counters.CounterType;
|
||||||
|
|
@ -24,9 +25,11 @@ public class RenownAbility extends TriggeredAbilityImpl {
|
||||||
public RenownAbility(int renownValue) {
|
public RenownAbility(int renownValue) {
|
||||||
super(Zone.BATTLEFIELD, new BecomesRenownedSourceEffect(renownValue), false);
|
super(Zone.BATTLEFIELD, new BecomesRenownedSourceEffect(renownValue), false);
|
||||||
this.renownValue = renownValue;
|
this.renownValue = renownValue;
|
||||||
|
|
||||||
|
this.addHint(RenownedHint.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
public RenownAbility(final RenownAbility ability) {
|
private RenownAbility(final RenownAbility ability) {
|
||||||
super(ability);
|
super(ability);
|
||||||
this.renownValue = ability.renownValue;
|
this.renownValue = ability.renownValue;
|
||||||
}
|
}
|
||||||
|
|
@ -60,12 +63,12 @@ public class RenownAbility extends TriggeredAbilityImpl {
|
||||||
|
|
||||||
class BecomesRenownedSourceEffect extends OneShotEffect {
|
class BecomesRenownedSourceEffect extends OneShotEffect {
|
||||||
|
|
||||||
public BecomesRenownedSourceEffect(int renownValue) {
|
BecomesRenownedSourceEffect(int renownValue) {
|
||||||
super(Outcome.BoostCreature);
|
super(Outcome.BoostCreature);
|
||||||
this.staticText = setText(renownValue);
|
this.staticText = setText(renownValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
public BecomesRenownedSourceEffect(final BecomesRenownedSourceEffect effect) {
|
private BecomesRenownedSourceEffect(final BecomesRenownedSourceEffect effect) {
|
||||||
super(effect);
|
super(effect);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue