summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2008-10-06 00:50:02 +0000
committerBen Boeckel <MathStuf@gmail.com>2008-10-06 00:50:02 +0000
commit2c0a3866e09140d8d5ff84178decddc22db15778 (patch)
tree8d780290c2b1738cb17cec832dd866b068b9a31f
parent61276d172306a14c110a7c3631b484ccf93f9ffa (diff)
downloadsigen-2c0a3866e09140d8d5ff84178decddc22db15778.tar.gz
sigen-2c0a3866e09140d8d5ff84178decddc22db15778.tar.xz
sigen-2c0a3866e09140d8d5ff84178decddc22db15778.zip
[FIX] Added single player option to Sigmod
[FIX] Doxygen generation cleaned up [FIX] Can no longer override variables in the Sigmod if not a single player game [FIX] When checking for modified move priority, blean up afterwards git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@271 6ecfd1a5-f3ed-3746-8530-beee90d26b22
-rw-r--r--CMakeLists.txt18
-rw-r--r--Changelog10
-rw-r--r--Doxyfile33
-rw-r--r--doxygen.cmake47
-rw-r--r--sigbattle/TeamMember.cpp15
-rw-r--r--sigbattle/TeamMember.h2
-rw-r--r--sigmod/Ability.cpp4
-rw-r--r--sigmod/Ability.h137
-rw-r--r--sigmod/Author.cpp4
-rw-r--r--sigmod/Author.h78
-rw-r--r--sigmod/Badge.cpp4
-rw-r--r--sigmod/Badge.h49
-rw-r--r--sigmod/CMakeLists.txt20
-rw-r--r--sigmod/Sigmod.cpp29
-rw-r--r--sigmod/Sigmod.h3
-rw-r--r--sigmodr/SigmodUI.cpp8
-rw-r--r--sigmodr/SigmodUI.h1
-rw-r--r--sigmodr/SoundUI.h2
-rw-r--r--sigmodr/gui/sigmod.ui19
-rw-r--r--sigscript/AbilityWrapper.cpp2
-rw-r--r--sigscript/CoinListObjectWrapper.cpp4
-rw-r--r--sigscript/ItemTypeWrapper.cpp2
-rw-r--r--sigscript/ItemWrapper.cpp4
-rw-r--r--sigscript/MapEffectWrapper.cpp4
-rw-r--r--sigscript/MapTrainerTeamMemberWrapper.cpp2
-rw-r--r--sigscript/MapWarpWrapper.cpp2
-rw-r--r--sigscript/MapWildListEncounterWrapper.cpp4
-rw-r--r--sigscript/MoveWrapper.cpp6
-rw-r--r--sigscript/RulesWrapper.cpp30
-rw-r--r--sigscript/SigmodWrapper.cpp5
-rw-r--r--sigscript/SigmodWrapper.h1
-rw-r--r--sigscript/SpeciesItemWrapper.cpp2
-rw-r--r--sigscript/SpeciesWrapper.cpp8
-rw-r--r--sigscript/TileWrapper.cpp4
-rw-r--r--sigscript/TrainerWrapper.cpp4
35 files changed, 471 insertions, 96 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2736aa08..c243a168 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -74,15 +74,19 @@ ADD_DEPENDENCIES(sigmodr
sigmod
)
-INCLUDE(doxygen.cmake)
-
INSTALL(
- FILES DISCLAIMER LICENSE
- DESTINATION ${CMAKE_INSTALL_PREFIX}/share/doc/${CMAKE_PROJECT_NAME}-${SIGEN_VERSION}
- COMPONENT documentation
+ FILES
+ DISCLAIMER
+ LICENSE
+ DESTINATION
+ ${CMAKE_INSTALL_PREFIX}/share/doc/${CMAKE_PROJECT_NAME}-${SIGEN_VERSION}
+ COMPONENT
+ documentation
)
INSTALL(
- FILES sigmod.knsrc
- DESTINATION ${KDE4_CONFIG_INSTALL_DIR}
+ FILES
+ sigmod.knsrc
+ DESTINATION
+ ${KDE4_CONFIG_INSTALL_DIR}
)
diff --git a/Changelog b/Changelog
index 94b4b6eb..b6f42ce2 100644
--- a/Changelog
+++ b/Changelog
@@ -1,4 +1,14 @@
-----------------
+Rev: 271
+Date: 5 October 2008
+User: MathStuf
+-----------------
+[FIX] Added single player option to Sigmod
+[FIX] Doxygen generation cleaned up
+[FIX] Can no longer override variables in the Sigmod if not a single player game
+[FIX] When checking for modified move priority, blean up afterwards
+
+-----------------
Rev: 270
Date: 27 September 2008
User: MathStuf
diff --git a/Doxyfile b/Doxyfile
index a9407fd2..fa022b80 100644
--- a/Doxyfile
+++ b/Doxyfile
@@ -1,12 +1,12 @@
-# Doxyfile 1.5.6-KDevelop
+# Doxyfile 1.5.6
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
DOXYFILE_ENCODING = UTF-8
-PROJECT_NAME = sigen
+PROJECT_NAME = _PROJECT_NAME
PROJECT_NUMBER = 1
-OUTPUT_DIRECTORY = DOCUMENTATION_OUTPUT_PATH
+OUTPUT_DIRECTORY = DOCUMENTATION_OUTPUT_PATH/_PROJECT_NAME
CREATE_SUBDIRS = YES
OUTPUT_LANGUAGE = English
BRIEF_MEMBER_DESC = YES
@@ -47,11 +47,10 @@ IDL_PROPERTY_SUPPORT = YES
DISTRIBUTE_GROUP_DOC = NO
SUBGROUPING = YES
TYPEDEF_HIDES_STRUCT = NO
-SYMBOL_CACHE_SIZE = 0
#---------------------------------------------------------------------------
# Build related configuration options
#---------------------------------------------------------------------------
-EXTRACT_ALL = YES
+EXTRACT_ALL = NO
EXTRACT_PRIVATE = NO
EXTRACT_STATIC = YES
EXTRACT_LOCAL_CLASSES = YES
@@ -67,7 +66,7 @@ HIDE_SCOPE_NAMES = NO
SHOW_INCLUDE_FILES = YES
INLINE_INFO = YES
SORT_MEMBER_DOCS = YES
-SORT_BRIEF_DOCS = NO
+SORT_BRIEF_DOCS = YES
SORT_GROUP_NAMES = NO
SORT_BY_SCOPE_NAME = NO
GENERATE_TODOLIST = YES
@@ -90,7 +89,7 @@ WARN_IF_UNDOCUMENTED = YES
WARN_IF_DOC_ERROR = YES
WARN_NO_PARAMDOC = YES
WARN_FORMAT = "$file:$line: $text"
-WARN_LOGFILE = DOCUMENTATION_OUTPUT_PATH/warnings
+WARN_LOGFILE = DOCUMENTATION_OUTPUT_PATH/_PROJECT_NAME.warnings
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
@@ -98,6 +97,7 @@ INPUT = PROJECT_SOURCE_DIR
INPUT_ENCODING = UTF-8
FILE_PATTERNS = *.cpp \
*.h \
+ *.dox \
RECURSIVE \
= \
yes
@@ -119,8 +119,8 @@ FILTER_SOURCE_FILES = NO
SOURCE_BROWSER = YES
INLINE_SOURCES = NO
STRIP_CODE_COMMENTS = YES
-REFERENCED_BY_RELATION = YES
-REFERENCES_RELATION = YES
+REFERENCED_BY_RELATION = NO
+REFERENCES_RELATION = NO
REFERENCES_LINK_SOURCE = YES
USE_HTAGS = NO
VERBATIM_HEADERS = YES
@@ -134,7 +134,7 @@ IGNORE_PREFIX =
# configuration options related to the HTML output
#---------------------------------------------------------------------------
GENERATE_HTML = YES
-HTML_OUTPUT = html
+HTML_OUTPUT = .
HTML_FILE_EXTENSION = .html
HTML_HEADER =
HTML_FOOTER =
@@ -147,9 +147,6 @@ DOCSET_BUNDLE_ID = org.doxygen.Project
HTML_DYNAMIC_SECTIONS = NO
CHM_FILE =
HHC_LOCATION =
-QTHELP_FILE =
-QTHELP_CONFIG =
-DOXYGEN2QTHELP_LOC =
GENERATE_CHI = NO
CHM_INDEX_ENCODING =
BINARY_TOC = NO
@@ -224,8 +221,8 @@ SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
# Configuration::additions related to external references
#---------------------------------------------------------------------------
-TAGFILES =
-GENERATE_TAGFILE =
+TAGFILES = TAG_FILES
+GENERATE_TAGFILE = DOCUMENTATION_OUTPUT_PATH/_PROJECT_NAME.tag
ALLEXTERNALS = YES
EXTERNAL_GROUPS = YES
PERL_PATH = /usr/bin/perl
@@ -239,12 +236,12 @@ HAVE_DOT = YES
DOT_FONTNAME = FreeSans
DOT_FONTPATH =
CLASS_GRAPH = YES
-COLLABORATION_GRAPH = YES
+COLLABORATION_GRAPH = NO
GROUP_GRAPHS = YES
-UML_LOOK = YES
+UML_LOOK = NO
TEMPLATE_RELATIONS = NO
INCLUDE_GRAPH = YES
-INCLUDED_BY_GRAPH = YES
+INCLUDED_BY_GRAPH = NO
CALL_GRAPH = NO
CALLER_GRAPH = NO
GRAPHICAL_HIERARCHY = YES
diff --git a/doxygen.cmake b/doxygen.cmake
index 63224759..22e904d1 100644
--- a/doxygen.cmake
+++ b/doxygen.cmake
@@ -2,33 +2,48 @@ FIND_PACKAGE(Doxygen)
IF(DOXYGEN_EXECUTABLE AND UNIX)
ADD_CUSTOM_COMMAND(
- OUTPUT ${DOCUMENTATION_OUTPUT_PATH}
- COMMAND mkdir ${DOCUMENTATION_OUTPUT_PATH}
+ OUTPUT
+ ${DOCUMENTATION_OUTPUT_PATH}/${PROJECT_NAME}
+ COMMAND
+ mkdir -p ${DOCUMENTATION_OUTPUT_PATH}/${PROJECT_NAME}
)
ADD_CUSTOM_COMMAND(
- OUTPUT ${DOCUMENTATION_OUTPUT_PATH}/Doxyfile
- COMMAND sed ${CMAKE_SOURCE_DIR}/Doxyfile -e 's!PROJECT_SOURCE_DIR!${PROJECT_SOURCE_DIR}!' -e 's!DOCUMENTATION_OUTPUT_PATH!${DOCUMENTATION_OUTPUT_PATH}!' > Doxyfile
- DEPENDS Doxyfile
- DEPENDS ${DOCUMENTATION_OUTPUT_PATH}
- WORKING_DIRECTORY ${DOCUMENTATION_OUTPUT_PATH}
+ OUTPUT
+ ${DOCUMENTATION_OUTPUT_PATH}/${PROJECT_NAME}/Doxyfile
+ COMMAND
+ sed ${CMAKE_SOURCE_DIR}/Doxyfile -e 's!PROJECT_SOURCE_DIR!${PROJECT_SOURCE_DIR}!g' -e 's!DOCUMENTATION_OUTPUT_PATH!${DOCUMENTATION_OUTPUT_PATH}!g' -e 's!_PROJECT_NAME!${PROJECT_NAME}!g' -e 's!TAG_FILES!${TAG_FILES}!g' > Doxyfile
+ DEPENDS
+ ${CMAKE_SOURCE_DIR}/Doxyfile
+ ${DOCUMENTATION_OUTPUT_PATH}/${PROJECT_NAME}
+ WORKING_DIRECTORY
+ ${DOCUMENTATION_OUTPUT_PATH}/${PROJECT_NAME}
)
ADD_CUSTOM_COMMAND(
- OUTPUT ${DOCUMENTATION_OUTPUT_PATH}/html
- COMMAND ${DOXYGEN_EXECUTABLE}
- DEPENDS ${DOCUMENTATION_OUTPUT_PATH}/Doxyfile
- WORKING_DIRECTORY ${DOCUMENTATION_OUTPUT_PATH}
+ OUTPUT
+ ${DOCUMENTATION_OUTPUT_PATH}/${PROJECT_NAME}/index.html
+ COMMAND
+ ${DOXYGEN_EXECUTABLE}
+ DEPENDS
+ ${DOCUMENTATION_OUTPUT_PATH}/${PROJECT_NAME}/Doxyfile
+ WORKING_DIRECTORY
+ ${DOCUMENTATION_OUTPUT_PATH}/${PROJECT_NAME}
)
ADD_CUSTOM_TARGET(doxygen
- ALL echo
- DEPENDS ${DOCUMENTATION_OUTPUT_PATH}/html
+ ALL
+ echo
+ DEPENDS
+ ${DOCUMENTATION_OUTPUT_PATH}/${PROJECT_NAME}/index.html
)
INSTALL(
- DIRECTORY ${DOCUMENTATION_OUTPUT_PATH}/html
- DESTINATION ${CMAKE_INSTALL_PREFIX}/share/doc/${CMAKE_PROJECT_NAME}-${SIGEN_VERSION}
- COMPONENT documentation
+ DIRECTORY
+ ${DOCUMENTATION_OUTPUT_PATH}/${PROJECT_NAME}
+ DESTINATION
+ ${CMAKE_INSTALL_PREFIX}/share/doc/${CMAKE_PROJECT_NAME}-${SIGEN_VERSION}/${PROJECT_NAME}
+ COMPONENT
+ documentation
)
ENDIF(DOXYGEN_EXECUTABLE AND UNIX)
diff --git a/sigbattle/TeamMember.cpp b/sigbattle/TeamMember.cpp
index b0742380..c7ce437a 100644
--- a/sigbattle/TeamMember.cpp
+++ b/sigbattle/TeamMember.cpp
@@ -51,16 +51,23 @@
// C includes
#include <cmath>
-int Sigbattle::actionPriority(const TeamMember* teamMember, const TeamMember::Action& action)
+int Sigbattle::actionPriority(TeamMember* teamMember, const TeamMember::Action& action)
{
int priority = INT_MAX;
switch (action.first)
{
case TeamMember::Attack:
- if (teamMember->hasValueOfType<int>("priority"))
-
- priority = teamMember->sigmod()->move(action.second.first.toString())->priority();
+ {
+ QString move = action.second.first.toString();
+ if (teamMember->hasValueOfType<int>(QString("move-priority-%1").arg(move)))
+ {
+ priority = teamMember->valueOfType<int>(QString("move-priority-%1").arg(move));
+ teamMember->removeValue(QString("move-priority-%1").arg(move));
+ }
+ else
+ priority = teamMember->sigmod()->move(move)->priority();
break;
+ }
case TeamMember::Item:
priority = INT_MIN / 3;
break;
diff --git a/sigbattle/TeamMember.h b/sigbattle/TeamMember.h
index 2104bc2f..674f8e30 100644
--- a/sigbattle/TeamMember.h
+++ b/sigbattle/TeamMember.h
@@ -206,7 +206,7 @@ class SIGBATTLE_EXPORT TeamMember : public Sigscript::Config
void initStats();
};
-int actionPriority(const TeamMember* teamMember, const TeamMember::Action& action);
+int actionPriority(TeamMember* teamMember, const TeamMember::Action& action);
}
Q_DECLARE_METATYPE(Sigbattle::TeamMember*)
diff --git a/sigmod/Ability.cpp b/sigmod/Ability.cpp
index 36976e3e..1296418f 100644
--- a/sigmod/Ability.cpp
+++ b/sigmod/Ability.cpp
@@ -15,6 +15,10 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+/**
+ * \file sigmod/Ability.cpp
+ */
+
// Header include
#include "Ability.h"
diff --git a/sigmod/Ability.h b/sigmod/Ability.h
index 058cd9f4..5890362a 100644
--- a/sigmod/Ability.h
+++ b/sigmod/Ability.h
@@ -15,6 +15,10 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+/**
+ * \file sigmod/Ability.h
+ */
+
#ifndef SIGMOD_ABILITY
#define SIGMOD_ABILITY
@@ -27,33 +31,166 @@ namespace Sigmod
// Forward declarations
class Sigmod;
+/**
+ * \class Sigmod::Ability Ability.h sigmod/Ability.h
+ * \brief Class describing an ability.
+ *
+ * Abilities work as helpers in battle. Some common uses are:
+ *
+ * - Nullifying status effects
+ * - Manipulating the weather
+ * - Providing support in times of need
+ */
class SIGMOD_EXPORT Ability : public Object
{
Q_OBJECT
public:
+ /**
+ * Copy constructor.
+ *
+ * \param ability The ability to copy.
+ */
Ability(const Ability& ability);
+ /**
+ * Create a new ability belonging to \p parent and id \p id.
+ *
+ * \param parent The parent of the ability.
+ * \param id The id number for the ability.
+ */
Ability(const Sigmod* parent, const int id);
+ /**
+ * Data copy constructor. Copies the data from \p ability and parents the new ability with \p parent and id \p id.
+ *
+ * \param ability The ability to copy the data from.
+ * \param parent The parent of the ability.
+ * \param id The id number for the ability.
+ */
Ability(const Ability& ability, const Sigmod* parent, const int id);
+ /**
+ * XML data constructor.
+ *
+ * \param xml The XML structure to extract the data from.
+ * \param parent The parent of the ability.
+ * \param id The id number for the ability.
+ */
Ability(const QDomElement& xml, const Sigmod* parent, const int id = -1);
+ /**
+ * Check to make sure the ability is valid.
+ * \note This does not check the scripts for anything.
+ * \todo Check scripts for syntax errors (require Kross).
+ */
void validate();
+ /**
+ * Load data from XML.
+ *
+ * \param xml The XML structure to extract data from.
+ */
void load(const QDomElement& xml);
+ /**
+ * Get the data for the ability in XML format.
+ *
+ * \return The XML structure representing the ability.
+ */
QDomElement save() const;
+ /**
+ * Set the name of the ability used in the game.
+ *
+ * \param name The name of the ability.
+ */
void setName(const QString& name);
+ /**
+ * Set the priority of the ability. The priority is used by the battle engine determine which abilities get executed first.
+ * Lower values go before higher values. Use the \link Ability::setPriorityScript priority script \endlink for how to modify
+ * it based on the environment in the arena.
+ *
+ * \param priority The priority of the ability.
+ */
void setPriority(const int priority);
+ /**
+ * Set the description of the ability. The description should be a snippet of text describing the ability to the player.
+ *
+ * \param description The description of the ability.
+ */
void setDescription(const QString& description);
+ /**
+ * Set the script for the ability when in battle. This script defines the behavior of the ability when in a battle.
+ * The following objects are available:
+ *
+ * - \b owner -- The \link Sigbattle::TeamMember team member \endlink which owns the instance of the ability.
+ * - \b client -- The \link Sigbattle::Client client \endlink which is choosing the actions of the ability.
+ * - \b sigmod -- Wrapper for the \link Sigscript::SigmodWrapper Sigmod \endlink in use.
+ * - \b arena -- The \link Sigbattle::Arena arena \endlink the ability is being used in.
+ *
+ * \param battleScript The script for the ability when in battle.
+ */
void setBattleScript(const Script& battleScript);
+ /**
+ * Set the script for the ability when on the world map. This script defines the behavior of the ability when on the world map.
+ * The following objects are available:
+ *
+ * - \b owner -- The \link Sigbattle::TeamMember team member \endlink which owns the instance of the ability.
+ * - \b client -- The \link Sigbattle::Client client \endlink which is choosing the actions of the ability.
+ * - \b sigmod -- Wrapper for the \link Sigscript::SigmodWrapper Sigmod \endlink in use.
+ * - \b map -- The \link Sigmap::Map map \endlink the player is on.
+ *
+ * \param worldScript The script for the ability when on the world map.
+ */
void setWorldScript(const Script& worldScript);
+ /**
+ * Set the script that determines the priority of the ability. This script allows the ability to change its priority based on what
+ * is happening in the \link Sigbattle::Arena arena \endlink. The following objects are available:
+ *
+ * - \b owner -- The \link Sigbattle::TeamMember team member \endlink which owns the instance of the ability.
+ * - \b sigmod -- Wrapper for the \link Sigscript::SigmodWrapper Sigmod \endlink in use.
+ * - \b arena -- The \link Sigbattle::Arena arena \endlink the ability is being used in.
+ *
+ * To override the priority given by the ability, set the \p ability-priority-%name (where "%name" is the name of the ability)
+ * value in the \p owner. Setting it in the \link Sigscript::SigmodWrapper Sigmod \endlink will cause all instances of the
+ * ability to have the new priority.
+ *
+ * \param priorityScript The script that determines the priority of the ability.
+ */
void setPriorityScript(const Script& priorityScript);
+ /**
+ * \sa setName
+ *
+ * \return The name of the ability.
+ */
QString name() const;
+ /**
+ * \sa setPriority
+ *
+ * \return The priority of the ability.
+ */
int priority() const;
+ /**
+ * \sa setDescription
+ *
+ * \return The description of the ability.
+ */
QString description() const;
+ /**
+ * \sa setBattleScript
+ *
+ * \return The script that controls the ability in battle.
+ */
Script battleScript() const;
+ /**
+ * \sa setWorldScript
+ *
+ * \return The script that controls the ability on the world map.
+ */
Script worldScript() const;
+ /**
+ * \sa setPriorityScript
+ *
+ * \return The script that changes the priority when necessary.
+ */
Script priorityScript() const;
Ability& operator=(const Ability& rhs);
diff --git a/sigmod/Author.cpp b/sigmod/Author.cpp
index 2cca635f..a8ee02fd 100644
--- a/sigmod/Author.cpp
+++ b/sigmod/Author.cpp
@@ -15,6 +15,10 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+/**
+ * \file sigmod/Author.cpp
+ */
+
// Header include
#include "Author.h"
diff --git a/sigmod/Author.h b/sigmod/Author.h
index 413fece6..b0b322a0 100644
--- a/sigmod/Author.h
+++ b/sigmod/Author.h
@@ -15,6 +15,10 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+/**
+ * \file sigmod/Author.h
+ */
+
#ifndef SIGMOD_AUTHOR
#define SIGMOD_AUTHOR
@@ -26,27 +30,101 @@ namespace Sigmod
// Forward declarations
class Sigmod;
+/**
+ * \class Sigmod::Author Author.h sigmod/Author.h
+ * \brief Class describing an author of the %Sigmod.
+ *
+ * Authors are used to allow scripts to create credits.
+ */
class SIGMOD_EXPORT Author : public Object
{
Q_OBJECT
public:
+ /**
+ * Copy constructor.
+ *
+ * \param author The author to copy.
+ */
Author(const Author& author);
+ /**
+ * Create a new author belonging to \p parent and id \p id.
+ *
+ * \param parent The parent of the author.
+ * \param id The id number for the author.
+ */
Author(const Sigmod* parent, const int id);
+ /**
+ * Data copy constructor. Copies the data from \p author and parents the new author with \p parent and id \p id.
+ *
+ * \param author The author to copy the data from.
+ * \param parent The parent of the author.
+ * \param id The id number for the author.
+ */
Author(const Author& author, const Sigmod* parent, const int id);
+ /**
+ * XML data constructor.
+ *
+ * \param xml The XML structure to extract the data from.
+ * \param parent The parent of the author.
+ * \param id The id number for the author.
+ */
Author(const QDomElement& xml, const Sigmod* parent, const int id = -1);
+ /**
+ * Check to make sure the author is valid.
+ */
void validate();
+ /**
+ * Load data from XML.
+ *
+ * \param xml The XML structure to extract data from.
+ */
void load(const QDomElement& xml);
+ /**
+ * Get the data for the author in XML format.
+ *
+ * \return The XML structure representing the author.
+ */
QDomElement save() const;
+ /**
+ * Set the name of the author.
+ *
+ * \param name The name of the author.
+ */
void setName(const QString& name);
+ /**
+ * Set the email of the author. It is not checked to be well-formed until the author is \link Author::validate \p validate \endlink is called.
+ *
+ * \param email The email of the author.
+ */
void setEmail(const QString& email);
+ /**
+ * Set what the author did for the %Sigmod. The default credits generator assumes that the roles are comma-separated.
+ *
+ * \param role The role(s) of the author.
+ */
void setRole(const QString& role);
+ /**
+ * \sa setName
+ *
+ * \return The name of the author.
+ */
QString name() const;
+ /**
+ * \sa setEmail
+ *
+ * \return The email address of the author.
+ */
QString email() const;
+ /**
+ * \sa setRole
+ *
+ * \return The role(s) of the author.
+ */
QString role() const;
Author& operator=(const Author& rhs);
diff --git a/sigmod/Badge.cpp b/sigmod/Badge.cpp
index 231fba47..8a050520 100644
--- a/sigmod/Badge.cpp
+++ b/sigmod/Badge.cpp
@@ -15,6 +15,10 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+/**
+ * \file sigmod/Badge.cpp
+ */
+
// Header include
#include "Badge.h"
diff --git a/sigmod/Badge.h b/sigmod/Badge.h
index dda68ec8..debe7abe 100644
--- a/sigmod/Badge.h
+++ b/sigmod/Badge.h
@@ -15,6 +15,10 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+/**
+ * \file sigmod/Badge.h
+ */
+
#ifndef SIGMOD_BADGE
#define SIGMOD_BADGE
@@ -27,19 +31,64 @@ namespace Sigmod
// Forward declarations
class Sigmod;
+/**
+ * \class Sigmod::Badge Badge.h sigmod/Badge.h
+ * \brief Class describing a badge.
+ *
+ * Badges are used to show a trainer's worthiness. Without them, team members that are too high leveled may not
+ * listen to its trainer. Some badges also boost stats (only with in-game battles).
+ */
class SIGMOD_EXPORT Badge : public Object
{
Q_OBJECT
public:
+ /**
+ * Copy constructor.
+ *
+ * \param badge The badge to copy.
+ */
Badge(const Badge& badge);
+ /**
+ * Create a new badge belonging to \p parent and id \p id.
+ *
+ * \param parent The parent of the badge.
+ * \param id The id number for the badge.
+ */
Badge(const Sigmod* parent, const int id);
+ /**
+ * Data copy constructor. Copies the data from \p badge and parents the new badge with \p parent and id \p id.
+ *
+ * \param ability The badge to copy the data from.
+ * \param parent The parent of the badge.
+ * \param id The id number for the badge.
+ */
Badge(const Badge& badge, const Sigmod* parent, const int id);
+ /**
+ * XML data constructor.
+ *
+ * \param xml The XML structure to extract the data from.
+ * \param parent The parent of the badge.
+ * \param id The id number for the badge.
+ */
Badge(const QDomElement& xml, const Sigmod* parent, const int id = -1);
+ /**
+ * Check to make sure the badge is valid.
+ */
void validate();
+ /**
+ * Load data from XML.
+ *
+ * \param xml The XML structure to extract data from.
+ */
void load(const QDomElement& xml);
+ /**
+ * Get the data for the badge in XML format.
+ *
+ * \return The XML structure representing the badge.
+ */
QDomElement save() const;
void setName(const QString& name);
diff --git a/sigmod/CMakeLists.txt b/sigmod/CMakeLists.txt
index 674508fd..5a16e49e 100644
--- a/sigmod/CMakeLists.txt
+++ b/sigmod/CMakeLists.txt
@@ -111,14 +111,22 @@ TARGET_LINK_LIBRARIES(sigmod
${QT_QTXML_LIBRARY}
)
+INCLUDE(../doxygen.cmake)
+
INSTALL(
- TARGETS sigmod
- DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}
- COMPONENT runtime
+ TARGETS
+ sigmod
+ DESTINATION
+ ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}
+ COMPONENT
+ runtime
)
INSTALL(
- FILES ${sigmod_DEVEL}
- DESTINATION ${CMAKE_INSTALL_PREFIX}/include/${CMAKE_PROJECT_NAME}/${PROJECT_NAME}
- COMPONENT development
+ FILES
+ ${sigmod_DEVEL}
+ DESTINATION
+ ${CMAKE_INSTALL_PREFIX}/include/${CMAKE_PROJECT_NAME}/${PROJECT_NAME}
+ COMPONENT
+ development
)
diff --git a/sigmod/Sigmod.cpp b/sigmod/Sigmod.cpp
index 05149f9c..753847c3 100644
--- a/sigmod/Sigmod.cpp
+++ b/sigmod/Sigmod.cpp
@@ -52,6 +52,7 @@ Sigmod::Sigmod::Sigmod() :
m_title(""),
m_version(""),
m_description(""),
+ m_singlePlayer(true),
m_startMap(INT_MAX),
m_startWarp(INT_MAX),
m_typechart(0, 0),
@@ -88,10 +89,13 @@ void Sigmod::Sigmod::validate()
emit(error("Version is empty"));
if (m_description.isEmpty())
emit(warning("Description is empty"));
- if (mapIndex(m_startMap) == INT_MAX)
- emit(error("Invalid starting map"));
- else if (mapById(m_startMap)->warpIndex(m_startWarp) == INT_MAX)
- emit(error("Invalid starting warp"));
+ if (m_singlePlayer)
+ {
+ if (mapIndex(m_startMap) == INT_MAX)
+ emit(error("Invalid starting map"));
+ else if (mapById(m_startMap)->warpIndex(m_startWarp) == INT_MAX)
+ emit(error("Invalid starting warp"));
+ }
if ((m_typechart.width() != typeCount()) || (m_typechart.height() != typeCount()))
emit(error("Type chart is invalid"));
TEST_CHILD(m_rules);
@@ -277,6 +281,7 @@ void Sigmod::Sigmod::load(const QDomElement& xml)
LOAD(title);
LOAD(version);
LOAD(description);
+ LOAD(singlePlayer);
LOAD(startMap);
LOAD(startWarp);
LOAD_Rules();
@@ -312,6 +317,7 @@ QDomElement Sigmod::Sigmod::save() const
SAVE(title);
SAVE(version);
SAVE(description);
+ SAVE(singlePlayer);
SAVE(startMap);
SAVE(startWarp);
SAVE_Rules(rules);
@@ -356,8 +362,15 @@ void Sigmod::Sigmod::setDescription(const QString& description)
CHECK(description);
}
+void Sigmod::Sigmod::setSinglePlayer(const bool singlePlayer)
+{
+ CHECK(singlePlayer);
+}
+
void Sigmod::Sigmod::setStartMap(const int startMap)
{
+ if (!m_singlePlayer)
+ emit(error(unused("startMap")));
if (mapIndex(startMap) == INT_MAX)
emit(error(bounds("startMap")));
else
@@ -366,6 +379,8 @@ void Sigmod::Sigmod::setStartMap(const int startMap)
void Sigmod::Sigmod::setStartWarp(const int startWarp)
{
+ if (!m_singlePlayer)
+ emit(error(unused("startWarp")));
if (mapIndex(m_startMap) == INT_MAX)
emit(error(bounds("startMap")));
else if (mapById(m_startMap)->warpIndex(startWarp) == INT_MAX)
@@ -404,6 +419,11 @@ QString Sigmod::Sigmod::description() const
return m_description;
}
+bool Sigmod::Sigmod::singlePlayer() const
+{
+ return m_singlePlayer;
+}
+
int Sigmod::Sigmod::startMap() const
{
return m_startMap;
@@ -2165,6 +2185,7 @@ Sigmod::Sigmod& Sigmod::Sigmod::operator=(const Sigmod& rhs)
COPY(title);
COPY(version);
COPY(description);
+ COPY(singlePlayer);
COPY(startMap);
COPY(startWarp);
COPY(typechart);
diff --git a/sigmod/Sigmod.h b/sigmod/Sigmod.h
index cdd3f6f6..e902aaac 100644
--- a/sigmod/Sigmod.h
+++ b/sigmod/Sigmod.h
@@ -69,6 +69,7 @@ class SIGMOD_EXPORT Sigmod : public Object
void setTitle(const QString& title);
void setVersion(const QString& version);
void setDescription(const QString& description);
+ void setSinglePlayer(const bool singlePlayer);
void setStartMap(const int startMap);
void setStartWarp(const int startWarp);
void setTypechart(const int attack, const int defense, const Fraction& multiplier);
@@ -78,6 +79,7 @@ class SIGMOD_EXPORT Sigmod : public Object
QString title() const;
QString version() const;
QString description() const;
+ bool singlePlayer() const;
int startMap() const;
int startWarp() const;
const Matrix<Fraction>* typechart() const;
@@ -425,6 +427,7 @@ class SIGMOD_EXPORT Sigmod : public Object
QString m_title;
QString m_version;
QString m_description;
+ bool m_singlePlayer;
int m_startMap;
int m_startWarp;
Matrix<Fraction> m_typechart;
diff --git a/sigmodr/SigmodUI.cpp b/sigmodr/SigmodUI.cpp
index 31d37a13..4b3defca 100644
--- a/sigmodr/SigmodUI.cpp
+++ b/sigmodr/SigmodUI.cpp
@@ -67,7 +67,9 @@ void Sigmodr::SigmodUI::setGui()
varTitle->setText(qobject_cast<Sigmod::Sigmod*>(modified())->title());
varVersion->setText(qobject_cast<Sigmod::Sigmod*>(modified())->version());
varDescription->setText(qobject_cast<Sigmod::Sigmod*>(modified())->description());
+ varSinglePlayer->setChecked(qobject_cast<Sigmod::Sigmod*>(modified())->singlePlayer() ? Qt::Checked : Qt::Unchecked);
varMap->setCurrentIndex(varMap->findData(qobject_cast<Sigmod::Sigmod*>(modified())->startMap()));
+ varMap->setEnabled(qobject_cast<Sigmod::Sigmod*>(modified())->singlePlayer());
m_lastMap = qobject_cast<Sigmod::Sigmod*>(modified())->startMap();
if (resetWarps)
{
@@ -86,6 +88,7 @@ void Sigmodr::SigmodUI::setGui()
varWarp->blockSignals(blocked);
}
varWarp->setCurrentIndex(varWarp->findData(qobject_cast<Sigmod::Sigmod*>(modified())->startWarp()));
+ varWarp->setEnabled(qobject_cast<Sigmod::Sigmod*>(modified())->singlePlayer());
}
void Sigmodr::SigmodUI::apply()
@@ -123,6 +126,11 @@ void Sigmodr::SigmodUI::on_varDescription_textChanged(const QString& description
varDescription->setCursorPosition(cursor);
}
+void Sigmodr::SigmodUI::on_varSinglePlayer_clicked(const bool singlePlayer)
+{
+ qobject_cast<Sigmod::Sigmod*>(modified())->setSinglePlayer(singlePlayer);
+}
+
void Sigmodr::SigmodUI::on_varMap_activated(const int map)
{
qobject_cast<Sigmod::Sigmod*>(modified())->setStartMap(varMap->itemData(map).toInt());
diff --git a/sigmodr/SigmodUI.h b/sigmodr/SigmodUI.h
index 44dd9f1d..7610f078 100644
--- a/sigmodr/SigmodUI.h
+++ b/sigmodr/SigmodUI.h
@@ -46,6 +46,7 @@ class SigmodUI : public ObjectUI, private Ui::formSigmod
void on_varTitle_textChanged(const QString& title);
void on_varVersion_textChanged(const QString& version);
void on_varDescription_textChanged(const QString& description);
+ void on_varSinglePlayer_clicked(const bool singlePlayer);
void on_varMap_activated(const int map);
void on_varWarp_activated(const int warp);
void on_varTypechart_clicked(const QModelIndex& index);
diff --git a/sigmodr/SoundUI.h b/sigmodr/SoundUI.h
index bdeca309..141d5ed2 100644
--- a/sigmodr/SoundUI.h
+++ b/sigmodr/SoundUI.h
@@ -16,7 +16,7 @@
*/
#ifndef SIGMODR_SOUNDUI
-#define SIGMODR_SOUNFUI
+#define SIGMODR_SOUNDUI
// Sigmodr includes
#include "ObjectUI.h"
diff --git a/sigmodr/gui/sigmod.ui b/sigmodr/gui/sigmod.ui
index 296b0d21..19f05452 100644
--- a/sigmodr/gui/sigmod.ui
+++ b/sigmodr/gui/sigmod.ui
@@ -85,6 +85,25 @@
</widget>
</item>
<item>
+ <widget class="QGroupBox" name="varSinglePlayer" >
+ <property name="title" >
+ <string>Single Player</string>
+ </property>
+ <property name="checkable" >
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" >
+ <string>Whether the Sigmod is meant to be played as a single player game or as a MMO</string>
+ </property>
+ <property name="statusTip" >
+ <string>Whether the Sigmod is meant to be played as a single player game or as a MMO</string>
+ </property>
+ <property name="whatsThis" >
+ <string>Whether the Sigmod is meant to be played as a single player game or as a MMO</string>
+ </property>
+ </widget>
+ </item>
+ <item>
<widget class="QGroupBox" name="boxStartPosition" >
<property name="title" >
<string>Start Position</string>
diff --git a/sigscript/AbilityWrapper.cpp b/sigscript/AbilityWrapper.cpp
index 35e8dd82..42a40541 100644
--- a/sigscript/AbilityWrapper.cpp
+++ b/sigscript/AbilityWrapper.cpp
@@ -41,7 +41,7 @@ QString Sigscript::AbilityWrapper::name() const
int Sigscript::AbilityWrapper::priority() const
{
- if (hasValueOfType<int>("priority"))
+ if (sigmod()->singlePlayer() && hasValueOfType<int>("priority"))
return valueOfType<int>("priority");
return m_ability->priority();
}
diff --git a/sigscript/CoinListObjectWrapper.cpp b/sigscript/CoinListObjectWrapper.cpp
index b0b540a5..6520b8d1 100644
--- a/sigscript/CoinListObjectWrapper.cpp
+++ b/sigscript/CoinListObjectWrapper.cpp
@@ -65,14 +65,14 @@ Sigscript::SpeciesWrapper* Sigscript::CoinListObjectWrapper::speciesObject()
int Sigscript::CoinListObjectWrapper::amount() const
{
- if (hasValueOfType<int>("amount"))
+ if (sigmod()->singlePlayer() && hasValueOfType<int>("amount"))
return valueOfType<int>("amount");
return m_object->amount();
}
int Sigscript::CoinListObjectWrapper::cost() const
{
- if (hasValueOfType<int>("cost"))
+ if (sigmod()->singlePlayer() && hasValueOfType<int>("cost"))
return valueOfType<int>("cost");
return m_object->cost();
}
diff --git a/sigscript/ItemTypeWrapper.cpp b/sigscript/ItemTypeWrapper.cpp
index aebd20c3..ae3fb45a 100644
--- a/sigscript/ItemTypeWrapper.cpp
+++ b/sigscript/ItemTypeWrapper.cpp
@@ -60,7 +60,7 @@ int Sigscript::ItemTypeWrapper::player() const
int Sigscript::ItemTypeWrapper::maxWeight() const
{
- if (hasValueOfType<int>("maxWeight"))
+ if (sigmod()->singlePlayer() && hasValueOfType<int>("maxWeight"))
return valueOfType<int>("maxWeight");
return m_itemType->maxWeight();
}
diff --git a/sigscript/ItemWrapper.cpp b/sigscript/ItemWrapper.cpp
index 18803dbb..642b6303 100644
--- a/sigscript/ItemWrapper.cpp
+++ b/sigscript/ItemWrapper.cpp
@@ -51,14 +51,14 @@ Sigscript::ItemTypeWrapper* Sigscript::ItemWrapper::type()
int Sigscript::ItemWrapper::price() const
{
- if (hasValueOfType<int>("price"))
+ if (sigmod()->singlePlayer() && hasValueOfType<int>("price"))
return valueOfType<int>("price");
return m_item->price();
}
int Sigscript::ItemWrapper::sellPrice() const
{
- if (hasValueOfType<int>("sellPrice"))
+ if (sigmod()->singlePlayer() && hasValueOfType<int>("sellPrice"))
return valueOfType<int>("sellPrice");
return m_item->sellPrice();
}
diff --git a/sigscript/MapEffectWrapper.cpp b/sigscript/MapEffectWrapper.cpp
index 52bd4de9..c06d7c10 100644
--- a/sigscript/MapEffectWrapper.cpp
+++ b/sigscript/MapEffectWrapper.cpp
@@ -42,7 +42,7 @@ QString Sigscript::MapEffectWrapper::name() const
QPoint Sigscript::MapEffectWrapper::coordinate() const
{
- if (hasValueOfType<QPoint>("coordinate"))
+ if (sigmod()->singlePlayer() && hasValueOfType<QPoint>("coordinate"))
return valueOfType<QPoint>("coordinate");
return m_effect->coordinate();
}
@@ -54,7 +54,7 @@ Sigscript::SkinWrapper* Sigscript::MapEffectWrapper::skin()
bool Sigscript::MapEffectWrapper::isGhost() const
{
- if (hasValueOfType<bool>("ghost"))
+ if (sigmod()->singlePlayer() && hasValueOfType<bool>("ghost"))
return valueOfType<bool>("ghost");
return m_effect->isGhost();
}
diff --git a/sigscript/MapTrainerTeamMemberWrapper.cpp b/sigscript/MapTrainerTeamMemberWrapper.cpp
index e875008a..74e500c4 100644
--- a/sigscript/MapTrainerTeamMemberWrapper.cpp
+++ b/sigscript/MapTrainerTeamMemberWrapper.cpp
@@ -42,7 +42,7 @@ Sigscript::SpeciesWrapper* Sigscript::MapTrainerTeamMemberWrapper::species()
int Sigscript::MapTrainerTeamMemberWrapper::level() const
{
- if (hasValueOfType<int>("level"))
+ if (sigmod()->singlePlayer() && hasValueOfType<int>("level"))
return valueOfType<int>("level");
return m_teamMember->level();
}
diff --git a/sigscript/MapWarpWrapper.cpp b/sigscript/MapWarpWrapper.cpp
index bacba9b0..d09646cf 100644
--- a/sigscript/MapWarpWrapper.cpp
+++ b/sigscript/MapWarpWrapper.cpp
@@ -55,7 +55,7 @@ QString Sigscript::MapWarpWrapper::name() const
QPoint Sigscript::MapWarpWrapper::coordinate() const
{
- if (hasValueOfType<QPoint>("coordinate"))
+ if (sigmod()->singlePlayer() && hasValueOfType<QPoint>("coordinate"))
return valueOfType<QPoint>("coordinate");
return m_warp->coordinate();
}
diff --git a/sigscript/MapWildListEncounterWrapper.cpp b/sigscript/MapWildListEncounterWrapper.cpp
index 1eea2ce8..3fd49c9c 100644
--- a/sigscript/MapWildListEncounterWrapper.cpp
+++ b/sigscript/MapWildListEncounterWrapper.cpp
@@ -42,14 +42,14 @@ Sigscript::SpeciesWrapper* Sigscript::MapWildListEncounterWrapper::species()
int Sigscript::MapWildListEncounterWrapper::level() const
{
- if (hasValueOfType<int>("level"))
+ if (sigmod()->singlePlayer() && hasValueOfType<int>("level"))
return valueOfType<int>("level");
return m_encounter->level();
}
int Sigscript::MapWildListEncounterWrapper::weight() const
{
- if (hasValueOfType<int>("weight"))
+ if (sigmod()->singlePlayer() && hasValueOfType<int>("weight"))
return valueOfType<int>("weight");
return m_encounter->weight();
}
diff --git a/sigscript/MoveWrapper.cpp b/sigscript/MoveWrapper.cpp
index 6c21cc38..60dc2729 100644
--- a/sigscript/MoveWrapper.cpp
+++ b/sigscript/MoveWrapper.cpp
@@ -41,14 +41,14 @@ QString Sigscript::MoveWrapper::name() const
Sigmod::Fraction Sigscript::MoveWrapper::accuracy() const
{
- if (hasValueOfType<Sigmod::Fraction>("accuracy"))
+ if (sigmod()->singlePlayer() && hasValueOfType<Sigmod::Fraction>("accuracy"))
return valueOfType<Sigmod::Fraction>("accuracy");
return m_move->accuracy();
}
int Sigscript::MoveWrapper::power() const
{
- if (hasValueOfType<int>("power"))
+ if (sigmod()->singlePlayer() && hasValueOfType<int>("power"))
return valueOfType<int>("power");
return m_move->power();
}
@@ -70,7 +70,7 @@ int Sigscript::MoveWrapper::powerPoints() const
int Sigscript::MoveWrapper::priority() const
{
- if (hasValueOfType<int>("priority"))
+ if (sigmod()->singlePlayer() && hasValueOfType<int>("priority"))
return valueOfType<int>("priority");
return m_move->priority();
}
diff --git a/sigscript/RulesWrapper.cpp b/sigscript/RulesWrapper.cpp
index a5374678..662383f3 100644
--- a/sigscript/RulesWrapper.cpp
+++ b/sigscript/RulesWrapper.cpp
@@ -56,49 +56,49 @@ bool Sigscript::RulesWrapper::useTurns() const
bool Sigscript::RulesWrapper::pausedATB() const
{
- if (hasValueOfType<bool>("pausedATB"))
+ if (sigmod()->singlePlayer() && hasValueOfType<bool>("pausedATB"))
return valueOfType<bool>("pausedATB");
return m_rules->pausedATB();
}
int Sigscript::RulesWrapper::numBoxes() const
{
- if (hasValueOfType<int>("numBoxes"))
+ if (sigmod()->singlePlayer() && hasValueOfType<int>("numBoxes"))
return valueOfType<int>("numBoxes");
return m_rules->numBoxes();
}
int Sigscript::RulesWrapper::boxSize() const
{
- if (hasValueOfType<int>("boxSize"))
+ if (sigmod()->singlePlayer() && hasValueOfType<int>("boxSize"))
return valueOfType<int>("boxSize");
return m_rules->boxSize();
}
int Sigscript::RulesWrapper::maxParty() const
{
- if (hasValueOfType<int>("maxParty"))
+ if (sigmod()->singlePlayer() && hasValueOfType<int>("maxParty"))
return valueOfType<int>("maxParty");
return m_rules->maxParty();
}
int Sigscript::RulesWrapper::maxFight() const
{
- if (hasValueOfType<int>("maxFight"))
+ if (sigmod()->singlePlayer() && hasValueOfType<int>("maxFight"))
return valueOfType<int>("maxFight");
return m_rules->maxFight();
}
int Sigscript::RulesWrapper::maxPlayers() const
{
- if (hasValueOfType<int>("maxFight"))
+ if (sigmod()->singlePlayer() && hasValueOfType<int>("maxFight"))
return valueOfType<int>("maxFight");
return m_rules->maxPlayers();
}
int Sigscript::RulesWrapper::maxHeldItems() const
{
- if (hasValueOfType<int>("maxHeldItems"))
+ if (sigmod()->singlePlayer() && hasValueOfType<int>("maxHeldItems"))
return valueOfType<int>("maxHeldItems");
return m_rules->maxHeldItems();
}
@@ -115,35 +115,35 @@ int Sigscript::RulesWrapper::maxNatures() const
int Sigscript::RulesWrapper::maxMoves() const
{
- if (hasValueOfType<int>("maxMoves"))
+ if (sigmod()->singlePlayer() && hasValueOfType<int>("maxMoves"))
return valueOfType<int>("maxMoves");
return m_rules->maxMoves();
}
int Sigscript::RulesWrapper::maxLevel() const
{
- if (hasValueOfType<int>("maxLevel"))
+ if (sigmod()->singlePlayer() && hasValueOfType<int>("maxLevel"))
return valueOfType<int>("maxLevel");
return m_rules->maxLevel();
}
int Sigscript::RulesWrapper::maxStages() const
{
- if (hasValueOfType<int>("maxStages"))
+ if (sigmod()->singlePlayer() && hasValueOfType<int>("maxStages"))
return valueOfType<int>("maxStages");
return m_rules->maxStages();
}
int Sigscript::RulesWrapper::maxMoney() const
{
- if (hasValueOfType<int>("maxMoney"))
+ if (sigmod()->singlePlayer() && hasValueOfType<int>("maxMoney"))
return valueOfType<int>("maxMoney");
return m_rules->maxMoney();
}
int Sigscript::RulesWrapper::maxTotalWeight() const
{
- if (hasValueOfType<int>("maxTotalWeight"))
+ if (sigmod()->singlePlayer() && hasValueOfType<int>("maxTotalWeight"))
return valueOfType<int>("maxTotalWeight");
return m_rules->maxTotalWeight();
}
@@ -155,7 +155,7 @@ bool Sigscript::RulesWrapper::hardCash() const
bool Sigscript::RulesWrapper::allowSwitchStyle() const
{
- if (hasValueOfType<bool>("allowSwitchStyle"))
+ if (sigmod()->singlePlayer() && hasValueOfType<bool>("allowSwitchStyle"))
return valueOfType<bool>("allowSwitchStyle");
return m_rules->allowSwitchStyle();
}
@@ -177,14 +177,14 @@ bool Sigscript::RulesWrapper::effortValuesAllowed() const
int Sigscript::RulesWrapper::maxTotalEV() const
{
- if (hasValueOfType<int>("maxTotalEV"))
+ if (sigmod()->singlePlayer() && hasValueOfType<int>("maxTotalEV"))
return valueOfType<int>("maxTotalEV");
return m_rules->maxTotalEV();
}
int Sigscript::RulesWrapper::maxEVPerStat() const
{
- if (hasValueOfType<int>("maxEVPerStat"))
+ if (sigmod()->singlePlayer() && hasValueOfType<int>("maxEVPerStat"))
return valueOfType<int>("maxEVPerStat");
return m_rules->maxEVPerStat();
}
diff --git a/sigscript/SigmodWrapper.cpp b/sigscript/SigmodWrapper.cpp
index 473ffddc..cb70ec64 100644
--- a/sigscript/SigmodWrapper.cpp
+++ b/sigscript/SigmodWrapper.cpp
@@ -224,6 +224,11 @@ QString Sigscript::SigmodWrapper::description() const
return m_sigmod->description();
}
+bool Sigscript::SigmodWrapper::singlePlayer() const
+{
+ return m_sigmod->singlePlayer();
+}
+
Sigscript::MapWarpWrapper* Sigscript::SigmodWrapper::startWarp()
{
return map(m_sigmod->startMap())->warp(m_sigmod->startWarp());
diff --git a/sigscript/SigmodWrapper.h b/sigscript/SigmodWrapper.h
index 1d9093b5..fa740a8a 100644
--- a/sigscript/SigmodWrapper.h
+++ b/sigscript/SigmodWrapper.h
@@ -91,6 +91,7 @@ class SIGSCRIPT_EXPORT SigmodWrapper : public ObjectWrapper
Q_SCRIPTABLE QString title() const;
Q_SCRIPTABLE QString version() const;
Q_SCRIPTABLE QString description() const;
+ Q_SCRIPTABLE bool singlePlayer() const;
Q_SCRIPTABLE MapWarpWrapper* startWarp();
Q_SCRIPTABLE Sigmod::Fraction effectiveness(const TypeWrapper* attacker, const TypeWrapper* defender) const;
Q_SCRIPTABLE RulesWrapper* rules();
diff --git a/sigscript/SpeciesItemWrapper.cpp b/sigscript/SpeciesItemWrapper.cpp
index 8bc86ef3..8a36ee8b 100644
--- a/sigscript/SpeciesItemWrapper.cpp
+++ b/sigscript/SpeciesItemWrapper.cpp
@@ -42,7 +42,7 @@ Sigscript::ItemWrapper* Sigscript::SpeciesItemWrapper::item()
int Sigscript::SpeciesItemWrapper::weight() const
{
- if (hasValueOfType<int>("weight"))
+ if (sigmod()->singlePlayer() && hasValueOfType<int>("weight"))
return valueOfType<int>("weight");
return m_item->weight();
}
diff --git a/sigscript/SpeciesWrapper.cpp b/sigscript/SpeciesWrapper.cpp
index 42a46a50..d79f2e5f 100644
--- a/sigscript/SpeciesWrapper.cpp
+++ b/sigscript/SpeciesWrapper.cpp
@@ -107,21 +107,21 @@ int Sigscript::SpeciesWrapper::maxHoldWeight() const
Sigmod::Fraction Sigscript::SpeciesWrapper::runChance() const
{
- if (hasValueOfType<Sigmod::Fraction>("runChance"))
+ if (sigmod()->singlePlayer() && hasValueOfType<Sigmod::Fraction>("runChance"))
return valueOfType<Sigmod::Fraction>("runChance");
return m_species->runChance();
}
Sigmod::Fraction Sigscript::SpeciesWrapper::fleeChance() const
{
- if (hasValueOfType<Sigmod::Fraction>("fleeChance"))
+ if (sigmod()->singlePlayer() && hasValueOfType<Sigmod::Fraction>("fleeChance"))
return valueOfType<Sigmod::Fraction>("fleeChance");
return m_species->fleeChance();
}
Sigmod::Fraction Sigscript::SpeciesWrapper::itemChance() const
{
- if (hasValueOfType<Sigmod::Fraction>("itemChance"))
+ if (sigmod()->singlePlayer() && hasValueOfType<Sigmod::Fraction>("itemChance"))
return valueOfType<Sigmod::Fraction>("itemChance");
return m_species->itemChance();
}
@@ -178,7 +178,7 @@ Sigmod::Fraction Sigscript::SpeciesWrapper::genderFactor() const
int Sigscript::SpeciesWrapper::eggSpecies() const
{
- if (hasValueOfType<int>("eggSpecies"))
+ if (sigmod()->singlePlayer() && hasValueOfType<int>("eggSpecies"))
return valueOfType<int>("eggSpecies");
return m_species->eggSpecies();
}
diff --git a/sigscript/TileWrapper.cpp b/sigscript/TileWrapper.cpp
index 3ef2525d..8417b003 100644
--- a/sigscript/TileWrapper.cpp
+++ b/sigscript/TileWrapper.cpp
@@ -42,7 +42,7 @@ QString Sigscript::TileWrapper::name() const
Sigscript::SpriteWrapper* Sigscript::TileWrapper::sprite()
{
- if (hasValueOfType<QString>("sprite"))
+ if (sigmod()->singlePlayer() && hasValueOfType<QString>("sprite"))
{
SpriteWrapper* sprite = sigmod()->sprite(valueOfType<QString>("sprite"));
if (sprite && sprite->sprite().size() == QSize(64, 64))
@@ -53,7 +53,7 @@ Sigscript::SpriteWrapper* Sigscript::TileWrapper::sprite()
bool Sigscript::TileWrapper::from(const Sigmod::Direction direction) const
{
- if (hasValueOfType<bool>(QString("direction-%1").arg(direction)))
+ if (sigmod()->singlePlayer() && hasValueOfType<bool>(QString("direction-%1").arg(direction)))
return valueOfType<bool>(QString("direction-%1").arg(direction));
return m_tile->from(direction);
}
diff --git a/sigscript/TrainerWrapper.cpp b/sigscript/TrainerWrapper.cpp
index bc937058..47f27505 100644
--- a/sigscript/TrainerWrapper.cpp
+++ b/sigscript/TrainerWrapper.cpp
@@ -54,7 +54,7 @@ QString Sigscript::TrainerWrapper::TrainerWrapper::name() const
int Sigscript::TrainerWrapper::TrainerWrapper::moneyFactor() const
{
- if (hasValueOfType<int>("moneyFactor"))
+ if (sigmod()->singlePlayer() && hasValueOfType<int>("moneyFactor"))
return valueOfType<int>("moneyFactor");
return m_trainer->moneyFactor();
}
@@ -66,7 +66,7 @@ Sigscript::SkinWrapper* Sigscript::TrainerWrapper::TrainerWrapper::skin()
int Sigscript::TrainerWrapper::TrainerWrapper::depth() const
{
- if (hasValueOfType<int>("depth"))
+ if (sigmod()->singlePlayer() && hasValueOfType<int>("depth"))
return valueOfType<int>("depth");
return m_trainer->depth();
}