mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 18:28:00 +00:00
AscendEffect: add Effect to add Blessing to Player
This commit is contained in:
@@ -24,6 +24,7 @@ public enum SpellApiToAi {
|
|||||||
.put(ApiType.Animate, AnimateAi.class)
|
.put(ApiType.Animate, AnimateAi.class)
|
||||||
.put(ApiType.AnimateAll, AnimateAllAi.class)
|
.put(ApiType.AnimateAll, AnimateAllAi.class)
|
||||||
.put(ApiType.Attach, AttachAi.class)
|
.put(ApiType.Attach, AttachAi.class)
|
||||||
|
.put(ApiType.Ascend, AlwaysPlayAi.class)
|
||||||
.put(ApiType.Balance, BalanceAi.class)
|
.put(ApiType.Balance, BalanceAi.class)
|
||||||
.put(ApiType.BecomeMonarch, AlwaysPlayAi.class)
|
.put(ApiType.BecomeMonarch, AlwaysPlayAi.class)
|
||||||
.put(ApiType.BecomesBlocked, BecomesBlockedAi.class)
|
.put(ApiType.BecomesBlocked, BecomesBlockedAi.class)
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ public enum ApiType {
|
|||||||
Animate (AnimateEffect.class),
|
Animate (AnimateEffect.class),
|
||||||
AnimateAll (AnimateAllEffect.class),
|
AnimateAll (AnimateAllEffect.class),
|
||||||
Attach (AttachEffect.class),
|
Attach (AttachEffect.class),
|
||||||
|
Ascend (AscendEffect.class),
|
||||||
Balance (BalanceEffect.class),
|
Balance (BalanceEffect.class),
|
||||||
BecomeMonarch (BecomeMonarchEffect.class),
|
BecomeMonarch (BecomeMonarchEffect.class),
|
||||||
BecomesBlocked (BecomesBlockedEffect.class),
|
BecomesBlocked (BecomesBlockedEffect.class),
|
||||||
|
|||||||
@@ -0,0 +1,43 @@
|
|||||||
|
package forge.game.ability.effects;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import forge.game.ability.SpellAbilityEffect;
|
||||||
|
import forge.game.player.Player;
|
||||||
|
import forge.game.spellability.SpellAbility;
|
||||||
|
import forge.game.zone.ZoneType;
|
||||||
|
import forge.util.Lang;
|
||||||
|
|
||||||
|
public class AscendEffect extends SpellAbilityEffect {
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see forge.game.ability.SpellAbilityEffect#getStackDescription(forge.game.spellability.SpellAbility)
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected String getStackDescription(SpellAbility sa) {
|
||||||
|
final StringBuilder sb = new StringBuilder();
|
||||||
|
|
||||||
|
List<Player> tgt = getTargetPlayers(sa);
|
||||||
|
|
||||||
|
sb.append(Lang.joinHomogenous(tgt));
|
||||||
|
sb.append(" ");
|
||||||
|
sb.append(tgt.size() > 1 ? "ascend" : "ascends");
|
||||||
|
sb.append(". ");
|
||||||
|
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
* @see forge.game.ability.SpellAbilityEffect#resolve(forge.game.spellability.SpellAbility)
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void resolve(SpellAbility sa) {
|
||||||
|
for (Player p : getTargetPlayers(sa)) {
|
||||||
|
// Player need 10+ permanents on the battlefield
|
||||||
|
if (p.getZone(ZoneType.Battlefield).size() >= 10) {
|
||||||
|
p.setBlessing(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user