mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 03:22:00 -08:00
Added static and colored hints for cards
This commit is contained in:
parent
fce93c66e1
commit
13ed3c6dbd
7 changed files with 120 additions and 10 deletions
|
|
@ -12,6 +12,7 @@ import mage.abilities.effects.Effects;
|
|||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.ManaEffect;
|
||||
import mage.abilities.effects.mana.DynamicManaEffect;
|
||||
import mage.abilities.hint.Hint;
|
||||
import mage.abilities.mana.ActivatedManaAbilityImpl;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.SplitCard;
|
||||
|
|
@ -73,6 +74,7 @@ public abstract class AbilityImpl implements Ability {
|
|||
protected boolean canFizzle = true;
|
||||
protected TargetAdjuster targetAdjuster = null;
|
||||
protected CostAdjuster costAdjuster = null;
|
||||
protected List<Hint> hints = new ArrayList<>();
|
||||
|
||||
public AbilityImpl(AbilityType abilityType, Zone zone) {
|
||||
this.id = UUID.randomUUID();
|
||||
|
|
@ -120,6 +122,9 @@ public abstract class AbilityImpl implements Ability {
|
|||
this.canFizzle = ability.canFizzle;
|
||||
this.targetAdjuster = ability.targetAdjuster;
|
||||
this.costAdjuster = ability.costAdjuster;
|
||||
for (Hint hint : ability.getHints()) {
|
||||
this.hints.add(hint.copy());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -256,7 +261,7 @@ public abstract class AbilityImpl implements Ability {
|
|||
}
|
||||
}
|
||||
if (modes.getAdditionalCost() != null) {
|
||||
((OptionalAdditionalModeSourceCosts) modes.getAdditionalCost()).addOptionalAdditionalModeCosts(this, game);
|
||||
modes.getAdditionalCost().addOptionalAdditionalModeCosts(this, game);
|
||||
}
|
||||
// 20130201 - 601.2b
|
||||
// If the spell has alternative or additional costs that will be paid as it's being cast such
|
||||
|
|
@ -952,9 +957,7 @@ public abstract class AbilityImpl implements Ability {
|
|||
} else if (!object.getAbilities().contains(this)) {
|
||||
// check if it's an ability that is temporary gained to a card
|
||||
Abilities<Ability> otherAbilities = game.getState().getAllOtherAbilities(this.getSourceId());
|
||||
if (otherAbilities == null || !otherAbilities.contains(this)) {
|
||||
return false;
|
||||
}
|
||||
return otherAbilities != null && otherAbilities.contains(this);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
@ -1243,4 +1246,15 @@ public abstract class AbilityImpl implements Ability {
|
|||
costAdjuster.adjustCosts(this, game);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Hint> getHints() {
|
||||
return this.hints;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Ability addHint(Hint hint) {
|
||||
this.hints.add(hint);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue