"Orkish Fiend"
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
package com.gempukku.lotro.cards.modifiers;
|
||||
|
||||
import com.gempukku.lotro.game.PhysicalCard;
|
||||
import com.gempukku.lotro.game.state.GameState;
|
||||
import com.gempukku.lotro.logic.modifiers.AbstractModifier;
|
||||
import com.gempukku.lotro.logic.modifiers.Condition;
|
||||
import com.gempukku.lotro.logic.modifiers.ModifierEffect;
|
||||
import com.gempukku.lotro.logic.modifiers.ModifiersQuerying;
|
||||
|
||||
public class CantPlaySiteByFPPlayerModifier extends AbstractModifier {
|
||||
public CantPlaySiteByFPPlayerModifier(PhysicalCard source, Condition condition) {
|
||||
super(source, "Can't be replaced by Free Peoples player", null, condition, ModifierEffect.PLAY_SITE_MODIFIER);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlaySite(GameState gameState, ModifiersQuerying modifiersQuerying, String playerId) {
|
||||
if (playerId.equals(gameState.getCurrentPlayerId()))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.gempukku.lotro.cards.set17.orc;
|
||||
|
||||
import com.gempukku.lotro.cards.AbstractMinion;
|
||||
import com.gempukku.lotro.cards.PlayConditions;
|
||||
import com.gempukku.lotro.cards.modifiers.CantPlaySiteByFPPlayerModifier;
|
||||
import com.gempukku.lotro.cards.modifiers.CantReplaceSiteByFPPlayerModifier;
|
||||
import com.gempukku.lotro.cards.modifiers.conditions.LocationCondition;
|
||||
import com.gempukku.lotro.common.Culture;
|
||||
import com.gempukku.lotro.common.Keyword;
|
||||
import com.gempukku.lotro.common.Race;
|
||||
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.KeywordModifier;
|
||||
import com.gempukku.lotro.logic.modifiers.Modifier;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Set: Rise of Saruman
|
||||
* Side: Shadow
|
||||
* Culture: Orc
|
||||
* Twilight Cost: 8
|
||||
* Type: Minion • Orc
|
||||
* Strength: 18
|
||||
* Vitality: 4
|
||||
* Site: 4
|
||||
* Game Text: To play, spot an [ORC] Orc. While at an underground site, this minion is fierce and the Free Peoples
|
||||
* player may not replace sites or play a site from his or her adventure deck.
|
||||
*/
|
||||
public class Card17_076 extends AbstractMinion {
|
||||
public Card17_076() {
|
||||
super(8, 18, 4, 4, Race.ORC, Culture.ORC, "Orkish Fiend");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkPlayRequirements(String playerId, LotroGame game, PhysicalCard self, int withTwilightRemoved, int twilightModifier, boolean ignoreRoamingPenalty, boolean ignoreCheckingDeadPile) {
|
||||
return super.checkPlayRequirements(playerId, game, self, withTwilightRemoved, twilightModifier, ignoreRoamingPenalty, ignoreCheckingDeadPile)
|
||||
&& PlayConditions.canSpot(game, Culture.ORC, Race.ORC);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<? extends Modifier> getAlwaysOnModifiers(LotroGame game, PhysicalCard self) {
|
||||
List<Modifier> modifiers = new LinkedList<Modifier>();
|
||||
modifiers.add(
|
||||
new KeywordModifier(self, self, new LocationCondition(Keyword.UNDERGROUND), Keyword.FIERCE, 1));
|
||||
modifiers.add(
|
||||
new CantReplaceSiteByFPPlayerModifier(self, new LocationCondition(Keyword.UNDERGROUND), Filters.any));
|
||||
modifiers.add(
|
||||
new CantPlaySiteByFPPlayerModifier(self, new LocationCondition(Keyword.UNDERGROUND)));
|
||||
return modifiers;
|
||||
}
|
||||
}
|
||||
@@ -95,7 +95,8 @@ public class PlaySiteEffect extends AbstractEffect {
|
||||
|
||||
PhysicalCard currentSite = game.getGameState().getSite(siteNumber);
|
||||
|
||||
if (newSite.size() > 0 && (currentSite == null || game.getModifiersQuerying().canReplaceSite(game.getGameState(), _playerId, currentSite))) {
|
||||
if (newSite.size() > 0 && (currentSite == null || game.getModifiersQuerying().canReplaceSite(game.getGameState(), _playerId, currentSite))
|
||||
&& game.getModifiersQuerying().canPlaySite(game.getGameState(), _playerId)) {
|
||||
SubAction subAction = new SubAction(_action);
|
||||
subAction.appendEffect(
|
||||
new ChooseArbitraryCardsEffect(_playerId, "Choose site to play", newSite, 1, 1) {
|
||||
@@ -146,7 +147,7 @@ public class PlaySiteEffect extends AbstractEffect {
|
||||
game.getActionsEnvironment().addActionToStack(subAction);
|
||||
return new FullEffectResult(true, true);
|
||||
} else if (newSite.size() > 0) {
|
||||
game.getGameState().sendMessage("Can't replace a site");
|
||||
game.getGameState().sendMessage("Can't play a site");
|
||||
return new FullEffectResult(false, false);
|
||||
} else {
|
||||
game.getGameState().sendMessage("Can't find a matching site to play in " + _playerId + " adventure deck");
|
||||
|
||||
@@ -307,6 +307,11 @@ public abstract class AbstractModifier implements Modifier {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlaySite(GameState gameState, ModifiersQuerying modifiersQuerying, String playerId) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Side hasInitiative(GameState gameState, ModifiersQuerying modifiersQuerying) {
|
||||
return null;
|
||||
|
||||
@@ -123,6 +123,8 @@ public interface Modifier {
|
||||
|
||||
public boolean isSiteReplaceable(GameState gameState, ModifiersQuerying modifiersQuerying, String playerId);
|
||||
|
||||
public boolean canPlaySite(GameState gameState, ModifiersQuerying modifiersQuerying, String playerId);
|
||||
|
||||
public Side hasInitiative(GameState gameState, ModifiersQuerying modifiersQuerying);
|
||||
|
||||
public int getInitiativeHandSizeModifier(GameState gameState, ModifiersQuerying modifiersQuerying);
|
||||
|
||||
@@ -12,7 +12,7 @@ public enum ModifierEffect {
|
||||
EXTRA_ACTION_MODIFIER, EXTRA_COST_MODIFIER,
|
||||
INITIATIVE_MODIFIER, TEXT_MODIFIER,
|
||||
|
||||
SPECIAL_FLAG_MODIFIER, REPLACE_SITE_MODIFIER,
|
||||
SPECIAL_FLAG_MODIFIER, REPLACE_SITE_MODIFIER, PLAY_SITE_MODIFIER,
|
||||
|
||||
ADDITIONAL_CARD_TYPE,
|
||||
|
||||
|
||||
@@ -873,6 +873,15 @@ public class ModifiersLogic implements ModifiersEnvironment, ModifiersQuerying {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlaySite(GameState gameState, String playerId) {
|
||||
for (Modifier modifier : getModifiers(gameState, ModifierEffect.PLAY_SITE_MODIFIER))
|
||||
if (!modifier.canPlaySite(gameState, this, playerId))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private class ModifierHookImpl implements ModifierHook {
|
||||
private Modifier _modifier;
|
||||
|
||||
|
||||
@@ -122,4 +122,6 @@ public interface ModifiersQuerying {
|
||||
public boolean hasFlagActive(GameState gameState, ModifierFlag modifierFlag);
|
||||
|
||||
public boolean canReplaceSite(GameState gameState, String playerId, PhysicalCard siteToReplace);
|
||||
|
||||
public boolean canPlaySite(GameState gameState, String playerId);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user