Fixing crash with Dark Waters, updating sql scripts

This commit is contained in:
Christian 'ketura' McCarty
2024-12-06 19:36:33 -06:00
parent 9096476b73
commit 2fd2d171ce
5 changed files with 130 additions and 39 deletions

View File

@@ -1,7 +1,7 @@
SELECT * SELECT *
FROM transfer t FROM transfer t
# WHERE collection RLIKE('(101_65|101_66|101_67)') WHERE contents RLIKE('(101_65|101_66|101_67)')
ORDER BY id DESC; ORDER BY id DESC;
SELECT * SELECT *
@@ -20,16 +20,16 @@ WHERE contents RLIKE('(101_65|101_66|101_67)');
-- WHERE c.id IN (59510, 64642, 64643) -- WHERE c.id IN (59510, 64642, 64643)
UPDATE transfer UPDATE transfer
SET collection = REGEXP_REPLACE(collection, '101_65', '101_101') SET contents = REGEXP_REPLACE(contents, '101_65', '101_101')
WHERE collection RLIKE('101_65'); WHERE contents RLIKE('101_65');
UPDATE transfer UPDATE transfer
SET collection = REGEXP_REPLACE(collection, '101_66', '101_102') SET contents = REGEXP_REPLACE(contents, '101_66', '101_102')
WHERE collection RLIKE('101_66'); WHERE contents RLIKE('101_66');
UPDATE transfer UPDATE transfer
SET collection = REGEXP_REPLACE(collection, '101_67', '101_103') SET contents = REGEXP_REPLACE(contents, '101_67', '101_103')
WHERE collection RLIKE('101_67'); WHERE contents RLIKE('101_67');
UPDATE collection_entries UPDATE collection_entries
@@ -62,7 +62,7 @@ WHERE contents RLIKE('101_67');
SELECT * SELECT *
FROM transfer t FROM transfer t
WHERE collection RLIKE('(101_101|101_102|101_103)') WHERE contents RLIKE('(101_101|101_102|101_103)')
ORDER BY id DESC; ORDER BY id DESC;
SELECT * SELECT *

View File

@@ -9,15 +9,15 @@ WHERE player = 'wert'
SELECT * SELECT *
FROM gemp_db.transfer t FROM gemp_db.transfer t
# WHERE collection RLIKE('(101_65|101_66|101_67)') WHERE collection RLIKE('(101_65|101_66|101_67)')
ORDER BY id DESC; ORDER BY id DESC;
UPDATE transfer -- UPDATE transfer
SET notify = TRUE -- SET notify = TRUE
WHERE id = 5031 -- WHERE id = 5031
SELECT NOW(), NOW() + INTERVAL 24 HOUR -- SELECT NOW(), NOW() + INTERVAL 24 HOUR

View File

