Fixed Sting, Bane of the Eight Legs not triggering during a fierce skirmish.
This commit is contained in:
@@ -52,7 +52,7 @@ public class SkirmishPhaseAction extends SystemQueueAction {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
appendEffect(
|
appendEffect(
|
||||||
new TriggeringResultEffect(null, new SkirmishAboutToEndResult(shadowCharacters), "Skirmish about to end"));
|
new TriggeringResultEffect(null, new SkirmishAboutToEndResult(fellowshipCharacter, shadowCharacters), "Skirmish about to end"));
|
||||||
appendEffect(
|
appendEffect(
|
||||||
new TriggeringResultEffect(null, new EndOfPhaseResult(Phase.SKIRMISH), "End of skirmish phase"));
|
new TriggeringResultEffect(null, new EndOfPhaseResult(Phase.SKIRMISH), "End of skirmish phase"));
|
||||||
appendEffect(
|
appendEffect(
|
||||||
|
|||||||
@@ -271,10 +271,10 @@ public class TriggerConditions {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isSkirmishAboutToEnd(EffectResult effectResult, LotroGame game, Filterable... minionsInvolving) {
|
public static boolean isSkirmishAboutToEnd(EffectResult effectResult, LotroGame game, Filterable... charactersInvolving) {
|
||||||
if (effectResult.getType() == EffectResult.Type.SKIRMISH_ABOUT_TO_END) {
|
if (effectResult.getType() == EffectResult.Type.SKIRMISH_ABOUT_TO_END) {
|
||||||
SkirmishAboutToEndResult skirmishAboutToEnd = (SkirmishAboutToEndResult) effectResult;
|
SkirmishAboutToEndResult skirmishAboutToEnd = (SkirmishAboutToEndResult) effectResult;
|
||||||
return Filters.acceptsAny(game, skirmishAboutToEnd.getMinionsInvolved(), minionsInvolving);
|
return Filters.acceptsAny(game, skirmishAboutToEnd.getAllInvolved(), charactersInvolving);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,17 +3,31 @@ package com.gempukku.lotro.logic.timing.results;
|
|||||||
import com.gempukku.lotro.game.PhysicalCard;
|
import com.gempukku.lotro.game.PhysicalCard;
|
||||||
import com.gempukku.lotro.logic.timing.EffectResult;
|
import com.gempukku.lotro.logic.timing.EffectResult;
|
||||||
|
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
public class SkirmishAboutToEndResult extends EffectResult {
|
public class SkirmishAboutToEndResult extends EffectResult {
|
||||||
private final Set<PhysicalCard> _minionsInvolved;
|
private final Set<PhysicalCard> _minionsInvolved;
|
||||||
|
private final PhysicalCard _freepsInvolved;
|
||||||
|
|
||||||
public SkirmishAboutToEndResult(Set<PhysicalCard> minionsInvolved) {
|
public SkirmishAboutToEndResult(PhysicalCard freepsInvolved, Set<PhysicalCard> minionsInvolved) {
|
||||||
super(EffectResult.Type.SKIRMISH_ABOUT_TO_END);
|
super(EffectResult.Type.SKIRMISH_ABOUT_TO_END);
|
||||||
_minionsInvolved = minionsInvolved;
|
_freepsInvolved = freepsInvolved;
|
||||||
|
_minionsInvolved = Objects.requireNonNullElseGet(minionsInvolved, HashSet::new);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Set<PhysicalCard> getMinionsInvolved() {
|
public Set<PhysicalCard> getMinionsInvolved() {
|
||||||
return _minionsInvolved;
|
return _minionsInvolved;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public PhysicalCard getFreepsInvolved() {
|
||||||
|
return _freepsInvolved;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Set<PhysicalCard> getAllInvolved() {
|
||||||
|
var everyone = new HashSet<>(_minionsInvolved);
|
||||||
|
everyone.add(_freepsInvolved);
|
||||||
|
return everyone;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package com.gempukku.lotro.cards.official.set08;
|
|||||||
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.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;
|
||||||
|
|
||||||
@@ -18,8 +17,8 @@ public class Card_08_113_Tests
|
|||||||
return new GenericCardTestHelper(
|
return new GenericCardTestHelper(
|
||||||
new HashMap<>()
|
new HashMap<>()
|
||||||
{{
|
{{
|
||||||
put("card", "8_113");
|
put("sting", "8_113");
|
||||||
// put other cards in here as needed for the test case
|
put("shelob", "8_25");
|
||||||
}},
|
}},
|
||||||
GenericCardTestHelper.FellowshipSites,
|
GenericCardTestHelper.FellowshipSites,
|
||||||
GenericCardTestHelper.FOTRFrodo,
|
GenericCardTestHelper.FOTRFrodo,
|
||||||
@@ -40,12 +39,14 @@ public class Card_08_113_Tests
|
|||||||
* Type: Possession
|
* Type: Possession
|
||||||
* Subtype: Hand weapon
|
* Subtype: Hand weapon
|
||||||
* Strength: 2
|
* Strength: 2
|
||||||
* Game Text: Bearer must be Frodo or Sam.<br><b>Response:</b> If a fierce skirmish involving bearer is about to end, add a threat to discard a minion involved in that skirmish.
|
* Game Text: Bearer must be Frodo or Sam.
|
||||||
|
* <b>Response:</b> If a fierce skirmish involving bearer is about to end, add a threat to discard a minion
|
||||||
|
* involved in that skirmish.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var scn = GetScenario();
|
var scn = GetScenario();
|
||||||
|
|
||||||
var card = scn.GetFreepsCard("card");
|
var card = scn.GetFreepsCard("sting");
|
||||||
|
|
||||||
assertEquals("Sting", card.getBlueprint().getTitle());
|
assertEquals("Sting", card.getBlueprint().getTitle());
|
||||||
assertEquals("Bane of the Eight Legs", card.getBlueprint().getSubtitle());
|
assertEquals("Bane of the Eight Legs", card.getBlueprint().getSubtitle());
|
||||||
@@ -58,18 +59,39 @@ public class Card_08_113_Tests
|
|||||||
assertEquals(2, card.getBlueprint().getStrength());
|
assertEquals(2, card.getBlueprint().getStrength());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Uncomment any @Test markers below once this is ready to be used
|
@Test
|
||||||
//@Test
|
public void StingTriggersAfterFierceButNotRegularSkirmish() throws DecisionResultInvalidException, CardNotFoundException {
|
||||||
public void StingTest1() throws DecisionResultInvalidException, CardNotFoundException {
|
|
||||||
//Pre-game setup
|
//Pre-game setup
|
||||||
var scn = GetScenario();
|
var scn = GetScenario();
|
||||||
|
|
||||||
var card = scn.GetFreepsCard("card");
|
var frodo = scn.GetRingBearer();
|
||||||
scn.FreepsMoveCardToHand(card);
|
var sting = scn.GetFreepsCard("sting");
|
||||||
|
scn.FreepsAttachCardsTo(frodo, sting);
|
||||||
|
|
||||||
|
var shelob = scn.GetShadowCard("shelob");
|
||||||
|
scn.ShadowMoveCharToTable(shelob);
|
||||||
|
|
||||||
scn.StartGame();
|
scn.StartGame();
|
||||||
scn.FreepsPlayCard(card);
|
scn.SkipToAssignments();
|
||||||
|
scn.FreepsAssignToMinions(frodo, shelob);
|
||||||
|
scn.FreepsResolveSkirmish(frodo);
|
||||||
|
scn.PassCurrentPhaseActions();
|
||||||
|
scn.FreepsDeclineOptionalTrigger(); //Ring converting burdens
|
||||||
|
assertFalse(scn.FreepsDecisionAvailable("Sting"));
|
||||||
|
|
||||||
assertEquals(1, scn.GetTwilight());
|
//Fierce assignment
|
||||||
|
scn.PassCurrentPhaseActions();
|
||||||
|
scn.FreepsAssignToMinions(frodo, shelob);
|
||||||
|
scn.FreepsResolveSkirmish(frodo);
|
||||||
|
scn.PassCurrentPhaseActions();
|
||||||
|
|
||||||
|
scn.FreepsDeclineOptionalTrigger(); //Ring converting burdens
|
||||||
|
assertTrue(scn.FreepsHasOptionalTriggerAvailable());
|
||||||
|
|
||||||
|
assertEquals(0, scn.GetThreats());
|
||||||
|
assertEquals(Zone.SHADOW_CHARACTERS, shelob.getZone());
|
||||||
|
scn.FreepsAcceptOptionalTrigger();
|
||||||
|
assertEquals(1, scn.GetThreats());
|
||||||
|
assertEquals(Zone.DISCARD, shelob.getZone());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user