- fix issue 154 (dragon whelp)
- Fix issue 157 (erg raiders)
- fix issue 169 (living artifact)
- fix issue 159 (stonebrow) although I believe this card doesn't work correctly...
This commit is contained in:
wagic.the.homebrew@gmail.com
2009-11-12 13:57:22 +00:00
parent e059890446
commit ce0051e545
9 changed files with 61 additions and 102 deletions

View File

@@ -683,7 +683,7 @@ rarity=R
mana={3}{R}{G} mana={3}{R}{G}
type=Creature type=Creature
subtype=Centaur Warrior subtype=Centaur Warrior
auto=lord(creature[attacking,trample]|myBattlefield) 2/2 auto=lord(creature[attacking;trample]|myBattlefield) 2/2
power=4 power=4
toughness=4 toughness=4
abilities=legendary,trample abilities=legendary,trample

View File

@@ -111,6 +111,7 @@ dingus_egg.txt
doomed_necromancer.txt doomed_necromancer.txt
dragon_fodder.txt dragon_fodder.txt
dragon_fodder2.txt dragon_fodder2.txt
dragon_whelp_i154.txt
drain_life.txt drain_life.txt
drift_of_the_dead.txt drift_of_the_dead.txt
dromad_purebred.txt dromad_purebred.txt
@@ -119,6 +120,7 @@ duskwalker.txt
elvish_piper.txt elvish_piper.txt
elvish_promenade.txt elvish_promenade.txt
emblem_of_the_warmind.txt emblem_of_the_warmind.txt
erg_raiders_i157.txt
flagstones.txt flagstones.txt
farhaven_elf.txt farhaven_elf.txt
fastbond.txt fastbond.txt
@@ -172,6 +174,7 @@ lhurgoyf.txt
liability.txt liability.txt
lifeforce.txt lifeforce.txt
lifetap.txt lifetap.txt
living_artifact_i169.txt
living_lands.txt living_lands.txt
lord_of_the_pit.txt lord_of_the_pit.txt
lord_of_the_pit2.txt lord_of_the_pit2.txt
@@ -243,6 +246,7 @@ stasis.txt
steelclad_serpent1.txt steelclad_serpent1.txt
steelclad_serpent2.txt steelclad_serpent2.txt
stillmoon_cavalier.txt stillmoon_cavalier.txt
stonebrow_i159.txt
stronghold_discipline.txt stronghold_discipline.txt
sword_to_plowshares.txt sword_to_plowshares.txt
symbiotic_wurm.txt symbiotic_wurm.txt

View File

@@ -1,67 +0,0 @@
#NAME: Living Artifact
#DESC: I checked an old bug list entry claiming that
#DESC: Living Artifact "gives you one life whenever
#DESC: a card is tapped". I couldn't reproduce that.
#DESC: However, I couldn't produce *any* effect from
#DESC: Living Artifact either.
#DESC: The script first tests for the condition of
#DESC: the bug report mentioned above, then tries to
#DESC: activate Living Artifact when it should be
#DESC: possible. The Assert part may need tweaking
#DESC: since I have no way of knowing how Living
#DESC: Artifact is assumed to be activated correctly.
#DESC: See http://code.google.com/p/wagic/issues/detail?id=169
[INIT]
firstmain
[PLAYER1]
inplay:Forest,Sol Ring,Craw Wurm
hand:Living Artifact
library:Plains
manapool:{G}
[PLAYER2]
inplay:Grizzly Bears
library:Swamp,Mountain
[DO]
Living Artifact
Sol Ring
next
next
# Try a couple of things that should NOT put
# counters on Living Artifact
Forest
Sol Ring
Craw Wurm
eot
# 2nd player does nothing:
eot
# 1st player tries to use Living Artifact. This should
# have NO effect at this stage.
next
Living Artifact
eot
# 2nd player attacks:
next
next
next
next
next
Grizzly Bears
eot
# 1st player tries to use Living Artifact. This should
# work now since he has sustained damage
next
Living Artifact
[ASSERT]
upkeep
[PLAYER1]
inplay:Forest,Sol Ring,Craw Wurm,Living Artifact
hand:Plains
library:
life:19
manapool:
[PLAYER2]
inplay:Grizzly Bears
hand:Swamp,Mountain
library:
life:14
[END]

View File

@@ -0,0 +1,24 @@
#NAME: Living Artifact
#DESC: See http://code.google.com/p/wagic/issues/detail?id=169
[INIT]
firstmain
[PLAYER1]
inplay:Sol Ring
hand:Living Artifact,shock
manapool:{G}{R}
[PLAYER2]
[DO]
Living Artifact
Sol Ring
shock
p1
Living Artifact
Living Artifact
[ASSERT]
firstmain
[PLAYER1]
inplay:Sol Ring,Living Artifact
life:19
graveyard:shock
[PLAYER2]
[END]

View File

