Migrated Dwarven cards in set 6 to hjson

This commit is contained in:
MarcinSc
2024-04-22 14:15:12 +07:00
parent 887b723faf
commit dcd758d768
12 changed files with 300 additions and 161 deletions

View File

@@ -32,7 +32,7 @@ public class Card10_010 extends AbstractEvent {
if (Filters.canSpot(game, CardType.SITE, Zone.SUPPORT))
action.appendEffect(
new OptionalEffect(action, playerId,
new PutPlayedEventOnTopOfDeckEffect(action)));
new PutPlayedEventOnTopOfDeckEffect(self)));
return action;
}
}

View File

@@ -1,11 +1,5 @@
package com.gempukku.lotro.cards.set13.elven;
import com.gempukku.lotro.logic.cardtype.AbstractCompanion;
import com.gempukku.lotro.logic.timing.PlayConditions;
import com.gempukku.lotro.logic.timing.TriggerConditions;
import com.gempukku.lotro.logic.effects.PutPlayedEventOnTopOfDeckEffect;
import com.gempukku.lotro.logic.effects.SelfExertEffect;
import com.gempukku.lotro.logic.timing.results.PlayEventResult;
import com.gempukku.lotro.common.CardType;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Phase;
@@ -14,7 +8,13 @@ import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.actions.ActivateCardAction;
import com.gempukku.lotro.logic.cardtype.AbstractCompanion;
import com.gempukku.lotro.logic.effects.PutPlayedEventOnTopOfDeckEffect;
import com.gempukku.lotro.logic.effects.SelfExertEffect;
import com.gempukku.lotro.logic.timing.EffectResult;
import com.gempukku.lotro.logic.timing.PlayConditions;
import com.gempukku.lotro.logic.timing.TriggerConditions;
import com.gempukku.lotro.logic.timing.results.PlayEventResult;
import java.util.Collections;
import java.util.List;
@@ -46,7 +46,7 @@ public class Card13_023 extends AbstractCompanion {
action.appendCost(
new SelfExertEffect(action, self));
action.appendEffect(
new PutPlayedEventOnTopOfDeckEffect(((PlayEventResult) effectResult).getPlayEventAction()));
new PutPlayedEventOnTopOfDeckEffect(((PlayEventResult) effectResult).getPlayedCard()));
return Collections.singletonList(action);
}
return null;

View File

@@ -59,7 +59,7 @@ public class Card6_011 extends AbstractEvent {
protected void validDecisionMade(int index, String result) {
if (index == 0)
action.insertEffect(
new PutPlayedEventOnTopOfDeckEffect(action));
new PutPlayedEventOnTopOfDeckEffect(self));
else
action.insertEffect(
new PutPlayedEventOnBottomOfDeckEffect(self));

View File

@@ -32,7 +32,7 @@ public class Card7_029 extends AbstractEvent {
new ChooseAndAddUntilEOPStrengthBonusEffect(action, self, playerId, 2, Race.ELF));
action.appendEffect(
new OptionalEffect(action, playerId,
new PutPlayedEventOnTopOfDeckEffect(action)));
new PutPlayedEventOnTopOfDeckEffect(self)));
return action;
}
}

View File

@@ -45,7 +45,7 @@ public class Card8_066 extends AbstractEvent {
if (PlayConditions.hasInitiative(game, Side.SHADOW))
action.appendEffect(
new OptionalEffect(action, playerId,
new PutPlayedEventOnTopOfDeckEffect(action)));
new PutPlayedEventOnTopOfDeckEffect(self)));
}
};
spotDecision.setDefaultValue(count);

View File

@@ -1,140 +0,0 @@
{
6_9: {
cardInfo: {
imagePath: decipher/LOTR06009.jpg
javaClass: true
//parentId: 6_9
//One of: Variant, Errata, Reprint
//parentType: Variant
//parentPath: alts/promo
version: 0
collInfo: 6U9
rarity: U
setNum: "6"
cardNum: 9
style: Standard
}
title: Lend Us Your Aid
unique: false
side: Free Peoples
culture: Dwarven
twilight: 0
type: Event
keywords: Maneuver
/*requires: {
}
effects: {
type: event
cost: {
},
effect: [
{
}
]
}*/
gametext: <b>Maneuver:</b> Exert Gimli twice to make him and each Elf companion strength +3 until the regroup phase.
lore: He hewed a two-handed stroke and laid the last Orc before his feet. 'Now my count passes Master Legolas again.'
promotext: ""
alts: {
promos: {
}
errata: {
}
}
}
6_10: {
cardInfo: {
imagePath: decipher/LOTR06010.jpg
javaClass: true
//parentId: 6_10
//One of: Variant, Errata, Reprint
//parentType: Variant
//parentPath: alts/promo
version: 0
collInfo: 6C10
rarity: C
setNum: "6"
cardNum: 10
style: Standard
}
title: Suspended Palaces
unique: true
side: Free Peoples
culture: Dwarven
twilight: 2
type: Condition
keywords: Support Area
/*requires: {
}
effects: [
{
}
{
}
]*/
gametext: Plays to your support area. When you play this condition, you may spot a Dwarf to place 2 [dwarven] tokens here.<br><b>Fellowship:</b> Discard this condition or remove a [dwarven] token from here to stack the top card of your draw deck on a [dwarven] condition that has a card stacked on it.
lore: ""
promotext: ""
alts: {
promos: {
}
errata: {
}
}
}
6_11: {
cardInfo: {
imagePath: decipher/LOTR06011.jpg
javaClass: true
//parentId: 6_11
//One of: Variant, Errata, Reprint
//parentType: Variant
//parentPath: alts/promo
version: 0
collInfo: 6R11
rarity: R
setNum: "6"
cardNum: 11
style: Standard
}
title: Toss Me
unique: false
side: Free Peoples
culture: Dwarven
twilight: 1
type: Event
keywords: Fellowship
/*requires: {
}
effects: {
type: event
cost: {
},
effect: [
{
}
]
}*/
gametext: While this card is stacked on a [dwarven] condition, Gimli is strength +1.<br><b>Fellowship:</b> Place this card or another [dwarven] card from hand on top of or beneath your draw deck.
lore: Don't tell the Elf.'
promotext: ""
alts: {
promos: {
}
errata: {
}
}
}
}

View File

