diff options
Diffstat (limited to 'pokemod/MapEffect.cpp')
| -rw-r--r-- | pokemod/MapEffect.cpp | 856 |
1 files changed, 346 insertions, 510 deletions
diff --git a/pokemod/MapEffect.cpp b/pokemod/MapEffect.cpp index bab36f48..5d212f54 100644 --- a/pokemod/MapEffect.cpp +++ b/pokemod/MapEffect.cpp @@ -1,510 +1,346 @@ -/////////////////////////////////////////////////////////////////////////////
-// Name: pokemod/MapEffect.cpp
-// Purpose: Define an effect for a map
-// Author: Ben Boeckel
-// Modified by: Ben Boeckel
-// Created: Fri June 1 2007 20:23:15
-// Copyright: ©2007 Nerdy Productions
-// Licence:
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License along
-// with this program. If not, see <http://www.gnu.org/licenses/>.
-/////////////////////////////////////////////////////////////////////////////
-
-#include "MapEffect.h"
-
-PokeGen::PokeMod::MapEffect::MapEffect(const Pokemod *par, const unsigned _id) :
- name(""),
- coordinate(0, 0),
- existFlag(0, 0),
- skin(""),
- effect(UINT_MAX),
- val1(UINT_MAX),
- val2(UINT_MAX),
- direction(UINT_MAX),
- isTransparent(false),
- canMove(false),
- dialog(UINT_MAX)
-{
- LogCtor("MapEffect", _id);
- id = _id;
- pokemod = par;
-}
-
-PokeGen::PokeMod::MapEffect::MapEffect(const Pokemod *par, Ini &ini, const unsigned _id)
-{
- LogCtorIni("MapEffect", _id);
- pokemod = par;
- ImportIni(ini, _id);
- if (id == UINT_MAX)
- LogIdError("MapEffect");
-}
-
-PokeGen::PokeMod::MapEffect::~MapEffect()
-{
- LogDtor("MapEffect", id, name);
-}
-
-void PokeGen::PokeMod::MapEffect::Validate()
-{
- LogValidateStart("MapEffect", id, name);
- if (name == "")
- {
- LogVarNotSet("MapEffect", id, "name");
- isValid = false;
- }
- if (FV_END <= existFlag.GetStatus())
- {
- LogVarNotValid("MapEffect", id, "existFlag value", name);
- isValid = false;
- }
- if (!skin.DoesExist())
- {
- if (skin == "")
- LogVarNotSet("MapEffect", id, "skin", name);
- else
- LogVarNotValid("MapEffect", id, "skin", name);
- isValid = false;
- }
- if (effect < MAPE_END)
- {
- switch (effect)
- {
- case MAPE_ITEM:
- if (!pokemod->GetItem(val2))
- {
- LogVarNotValid("MapEffect", id, "val2", name);
- isValid = false;
- }
- break;
- case MAPE_PC:
- if (PCT_END <= val2)
- {
- LogVarNotValid("MapEffect", id, "val2", name);
- isValid = false;
- }
- break;
- case MAPE_STRENGTH_BLOCK:
- case MAPE_BUTTON:
- if (FV_END <= val2)
- {
- LogVarNotValid("MapEffect", id, "val2", name);
- isValid = false;
- }
- }
- }
- else
- {
- LogVarNotValid("MapEffect", id, "effect", name);
- isValid = false;
- }
- if (DIR_END <= direction)
- {
- LogVarNotValid("MapEffect", id, "direction", name);
- isValid = false;
- }
- if (!pokemod->GetDialog(dialog))
- {
- LogVarNotValid("MapEffect", id, "dialog", name);
- isValid = false;
- }
- LogValidateOver("MapEffect", id, isValid, name);
-}
-
-void PokeGen::PokeMod::MapEffect::ImportIni(Ini &ini, const unsigned _id)
-{
- LogImportStart("MapEffect");
- if (_id == UINT_MAX)
- {
- ini.GetValue("id", id);
- if (id == UINT_MAX)
- LogIdNotFound("MapEffect");
- }
- else
- id = _id;
- unsigned i;
- unsigned j;
- ini.GetValue("name", name);
- ini.GetValue("coordinate-x", i, 0);
- ini.GetValue("coordinate-y", j, 0);
- coordinate.Set(i, j);
- ini.GetValue("existFlag-f", i, 0);
- ini.GetValue("existFlag-s", j, 0);
- existFlag.Set(i, j);
- ini.GetValue("skin", skin);
- ini.GetValue("effect", effect);
- ini.GetValue("val1", val1);
- ini.GetValue("val2", val2);
- ini.GetValue("direction", direction);
- ini.GetValue("isTransparent", isTransparent);
- ini.GetValue("canMove", canMove);
- ini.GetValue("dialog", dialog);
- LogImportOver("MapEffect", id, name);
-}
-
-void PokeGen::PokeMod::MapEffect::ExportIni(QFile &fout, const QString &map) const
-{
- LogExportStart("MapEffect", id, name);
- Ini exMapEffect(map + "mapEffect");
- exMapEffect.AddField("id", id);
- exMapEffect.AddField("name", name);
- exMapEffect.AddField("coordinate-x", coordinate.GetX());
- exMapEffect.AddField("coordinate-y", coordinate.GetY());
- exMapEffect.AddField("existFlag-f", existFlag.GetFlag());
- exMapEffect.AddField("existFlag-s", existFlag.GetStatus());
- exMapEffect.AddField("skin", skin);
- exMapEffect.AddField("effect", effect);
- exMapEffect.AddField("val1", val1);
- exMapEffect.AddField("val2", val2);
- exMapEffect.AddField("direction", direction);
- exMapEffect.AddField("isTransparent", isTransparent);
- exMapEffect.AddField("canMove", canMove);
- exMapEffect.AddField("dialog", dialog);
- exMapEffect.Export(fout);
- LogExportOver("MapEffect", id, name);
-}
-
-void PokeGen::PokeMod::MapEffect::SetName(const QString &n)
-{
- LogSetVar("MapEffect", id, "name", n);
- name = n;
-}
-
-void PokeGen::PokeMod::MapEffect::SetCoordinate(const Point &c)
-{
- LogSetVar("MapEffect", id, "coordinate", c.GetX(), c.GetY(), name);
- coordinate = c;
-}
-
-void PokeGen::PokeMod::MapEffect::SetCoordinate(const unsigned x, const unsigned y)
-{
- LogSetVar("MapEffect", id, "coordinate", x, y, name);
- coordinate.Set(x, y);
-}
-
-void PokeGen::PokeMod::MapEffect::SetCoordinateX(const unsigned x)
-{
- LogSetVar("MapEffect", id, "coordinate x", x, name);
- coordinate.SetX(x);
-}
-
-void PokeGen::PokeMod::MapEffect::SetCoordinateY(const unsigned y)
-{
- LogSetVar("MapEffect", id, "coordinate y", y, name);
- coordinate.SetY(y);
-}
-
-void PokeGen::PokeMod::MapEffect::SetExistFlag(const Flag &e)
-{
- LogSetVar("MapEffect", id, "existFlag", e.GetFlag(), e.GetStatus(), name);
- existFlag = e;
-}
-
-void PokeGen::PokeMod::MapEffect::SetExistFlag(const unsigned f, const unsigned s)
-{
- LogSetVar("MapEffect", id, "existFlag", f, s, name);
- existFlag.Set(f, s);
-}
-
-void PokeGen::PokeMod::MapEffect::SetExistFlagFlag(const unsigned f)
-{
- LogSetVar("MapEffect", id, "existFlag flag", f, name);
- existFlag.SetFlag(f);
-}
-
-void PokeGen::PokeMod::MapEffect::SetExistFlagStatus(const unsigned s)
-{
- LogSetVar("MapEffect", id, "existFlag status", s, name);
- if (s < FV_END)
- existFlag.SetStatus(s);
-}
-
-void PokeGen::PokeMod::MapEffect::SetExistFlagStatus(const QString &s)
-{
- SetExistFlagStatus(FindIn(FV_END, s, FlagValueStr));
-}
-
-void PokeGen::PokeMod::MapEffect::SetSkin(const Path &s)
-{
- LogSetVar("MapEffect", id, "skin", s, name);
- skin = s;
-}
-
-void PokeGen::PokeMod::MapEffect::SetEffect(const unsigned e)
-{
- LogSetVar("MapEffect", id, "effect", e, name);
- if (e < MAPE_END)
- {
- effect = e;
- val1 = UINT_MAX;
- val2 = UINT_MAX;
- }
-}
-
-void PokeGen::PokeMod::MapEffect::SetEffect(const QString &e)
-{
- SetEffect(FindIn(MAPE_END, e, MapEffectStr));
-}
-
-void PokeGen::PokeMod::MapEffect::SetVal1(const unsigned v1)
-{
- LogSetVar("MapEffect", id, "val1", v1, name);
- switch (effect)
- {
- case MAPE_ITEM:
- case MAPE_PC:
- case MAPE_ROCK_SMASH:
- case MAPE_SLOT_MACHINE:
- case MAPE_CARD_FLIP_GAME:
- LogNoUse("MapEffect", id, "val1", v1, "effect", MapEffectStr[effect]);
- break;
- case MAPE_STRENGTH_BLOCK:
- case MAPE_BUTTON:
- val1 = v1;
- break;
- default:
- LogNotSet("MapEffect", id, "val1", v1, "effect");
- }
-}
-
-void PokeGen::PokeMod::MapEffect::SetVal2(const unsigned v2)
-{
- LogSetVar("MapEffect", id, "val2", v2, name);
- switch (effect)
- {
- case MAPE_ITEM:
- if (pokemod->GetItem(v2))
- val2 = v2;
- else
- LogOutOfRange("MapEffect", id, "val2", v2, "effect", "Item");
- break;
- case MAPE_PC:
- if (v2 < PCT_END)
- val2 = v2;
- else
- LogOutOfRange("MapEffect", id, "val2", v2, "effect", "PC");
- break;
- case MAPE_STRENGTH_BLOCK:
- case MAPE_BUTTON:
- if (v2 < FV_END)
- val2 = v2;
- else
- LogOutOfRange("MapEffect", id, "val2", v2, "effect", MapEffectStr[effect]);
- break;
- case MAPE_ROCK_SMASH:
- case MAPE_SLOT_MACHINE:
- case MAPE_CARD_FLIP_GAME:
- LogNoUse("MapEffect", id, "val2", v2, "effect", MapEffectStr[effect]);
- break;
- default:
- LogNotSet("MapEffect", id, "val2", v2, "effect");
- }
-}
-
-void PokeGen::PokeMod::MapEffect::SetVal2(const QString &v2)
-{
- switch (effect)
- {
- case MAPE_ITEM:
- if (const Item *i = pokemod->GetItem(v2))
- SetVal2(i->GetId());
- break;
- case MAPE_PC:
- SetVal2(FindIn(PCT_END, v2, PCTypeStr));
- break;
- case MAPE_STRENGTH_BLOCK:
- case MAPE_BUTTON:
- SetVal2(FindIn(FV_END, v2, FlagValueStr));
- break;
- case MAPE_ROCK_SMASH:
- case MAPE_SLOT_MACHINE:
- case MAPE_CARD_FLIP_GAME:
- LogNoUse("MapEffect", id, "val2", v2, "effect", MapEffectStr[effect]);
- break;
- default:
- LogNotSet("MapEffect", id, "val2", v2, "effect");
- }
-}
-
-void PokeGen::PokeMod::MapEffect::SetDirection(const unsigned d)
-{
- LogSetVar("MapEffect", id, "direction", d, name);
- if (d < DIR_END_NONE)
- direction = d;
-}
-
-void PokeGen::PokeMod::MapEffect::SetDirection(const QString &d)
-{
- SetDirection(FindIn(DIR_END_NONE, d, DirectionStr));
-}
-
-void PokeGen::PokeMod::MapEffect::SetIsTransparent(const bool i)
-{
- LogSetVar("MapEffect", id, "isTransparent", i, name);
- isTransparent = i;
-}
-
-void PokeGen::PokeMod::MapEffect::SetCanMove(const bool c)
-{
- LogSetVar("MapEffect", id, "canMove", c, name);
- canMove = c;
-}
-
-void PokeGen::PokeMod::MapEffect::SetDialog(const unsigned d)
-{
- LogSetVar("MapEffect", id, "dialog", d, name);
- if (pokemod->GetDialog(d))
- dialog = d;
-}
-
-QString PokeGen::PokeMod::MapEffect::GetName() const
-{
- LogFetchVar("MapEffect", id, "name", name);
- return name;
-}
-
-PokeGen::PokeMod::Point PokeGen::PokeMod::MapEffect::GetCoordinate() const
-{
- LogFetchVar("MapEffect", id, "coordinate", coordinate.GetX(), coordinate.GetY(), name);
- return coordinate;
-}
-
-unsigned PokeGen::PokeMod::MapEffect::GetCoordinateX() const
-{
- LogFetchVar("MapEffect", id, "coordinate x", coordinate.GetX(), name);
- return coordinate.GetX();
-}
-
-unsigned PokeGen::PokeMod::MapEffect::GetCoordinateY() const
-{
- LogFetchVar("MapEffect", id, "coordinate y", coordinate.GetY(), name);
- return coordinate.GetY();
-}
-
-PokeGen::PokeMod::Flag PokeGen::PokeMod::MapEffect::GetExistFlag() const
-{
- LogFetchVar("MapEffect", id, "existFlag", existFlag.GetFlag(), existFlag.GetStatus(), name);
- return existFlag;
-}
-
-unsigned PokeGen::PokeMod::MapEffect::GetExistFlagFlag() const
-{
- LogFetchVar("MapEffect", id, "existFlag flag", existFlag.GetFlag(), name);
- return existFlag.GetFlag();
-}
-
-unsigned PokeGen::PokeMod::MapEffect::GetExistFlagStatus() const
-{
- LogFetchVar("MapEffect", id, "existFlag status", existFlag.GetStatus(), name);
- return existFlag.GetStatus();
-}
-
-QString PokeGen::PokeMod::MapEffect::GetExistFlagStatusString() const
-{
- LogFetchVar("MapEffect", id, "existFlag status string", existFlag.GetStatus(), name);
- return existFlag.GetStatusString();
-}
-
-PokeGen::PokeMod::Path PokeGen::PokeMod::MapEffect::GetSkin() const
-{
- LogFetchVar("MapEffect", id, "skin", skin, name);
- return skin;
-}
-
-unsigned PokeGen::PokeMod::MapEffect::GetEffect() const
-{
- LogFetchVar("MapEffect", id, "effect", effect, name);
- return effect;
-}
-
-QString PokeGen::PokeMod::MapEffect::GetEffectString() const
-{
- LogFetchVar("MapEffect", id, "effect string", effect, name);
- if (effect < MAPE_END)
- return MapEffectStr[effect];
- return "";
-}
-
-unsigned PokeGen::PokeMod::MapEffect::GetVal1() const
-{
- LogFetchVar("MapEffect", id, "val1", val1, name);
- return val1;
-}
-
-unsigned PokeGen::PokeMod::MapEffect::GetVal2() const
-{
- LogFetchVar("MapEffect", id, "val2", val2, name);
- return val2;
-}
-
-QString PokeGen::PokeMod::MapEffect::GetVal2String() const
-{
- LogFetchVar("MapEffect", id, "val2 string", val2, name);
- QString ret;
- switch (effect)
- {
- case MAPE_ITEM:
- if (const Item *i = pokemod->GetItem(val2))
- ret = i->GetName();
- break;
- case MAPE_PC:
- if (val2 <= PCT_END)
- ret = PCTypeStr[val2];
- break;
- case MAPE_STRENGTH_BLOCK:
- case MAPE_BUTTON:
- if (val2 <= FV_END)
- ret = FlagValueStr[val2];
- break;
- }
- return ret;
-}
-
-unsigned PokeGen::PokeMod::MapEffect::GetDirection() const
-{
- LogFetchVar("MapEffect", id, "direction", direction, name);
- return direction;
-}
-
-QString PokeGen::PokeMod::MapEffect::GetDirectionString() const
-{
- LogFetchVar("MapEffect", id, "direction string", direction, name);
- if (direction < DIR_END_NONE)
- return DirectionStr[direction];
- return "";
-}
-
-bool PokeGen::PokeMod::MapEffect::GetIsTransparent() const
-{
- LogFetchVar("MapEffect", id, "isTransparent", isTransparent, name);
- return isTransparent;
-}
-
-bool PokeGen::PokeMod::MapEffect::GetCanMove() const
-{
- LogFetchVar("MapEffect", id, "canMove", canMove, name);
- return canMove;
-}
-
-unsigned PokeGen::PokeMod::MapEffect::GetDialog() const
-{
- LogFetchVar("MapEffect", id, "dialog", dialog, name);
- return dialog;
-}
-
-QString PokeGen::PokeMod::MapEffect::GetDialogString() const
-{
- LogFetchVar("MapEffect", id, "dialog string", dialog, name);
- if (const Dialog *d = pokemod->GetDialog(dialog))
- return d->GetDialog();
- return "";
-}
+///////////////////////////////////////////////////////////////////////////// +// Name: pokemod/MapEffect.cpp +// Purpose: Define an effect for a map +// Author: Ben Boeckel +// Modified by: Ben Boeckel +// Created: Fri June 1 2007 20:23:15 +// Copyright: ©2007 Nerdy Productions +// Licence: +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this program. If not, see <http://www.gnu.org/licenses/>. +///////////////////////////////////////////////////////////////////////////// + +#include "MapEffect.h" + +PokeGen::PokeMod::MapEffect::MapEffect(const Pokemod* par, const unsigned _id) : + Object(_id, par), + name(""), + coordinate(0, 0), + existFlag(0, 0), + skin(""), + effect(UINT_MAX), + val1(UINT_MAX), + val2(UINT_MAX), + direction(UINT_MAX), + isTransparent(false), + canMove(false), + dialog(UINT_MAX) +{ +} + +PokeGen::PokeMod::MapEffect::MapEffect(const Pokemod* par, Ini& ini, const unsigned _id) : + Object(_id, par) +{ + ImportIni(ini, _id); +} + +bool PokeGen::PokeMod::MapEffect::Validate() +{ + pokemod->ValidationMsg(QString("------Effect \"%1\" with id %2---").arg(name).arg(id), Pokemod::V_Msg); + if (name == "") + { + pokemod->ValidationMsg("Name is not defined"); + isValid = false; + } + if (Flag::End <= existFlag.GetStatus()) + { + pokemod->ValidationMsg("Invalid existence flag status"); + isValid = false; + } + if (!QFile(pokemod->GetPath() + "images/skins/" + skin + ".png").exists()) + { + pokemod->ValidationMsg(QString("Skin not found")); + isValid = false; + } + if (effect < E_End) + { + bool ok = true; + switch (effect) + { + case E_Item: + if (pokemod->GetItemByID(val2) == UINT_MAX) + ok = false; + break; + case E_PC: + if (PC_End <= val2) + ok = false; + break; + case E_StrengthBlock: + case E_Button: + if (Flag::End <= val2) + ok = false; + } + if (!ok) + { + pokemod->ValidationMsg("Invalid val2"); + isValid = false; + } + } + else + { + pokemod->ValidationMsg("Invalid effect"); + isValid = false; + } + if (DIR_End <= direction) + { + pokemod->ValidationMsg("Invalid driection"); + isValid = false; + } + if (pokemod->GetDialogByID(dialog) == UINT_MAX) + { + pokemod->ValidationMsg("Invalid dialog"); + isValid = false; + } + return isValid; +} + +void PokeGen::PokeMod::MapEffect::ImportIni(Ini& ini, const unsigned _id) +{ + if (_id == UINT_MAX) + ini.GetValue("id", id); + else + id = _id; + unsigned i; + unsigned j; + ini.GetValue("name", name); + ini.GetValue("coordinate-x", i, 0); + ini.GetValue("coordinate-y", j, 0); + coordinate.Set(i, j); + ini.GetValue("existFlag-f", i, 0); + ini.GetValue("existFlag-s", j, 0); + existFlag.Set(i, j); + ini.GetValue("skin", skin); + ini.GetValue("effect", effect); + ini.GetValue("val1", val1); + ini.GetValue("val2", val2); + ini.GetValue("direction", direction); + ini.GetValue("isTransparent", isTransparent); + ini.GetValue("canMove", canMove); + ini.GetValue("dialog", dialog); +} + +void PokeGen::PokeMod::MapEffect::ExportIni(QFile& fout, const QString& map) const +{ + Ini exMapEffect(map + "mapEffect"); + exMapEffect.AddField("id", id); + exMapEffect.AddField("name", name); + exMapEffect.AddField("coordinate-x", coordinate.GetX()); + exMapEffect.AddField("coordinate-y", coordinate.GetY()); + exMapEffect.AddField("existFlag-f", existFlag.GetFlag()); + exMapEffect.AddField("existFlag-s", existFlag.GetStatus()); + exMapEffect.AddField("skin", skin); + exMapEffect.AddField("effect", effect); + exMapEffect.AddField("val1", val1); + exMapEffect.AddField("val2", val2); + exMapEffect.AddField("direction", direction); + exMapEffect.AddField("isTransparent", isTransparent); + exMapEffect.AddField("canMove", canMove); + exMapEffect.AddField("dialog", dialog); + exMapEffect.Export(fout); +} + +void PokeGen::PokeMod::MapEffect::SetName(const QString& n) +{ + name = n; +} + +void PokeGen::PokeMod::MapEffect::SetCoordinate(const unsigned x, const unsigned y) +{ + coordinate.Set(x, y); +} + +void PokeGen::PokeMod::MapEffect::SetCoordinateX(const unsigned x) +{ + coordinate.SetX(x); +} + +void PokeGen::PokeMod::MapEffect::SetCoordinateY(const unsigned y) +{ + coordinate.SetY(y); +} + +void PokeGen::PokeMod::MapEffect::SetExistFlag(const unsigned f, const unsigned s) +{ + existFlag.Set(f, s); +} + +void PokeGen::PokeMod::MapEffect::SetExistFlagFlag(const unsigned f) +{ + existFlag.SetFlag(f); +} + +bool PokeGen::PokeMod::MapEffect::SetExistFlagStatus(const unsigned s) +{ + if (s < Flag::End) + { + existFlag.SetStatus(s); + return true; + } + return false; +} + +bool PokeGen::PokeMod::MapEffect::SetSkin(const QString& s) +{ + int dirPos = s.lastIndexOf(PM_DEF_SEP); + int extPos = s.lastIndexOf('.'); + if ((dirPos == -1) || (extPos == -1)) + return false; + skin = s.mid(dirPos + 1, extPos - dirPos - 1); + QFile file(pokemod->GetPath() + "images/skins/" + skin + ".png"); + if (file.exists() && !file.remove()) + return false; + return QFile::copy(s, pokemod->GetPath() + "images/skins/" + skin + ".png"); +} + +bool PokeGen::PokeMod::MapEffect::SetEffect(const unsigned e) +{ + if (e < E_End) + { + effect = e; + val1 = UINT_MAX; + val2 = UINT_MAX; + } + return (effect == e); +} + +bool PokeGen::PokeMod::MapEffect::SetVal1(const unsigned v1) +{ + switch (effect) + { + case E_StrengthBlock: + case E_Button: + val1 = v1; + break; + } + return (val1 == v1); +} + +bool PokeGen::PokeMod::MapEffect::SetVal2(const unsigned v2) +{ + switch (effect) + { + case E_Item: + if (pokemod->GetItemByID(v2) != UINT_MAX) + val2 = v2; + break; + case E_PC: + if (v2 < PC_End) + val2 = v2; + break; + case E_StrengthBlock: + case E_Button: + if (v2 < Flag::End) + val2 = v2; + break; + } + return (val2 == v2); +} + +bool PokeGen::PokeMod::MapEffect::SetDirection(const unsigned d) +{ + if (d < DIR_End_None) + direction = d; + return (direction == d); +} + +void PokeGen::PokeMod::MapEffect::SetIsTransparent(const bool i) +{ + isTransparent = i; +} + +void PokeGen::PokeMod::MapEffect::SetCanMove(const bool c) +{ + canMove = c; +} + +bool PokeGen::PokeMod::MapEffect::SetDialog(const unsigned d) +{ + if (pokemod->GetDialogByID(d) != UINT_MAX) + dialog = d; + return (dialog == d); +} + +QString PokeGen::PokeMod::MapEffect::GetName() const +{ + return name; +} + +PokeGen::PokeMod::Point PokeGen::PokeMod::MapEffect::GetCoordinate() const +{ + return coordinate; +} + +unsigned PokeGen::PokeMod::MapEffect::GetCoordinateX() const +{ + return coordinate.GetX(); +} + +unsigned PokeGen::PokeMod::MapEffect::GetCoordinateY() const +{ + return coordinate.GetY(); +} + +PokeGen::PokeMod::Flag PokeGen::PokeMod::MapEffect::GetExistFlag() const +{ + return existFlag; +} + +unsigned PokeGen::PokeMod::MapEffect::GetExistFlagFlag() const +{ + return existFlag.GetFlag(); +} + +unsigned PokeGen::PokeMod::MapEffect::GetExistFlagStatus() const +{ + return existFlag.GetStatus(); +} + +QString PokeGen::PokeMod::MapEffect::GetSkin() const +{ + return skin; +} + +unsigned PokeGen::PokeMod::MapEffect::GetEffect() const +{ + return effect; +} + +unsigned PokeGen::PokeMod::MapEffect::GetVal1() const +{ + return val1; +} + +unsigned PokeGen::PokeMod::MapEffect::GetVal2() const +{ + return val2; +} + +unsigned PokeGen::PokeMod::MapEffect::GetDirection() const +{ + return direction; +} + +bool PokeGen::PokeMod::MapEffect::GetIsTransparent() const +{ + return isTransparent; +} + +bool PokeGen::PokeMod::MapEffect::GetCanMove() const +{ + return canMove; +} + +unsigned PokeGen::PokeMod::MapEffect::GetDialog() const +{ + return dialog; +} |
