- Fixed Shadow Ability now works properly

- Added Generic KirdApe give P/W modifier when cards inplay
 - Added Rampage (WIP) does not work at the moment
 - Added Cards from diverse Sets
This commit is contained in:
laurent.rabouin
2008-11-12 08:23:39 +00:00
parent 90238d8269
commit 6ad6f9b668
5 changed files with 419 additions and 157 deletions
+3 -5
View File
@@ -233,23 +233,22 @@ int MTGCardInstance::setToughness(int value){
int MTGCardInstance::canBlock(){
if (!tapped && isACreature())return 1;
if (!basicAbilities[SHADOW]&& isACreature()) return 1; // Try to add shadow
return 0;
}
int MTGCardInstance::canBlock(MTGCardInstance * opponent){
if (!canBlock()) return 0;
if (!opponent) return 1;
if (!opponent->isAttacker()) return 0;
// Comprehensive rule 502.7f : If a creature with protection attacks, it can't be blocked by creatures that have the stated quality.
if (opponent->protectedAgainst(this)) return 0;
if (opponent->basicAbilities[UNBLOCKABLE]) return 0;
if (opponent->basicAbilities[FEAR] && !(hasColor(MTG_COLOR_ARTIFACT) || hasColor(MTG_COLOR_BLACK))) return 0;
if (opponent->basicAbilities[FLYING] && !( basicAbilities[FLYING] || basicAbilities[REACH])) return 0;
// If opponent has shadow and a creature does not have either shadow or reachshadow it cannot be blocked
if (opponent->basicAbilities[SHADOW] && !( basicAbilities[SHADOW] || basicAbilities[REACHSHADOW])) return 0;
// If opponent does not have shadow and a creature has shadow it cannot be blocked
if (!opponent->basicAbilities[SHADOW] && basicAbilities[SHADOW]) return 0;
if (opponent->basicAbilities[SWAMPWALK] && controller()->game->inPlay->hasType("swamp")) return 0;
if (opponent->basicAbilities[FORESTWALK] && controller()->game->inPlay->hasType("forest")) return 0;
if (opponent->basicAbilities[ISLANDWALK] && controller()->game->inPlay->hasType("island")) return 0;
@@ -258,7 +257,6 @@ int MTGCardInstance::canBlock(MTGCardInstance * opponent){
return 1;
}
MTGCardInstance * MTGCardInstance::getNextPartner(){
MTGInPlay * inplay = controller()->game->inPlay;
MTGCardInstance * bandingPartner = inplay->getNextAttacker(banding);