@@ -0,0 +1,231 @@
{
6_9: {
cardInfo: {
imagePath: decipher/LOTR06009.jpg
javaClass: true
//parentId: 6_9
//One of: Variant, Errata, Reprint
//parentType: Variant
//parentPath: alts/promo
version: 0
collInfo: 6U9
rarity: U
setNum: "6"
cardNum: 9
style: Standard
}
title: Lend Us Your Aid
unique: false
side: Free Peoples
culture: Dwarven
twilight: 0
type: Event
keywords: Maneuver
effects: {
type: event
cost: {
type: exert
filter: choose(name(Gimli))
times: 2
},
effect: [
{
type: modifyStrength
filter: choose(name(Gimli))
amount: 3
until: regroup
}
{
type: modifyStrength
filter: all(elf,companion)
amount: 3
until: regroup
}
]
}
gametext: <b>Maneuver:</b> Exert Gimli twice to make him and each Elf companion strength +3 until the regroup phase.
lore: He hewed a two-handed stroke and laid the last Orc before his feet. 'Now my count passes Master Legolas again.'
promotext: ""
alts: {
promos: {
}
errata: {
}
}
}
6_10: {
cardInfo: {
imagePath: decipher/LOTR06010.jpg
javaClass: true
//parentId: 6_10
//One of: Variant, Errata, Reprint
//parentType: Variant
//parentPath: alts/promo
version: 0
collInfo: 6C10
rarity: C
setNum: "6"
cardNum: 10
style: Standard
}
title: Suspended Palaces
unique: true
side: Free Peoples
culture: Dwarven
twilight: 2
type: Condition
keywords: Support Area
effects: [
{
type: trigger
optional: true
trigger: {
type: played
filter: self
}
requires: {
type: canSpot
filter: dwarf
}
effect: {
type: addTokens
culture: dwarven
filter: self
count: 2
}
}
{
type: activated
phase: fellowship
cost: {
type: choice
texts: [
Discard this condition
Remove a {dwarven} token from here
]
effects: [
{
type: discard
filter: self
}
{
type: removeTokens
filter: self
culture: dwarven
}
]
}
effect: {
type: stackTopCardsOfDrawDeck
where: choose(culture(dwarven),condition,hasStacked(any))
count: 1
}
}
]
gametext: Plays to your support area. When you play this condition, you may spot a Dwarf to place 2 [dwarven] tokens here.<br><b>Fellowship:</b> Discard this condition or remove a [dwarven] token from here to stack the top card of your draw deck on a [dwarven] condition that has a card stacked on it.
lore: ""
promotext: ""
alts: {
promos: {
}
errata: {
}
}
}
6_11: {
cardInfo: {
imagePath: decipher/LOTR06011.jpg
javaClass: true
//parentId: 6_11
//One of: Variant, Errata, Reprint
//parentType: Variant
//parentPath: alts/promo
version: 0
collInfo: 6R11
rarity: R
setNum: "6"
cardNum: 11
style: Standard
}
title: Toss Me
unique: false
side: Free Peoples
culture: Dwarven
twilight: 1
type: Event
keywords: Fellowship
effects: [
{
type: stackedOnModifier
modifier: {
type: modifyStrength
requires: {
type: hasCardStacked
filter: self
on: culture(dwarven),condition
}
filter: name(Gimli)
amount: 1
}
}
{
type: event
effect: [
{
type: choice
texts: [
Place this card on top of or beneath your draw deck
Place another {dwarven} card from hand on top or beneath your draw deck
]
effects: [
{
type: choice
texts: [
Place this card on top of your draw deck
Place this card beneath your draw deck
]
effects: [
{
type: putPlayedEventOnTopOfDrawDeck
}
{
type: putPlayedEventOnBottomOfDrawDeck
}
]
}
{
type: choice
texts: [
Place that card on top of your draw deck
Place that card beneath your draw deck
]
effects: [
{
type: putCardsFromHandOnTopOfDeck
filter: choose(culture(dwarven))
}
{
type: putCardsFromhandOnBottomOfDeck
filter: choose(culture(dwarven))
}
]
}
]
}
]
}
]
gametext: While this card is stacked on a [dwarven] condition, Gimli is strength +1.<br><b>Fellowship:</b> Place this card or another [dwarven] card from hand on top of or beneath your draw deck.
lore: Don't tell the Elf.'
promotext: ""
alts: {
promos: {
}
errata: {
}
}
}
}

View File