@@ -990,6 +990,10 @@ class ASpellCastLife:public MTGAbility{
return a; return a;
} }
~ASpellCastLife(){
SAFE_DELETE(cost);
}
}; };
//Allows to untap at any moment for an amount of mana //Allows to untap at any moment for an amount of mana
@@ -1212,7 +1216,7 @@ class APowerToughnessModifierUntilEndOfTurn: public ActivatedAbility{
} }
void Update(float dt){ void Update(float dt){
if (newPhase != currentPhase && newPhase ==Constants::MTG_PHASE_AFTER_EOT){ if (newPhase != currentPhase && newPhase == Constants::MTG_PHASE_AFTER_EOT){
counters = 0; counters = 0;
} }
ActivatedAbility::Update(dt); ActivatedAbility::Update(dt);
@@ -2786,16 +2790,14 @@ class ALivingArtifact:public MTGAbility{
latest = NULL; latest = NULL;
} }
void Update(float dt){ int receiveEvent(WEvent * event){
if (newPhase != currentPhase && newPhase == Constants::MTG_PHASE_UNTAP) usedThisTurn = 0; WEventDamage * e = dynamic_cast<WEventDamage *>(event);
Damage * damage = ((Damage *)game->mLayers->stackLayer()->getNext(latest,ACTION_DAMAGE,RESOLVED_OK)); if (!e) return 0;
while (damage){ Player * p = dynamic_cast<Player *>(e->damage->target);
if (damage->target == source->controller()){ if (!p) return 0;
counters += damage->damage; if (p != source->controller()) return 0;
} counters+=e->damage->damage;
latest = damage; return 1; //is this meant to return 0 or 1?
damage = ((Damage *)game->mLayers->stackLayer()->getNext(damage,ACTION_DAMAGE,RESOLVED_OK));
}
} }
int isReactingtoclick(MTGCardInstance * card, ManaCost * mana = NULL){ int isReactingtoclick(MTGCardInstance * card, ManaCost * mana = NULL){
@@ -2914,38 +2916,28 @@ class AAnimateDead:public MTGAbility{
//1159 Erg Raiders //1159 Erg Raiders
class AErgRaiders:public MTGAbility{ class AErgRaiders:public MTGAbility{
public: public:
int init; int attackedThisTurn;
int dealDamage;
AErgRaiders(int _id, MTGCardInstance * _source):MTGAbility(_id, _source){ AErgRaiders(int _id, MTGCardInstance * _source):MTGAbility(_id, _source){
init = 0; attackedThisTurn = 1;
dealDamage = 0;
} }
void Update(float dt){ void Update(float dt){
if (newPhase != currentPhase){ if (newPhase != currentPhase){
Player * controller = source->controller(); Player * controller = source->controller();
if (newPhase == Constants::MTG_PHASE_COMBATDAMAGE && game->currentPlayer == controller){ if (newPhase == Constants::MTG_PHASE_COMBATDAMAGE && game->currentPlayer == controller){
if (!source->isAttacker() && init){ if (source->isAttacker()){
dealDamage = 1; attackedThisTurn = 1;
} }
}else if (newPhase == Constants::MTG_PHASE_UNTAP && game->currentPlayer != controller){ }else if (newPhase == Constants::MTG_PHASE_UNTAP){
if (dealDamage){ if (game->currentPlayer != controller && !attackedThisTurn){
game->mLayers->stackLayer()->addDamage(source, controller,2); game->mLayers->stackLayer()->addDamage(source, controller,2);
} }else if (game->currentPlayer == controller) {
init = 1; attackedThisTurn = 0;
dealDamage = 0; }
} }
} }
} }
virtual ostream& toString(ostream& out) const
{
out << "AErgRaiders ::: init : " << init
<< " ; dealDamage : " << dealDamage
<< " (";
return MTGAbility::toString(out) << ")";
}
AErgRaiders * clone() const{ AErgRaiders * clone() const{
AErgRaiders * a = NEW AErgRaiders(*this); AErgRaiders * a = NEW AErgRaiders(*this);
a->isClone = 1; a->isClone = 1;
@@ -3396,7 +3388,7 @@ class ADragonWhelp: public APowerToughnessModifierUntilEndOfTurn{
} }
void Update(float dt){ void Update(float dt){
if (newPhase != currentPhase && newPhase == Constants::MTG_PHASE_UNTAP && counters > 3){ if (newPhase != currentPhase && newPhase == Constants::MTG_PHASE_AFTER_EOT && counters > 3){
source->controller()->game->putInGraveyard(source); source->controller()->game->putInGraveyard(source);
} }
APowerToughnessModifierUntilEndOfTurn::Update(dt); APowerToughnessModifierUntilEndOfTurn::Update(dt);

View File

@@ -325,7 +325,13 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
TargetChooserFactory tcf; TargetChooserFactory tcf;
TargetChooser * lordTargets = tcf.createTargetChooser(lordTargetsString, card); TargetChooser * lordTargets = tcf.createTargetChooser(lordTargetsString, card);
if (!lordTargets){
OutputDebugString("MTGABILITY: Parsing Error:");
OutputDebugString(s.c_str());
OutputDebugString("\n");
return NULL;
}
MTGAbility * a = parseMagicLine(s1,id,spell, card,0,activated); //activated lords usually force an end of turn ability MTGAbility * a = parseMagicLine(s1,id,spell, card,0,activated); //activated lords usually force an end of turn ability
if (!a){ if (!a){
SAFE_DELETE(lordTargets); SAFE_DELETE(lordTargets);