From 65cc463f1d91fe99acf1c4dd9bce7e0038593022 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Tue, 3 Jul 2007 04:20:36 +0000 Subject: Fixed Logging, minor fixes, got rid of NatureEffect, and started migration from wxGTK to Qt git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@22 6ecfd1a5-f3ed-3746-8530-beee90d26b22 --- pokemod/Tile.cpp | 106 +++++++++++++++++-------------------------------------- 1 file changed, 32 insertions(+), 74 deletions(-) (limited to 'pokemod/Tile.cpp') diff --git a/pokemod/Tile.cpp b/pokemod/Tile.cpp index 36cc5bc5..cd1e3d13 100644 --- a/pokemod/Tile.cpp +++ b/pokemod/Tile.cpp @@ -38,7 +38,8 @@ PokeGen::PokeMod::Tile::Tile(const Pokemod *par, const unsigned _id) : canDive(false), isCuttable(false), underCut(UINT_MAX), - canHeadbutt(false), + canHeadbutt(false), + isRockClimb(false), forceType(UINT_MAX), forceDirection(UINT_MAX) { @@ -84,6 +85,14 @@ void PokeGen::PokeMod::Tile::Validate() LogVarNotValid("Tile", id, "waterType", name); isValid = false; } + else if (waterType == WTRT_WATERFALL) + { + if (!fromDown) + { + Log::Write(String("Tile: Waterfall needs to be accessible from below in %u (%s)", id, name.c_str()), PM_DEBUG_ERROR | PM_DEBUG_VALIDATION); + isValid = false; + } + } else if (waterType == WTRT_WHIRLPOOL) { if (!pokemod->GetTile(underWater)) @@ -100,77 +109,15 @@ void PokeGen::PokeMod::Tile::Validate() LogVarNotValid("Tile", id, "underCut", name); isValid = false; } - } - if (forceType < FT_END) - { - if ((forceType == FT_SLIP) || (forceType == FT_FORCE) || (forceType == FT_PUSH)) - { - if (DIR_END <= forceDirection) - { - LogVarNotValid("Tile", id, "forceDirection", name); - isValid = false; - } - } - } - else - { - LogVarNotValid("Tile", id, "forceType", name); - isValid = false; - } - LogValidateOver("Tile", id, isValid, name); -} - -#ifdef PG_DEBUG_WINDOW -void PokeGen::PokeMod::Tile::Validate(const wxListBox &output) -{ - LogValidateStart("Tile", id, name); - if (name == "") - { - LogVarNotSet("Tile", id, "Name", name); - output.Append(ConsoleLogVarNotSet("Tile", id, "Name", name)); - isValid = false; - } - if (!pic.DoesExist()) - { - if (pic == "") - { - LogVarNotSet("Tile", id, "pic", name); - output.Append(ConsoleLogVarNotSet("Tile", id, "pic", name)); - } - else - { - LogVarNotValid("Tile", id, "pic", name); - output.Append(ConsoleLogVarNotValid("Tile", id, "pic", name)); - } - isValid = false; - } - if (isWater) - { - if (WT_END <= waterType) - { - LogVarNotValid("Tile", id, "waterType", name); - output.Append(Console); - isValid = false; - } - else if (waterType == WT_WHIRLPOOL) - { - if (!pokemod->GetTile(underWater)) - { - LogVarNotValid("Tile", id, "underWater", name); - output.Append(Console); - isValid = false; - } - } - } - if (isCuttable) + } + if (isRockClimb) { - if (!pokemod->GetTile(underCut)) - { - LogVarNotValid("Tile", id, "underCut", name); - output.Append(Console); - isValid = false; - } - } + if (!fromDown) + { + Log::Write(String("Tile: Rock Climbing needs to be accessible from below in %u (%s)", id, name.c_str()), PM_DEBUG_ERROR | PM_DEBUG_VALIDATION); + isValid = false; + } + } if (forceType < FT_END) { if ((forceType == FT_SLIP) || (forceType == FT_FORCE) || (forceType == FT_PUSH)) @@ -178,7 +125,6 @@ void PokeGen::PokeMod::Tile::Validate(const wxListBox &output) if (DIR_END <= forceDirection) { LogVarNotValid("Tile", id, "forceDirection", name); - output.Append(Console); isValid = false; } } @@ -186,12 +132,10 @@ void PokeGen::PokeMod::Tile::Validate(const wxListBox &output) else { LogVarNotValid("Tile", id, "forceType", name); - output.Append(Console); isValid = false; } LogValidateOver("Tile", id, isValid, name); } -#endif void PokeGen::PokeMod::Tile::ImportIni(Ini &ini, const unsigned _id) { @@ -223,6 +167,7 @@ void PokeGen::PokeMod::Tile::ImportIni(Ini &ini, const unsigned _id) ini.GetValue("isCuttable", isCuttable, false); ini.GetValue("underCut", underCut); ini.GetValue("canHeadbutt", canHeadbutt, false); + ini.GetValue("isRockClimb", isRockClimb, false); ini.GetValue("forceType", forceType); ini.GetValue("forceDirection", forceDirection); LogImportOver("Tile", id, name); @@ -249,6 +194,7 @@ void PokeGen::PokeMod::Tile::ExportIni(std::ofstream &fout) const exTile.AddField("isCuttable", isCuttable); exTile.AddField("underCut", underCut); exTile.AddField("canHeadbutt", canHeadbutt); + exTile.AddField("isRockClimb", isRockClimb); exTile.AddField("forceType", forceType); exTile.AddField("forceDirection", forceDirection); exTile.Export(fout); @@ -385,6 +331,12 @@ void PokeGen::PokeMod::Tile::SetCanHeadbutt(const bool c) canHeadbutt = c; } +void PokeGen::PokeMod::Tile::SetIsRockClimb(const bool i) +{ + LogSetVar("Tile", id, "isRockClimb", i, name); + isRockClimb = i; +} + void PokeGen::PokeMod::Tile::SetForceType(const unsigned f) { LogSetVar("Tile", id, "forceType", f, name); @@ -535,6 +487,12 @@ bool PokeGen::PokeMod::Tile::GetCanHeadbutt() const return canHeadbutt; } +bool PokeGen::PokeMod::Tile::GetIsRockClimb() const +{ + LogFetchVar("Tile", id, "isRockClimb", isRockClimb, name); + return isRockClimb; +} + unsigned PokeGen::PokeMod::Tile::GetForceType() const { LogFetchVar("Tile", id, "forceType", forceType, name); -- cgit