- "Realm of Dwarrowdelf" now has two separate limits (for str and dmg).
This commit is contained in:
@@ -11,6 +11,7 @@ import com.gempukku.lotro.logic.timing.UnrespondableEffect;
|
|||||||
public class CheckPhaseLimitEffect extends UnrespondableEffect {
|
public class CheckPhaseLimitEffect extends UnrespondableEffect {
|
||||||
private Action _action;
|
private Action _action;
|
||||||
private PhysicalCard _card;
|
private PhysicalCard _card;
|
||||||
|
private String _limitPrefix;
|
||||||
private int _limit;
|
private int _limit;
|
||||||
private Phase _phase;
|
private Phase _phase;
|
||||||
private Effect _limitedEffect;
|
private Effect _limitedEffect;
|
||||||
@@ -20,7 +21,12 @@ public class CheckPhaseLimitEffect extends UnrespondableEffect {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public CheckPhaseLimitEffect(Action action, PhysicalCard card, int limit, Phase phase, Effect limitedEffect) {
|
public CheckPhaseLimitEffect(Action action, PhysicalCard card, int limit, Phase phase, Effect limitedEffect) {
|
||||||
|
this(action, card, "", limit, phase, limitedEffect);
|
||||||
|
}
|
||||||
|
|
||||||
|
public CheckPhaseLimitEffect(Action action, PhysicalCard card, String limitPrefix, int limit, Phase phase, Effect limitedEffect) {
|
||||||
_card = card;
|
_card = card;
|
||||||
|
_limitPrefix = limitPrefix;
|
||||||
_limit = limit;
|
_limit = limit;
|
||||||
_phase = phase;
|
_phase = phase;
|
||||||
_limitedEffect = limitedEffect;
|
_limitedEffect = limitedEffect;
|
||||||
@@ -33,7 +39,7 @@ public class CheckPhaseLimitEffect extends UnrespondableEffect {
|
|||||||
if (phase == null)
|
if (phase == null)
|
||||||
phase = game.getGameState().getCurrentPhase();
|
phase = game.getGameState().getCurrentPhase();
|
||||||
|
|
||||||
int incrementedBy = game.getModifiersQuerying().getUntilEndOfPhaseLimitCounter(_card, phase).incrementToLimit(_limit, 1);
|
int incrementedBy = game.getModifiersQuerying().getUntilEndOfPhaseLimitCounter(_card, _limitPrefix, phase).incrementToLimit(_limit, 1);
|
||||||
if (incrementedBy > 0) {
|
if (incrementedBy > 0) {
|
||||||
SubAction subAction = new SubAction(_action);
|
SubAction subAction = new SubAction(_action);
|
||||||
subAction.appendEffect(
|
subAction.appendEffect(
|
||||||
|
|||||||
@@ -44,12 +44,12 @@ public class Card2_012 extends AbstractPermanent {
|
|||||||
@Override
|
@Override
|
||||||
protected void cardSelected(LotroGame game, PhysicalCard dwarf) {
|
protected void cardSelected(LotroGame game, PhysicalCard dwarf) {
|
||||||
action.appendEffect(
|
action.appendEffect(
|
||||||
new CheckPhaseLimitEffect(action, self, 3, Phase.SKIRMISH,
|
new CheckPhaseLimitEffect(action, self, "str", 3, Phase.SKIRMISH,
|
||||||
new AddUntilEndOfPhaseModifierEffect(
|
new AddUntilEndOfPhaseModifierEffect(
|
||||||
new StrengthModifier(self, Filters.sameCard(dwarf), 1), Phase.SKIRMISH)));
|
new StrengthModifier(self, Filters.sameCard(dwarf), 1), Phase.SKIRMISH)));
|
||||||
if (PlayConditions.location(game, Keyword.UNDERGROUND))
|
if (PlayConditions.location(game, Keyword.UNDERGROUND))
|
||||||
action.appendEffect(
|
action.appendEffect(
|
||||||
new CheckPhaseLimitEffect(action, self, 3, Phase.SKIRMISH,
|
new CheckPhaseLimitEffect(action, self, "dmg", 3, Phase.SKIRMISH,
|
||||||
new AddUntilEndOfPhaseModifierEffect(
|
new AddUntilEndOfPhaseModifierEffect(
|
||||||
new KeywordModifier(self, Filters.sameCard(dwarf), Keyword.DAMAGE), Phase.SKIRMISH)));
|
new KeywordModifier(self, Filters.sameCard(dwarf), Keyword.DAMAGE), Phase.SKIRMISH)));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ public class ModifiersLogic implements ModifiersEnvironment, ModifiersQuerying {
|
|||||||
|
|
||||||
private Set<Modifier> _skipSet = new HashSet<Modifier>();
|
private Set<Modifier> _skipSet = new HashSet<Modifier>();
|
||||||
|
|
||||||
private Map<Phase, Map<Integer, LimitCounter>> _phaseLimitCounters = new HashMap<Phase, Map<Integer, LimitCounter>>();
|
private Map<Phase, Map<String, LimitCounter>> _phaseLimitCounters = new HashMap<Phase, Map<String, LimitCounter>>();
|
||||||
private Map<Integer, LimitCounter> _turnLimitCounters = new HashMap<Integer, LimitCounter>();
|
private Map<Integer, LimitCounter> _turnLimitCounters = new HashMap<Integer, LimitCounter>();
|
||||||
|
|
||||||
private int _drawnThisPhaseCount = 0;
|
private int _drawnThisPhaseCount = 0;
|
||||||
@@ -26,15 +26,20 @@ public class ModifiersLogic implements ModifiersEnvironment, ModifiersQuerying {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public LimitCounter getUntilEndOfPhaseLimitCounter(PhysicalCard card, Phase phase) {
|
public LimitCounter getUntilEndOfPhaseLimitCounter(PhysicalCard card, Phase phase) {
|
||||||
Map<Integer, LimitCounter> limitCounterMap = _phaseLimitCounters.get(phase);
|
return getUntilEndOfPhaseLimitCounter(card, "", phase);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public LimitCounter getUntilEndOfPhaseLimitCounter(PhysicalCard card, String prefix, Phase phase) {
|
||||||
|
Map<String, LimitCounter> limitCounterMap = _phaseLimitCounters.get(phase);
|
||||||
if (limitCounterMap == null) {
|
if (limitCounterMap == null) {
|
||||||
limitCounterMap = new HashMap<Integer, LimitCounter>();
|
limitCounterMap = new HashMap<String, LimitCounter>();
|
||||||
_phaseLimitCounters.put(phase, limitCounterMap);
|
_phaseLimitCounters.put(phase, limitCounterMap);
|
||||||
}
|
}
|
||||||
LimitCounter limitCounter = limitCounterMap.get(card.getCardId());
|
LimitCounter limitCounter = limitCounterMap.get(prefix + card.getCardId());
|
||||||
if (limitCounter == null) {
|
if (limitCounter == null) {
|
||||||
limitCounter = new DefaultLimitCounter();
|
limitCounter = new DefaultLimitCounter();
|
||||||
limitCounterMap.put(card.getCardId(), limitCounter);
|
limitCounterMap.put(prefix + card.getCardId(), limitCounter);
|
||||||
}
|
}
|
||||||
return limitCounter;
|
return limitCounter;
|
||||||
}
|
}
|
||||||
@@ -128,7 +133,7 @@ public class ModifiersLogic implements ModifiersEnvironment, ModifiersQuerying {
|
|||||||
removeModifiers(list);
|
removeModifiers(list);
|
||||||
list.clear();
|
list.clear();
|
||||||
}
|
}
|
||||||
Map<Integer, LimitCounter> counterMap = _phaseLimitCounters.get(phase);
|
Map<String, LimitCounter> counterMap = _phaseLimitCounters.get(phase);
|
||||||
if (counterMap != null)
|
if (counterMap != null)
|
||||||
counterMap.clear();
|
counterMap.clear();
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,8 @@ import java.util.Set;
|
|||||||
public interface ModifiersQuerying {
|
public interface ModifiersQuerying {
|
||||||
public LimitCounter getUntilEndOfPhaseLimitCounter(PhysicalCard card, Phase phase);
|
public LimitCounter getUntilEndOfPhaseLimitCounter(PhysicalCard card, Phase phase);
|
||||||
|
|
||||||
|
public LimitCounter getUntilEndOfPhaseLimitCounter(PhysicalCard card, String prefix, Phase phase);
|
||||||
|
|
||||||
public LimitCounter getUntilEndOfTurnLimitCounter(PhysicalCard card);
|
public LimitCounter getUntilEndOfTurnLimitCounter(PhysicalCard card);
|
||||||
|
|
||||||
public Collection<Modifier> getModifiersAffecting(GameState gameState, PhysicalCard card);
|
public Collection<Modifier> getModifiersAffecting(GameState gameState, PhysicalCard card);
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<pre style="font-size:80%">
|
<pre style="font-size:80%">
|
||||||
<b>30 Apr. 2012</b>
|
<b>30 Apr. 2012</b>
|
||||||
- "Pillage of Rohan" should now work correctly.
|
- "Pillage of Rohan" should now work correctly.
|
||||||
|
- "Realm of Dwarrowdelf" now has two separate limits (for str and dmg).
|
||||||
|
|
||||||
<b>27 Apr. 2012</b>
|
<b>27 Apr. 2012</b>
|
||||||
- "Morning Came" now correctly adds +2 Strength to the character if shadow player puts card from hand beneath his/her
|
- "Morning Came" now correctly adds +2 Strength to the character if shadow player puts card from hand beneath his/her
|
||||||
|
|||||||
Reference in New Issue
Block a user