Made damager keyword work. Fixed Executioner's Swing in mtg.txt
This commit is contained in:
@@ -28204,7 +28204,7 @@ subtype=Equipment
|
|||||||
[card]
|
[card]
|
||||||
name=Executioner's Swing
|
name=Executioner's Swing
|
||||||
text=Target creature that dealt damage this turn gets -5/-5 until end of turn.
|
text=Target creature that dealt damage this turn gets -5/-5 until end of turn.
|
||||||
target=creature[damaged]
|
target=creature[damager]
|
||||||
auto=-5/-5 ueot
|
auto=-5/-5 ueot
|
||||||
mana={W}{B}
|
mana={W}{B}
|
||||||
type=Instant
|
type=Instant
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ class CardDescriptor: public MTGCardInstance
|
|||||||
string compareName;
|
string compareName;
|
||||||
int CDopponentDamaged;
|
int CDopponentDamaged;
|
||||||
int CDcontrollerDamaged;
|
int CDcontrollerDamaged;
|
||||||
|
int CDdamager;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ public:
|
|||||||
bool wasDealtDamage;
|
bool wasDealtDamage;
|
||||||
bool damageToOpponent;
|
bool damageToOpponent;
|
||||||
bool damageToController;
|
bool damageToController;
|
||||||
|
bool damageToCreature;
|
||||||
bool mPropertiesChangedSinceLastUpdate;
|
bool mPropertiesChangedSinceLastUpdate;
|
||||||
int reduxamount;
|
int reduxamount;
|
||||||
int flanked;
|
int flanked;
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ CardDescriptor::CardDescriptor()
|
|||||||
colorComparisonMode = COMPARISON_NONE;
|
colorComparisonMode = COMPARISON_NONE;
|
||||||
CDopponentDamaged = 0;
|
CDopponentDamaged = 0;
|
||||||
CDcontrollerDamaged = 0;
|
CDcontrollerDamaged = 0;
|
||||||
|
CDdamager = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CardDescriptor::init()
|
int CardDescriptor::init()
|
||||||
@@ -226,6 +227,12 @@ MTGCardInstance * CardDescriptor::match(MTGCardInstance * card)
|
|||||||
{
|
{
|
||||||
match = NULL;
|
match = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((CDdamager == -1 && (card->damageToOpponent || card->damageToController || card->damageToCreature)) || (CDdamager == 1 && !(card->damageToOpponent || card->damageToController || card->damageToCreature)))
|
||||||
|
{
|
||||||
|
match = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if(CDopponentDamaged == -1 || CDopponentDamaged == 1)
|
if(CDopponentDamaged == -1 || CDopponentDamaged == 1)
|
||||||
{
|
{
|
||||||
Player * p = card->controller()->opponent();//controller()->opponent();
|
Player * p = card->controller()->opponent();//controller()->opponent();
|
||||||
|
|||||||
@@ -1224,6 +1224,14 @@ bool CardGui::FilterCard(MTGCard * _card,string filter)
|
|||||||
cd.CDcontrollerDamaged = 1;
|
cd.CDcontrollerDamaged = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//creature dealt damage to anything
|
||||||
|
else if (attribute.find("damager") != string::npos){
|
||||||
|
if (minus){
|
||||||
|
cd.CDdamager = -1;
|
||||||
|
} else {
|
||||||
|
cd.CDdamager = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
else if (attribute.find("multicolor") != string::npos)
|
else if (attribute.find("multicolor") != string::npos)
|
||||||
{
|
{
|
||||||
//card is multicolored?
|
//card is multicolored?
|
||||||
|
|||||||
@@ -192,8 +192,10 @@ int Damage::resolve()
|
|||||||
//return the left over amount after effects have been applied to them.
|
//return the left over amount after effects have been applied to them.
|
||||||
a = target->dealDamage(damage);
|
a = target->dealDamage(damage);
|
||||||
target->damageCount += damage;//the amount must be the actual damage so i changed this from 1 to damage, this fixes pdcount and odcount
|
target->damageCount += damage;//the amount must be the actual damage so i changed this from 1 to damage, this fixes pdcount and odcount
|
||||||
if (target->type_as_damageable == Damageable::DAMAGEABLE_MTGCARDINSTANCE)
|
if (target->type_as_damageable == Damageable::DAMAGEABLE_MTGCARDINSTANCE){
|
||||||
((MTGCardInstance*)target)->wasDealtDamage = true;
|
((MTGCardInstance*)target)->wasDealtDamage = true;
|
||||||
|
((MTGCardInstance*)source)->damageToCreature = true;
|
||||||
|
}
|
||||||
if (target->type_as_damageable == Damageable::DAMAGEABLE_PLAYER)
|
if (target->type_as_damageable == Damageable::DAMAGEABLE_PLAYER)
|
||||||
{
|
{
|
||||||
if(target == source->controller())
|
if(target == source->controller())
|
||||||
|
|||||||
@@ -795,6 +795,7 @@ void GameObserver::gameStateBasedEffects()
|
|||||||
c->wasDealtDamage = false;
|
c->wasDealtDamage = false;
|
||||||
c->damageToController = false;
|
c->damageToController = false;
|
||||||
c->damageToOpponent = false;
|
c->damageToOpponent = false;
|
||||||
|
c->damageToCreature = false;
|
||||||
c->isAttacking = NULL;
|
c->isAttacking = NULL;
|
||||||
}
|
}
|
||||||
for (int t = 0; t < nbcards; t++)
|
for (int t = 0; t < nbcards; t++)
|
||||||
|
|||||||
@@ -158,6 +158,7 @@ void MTGCardInstance::initMTGCI()
|
|||||||
auras = 0;
|
auras = 0;
|
||||||
damageToOpponent = false;
|
damageToOpponent = false;
|
||||||
damageToController = false;
|
damageToController = false;
|
||||||
|
damageToCreature = false;
|
||||||
wasDealtDamage = false;
|
wasDealtDamage = false;
|
||||||
isDualWielding = false;
|
isDualWielding = false;
|
||||||
suspended = false;
|
suspended = false;
|
||||||
|
|||||||
@@ -485,6 +485,14 @@ TargetChooser * TargetChooserFactory::createTargetChooser(string s, MTGCardInsta
|
|||||||
cd->CDcontrollerDamaged = 1;
|
cd->CDcontrollerDamaged = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//creature dealt damage to anything
|
||||||
|
else if (attribute.find("damager") != string::npos){
|
||||||
|
if (minus){
|
||||||
|
cd->CDdamager = -1;
|
||||||
|
} else {
|
||||||
|
cd->CDdamager = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
else if (attribute.find("multicolor") != string::npos)
|
else if (attribute.find("multicolor") != string::npos)
|
||||||
{
|
{
|
||||||
//card is multicolored?
|
//card is multicolored?
|
||||||
|
|||||||
Reference in New Issue
Block a user