@@ -376,18 +376,27 @@
filter: tentacle filter: tentacle
memorize: woundedTentacle memorize: woundedTentacle
} }
]
effect: [
{ {
type: Killed type: If
filter: tentacle check: {
cause: wounds type: HasCardInDiscard
memorize: woundedTentacle filter: memory(woundedTentacle)
}
true: {
type: StackCardsFromDiscard
select: memory(woundedTentacle)
where: self
}
false: {
type: StackCardsFromPlay
select: memory(woundedTentacle)
where: self
}
} }
] ]
effect: {
type: StackCardsFromPlay
select: memory(woundedTentacle)
where: self
}
} }
{ {
type: activated type: activated

View File

@@ -2,9 +2,10 @@ package com.gempukku.lotro.cards.unofficial.pc.vsets.set_v01;
import com.gempukku.lotro.cards.GenericCardTestHelper; import com.gempukku.lotro.cards.GenericCardTestHelper;
import com.gempukku.lotro.common.*; import com.gempukku.lotro.common.*;
import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.CardNotFoundException; import com.gempukku.lotro.game.CardNotFoundException;
import com.gempukku.lotro.game.PhysicalCardImpl;
import com.gempukku.lotro.logic.decisions.DecisionResultInvalidException; import com.gempukku.lotro.logic.decisions.DecisionResultInvalidException;
import com.gempukku.lotro.logic.modifiers.AddKeywordModifier;
import org.junit.Test; import org.junit.Test;
import java.util.HashMap; import java.util.HashMap;
@@ -16,10 +17,12 @@ public class Card_V1_034_Tests
protected GenericCardTestHelper GetScenario() throws CardNotFoundException, DecisionResultInvalidException { protected GenericCardTestHelper GetScenario() throws CardNotFoundException, DecisionResultInvalidException {
return new GenericCardTestHelper( return new GenericCardTestHelper(
new HashMap<>() new HashMap<>() {{
{{ put("darkwaters", "101_34");
put("card", "101_34"); put("tentacle1", "2_58");
// put other cards in here as needed for the test case put("tentacle2", "2_66");
put("song", "3_5");
put("greenleaf", "1_50");
}}, }},
GenericCardTestHelper.FellowshipSites, GenericCardTestHelper.FellowshipSites,
GenericCardTestHelper.FOTRFrodo, GenericCardTestHelper.FOTRFrodo,
@@ -46,7 +49,7 @@ public class Card_V1_034_Tests
var scn = GetScenario(); var scn = GetScenario();
var card = scn.GetFreepsCard("card"); var card = scn.GetFreepsCard("darkwaters");
assertEquals("Out of Dark Waters", card.getBlueprint().getTitle()); assertEquals("Out of Dark Waters", card.getBlueprint().getTitle());
assertNull(card.getBlueprint().getSubtitle()); assertNull(card.getBlueprint().getSubtitle());
@@ -58,18 +61,95 @@ public class Card_V1_034_Tests
assertEquals(1, card.getBlueprint().getTwilightCost()); assertEquals(1, card.getBlueprint().getTwilightCost());
} }
// Uncomment any @Test markers below once this is ready to be used @Test
//@Test public void DarkWatersStacksWoundedTentacles() throws DecisionResultInvalidException, CardNotFoundException {
public void OutofDarkWatersTest1() throws DecisionResultInvalidException, CardNotFoundException {
//Pre-game setup //Pre-game setup
var scn = GetScenario(); GenericCardTestHelper scn = GetScenario();
var card = scn.GetFreepsCard("card"); var darkwaters = scn.GetShadowCard("darkwaters");
scn.FreepsMoveCardToHand(card); var tentacle2 = scn.GetShadowCard("tentacle2");
scn.ShadowMoveCardToSupportArea(darkwaters);
scn.ShadowMoveCardToHand(tentacle2);
scn.FreepsMoveCharToTable("greenleaf");
scn.StartGame(); scn.StartGame();
scn.FreepsPlayCard(card); scn.SetTwilight(4);
scn.ApplyAdHocModifier(new AddKeywordModifier(null, Filters.siteNumber(2), null, Keyword.MARSH));
scn.FreepsPassCurrentPhaseAction();
scn.ShadowPlayCard(tentacle2);
assertEquals(0, scn.getWounds(tentacle2));
assertEquals(Zone.SHADOW_CHARACTERS, tentacle2.getZone());
scn.SkipToPhase(Phase.ARCHERY);
scn.PassCurrentPhaseActions();
assertEquals(1, scn.getWounds(tentacle2));
assertTrue(scn.ShadowHasOptionalTriggerAvailable());
scn.ShadowAcceptOptionalTrigger();
assertEquals(Zone.STACKED, tentacle2.getZone());
assertEquals(darkwaters, tentacle2.getStackedOn());
}
@Test
public void DarkWatersStacksTentaclesKilledByWound() throws DecisionResultInvalidException, CardNotFoundException {
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
var darkwaters = scn.GetShadowCard("darkwaters");
var tentacle1 = scn.GetShadowCard("tentacle1");
scn.ShadowMoveCardToSupportArea(darkwaters);
scn.ShadowMoveCardToHand(tentacle1);
scn.FreepsMoveCharToTable("greenleaf");
scn.StartGame();
scn.SetTwilight(4);
scn.ApplyAdHocModifier(new AddKeywordModifier(null, Filters.siteNumber(2), null, Keyword.MARSH));
scn.FreepsPassCurrentPhaseAction();
scn.ShadowPlayCard(tentacle1);
assertEquals(Zone.SHADOW_CHARACTERS, tentacle1.getZone());
scn.SkipToPhase(Phase.ARCHERY);
scn.PassCurrentPhaseActions();
assertTrue(scn.ShadowHasOptionalTriggerAvailable());
scn.ShadowAcceptOptionalTrigger();
assertEquals(Zone.STACKED, tentacle1.getZone());
assertEquals(darkwaters, tentacle1.getStackedOn());
}
@Test
public void DarkWatersCanBurn2AStackedTentaclesToPreventSelfDiscard() throws DecisionResultInvalidException, CardNotFoundException {
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
var song = scn.GetFreepsCard("song");
scn.FreepsMoveCardToSupportArea(song);
var darkwaters = scn.GetShadowCard("darkwaters");
var tentacle1 = scn.GetShadowCard("tentacle1");
var tentacle2 = scn.GetShadowCard("tentacle2");
scn.ShadowMoveCardToSupportArea(darkwaters);
//scn.ShadowMoveCardToHand(tentacle1, tentacle2);
scn.StartGame();
scn.StackCardsOn(darkwaters, tentacle1, tentacle2);
scn.FreepsUseCardAction(song);
scn.FreepsChooseCard(darkwaters);
assertTrue(scn.ShadowHasOptionalTriggerAvailable());
scn.ShadowAcceptOptionalTrigger();
assertEquals(Zone.DISCARD, tentacle1.getZone());
assertEquals(Zone.DISCARD, tentacle2.getZone());
assertEquals(Zone.SUPPORT, darkwaters.getZone());
assertEquals(1, scn.GetTwilight());
} }
} }

View File

@@ -1,9 +1,11 @@
package com.gempukku.lotro.cards.unofficial.pc.vsets.set_v02; package com.gempukku.lotro.cards.unofficial.pc.vsets.set_v02;
import com.gempukku.lotro.cards.GenericCardTestHelper; import com.gempukku.lotro.cards.GenericCardTestHelper;
import com.gempukku.lotro.common.*; import com.gempukku.lotro.common.CardType;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Keyword;
import com.gempukku.lotro.common.Side;
import com.gempukku.lotro.game.CardNotFoundException; import com.gempukku.lotro.game.CardNotFoundException;
import com.gempukku.lotro.game.PhysicalCardImpl;
import com.gempukku.lotro.logic.decisions.DecisionResultInvalidException; import com.gempukku.lotro.logic.decisions.DecisionResultInvalidException;
import org.junit.Test; import org.junit.Test;
@@ -49,7 +51,7 @@ public class Card_V2_048_Tests
assertEquals("Stronghold of My Fathers", card.getBlueprint().getTitle()); assertEquals("Stronghold of My Fathers", card.getBlueprint().getTitle());
assertNull(card.getBlueprint().getSubtitle()); assertNull(card.getBlueprint().getSubtitle());
assertFalse(card.getBlueprint().isUnique()); assertTrue(card.getBlueprint().isUnique());
assertEquals(Side.FREE_PEOPLE, card.getBlueprint().getSide()); assertEquals(Side.FREE_PEOPLE, card.getBlueprint().getSide());
assertEquals(Culture.ROHAN, card.getBlueprint().getCulture()); assertEquals(Culture.ROHAN, card.getBlueprint().getCulture());
assertEquals(CardType.POSSESSION, card.getBlueprint().getCardType()); assertEquals(CardType.POSSESSION, card.getBlueprint().getCardType());