Erwan
- Fixed a bug with royal Assassin
This commit is contained in:
Binary file not shown.
@@ -1,50 +0,0 @@
|
||||
30
|
||||
100
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
@@ -1,96 +0,0 @@
|
||||
1167
|
||||
460
|
||||
1202
|
||||
525
|
||||
1340
|
||||
92
|
||||
1284
|
||||
101
|
||||
1149
|
||||
20
|
||||
1264
|
||||
20
|
||||
1321
|
||||
20
|
||||
1272
|
||||
437
|
||||
1126
|
||||
485
|
||||
1334
|
||||
107
|
||||
1352
|
||||
91
|
||||
1279
|
||||
20
|
||||
1154
|
||||
481
|
||||
1328
|
||||
551
|
||||
1335
|
||||
20
|
||||
1227
|
||||
500
|
||||
1236
|
||||
489
|
||||
1186
|
||||
20
|
||||
1219
|
||||
20
|
||||
1175
|
||||
459
|
||||
1136
|
||||
111
|
||||
1332
|
||||
545
|
||||
1250
|
||||
21
|
||||
1204
|
||||
19
|
||||
1381
|
||||
499
|
||||
1170
|
||||
484
|
||||
1097
|
||||
102
|
||||
1102
|
||||
46
|
||||
1282
|
||||
485
|
||||
1378
|
||||
490
|
||||
1300
|
||||
20
|
||||
1363
|
||||
495
|
||||
129665
|
||||
90
|
||||
1387
|
||||
4
|
||||
129652
|
||||
5
|
||||
174957
|
||||
108
|
||||
175030
|
||||
5
|
||||
130378
|
||||
107
|
||||
175031
|
||||
5
|
||||
1312
|
||||
19
|
||||
130386
|
||||
97
|
||||
1275
|
||||
21
|
||||
1148
|
||||
103
|
||||
135185
|
||||
20
|
||||
1100
|
||||
109
|
||||
153441
|
||||
19
|
||||
1318
|
||||
499
|
||||
146746
|
||||
509
|
||||
@@ -43,6 +43,7 @@ paralysis.txt
|
||||
paralysis2.txt
|
||||
resurrection.txt
|
||||
rootwalla.txt
|
||||
royal_assassin.txt
|
||||
shivan_hellkite.txt
|
||||
shock.txt
|
||||
spark_elemental.txt
|
||||
|
||||
21
projects/mtg/bin/Res/test/royal_assassin.txt
Normal file
21
projects/mtg/bin/Res/test/royal_assassin.txt
Normal file
@@ -0,0 +1,21 @@
|
||||
#Testing Icy Manipulator + Royal assassin on serra angel
|
||||
[INIT]
|
||||
FIRSTMAIN
|
||||
[PLAYER1]
|
||||
inplay:1175,129601
|
||||
manapool:{B}
|
||||
[PLAYER2]
|
||||
inplay:129726
|
||||
[DO]
|
||||
129601
|
||||
129726
|
||||
1175
|
||||
129726
|
||||
[ASSERT]
|
||||
FIRSTMAIN
|
||||
[PLAYER1]
|
||||
inplay:1175,129601
|
||||
manapool:{0}
|
||||
[PLAYER2]
|
||||
graveyard:129726
|
||||
[END]
|
||||
@@ -47,7 +47,7 @@ class ADrawer:public ActivatedAbility{
|
||||
class ADestroyer:public TargetAbility{
|
||||
public:
|
||||
int bury;
|
||||
ADestroyer(int _id, MTGCardInstance * _source, TargetChooser * _tc = NULL, int _bury = 0):TargetAbility(_id,_source, tc),bury(_bury){
|
||||
ADestroyer(int _id, MTGCardInstance * _source, TargetChooser * _tc = NULL, int _bury = 0):TargetAbility(_id,_source, _tc),bury(_bury){
|
||||
if (!tc) tc = NEW CreatureTargetChooser();
|
||||
}
|
||||
|
||||
|
||||
@@ -463,8 +463,7 @@ class GameStateMenu: public GameState, public JGuiListener
|
||||
break;
|
||||
case 14:
|
||||
currentState = STATE_MENU;
|
||||
delete subMenuController;
|
||||
subMenuController = NULL;
|
||||
SAFE_DELETE(subMenuController);
|
||||
break;
|
||||
#ifdef TESTSUITE
|
||||
case 666:
|
||||
|
||||
@@ -22,10 +22,12 @@ MTGCardInstance * CardDescriptor::match_or(MTGCardInstance * card){
|
||||
if (!found) return NULL;
|
||||
|
||||
for (int i = 0; i< MTG_NB_COLORS; i++){
|
||||
found = 0;
|
||||
if (colors[i] == 1 && card->hasColor(i)){
|
||||
found = 1;
|
||||
break;
|
||||
if (colors[i] == 1){
|
||||
found = 0;
|
||||
if(card->hasColor(i)){
|
||||
found = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!found) return NULL;
|
||||
@@ -51,13 +53,15 @@ MTGCardInstance * CardDescriptor::match_and(MTGCardInstance * card){
|
||||
MTGCardInstance * CardDescriptor::match(MTGCardInstance * card){
|
||||
|
||||
MTGCardInstance * match = card;
|
||||
|
||||
if (mode == CD_AND){
|
||||
match = match_and(card);
|
||||
}else{
|
||||
match=match_or(card);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//Abilities
|
||||
for (int j = 0; j < NB_BASIC_ABILITIES; j++){
|
||||
if ((basicAbilities[j] == 1 && !card->basicAbilities[j]) || (basicAbilities[j] == -1 && card->basicAbilities[j])){
|
||||
@@ -65,10 +69,13 @@ MTGCardInstance * CardDescriptor::match(MTGCardInstance * card){
|
||||
}
|
||||
}
|
||||
|
||||
if ((tapped == -1 && card->isTapped()) || (tapped == 1 && !card->isTapped())){
|
||||
|
||||
if ((tapped == -1 && card->isTapped()) || (tapped == 1 && !card->isTapped())){
|
||||
match = NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (attacker == 1){
|
||||
if ((int)defenser == 1){
|
||||
if (!card->attacker && !card->defenser) match = NULL;
|
||||
|
||||
@@ -182,20 +182,6 @@ int AbilityFactory::magicText(int id, Spell * spell, MTGCardInstance * card){
|
||||
continue;
|
||||
}
|
||||
|
||||
//Tapper (icy manipulator)
|
||||
found = s.find("tap");
|
||||
if (found != string::npos){
|
||||
if (dryMode) return BAKA_EFFECT_GOOD;
|
||||
ManaCost * cost = ManaCost::parseManaCost(s);
|
||||
if (tc){
|
||||
game->addObserver(NEW ATapper(id, card, cost, tc));
|
||||
}else{
|
||||
target->tapped = 1;
|
||||
}
|
||||
|
||||
result++;
|
||||
continue;
|
||||
}
|
||||
|
||||
//Regeneration
|
||||
found = s.find("}:regenerate");
|
||||
@@ -264,29 +250,29 @@ int AbilityFactory::magicText(int id, Spell * spell, MTGCardInstance * card){
|
||||
|
||||
found = s.find("all(");
|
||||
if (found != string::npos){
|
||||
int end = s.find(")");
|
||||
string starget = s.substr(found + 4,end - found - 4);
|
||||
TargetChooserFactory tcf;
|
||||
TargetChooser * targetAll = tcf.createTargetChooser(starget, card);
|
||||
if (dryMode){
|
||||
int myNbCards = countCards(targetAll,card->controller());
|
||||
int opponentNbCards = countCards(targetAll, card->controller()->opponent());
|
||||
int myCardsPower = countCards(targetAll,card->controller(),COUNT_POWER);
|
||||
int opponentCardsPower = countCards(targetAll, card->controller()->opponent(),COUNT_POWER);
|
||||
delete targetAll;
|
||||
if (myNbCards < opponentNbCards || myCardsPower < opponentCardsPower) return BAKA_EFFECT_GOOD;
|
||||
return BAKA_EFFECT_BAD;
|
||||
}else{
|
||||
this->destroyAllInPlay(targetAll);
|
||||
delete targetAll;
|
||||
}
|
||||
int end = s.find(")");
|
||||
string starget = s.substr(found + 4,end - found - 4);
|
||||
TargetChooserFactory tcf;
|
||||
TargetChooser * targetAll = tcf.createTargetChooser(starget, card);
|
||||
if (dryMode){
|
||||
int myNbCards = countCards(targetAll,card->controller());
|
||||
int opponentNbCards = countCards(targetAll, card->controller()->opponent());
|
||||
int myCardsPower = countCards(targetAll,card->controller(),COUNT_POWER);
|
||||
int opponentCardsPower = countCards(targetAll, card->controller()->opponent(),COUNT_POWER);
|
||||
delete targetAll;
|
||||
if (myNbCards < opponentNbCards || myCardsPower < opponentCardsPower) return BAKA_EFFECT_GOOD;
|
||||
return BAKA_EFFECT_BAD;
|
||||
}else{
|
||||
this->destroyAllInPlay(targetAll);
|
||||
delete targetAll;
|
||||
}
|
||||
}else{
|
||||
if (dryMode) return BAKA_EFFECT_BAD;
|
||||
if (tc){
|
||||
game->addObserver(NEW ADestroyer(id, card,tc));
|
||||
}else{
|
||||
game->mLayers->stackLayer()->addPutInGraveyard(target);
|
||||
}
|
||||
if (dryMode) return BAKA_EFFECT_BAD;
|
||||
if (tc){
|
||||
game->addObserver(NEW ADestroyer(id, card,tc));
|
||||
}else{
|
||||
game->mLayers->stackLayer()->addPutInGraveyard(target);
|
||||
}
|
||||
}
|
||||
result++;
|
||||
continue;
|
||||
@@ -481,8 +467,30 @@ int AbilityFactory::magicText(int id, Spell * spell, MTGCardInstance * card){
|
||||
result++;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
//Tapper (icy manipulator)
|
||||
found = s.find("tap");
|
||||
if (found != string::npos){
|
||||
if (dryMode) return BAKA_EFFECT_GOOD;
|
||||
ManaCost * cost = ManaCost::parseManaCost(s);
|
||||
if (tc){
|
||||
game->addObserver(NEW ATapper(id, card, cost, tc));
|
||||
}else{
|
||||
target->tapped = 1;
|
||||
}
|
||||
|
||||
result++;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
return result;
|
||||
|
||||
|
||||
|
||||
@@ -411,9 +411,9 @@ DescriptorTargetChooser::DescriptorTargetChooser(CardDescriptor * _cd, MTGGameZo
|
||||
|
||||
int DescriptorTargetChooser::canTarget(Targetable * target){
|
||||
if (target->typeAsTarget() == TARGET_CARD){
|
||||
MTGCardInstance * card = (MTGCardInstance *) target;
|
||||
if (!TargetZoneChooser::canTarget(card)) return 0;
|
||||
if (cd->match(card)) return 1;
|
||||
MTGCardInstance * _target = (MTGCardInstance *) target;
|
||||
if (!TargetZoneChooser::canTarget(_target)) return 0;
|
||||
if (cd->match(_target)) return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user