- fixed a few cards
- removed extra phasebar
- doesnotuntap and protection from... will now work as auras
This commit is contained in:
wagic.the.homebrew@gmail.com
2009-08-10 13:22:22 +00:00
parent f3a25b3f3d
commit 258e08786d
8 changed files with 24 additions and 100 deletions
+1 -1
View File
@@ -62,7 +62,7 @@ rarity=R
[/card] [/card]
[card] [card]
id=77925 id=77925
id=129767 alias=129767
target=creature[-legendary] target=creature[-legendary]
auto=haste auto=haste
auto=untap auto=untap
-9
View File
@@ -149,15 +149,6 @@ mana={1}{G}{G}
type=Enchantment type=Enchantment
[/card] [/card]
[card] [card]
text=Whenever a creature attacks you, it gets -1/-0 until end of turn.
id=19745
name=Briar Patch
auto=lord(creature[attacking]|opponentinplay) -1/0
rarity=U
type=Enchantment
mana={1}{G}{G}
[/card]
[card]
text=Search target opponent's library for a creature card and put that card into play under your control. Then that player shuffles his or her library. text=Search target opponent's library for a creature card and put that card into play under your control. Then that player shuffles his or her library.
target=creature|opponentLibrary target=creature|opponentLibrary
auto=moveTo(myInplay) auto=moveTo(myInplay)
+5
View File
@@ -198,6 +198,7 @@ mana={1}
[card] [card]
text=Enchant creature Enchanted creature has protection from black. This effect doesn't remove Black Ward. text=Enchant creature Enchanted creature has protection from black. This effect doesn't remove Black Ward.
target=creature target=creature
auto=protection from black
id=1331 id=1331
name=Black Ward name=Black Ward
rarity=U rarity=U
@@ -227,6 +228,7 @@ mana={U}
[card] [card]
text=Enchant creature Enchanted creature has protection from blue. This effect doesn't remove Blue Ward. text=Enchant creature Enchanted creature has protection from blue. This effect doesn't remove Blue Ward.
target=creature target=creature
auto=protection from blue
id=1333 id=1333
name=Blue Ward name=Blue Ward
rarity=U rarity=U
@@ -945,6 +947,7 @@ toughness=2
[card] [card]
text=Enchant creature Enchanted creature has protection from green. This effect doesn't remove Green Ward. text=Enchant creature Enchanted creature has protection from green. This effect doesn't remove Green Ward.
target=creature target=creature
auto=protection from green
id=1346 id=1346
name=Green Ward name=Green Ward
rarity=U rarity=U
@@ -1753,6 +1756,7 @@ mana={R}
[card] [card]
text=Enchant creature Enchanted creature has protection from red. This effect doesn't remove Red Ward. text=Enchant creature Enchanted creature has protection from red. This effect doesn't remove Red Ward.
target=creature target=creature
auto=protection from red
id=1359 id=1359
name=Red Ward name=Red Ward
rarity=U rarity=U
@@ -2526,6 +2530,7 @@ toughness=2
[card] [card]
text=Enchant creature Enchanted creature has protection from white. This effect doesn't remove White Ward. text=Enchant creature Enchanted creature has protection from white. This effect doesn't remove White Ward.
target=creature target=creature
auto=protection from white
id=1371 id=1371
name=White Ward name=White Ward
rarity=U rarity=U
-38
View File
@@ -1251,44 +1251,6 @@ class AStandardRegenerate:public ActivatedAbility{
} }
}; };
/*Gives protection to a target */
class AProtectionFrom:public MTGAbility{
public:
CardDescriptor * cd;
void initProtection(){
((MTGCardInstance *)target)->addProtection(cd);
}
AProtectionFrom(int _id, MTGCardInstance * _source, MTGCardInstance * _target, CardDescriptor * _cd):MTGAbility(_id, _source, _target),cd(_cd){
initProtection();
}
AProtectionFrom(int _id, MTGCardInstance * _source, MTGCardInstance * _target, int color):MTGAbility(_id, _source, _target){
cd = NEW CardDescriptor();
cd->colors[color] = 1;
initProtection();
}
int destroy(){
((MTGCardInstance *)target)->removeProtection(cd);
return 1;
}
~AProtectionFrom(){
delete(cd);
}
virtual ostream& toString(ostream& out) const
{
out << "AProtectionFrom ::: cd : " << cd
<< " (";
return MTGAbility::toString(out) << ")";
}
AProtectionFrom * clone() const{
AProtectionFrom * a = NEW AProtectionFrom(*this);
a->isClone = 1;
return a;
}
};
//Aura Enchantments that provide controller of target life or damages at a given phase of their turn //Aura Enchantments that provide controller of target life or damages at a given phase of their turn
class ARegularLifeModifierAura:public MTGAbility{ class ARegularLifeModifierAura:public MTGAbility{
+6 -6
View File
@@ -34,7 +34,7 @@ void DuelLayers::init(){
//3 Game //3 Game
MTGGuiPlay * play = NEW MTGGuiPlay(4, GameObserver::GetInstance()); MTGGuiPlay * play = NEW MTGGuiPlay(4, GameObserver::GetInstance());
Add(NEW GuiPhaseBar(GameObserver::GetInstance())); //Add(NEW GuiPhaseBar(GameObserver::GetInstance()));
Add(mActionStack); Add(mActionStack);
Add(mDamageResolver); Add(mDamageResolver);
Add(actionLayer); Add(actionLayer);
@@ -44,22 +44,22 @@ void DuelLayers::init(){
ActionStack * DuelLayers::stackLayer(){ ActionStack * DuelLayers::stackLayer(){
return ((ActionStack *) (objects[1])); return ((ActionStack *) (objects[0]));
} }
DamageResolverLayer * DuelLayers::combatLayer(){ DamageResolverLayer * DuelLayers::combatLayer(){
return ((DamageResolverLayer *) (objects[2])); return ((DamageResolverLayer *) (objects[1]));
} }
ActionLayer * DuelLayers::actionLayer(){ ActionLayer * DuelLayers::actionLayer(){
return ((ActionLayer *) (objects[3])); return ((ActionLayer *) (objects[2]));
} }
MTGGuiHand * DuelLayers::handLayer(){ MTGGuiHand * DuelLayers::handLayer(){
return ((MTGGuiHand *) (objects[4])); return ((MTGGuiHand *) (objects[3]));
} }
MTGGuiPlay * DuelLayers::playLayer(){ MTGGuiPlay * DuelLayers::playLayer(){
return ((MTGGuiPlay *) (objects[5])); return ((MTGGuiPlay *) (objects[4]));
} }
+2 -38
View File
@@ -1409,31 +1409,11 @@ void AbilityFactory::addAbilities(int _id, Spell * spell){
} }
break; 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 case 1238: //Cockatrice
{ {
game->addObserver(NEW AOldSchoolDeathtouch(_id,card)); game->addObserver(NEW AOldSchoolDeathtouch(_id,card));
break; 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 case 1362: //Reverse polarity
{ {
ActionStack * as = game->mLayers->stackLayer(); ActionStack * as = game->mLayers->stackLayer();
@@ -1475,11 +1455,6 @@ void AbilityFactory::addAbilities(int _id, Spell * spell){
} }
break; break;
} }
case 1371: //White Ward
{
game->addObserver(NEW AProtectionFrom( _id,card, card->target, Constants::MTG_COLOR_WHITE));
break;
}
//Addons Legends //Addons Legends
case 1427: //Abomination (does not work make the game crash) 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 * 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 * The main reason is that classes that add an ability to a card do NOT create these objects, and therefore do NOT
* Work. * 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 * 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]){ if (card->basicAbilities[Constants::EXALTED]){
game->addObserver(NEW AExalted(_id, card)); 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 // Tested works the first r10 did not function because of the mistake in the array of the definition
if (card->basicAbilities[Constants::FORESTHOME]){ if (card->basicAbilities[Constants::FORESTHOME]){
game->addObserver(NEW AStrongLandLinkCreature(_id, card, "forest")); game->addObserver(NEW AStrongLandLinkCreature(_id, card, "forest"));
+6
View File
@@ -567,6 +567,12 @@ int MTGCardInstance::removeProtection(CardDescriptor * cd, int erase){
} }
int MTGCardInstance::protectedAgainst(MTGCardInstance * card){ 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++){ for (int i = 0; i < nbprotections ; i++){
if (protections[i]->match(card)) return 1; if (protections[i]->match(card)) return 1;
} }
+4 -8
View File
@@ -369,14 +369,10 @@ MTGCardInstance * MTGInPlay::getNextAttacker(MTGCardInstance * previous){
void MTGInPlay::untapAll(){ void MTGInPlay::untapAll(){
int i; int i;
for (i = 0; i < nb_cards; i ++){ for (i = 0; i < nb_cards; i ++){
cards[i]->setUntapping(); MTGCardInstance * card = cards[i];
if (cards[i]->getUntapBlockers()->isEmpty()){ card->setUntapping();
#if defined (WIN32) || defined (LINUX) if (!card->basicAbilities[Constants::DOESNOTUNTAP] && card->getUntapBlockers()->isEmpty()){
char buf[4096]; card->attemptUntap();
sprintf(buf, "Can untap %s\n", cards[i]->getName());
OutputDebugString(buf);
#endif
cards[i]->attemptUntap();
} }
} }
} }