Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UNF: eelectrocute.txt + support #6616

Merged
merged 3 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 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 @@ -2320,6 +2320,11 @@ public static int xCount(Card c, final String s, final CardTraitBase ctb) {
return doXMath(player.getNumRollsThisTurn(), expr, c, ctb);
}

if (sq[0].startsWith("YouRolledThisTurn")) {
int n = calculateAmount(c, sq[0].substring(17), ctb);
return doXMath(Collections.frequency(player.getDiceRollsThisTurn(), n), expr, c, ctb);
}

if (sq[0].equals("YouSurveilThisTurn")) {
return doXMath(player.getSurveilThisTurn(), expr, c, ctb);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ private static int rollDiceForPlayer(SpellAbility sa, Player player, int amount,
StringUtils.join(ignored, ", ")));
}
player.getGame().getAction().notifyOfValue(sa, player, sb.toString(), null);
player.addDieRollThisTurn(naturalRolls);
}

List<Integer> rolls = Lists.newArrayList();
Expand Down
9 changes: 9 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 @@ -100,6 +100,7 @@ public class Player extends GameEntity implements Comparable<Player> {
private int lifeGainedTimesThisTurn;
private int lifeGainedByTeamThisTurn;
private int committedCrimeThisTurn;
private List<Integer> diceRollsThisTurn = Lists.newArrayList();
private int expentThisTurn;
private int numManaShards;
private int numPowerSurgeLands;
Expand Down Expand Up @@ -2520,6 +2521,7 @@ public void onCleanupPhase() {
setNumManaConversion(0);

setCommitedCrimeThisTurn(0);
diceRollsThisTurn = Lists.newArrayList();
setExpentThisTurn(0);

damageReceivedThisTurn.clear();
Expand Down Expand Up @@ -3930,6 +3932,13 @@ public void setCommitedCrimeThisTurn(int v) {
committedCrimeThisTurn = v;
}

public List<Integer> getDiceRollsThisTurn() {
return diceRollsThisTurn;
}
public void addDieRollThisTurn(List<Integer> rolls) {
diceRollsThisTurn.addAll(rolls);
}

public int getExpentThisTurn() {
return expentThisTurn;
}
Expand Down
1 change: 1 addition & 0 deletions forge-gui/res/cardsfolder/a/adorable_kitten.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ PT:1/1
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigRoll | Host$ True | TriggerDescription$ When this creature enters, roll a six-sided die. You gain life equal to the result.
SVar:TrigRoll:DB$ RollDice | ResultSVar$ Result | SubAbility$ DBLife
SVar:DBLife:DB$ GainLife | LifeAmount$ Result
DeckHas:Ability$LifeGain
Oracle:When this creature enters, roll a six-sided die. You gain life equal to the result.
9 changes: 9 additions & 0 deletions forge-gui/res/cardsfolder/e/eelectrocute.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Name:Eelectrocute
ManaCost:1 R
Types:Instant
A:SP$ DealDamage | ValidTgts$ Any | NumDmg$ 2 | SpellDescription$ CARDNAME deals 2 damage to any target.
S:Mode$ Continuous | Affected$ Card.Self | AffectedZone$ Graveyard | EffectZone$ Graveyard | MayPlay$ True | CheckSVar$ Count$YouRolledThisTurn6 | Description$ You may cast CARDNAME from your graveyard as long as you've rolled a 6 this turn. If you cast CARDNAME this way and it would be put into your graveyard, exile it instead.
R:Event$ Moved | ValidLKI$ Card.CastSa Spell.MayPlaySource | Origin$ Stack | Destination$ Graveyard | ReplaceWith$ MoveExile
SVar:MoveExile:DB$ ChangeZone | Defined$ ReplacedCard | Origin$ Stack | Destination$ Exile
DeckHas:Ability$Graveyard
Oracle:Eelectrocute deals 2 damage to any target.\nYou may cast Eelectrocute from your graveyard as long as you've rolled a 6 this turn. If you cast Eelectrocute this way and it would be put into your graveyard, exile it instead.