Skip to content

Commit

Permalink
YLCI: heralds_reveille + support
Browse files Browse the repository at this point in the history
  • Loading branch information
Northmoc committed Dec 4, 2023
1 parent c652f9c commit 5c03dcd
Show file tree
Hide file tree
Showing 14 changed files with 49 additions and 1 deletion.
4 changes: 4 additions & 0 deletions forge-game/src/main/java/forge/game/ability/AbilityUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -3515,6 +3515,10 @@ public static int playerXProperty(final Player player, final String s, final Car
return doXMath(player.getNumDiscardedThisTurn(), m, source, ctb);
}

if (value.contains("ExploredThisTurn")) {
return doXMath(player.getNumExploredThisTurn(), m, source, ctb);
}

if (value.contains("AttackersDeclared")) {
return doXMath(player.getCreaturesAttackedThisTurn().size(), m, source, ctb);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public void resolve(SpellAbility sa) {
CardCollectionView tgts = GameActionUtil.orderCardsByTheirOwners(game, getTargetCards(sa), ZoneType.Battlefield, sa);

for (final Card c : tgts) {
final Player pl = c.getController();
for (int i = 0; i < amount; i++) {
GameEntityCounterTable table = new GameEntityCounterTable();
final CardZoneTable triggerList = new CardZoneTable();
Expand All @@ -72,7 +73,6 @@ public void resolve(SpellAbility sa) {

// revealed land card
boolean revealedLand = false;
final Player pl = c.getController();
CardCollection top = pl.getTopXCardsFromLibrary(1);
if (!top.isEmpty()) {
Card movedCard = null;
Expand Down Expand Up @@ -106,6 +106,7 @@ public void resolve(SpellAbility sa) {
}

// a creature does explore even if it isn't on the battlefield anymore
pl.addExploredThisTurn();
final Map<AbilityKey, Object> runParams = AbilityKey.mapFromCard(c);
if (!top.isEmpty()) runParams.put(AbilityKey.Explored, top.getFirst());
game.getTriggerHandler().runTrigger(TriggerType.Explores, runParams, false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import forge.game.trigger.TriggerType;
import forge.game.zone.ZoneType;
import forge.util.Aggregates;
import forge.util.Localizer;

import java.util.Arrays;
import java.util.List;
Expand Down Expand Up @@ -54,6 +55,7 @@ public void resolve(SpellAbility sa) {

CardCollection soughtCards = new CardCollection();

final StringBuilder notify = new StringBuilder();
for (String seekType : seekTypes) {
CardCollection pool;
if (sa.hasParam("DefinedCards")) {
Expand All @@ -65,6 +67,8 @@ public void resolve(SpellAbility sa) {
pool = CardLists.getValidCards(pool, seekType, source.getController(), source, sa);
}
if (pool.isEmpty()) {
if (notify.length() != 0) notify.append("\r\n");
notify.append(Localizer.getInstance().getMessage("lblSeekFailed", seekType));
continue; // can't find if nothing to seek
}

Expand All @@ -84,6 +88,9 @@ public void resolve(SpellAbility sa) {

}
}
if (notify.length() != 0) {
game.getAction().notifyOfValue(sa, source, notify.toString(), null);
}
if (!soughtCards.isEmpty()) {
if (sa.hasParam("RememberFound")) {
source.addRemembered(soughtCards);
Expand Down
11 changes: 11 additions & 0 deletions forge-game/src/main/java/forge/game/player/Player.java
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ public class Player extends GameEntity implements Comparable<Player> {
private int numDrawnThisDrawStep;
private int numRollsThisTurn;
private int numDiscardedThisTurn;
private int numExploredThisTurn;
private int numTokenCreatedThisTurn;
private int numForetoldThisTurn;
private int numCardsInHandStartedThisTurnWith;
Expand Down Expand Up @@ -1588,6 +1589,16 @@ public final void resetNumDiscardedThisTurn() {
numDiscardedThisTurn = 0;
}

public final int getNumExploredThisTurn() {
return numExploredThisTurn;
}
public final void addExploredThisTurn() {
numExploredThisTurn++;
}
public final void resetNumExploredThisTurn() {
numExploredThisTurn = 0;
}

public int getNumCardsInHandStartedThisTurnWith() {
return numCardsInHandStartedThisTurnWith;
}
Expand Down
1 change: 1 addition & 0 deletions forge-game/src/main/java/forge/util/MessageUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public static String formatNotificationMessage(SpellAbility sa, Player player,
case ChooseDirection:
case Clash:
case DigMultiple:
case Seek:
return value;
case ChooseColor:
return sa.hasParam("Random")
Expand Down
8 changes: 8 additions & 0 deletions forge-gui/res/cardsfolder/upcoming/heralds_reveille.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Name:Herald's Reveille
ManaCost:U
Types:Sorcery
A:SP$ Branch | BranchConditionSVar$ PlayerCountPropertyYou$ExploredThisTurn | TrueSubAbility$ DBSeek | FalseSubAbility$ DBDraw | SpellDescription$ Draw a card. If a permanent you controlled explored this turn, seek a Merfolk card instead.
SVar:DBSeek:DB$ Seek | Type$ Merfolk
SVar:DBDraw:DB$ Draw
DeckHints:Type$Merfolk
Oracle:Draw a card. If a permanent you controlled explored this turn, seek a Merfolk card instead.
2 changes: 2 additions & 0 deletions forge-gui/res/languages/de-DE.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2071,6 +2071,8 @@ lblDoYouWantPayEcho=Möchtest du die Echokosten zahlen
lblPayEcho=Zahle Echokosten
lblDoYouWantSacrifice=Opfern durchführen?
lblDoYouWantSacrificeThis=Möchtest du {0} opfern?
#SeekEffect.java
lblSeekFailed=Suche fehlgeschlagen: {0}
#SetStateEffect.java
lblFaceDownCardCantTurnFaceUp=Verdeckte Karte kann nicht umgedreht werden
#ShuffleEffect.java
Expand Down
2 changes: 2 additions & 0 deletions forge-gui/res/languages/en-US.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2076,6 +2076,8 @@ lblDoYouWantPayEcho=Do you want to pay Echo
lblPayEcho=Pay Echo
lblDoYouWantSacrifice=Do you want to sacrifice?
lblDoYouWantSacrificeThis=Do you want to sacrifice {0}?
#SeekEffect.java
lblSeekFailed=Seek failed: {0}
#SetStateEffect.java
lblFaceDownCardCantTurnFaceUp=Face-down card can''t turn face up
#ShuffleEffect.java
Expand Down
2 changes: 2 additions & 0 deletions forge-gui/res/languages/es-ES.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2072,6 +2072,8 @@ lblDoYouWantPayEcho=¿Quieres pagar Eco
lblPayEcho=Pagar Eco
lblDoYouWantSacrifice=¿Quieres sacrificar?
lblDoYouWantSacrificeThis=¿Quieres sacrificar {0}?
#SeekEffect.java
lblSeekFailed=Búsqueda fallida: {0}
#SetStateEffect.java
lblFaceDownCardCantTurnFaceUp=La carta boca abajo no se puede girar boca arriba
#ShuffleEffect.java
Expand Down
2 changes: 2 additions & 0 deletions forge-gui/res/languages/fr-FR.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2076,6 +2076,8 @@ lblDoYouWantPayEcho=Voulez-vous payer Echo
lblPayEcho=Écho de paiement
lblDoYouWantSacrifice=Voulez-vous sacrifier ?
lblDoYouWantSacrificeThis=Voulez-vous sacrifier {0} ?
#SeekEffect.java
lblSeekFailed=Échec de la recherche: {0}
#SetStateEffect.java
lblFaceDownCardCantTurnFaceUp=La carte face cachée ne peut pas être retournée face visible
#ShuffleEffet.java
Expand Down
2 changes: 2 additions & 0 deletions forge-gui/res/languages/it-IT.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2072,6 +2072,8 @@ lblDoYouWantPayEcho=Vuoi pagare Eco
lblPayEcho=Paga Eco
lblDoYouWantSacrifice=Vuoi sacrificare?
lblDoYouWantSacrificeThis=Vuoi sacrificare {0}?
#SeekEffect.java
lblSeekFailed=Ricerca non riuscita: {0}
#SetStateEffect.java
lblFaceDownCardCantTurnFaceUp=La carta a faccia in giù non può essere girata a faccia in su
#ShuffleEffect.java
Expand Down
2 changes: 2 additions & 0 deletions forge-gui/res/languages/ja-JP.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2071,6 +2071,8 @@ lblDoYouWantPayEcho=エコーコストを支払いますか:
lblPayEcho=エコーコストを支払います
lblDoYouWantSacrifice=生け贄にしますか?
lblDoYouWantSacrificeThis=Do you want to sacrifice {0}?
#SeekEffect.java
lblSeekFailed=シークが失敗しました: {0}
#SetStateEffect.java
lblFaceDownCardCantTurnFaceUp=裏向きのカードが表向きにできません
#ShuffleEffect.java
Expand Down
2 changes: 2 additions & 0 deletions forge-gui/res/languages/pt-BR.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2133,6 +2133,8 @@ lblDoYouWantPayEcho=Quer pagar pelo Eco
lblPayEcho=Pagar Eco
lblDoYouWantSacrifice=Deseja sacrificar?
lblDoYouWantSacrificeThis=Deseja sacrificar {0}?
#SeekEffect.java
lblSeekFailed=Falha na busca: {0}
#SetStateEffect.java
lblFaceDownCardCantTurnFaceUp=Carta com face voltada pra baixo não volta com face pra cima
#ShuffleEffect.java
Expand Down
2 changes: 2 additions & 0 deletions forge-gui/res/languages/zh-CN.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2076,6 +2076,8 @@ lblDoYouWantPayEcho=你想支付返响费用
lblPayEcho=支付返响费用
lblDoYouWantSacrifice=你想牺牲吗?
lblDoYouWantSacrificeThis=你想要牺牲{0}吗?
#SeekEffect.java
lblSeekFailed=查找失败:{0}
#SetStateEffect.java
lblFaceDownCardCantTurnFaceUp=面朝下的牌不能面朝上
#ShuffleEffect.java
Expand Down

0 comments on commit 5c03dcd

Please sign in to comment.