Some Reflections cards
This commit is contained in:
137
gemp-lotr/gemp-lotr-async/src/main/web/cards/set9.json
Normal file
137
gemp-lotr/gemp-lotr-async/src/main/web/cards/set9.json
Normal file
@@ -0,0 +1,137 @@
|
||||
{
|
||||
"9_1": {
|
||||
"title": "*The One Ring",
|
||||
"subtitle": "The Binding Ring",
|
||||
"type": "the one ring",
|
||||
"cost": 0,
|
||||
"strength": 1,
|
||||
"vitality": 1,
|
||||
"effects": [
|
||||
{
|
||||
"type": "activated",
|
||||
"phase": "fellowship",
|
||||
"condition": {
|
||||
"type": "ringIsActive"
|
||||
},
|
||||
"cost": {
|
||||
"type": "addBurdens",
|
||||
"amount": 2
|
||||
},
|
||||
"effect": {
|
||||
"type": "playCardFromDrawDeck",
|
||||
"filter": "choose(ring)"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "activated",
|
||||
"phase": "maneuver",
|
||||
"condition": {
|
||||
"type": "ringIsActive"
|
||||
},
|
||||
"cost": {
|
||||
"type": "exert",
|
||||
"filter": "choose(bearer)"
|
||||
},
|
||||
"effect": {
|
||||
"type": "putOnRing"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "trigger",
|
||||
"condition": [
|
||||
{
|
||||
"type": "ringIsOn"
|
||||
},
|
||||
{
|
||||
"type": "ringIsActive"
|
||||
}
|
||||
],
|
||||
"trigger": {
|
||||
"type": "aboutToTakeWound",
|
||||
"filter": "bearer"
|
||||
},
|
||||
"effect": [
|
||||
{
|
||||
"type": "negateWound",
|
||||
"filter": "all(bearer)"
|
||||
},
|
||||
{
|
||||
"type": "addBurdens"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"9_2": {
|
||||
"title": "*Freca",
|
||||
"subtitle": "Hungry Savage",
|
||||
"culture": "dunland",
|
||||
"cost": 4,
|
||||
"type": "minion",
|
||||
"race": "man",
|
||||
"strength": 9,
|
||||
"vitality": 1,
|
||||
"site": 3,
|
||||
"effects": [
|
||||
{
|
||||
"type": "trigger",
|
||||
"optional": true,
|
||||
"trigger": {
|
||||
"type": "played",
|
||||
"filter": "self"
|
||||
},
|
||||
"condition": {
|
||||
"type": "canSpot",
|
||||
"filter": "another,culture(dunland),man"
|
||||
},
|
||||
"effect": {
|
||||
"type": "takeControlOfSite"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "killedTrigger",
|
||||
"condition": {
|
||||
"type": "isSide",
|
||||
"side": "free people"
|
||||
},
|
||||
"effect": {
|
||||
"type": "liberateSite"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"9_3": {
|
||||
"title": "*Durin III",
|
||||
"subtitle": "Dwarven Lord",
|
||||
"culture": "dwarven",
|
||||
"cost": 4,
|
||||
"type": "companion",
|
||||
"race": "dwarf",
|
||||
"strength": 7,
|
||||
"vitality": 4,
|
||||
"resistance": 6,
|
||||
"keyword": "damage+1",
|
||||
"effects": [
|
||||
{
|
||||
"type": "modifyOwnCost",
|
||||
"condition": {
|
||||
"type": "canSpot",
|
||||
"filter": "dwarf",
|
||||
"count": 2
|
||||
},
|
||||
"amount": -2
|
||||
},
|
||||
{
|
||||
"type": "modifier",
|
||||
"modifier": {
|
||||
"type": "modifyStrength",
|
||||
"filter": "self",
|
||||
"amount": {
|
||||
"type": "forEachYouCanSpot",
|
||||
"filter": "or(artifact,possession),attachedTo(self)"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -70,6 +70,7 @@ public class BuiltLotroCardBlueprint implements LotroCardBlueprint {
|
||||
private List<Requirement> playInOtherPhaseConditions;
|
||||
|
||||
private ActionSource playEventAction;
|
||||
private ActionSource killedTriggerAction;
|
||||
|
||||
private ExtraPossessionClassTest extraPossessionClassTest;
|
||||
|
||||
@@ -214,6 +215,10 @@ public class BuiltLotroCardBlueprint implements LotroCardBlueprint {
|
||||
this.playEventAction = playEventAction;
|
||||
}
|
||||
|
||||
public void setKilledTriggerAction(ActionSource killedTriggerAction) {
|
||||
this.killedTriggerAction = killedTriggerAction;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
@@ -724,7 +729,13 @@ public class BuiltLotroCardBlueprint implements LotroCardBlueprint {
|
||||
|
||||
@Override
|
||||
public OptionalTriggerAction getKilledOptionalTrigger(String playerId, LotroGame game, PhysicalCard self) {
|
||||
return null;
|
||||
if (killedTriggerAction == null)
|
||||
return null;
|
||||
|
||||
DefaultActionContext actionContext = new DefaultActionContext(playerId, game, self, null, null);
|
||||
OptionalTriggerAction action = new OptionalTriggerAction(self);
|
||||
killedTriggerAction.createAction(action, actionContext);
|
||||
return action;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -19,6 +19,7 @@ public class EffectFieldProcessor implements FieldProcessor {
|
||||
effectProcessors.put("trigger", new TriggerEffectProcessor());
|
||||
effectProcessors.put("inhandtrigger", new InHandTriggerEffectProcessor());
|
||||
effectProcessors.put("activatedtrigger", new ActivatedTriggerEffectProcessor());
|
||||
effectProcessors.put("killedtrigger", new KilledTriggerEffectProcessor());
|
||||
effectProcessors.put("activated", new ActivatedEffectProcessor());
|
||||
effectProcessors.put("event", new EventEffectProcessor());
|
||||
effectProcessors.put("responseevent", new ResponseEventEffectProcessor());
|
||||
|
||||
@@ -104,6 +104,8 @@ public class EffectAppenderFactory {
|
||||
effectAppenderProducers.put("corruptringbearer", new CorruptRingBearer());
|
||||
effectAppenderProducers.put("kill", new Kill());
|
||||
effectAppenderProducers.put("endphase", new EndPhase());
|
||||
effectAppenderProducers.put("takecontrolofsite", new TakeControlOfSite());
|
||||
effectAppenderProducers.put("liberatesite", new LiberateSite());
|
||||
}
|
||||
|
||||
public EffectAppender getEffectAppender(JSONObject effectObject, CardGenerationEnvironment environment) throws InvalidCardDefinitionException {
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.gempukku.lotro.cards.build.field.effect;
|
||||
|
||||
import com.gempukku.lotro.cards.build.BuiltLotroCardBlueprint;
|
||||
import com.gempukku.lotro.cards.build.CardGenerationEnvironment;
|
||||
import com.gempukku.lotro.cards.build.InvalidCardDefinitionException;
|
||||
import com.gempukku.lotro.cards.build.field.EffectProcessor;
|
||||
import com.gempukku.lotro.cards.build.field.FieldUtils;
|
||||
import org.json.simple.JSONObject;
|
||||
|
||||
public class KilledTriggerEffectProcessor implements EffectProcessor {
|
||||
@Override
|
||||
public void processEffect(JSONObject value, BuiltLotroCardBlueprint blueprint, CardGenerationEnvironment environment) throws InvalidCardDefinitionException {
|
||||
FieldUtils.validateAllowedFields(value, "condition", "cost", "effect");
|
||||
|
||||
DefaultActionSource triggerActionSource = new DefaultActionSource();
|
||||
EffectUtils.processRequirementsCostsAndEffects(value, environment, triggerActionSource);
|
||||
blueprint.setKilledTriggerAction(triggerActionSource);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.gempukku.lotro.cards.build.field.effect.appender;
|
||||
|
||||
import com.gempukku.lotro.cards.build.ActionContext;
|
||||
import com.gempukku.lotro.cards.build.CardGenerationEnvironment;
|
||||
import com.gempukku.lotro.cards.build.InvalidCardDefinitionException;
|
||||
import com.gempukku.lotro.cards.build.field.FieldUtils;
|
||||
import com.gempukku.lotro.cards.build.field.effect.EffectAppender;
|
||||
import com.gempukku.lotro.cards.build.field.effect.EffectAppenderProducer;
|
||||
import com.gempukku.lotro.logic.actions.CostToEffectAction;
|
||||
import com.gempukku.lotro.logic.effects.LiberateASiteEffect;
|
||||
import com.gempukku.lotro.logic.timing.Effect;
|
||||
import com.gempukku.lotro.logic.timing.PlayConditions;
|
||||
import org.json.simple.JSONObject;
|
||||
|
||||
public class LiberateSite implements EffectAppenderProducer {
|
||||
@Override
|
||||
public EffectAppender createEffectAppender(JSONObject effectObject, CardGenerationEnvironment environment) throws InvalidCardDefinitionException {
|
||||
FieldUtils.validateAllowedFields(effectObject);
|
||||
|
||||
return new DelayedAppender() {
|
||||
@Override
|
||||
public boolean isPlayableInFull(ActionContext actionContext) {
|
||||
return PlayConditions.canLiberateASite(actionContext.getGame(), actionContext.getPerformingPlayer(), actionContext.getSource(), null);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Effect createEffect(boolean cost, CostToEffectAction action, ActionContext actionContext) {
|
||||
return new LiberateASiteEffect(action.getActionSource(), action.getPerformingPlayer(), null);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.gempukku.lotro.cards.build.field.effect.appender;
|
||||
|
||||
import com.gempukku.lotro.cards.build.ActionContext;
|
||||
import com.gempukku.lotro.cards.build.CardGenerationEnvironment;
|
||||
import com.gempukku.lotro.cards.build.InvalidCardDefinitionException;
|
||||
import com.gempukku.lotro.cards.build.field.FieldUtils;
|
||||
import com.gempukku.lotro.cards.build.field.effect.EffectAppender;
|
||||
import com.gempukku.lotro.cards.build.field.effect.EffectAppenderProducer;
|
||||
import com.gempukku.lotro.game.PhysicalCard;
|
||||
import com.gempukku.lotro.game.state.LotroGame;
|
||||
import com.gempukku.lotro.logic.actions.CostToEffectAction;
|
||||
import com.gempukku.lotro.logic.effects.TakeControlOfASiteEffect;
|
||||
import com.gempukku.lotro.logic.timing.Effect;
|
||||
import org.json.simple.JSONObject;
|
||||
|
||||
public class TakeControlOfSite implements EffectAppenderProducer {
|
||||
@Override
|
||||
public EffectAppender createEffectAppender(JSONObject effectObject, CardGenerationEnvironment environment) throws InvalidCardDefinitionException {
|
||||
FieldUtils.validateAllowedFields(effectObject);
|
||||
|
||||
return new DelayedAppender() {
|
||||
@Override
|
||||
public boolean isPlayableInFull(ActionContext actionContext) {
|
||||
final LotroGame game = actionContext.getGame();
|
||||
int maxUnoccupiedSite = Integer.MAX_VALUE;
|
||||
for (String playerId : game.getGameState().getPlayerOrder().getAllPlayers())
|
||||
maxUnoccupiedSite = Math.min(maxUnoccupiedSite, game.getGameState().getPlayerPosition(playerId) - 1);
|
||||
|
||||
for (int i = 1; i <= maxUnoccupiedSite; i++) {
|
||||
final PhysicalCard site = game.getGameState().getSite(i);
|
||||
if (site.getCardController() == null)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Effect createEffect(boolean cost, CostToEffectAction action, ActionContext actionContext) {
|
||||
return new TakeControlOfASiteEffect(action.getActionSource(), action.getPerformingPlayer());
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user