"Nurn"
This commit is contained in:
@@ -115,6 +115,11 @@ public abstract class AbstractLotroCardBlueprint implements LotroCardBlueprint {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<? extends Modifier> getControlledSiteModifiers(LotroGame game, PhysicalCard self) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public Modifier getAlwaysOnModifier(PhysicalCard self) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ public class TakeControlOfASiteEffect extends AbstractEffect implements Preventa
|
||||
protected FullEffectResult playEffectReturningResult(LotroGame game) {
|
||||
PhysicalCard site = getFirstControllableSite(game);
|
||||
if (site != null && !_prevented) {
|
||||
game.getGameState().takeControlOfCard(_playerId, site, Zone.SUPPORT);
|
||||
game.getGameState().takeControlOfCard(_playerId, game, site, Zone.SUPPORT);
|
||||
game.getGameState().sendMessage(_playerId + " took control of " + GameUtils.getCardLink(site));
|
||||
game.getActionsEnvironment().emitEffectResult(new TakeControlOfSiteResult(_playerId));
|
||||
return new FullEffectResult(true, true);
|
||||
|
||||
@@ -56,7 +56,7 @@ public class Card15_174 extends AbstractMinion {
|
||||
siteOnPath.setSiteNumber(controlledNumber);
|
||||
controlledSite.setSiteNumber(onPathNumber);
|
||||
game.getGameState().loseControlOfCard(controlledSite, Zone.ADVENTURE_PATH);
|
||||
game.getGameState().takeControlOfCard(playerId, siteOnPath, Zone.SUPPORT);
|
||||
game.getGameState().takeControlOfCard(playerId, game, siteOnPath, Zone.SUPPORT);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.gempukku.lotro.cards.set17.site;
|
||||
|
||||
import com.gempukku.lotro.cards.AbstractNewSite;
|
||||
import com.gempukku.lotro.common.CardType;
|
||||
import com.gempukku.lotro.common.Keyword;
|
||||
import com.gempukku.lotro.filters.Filters;
|
||||
import com.gempukku.lotro.game.PhysicalCard;
|
||||
import com.gempukku.lotro.game.state.LotroGame;
|
||||
import com.gempukku.lotro.logic.modifiers.Modifier;
|
||||
import com.gempukku.lotro.logic.modifiers.StrengthModifier;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Set: Rise of Saruman
|
||||
* Twilight Cost: 1
|
||||
* Type: Site
|
||||
* Game Text: Plains. While you control this site, each of your hunter minions is strength +1.
|
||||
*/
|
||||
public class Card17_148 extends AbstractNewSite {
|
||||
public Card17_148() {
|
||||
super("Nurn", 1, Direction.LEFT);
|
||||
addKeyword(Keyword.PLAINS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<? extends Modifier> getControlledSiteModifiers(LotroGame game, PhysicalCard self) {
|
||||
return Collections.singletonList(
|
||||
new StrengthModifier(self, Filters.and(Filters.owner(self.getCardController()), CardType.MINION, Keyword.HUNTER), 1));
|
||||
}
|
||||
}
|
||||
@@ -51,6 +51,8 @@ public interface LotroCardBlueprint {
|
||||
|
||||
public List<? extends Modifier> getInDiscardModifiers(LotroGame game, PhysicalCard self);
|
||||
|
||||
public List<? extends Modifier> getControlledSiteModifiers(LotroGame game, PhysicalCard self);
|
||||
|
||||
public boolean checkPlayRequirements(String playerId, LotroGame game, PhysicalCard self, int withTwilightRemoved, int twilightModifier, boolean ignoreRoamingPenalty, boolean ignoreCheckingDeadPile);
|
||||
|
||||
public CostToEffectAction getPlayCardAction(String playerId, LotroGame game, PhysicalCard self, int twilightModifier, boolean ignoreRoamingPenalty);
|
||||
|
||||
@@ -22,6 +22,7 @@ public class PhysicalCardImpl implements PhysicalCard {
|
||||
private List<ModifierHook> _modifierHooks;
|
||||
private List<ModifierHook> _modifierHooksStacked;
|
||||
private List<ModifierHook> _modifierHooksInDiscard;
|
||||
private List<ModifierHook> _modifierHooksControlledSite;
|
||||
|
||||
private Object _data;
|
||||
|
||||
@@ -119,6 +120,23 @@ public class PhysicalCardImpl implements PhysicalCard {
|
||||
}
|
||||
}
|
||||
|
||||
public void startAffectingGameControlledSite(LotroGame game) {
|
||||
List<? extends Modifier> modifiers = _blueprint.getControlledSiteModifiers(game, this);
|
||||
if (modifiers != null) {
|
||||
_modifierHooksControlledSite = new LinkedList<ModifierHook>();
|
||||
for (Modifier modifier : modifiers)
|
||||
_modifierHooksControlledSite.add(game.getModifiersEnvironment().addAlwaysOnModifier(modifier));
|
||||
}
|
||||
}
|
||||
|
||||
public void stopAffectingGameControlledSite() {
|
||||
if (_modifierHooksControlledSite != null) {
|
||||
for (ModifierHook modifierHook : _modifierHooksControlledSite)
|
||||
modifierHook.stop();
|
||||
_modifierHooksControlledSite = null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCardId() {
|
||||
return _cardId;
|
||||
|
||||
@@ -242,14 +242,18 @@ public class GameState {
|
||||
listener.cardMoved(card);
|
||||
}
|
||||
|
||||
public void takeControlOfCard(String playerId, PhysicalCard card, Zone zone) {
|
||||
public void takeControlOfCard(String playerId, LotroGame game, PhysicalCard card, Zone zone) {
|
||||
((PhysicalCardImpl) card).setCardController(playerId);
|
||||
((PhysicalCardImpl) card).setZone(zone);
|
||||
if (card.getBlueprint().getCardType() == CardType.SITE)
|
||||
startAffectingControlledSite(game, card);
|
||||
for (GameStateListener listener : getAllGameStateListeners())
|
||||
listener.cardMoved(card);
|
||||
}
|
||||
|
||||
public void loseControlOfCard(PhysicalCard card, Zone zone) {
|
||||
if (card.getBlueprint().getCardType() == CardType.SITE)
|
||||
stopAffectingControlledSite(card);
|
||||
((PhysicalCardImpl) card).setCardController(null);
|
||||
((PhysicalCardImpl) card).setZone(zone);
|
||||
for (GameStateListener listener : getAllGameStateListeners())
|
||||
@@ -781,6 +785,10 @@ public class GameState {
|
||||
for (PhysicalCardImpl physicalCard : _inPlay) {
|
||||
if (isCardInPlayActive(physicalCard) && physicalCard.getBlueprint().getCardType() != CardType.SITE)
|
||||
startAffecting(game, physicalCard);
|
||||
else if (physicalCard.getBlueprint().getCardType() == CardType.SITE &&
|
||||
physicalCard.getCardController() != null) {
|
||||
startAffectingControlledSite(game, physicalCard);
|
||||
}
|
||||
}
|
||||
|
||||
// Current site is affecting
|
||||
@@ -798,6 +806,10 @@ public class GameState {
|
||||
startAffectingInDiscard(game, discardedCard);
|
||||
}
|
||||
|
||||
private void startAffectingControlledSite(LotroGame game, PhysicalCard physicalCard) {
|
||||
((PhysicalCardImpl) physicalCard).startAffectingGameControlledSite(game);
|
||||
}
|
||||
|
||||
public void reapplyAffectingForCard(LotroGame game, PhysicalCard card) {
|
||||
((PhysicalCardImpl) card).stopAffectingGame();
|
||||
((PhysicalCardImpl) card).startAffectingGame(game);
|
||||
@@ -807,6 +819,10 @@ public class GameState {
|
||||
for (PhysicalCardImpl physicalCard : _inPlay) {
|
||||
if (isCardInPlayActive(physicalCard) && physicalCard.getBlueprint().getCardType() != CardType.SITE)
|
||||
stopAffecting(physicalCard);
|
||||
else if (physicalCard.getBlueprint().getCardType() == CardType.SITE &&
|
||||
physicalCard.getCardController() != null) {
|
||||
stopAffectingControlledSite(physicalCard);
|
||||
}
|
||||
}
|
||||
|
||||
stopAffecting(getCurrentSite());
|
||||
@@ -821,6 +837,10 @@ public class GameState {
|
||||
stopAffectingInDiscard(discardedCard);
|
||||
}
|
||||
|
||||
private void stopAffectingControlledSite(PhysicalCard physicalCard) {
|
||||
((PhysicalCardImpl) physicalCard).stopAffectingGameControlledSite();
|
||||
}
|
||||
|
||||
private void startAffecting(LotroGame game, PhysicalCard card) {
|
||||
((PhysicalCardImpl) card).startAffectingGame(game);
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ public class PlaySiteEffect extends AbstractEffect {
|
||||
gameState.sendMessage(newSite.getOwner() + " plays " + GameUtils.getCardLink(newSite));
|
||||
|
||||
if (controlled != null) {
|
||||
gameState.takeControlOfCard(controlled, newSite, zone);
|
||||
gameState.takeControlOfCard(controlled, game, newSite, zone);
|
||||
for (PhysicalCard physicalCard : stacked)
|
||||
gameState.stackCard(game, physicalCard, newSite);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user