Erwan
- fixed a few cards - removed extra phasebar - doesnotuntap and protection from... will now work as auras
This commit is contained in:
@@ -34,7 +34,7 @@ void DuelLayers::init(){
|
||||
//3 Game
|
||||
MTGGuiPlay * play = NEW MTGGuiPlay(4, GameObserver::GetInstance());
|
||||
|
||||
Add(NEW GuiPhaseBar(GameObserver::GetInstance()));
|
||||
//Add(NEW GuiPhaseBar(GameObserver::GetInstance()));
|
||||
Add(mActionStack);
|
||||
Add(mDamageResolver);
|
||||
Add(actionLayer);
|
||||
@@ -44,22 +44,22 @@ void DuelLayers::init(){
|
||||
|
||||
|
||||
ActionStack * DuelLayers::stackLayer(){
|
||||
return ((ActionStack *) (objects[1]));
|
||||
return ((ActionStack *) (objects[0]));
|
||||
}
|
||||
|
||||
DamageResolverLayer * DuelLayers::combatLayer(){
|
||||
return ((DamageResolverLayer *) (objects[2]));
|
||||
return ((DamageResolverLayer *) (objects[1]));
|
||||
}
|
||||
|
||||
ActionLayer * DuelLayers::actionLayer(){
|
||||
return ((ActionLayer *) (objects[3]));
|
||||
return ((ActionLayer *) (objects[2]));
|
||||
}
|
||||
|
||||
MTGGuiHand * DuelLayers::handLayer(){
|
||||
return ((MTGGuiHand *) (objects[4]));
|
||||
return ((MTGGuiHand *) (objects[3]));
|
||||
}
|
||||
MTGGuiPlay * DuelLayers::playLayer(){
|
||||
return ((MTGGuiPlay *) (objects[5]));
|
||||
return ((MTGGuiPlay *) (objects[4]));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1409,31 +1409,11 @@ void AbilityFactory::addAbilities(int _id, Spell * spell){
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 1331: //Black Ward
|
||||
{
|
||||
game->addObserver(NEW AProtectionFrom( _id,card, card->target, Constants::MTG_COLOR_BLACK));
|
||||
break;
|
||||
}
|
||||
case 1333: //Blue Ward
|
||||
{
|
||||
game->addObserver(NEW AProtectionFrom( _id,card, card->target, Constants::MTG_COLOR_BLUE));
|
||||
break;
|
||||
}
|
||||
case 1238: //Cockatrice
|
||||
{
|
||||
game->addObserver(NEW AOldSchoolDeathtouch(_id,card));
|
||||
break;
|
||||
}
|
||||
case 1346: //Green Ward
|
||||
{
|
||||
game->addObserver(NEW AProtectionFrom( _id,card, card->target, Constants::MTG_COLOR_GREEN));
|
||||
break;
|
||||
}
|
||||
case 1359: //Red Ward
|
||||
{
|
||||
game->addObserver(NEW AProtectionFrom( _id,card, card->target, Constants::MTG_COLOR_RED));
|
||||
break;
|
||||
}
|
||||
case 1362: //Reverse polarity
|
||||
{
|
||||
ActionStack * as = game->mLayers->stackLayer();
|
||||
@@ -1475,11 +1455,6 @@ void AbilityFactory::addAbilities(int _id, Spell * spell){
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 1371: //White Ward
|
||||
{
|
||||
game->addObserver(NEW AProtectionFrom( _id,card, card->target, Constants::MTG_COLOR_WHITE));
|
||||
break;
|
||||
}
|
||||
|
||||
//Addons Legends
|
||||
case 1427: //Abomination (does not work make the game crash)
|
||||
@@ -1762,29 +1737,18 @@ void AbilityFactory::addAbilities(int _id, Spell * spell){
|
||||
|
||||
|
||||
|
||||
/* Erwan - 2008/11/13: We want to get rid of these basicAbility things.
|
||||
/* We want to get rid of these basicAbility things.
|
||||
* basicAbilities themselves are alright, but creating new object depending on them is dangerous
|
||||
* The main reason is that classes that add an ability to a card do NOT create these objects, and therefore do NOT
|
||||
* Work.
|
||||
* For example, setting LIFELINK for a creature is not enough right now...
|
||||
* For example, setting EXALTED for a creature is not enough right now...
|
||||
* It shouldn't be necessary to add an object. State based abilities could do the trick
|
||||
*/
|
||||
|
||||
|
||||
for (int i=Constants::PROTECTIONGREEN; i <= Constants::PROTECTIONWHITE; i++){
|
||||
if (card->basicAbilities[i]){
|
||||
game->addObserver(NEW AProtectionFrom(_id, card, card, i - Constants::PROTECTIONGREEN + Constants::MTG_COLOR_GREEN));
|
||||
}
|
||||
}
|
||||
|
||||
if (card->basicAbilities[Constants::EXALTED]){
|
||||
game->addObserver(NEW AExalted(_id, card));
|
||||
}
|
||||
|
||||
if (card->basicAbilities[Constants::DOESNOTUNTAP]){
|
||||
game->addObserver(NEW UntapBlocker(_id, card));
|
||||
}
|
||||
|
||||
// Tested works the first r10 did not function because of the mistake in the array of the definition
|
||||
if (card->basicAbilities[Constants::FORESTHOME]){
|
||||
game->addObserver(NEW AStrongLandLinkCreature(_id, card, "forest"));
|
||||
|
||||
@@ -567,6 +567,12 @@ int MTGCardInstance::removeProtection(CardDescriptor * cd, int erase){
|
||||
}
|
||||
|
||||
int MTGCardInstance::protectedAgainst(MTGCardInstance * card){
|
||||
//Basic protections
|
||||
for (int i=Constants::PROTECTIONGREEN; i <= Constants::PROTECTIONWHITE; i++){
|
||||
if (basicAbilities[i] && card->hasColor( i - Constants::PROTECTIONGREEN + Constants::MTG_COLOR_GREEN )) return 1;
|
||||
}
|
||||
|
||||
//General protections
|
||||
for (int i = 0; i < nbprotections ; i++){
|
||||
if (protections[i]->match(card)) return 1;
|
||||
}
|
||||
|
||||
@@ -369,14 +369,10 @@ MTGCardInstance * MTGInPlay::getNextAttacker(MTGCardInstance * previous){
|
||||
void MTGInPlay::untapAll(){
|
||||
int i;
|
||||
for (i = 0; i < nb_cards; i ++){
|
||||
cards[i]->setUntapping();
|
||||
if (cards[i]->getUntapBlockers()->isEmpty()){
|
||||
#if defined (WIN32) || defined (LINUX)
|
||||
char buf[4096];
|
||||
sprintf(buf, "Can untap %s\n", cards[i]->getName());
|
||||
OutputDebugString(buf);
|
||||
#endif
|
||||
cards[i]->attemptUntap();
|
||||
MTGCardInstance * card = cards[i];
|
||||
card->setUntapping();
|
||||
if (!card->basicAbilities[Constants::DOESNOTUNTAP] && card->getUntapBlockers()->isEmpty()){
|
||||
card->attemptUntap();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user