* fixed some formatting
* pruned out unused local variables. ---- There's no need to define something if it isn't going to be referenced. It consumes extra memory temporarily and more than anything is a potential cause for confusion down the road.
This commit is contained in:
@@ -101,7 +101,7 @@ void DestroyGame(void)
|
||||
return self;
|
||||
}
|
||||
|
||||
-(id)initialize {
|
||||
- (id)initialize {
|
||||
|
||||
NSLog(@"EAGL View - initialize EAGL");
|
||||
|
||||
|
||||
@@ -4559,7 +4559,6 @@ public:
|
||||
{
|
||||
|
||||
Interruptible * action = game->mLayers->stackLayer()->getAt(-1);
|
||||
Spell * spell = (Spell *) action;
|
||||
AADrawer * draw = dynamic_cast <AADrawer *> (action);
|
||||
if (draw && draw->aType == MTGAbility::STANDARD_DRAW)
|
||||
return 1;
|
||||
|
||||
@@ -910,7 +910,7 @@ AAMorph * AAMorph::clone() const
|
||||
}
|
||||
// AADYNAMIC: dynamic ability builder
|
||||
AADynamic::AADynamic(int id, MTGCardInstance * card, Damageable * _target,int type,int effect,int who,int amountsource,MTGAbility * storedAbility, ManaCost * _cost) :
|
||||
ActivatedAbility(id, card, _cost, 0),type(type),effect(effect),who(who),amountsource(amountsource),eachother(eachother),storedAbility(storedAbility)
|
||||
ActivatedAbility(id, card, _cost, 0),type(type),effect(effect),who(who),amountsource(amountsource),storedAbility(storedAbility)
|
||||
{
|
||||
target = _target;
|
||||
sourceamount = 0;
|
||||
@@ -919,7 +919,6 @@ ActivatedAbility(id, card, _cost, 0),type(type),effect(effect),who(who),amountso
|
||||
tosrc = false;
|
||||
menu = "";
|
||||
OriginalSrc = source;
|
||||
storedAbility = storedAbility;
|
||||
clonedStored = NULL;
|
||||
}
|
||||
|
||||
@@ -2555,7 +2554,8 @@ int ATransformer::addToGame()
|
||||
((GenericActivatedAbility *)aNew)->source = _target;
|
||||
((GenericActivatedAbility *)aNew)->ability->source = _target;
|
||||
}
|
||||
if (MultiAbility * abi = dynamic_cast<MultiAbility*>(aNew))
|
||||
MultiAbility * abi = dynamic_cast<MultiAbility*>(aNew);
|
||||
if (abi)
|
||||
{
|
||||
((MultiAbility *)aNew)->source = _target;
|
||||
((MultiAbility *)aNew)->abilities[0]->source = _target;
|
||||
|
||||
@@ -698,7 +698,7 @@ void CardGui::TinyCropRender(MTGCard * card, const Pos& pos, JQuad * quad)
|
||||
++j;
|
||||
}
|
||||
//Has X?
|
||||
if (int cost = manacost->hasX())
|
||||
if (manacost->hasX())
|
||||
{
|
||||
char buffer[10];
|
||||
sprintf(buffer, "X");
|
||||
|
||||
@@ -131,7 +131,8 @@ int Counters::removeCounter(const char * _name, int _power, int _toughness)
|
||||
{
|
||||
GameObserver * game = game->GetInstance();
|
||||
MTGCardInstance * copy = target->controller()->game->putInZone(target, target->currentZone, target->controller()->game->stack);
|
||||
Spell * spell = game->mLayers->stackLayer()->addSpell(copy, game->targetChooser, NULL,1, 0);
|
||||
|
||||
game->mLayers->stackLayer()->addSpell(copy, game->targetChooser, NULL,1, 0);
|
||||
game->targetChooser = NULL;
|
||||
}
|
||||
return mCount;
|
||||
|
||||
@@ -184,8 +184,8 @@ bool isSpell(CardView* c)
|
||||
}
|
||||
void GuiPlay::Replace()
|
||||
{
|
||||
unsigned opponentSpellsN = 0, selfSpellsN = 0, opponentLandsN = 0, opponentCreaturesN = 0, battleFieldAttackersN = 0,
|
||||
battleFieldBlockersN = 0, selfCreaturesN = 0, selfLandsN = 0, selfPlaneswalkern = 0,opponentPlaneswalkern = 0;
|
||||
unsigned opponentSpellsN = 0, selfSpellsN = 0, opponentLandsN = 0, opponentCreaturesN = 0,
|
||||
battleFieldAttackersN = 0, battleFieldBlockersN = 0, selfCreaturesN = 0, selfLandsN = 0;
|
||||
|
||||
end_spells = stable_partition(cards.begin(), cards.end(), &isSpell);
|
||||
|
||||
|
||||
@@ -860,7 +860,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
||||
|
||||
// figure out alternative cost effects
|
||||
string keyword;
|
||||
int costType = -1;
|
||||
|
||||
|
||||
for (size_t i = 0; i < sizeof(kAlternateCostIds)/sizeof(kAlternateCostIds[0]); ++i)
|
||||
{
|
||||
@@ -1813,7 +1813,6 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
||||
TargetChooserFactory tcf;
|
||||
TargetChooser * castTargets = tcf.createTargetChooser(splitCast[1], card);
|
||||
|
||||
size_t space = s.find(" ");
|
||||
vector<string> splitValue = parseBetween(splitCast[2], "", " ", false);
|
||||
if (!splitValue.size())
|
||||
{
|
||||
@@ -1987,8 +1986,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
||||
found = s.find("transforms((");
|
||||
if (found != string::npos)
|
||||
{
|
||||
string extraTransforms = "";
|
||||
size_t stypesStartIndex = found + 12;
|
||||
string extraTransforms = "";
|
||||
string transformsParamsString = "";
|
||||
transformsParamsString.append(storedString);//the string between found and real end is removed at start.
|
||||
|
||||
@@ -2575,7 +2573,7 @@ int AbilityFactory::magicText(int id, Spell * spell, MTGCardInstance * card, int
|
||||
{
|
||||
// Anything involving Mana Producing abilities cannot be interrupted
|
||||
MTGAbility * core = getCoreAbility(a);
|
||||
if (AManaProducer * amp = dynamic_cast<AManaProducer*> (core))
|
||||
if (dynamic_cast<AManaProducer*> (core))
|
||||
a->canBeInterrupted = false;
|
||||
|
||||
a->addToGame();
|
||||
|
||||
@@ -49,7 +49,6 @@ MTGAbility(_id,NULL)
|
||||
}
|
||||
int MTGEventBonus::receiveEvent(WEvent * event)
|
||||
{
|
||||
Player * player = game->currentlyActing();
|
||||
Player * currentPlayer = game->currentPlayer;
|
||||
//bonus for chain chain casting without tapping for mana or being interupted;
|
||||
//note gaining mana from other sources is still possible.
|
||||
@@ -532,7 +531,7 @@ int MTGKickerRule::reactToClick(MTGCardInstance * card)
|
||||
}
|
||||
|
||||
ManaCost * previousManaPool = NEW ManaCost(player->getManaPool());
|
||||
int payResult = player->getManaPool()->pay(withKickerCost);
|
||||
player->getManaPool()->pay(withKickerCost);
|
||||
withKickerCost->doPayExtra();
|
||||
ManaCost * spellCost = previousManaPool->Diff(player->getManaPool());
|
||||
delete withKickerCost;
|
||||
@@ -630,7 +629,7 @@ int MTGAlternativeCostRule::isReactingToClick(MTGCardInstance * card, ManaCost *
|
||||
return 0;
|
||||
if(!allowedToAltCast(card,player))
|
||||
return 0;
|
||||
card->getManaCost()->alternativeName;
|
||||
|
||||
if(card->model->data->getManaCost()->alternative && card->model->data->getManaCost()->alternative->alternativeName.size())
|
||||
alternativeName = card->model->data->getManaCost()->alternative->alternativeName;
|
||||
|
||||
@@ -673,11 +672,9 @@ int MTGAlternativeCostRule::reactToClick(MTGCardInstance * card)
|
||||
return 0;
|
||||
|
||||
ManaCost *alternateCost = card->getManaCost()->alternative;
|
||||
Player * player = game->currentlyActing();
|
||||
ManaCost * playerMana = player->getManaPool();
|
||||
card->paymenttype = MTGAbility::ALTERNATIVE_COST;
|
||||
|
||||
return reactToClick(card, card->getManaCost()->alternative, ManaCost::MANA_PAID_WITH_ALTERNATIVE);
|
||||
return reactToClick(card, alternateCost, ManaCost::MANA_PAID_WITH_ALTERNATIVE);
|
||||
}
|
||||
|
||||
int MTGAlternativeCostRule::reactToClick(MTGCardInstance * card, ManaCost *alternateCost, int alternateCostType){
|
||||
@@ -789,8 +786,6 @@ int MTGBuyBackRule::reactToClick(MTGCardInstance * card)
|
||||
if (!isReactingToClick(card))
|
||||
return 0;
|
||||
|
||||
Player *player = game->currentlyActing();
|
||||
ManaCost * playerMana = player->getManaPool();
|
||||
ManaCost * alternateCost = card->getManaCost()->BuyBack;
|
||||
|
||||
card->paymenttype = MTGAbility::BUYBACK_COST;
|
||||
@@ -838,9 +833,8 @@ int MTGFlashBackRule::isReactingToClick(MTGCardInstance * card, ManaCost * mana)
|
||||
|
||||
int MTGFlashBackRule::reactToClick(MTGCardInstance * card)
|
||||
{
|
||||
Player *player = game->currentlyActing();
|
||||
ManaCost * alternateCost = card->getManaCost()->FlashBack;
|
||||
ManaCost * playerMana = game->currentlyActing()->getManaPool();
|
||||
|
||||
if (!isReactingToClick(card))
|
||||
return 0;
|
||||
|
||||
@@ -896,8 +890,7 @@ int MTGRetraceRule::reactToClick(MTGCardInstance * card)
|
||||
{
|
||||
if (!isReactingToClick(card))
|
||||
return 0;
|
||||
Player *player = game->currentlyActing();
|
||||
ManaCost * playerMana = player->getManaPool();
|
||||
|
||||
ManaCost * alternateCost = card->getManaCost()->Retrace;
|
||||
|
||||
card->paymenttype = MTGAbility::RETRACE_COST;
|
||||
@@ -1039,7 +1032,7 @@ MTGMorphCostRule::MTGMorphCostRule(int _id) :
|
||||
}
|
||||
int MTGMorphCostRule::isReactingToClick(MTGCardInstance * card, ManaCost * mana)
|
||||
{
|
||||
int cardsinhand = game->players[0]->game->hand->nb_cards;
|
||||
|
||||
Player * player = game->currentlyActing();
|
||||
Player * currentPlayer = game->currentPlayer;
|
||||
if (!player->game->hand->hasCard(card))
|
||||
@@ -1058,11 +1051,13 @@ int MTGMorphCostRule::isReactingToClick(MTGCardInstance * card, ManaCost * mana)
|
||||
if (currentPlayer->game->playRestrictions->canPutIntoZone(card, currentPlayer->game->stack) == PlayRestriction::CANT_PLAY)
|
||||
return 0;
|
||||
ManaCost * playerMana = player->getManaPool();
|
||||
ManaCost * cost = card->getManaCost();
|
||||
ManaCost * morph = card->getManaCost()->morph;
|
||||
|
||||
#ifdef WIN32
|
||||
ManaCost * cost = card->getManaCost();
|
||||
cost->Dump();
|
||||
#endif
|
||||
|
||||
//cost of card.
|
||||
if (morph && playerMana->canAfford(morph))
|
||||
{
|
||||
|
||||
@@ -1118,7 +1118,6 @@ bool WGuiTabMenu::CheckUserInput(JButton key)
|
||||
{
|
||||
bool result = false;
|
||||
bool kidModal = false;
|
||||
bool handledInput = false;
|
||||
int nbitems = (int) items.size();
|
||||
JGE * mEngine = JGE::GetInstance();
|
||||
int i, j;
|
||||
|
||||
Reference in New Issue
Block a user