Ring tempts you (#3453)

* Ring tempts you WIP

* add ring triggers

* Update RingTemptsYouEffect.java

* Add files via upload

* Update TriggerRingbearerChosen.java

* Update token-images.txt

* Update TrackableProperty.java

* Update CardView.java

* Update CardRenderer.java

* Update RingTemptsYouEffect.java

fix crash

* Update Card.java

* Update CardView.java

* Update TrackableProperty.java

* Update StaticAbilityContinuous.java

* Update StaticEffect.java

* Update RingTemptsYouEffect.java

* update sprite_manaicons.png

* Update FSkinProp.java

* Update FSkinImage.java

* Update CardFaceSymbols.java

* Update CardRenderer.java

* update trigger

* update desktop symbol, add aragorn company leader

* update cleanup, add bilbo, add birthday escape

* update cleanup

* add 3 cards

* add five cards

* add two cards

* update aragorn,update bombadil, add two cards

* add ten cards

* Update horses_of_the_bruinen.txt

* add dunedain rangers + cleanup

* Update gollums_bite.txt

* update cleanup

* add six cards

* delete unnecessary file

* Update rangers_firebrand.txt

* add two cards, add RingTemptedYou playerproperty

* update frodo, add three cards

* update sauron, samwise, add two cards

* Update sauron_the_dark_lord.txt

* update validplayer

* add six cards

* update smeagol

* update sauron ransom two piles

* add four cards

* add three cards

* update card scripts

* Update war_of_the_last_alliance.txt

* update scripts, update ringbearer

* update CardDetailUtil

* remove unused param

* Update affected

* remove unnecesary variables

* update

* update scripts

* update RingTemptsYouEffect

* fix cantblockby RingTemptsYouEffect.java

* The Ring: use numTemptYou for RingLevel

* Update dunedain_rangers.txt

* Update jaces_defeat.txt

* update lord of the nazgul

* fix theRing CardView

* update ringEffect, update translation

* update translation

* update gamestate

* replace switch with if else

* fix effect

* update gamestate, translation

* update restartgameeffect, remove unneeded clearRingBearer

---------

Co-authored-by: Anthony Calosa <anthonycalosa@gmail.com>
Co-authored-by: tool4ever <therealtoolkit@hotmail.com>
Co-authored-by: Hans Mackowiak <hanmac@gmx.de>
This commit is contained in:
Chris H
2023-07-26 13:07:41 -04:00
committed by GitHub
parent 69748ab0fb
commit abb2ff3cdf
106 changed files with 1038 additions and 231 deletions

View File

@@ -59,6 +59,7 @@ public abstract class GameState {
private String persistentMana = "";
private int landsPlayed = 0;
private int landsPlayedLastTurn = 0;
private int numRingTemptedYou = 0;
private String precast = null;
private String putOnStack = null;
private final Map<ZoneType, String> cardTexts = new EnumMap<>(ZoneType.class);
@@ -135,6 +136,7 @@ public abstract class GameState {
sb.append(TextUtil.concatNoSpace(prefix + "life=", String.valueOf(p.life), "\n"));
sb.append(TextUtil.concatNoSpace(prefix + "landsplayed=", String.valueOf(p.landsPlayed), "\n"));
sb.append(TextUtil.concatNoSpace(prefix + "landsplayedlastturn=", String.valueOf(p.landsPlayedLastTurn), "\n"));
sb.append(TextUtil.concatNoSpace(prefix + "numringtemptedyou=", String.valueOf(p.numRingTemptedYou), "\n"));
if (!p.counters.isEmpty()) {
sb.append(TextUtil.concatNoSpace(prefix + "counters=", p.counters, "\n"));
}
@@ -164,6 +166,7 @@ public abstract class GameState {
p.landsPlayedLastTurn = player.getLandsPlayedLastTurn();
p.counters = countersToString(player.getCounters());
p.manaPool = processManaPool(player.getManaPool());
p.numRingTemptedYou = player.getNumRingTemptedYou();
playerStates.add(p);
}
@@ -269,6 +272,9 @@ public abstract class GameState {
if (c.isCommander()) {
newText.append("|IsCommander");
}
if (c.isRingBearer()) {
newText.append("|IsRingBearer");
}
if (cardsReferencedByID.contains(c)) {
newText.append("|Id:").append(c.getId());
@@ -518,6 +524,8 @@ public abstract class GameState {
getPlayerState(categoryName).landsPlayed = Integer.parseInt(categoryValue);
} else if (categoryName.endsWith("landsplayedlastturn")) {
getPlayerState(categoryName).landsPlayedLastTurn = Integer.parseInt(categoryValue);
} else if (categoryName.endsWith("numringtemptedyou")) {
getPlayerState(categoryName).numRingTemptedYou = Integer.parseInt(categoryValue);
} else if (categoryName.endsWith("play") || categoryName.endsWith("battlefield")) {
getPlayerState(categoryName).cardTexts.put(ZoneType.Battlefield, categoryValue);
} else if (categoryName.endsWith("hand")) {
@@ -1110,6 +1118,7 @@ public abstract class GameState {
}
p.setCommanders(Lists.newArrayList());
p.clearTheRing();
Map<ZoneType, CardCollectionView> playerCards = new EnumMap<>(ZoneType.class);
for (Entry<ZoneType, String> kv : state.cardTexts.entrySet()) {
@@ -1120,6 +1129,7 @@ public abstract class GameState {
if (state.life >= 0) p.setLife(state.life, null);
p.setLandsPlayedThisTurn(state.landsPlayed);
p.setLandsPlayedLastTurn(state.landsPlayedLastTurn);
p.setNumRingTemptedYou(state.numRingTemptedYou);
p.clearPaidForSA();
@@ -1175,6 +1185,14 @@ public abstract class GameState {
if (!state.counters.isEmpty()) {
applyCountersToGameEntity(p, state.counters);
}
if (state.numRingTemptedYou > 0) {
//setup all levels
for (int i = 1; i <= state.numRingTemptedYou; i++) {
if (i > 4)
break;
p.setRingLevel(i);
}
}
}
/**
@@ -1300,6 +1318,9 @@ public abstract class GameState {
List<Card> cmd = Lists.newArrayList(player.getCommanders());
cmd.add(c);
player.setCommanders(cmd);
} else if (info.startsWith("IsRingBearer")) {
c.setRingBearer(true);
player.setRingBearer(c);
} else if (info.startsWith("Id:")) {
int id = Integer.parseInt(info.substring(3));
idToCard.put(id, c);

View File

@@ -159,6 +159,7 @@ public enum SpellApiToAi {
.put(ApiType.Reveal, RevealAi.class)
.put(ApiType.RevealHand, RevealHandAi.class)
.put(ApiType.ReverseTurnOrder, AlwaysPlayAi.class)
.put(ApiType.RingTemptsYou, AlwaysPlayAi.class)
.put(ApiType.RollDice, RollDiceAi.class)
.put(ApiType.RollPlanarDice, RollPlanarDiceAi.class)
.put(ApiType.RunChaos, AlwaysPlayAi.class)