mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
- Implemented an experimental version of Multikicker, added Gnarlid Pack, Apex Hawks and Enclave Elite.
This commit is contained in:
@@ -1,3 +1,26 @@
|
|||||||
|
Enclave Elite
|
||||||
|
2 U
|
||||||
|
Creature Merfolk Soldier
|
||||||
|
Enclave Elite enters the battlefield with a +1/+1 counter on it for each time it was kicked.
|
||||||
|
2/2
|
||||||
|
Islandwalk
|
||||||
|
Multikicker 1 U
|
||||||
|
|
||||||
|
Apex Hawks
|
||||||
|
2 W
|
||||||
|
Creature Bird
|
||||||
|
Apex Hawks enters the battlefield with a +1/+1 counter on it for each time it was kicked.
|
||||||
|
2/2
|
||||||
|
Flying
|
||||||
|
Multikicker 1 W
|
||||||
|
|
||||||
|
Gnarlid Pack
|
||||||
|
1 G
|
||||||
|
Creature Beast
|
||||||
|
Gnarlid Pack enters the battlefield with a +1/+1 counter on it for each time it was kicked.
|
||||||
|
2/2
|
||||||
|
Multikicker 1 G
|
||||||
|
|
||||||
Absorb Vis
|
Absorb Vis
|
||||||
6 B
|
6 B
|
||||||
Sorcery
|
Sorcery
|
||||||
|
|||||||
@@ -80,6 +80,8 @@ public class Card extends MyObservable {
|
|||||||
|
|
||||||
private int X = 0;
|
private int X = 0;
|
||||||
|
|
||||||
|
private int multiKickerMagnitude = 0;
|
||||||
|
|
||||||
private String owner = "";
|
private String owner = "";
|
||||||
private String controller = "";
|
private String controller = "";
|
||||||
private String name = "";
|
private String name = "";
|
||||||
@@ -1139,6 +1141,21 @@ public class Card extends MyObservable {
|
|||||||
return upkeepDamage;
|
return upkeepDamage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void addMultiKickerMagnitude(int n)
|
||||||
|
{
|
||||||
|
multiKickerMagnitude += n;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMultiKickerMagnitude(int n)
|
||||||
|
{
|
||||||
|
multiKickerMagnitude = n;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMultiKickerMagnitude()
|
||||||
|
{
|
||||||
|
return multiKickerMagnitude;
|
||||||
|
}
|
||||||
|
|
||||||
//public int getAttack(){return attack;}
|
//public int getAttack(){return attack;}
|
||||||
|
|
||||||
//for cards like Giant Growth, etc.
|
//for cards like Giant Growth, etc.
|
||||||
|
|||||||
@@ -215,6 +215,20 @@ public class CardFactory implements NewConstants {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (hasKeyword(card, "Multikicker") != -1)
|
||||||
|
{
|
||||||
|
int n = hasKeyword(card, "Multikicker");
|
||||||
|
if (n!= -1)
|
||||||
|
{
|
||||||
|
String parse = card.getKeyword().get(n).toString();
|
||||||
|
String k[] = parse.split("kicker ");
|
||||||
|
|
||||||
|
SpellAbility sa = card.getSpellAbility()[0];
|
||||||
|
sa.setIsMultiKicker(true);
|
||||||
|
sa.setMultiKickerManaCost(k[1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* //Creatures with simple, self-targeted mana-activated keyword adding abilities
|
/* //Creatures with simple, self-targeted mana-activated keyword adding abilities
|
||||||
//-1 means not found
|
//-1 means not found
|
||||||
while(hasKeyword(card, "KPump") != -1)
|
while(hasKeyword(card, "KPump") != -1)
|
||||||
|
|||||||
@@ -1994,6 +1994,45 @@ public class CardFactoryUtil {
|
|||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String sumManaCost(String manacost1, String manacost2)
|
||||||
|
{
|
||||||
|
String tokenized1[] = manacost1.split("\\s");
|
||||||
|
String tokenized2[] = manacost2.split("\\s");
|
||||||
|
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
|
||||||
|
int totalNumberCost = 0;
|
||||||
|
if (Character.isDigit(tokenized1[0].charAt(0)) && Character.isDigit(tokenized2[0].charAt(0)))
|
||||||
|
{
|
||||||
|
int cost1 = Integer.parseInt(tokenized1[0]);
|
||||||
|
int cost2 = Integer.parseInt(tokenized2[0]);
|
||||||
|
totalNumberCost = cost1 + cost2;
|
||||||
|
}
|
||||||
|
else if (Character.isDigit(tokenized1[0].charAt(0)))
|
||||||
|
totalNumberCost = Integer.parseInt(tokenized1[0]);
|
||||||
|
else if (Character.isDigit(tokenized2[0].charAt(0)))
|
||||||
|
totalNumberCost = Integer.parseInt(tokenized2[0]);
|
||||||
|
|
||||||
|
if (totalNumberCost != 0) {
|
||||||
|
sb.append(totalNumberCost);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i=1;i<tokenized1.length;i++)
|
||||||
|
{
|
||||||
|
sb.append(" ");
|
||||||
|
sb.append(tokenized1[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i=1;i<tokenized2.length;i++)
|
||||||
|
{
|
||||||
|
sb.append(" ");
|
||||||
|
sb.append(tokenized2[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
//TODO: resort mana symbol order?
|
||||||
|
return sb.toString().trim();
|
||||||
|
}
|
||||||
|
|
||||||
public static String multiplyManaCost(String manacost, int multiplier) {
|
public static String multiplyManaCost(String manacost, int multiplier) {
|
||||||
if(multiplier == 0) return "";
|
if(multiplier == 0) return "";
|
||||||
if(multiplier == 1) return manacost;
|
if(multiplier == 1) return manacost;
|
||||||
|
|||||||
@@ -17075,7 +17075,6 @@ public class CardFactory_Creatures {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
Command commandComes = new Command() {
|
Command commandComes = new Command() {
|
||||||
private static final long serialVersionUID = -2622859088591798773L;
|
private static final long serialVersionUID = -2622859088591798773L;
|
||||||
|
|
||||||
@@ -17228,6 +17227,31 @@ public class CardFactory_Creatures {
|
|||||||
|
|
||||||
}//*************** END ************ END **************************
|
}//*************** END ************ END **************************
|
||||||
|
|
||||||
|
//*************** START *********** START **************************
|
||||||
|
else if(cardName.equals("Gnarlid Pack") || cardName.equals("Apex Hawks") || cardName.equals("Enclave Elite"))
|
||||||
|
{
|
||||||
|
final Ability ability = new Ability(card, "0") {
|
||||||
|
@Override
|
||||||
|
public void resolve() {
|
||||||
|
card.addCounter(Counters.P1P1, card.getMultiKickerMagnitude());
|
||||||
|
card.setMultiKickerMagnitude(0);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.append(cardName);
|
||||||
|
sb.append(" enters the battlefield with a +1/+1 counter on it for each time it was kicked.");
|
||||||
|
ability.setStackDescription(sb.toString());
|
||||||
|
|
||||||
|
final Command comesIntoPlay = new Command() {
|
||||||
|
private static final long serialVersionUID = 4245563898487609274L;
|
||||||
|
|
||||||
|
public void execute() {
|
||||||
|
AllZone.Stack.add(ability);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
card.addComesIntoPlayCommand(comesIntoPlay);
|
||||||
|
}//*************** END ************ END **************************
|
||||||
|
|
||||||
// Cards with Cycling abilities
|
// Cards with Cycling abilities
|
||||||
// -1 means keyword "Cycling" not found
|
// -1 means keyword "Cycling" not found
|
||||||
if(shouldCycle(card) != -1) {
|
if(shouldCycle(card) != -1) {
|
||||||
|
|||||||
@@ -11,10 +11,43 @@ public class MagicStack extends MyObservable
|
|||||||
this.updateObservers();
|
this.updateObservers();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void add(SpellAbility sp)
|
public void add(SpellAbility sp)
|
||||||
{
|
{
|
||||||
if(sp instanceof Ability_Mana || sp instanceof Ability_Triggered)//TODO make working triggered abilities!
|
if(sp instanceof Ability_Mana || sp instanceof Ability_Triggered)//TODO make working triggered abilities!
|
||||||
sp.resolve(); else push(sp);
|
sp.resolve();
|
||||||
|
else {
|
||||||
|
if (sp.isMultiKicker())
|
||||||
|
{
|
||||||
|
final SpellAbility sa = sp;
|
||||||
|
final Ability ability = new Ability(sp.getSourceCard(), sp.getMultiKickerManaCost())
|
||||||
|
{
|
||||||
|
public void resolve()
|
||||||
|
{
|
||||||
|
this.getSourceCard().addMultiKickerMagnitude(1);
|
||||||
|
//System.out.println("MultiKicker has been paid (currently multi-kicked " + this.getSourceCard().getName() + " " + this.getSourceCard().getMultiKickerMagnitude()+ " times)");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
final Command paidCommand = new Command() {
|
||||||
|
private static final long serialVersionUID = -6037161763374971106L;
|
||||||
|
public void execute() {
|
||||||
|
ability.resolve();
|
||||||
|
AllZone.InputControl.setInput(new Input_PayManaCost_Ability("Multikicker for " + sa.getSourceCard() + "\r\n",
|
||||||
|
ability.getManaCost(), this, Command.Blank));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
if(sp.getSourceCard().getController().equals(Constant.Player.Human)) {
|
||||||
|
AllZone.InputControl.setInput(new Input_PayManaCost_Ability("Multikicker for " + sp.getSourceCard() + "\r\n",
|
||||||
|
ability.getManaCost(), paidCommand, Command.Blank));
|
||||||
|
}
|
||||||
|
else //computer
|
||||||
|
{
|
||||||
|
while(ComputerUtil.canPayCost(ability)) ComputerUtil.playNoStack(ability);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
push(sp);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
public int size()
|
public int size()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ public abstract class SpellAbility {
|
|||||||
private String stackDescription = "";
|
private String stackDescription = "";
|
||||||
private String manaCost = "";
|
private String manaCost = "";
|
||||||
private String additionalManaCost = "";
|
private String additionalManaCost = "";
|
||||||
|
private String multiKickerManaCost= "";
|
||||||
|
|
||||||
private String type = "Intrinsic"; //set to Intrinsic by default
|
private String type = "Intrinsic"; //set to Intrinsic by default
|
||||||
|
|
||||||
@@ -26,6 +27,7 @@ public abstract class SpellAbility {
|
|||||||
private boolean tapAbility;
|
private boolean tapAbility;
|
||||||
private boolean buyBackAbility = false; //false by default
|
private boolean buyBackAbility = false; //false by default
|
||||||
private boolean flashBackAbility = false;
|
private boolean flashBackAbility = false;
|
||||||
|
private boolean multiKicker = false;
|
||||||
|
|
||||||
private Input beforePayMana;
|
private Input beforePayMana;
|
||||||
private Input afterResolve;
|
private Input afterResolve;
|
||||||
@@ -104,6 +106,14 @@ public abstract class SpellAbility {
|
|||||||
additionalManaCost = cost;
|
additionalManaCost = cost;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getMultiKickerManaCost() {
|
||||||
|
return multiKickerManaCost;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMultiKickerManaCost(String cost) {
|
||||||
|
multiKickerManaCost = cost;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isSpell() {
|
public boolean isSpell() {
|
||||||
return spell;
|
return spell;
|
||||||
}
|
}
|
||||||
@@ -124,6 +134,14 @@ public abstract class SpellAbility {
|
|||||||
return buyBackAbility;
|
return buyBackAbility;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setIsMultiKicker(boolean b){
|
||||||
|
multiKicker = b;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isMultiKicker() {
|
||||||
|
return multiKicker;
|
||||||
|
}
|
||||||
|
|
||||||
public void setSourceCard(Card c) {
|
public void setSourceCard(Card c) {
|
||||||
sourceCard = c;
|
sourceCard = c;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user