Erwan
- 2 new ability keywords: mustattack and cantattack
This commit is contained in:
@@ -213,6 +213,19 @@ type=Sorcery
|
|||||||
mana={X}{R}
|
mana={X}{R}
|
||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
|
text=Bloodrock Cyclops attacks each turn if able.
|
||||||
|
abilities=mustattack
|
||||||
|
id=130384
|
||||||
|
name=Bloodrock Cyclops
|
||||||
|
rarity=C
|
||||||
|
color=Red
|
||||||
|
type=Creature
|
||||||
|
mana={2}{R}
|
||||||
|
power=3
|
||||||
|
subtype=Cyclops
|
||||||
|
toughness=3
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
text=Swampwalk (This creature is unblockable as long as defending player controls a Swamp.)
|
text=Swampwalk (This creature is unblockable as long as defending player controls a Swamp.)
|
||||||
abilities=swampwalk
|
abilities=swampwalk
|
||||||
id=129491
|
id=129491
|
||||||
|
|||||||
@@ -195,18 +195,7 @@ power=6
|
|||||||
subtype=Giant
|
subtype=Giant
|
||||||
toughness=6
|
toughness=6
|
||||||
[/card]
|
[/card]
|
||||||
[card]
|
|
||||||
text=Bloodrock Cyclops attacks each turn if able.
|
|
||||||
id=130384
|
|
||||||
name=Bloodrock Cyclops
|
|
||||||
rarity=C
|
|
||||||
color=Red
|
|
||||||
type=Creature
|
|
||||||
mana={2}{R}
|
|
||||||
power=3
|
|
||||||
subtype=Cyclops
|
|
||||||
toughness=3
|
|
||||||
[/card]
|
|
||||||
[card]
|
[card]
|
||||||
text=When Bogardan Firefiend is put into a graveyard from play, it deals 2 damage to target creature.
|
text=When Bogardan Firefiend is put into a graveyard from play, it deals 2 damage to target creature.
|
||||||
id=130534
|
id=130534
|
||||||
|
|||||||
@@ -796,6 +796,19 @@ subtype=Bird Skeleton
|
|||||||
toughness=2
|
toughness=2
|
||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
|
text=Steelclad Serpent can't attack unless you control another artifact.
|
||||||
|
abilities=cantattack
|
||||||
|
auto=aslongas(artifact|myinplay) other -cantattack
|
||||||
|
id=175009
|
||||||
|
name=Steelclad Serpent
|
||||||
|
rarity=C
|
||||||
|
type=Artifact Creature
|
||||||
|
mana={5}{U}
|
||||||
|
power=4
|
||||||
|
subtype=Serpent
|
||||||
|
toughness=5
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
text=Vigilance {T}: Add {G} to your mana pool.
|
text=Vigilance {T}: Add {G} to your mana pool.
|
||||||
abilities=vigilance
|
abilities=vigilance
|
||||||
auto={T}:Add{G}
|
auto={T}:Add{G}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
########################
|
########################
|
||||||
#Generic engine features
|
#Generic engine features
|
||||||
########################
|
########################
|
||||||
|
generic/attacks_each_turn.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
|
||||||
@@ -92,6 +93,8 @@ shock.txt
|
|||||||
spark_elemental.txt
|
spark_elemental.txt
|
||||||
spirit_link.txt
|
spirit_link.txt
|
||||||
stasis.txt
|
stasis.txt
|
||||||
|
steelclad_serpent1.txt
|
||||||
|
steelclad_serpent2.txt
|
||||||
sword_to_plowshares.txt
|
sword_to_plowshares.txt
|
||||||
terror.txt
|
terror.txt
|
||||||
tranquil_domain.txt
|
tranquil_domain.txt
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
#Bloodrock Cyclops attacks each turn if able.
|
||||||
|
[INIT]
|
||||||
|
FIRSTMAIN
|
||||||
|
[PLAYER1]
|
||||||
|
inplay:bloodrock cyclops
|
||||||
|
[PLAYER2]
|
||||||
|
[DO]
|
||||||
|
next
|
||||||
|
#combat begin
|
||||||
|
next
|
||||||
|
#attackers
|
||||||
|
next
|
||||||
|
#blockers
|
||||||
|
next
|
||||||
|
#damage
|
||||||
|
next
|
||||||
|
#combat end
|
||||||
|
[ASSERT]
|
||||||
|
COMBATEND
|
||||||
|
[PLAYER1]
|
||||||
|
inplay:bloodrock cyclops
|
||||||
|
[PLAYER2]
|
||||||
|
life:17
|
||||||
|
[END]
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
#Steelclad serpent can't attack unless you control another artifact
|
||||||
|
[INIT]
|
||||||
|
COMBATATTACKERS
|
||||||
|
[PLAYER1]
|
||||||
|
inplay:Steelclad Serpent
|
||||||
|
[PLAYER2]
|
||||||
|
[DO]
|
||||||
|
Steelclad Serpent
|
||||||
|
next
|
||||||
|
next
|
||||||
|
next
|
||||||
|
[ASSERT]
|
||||||
|
COMBATEND
|
||||||
|
[PLAYER1]
|
||||||
|
inplay:Steelclad Serpent
|
||||||
|
[PLAYER2]
|
||||||
|
[END]
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
#Steelclad serpent can't attack unless you control another artifact
|
||||||
|
[INIT]
|
||||||
|
COMBATATTACKERS
|
||||||
|
[PLAYER1]
|
||||||
|
inplay:Steelclad Serpent,black vise
|
||||||
|
[PLAYER2]
|
||||||
|
[DO]
|
||||||
|
Steelclad Serpent
|
||||||
|
next
|
||||||
|
next
|
||||||
|
next
|
||||||
|
[ASSERT]
|
||||||
|
COMBATEND
|
||||||
|
[PLAYER1]
|
||||||
|
inplay:Steelclad Serpent,black vise
|
||||||
|
[PLAYER2]
|
||||||
|
life:16
|
||||||
|
[END]
|
||||||
@@ -921,10 +921,11 @@ class ALord:public ListMaintainerAbility{
|
|||||||
TargetChooser * tc;
|
TargetChooser * tc;
|
||||||
int power, toughness;
|
int power, toughness;
|
||||||
int ability;
|
int ability;
|
||||||
|
int modifier;
|
||||||
ManaCost * regenCost;
|
ManaCost * regenCost;
|
||||||
int includeSelf;
|
int includeSelf;
|
||||||
map<MTGCardInstance *, MTGAbility *> regenerations;
|
map<MTGCardInstance *, MTGAbility *> regenerations;
|
||||||
ALord(int _id, MTGCardInstance * card, TargetChooser * _tc, int _includeSelf, int _power = 0 , int _toughness = 0, int _ability = -1, ManaCost * _regenCost = NULL):ListMaintainerAbility(_id,card){
|
ALord(int _id, MTGCardInstance * card, TargetChooser * _tc, int _includeSelf, int _power = 0 , int _toughness = 0, int _ability = -1, ManaCost * _regenCost = NULL, int _modifier = 1):ListMaintainerAbility(_id,card){
|
||||||
tc = _tc;
|
tc = _tc;
|
||||||
tc->source = NULL;
|
tc->source = NULL;
|
||||||
includeSelf = _includeSelf;
|
includeSelf = _includeSelf;
|
||||||
@@ -932,6 +933,8 @@ class ALord:public ListMaintainerAbility{
|
|||||||
toughness = _toughness;
|
toughness = _toughness;
|
||||||
ability = _ability;
|
ability = _ability;
|
||||||
regenCost = _regenCost;
|
regenCost = _regenCost;
|
||||||
|
modifier = _modifier;
|
||||||
|
if (!modifier) modifier = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int canBeInList(MTGCardInstance * card){
|
int canBeInList(MTGCardInstance * card){
|
||||||
@@ -942,7 +945,7 @@ class ALord:public ListMaintainerAbility{
|
|||||||
int added(MTGCardInstance * card){
|
int added(MTGCardInstance * card){
|
||||||
card->power += power;
|
card->power += power;
|
||||||
card->addToToughness(toughness);
|
card->addToToughness(toughness);
|
||||||
if (ability != -1) card->basicAbilities[ability] +=1;
|
if (ability != -1) card->basicAbilities[ability] +=modifier;
|
||||||
if (regenCost){
|
if (regenCost){
|
||||||
ManaCost * _regenCost = NEW ManaCost(regenCost);
|
ManaCost * _regenCost = NEW ManaCost(regenCost);
|
||||||
AStandardRegenerate * regen = NEW AStandardRegenerate(0, card, card, _regenCost);
|
AStandardRegenerate * regen = NEW AStandardRegenerate(0, card, card, _regenCost);
|
||||||
@@ -955,7 +958,7 @@ class ALord:public ListMaintainerAbility{
|
|||||||
int removed(MTGCardInstance * card){
|
int removed(MTGCardInstance * card){
|
||||||
card->power -= power;
|
card->power -= power;
|
||||||
card->addToToughness(-toughness);
|
card->addToToughness(-toughness);
|
||||||
if (ability != -1 && card->basicAbilities[ability]) card->basicAbilities[ability] -=1;
|
if (ability != -1 && ((card->basicAbilities[ability]>0 && (modifier >0)) || (card->basicAbilities[ability]<=0 && (modifier <0)) )) card->basicAbilities[ability] -=modifier;
|
||||||
if (regenCost){
|
if (regenCost){
|
||||||
if(regenerations.find(card) != regenerations.end()){
|
if(regenerations.find(card) != regenerations.end()){
|
||||||
if (game->isInPlay(card)) game->removeObserver(regenerations[card]);
|
if (game->isInPlay(card)) game->removeObserver(regenerations[card]);
|
||||||
@@ -2720,13 +2723,16 @@ class AKirdApe:public ListMaintainerAbility{
|
|||||||
int power;
|
int power;
|
||||||
int toughness;
|
int toughness;
|
||||||
int ability;
|
int ability;
|
||||||
|
int modifier;
|
||||||
int includeSelf;
|
int includeSelf;
|
||||||
AKirdApe(int _id, MTGCardInstance * _source, TargetChooser * _tc, int _includeSelf,int _power = 0, int _toughness = 0, int _ability=-1):ListMaintainerAbility(_id, _source){
|
AKirdApe(int _id, MTGCardInstance * _source, TargetChooser * _tc, int _includeSelf,int _power = 0, int _toughness = 0, int _ability=-1, int _abilityModifier = 1):ListMaintainerAbility(_id, _source){
|
||||||
power = _power;
|
power = _power;
|
||||||
toughness = _toughness;
|
toughness = _toughness;
|
||||||
tc = _tc;
|
tc = _tc;
|
||||||
includeSelf = _includeSelf;
|
includeSelf = _includeSelf;
|
||||||
ability=_ability;
|
ability=_ability;
|
||||||
|
modifier = _abilityModifier;
|
||||||
|
if (!modifier) modifier = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int canBeInList(MTGCardInstance * card){
|
int canBeInList(MTGCardInstance * card){
|
||||||
@@ -2738,7 +2744,7 @@ class AKirdApe:public ListMaintainerAbility{
|
|||||||
if (cards.size()== 1){
|
if (cards.size()== 1){
|
||||||
source->power+=power;
|
source->power+=power;
|
||||||
source->addToToughness(toughness);
|
source->addToToughness(toughness);
|
||||||
if (ability != -1) source->basicAbilities[ability] +=1;
|
if (ability != -1) source->basicAbilities[ability] +=modifier;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
@@ -2749,7 +2755,7 @@ class AKirdApe:public ListMaintainerAbility{
|
|||||||
if (cards.size()== 0){
|
if (cards.size()== 0){
|
||||||
source->power-=power;
|
source->power-=power;
|
||||||
source->addToToughness(-toughness);
|
source->addToToughness(-toughness);
|
||||||
if ((ability != -1) && source->basicAbilities[ability] >0 ) source->basicAbilities[ability] -=1;
|
if ((ability != -1) && source->basicAbilities[ability] >0 ) source->basicAbilities[ability] -=modifier;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ class MTGAttackRule:public MTGAbility{
|
|||||||
int testDestroy();
|
int testDestroy();
|
||||||
MTGAttackRule(int _id);
|
MTGAttackRule(int _id);
|
||||||
const char * getMenuText(){return "Attacker";}
|
const char * getMenuText(){return "Attacker";}
|
||||||
|
void Update(float dt);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -598,9 +598,9 @@ int AbilityFactory::magicText(int id, Spell * spell, MTGCardInstance * card){
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (lordType == PARSER_LORD){
|
if (lordType == PARSER_LORD){
|
||||||
game->addObserver(NEW ALord(id,card,lordTargets,lordIncludeSelf,0,0,j));
|
game->addObserver(NEW ALord(id,card,lordTargets,lordIncludeSelf,0,0,j,0,modifier));
|
||||||
}else if (lordType == PARSER_ASLONGAS){
|
}else if (lordType == PARSER_ASLONGAS){
|
||||||
game->addObserver(NEW AKirdApe(id,card,lordTargets,lordIncludeSelf,0,0,j));
|
game->addObserver(NEW AKirdApe(id,card,lordTargets,lordIncludeSelf,0,0,j,modifier));
|
||||||
}else{
|
}else{
|
||||||
if (tc){
|
if (tc){
|
||||||
game->addObserver(NEW ABasicAbilityModifierUntilEOT(id, card, j, cost,tc, modifier));
|
game->addObserver(NEW ABasicAbilityModifierUntilEOT(id, card, j, cost,tc, modifier));
|
||||||
|
|||||||
@@ -272,9 +272,11 @@ Player * MTGCardInstance::controller(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
int MTGCardInstance::canAttack(){
|
int MTGCardInstance::canAttack(){
|
||||||
if (!hasSummoningSickness() && !tapped && isACreature() && basicAbilities[Constants::DEFENSER] !=1)
|
if (tapped) return 0;
|
||||||
|
if (hasSummoningSickness()) return 0;
|
||||||
|
if (basicAbilities[Constants::DEFENSER] || basicAbilities[Constants::CANTATTACK]) return 0;
|
||||||
|
if (!isACreature()) return 0;
|
||||||
return 1;
|
return 1;
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -88,6 +88,18 @@ int MTGAttackRule::isReactingToClick(MTGCardInstance * card, ManaCost * mana){
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MTGAttackRule::Update(float dt){
|
||||||
|
if (currentPhase != newPhase && currentPhase == Constants::MTG_PHASE_COMBATATTACKERS){
|
||||||
|
Player * p = game->currentPlayer;
|
||||||
|
MTGGameZone * z = p->game->inPlay;
|
||||||
|
for (int i= 0; i < z->nb_cards; i++){
|
||||||
|
MTGCardInstance * card = z->cards[i];
|
||||||
|
if (!card->isAttacker() && card->has(Constants::MUSTATTACK)) reactToClick(card);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
MTGAbility::Update(dt);
|
||||||
|
}
|
||||||
|
|
||||||
int MTGAttackRule::reactToClick(MTGCardInstance * card){
|
int MTGAttackRule::reactToClick(MTGCardInstance * card){
|
||||||
if (!isReactingToClick(card)) return 0;
|
if (!isReactingToClick(card)) return 0;
|
||||||
card->attacker = 1;
|
card->attacker = 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user