Erwan
- Added a few cards - Creature attacks, blocks, is re-ordered in blocking list events
This commit is contained in:
@@ -597,6 +597,15 @@ subtype=Human Shaman
|
|||||||
toughness=2
|
toughness=2
|
||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
|
text={2}: Remove target creature card in a graveyard from the game. Put a 1/1 green Saproling creature token into play.
|
||||||
|
auto={2}:moveTo(exile) target(creature|graveyard) && token(Saproling,creature saproling, 1/1,green)
|
||||||
|
id=175023
|
||||||
|
name=Necrogenesis
|
||||||
|
rarity=U
|
||||||
|
type=Enchantment
|
||||||
|
mana={B}{G}
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
text={T}: Add {G}, {W}, or {U} to your mana pool.
|
text={T}: Add {G}, {W}, or {U} to your mana pool.
|
||||||
auto={T}:Add{G}
|
auto={T}:Add{G}
|
||||||
auto={T}:Add{W}
|
auto={T}:Add{W}
|
||||||
|
|||||||
@@ -865,14 +865,7 @@ name=Naya Panorama
|
|||||||
rarity=C
|
rarity=C
|
||||||
type=Land
|
type=Land
|
||||||
[/card]
|
[/card]
|
||||||
[card]
|
|
||||||
text={2}: Remove target creature card in a graveyard from the game. Put a 1/1 green Saproling creature token into play.
|
|
||||||
id=175023
|
|
||||||
name=Necrogenesis
|
|
||||||
rarity=U
|
|
||||||
type=Enchantment
|
|
||||||
mana={B}{G}
|
|
||||||
[/card]
|
|
||||||
[card]
|
[card]
|
||||||
text=When Oblivion Ring comes into play, remove another target nonland permanent from the game. When Oblivion Ring leaves play, return the removed card to play under its owner's control.
|
text=When Oblivion Ring comes into play, remove another target nonland permanent from the game. When Oblivion Ring leaves play, return the removed card to play under its owner's control.
|
||||||
id=174909
|
id=174909
|
||||||
|
|||||||
@@ -42,6 +42,18 @@ type=Instant
|
|||||||
mana={1}{WB}
|
mana={1}{WB}
|
||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
|
text={BG}{BG}: Remove target card in a graveyard from the game. You gain 1 life.
|
||||||
|
auto={BG}{BG}:moveTo(exile) target(*|graveyard) && life:1
|
||||||
|
id=157206
|
||||||
|
name=Creakwood Ghoul
|
||||||
|
rarity=U
|
||||||
|
type=Creature
|
||||||
|
mana={4}{B}
|
||||||
|
power=3
|
||||||
|
subtype=Plant Zombie
|
||||||
|
toughness=3
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
text=Target creature gains double strike until end of turn. (It deals both first-strike and regular combat damage.)
|
text=Target creature gains double strike until end of turn. (It deals both first-strike and regular combat damage.)
|
||||||
target=creature
|
target=creature
|
||||||
auto=double strike
|
auto=double strike
|
||||||
|
|||||||
@@ -21,6 +21,18 @@ mana={2}{W}
|
|||||||
subtype=Aura
|
subtype=Aura
|
||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
|
text={2}{B}: Regenerate target Treefolk.
|
||||||
|
auto={2}{B}:regenerate target(treefolk)
|
||||||
|
id=139454
|
||||||
|
name=Black Poplar Shaman
|
||||||
|
rarity=C
|
||||||
|
type=Creature
|
||||||
|
mana={2}{B}
|
||||||
|
power=1
|
||||||
|
subtype=Treefolk Shaman
|
||||||
|
toughness=3
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
text=Blind-Spot Giant can't attack or block unless you control another Giant.
|
text=Blind-Spot Giant can't attack or block unless you control another Giant.
|
||||||
id=146597
|
id=146597
|
||||||
name=Blind-Spot Giant
|
name=Blind-Spot Giant
|
||||||
|
|||||||
@@ -137,17 +137,7 @@ power=5
|
|||||||
subtype=Elemental
|
subtype=Elemental
|
||||||
toughness=5
|
toughness=5
|
||||||
[/card]
|
[/card]
|
||||||
[card]
|
|
||||||
text={2}{B}: Regenerate target Treefolk.
|
|
||||||
id=139454
|
|
||||||
name=Black Poplar Shaman
|
|
||||||
rarity=C
|
|
||||||
type=Creature
|
|
||||||
mana={2}{B}
|
|
||||||
power=1
|
|
||||||
subtype=Treefolk Shaman
|
|
||||||
toughness=3
|
|
||||||
[/card]
|
|
||||||
[card]
|
[card]
|
||||||
text=Changeling (This card is every creature type at all times.) Up to two target creatures each get +2/+0 and gain all creature types until end of turn.
|
text=Changeling (This card is every creature type at all times.) Up to two target creatures each get +2/+0 and gain all creature types until end of turn.
|
||||||
id=139480
|
id=139480
|
||||||
|
|||||||
@@ -91,6 +91,15 @@ mana={1}{B}
|
|||||||
type=Instant
|
type=Instant
|
||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
|
text=Target opponent reveals his or her hand. You draw a card for each Mountain and red card in it.
|
||||||
|
auto=foreach(*[land,red]|opponenthand) draw:1
|
||||||
|
id=4249
|
||||||
|
name=Baleful Stare
|
||||||
|
rarity=U
|
||||||
|
type=Sorcery
|
||||||
|
mana={2}{U}
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
text=Bee Sting deals 2 damage to target creature or player.
|
text=Bee Sting deals 2 damage to target creature or player.
|
||||||
id=4289
|
id=4289
|
||||||
target=creature,player
|
target=creature,player
|
||||||
@@ -101,6 +110,24 @@ mana={3}{G}
|
|||||||
type=Sorcery
|
type=Sorcery
|
||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
|
text=You gain 3 life for each creature attacking you.
|
||||||
|
auto=foreach(creature[attacking]|opponentinplay) life:3
|
||||||
|
id=4375
|
||||||
|
name=Blessed Reversal
|
||||||
|
rarity=R
|
||||||
|
type=Instant
|
||||||
|
mana={1}{W}
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
text=Tap all nonwhite creatures.
|
||||||
|
auto=tap all(creature[-white])
|
||||||
|
id=4376
|
||||||
|
name=Blinding Light
|
||||||
|
rarity=R
|
||||||
|
type=Sorcery
|
||||||
|
mana={2}{W}
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
text=Flying
|
text=Flying
|
||||||
id=4209
|
id=4209
|
||||||
name=Bog Imp
|
name=Bog Imp
|
||||||
@@ -282,6 +309,19 @@ subtype=Human Knight
|
|||||||
toughness=2
|
toughness=2
|
||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
|
text=Deep-Sea Serpent can't attack unless defending player controls an Island.
|
||||||
|
abilities=cantattack
|
||||||
|
auto=aslongas(island|opponentinplay) -cantattack
|
||||||
|
id=4258
|
||||||
|
name=Deep-Sea Serpent
|
||||||
|
rarity=U
|
||||||
|
type=Creature
|
||||||
|
mana={4}{U}{U}
|
||||||
|
power=5
|
||||||
|
subtype=Serpent
|
||||||
|
toughness=5
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
text=Play Defiant Stand only during the declare attackers step and only if you are the defending player. Target creature gets +1/+3 until the end of the turn. If that creature is tapped, untap it.
|
text=Play Defiant Stand only during the declare attackers step and only if you are the defending player. Target creature gets +1/+3 until the end of the turn. If that creature is tapped, untap it.
|
||||||
target=creature
|
target=creature
|
||||||
auto=untap
|
auto=untap
|
||||||
@@ -798,6 +838,15 @@ power=2
|
|||||||
toughness=3
|
toughness=3
|
||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
|
text=Untap all creatures you control.
|
||||||
|
auto=untap all(creature|myinplay)
|
||||||
|
id=4303
|
||||||
|
name=Mobilize
|
||||||
|
rarity=C
|
||||||
|
type=Sorcery
|
||||||
|
mana={G}
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
text=Target creature gets +4/+4 until end of turn.
|
text=Target creature gets +4/+4 until end of turn.
|
||||||
id=4304
|
id=4304
|
||||||
target=creature
|
target=creature
|
||||||
@@ -1145,6 +1194,18 @@ mana={R}
|
|||||||
type=Sorcery
|
type=Sorcery
|
||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
|
text=When Serpent Assassin comes into play, you may destroy target nonblack creature.
|
||||||
|
auto=may destroy target(creature[-black])
|
||||||
|
id=4237
|
||||||
|
name=Serpent Assassin
|
||||||
|
rarity=R
|
||||||
|
type=Creature
|
||||||
|
mana={3}{B}{B}
|
||||||
|
power=2
|
||||||
|
subtype=Snake Assassin
|
||||||
|
toughness=2
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
text=When Serpent Warrior comes into play, you lose 3 life.
|
text=When Serpent Warrior comes into play, you lose 3 life.
|
||||||
auto=life:-3
|
auto=life:-3
|
||||||
id=4238
|
id=4238
|
||||||
@@ -1354,6 +1415,18 @@ type=Sorcery
|
|||||||
mana={2}{U}
|
mana={2}{U}
|
||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
|
text=Haste (This creature can attack the turn it comes under your control.) When Thundermare comes into play, tap all other creatures.
|
||||||
|
auto=tap all(creature) other
|
||||||
|
id=4364
|
||||||
|
name=Thundermare
|
||||||
|
rarity=R
|
||||||
|
type=Creature
|
||||||
|
mana={5}{R}
|
||||||
|
power=5
|
||||||
|
subtype=Elemental Horse
|
||||||
|
toughness=5
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
text=Put target creature on top of its owner's library.
|
text=Put target creature on top of its owner's library.
|
||||||
target=creature
|
target=creature
|
||||||
auto=moveTo(ownerLibrary)
|
auto=moveTo(ownerLibrary)
|
||||||
@@ -1373,6 +1446,24 @@ mana={3}{U}
|
|||||||
type=Sorcery
|
type=Sorcery
|
||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
|
text=White creatures get +2/+0 until end of turn.
|
||||||
|
auto=lord(creature[white] 2/0
|
||||||
|
id=4402
|
||||||
|
name=Valorous Charge
|
||||||
|
rarity=U
|
||||||
|
type=Sorcery
|
||||||
|
mana={1}{W}{W}
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
text=Creatures you control get +1/+1 until end of turn.
|
||||||
|
auto=lord(creature|myinplay) 1/1
|
||||||
|
id=4406
|
||||||
|
name=Warrior's Charge
|
||||||
|
rarity=C
|
||||||
|
type=Sorcery
|
||||||
|
mana={2}{W}
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
text=Search your library for a basic land card and put that card into play. Then shuffle your library.
|
text=Search your library for a basic land card and put that card into play. Then shuffle your library.
|
||||||
target=land[basic]|myLibrary
|
target=land[basic]|myLibrary
|
||||||
auto=moveTo(myInplay)
|
auto=moveTo(myInplay)
|
||||||
|
|||||||
@@ -33,14 +33,7 @@ rarity=R
|
|||||||
type=Sorcery
|
type=Sorcery
|
||||||
mana={3}{U}{U}
|
mana={3}{U}{U}
|
||||||
[/card]
|
[/card]
|
||||||
[card]
|
|
||||||
text=Target opponent reveals his or her hand. You draw a card for each Mountain and red card in it.
|
|
||||||
id=4249
|
|
||||||
name=Baleful Stare
|
|
||||||
rarity=U
|
|
||||||
type=Sorcery
|
|
||||||
mana={2}{U}
|
|
||||||
[/card]
|
|
||||||
[card]
|
[card]
|
||||||
text=Blaze deals X damage to target creature or player.
|
text=Blaze deals X damage to target creature or player.
|
||||||
id=4329
|
id=4329
|
||||||
@@ -49,22 +42,8 @@ rarity=U
|
|||||||
type=Sorcery
|
type=Sorcery
|
||||||
mana={X}{R}
|
mana={X}{R}
|
||||||
[/card]
|
[/card]
|
||||||
[card]
|
|
||||||
text=You gain 3 life for each creature attacking you.
|
|
||||||
id=4375
|
|
||||||
name=Blessed Reversal
|
|
||||||
rarity=R
|
|
||||||
type=Instant
|
|
||||||
mana={1}{W}
|
|
||||||
[/card]
|
|
||||||
[card]
|
|
||||||
text=Tap all nonwhite creatures.
|
|
||||||
id=4376
|
|
||||||
name=Blinding Light
|
|
||||||
rarity=R
|
|
||||||
type=Sorcery
|
|
||||||
mana={2}{W}
|
|
||||||
[/card]
|
|
||||||
[card]
|
[card]
|
||||||
text=Whenever Charging Bandits attacks, it gets +2/+0 until end of turn.
|
text=Whenever Charging Bandits attacks, it gets +2/+0 until end of turn.
|
||||||
id=4212
|
id=4212
|
||||||
@@ -140,17 +119,7 @@ rarity=U
|
|||||||
type=Instant
|
type=Instant
|
||||||
mana={1}{G}
|
mana={1}{G}
|
||||||
[/card]
|
[/card]
|
||||||
[card]
|
|
||||||
text=Deep-Sea Serpent can't attack unless defending player controls an Island.
|
|
||||||
id=4258
|
|
||||||
name=Deep-Sea Serpent
|
|
||||||
rarity=U
|
|
||||||
type=Creature
|
|
||||||
mana={4}{U}{U}
|
|
||||||
power=5
|
|
||||||
subtype=Serpent
|
|
||||||
toughness=5
|
|
||||||
[/card]
|
|
||||||
[card]
|
[card]
|
||||||
text=Until end of turn, black creatures you control can be blocked only by black creatures.
|
text=Until end of turn, black creatures you control can be blocked only by black creatures.
|
||||||
id=4216
|
id=4216
|
||||||
@@ -314,14 +283,7 @@ power=4
|
|||||||
subtype=Human Mercenary Knight
|
subtype=Human Mercenary Knight
|
||||||
toughness=4
|
toughness=4
|
||||||
[/card]
|
[/card]
|
||||||
[card]
|
|
||||||
text=Untap all creatures you control.
|
|
||||||
id=4303
|
|
||||||
name=Mobilize
|
|
||||||
rarity=C
|
|
||||||
type=Sorcery
|
|
||||||
mana={G}
|
|
||||||
[/card]
|
|
||||||
[card]
|
[card]
|
||||||
text=As an additional cost to play Natural Order, sacrifice a green creature. Search your library for a green creature card and put it into play. Then shuffle your library.
|
text=As an additional cost to play Natural Order, sacrifice a green creature. Search your library for a green creature card and put it into play. Then shuffle your library.
|
||||||
id=4307
|
id=4307
|
||||||
@@ -433,17 +395,7 @@ power=2
|
|||||||
subtype=Human Soldier
|
subtype=Human Soldier
|
||||||
toughness=2
|
toughness=2
|
||||||
[/card]
|
[/card]
|
||||||
[card]
|
|
||||||
text=When Serpent Assassin comes into play, you may destroy target nonblack creature.
|
|
||||||
id=4237
|
|
||||||
name=Serpent Assassin
|
|
||||||
rarity=R
|
|
||||||
type=Creature
|
|
||||||
mana={3}{B}{B}
|
|
||||||
power=2
|
|
||||||
subtype=Snake Assassin
|
|
||||||
toughness=2
|
|
||||||
[/card]
|
|
||||||
[card]
|
[card]
|
||||||
text=Look at target opponent's hand. Draw a card.
|
text=Look at target opponent's hand. Draw a card.
|
||||||
id=4275
|
id=4275
|
||||||
@@ -517,17 +469,7 @@ power=4
|
|||||||
subtype=Wurm
|
subtype=Wurm
|
||||||
toughness=4
|
toughness=4
|
||||||
[/card]
|
[/card]
|
||||||
[card]
|
|
||||||
text=Haste (This creature can attack the turn it comes under your control.) When Thundermare comes into play, tap all other creatures.
|
|
||||||
id=4364
|
|
||||||
name=Thundermare
|
|
||||||
rarity=R
|
|
||||||
type=Creature
|
|
||||||
mana={5}{R}
|
|
||||||
power=5
|
|
||||||
subtype=Elemental Horse
|
|
||||||
toughness=5
|
|
||||||
[/card]
|
|
||||||
[card]
|
[card]
|
||||||
text=Tap up to three target creatures without flying.
|
text=Tap up to three target creatures without flying.
|
||||||
id=4281
|
id=4281
|
||||||
@@ -556,22 +498,8 @@ subtype=Beast
|
|||||||
toughness=2
|
toughness=2
|
||||||
[/card]
|
[/card]
|
||||||
|
|
||||||
[card]
|
|
||||||
text=White creatures get +2/+0 until end of turn.
|
|
||||||
id=4402
|
|
||||||
name=Valorous Charge
|
|
||||||
rarity=U
|
|
||||||
type=Sorcery
|
|
||||||
mana={1}{W}{W}
|
|
||||||
[/card]
|
|
||||||
[card]
|
|
||||||
text=Creatures you control get +1/+1 until end of turn.
|
|
||||||
id=4406
|
|
||||||
name=Warrior's Charge
|
|
||||||
rarity=C
|
|
||||||
type=Sorcery
|
|
||||||
mana={2}{W}
|
|
||||||
[/card]
|
|
||||||
[card]
|
[card]
|
||||||
text=Destroy two target nonblack creatures. You lose 5 life.
|
text=Destroy two target nonblack creatures. You lose 5 life.
|
||||||
id=4246
|
id=4246
|
||||||
|
|||||||
@@ -104,6 +104,7 @@ master_of_etherium.txt
|
|||||||
millstone.txt
|
millstone.txt
|
||||||
mind_rot.txt
|
mind_rot.txt
|
||||||
nantuko_husk.txt
|
nantuko_husk.txt
|
||||||
|
necrogenesis.txt
|
||||||
Nevinyrrals_Disk.txt
|
Nevinyrrals_Disk.txt
|
||||||
Nevinyrrals_Disk2.txt
|
Nevinyrrals_Disk2.txt
|
||||||
nightmare.txt
|
nightmare.txt
|
||||||
@@ -149,4 +150,4 @@ zombify.txt
|
|||||||
#Momir Basic Tests
|
#Momir Basic Tests
|
||||||
########################
|
########################
|
||||||
momir/keldon_warlord.txt
|
momir/keldon_warlord.txt
|
||||||
momir/overcost.txt
|
momir/overcost.txt
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
#Testing && symbol
|
||||||
|
#necrogensis: text={2}: Remove target creature card in a graveyard from the game. Put a 1/1 green Saproling creature token into play.
|
||||||
|
[INIT]
|
||||||
|
FIRSTMAIN
|
||||||
|
[PLAYER1]
|
||||||
|
inplay:necrogenesis
|
||||||
|
manapool:{B}{B}
|
||||||
|
[PLAYER2]
|
||||||
|
graveyard:1250
|
||||||
|
[DO]
|
||||||
|
necrogenesis
|
||||||
|
1250
|
||||||
|
[ASSERT]
|
||||||
|
FIRSTMAIN
|
||||||
|
[PLAYER1]
|
||||||
|
inplay:necrogenesis,*
|
||||||
|
manapool:{0}
|
||||||
|
[PLAYER2]
|
||||||
|
[END]
|
||||||
@@ -140,6 +140,7 @@ public:
|
|||||||
int resolve(){
|
int resolve(){
|
||||||
vector<int>::size_type sz = abilities.size();
|
vector<int>::size_type sz = abilities.size();
|
||||||
for (unsigned int i = 0; i < sz; i++){
|
for (unsigned int i = 0; i < sz; i++){
|
||||||
|
if (target && target!= source && abilities[i]->target == abilities[i]->source) abilities[i]->target = target;
|
||||||
abilities[i]->resolve();
|
abilities[i]->resolve();
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
@@ -1734,8 +1735,7 @@ class AStrongLandLinkCreature: public MTGAbility{
|
|||||||
void Update(float dt){
|
void Update(float dt){
|
||||||
if (source->isAttacker()){
|
if (source->isAttacker()){
|
||||||
if (!game->opponent()->game->inPlay->hasType(land)){
|
if (!game->opponent()->game->inPlay->hasType(land)){
|
||||||
source->attacker=0;
|
source->toggleAttacker();
|
||||||
source->untap();
|
|
||||||
//TODO Improve, there can be race conditions here
|
//TODO Improve, there can be race conditions here
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2337,7 +2337,8 @@ class AEbonyHorse:public TargetAbility{
|
|||||||
}
|
}
|
||||||
|
|
||||||
int resolve(){
|
int resolve(){
|
||||||
tc->getNextCardTarget()->attacker = 0;
|
MTGCardInstance * _target = tc->getNextCardTarget();
|
||||||
|
if (_target->isAttacker()) _target->toggleAttacker();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3382,7 +3383,7 @@ class AIslandSanctuary:public MTGAbility{
|
|||||||
MTGGameZone * zone = game->currentPlayer->game->inPlay;
|
MTGGameZone * zone = game->currentPlayer->game->inPlay;
|
||||||
for (int i = 0; i < zone->nb_cards; i++){
|
for (int i = 0; i < zone->nb_cards; i++){
|
||||||
MTGCardInstance * card = zone->cards[i];
|
MTGCardInstance * card = zone->cards[i];
|
||||||
if (card->isAttacker() && !card->basicAbilities[Constants::FLYING] && !card->basicAbilities[Constants::ISLANDWALK]) card->attacker=0;
|
if (card->isAttacker() && !card->basicAbilities[Constants::FLYING] && !card->basicAbilities[Constants::ISLANDWALK]) source->toggleAttacker();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,6 +38,8 @@ class MTGCardInstance: public MTGCard, public Damageable {
|
|||||||
void unband();
|
void unband();
|
||||||
MTGCardInstance * getNextPartner();
|
MTGCardInstance * getNextPartner();
|
||||||
void initMTGCI();
|
void initMTGCI();
|
||||||
|
int setDefenser(MTGCardInstance * c);
|
||||||
|
int setAttacker(int value);
|
||||||
public:
|
public:
|
||||||
int regenerateTokens;
|
int regenerateTokens;
|
||||||
bool isToken;
|
bool isToken;
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ class MTGCardInstance;
|
|||||||
class MTGGameZone;
|
class MTGGameZone;
|
||||||
class Damage;
|
class Damage;
|
||||||
class Phase;
|
class Phase;
|
||||||
|
class Targetable;
|
||||||
|
|
||||||
class WEvent{
|
class WEvent{
|
||||||
public:
|
public:
|
||||||
@@ -14,7 +15,7 @@ public:
|
|||||||
DAMAGE = 2,
|
DAMAGE = 2,
|
||||||
CHANGE_PHASE = 3,
|
CHANGE_PHASE = 3,
|
||||||
};
|
};
|
||||||
int type;
|
int type; //Deprecated, use dynamic casting instead
|
||||||
WEvent(int _type = NOT_SPECIFIED);
|
WEvent(int _type = NOT_SPECIFIED);
|
||||||
virtual ~WEvent() {};
|
virtual ~WEvent() {};
|
||||||
};
|
};
|
||||||
@@ -42,12 +43,54 @@ public:
|
|||||||
WEventPhaseChange(Phase * _from, Phase * _to);
|
WEventPhaseChange(Phase * _from, Phase * _to);
|
||||||
};
|
};
|
||||||
|
|
||||||
class WEventCardTap: public WEvent{
|
|
||||||
|
//Abstract class of event when a card's status changes
|
||||||
|
class WEventCardUpdate: public WEvent{
|
||||||
public:
|
public:
|
||||||
MTGCardInstance * card;
|
MTGCardInstance * card;
|
||||||
|
WEventCardUpdate(MTGCardInstance * card):WEvent(),card(card){};
|
||||||
|
};
|
||||||
|
|
||||||
|
//Event when a card is tapped/untapped
|
||||||
|
class WEventCardTap: public WEventCardUpdate{
|
||||||
|
public:
|
||||||
bool before;
|
bool before;
|
||||||
bool after;
|
bool after;
|
||||||
WEventCardTap(MTGCardInstance * card, bool before, bool after);
|
WEventCardTap(MTGCardInstance * card, bool before, bool after);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//Event when a card's "attacker" status changes
|
||||||
|
//before:Player/Planeswalker that card was attacking previously
|
||||||
|
//after: Player/Planeswalker that card is attacking now
|
||||||
|
class WEventCreatureAttacker: public WEventCardUpdate{
|
||||||
|
public:
|
||||||
|
Targetable * before;
|
||||||
|
Targetable * after;
|
||||||
|
WEventCreatureAttacker(MTGCardInstance * card,Targetable * from, Targetable * to);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
//Event when a card's "defenser" status changes
|
||||||
|
//before : attacker that card was blocking previously
|
||||||
|
//after: attacker that card is blocking now
|
||||||
|
class WEventCreatureBlocker: public WEventCardUpdate{
|
||||||
|
public:
|
||||||
|
MTGCardInstance * before;
|
||||||
|
MTGCardInstance * after;
|
||||||
|
WEventCreatureBlocker(MTGCardInstance * card,MTGCardInstance * from,MTGCardInstance * to);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
//Event when a blocker is reordered
|
||||||
|
//exchangeWith: exchange card's position with exchangeWith's position
|
||||||
|
//attacker:both card and exchangeWith *should* be in attacker's "blockers" list.
|
||||||
|
class WEventCreatureBlockerRank: public WEventCardUpdate{
|
||||||
|
public:
|
||||||
|
MTGCardInstance * exchangeWith;
|
||||||
|
MTGCardInstance * attacker;
|
||||||
|
WEventCreatureBlockerRank(MTGCardInstance * card,MTGCardInstance * exchangeWith, MTGCardInstance * attacker);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -9,7 +9,9 @@ CardDescriptor::CardDescriptor(): MTGCardInstance(){
|
|||||||
|
|
||||||
int CardDescriptor::init(){
|
int CardDescriptor::init(){
|
||||||
int result = MTGCardInstance::init();
|
int result = MTGCardInstance::init();
|
||||||
initAttackersDefensers();
|
attacker = 0;
|
||||||
|
defenser = NULL;
|
||||||
|
banding = NULL;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,8 @@ MTGCardInstance::MTGCardInstance(MTGCard * card, MTGPlayerCards * _belongs_to):
|
|||||||
owner = NULL;
|
owner = NULL;
|
||||||
if (_belongs_to) owner = _belongs_to->library->owner;
|
if (_belongs_to) owner = _belongs_to->library->owner;
|
||||||
lastController = owner;
|
lastController = owner;
|
||||||
initAttackersDefensers();
|
defenser = NULL;
|
||||||
|
banding = NULL;
|
||||||
life=toughness;
|
life=toughness;
|
||||||
LOG("==Creating MTGCardInstance Successful==");
|
LOG("==Creating MTGCardInstance Successful==");
|
||||||
|
|
||||||
@@ -242,8 +243,8 @@ int MTGCardInstance::triggerRegenerate(){
|
|||||||
|
|
||||||
|
|
||||||
int MTGCardInstance::initAttackersDefensers(){
|
int MTGCardInstance::initAttackersDefensers(){
|
||||||
attacker = 0;
|
setAttacker(0);
|
||||||
defenser = NULL;
|
setDefenser(NULL);
|
||||||
banding = NULL;
|
banding = NULL;
|
||||||
blockers.clear();
|
blockers.clear();
|
||||||
return 1;
|
return 1;
|
||||||
@@ -403,26 +404,38 @@ void MTGCardInstance::unband(){
|
|||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int MTGCardInstance::setAttacker(int value){
|
||||||
|
Targetable * previousTarget = NULL;
|
||||||
|
Targetable * target = NULL;
|
||||||
|
Player * p = controller()->opponent();
|
||||||
|
if (value) target = p;
|
||||||
|
if (attacker) previousTarget = p;
|
||||||
|
attacker = value;
|
||||||
|
WEvent * e = NEW WEventCreatureAttacker(this,previousTarget, target);
|
||||||
|
GameObserver::GetInstance()->receiveEvent(e);
|
||||||
|
delete e;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
int MTGCardInstance::toggleAttacker(){
|
int MTGCardInstance::toggleAttacker(){
|
||||||
//TODO more controls ?
|
GameObserver * g = GameObserver::GetInstance();
|
||||||
if (canAttack()){
|
if (!attacker){
|
||||||
if (!attacker){
|
if (!basicAbilities[Constants::VIGILANCE]) tap();
|
||||||
attacker = 1;
|
setAttacker(1);
|
||||||
tap();
|
return 1;
|
||||||
|
}else{
|
||||||
|
//Banding needs to be debugged...
|
||||||
|
/*MTGCardInstance * bandingPartner = getNextPartner();
|
||||||
|
if (bandingPartner){
|
||||||
|
if (banding) unband();
|
||||||
|
if (!bandingPartner->banding) bandingPartner->banding = bandingPartner;
|
||||||
|
banding = bandingPartner->banding;
|
||||||
return 1;
|
return 1;
|
||||||
}else{
|
}else{*/
|
||||||
MTGCardInstance * bandingPartner = getNextPartner();
|
untap();
|
||||||
if (bandingPartner){
|
setAttacker(0);
|
||||||
if (banding) unband();
|
return 1;
|
||||||
if (!bandingPartner->banding) bandingPartner->banding = bandingPartner;
|
//}
|
||||||
banding = bandingPartner->banding;
|
|
||||||
return 1;
|
|
||||||
}else{
|
|
||||||
attacker = 0;
|
|
||||||
untap();
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -465,14 +478,9 @@ int MTGCardInstance::moveBlockerInRow(MTGCardInstance * blocker){
|
|||||||
if (it2 == blockers.end()) it2 = blockers.begin();
|
if (it2 == blockers.end()) it2 = blockers.begin();
|
||||||
|
|
||||||
blockers.splice( it2, blockers, it1 ); // move a before b, invalidates a
|
blockers.splice( it2, blockers, it1 ); // move a before b, invalidates a
|
||||||
char buffer[512];
|
WEvent* e = NEW WEventCreatureBlockerRank(blocker,*it2,this);
|
||||||
OutputDebugString("===Outputing blockers\n");
|
GameObserver::GetInstance()->receiveEvent(e);
|
||||||
for (it1 = blockers.begin(); it1 != blockers.end(); it1++){
|
delete(e);
|
||||||
MTGCardInstance * c = *it1;
|
|
||||||
sprintf(buffer, "%p-", c);
|
|
||||||
OutputDebugString(buffer);
|
|
||||||
}
|
|
||||||
OutputDebugString("\n===End Outputing blockers\n");
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -510,15 +518,24 @@ MTGCardInstance * MTGCardInstance::getNextOpponent(MTGCardInstance * previous){
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int MTGCardInstance::setDefenser(MTGCardInstance * opponent){
|
||||||
|
GameObserver * g = GameObserver::GetInstance();
|
||||||
|
if (defenser) defenser->blockers.remove(this);
|
||||||
|
WEvent * e = NEW WEventCreatureBlocker(this, defenser, opponent);
|
||||||
|
defenser = opponent;
|
||||||
|
if (defenser){
|
||||||
|
defenser->blockers.push_back(this);
|
||||||
|
}
|
||||||
|
g->blockersSorted = false;
|
||||||
|
g->receiveEvent(e);
|
||||||
|
delete e;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
int MTGCardInstance::toggleDefenser(MTGCardInstance * opponent){
|
int MTGCardInstance::toggleDefenser(MTGCardInstance * opponent){
|
||||||
if (canBlock()){
|
if (canBlock()){
|
||||||
if (canBlock(opponent)){
|
if (canBlock(opponent)){
|
||||||
if (defenser) defenser->blockers.remove(this);
|
setDefenser(opponent);
|
||||||
defenser = opponent;
|
|
||||||
if (defenser){
|
|
||||||
defenser->blockers.push_back(this);
|
|
||||||
}
|
|
||||||
GameObserver::GetInstance()->blockersSorted = false;
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -116,8 +116,7 @@ void MTGAttackRule::Update(float dt){
|
|||||||
|
|
||||||
int MTGAttackRule::reactToClick(MTGCardInstance * card){
|
int MTGAttackRule::reactToClick(MTGCardInstance * card){
|
||||||
if (!isReactingToClick(card)) return 0;
|
if (!isReactingToClick(card)) return 0;
|
||||||
card->attacker = 1;
|
card->toggleAttacker();
|
||||||
if (!card->basicAbilities[Constants::VIGILANCE]) card->tap();
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ JQuad * Player::getIcon(){
|
|||||||
|
|
||||||
Player * Player::opponent(){
|
Player * Player::opponent(){
|
||||||
GameObserver * game = GameObserver::GetInstance();
|
GameObserver * game = GameObserver::GetInstance();
|
||||||
|
if (!game) return NULL;
|
||||||
for (int i= 0; i < 2; i++){
|
for (int i= 0; i < 2; i++){
|
||||||
if (game->players[i] != this) return game->players[i];
|
if (game->players[i] != this) return game->players[i];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -354,7 +354,7 @@ int TestSuite::assertGame(){
|
|||||||
for (int j = 0; j < 4; j++){
|
for (int j = 0; j < 4; j++){
|
||||||
MTGGameZone * zone = playerZones[j];
|
MTGGameZone * zone = playerZones[j];
|
||||||
if (zone->nb_cards != endState.playerData[i].zones[j].nbitems){
|
if (zone->nb_cards != endState.playerData[i].zones[j].nbitems){
|
||||||
sprintf(result, "<span class=\"error\">==Card number not the same in %i==</span><br />",j);
|
sprintf(result, "<span class=\"error\">==Card number not the same in %i==, expected %i, got %i</span><br />",j, endState.playerData[i].zones[j].nbitems, zone->nb_cards);
|
||||||
Log(result);
|
Log(result);
|
||||||
error++;
|
error++;
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -13,7 +13,9 @@ Token::Token(string _name, MTGCardInstance * source, int _power, int _toughness)
|
|||||||
model = this;
|
model = this;
|
||||||
owner = source->owner;
|
owner = source->owner;
|
||||||
belongs_to=source->controller()->game;
|
belongs_to=source->controller()->game;
|
||||||
initAttackersDefensers();
|
attacker = 0;
|
||||||
|
defenser = NULL;
|
||||||
|
banding = NULL;
|
||||||
mCache = source->mCache;
|
mCache = source->mCache;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -24,4 +24,14 @@ WEventPhaseChange::WEventPhaseChange(Phase * _from, Phase * _to):WEvent(CHANGE_P
|
|||||||
to = _to;
|
to = _to;
|
||||||
}
|
}
|
||||||
|
|
||||||
WEventCardTap::WEventCardTap(MTGCardInstance * card, bool before, bool after):WEvent(), card(card),before(before), after(after){}
|
WEventCardTap::WEventCardTap(MTGCardInstance * card, bool before, bool after)
|
||||||
|
:WEventCardUpdate(card), before(before), after(after){}
|
||||||
|
|
||||||
|
WEventCreatureAttacker::WEventCreatureAttacker(MTGCardInstance * card,Targetable * before, Targetable * after)
|
||||||
|
:WEventCardUpdate(card), before(before), after(after){}
|
||||||
|
|
||||||
|
WEventCreatureBlocker::WEventCreatureBlocker(MTGCardInstance * card,MTGCardInstance * from,MTGCardInstance * to)
|
||||||
|
:WEventCardUpdate(card), before(before), after(after){}
|
||||||
|
|
||||||
|
WEventCreatureBlockerRank::WEventCreatureBlockerRank(MTGCardInstance * card,MTGCardInstance * exchangeWith, MTGCardInstance * attacker)
|
||||||
|
:WEventCardUpdate(card), exchangeWith(exchangeWith), attacker(attacker){}
|
||||||
Reference in New Issue
Block a user