mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
- Added Kicker keyword that creates a Second SpellAbility for the host card. At some point we should rewrite these additional costs to get paid if they exist after the mana cost gets paid.
- Added Goblin Bushwhacker.
This commit is contained in:
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -2192,6 +2192,7 @@ res/cardsfolder/goblin_bombardment.txt -text svneol=native#text/plain
|
||||
res/cardsfolder/goblin_brigand.txt -text svneol=native#text/plain
|
||||
res/cardsfolder/goblin_bully.txt -text svneol=native#text/plain
|
||||
res/cardsfolder/goblin_burrows.txt -text svneol=native#text/plain
|
||||
res/cardsfolder/goblin_bushwhacker.txt -text svneol=native#text/plain
|
||||
res/cardsfolder/goblin_cavaliers.txt -text svneol=native#text/plain
|
||||
res/cardsfolder/goblin_charbelcher.txt -text svneol=native#text/plain
|
||||
res/cardsfolder/goblin_chariot.txt -text svneol=native#text/plain
|
||||
|
||||
11
res/cardsfolder/goblin_bushwhacker.txt
Normal file
11
res/cardsfolder/goblin_bushwhacker.txt
Normal file
@@ -0,0 +1,11 @@
|
||||
Name:Goblin Bushwhacker
|
||||
ManaCost:R
|
||||
Types:Creature Goblin Warrior
|
||||
Text:no text
|
||||
PT:1/1
|
||||
K:Kicker:R
|
||||
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self+kicked | Execute$ TrigPumpAll | TriggerDescription$ When Goblin Bushwhacker enters the battlefield, if it was kicked, creatures you control get +1/+0 and gain haste until end of turn.
|
||||
SVar:TrigPumpAll:AB$PumpAll | Cost$ 0 | ValidCards$ Creature.YouCtrl | NumAtt$ 1 | KW$ Haste
|
||||
SVar:Rarity:Common
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/goblin_bushwhacker.jpg
|
||||
End
|
||||
@@ -7925,6 +7925,51 @@ public class CardFactory implements NewConstants {
|
||||
// Cards with Cycling abilities
|
||||
// -1 means keyword "Cycling" not found
|
||||
|
||||
// todo: certain cards have two different kicker types, kicker will need to be written differently to handle this
|
||||
// todo: kicker costs can only be mana right now i think?
|
||||
int kicker = hasKeyword(card, "Kicker");
|
||||
if (kicker != -1){
|
||||
final SpellAbility kickedSpell = new Spell(card) {
|
||||
private static final long serialVersionUID = -1598664196463358630L;
|
||||
|
||||
@Override
|
||||
public void resolve() {
|
||||
card.setKicked(true);
|
||||
AllZone.GameAction.moveToPlay(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlay() {
|
||||
return super.canPlay() && Phase.canCastSorcery(card.getController());
|
||||
}
|
||||
|
||||
};
|
||||
String parse = card.getKeyword().get(kicker).toString();
|
||||
card.removeIntrinsicKeyword(parse);
|
||||
|
||||
String k[] = parse.split(":");
|
||||
final String kickerCost = k[1];
|
||||
|
||||
ManaCost mc = new ManaCost(card.getManaCost());
|
||||
mc.combineManaCost(kickerCost);
|
||||
|
||||
kickedSpell.setKickerAbility(true);
|
||||
kickedSpell.setManaCost(mc.toString());
|
||||
kickedSpell.setAdditionalManaCost(kickerCost);
|
||||
|
||||
StringBuilder desc = new StringBuilder();
|
||||
desc.append("Kicker ").append(kickerCost).append(" (You may pay an additional ");
|
||||
desc.append(kickerCost).append(" as you cast this spell.)");
|
||||
|
||||
kickedSpell.setDescription(desc.toString());
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(card.getName()).append(" (Kicked)");
|
||||
kickedSpell.setStackDescription(sb.toString());
|
||||
|
||||
card.addSpellAbility(kickedSpell);
|
||||
}
|
||||
|
||||
if(hasKeyword(card, "Cycling") != -1) {
|
||||
int n = hasKeyword(card, "Cycling");
|
||||
if(n != -1) {
|
||||
|
||||
@@ -162,6 +162,35 @@ public class ManaCost {
|
||||
return true;
|
||||
}
|
||||
|
||||
public void combineManaCost(String extra){
|
||||
ArrayList<Object> extraParts = split(extra);
|
||||
|
||||
Mana_PartColorless part = null;
|
||||
for(int i = 0; i < manaPart.size(); i++){
|
||||
Object o = manaPart.get(i);
|
||||
if (o instanceof Mana_PartColorless)
|
||||
part = (Mana_PartColorless)o;
|
||||
}
|
||||
if (part != null){
|
||||
manaPart.remove(part);
|
||||
}
|
||||
|
||||
while(extraParts.size() > 0){
|
||||
Object o = extraParts.get(0);
|
||||
if (o instanceof Mana_PartColorless){
|
||||
if (part == null)
|
||||
part = (Mana_PartColorless)o;
|
||||
else{
|
||||
part.addToManaNeeded(((Mana_PartColorless)o).getManaNeeded());
|
||||
}
|
||||
}
|
||||
else{
|
||||
manaPart.add(o);
|
||||
}
|
||||
extraParts.remove(o);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
@@ -5,6 +5,7 @@ import forge.error.ErrorViewer;
|
||||
public class Mana_PartColorless extends Mana_Part {
|
||||
private int manaNeeded;
|
||||
public void addToManaNeeded(int additional) { manaNeeded += additional; }
|
||||
public int getManaNeeded() { return manaNeeded; }
|
||||
|
||||
//String manaCostToPay is like "1", "4", but NO COLOR
|
||||
public Mana_PartColorless(String manaCostToPay) {
|
||||
|
||||
Reference in New Issue
Block a user