@@ -8,6 +8,7 @@ import com.gempukku.lotro.cards.build.field.effect.*;
import com.gempukku.lotro.cards.build.field.effect.modifier.Modifier;
import com.gempukku.lotro.cards.build.field.effect.modifier.ModifyOwnCost;
import com.gempukku.lotro.cards.build.field.effect.modifier.PermanentSiteModifier;
import com.gempukku.lotro.cards.build.field.effect.modifier.StackedOnModifier;
import org.json.simple.JSONObject;
import java.util.HashMap;
@@ -31,6 +32,7 @@ public class EffectFieldProcessor implements FieldProcessor {
effectProcessors.put("extrapossessionclass", new ExtraPossessionClassEffectProcessor());
effectProcessors.put("inhandtrigger", new InHandTriggerEffectProcessor());
effectProcessors.put("killedtrigger", new KilledTriggerEffectProcessor());
effectProcessors.put("stackedonmodifier", new StackedOnModifier());
effectProcessors.put("modifier", new Modifier());
effectProcessors.put("permanentsitemodifier", new PermanentSiteModifier());
effectProcessors.put("modifyowncost", new ModifyOwnCost());

View File

@@ -123,6 +123,7 @@ public class EffectAppenderFactory {
effectAppenderProducers.put("putonring", new PutOnRing());
effectAppenderProducers.put("putplayedeventintohand", new PutPlayedEventIntoHand());
effectAppenderProducers.put("putplayedeventonbottomofdrawdeck", new PutPlayedEventOnBottomOfDrawDeck());
effectAppenderProducers.put("putplayedeventontopofdrawdeck", new PutPlayedEventOnTopOfDrawDeck());
effectAppenderProducers.put("putstackedcardsintohand", new PutStackedCardsIntoHand());
effectAppenderProducers.put("reconcilehand", new ReconcileHand());
effectAppenderProducers.put("reducearcherytotal", new ReduceArcheryTotal());

View File

@@ -0,0 +1,26 @@
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.PutPlayedEventOnTopOfDeckEffect;
import com.gempukku.lotro.logic.timing.Effect;
import org.json.simple.JSONObject;
public class PutPlayedEventOnTopOfDrawDeck implements EffectAppenderProducer {
@Override
public EffectAppender createEffectAppender(JSONObject effectObject, CardGenerationEnvironment environment) throws InvalidCardDefinitionException {
FieldUtils.validateAllowedFields(effectObject);
return new DelayedAppender() {
@Override
protected Effect createEffect(boolean cost, CostToEffectAction action, ActionContext actionContext) {
return new PutPlayedEventOnTopOfDeckEffect(actionContext.getSource());
}
};
}
}

View File

@@ -0,0 +1,21 @@
package com.gempukku.lotro.cards.build.field.effect.modifier;
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.ModifierSource;
import com.gempukku.lotro.cards.build.field.EffectProcessor;
import com.gempukku.lotro.cards.build.field.FieldUtils;
import org.json.simple.JSONObject;
public class StackedOnModifier implements EffectProcessor {
@Override
public void processEffect(JSONObject value, BuiltLotroCardBlueprint blueprint, CardGenerationEnvironment environment) throws InvalidCardDefinitionException {
FieldUtils.validateAllowedFields(value, "modifier");
JSONObject jsonObject = (JSONObject) value.get("modifier");
final ModifierSource modifier = environment.getModifierSourceFactory().getModifier(jsonObject, environment);
blueprint.appendStackedOnModifier(modifier);
}
}

View File

@@ -4,21 +4,20 @@ import com.gempukku.lotro.common.Zone;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.GameUtils;
import com.gempukku.lotro.logic.actions.PlayEventAction;
import com.gempukku.lotro.logic.timing.AbstractEffect;
import java.util.Collections;
public class PutPlayedEventOnTopOfDeckEffect extends AbstractEffect {
private final PlayEventAction _action;
private final PhysicalCard card;
public PutPlayedEventOnTopOfDeckEffect(PlayEventAction action) {
_action = action;
public PutPlayedEventOnTopOfDeckEffect(PhysicalCard card) {
this.card = card;
}
@Override
public String getText(LotroGame game) {
return "Put " + GameUtils.getFullName(_action.getEventPlayed()) + " on top of your deck";
return "Put " + GameUtils.getFullName(card) + " on top of your deck";
}
@Override
@@ -28,17 +27,16 @@ public class PutPlayedEventOnTopOfDeckEffect extends AbstractEffect {
@Override
public boolean isPlayableInFull(LotroGame game) {
Zone zone = _action.getEventPlayed().getZone();
Zone zone = card.getZone();
return zone == Zone.VOID || zone == Zone.VOID_FROM_HAND;
}
@Override
protected FullEffectResult playEffectReturningResult(LotroGame game) {
if (isPlayableInFull(game)) {
PhysicalCard eventPlayed = _action.getEventPlayed();
game.getGameState().sendMessage(_action.getPerformingPlayer() + " puts " + GameUtils.getCardLink(eventPlayed) + " on top of their deck");
game.getGameState().removeCardsFromZone(eventPlayed.getOwner(), Collections.singletonList(eventPlayed));
game.getGameState().putCardOnTopOfDeck(eventPlayed);
game.getGameState().sendMessage(card.getOwner() + " puts " + GameUtils.getCardLink(card) + " on top of their deck");
game.getGameState().removeCardsFromZone(card.getOwner(), Collections.singletonList(card));
game.getGameState().putCardOnTopOfDeck(card);
return new FullEffectResult(true);
}
return new FullEffectResult(false);