diff --git a/projects/mtg/bin/Res/sets/TMP/_cards.dat b/projects/mtg/bin/Res/sets/TMP/_cards.dat index 2e4b206b9..9a8174219 100644 --- a/projects/mtg/bin/Res/sets/TMP/_cards.dat +++ b/projects/mtg/bin/Res/sets/TMP/_cards.dat @@ -25,8 +25,8 @@ type=Sorcery [card] text=At the beginning of each player's upkeep, Ancient Runes deals damage to that player equal to the number of artifacts he or she controls. id=4801 -auto=@each upkeep:foreach(artifact|myinplay) damage:1 controller -auto=@each upkeep:foreach(artifact|opponentinplay) damage:1 opponent +auto=@each my upkeep:foreach(artifact|myinplay) damage:1 controller +auto=@each opponent upkeep:foreach(artifact|opponentinplay) damage:1 opponent name=Ancient Runes rarity=U type=Enchantment @@ -1930,4 +1930,4 @@ name=Winter's Grasp rarity=U mana={1}{G}{G} type=Sorcery -[/card] +[/card] diff --git a/projects/mtg/include/CardGui.h b/projects/mtg/include/CardGui.h index 40d21269e..fe4cbdd57 100644 --- a/projects/mtg/include/CardGui.h +++ b/projects/mtg/include/CardGui.h @@ -14,7 +14,6 @@ class PlayGuiObject; struct CardGui : public PlayGuiObject { protected: - JQuad* quad; public: static const float Width; diff --git a/projects/mtg/include/TexturesCache.h b/projects/mtg/include/TexturesCache.h index 80d4de1a4..709565d07 100644 --- a/projects/mtg/include/TexturesCache.h +++ b/projects/mtg/include/TexturesCache.h @@ -23,7 +23,6 @@ class CachedTexture{ JQuad* quad; public: int lastTime; - int type; int nbpixels; diff --git a/projects/mtg/include/WResourceManager.h b/projects/mtg/include/WResourceManager.h index adeda6db4..e1efd7d89 100644 --- a/projects/mtg/include/WResourceManager.h +++ b/projects/mtg/include/WResourceManager.h @@ -43,7 +43,7 @@ public: JMusic * ssLoadMusic(const char *fileName); JSample * ssLoadSample(const char *fileName); - //Our new redirect system. + //Our New redirect system. string graphicsFile(const string filename, const string specific = "", bool bFont = false); string musicFile(const string filename, const string specific = ""); string sfxFile(const string filename, const string specific = ""); diff --git a/projects/mtg/src/AIMomirPlayer.cpp b/projects/mtg/src/AIMomirPlayer.cpp index 79d8a9713..b4a1a3e30 100644 --- a/projects/mtg/src/AIMomirPlayer.cpp +++ b/projects/mtg/src/AIMomirPlayer.cpp @@ -1,7 +1,6 @@ #include "../include/config.h" #include "../include/AIMomirPlayer.h" #include "../include/CardDescriptor.h" -#include "../include/DamageResolverLayer.h" #include "../include/DamagerDamaged.h" #include "../include/AIStats.h" #include "../include/AllAbilities.h" diff --git a/projects/mtg/src/CardGui.cpp b/projects/mtg/src/CardGui.cpp index a5f94ea63..554820e5e 100644 --- a/projects/mtg/src/CardGui.cpp +++ b/projects/mtg/src/CardGui.cpp @@ -13,8 +13,8 @@ const float CardGui::Height = 40.0; const float CardGui::BigWidth = 200.0; const float CardGui::BigHeight = 285.0; -CardGui::CardGui(MTGCardInstance* card, float x, float y) : PlayGuiObject(Height, x, y, false), quad(cache.getQuad(card)), card(card) {} -CardGui::CardGui(MTGCardInstance* card, const Pos& ref) : PlayGuiObject(Height, ref, false), quad(cache.getQuad(card)), card(card) {} +CardGui::CardGui(MTGCardInstance* card, float x, float y) : PlayGuiObject(Height, x, y, false), card(card) {} +CardGui::CardGui(MTGCardInstance* card, const Pos& ref) : PlayGuiObject(Height, ref, false), card(card) {} CardView::CardView(MTGCardInstance* card, float x, float y) : CardGui(card, x, y) { card->view = this; @@ -40,7 +40,7 @@ void CardGui::Render() TargetChooser * tc = NULL; if (game) tc = game->getCurrentTargetChooser(); - quad = cache.getQuad(card); + JQuad * quad = cache.getThumb(card); if (quad) { const float scale = actZ * 40 / quad->mHeight; renderer->RenderQuad(GameApp::CommonRes->GetQuad("shadow"), actX + (scale-1)*15, actY + (scale-1)*15, actT, 28*scale, 40*scale); @@ -220,6 +220,7 @@ void CardGui::alternateRender(MTGCard * card, const Pos& pos){ void CardGui::RenderBig(const Pos& pos){ JRenderer * renderer = JRenderer::GetInstance(); + JQuad * quad = cache.getQuad(card); if (quad){ quad->SetColor(ARGB((int)pos.actA,255,255,255)); float scale = pos.actZ * 257.f / quad->mHeight; @@ -252,7 +253,7 @@ ostream& CardView::toString(ostream& out) const { return (CardGui::toString(out) << " : CardView ::: card : " << card << "; actX,actY : " << actX << "," << actY << "; t : " << t - << " ; actT : " << actT << " ; quad : " << quad); + << " ; actT : " << actT); } ostream& CardGui::toString(ostream& out) const { diff --git a/projects/mtg/src/GameApp.cpp b/projects/mtg/src/GameApp.cpp index c87906ce2..9c1246b78 100644 --- a/projects/mtg/src/GameApp.cpp +++ b/projects/mtg/src/GameApp.cpp @@ -164,7 +164,7 @@ void GameApp::Create() mCurrentState = NULL; mNextState = mGameStates[GAME_STATE_MENU]; - // effect = new CardEffect(); + // effect = NEW CardEffect(); char buf[512]; sprintf(buf, "size of MTGCard : %i\n" , sizeof(MTGCard)); diff --git a/projects/mtg/src/GameObserver.cpp b/projects/mtg/src/GameObserver.cpp index 69db5c027..598897ba5 100644 --- a/projects/mtg/src/GameObserver.cpp +++ b/projects/mtg/src/GameObserver.cpp @@ -5,7 +5,6 @@ #include "../include/ConstraintResolver.h" #include "../include/CardGui.h" #include "../include/Damage.h" -#include "../include/DamageResolverLayer.h" #include "../include/ExtraCost.h" #include diff --git a/projects/mtg/src/GameStateOptions.cpp b/projects/mtg/src/GameStateOptions.cpp index 435ab8282..7a6eb6259 100644 --- a/projects/mtg/src/GameStateOptions.cpp +++ b/projects/mtg/src/GameStateOptions.cpp @@ -187,7 +187,7 @@ void GameStateOptions::ButtonPressed(int controllerId, int controlId) else if(controllerId == 103) switch (controlId){ case 1: - //Load the new profile. + //Load the New profile. optionsTabs->acceptSubmode(); optionsTabs->reloadValues(); //Reset the current settings to those of the profile... diff --git a/projects/mtg/src/GuiCombat.cpp b/projects/mtg/src/GuiCombat.cpp index ef0313a77..1ed7c3a2e 100644 --- a/projects/mtg/src/GuiCombat.cpp +++ b/projects/mtg/src/GuiCombat.cpp @@ -23,12 +23,14 @@ GuiCombat::GuiCombat(GameObserver* go) : GuiLayer(), go(go), active(false), acti GameApp::CommonRes->CreateQuad("OK", "Ok.png", 0, 0, 56, 45); } ok_quad = GameApp::CommonRes->GetQuad("OK"); - ok_quad->SetHotSpot(28, 22); + if (ok_quad) ok_quad->SetHotSpot(28, 22); } } GuiCombat::~GuiCombat() { + for (inner_iterator it = attackers.begin(); it != attackers.end(); ++it) + delete (*it); } template diff --git a/projects/mtg/src/MTGAbility.cpp b/projects/mtg/src/MTGAbility.cpp index 11c479307..3d4bf1a4f 100644 --- a/projects/mtg/src/MTGAbility.cpp +++ b/projects/mtg/src/MTGAbility.cpp @@ -785,7 +785,7 @@ int AbilityFactory::computeX(Spell * spell, MTGCardInstance * card){ //Some basic functionalities that can be added automatically in the text file /* * Several objects are computed from the text string, and have a direct influence on what action we should take - * (direct impact on the game such as draw a card immediately, or create a new GameObserver and add it to the Abilities,etc..) + * (direct impact on the game such as draw a card immediately, or create a New GameObserver and add it to the Abilities,etc..) * These objects are: * - trigger (if there is an "@" in the string, this is a triggered ability) * - target (if there ie a "target(" in the string, then this is a TargetAbility) @@ -1742,7 +1742,7 @@ void AbilityFactory::addAbilities(int _id, Spell * spell){ /* We want to get rid of these basicAbility things. - * basicAbilities themselves are alright, but creating new object depending on them is dangerous + * basicAbilities themselves are alright, but creating New object depending on them is dangerous * The main reason is that classes that add an ability to a card do NOT create these objects, and therefore do NOT * Work. * For example, setting EXALTED for a creature is not enough right now... @@ -2106,7 +2106,7 @@ void ListMaintainerAbility::updateTargets(){ temp.clear(); - //add new valid ones + //add New valid ones for (int i = 0; i < 2; i++){ Player * p = game->players[i]; MTGGameZone * zones[] = {p->game->inPlay,p->game->graveyard,p->game->hand,p->game->library}; diff --git a/projects/mtg/src/PhaseRing.cpp b/projects/mtg/src/PhaseRing.cpp index 7b9b30e70..b4d628a77 100644 --- a/projects/mtg/src/PhaseRing.cpp +++ b/projects/mtg/src/PhaseRing.cpp @@ -5,7 +5,7 @@ #include "../include/WEvent.h" -/* Creates a new phase ring with the default rules */ +/* Creates a New phase ring with the default rules */ PhaseRing::PhaseRing(Player* players[], int nbPlayers){ for (int i = 0; i < nbPlayers; i++){ for (int j = 0; j < Constants::NB_MTG_PHASES; j++){ diff --git a/projects/mtg/src/TestSuiteAI.cpp b/projects/mtg/src/TestSuiteAI.cpp index 66fec9b77..452071a28 100644 --- a/projects/mtg/src/TestSuiteAI.cpp +++ b/projects/mtg/src/TestSuiteAI.cpp @@ -3,7 +3,6 @@ #include "../include/MTGAbility.h" #include "../include/MTGRules.h" #include "../include/ActionLayer.h" -#include "../include/DamageResolverLayer.h" #include using std::string; diff --git a/projects/mtg/src/TexturesCache.cpp b/projects/mtg/src/TexturesCache.cpp index 8e88f66d9..98ce2def3 100644 --- a/projects/mtg/src/TexturesCache.cpp +++ b/projects/mtg/src/TexturesCache.cpp @@ -114,7 +114,7 @@ CachedTexture::CachedTexture(string filename){ if (fileExists(filename.c_str())) init(filename); } -CachedTexture::CachedTexture(MTGCard * card, int _type){ +CachedTexture::CachedTexture(MTGCard * card, int type){ LOG("==Creating CardTexture Object"); JFileSystem* fs = JFileSystem::GetInstance(); char filename[100];