Erwan
- Added deathtouch (TODO: update Combat rules for damage on multiple blockers) - Added intimidate (untested)
This commit is contained in:
@@ -612,6 +612,18 @@ subtype=Elemental Shapeshifter
|
|||||||
toughness=4
|
toughness=4
|
||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
|
text=Toxic Iguanar has deathtouch as long as you control a green permanent. (Whenever it deals damage to a creature, destroy that creature.)
|
||||||
|
id=170956
|
||||||
|
name=Toxic Iguanar
|
||||||
|
auto=aslongas(*[green]|mybattlefield) deathtouch
|
||||||
|
rarity=C
|
||||||
|
type=Creature
|
||||||
|
mana={R}
|
||||||
|
power=1
|
||||||
|
subtype=Lizard
|
||||||
|
toughness=1
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
text=When Tukatongue Thallid is put into a graveyard from play, put a 1/1 green Saproling creature token into play.
|
text=When Tukatongue Thallid is put into a graveyard from play, put a 1/1 green Saproling creature token into play.
|
||||||
auto=@movedTo(this|graveyard):token(Saproling,creature Saproling,1/1,green)
|
auto=@movedTo(this|graveyard):token(Saproling,creature Saproling,1/1,green)
|
||||||
id=184995
|
id=184995
|
||||||
|
|||||||
@@ -2,8 +2,7 @@
|
|||||||
#Generic engine features
|
#Generic engine features
|
||||||
########################
|
########################
|
||||||
generic/attacks_each_turn.txt
|
generic/attacks_each_turn.txt
|
||||||
generic/m10_blockers.txt
|
generic/deathtouch.txt
|
||||||
generic/m10_blockers2.txt
|
|
||||||
generic/first_strike.txt
|
generic/first_strike.txt
|
||||||
generic/first_strike2.txt
|
generic/first_strike2.txt
|
||||||
generic/first_strike3.txt
|
generic/first_strike3.txt
|
||||||
@@ -12,6 +11,8 @@ generic/hybrid_mana_2.txt
|
|||||||
generic/hybrid_mana_3.txt
|
generic/hybrid_mana_3.txt
|
||||||
generic/legendary.txt
|
generic/legendary.txt
|
||||||
generic/lifelink.txt
|
generic/lifelink.txt
|
||||||
|
generic/m10_blockers.txt
|
||||||
|
generic/m10_blockers2.txt
|
||||||
generic/persist.txt
|
generic/persist.txt
|
||||||
generic/persist2.txt
|
generic/persist2.txt
|
||||||
generic/persist3.txt
|
generic/persist3.txt
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
#Testing Deathtouch
|
||||||
|
[INIT]
|
||||||
|
COMBATATTACKERS
|
||||||
|
[PLAYER1]
|
||||||
|
inplay:Toxic Iguanar,grizzly bears
|
||||||
|
[PLAYER2]
|
||||||
|
inplay:wall of fire
|
||||||
|
[DO]
|
||||||
|
Toxic Iguanar
|
||||||
|
next
|
||||||
|
#blockers
|
||||||
|
wall of fire
|
||||||
|
next
|
||||||
|
#damage
|
||||||
|
next
|
||||||
|
#combat end
|
||||||
|
[ASSERT]
|
||||||
|
COMBATEND
|
||||||
|
[PLAYER1]
|
||||||
|
inplay:Toxic Iguanar,grizzly bears
|
||||||
|
[PLAYER2]
|
||||||
|
graveyard:wall of fire
|
||||||
|
[END]
|
||||||
@@ -95,11 +95,13 @@ class Constants
|
|||||||
CANTATTACK = 37,
|
CANTATTACK = 37,
|
||||||
MUSTATTACK = 38,
|
MUSTATTACK = 38,
|
||||||
CANTBLOCK = 39,
|
CANTBLOCK = 39,
|
||||||
DOESNOTUNTAP =40,
|
DOESNOTUNTAP = 40,
|
||||||
OPPONENTSHROUD=41,
|
OPPONENTSHROUD = 41,
|
||||||
INDESTRUCTIBLE=42,
|
INDESTRUCTIBLE = 42,
|
||||||
|
INTIMIDATE = 43,
|
||||||
|
DEATHTOUCH = 44,
|
||||||
|
|
||||||
NB_BASIC_ABILITIES = 43,
|
NB_BASIC_ABILITIES = 45,
|
||||||
|
|
||||||
|
|
||||||
RARITY_M = 'M',
|
RARITY_M = 'M',
|
||||||
|
|||||||
@@ -112,6 +112,19 @@ class MTGLifelinkRule:public MTGAbility{
|
|||||||
virtual MTGLifelinkRule * clone() const;
|
virtual MTGLifelinkRule * clone() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* Deathtouch */
|
||||||
|
class MTGDeathtouchRule:public MTGAbility{
|
||||||
|
public:
|
||||||
|
MTGDeathtouchRule(int _id);
|
||||||
|
|
||||||
|
int receiveEvent(WEvent * event);
|
||||||
|
|
||||||
|
int testDestroy();
|
||||||
|
const char * getMenuText(){return "Deathtouch";}
|
||||||
|
|
||||||
|
virtual MTGDeathtouchRule * clone() const;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/* HUD Display */
|
/* HUD Display */
|
||||||
|
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ void DuelLayers::init(){
|
|||||||
action->Add(NEW MTGLegendRule(-1));
|
action->Add(NEW MTGLegendRule(-1));
|
||||||
action->Add(NEW MTGPersistRule(-1));
|
action->Add(NEW MTGPersistRule(-1));
|
||||||
action->Add(NEW MTGLifelinkRule(-1));
|
action->Add(NEW MTGLifelinkRule(-1));
|
||||||
|
action->Add(NEW MTGDeathtouchRule(-1));
|
||||||
//Other display elements
|
//Other display elements
|
||||||
action->Add(NEW HUDDisplay(-1));
|
action->Add(NEW HUDDisplay(-1));
|
||||||
|
|
||||||
|
|||||||
@@ -343,6 +343,19 @@ int MTGCardInstance::canBlock(MTGCardInstance * opponent){
|
|||||||
if (opponent->protectedAgainst(this)) return 0;
|
if (opponent->protectedAgainst(this)) return 0;
|
||||||
if (opponent->basicAbilities[Constants::UNBLOCKABLE]) return 0;
|
if (opponent->basicAbilities[Constants::UNBLOCKABLE]) return 0;
|
||||||
if (opponent->basicAbilities[Constants::FEAR] && !(hasColor(Constants::MTG_COLOR_ARTIFACT) || hasColor(Constants::MTG_COLOR_BLACK))) return 0;
|
if (opponent->basicAbilities[Constants::FEAR] && !(hasColor(Constants::MTG_COLOR_ARTIFACT) || hasColor(Constants::MTG_COLOR_BLACK))) return 0;
|
||||||
|
|
||||||
|
//intimidate
|
||||||
|
if (opponent->basicAbilities[Constants::INTIMIDATE] && !(hasColor(Constants::MTG_COLOR_ARTIFACT))){
|
||||||
|
int canblock = 0;
|
||||||
|
for (int i = Constants::PROTECTIONGREEN; i <= Constants::PROTECTIONWHITE; ++i){
|
||||||
|
if(hasColor(i) && opponent->hasColor(i)){
|
||||||
|
canblock = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!canblock) return 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (opponent->basicAbilities[Constants::FLYING] && !( basicAbilities[Constants::FLYING] || basicAbilities[Constants::REACH])) return 0;
|
if (opponent->basicAbilities[Constants::FLYING] && !( basicAbilities[Constants::FLYING] || basicAbilities[Constants::REACH])) return 0;
|
||||||
//Can block only creatures with flying if has cloud
|
//Can block only creatures with flying if has cloud
|
||||||
if (basicAbilities[Constants::CLOUD] && !( opponent->basicAbilities[Constants::FLYING])) return 0;
|
if (basicAbilities[Constants::CLOUD] && !( opponent->basicAbilities[Constants::FLYING])) return 0;
|
||||||
|
|||||||
@@ -51,6 +51,8 @@ const char* Constants::MTGBasicAbilities[] = {
|
|||||||
"doesnotuntap",
|
"doesnotuntap",
|
||||||
"opponentshroud",
|
"opponentshroud",
|
||||||
"indestructible",
|
"indestructible",
|
||||||
|
"intimidate",
|
||||||
|
"deathtouch"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -169,6 +169,8 @@ int MTGBlockRule::reactToClick(MTGCardInstance * card){
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//The Block rule is never destroyed
|
//The Block rule is never destroyed
|
||||||
int MTGBlockRule::testDestroy(){
|
int MTGBlockRule::testDestroy(){
|
||||||
return 0;
|
return 0;
|
||||||
@@ -526,3 +528,38 @@ HUDDisplay::~HUDDisplay(){
|
|||||||
a->isClone = 1;
|
a->isClone = 1;
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Deathtouch */
|
||||||
|
MTGDeathtouchRule::MTGDeathtouchRule(int _id):MTGAbility(_id,NULL){};
|
||||||
|
|
||||||
|
int MTGDeathtouchRule::receiveEvent(WEvent * event){
|
||||||
|
if (event->type == WEvent::DAMAGE){
|
||||||
|
WEventDamage * e = (WEventDamage *) event;
|
||||||
|
|
||||||
|
Damage * d = e->damage;
|
||||||
|
if (d->damage <= 0) return 0;
|
||||||
|
|
||||||
|
MTGCardInstance * card = d->source;
|
||||||
|
if (!card) return 0;
|
||||||
|
|
||||||
|
if (d->target->type_as_damageable != DAMAGEABLE_MTGCARDINSTANCE) return 0;
|
||||||
|
MTGCardInstance * _target = (MTGCardInstance *) (d->target);
|
||||||
|
|
||||||
|
if (card->basicAbilities[Constants::DEATHTOUCH]){
|
||||||
|
_target->destroy();
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int MTGDeathtouchRule::testDestroy(){return 0;}
|
||||||
|
|
||||||
|
|
||||||
|
MTGDeathtouchRule * MTGDeathtouchRule::clone() const{
|
||||||
|
MTGDeathtouchRule * a = NEW MTGDeathtouchRule(*this);
|
||||||
|
a->isClone = 1;
|
||||||
|
return a;
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user