- ORI: Added 2 Renown cards

This commit is contained in:
swordshine
2015-06-23 10:44:04 +00:00
parent 431554e8b5
commit f4bf0e4fc7
9 changed files with 115 additions and 3 deletions

1
.gitattributes vendored
View File

@@ -658,6 +658,7 @@ forge-game/src/main/java/forge/game/trigger/TriggerAttackerUnblocked.java svneol
forge-game/src/main/java/forge/game/trigger/TriggerAttackersDeclared.java svneol=native#text/plain
forge-game/src/main/java/forge/game/trigger/TriggerAttacks.java svneol=native#text/plain
forge-game/src/main/java/forge/game/trigger/TriggerBecomeMonstrous.java -text
forge-game/src/main/java/forge/game/trigger/TriggerBecomeRenowned.java -text
forge-game/src/main/java/forge/game/trigger/TriggerBecomesTarget.java svneol=native#text/plain
forge-game/src/main/java/forge/game/trigger/TriggerBlockersDeclared.java -text
forge-game/src/main/java/forge/game/trigger/TriggerBlocks.java svneol=native#text/plain

View File

@@ -235,7 +235,9 @@ public class GameCopier {
newCard.setMonstrous(true);
newCard.setMonstrosityNum(c.getMonstrosityNum());
}
if (c.isRenowned()) {
newCard.setRenowned(true);
}
if (c.isPlaneswalker()) {
for (SpellAbility sa : c.getAllSpellAbilities()) {
SpellAbilityRestriction restrict = sa.getRestrictions();

View File

@@ -141,6 +141,12 @@ public class CountersPutEffect extends SpellAbilityEffect {
runParams.put("Card", tgtCard);
tgtCard.getController().getGame().getTriggerHandler().runTrigger(TriggerType.BecomeMonstrous, runParams, false);
}
if (sa.hasParam("Renown")) {
tgtCard.setRenowned(true);
final HashMap<String, Object> runParams = new HashMap<String, Object>();
runParams.put("Card", tgtCard);
tgtCard.getController().getGame().getTriggerHandler().runTrigger(TriggerType.BecomeRenowned, runParams, false);
}
} else {
// adding counters to something like re-suspend cards
// etbcounter should apply multiplier

View File

@@ -195,6 +195,8 @@ public class Card extends GameEntity implements Comparable<Card> {
private boolean monstrous = false;
private int monstrosityNum = 0;
private boolean renowned = false;
private boolean manifested = false;
@@ -1651,6 +1653,9 @@ public class Card extends GameEntity implements Comparable<Card> {
if (monstrous) {
sb.append("Monstrous\r\n");
}
if (renowned) {
sb.append("Renowned\r\n");
}
if (manifested) {
sb.append("Manifested\r\n");
}
@@ -5082,6 +5087,14 @@ public class Card extends GameEntity implements Comparable<Card> {
if (isMonstrous()) {
return false;
}
} else if (property.equals("IsRenowned")) {
if (!isRenowned()) {
return false;
}
} else if (property.equals("IsNotRenowned")) {
if (isRenowned()) {
return false;
}
} else if (property.startsWith("non")) {
// ... Other Card types
if (getType().hasStringType(property.substring(3))) {
@@ -5903,6 +5916,13 @@ public class Card extends GameEntity implements Comparable<Card> {
monstrosityNum = num;
}
public final boolean isRenowned() {
return renowned;
}
public final void setRenowned(final boolean renowned0) {
renowned = renowned0;
}
public final boolean isManifested() {
return manifested;
}

View File

@@ -2343,6 +2343,20 @@ public class CardFactoryUtil {
final Trigger parsedUpkeepTrig = TriggerHandler.parseTrigger(upkeepTrig, card, true);
card.addTrigger(parsedUpkeepTrig);
}
else if (keyword.startsWith("Renown")) {
final String[] k = keyword.split(" ");
final String suffix = !k[1].equals("1") ? "s" : "";
card.removeIntrinsicKeyword(keyword);
String renownTrig = "Mode$ DamageDone | ValidSource$ Card.Self | ValidTarget$ Player"
+ " | IsPresent$ Card.Self+IsNotRenowned | CombatDamage$ True | Execute$"
+ " TrigBecomeRenown | TriggerDescription$ Renown " + k[1] +" (When this "
+ "creature deals combat damage to a player, if it isn't renowned, put "
+ k[1] + " +1/+1 counter" + suffix + " on it and it becomes renowned.) ";
card.setSVar("TrigBecomeRenown", "AB$ PutCounter | Cost$ 0 | Defined$ Self | "
+ "CounterType$ P1P1 | CounterNum$ " + k[1] + " | Renown$ True");
final Trigger parseRenownTrig = TriggerHandler.parseTrigger(renownTrig, card, true);
card.addTrigger(parseRenownTrig);
}
else if (keyword.startsWith("Vanishing")) {
final String[] k = keyword.split(":");
// etbcounter

View File

@@ -60,7 +60,7 @@ public final class CardUtil {
"Transmute", "Replicate", "Recover", "Suspend", "Aura swap",
"Fortify", "Transfigure", "Champion", "Evoke", "Prowl",
"Reinforce", "Unearth", "Level up", "Miracle", "Overload",
"Scavenge", "Bestow", "Outlast", "Dash").build();
"Scavenge", "Bestow", "Outlast", "Dash", "Renown").build();
/** List of keyword endings of keywords that could be modified by text changes. */
public static final ImmutableList<String> modifiableKeywordEndings = ImmutableList.<String>builder().add(
"walk", "cycling", "offering").build();

View File

@@ -0,0 +1,67 @@
/*
* Forge: Play Magic: the Gathering.
* Copyright (C) 2011 Forge Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package forge.game.trigger;
import forge.game.card.Card;
import forge.game.spellability.SpellAbility;
/**
* <p>
* Trigger_BecomeRenowned class.
* </p>
*
* @author Forge
* @version $Id: TriggerBecomeRenowned.java 21543 2013-05-19 21:35:20Z Max mtg $
*/
public class TriggerBecomeRenowned extends Trigger {
/**
* <p>
* Constructor for Trigger_BecomeRenowned.
* </p>
*
* @param params
* a {@link java.util.HashMap} object.
* @param host
* a {@link forge.game.card.Card} object.
* @param intrinsic
* the intrinsic
*/
public TriggerBecomeRenowned(final java.util.Map<String, String> params, final Card host, final boolean intrinsic) {
super(params, host, intrinsic);
}
/** {@inheritDoc} */
@Override
public final boolean performTest(final java.util.Map<String, Object> runParams2) {
if (this.mapParams.containsKey("ValidCard")) {
if (!matchesValid(runParams2.get("Card"), this.mapParams.get("ValidCard").split(","),
this.getHostCard())) {
return false;
}
}
return true;
}
/** {@inheritDoc} */
@Override
public final void setTriggeringObjects(final SpellAbility sa) {
sa.setTriggeringObject("Card", this.getRunParams().get("Card"));
}
}

View File

@@ -21,6 +21,7 @@ public enum TriggerType {
AttackerUnblocked(TriggerAttackerUnblocked.class),
Attacks(TriggerAttacks.class),
BecomeMonstrous(TriggerBecomeMonstrous.class),
BecomeRenowned(TriggerBecomeRenowned.class),
BecomesTarget(TriggerBecomesTarget.class),
BlockersDeclared(TriggerBlockersDeclared.class),
Blocks(TriggerBlocks.class),

View File

@@ -451,7 +451,8 @@ public final class CardScriptParser {
"IsImprinted", "IsNotImprinted", "hasActivatedAbilityWithTapCost",
"hasActivatedAbility", "hasManaAbility",
"hasNonManaActivatedAbility", "NoAbilities", "HasCounters",
"wasNotCast", "ChosenType", "IsNotChosenType", "IsCommander");
"wasNotCast", "ChosenType", "IsNotChosenType", "IsCommander",
"IsRenowned", "IsNotRenowned");
private static final Set<String> VALID_EXCLUSIVE_STARTSWITH = ImmutableSortedSet
.of("named", "notnamed", "OwnedBy", "ControlledBy",
"ControllerControls", "AttachedTo", "EnchantedBy",