add nonCombatDamage count

This commit is contained in:
Anthony Calosa
2016-08-04 09:56:53 +08:00
parent 8ba97b8a74
commit 1ab88940f9
6 changed files with 19 additions and 1 deletions
+1 -1
View File
@@ -11382,7 +11382,7 @@ toughness=2
[/card] [/card]
[card] [card]
name=Bloodcrazed Goblin name=Bloodcrazed Goblin
auto=this(opponentdamagecount <1) cantattack auto=this(variable{odnoncount}<1) cantattack
text=Bloodcrazed Goblin can't attack unless an opponent was dealt noncombat damage this turn. text=Bloodcrazed Goblin can't attack unless an opponent was dealt noncombat damage this turn.
mana={R} mana={R}
type=Creature type=Creature
+8
View File
@@ -690,6 +690,14 @@ private:
{ {
intValue = target->controller()->opponent()->damageCount; intValue = target->controller()->opponent()->damageCount;
} }
else if (s == "pdnoncount")
{
intValue = target->controller()->nonCombatDamage;
}
else if (s == "odnoncount")
{
intValue = target->controller()->opponent()->nonCombatDamage;
}
else if (s == "playerpoisoncount") else if (s == "playerpoisoncount")
{ {
intValue = target->controller()->poisonCount; intValue = target->controller()->poisonCount;
+1
View File
@@ -24,6 +24,7 @@ public:
int handsize; int handsize;
int poisonCount; int poisonCount;
int damageCount; int damageCount;
int nonCombatDamage;
int preventable; int preventable;
int thatmuch; int thatmuch;
int lifeLostThisTurn; int lifeLostThisTurn;
+6
View File
@@ -184,6 +184,8 @@ int Damage::resolve()
if(!_target->inPlay()->hasAbility(Constants::POISONSHROUD)) if(!_target->inPlay()->hasAbility(Constants::POISONSHROUD))
_target->poisonCount += damage;//this will be changed to poison counters. _target->poisonCount += damage;//this will be changed to poison counters.
_target->damageCount += damage; _target->damageCount += damage;
if(typeOfDamage == 2)
target->nonCombatDamage += damage;
if ( typeOfDamage == 1 && target == source->controller()->opponent() )//add vector prowledtypes. if ( typeOfDamage == 1 && target == source->controller()->opponent() )//add vector prowledtypes.
{ {
vector<string> values = MTGAllCards::getCreatureValuesById(); vector<string> values = MTGAllCards::getCreatureValuesById();
@@ -202,6 +204,8 @@ int Damage::resolve()
if(!_target->inPlay()->hasAbility(Constants::CANTCHANGELIFE)) if(!_target->inPlay()->hasAbility(Constants::CANTCHANGELIFE))
a = target->dealDamage(damage); a = target->dealDamage(damage);
target->damageCount += damage; target->damageCount += damage;
if(typeOfDamage == 2)
target->nonCombatDamage += damage;
if ( typeOfDamage == 1 && target == source->controller()->opponent() )//add vector prowledtypes. if ( typeOfDamage == 1 && target == source->controller()->opponent() )//add vector prowledtypes.
{ {
vector<string> values = MTGAllCards::getCreatureValuesById(); vector<string> values = MTGAllCards::getCreatureValuesById();
@@ -237,6 +241,8 @@ int Damage::resolve()
else else
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(typeOfDamage == 2)
target->nonCombatDamage += damage;
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; ((MTGCardInstance*)source)->damageToCreature = true;
+2
View File
@@ -211,11 +211,13 @@ void GameObserver::nextGamePhase()
{ {
cleanupPhase(); cleanupPhase();
currentPlayer->damageCount = 0; currentPlayer->damageCount = 0;
currentPlayer->nonCombatDamage = 0;
currentPlayer->drawCounter = 0; currentPlayer->drawCounter = 0;
currentPlayer->raidcount = 0; currentPlayer->raidcount = 0;
currentPlayer->opponent()->raidcount = 0; currentPlayer->opponent()->raidcount = 0;
currentPlayer->prowledTypes.clear(); currentPlayer->prowledTypes.clear();
currentPlayer->opponent()->damageCount = 0; //added to clear odcount currentPlayer->opponent()->damageCount = 0; //added to clear odcount
currentPlayer->opponent()->nonCombatDamage = 0;
currentPlayer->preventable = 0; currentPlayer->preventable = 0;
mLayers->actionLayer()->cleanGarbage(); //clean abilities history for this turn; mLayers->actionLayer()->cleanGarbage(); //clean abilities history for this turn;
mLayers->stackLayer()->garbageCollect(); //clean stack history for this turn; mLayers->stackLayer()->garbageCollect(); //clean stack history for this turn;
+1
View File
@@ -26,6 +26,7 @@ Player::Player(GameObserver *observer, string file, string fileSmall, MTGDeck *
nomaxhandsize = false; nomaxhandsize = false;
poisonCount = 0; poisonCount = 0;
damageCount = 0; damageCount = 0;
nonCombatDamage = 0;
preventable = 0; preventable = 0;
mAvatarTex = NULL; mAvatarTex = NULL;
type_as_damageable = DAMAGEABLE_PLAYER; type_as_damageable = DAMAGEABLE_PLAYER;