mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
- Add Arcanis the Omnipotent Avatar
- Count$Random can now randomize with SVars for min/max values
This commit is contained in:
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -416,6 +416,7 @@ res/cardsfolder/a/arcane_sanctum.txt svneol=native#text/plain
|
||||
res/cardsfolder/a/arcane_spyglass.txt svneol=native#text/plain
|
||||
res/cardsfolder/a/arcane_teachings.txt svneol=native#text/plain
|
||||
res/cardsfolder/a/arcanis_the_omnipotent.txt svneol=native#text/plain
|
||||
res/cardsfolder/a/arcanis_the_omnipotent_avatar.txt -text
|
||||
res/cardsfolder/a/arcbound_bruiser.txt svneol=native#text/plain
|
||||
res/cardsfolder/a/arcbound_crusher.txt svneol=native#text/plain
|
||||
res/cardsfolder/a/arcbound_fiend.txt -text
|
||||
|
||||
9
res/cardsfolder/a/arcanis_the_omnipotent_avatar.txt
Normal file
9
res/cardsfolder/a/arcanis_the_omnipotent_avatar.txt
Normal file
@@ -0,0 +1,9 @@
|
||||
Name:Arcanis, the Omnipotent Avatar
|
||||
ManaCost:no cost
|
||||
Types:Vanguard
|
||||
HandLifeModifier:+1/-3
|
||||
A:AB$ Draw | ActivationZone$ Command | Announce$ X | Cost$ XCantBe0 X Return<1/Creature.cmcEQX/creature you control with converted mana cost X> | NumCards$ Y | References$ X,Y | SpellDescription$ Draw a number of cards chosen at random between 0 and X. X can't be 0. | StackDescription$ SpellDescription
|
||||
SVar:X:Count$xPaid
|
||||
SVar:Y:Count$Random.0.X
|
||||
SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard-mtgo-2/arcanis-the-omnipotent.jpg
|
||||
Oracle:Hand +1, life -3\n{X}, Return a creature you control with converted mana cost X to its owner's hand: Draw a number of cards chosen at random between 0 and X. X can't be 0.
|
||||
@@ -23,6 +23,8 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
||||
import com.google.common.base.Predicate;
|
||||
import com.google.common.collect.Iterables;
|
||||
import com.google.common.collect.Lists;
|
||||
@@ -2178,8 +2180,21 @@ public class CardFactoryUtil {
|
||||
|
||||
//Count$Random.<Min>.<Max>
|
||||
if (sq[0].equals("Random")) {
|
||||
int min = Integer.parseInt(sq[1]);
|
||||
int max = Integer.parseInt(sq[2]);
|
||||
int min = 0;
|
||||
int max = 0;
|
||||
|
||||
if (StringUtils.isNumeric(sq[1])) {
|
||||
min = Integer.parseInt(sq[1]);
|
||||
} else {
|
||||
min = CardFactoryUtil.xCount(c, c.getSVar(sq[1]));
|
||||
}
|
||||
|
||||
if (StringUtils.isNumeric(sq[2])) {
|
||||
max = Integer.parseInt(sq[2]);
|
||||
} else {
|
||||
max = CardFactoryUtil.xCount(c, c.getSVar(sq[2]));
|
||||
}
|
||||
|
||||
return forge.util.MyRandom.getRandom().nextInt(max) + min;
|
||||
}
|
||||
|
||||
|
||||
@@ -99,11 +99,13 @@ public class CostReturn extends CostPartWithList {
|
||||
@Override
|
||||
public final boolean canPay(final SpellAbility ability, final Card source, final Player activator, final Cost cost, final GameState game) {
|
||||
if (!this.isTargetingThis()) {
|
||||
boolean needsAnnoucement = ability.hasParam("Announce") && this.getType().contains(ability.getParam("Announce"));
|
||||
|
||||
List<Card> typeList = new ArrayList<Card>(activator.getCardsIn(ZoneType.Battlefield));
|
||||
typeList = CardLists.getValidCards(typeList, this.getType().split(";"), activator, source);
|
||||
|
||||
final Integer amount = this.convertAmount();
|
||||
if ((amount != null) && (typeList.size() < amount)) {
|
||||
if (!needsAnnoucement && amount != null && typeList.size() < amount) {
|
||||
return false;
|
||||
}
|
||||
} else if (!source.isInPlay()) {
|
||||
|
||||
@@ -1774,6 +1774,8 @@ public abstract class SpellAbility implements ISpellAbility {
|
||||
String value = this.getActivatingPlayer().getController().announceRequirements(this, aVar);
|
||||
if (value == null || !StringUtils.isNumeric(value)) {
|
||||
return false;
|
||||
} else if (this.getPayCosts().getCostMana().isxCantBe0() && Integer.parseInt(value) == 0) {
|
||||
return false;
|
||||
}
|
||||
this.setSVar(aVar, "Number$" + value);
|
||||
this.getSourceCard().setSVar(aVar, "Number$" + value);
|
||||
|
||||
@@ -125,6 +125,7 @@ public class SpellAbilityRequirements {
|
||||
if (!this.ability.announceRequirements()) {
|
||||
this.select.setCancel(true);
|
||||
this.finishedTargeting();
|
||||
return;
|
||||
}
|
||||
|
||||
// Skip to paying if parent ability doesn't target and has no
|
||||
|
||||
Reference in New Issue
Block a user