Added the Rampage ability as a Keyowrd in the form: Rampage X

Added the following cards that make use of this ability:
AErathi Berserker (from Legends)
Balduvian War-Makers (from Alliances)
Chromium (from Legends)
Craw Giant (from Legends)
Frost Giant (from Legends)
Horrible Hordes (from Mirage)
Hunding Gjornersen (from Legends)
Marhault Elsdragon (from Legends)
Teeka's Dragon (from Mirage)
Wolverine Pack (from Legends)
This commit is contained in:
jendave
2011-08-06 04:22:09 +00:00
parent c731f9eb79
commit a00a1ceb0a
3 changed files with 151 additions and 0 deletions

View File

@@ -38,6 +38,16 @@ snow_covered_mountain.jpg http://www.wizards.com/global/images/magic/gene
snow_covered_mountain1.jpg http://www.wizards.com/global/images/magic/general/snow_covered_mountain.jpg
snow_covered_mountain2.jpg http://www.magickartenmarkt.de/img/cards/Ice_Age/snow_covered_mountain.jpg
snow_covered_mountain3.jpg http://www.magickartenmarkt.de/img/cards/Ice_Age/snow_covered_mountain.jpg
aerathi_berserker.jpg http://www.wizards.com/global/images/magic/general/aerathi_berserker.jpg
balduvian_war_makers.jpg http://www.wizards.com/global/images/magic/general/balduvian_war_makers.jpg
chromium.jpg http://www.wizards.com/global/images/magic/general/chromium.jpg
craw_giant.jpg http://www.wizards.com/global/images/magic/general/craw_giant.jpg
frost_giant.jpg http://www.wizards.com/global/images/magic/general/frost_giant.jpg
horrible_hordes.jpg http://www.wizards.com/global/images/magic/general/horrible_hordes.jpg
hunding_gjornersen.jpg http://www.wizards.com/global/images/magic/general/hunding_gjornersen.jpg
marhault_elsdragon.jpg http://www.wizards.com/global/images/magic/general/marhault_elsdragon.jpg
teekas_dragon.jpg http://www.wizards.com/global/images/magic/general/teekas_dragon.jpg
wolverine_pack.jpg http://www.wizards.com/global/images/magic/general/wolverine_pack.jpg
binding_grasp.jpg http://www.wizards.com/global/images/magic/general/binding_grasp.jpg
mind_harness.jpg http://www.wizards.com/global/images/magic/general/mind_harness.jpg
persuasion.jpg http://www.wizards.com/global/images/magic/general/persuasion.jpg

View File

@@ -1,3 +1,79 @@
AErathi Berserker
2 R R R
Creature Human Berserker
no text
2/4
Rampage 3
Balduvian War-Makers
4 R
Creature Human Barbarian
no text
3/3
Haste
Rampage 1
Chromium
2 W W U U B B
Legendary Creature Elder Dragon
no text
7/7
Flying
Rampage 2
At the beginning of your upkeep, sacrifice CARDNAME unless you pay:W U B
Craw Giant
3 G G G G
Creature Giant
no text
6/4
Trample
Rampage 2
Frost Giant
3 R R R
Creature Giant
no text
4/4
Rampage 2
Horrible Hordes
3
Artifact Creature Spirit
no text
2/2
Rampage 1
Hunding Gjornersen
3 U U W
Legendary Creature Human Warrior
no text
5/4
Rampage 1
Marhault Elsdragon
3 G R R
Legendary Creature Elf Warrior
no text
4/6
Rampage 1
Teeka's Dragon
9
Artifact Creature Dragon
no text
5/5
Flying
Trample
Rampage 4
Wolverine Pack
2 G G
Creature Wolverine
no text
2/4
Rampage 2
Binding Grasp
3 U
Enchantment Aura

View File

@@ -1727,6 +1727,26 @@ public class CombatUtil {
AllZone.Stack.add(ab);
}
////////////////////Rampage
//not sure why this is "not" - but I copied from Bushido...
if(!a.getCreatureGotBlockedThisCombat()) {
ArrayList<String> keywords = a.getKeyword();
Pattern p = Pattern.compile("Rampage [0-9]+");
Matcher m;
for (String keyword : keywords) {
m = p.matcher(keyword);
if (m.find()){
String k[] = keyword.split(" ");
final int magnitude = Integer.valueOf(k[1]);
final int numBlockers = AllZone.Combat.getBlockers(a).size();
if(numBlockers > 1) {
executeRampageAbility(a, magnitude, numBlockers);
}
} //find
}
}
////////////////////END Rampage
if(a.getKeyword().contains("Flanking") && !b.getKeyword().contains("Flanking")) {
int flankingMagnitude = 0;
String kw = "";
@@ -2055,4 +2075,49 @@ public class CombatUtil {
}
}
/////////////////////////Rampage
/**
* executes rampage abilities for a given card
*
* @param c the card to add rampage bonus to
* @param magnitude the magnitude of rampage (ie Rampage 2 means magnitude should be 2)
* @param numBlockers - the number of creatures blocking this rampaging creature
*/
private static void executeRampageAbility(Card c, int magnitude, int numBlockers) {
//TODO - possibly can get magnitude from Keyword on the Card here
final Card crd = c;
final int pump = magnitude;
Ability ability;
//numBlockers -1 since it is for every creature beyond the first
for(int i = 0; i < numBlockers - 1; i++) {
ability = new Ability(c, "0") {
@Override
public void resolve() {
final Command untilEOT = new Command() {
private static final long serialVersionUID = -3215615538474963181L;
public void execute() {
if(AllZone.GameAction.isCardInPlay(crd)) {
crd.addTempAttackBoost(-pump);
crd.addTempDefenseBoost(-pump);
}
}
};//Command
if(AllZone.GameAction.isCardInPlay(crd)) {
crd.addTempAttackBoost(pump);
crd.addTempDefenseBoost(pump);
AllZone.EndOfTurn.addUntil(untilEOT);
}
}//resolve
};//ability
ability.setStackDescription(c + " - (Rampage) gets +"+pump+"/+"+pump+" until EOT.");
AllZone.Stack.add(ability);
}
}
/////////////////////////END Rampage
}//Class CombatUtil