- 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}
type=Creature
subtype=Centaur Warrior
auto=lord(creature[attacking,trample]|myBattlefield) 2/2
auto=lord(creature[attacking;trample]|myBattlefield) 2/2
power=4
toughness=4
abilities=legendary,trample

View File

@@ -111,6 +111,7 @@ dingus_egg.txt
doomed_necromancer.txt
dragon_fodder.txt
dragon_fodder2.txt
dragon_whelp_i154.txt
drain_life.txt
drift_of_the_dead.txt
dromad_purebred.txt
@@ -119,6 +120,7 @@ duskwalker.txt
elvish_piper.txt
elvish_promenade.txt
emblem_of_the_warmind.txt
erg_raiders_i157.txt
flagstones.txt
farhaven_elf.txt
fastbond.txt
@@ -172,6 +174,7 @@ lhurgoyf.txt
liability.txt
lifeforce.txt
lifetap.txt
living_artifact_i169.txt
living_lands.txt
lord_of_the_pit.txt
lord_of_the_pit2.txt
@@ -243,6 +246,7 @@ stasis.txt
steelclad_serpent1.txt
steelclad_serpent2.txt
stillmoon_cavalier.txt
stonebrow_i159.txt
stronghold_discipline.txt
sword_to_plowshares.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;
}
~ASpellCastLife(){
SAFE_DELETE(cost);
}
};
//Allows to untap at any moment for an amount of mana
@@ -1212,7 +1216,7 @@ class APowerToughnessModifierUntilEndOfTurn: public ActivatedAbility{
}
void Update(float dt){
if (newPhase != currentPhase && newPhase ==Constants::MTG_PHASE_AFTER_EOT){
if (newPhase != currentPhase && newPhase == Constants::MTG_PHASE_AFTER_EOT){
counters = 0;
}
ActivatedAbility::Update(dt);
@@ -2786,16 +2790,14 @@ class ALivingArtifact:public MTGAbility{
latest = NULL;
}
void Update(float dt){
if (newPhase != currentPhase && newPhase == Constants::MTG_PHASE_UNTAP) usedThisTurn = 0;
Damage * damage = ((Damage *)game->mLayers->stackLayer()->getNext(latest,ACTION_DAMAGE,RESOLVED_OK));
while (damage){
if (damage->target == source->controller()){
counters += damage->damage;
}
latest = damage;
damage = ((Damage *)game->mLayers->stackLayer()->getNext(damage,ACTION_DAMAGE,RESOLVED_OK));
}
int receiveEvent(WEvent * event){
WEventDamage * e = dynamic_cast<WEventDamage *>(event);
if (!e) return 0;
Player * p = dynamic_cast<Player *>(e->damage->target);
if (!p) return 0;
if (p != source->controller()) return 0;
counters+=e->damage->damage;
return 1; //is this meant to return 0 or 1?
}
int isReactingtoclick(MTGCardInstance * card, ManaCost * mana = NULL){
@@ -2914,38 +2916,28 @@ class AAnimateDead:public MTGAbility{
//1159 Erg Raiders
class AErgRaiders:public MTGAbility{
public:
int init;
int dealDamage;
int attackedThisTurn;
AErgRaiders(int _id, MTGCardInstance * _source):MTGAbility(_id, _source){
init = 0;
dealDamage = 0;
attackedThisTurn = 1;
}
void Update(float dt){
if (newPhase != currentPhase){
Player * controller = source->controller();
if (newPhase == Constants::MTG_PHASE_COMBATDAMAGE && game->currentPlayer == controller){
if (!source->isAttacker() && init){
dealDamage = 1;
}
}else if (newPhase == Constants::MTG_PHASE_UNTAP && game->currentPlayer != controller){
if (dealDamage){
game->mLayers->stackLayer()->addDamage(source, controller,2);
}
init = 1;
dealDamage = 0;
if (source->isAttacker()){
attackedThisTurn = 1;
}
}else if (newPhase == Constants::MTG_PHASE_UNTAP){
if (game->currentPlayer != controller && !attackedThisTurn){
game->mLayers->stackLayer()->addDamage(source, controller,2);
}else if (game->currentPlayer == controller) {
attackedThisTurn = 0;
}
}
}
}
virtual ostream& toString(ostream& out) const
{
out << "AErgRaiders ::: init : " << init
<< " ; dealDamage : " << dealDamage
<< " (";
return MTGAbility::toString(out) << ")";
}
AErgRaiders * clone() const{
AErgRaiders * a = NEW AErgRaiders(*this);
a->isClone = 1;
@@ -3396,7 +3388,7 @@ class ADragonWhelp: public APowerToughnessModifierUntilEndOfTurn{
}
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);
}
APowerToughnessModifierUntilEndOfTurn::Update(dt);

View File

@@ -325,7 +325,13 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
TargetChooserFactory tcf;
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
if (!a){
SAFE_DELETE(lordTargets);