diff options
| -rw-r--r-- | Changelog | 9 | ||||
| -rw-r--r-- | pokemod/Ability.cpp | 14 | ||||
| -rw-r--r-- | pokemod/Ability.h | 3 | ||||
| -rw-r--r-- | pokemod/Badge.cpp | 26 | ||||
| -rw-r--r-- | pokemod/Badge.h | 3 | ||||
| -rw-r--r-- | pokemodr/AbilityUI.cpp | 14 | ||||
| -rw-r--r-- | pokemodr/AbilityUI.h | 2 | ||||
| -rw-r--r-- | pokemodr/BadgeUI.cpp | 9 | ||||
| -rw-r--r-- | pokemodr/BadgeUI.h | 1 | ||||
| -rw-r--r-- | pokemodr/PokemodUI.cpp | 2 | ||||
| -rw-r--r-- | pokemodr/ScriptWidget.cpp | 4 | ||||
| -rw-r--r-- | pokemodr/ScriptWidget.h | 2 | ||||
| -rw-r--r-- | pokemodr/gui/ability.ui | 17 | ||||
| -rw-r--r-- | pokemodr/gui/badge.ui | 21 | ||||
| -rw-r--r-- | pokemodr/models/BaseModel.cpp | 11 | ||||
| -rw-r--r-- | pokemodr/models/BaseModel.h | 5 | ||||
| -rw-r--r-- | pokemodr/models/GroupModel.cpp | 5 | ||||
| -rw-r--r-- | pokemodr/models/GroupModel.h | 2 | ||||
| -rw-r--r-- | pokemodr/pokemodr.tex | 372 |
19 files changed, 277 insertions, 245 deletions
@@ -1,4 +1,13 @@ ----------------- +Rev: 172 +Date: 24 May 2008 +User: MathStuf +----------------- +[ADD] More documentation +[ADD] Abilities now hav a description field +[FIX] Fixed up a few minor things in pokemodr + +----------------- Rev: 171 Date: 24 May 2008 User: MathStuf diff --git a/pokemod/Ability.cpp b/pokemod/Ability.cpp index 279cb5bf..dc07ce48 100644 --- a/pokemod/Ability.cpp +++ b/pokemod/Ability.cpp @@ -31,6 +31,7 @@ Ability::Ability(const Ability& ability) : Ability::Ability(const Pokemod* parent, const int id) : Object("Ability", parent, id), m_name(""), + m_description(""), m_script("", "") { } @@ -61,6 +62,7 @@ void Ability::load(const QDomElement& xml, int id) { LOAD_ID(); LOAD(QString, name); + LOAD(QString, description); LOAD(Script, script); } @@ -68,6 +70,7 @@ QDomElement Ability::save() const { SAVE_CREATE(); SAVE(QString, name); + SAVE(QString, description); SAVE(Script, script); return xml; } @@ -77,6 +80,11 @@ void Ability::setName(const QString& name) CHECK(name); } +void Ability::setDescription(const QString& description) +{ + CHECK(description); +} + void Ability::setScript(const Script& script) { CHECK(script); @@ -87,6 +95,11 @@ QString Ability::name() const return m_name; } +QString Ability::description() const +{ + return m_description; +} + Script Ability::script() const { return m_script; @@ -97,6 +110,7 @@ Ability& Ability::operator=(const Ability& rhs) if (this == &rhs) return *this; COPY(name); + COPY(description); COPY(script); return *this; } diff --git a/pokemod/Ability.h b/pokemod/Ability.h index edadc074..9b80bf17 100644 --- a/pokemod/Ability.h +++ b/pokemod/Ability.h @@ -42,14 +42,17 @@ class Ability : public Object QDomElement save() const; void setName(const QString& name); + void setDescription(const QString& description); void setScript(const Script& script); QString name() const; + QString description() const; Script script() const; Ability& operator=(const Ability& rhs); private: QString m_name; + QString m_description; Script m_script; }; diff --git a/pokemod/Badge.cpp b/pokemod/Badge.cpp index fe77cfc3..0b747e84 100644 --- a/pokemod/Badge.cpp +++ b/pokemod/Badge.cpp @@ -37,8 +37,6 @@ Badge::Badge(const Pokemod* parent, const int id) : { for (int i = 0; i < Pokemod::ST_End_GSC; ++i) m_stat[i].set(1, 1); - for (int i = 0; i < Pokemod::HM_End_All; ++i) - m_hm[i] = false; } Badge::Badge(const Badge& badge, const Pokemod* parent, const int id) : @@ -61,7 +59,6 @@ void Badge::validate() TEST(setBadge, badge); TEST(setObey, obey); TEST_ARRAY(setStat, stat, (static_cast<const Pokemod*>(pokemod())->rules()->specialSplit() ? Pokemod::ST_End_GSC : Pokemod::ST_End_RBY)); - TEST_ARRAY(setHm, hm, Pokemod::HM_End_All); } void Badge::load(const QDomElement& xml, int id) @@ -72,7 +69,6 @@ void Badge::load(const QDomElement& xml, int id) LOAD(QPixmap, badge); LOAD(int, obey); LOAD_ARRAY(Fraction, stat, (static_cast<const Pokemod*>(pokemod())->rules()->specialSplit() ? Pokemod::ST_End_GSC : Pokemod::ST_End_RBY)); - LOAD_ARRAY(bool, hm, Pokemod::HM_End_All); } QDomElement Badge::save() const @@ -83,7 +79,6 @@ QDomElement Badge::save() const SAVE(QPixmap, badge); SAVE(int, obey); SAVE_ARRAY(Fraction, stat, (static_cast<const Pokemod*>(pokemod())->rules()->specialSplit() ? Pokemod::ST_End_GSC : Pokemod::ST_End_RBY)); - SAVE_ARRAY(bool, hm, Pokemod::HM_End_All); return xml; } @@ -139,16 +134,6 @@ void Badge::setStat(const int stat, const Fraction& multiplier) CHECK_ARRAY(stat[stat], multiplier); } -void Badge::setHm(const int hm, const bool hmAllowed) -{ - if (Pokemod::HM_End_All <= hm) - { - emit(error(bounds("hm"))); - return; - } - CHECK_ARRAY(hm[hm], hmAllowed); -} - QString Badge::name() const { return m_name; @@ -179,16 +164,6 @@ Fraction Badge::stat(const int stat) const return m_stat[stat]; } -bool Badge::hm(const int hm) const -{ - if (Pokemod::HM_End_All <= hm) - { - emit(warning(bounds("hm"))); - return false; - } - return m_hm[hm]; -} - Badge& Badge::operator=(const Badge& rhs) { if (this == &rhs) @@ -198,6 +173,5 @@ Badge& Badge::operator=(const Badge& rhs) COPY(badge); COPY(obey); COPY_ARRAY(stat, Pokemod::ST_End_GSC); - COPY_ARRAY(hm, Pokemod::HM_End_All); return *this; } diff --git a/pokemod/Badge.h b/pokemod/Badge.h index 988fea9a..861c8ac8 100644 --- a/pokemod/Badge.h +++ b/pokemod/Badge.h @@ -46,14 +46,12 @@ class Badge : public Object void setBadge(const QPixmap& badge); void setObey(const int obey); void setStat(const int stat, const Fraction& multiplier); - void setHm(const int hm, const bool hmAllowed); QString name() const; QPixmap face() const; QPixmap badge() const; int obey() const; Fraction stat(const int stat) const; - bool hm(const int hm) const; Badge& operator=(const Badge& rhs); private: @@ -62,7 +60,6 @@ class Badge : public Object QPixmap m_badge; int m_obey; Fraction m_stat[Pokemod::ST_End_GSC]; - bool m_hm[Pokemod::HM_End_All]; }; #endif diff --git a/pokemodr/AbilityUI.cpp b/pokemodr/AbilityUI.cpp index c3e36e4d..16aafe2d 100644 --- a/pokemodr/AbilityUI.cpp +++ b/pokemodr/AbilityUI.cpp @@ -35,6 +35,8 @@ AbilityUI::~AbilityUI() void AbilityUI::setGui() { varName->setText(static_cast<Ability*>(modified())->name()); + varDescription->setPlainText(static_cast<Ability*>(modified())->description()); + varScript->setValue(static_cast<Ability*>(modified())->script()); } void AbilityUI::apply() @@ -54,3 +56,15 @@ void AbilityUI::on_varName_textChanged(const QString& name) { static_cast<Ability*>(modified())->setName(name); } + +void AbilityUI::on_varDescription_textChanged() +{ + QTextCursor cursor = varDescription->textCursor(); + static_cast<Ability*>(modified())->setDescription(varDescription->toPlainText()); + varDescription->setTextCursor(cursor); +} + +void AbilityUI::on_varScript_valueChanged(const Script& script) +{ + static_cast<Ability*>(modified())->setScript(script); +} diff --git a/pokemodr/AbilityUI.h b/pokemodr/AbilityUI.h index bf838268..d9f39dcc 100644 --- a/pokemodr/AbilityUI.h +++ b/pokemodr/AbilityUI.h @@ -39,6 +39,8 @@ class AbilityUI : public ObjectUI, private Ui::formAbility void discard(); protected slots: void on_varName_textChanged(const QString& name); + void on_varDescription_textChanged(); + void on_varScript_valueChanged(const Script& script); private slots: void setGui(); }; diff --git a/pokemodr/BadgeUI.cpp b/pokemodr/BadgeUI.cpp index 3fc4ab69..537079ce 100644 --- a/pokemodr/BadgeUI.cpp +++ b/pokemodr/BadgeUI.cpp @@ -40,7 +40,6 @@ BadgeUI::~BadgeUI() void BadgeUI::initGui() { connect(varStat, SIGNAL(activated(const int)), this, SLOT(setGui())); - varHMs->addItems(Pokemod::HMStr); } void BadgeUI::refreshGui() @@ -58,8 +57,6 @@ void BadgeUI::setGui() varFace->setIcon(static_cast<Badge*>(modified())->face()); varBadge->setIcon(static_cast<Badge*>(modified())->badge()); varStatMultiplier->setValue(static_cast<Badge*>(modified())->stat(varStat->currentIndex())); - for (int i = 0; i < varHMs->count(); ++i) - varHMs->item(i)->setSelected(static_cast<Badge*>(modified())->hm(i)); } void BadgeUI::apply() @@ -111,9 +108,3 @@ void BadgeUI::on_varStatMultiplier_valueChanged(const Fraction& multiplier) { static_cast<Badge*>(modified())->setStat(varStat->currentIndex(), multiplier); } - -void BadgeUI::on_varHMs_itemSelectionChanged() -{ - for (int i = 0; i < varHMs->count(); ++i) - static_cast<Badge*>(modified())->setHm(i, varHMs->item(i)->isSelected()); -} diff --git a/pokemodr/BadgeUI.h b/pokemodr/BadgeUI.h index c67215dd..7820ad06 100644 --- a/pokemodr/BadgeUI.h +++ b/pokemodr/BadgeUI.h @@ -43,7 +43,6 @@ class BadgeUI : public ObjectUI, private Ui::formBadge void on_varFace_pressed(); void on_varBadge_pressed(); void on_varStatMultiplier_valueChanged(const Fraction& multiplier); - void on_varHMs_itemSelectionChanged(); private slots: void initGui(); void refreshGui(); diff --git a/pokemodr/PokemodUI.cpp b/pokemodr/PokemodUI.cpp index 07be0db9..2d6d1c1d 100644 --- a/pokemodr/PokemodUI.cpp +++ b/pokemodr/PokemodUI.cpp @@ -23,10 +23,10 @@ #include "TypechartWidgetItem.h" // Pokemod includes -#include "../pokemod/Item.h" #include "../pokemod/Map.h" #include "../pokemod/MapWarp.h" #include "../pokemod/Pokemod.h" +#include "../pokemod/Type.h" PokemodUI::PokemodUI(Pokemod* pokemod, QWidget* parent) : ObjectUI(parent), diff --git a/pokemodr/ScriptWidget.cpp b/pokemodr/ScriptWidget.cpp index 8001199b..addb14ba 100644 --- a/pokemodr/ScriptWidget.cpp +++ b/pokemodr/ScriptWidget.cpp @@ -49,10 +49,10 @@ void ScriptWidget::on_varInterpreter_activated(const QString& interpreter) emit(valueChanged(m_value)); } -void ScriptWidget::on_varScript_textChanged(const QString& script) +void ScriptWidget::on_varScript_textChanged() { QTextCursor cursor = varScript->textCursor(); - m_value.setScript(script); + m_value.setScript(varScript->toPlainText()); varScript->setTextCursor(cursor); emit(valueChanged(m_value)); } diff --git a/pokemodr/ScriptWidget.h b/pokemodr/ScriptWidget.h index 1b0d536e..f881a32d 100644 --- a/pokemodr/ScriptWidget.h +++ b/pokemodr/ScriptWidget.h @@ -41,7 +41,7 @@ class ScriptWidget : public QWidget, private Ui::formScript void setValue(const Script& value); protected slots: void on_varInterpreter_activated(const QString& interpreter); - void on_varScript_textChanged(const QString& script); + void on_varScript_textChanged(); private: Script m_value; }; diff --git a/pokemodr/gui/ability.ui b/pokemodr/gui/ability.ui index 00641dbc..3a82d380 100644 --- a/pokemodr/gui/ability.ui +++ b/pokemodr/gui/ability.ui @@ -22,6 +22,18 @@ </widget> </item> <item> + <widget class="QGroupBox" name="boxDescription" > + <property name="title" > + <string>Description</string> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KTextEdit" name="varDescription" /> + </item> + </layout> + </widget> + </item> + <item> <widget class="QGroupBox" name="boxScript" > <property name="title" > <string>Script</string> @@ -42,6 +54,11 @@ <header>klineedit.h</header> </customwidget> <customwidget> + <class>KTextEdit</class> + <extends>QTextEdit</extends> + <header>ktextedit.h</header> + </customwidget> + <customwidget> <class>ScriptWidget</class> <extends>QWidget</extends> <header>../ScriptWidget.h</header> diff --git a/pokemodr/gui/badge.ui b/pokemodr/gui/badge.ui index daa950f8..85ebad21 100644 --- a/pokemodr/gui/badge.ui +++ b/pokemodr/gui/badge.ui @@ -143,22 +143,6 @@ </layout> </widget> </item> - <item> - <widget class="QGroupBox" name="boxHMs" > - <property name="title" > - <string>HMs</string> - </property> - <layout class="QHBoxLayout" > - <item> - <widget class="KListWidget" name="varHMs" > - <property name="selectionMode" > - <enum>QAbstractItemView::ExtendedSelection</enum> - </property> - </widget> - </item> - </layout> - </widget> - </item> </layout> </widget> <customwidgets> @@ -178,11 +162,6 @@ <header>klineedit.h</header> </customwidget> <customwidget> - <class>KListWidget</class> - <extends>QListWidget</extends> - <header>klistwidget.h</header> - </customwidget> - <customwidget> <class>KPushButton</class> <extends>QPushButton</extends> <header>kpushbutton.h</header> diff --git a/pokemodr/models/BaseModel.cpp b/pokemodr/models/BaseModel.cpp index 789cdccb..c4cc4b99 100644 --- a/pokemodr/models/BaseModel.cpp +++ b/pokemodr/models/BaseModel.cpp @@ -22,9 +22,9 @@ #include "../../pokemod/Object.h" BaseModel::BaseModel(BaseModel* parent, Object* object, const QString& name) : + m_parent(parent), m_object(object), - m_name(name), - m_parent(parent) + m_name(name) { } @@ -51,7 +51,12 @@ int BaseModel::indexNumber() const return -1; } -const Object * BaseModel::object() const +QString BaseModel::type() const +{ + return ""; +} + +const Object* BaseModel::object() const { return m_object; } diff --git a/pokemodr/models/BaseModel.h b/pokemodr/models/BaseModel.h index 41d5f353..9de2990c 100644 --- a/pokemodr/models/BaseModel.h +++ b/pokemodr/models/BaseModel.h @@ -51,7 +51,7 @@ class BaseModel virtual Qt::DropActions supportedDragActions() = 0; virtual Qt::DropActions supportedDropActions() = 0; - virtual QString type() const = 0; + virtual QString type() const; const Object* object() const; @@ -62,10 +62,9 @@ class BaseModel protected: virtual int findChild(const BaseModel* /*model*/) const; + BaseModel* m_parent; Object* m_object; QString m_name; - - BaseModel* m_parent; }; #endif diff --git a/pokemodr/models/GroupModel.cpp b/pokemodr/models/GroupModel.cpp index 90beb41f..1503dc14 100644 --- a/pokemodr/models/GroupModel.cpp +++ b/pokemodr/models/GroupModel.cpp @@ -80,11 +80,6 @@ Qt::DropActions GroupModel::supportedDropActions() return Qt::CopyAction | Qt::MoveAction; } -QString GroupModel::type() const -{ - return ""; -} - int GroupModel::findChild(const BaseModel* model) const { return m_objects.indexOf(const_cast<BaseObjectModel*>(static_cast<const BaseObjectModel*>(model))); diff --git a/pokemodr/models/GroupModel.h b/pokemodr/models/GroupModel.h index df548a53..46d2d850 100644 --- a/pokemodr/models/GroupModel.h +++ b/pokemodr/models/GroupModel.h @@ -49,8 +49,6 @@ class GroupModel : public BaseModel Qt::DropActions supportedDragActions(); Qt::DropActions supportedDropActions(); - - QString type() const; protected: int findChild(const BaseModel* model) const; diff --git a/pokemodr/pokemodr.tex b/pokemodr/pokemodr.tex index 6923900a..beebee15 100644 --- a/pokemodr/pokemodr.tex +++ b/pokemodr/pokemodr.tex @@ -19,137 +19,81 @@ \lstset{title=\thelisting} % This gives syntax highlighting in the python environment -% Found at http://ubuntuforums.org/archive/index.php/t-331602.html +% Adapted from http://ubuntuforums.org/archive/index.php/t-331602.html \renewcommand{\lstlistlistingname}{Code Listings} \renewcommand{\lstlistingname}{Code Listing} \definecolor{gray}{gray}{0.5} \definecolor{green}{rgb}{0,0.5,0} +\lstset{ + basicstyle=\ttfamily\small\setstretch{1}, + stringstyle=\color{red}, + showstringspaces=false, + alsoletter={1234567890}, + otherkeywords={\ , \}, \{}, + keywordstyle=\color{blue}, + emphstyle=\color{black}\bfseries, + emphstyle=[2]\color{green}, + emphstyle=[3]\color{blue}, + upquote=true, + commentstyle=\color{gray}\slshape, + emph={[4]1, 2, 3, 4, 5, 6, 7, 8, 9, 0}, + emphstyle=[4]\color{blue}, + literate=*{:}{{\textcolor{blue}:}}{1} + {=}{{\textcolor{blue}=}}{1} + {-}{{\textcolor{blue}-}}{1} + {+}{{\textcolor{blue}+}}{1} + {*}{{\textcolor{blue}*}}{1} + {!}{{\textcolor{blue}!}}{1} + {(}{{\textcolor{blue}(}}{1} + {)}{{\textcolor{blue})}}{1} + {[}{{\textcolor{blue}[}}{1} + {]}{{\textcolor{blue}]}}{1} + {<}{{\textcolor{blue}<}}{1} + {>}{{\textcolor{blue}>}}{1}, + framexleftmargin=1mm, + framextopmargin=1mm, + frame=shadowbox, + rulesepcolor=\color{blue}, +} + \lstnewenvironment{python}[1][]{ \lstset{ - language=python, - basicstyle=\ttfamily\small\setstretch{1}, - stringstyle=\color{red}, - showstringspaces=false, - alsoletter={1234567890}, - otherkeywords={\ , \}, \{}, - keywordstyle=\color{blue}, - emph={access, and, break, class, continue, def, del, elif, else, - except, exec, finally, for, from, global, if, import, in, is, - lambda, not, or, pass, print, raise, return, try, while}, - emphstyle=\color{black}\bfseries, - emph={[2]True, False, None, self}, - emphstyle=[2]\color{green}, - emph={[3]from, import, as}, - emphstyle=[3]\color{blue}, - upquote=true, - morecomment=[s]{"""}{"""}, - commentstyle=\color{gray}\slshape, - emph={[4]1, 2, 3, 4, 5, 6, 7, 8, 9, 0}, - emphstyle=[4]\color{blue}, - literate=*{:}{{\textcolor{blue}:}}{1} - {=}{{\textcolor{blue}=}}{1} - {-}{{\textcolor{blue}-}}{1} - {+}{{\textcolor{blue}+}}{1} - {*}{{\textcolor{blue}*}}{1} - {!}{{\textcolor{blue}!}}{1} - {(}{{\textcolor{blue}(}}{1} - {)}{{\textcolor{blue})}}{1} - {[}{{\textcolor{blue}[}}{1} - {]}{{\textcolor{blue}]}}{1} - {<}{{\textcolor{blue}<}}{1} - {>}{{\textcolor{blue}>}}{1}, - framexleftmargin=1mm, - framextopmargin=1mm, - frame=shadowbox, - rulesepcolor=\color{blue}, - #1 - }}{} + language=python, + emph={access, and, break, class, continue, def, del, elif, else, + except, exec, finally, for, from, global, if, import, in, is, + lambda, not, or, pass, print, raise, return, try, while}, + emph={[2]True, False, None, self}, + emph={[3]from, import, as}, + morecomment=[s]{"""}{"""}, + #1 +}}{} \lstnewenvironment{ruby}[1][]{ \lstset{ - language=ruby, - basicstyle=\ttfamily\small\setstretch{1}, - stringstyle=\color{red}, - showstringspaces=false, - alsoletter={1234567890}, - otherkeywords={\ , \}, \{}, - keywordstyle=\color{blue}, - emph={alias, and, begin, break, case, class, def, defined, - do, else, elsif, end, ensure, for, if, in, module, next, - not, or, redo, rescue, retry, return, super, then, undef, - unless, until, when, while, yield}, - emphstyle=\color{black}\bfseries, - emph={[2]true, false, nil, self}, - emphstyle=[2]\color{green}, - emph={[3]require, include}, - emphstyle=[3]\color{blue}, - upquote=true, - morecomment=[s]{"""}{"""}, - commentstyle=\color{gray}\slshape, - emph={[4]1, 2, 3, 4, 5, 6, 7, 8, 9, 0}, - emphstyle=[4]\color{blue}, - literate=*{:}{{\textcolor{blue}:}}{1} - {=}{{\textcolor{blue}=}}{1} - {-}{{\textcolor{blue}-}}{1} - {+}{{\textcolor{blue}+}}{1} - {*}{{\textcolor{blue}*}}{1} - {!}{{\textcolor{blue}!}}{1} - {(}{{\textcolor{blue}(}}{1} - {)}{{\textcolor{blue})}}{1} - {[}{{\textcolor{blue}[}}{1} - {]}{{\textcolor{blue}]}}{1} - {<}{{\textcolor{blue}<}}{1} - {>}{{\textcolor{blue}>}}{1}, - framexleftmargin=1mm, - framextopmargin=1mm, - frame=shadowbox, - rulesepcolor=\color{blue}, - #1 - }}{} + language=ruby, + emph={alias, and, begin, break, case, class, def, defined, + do, else, elsif, end, ensure, for, if, in, module, next, + not, or, redo, rescue, retry, return, super, then, undef, + unless, until, when, while, yield}, + emph={[2]true, false, nil, self}, + emph={[3]require, include}, + #1 +}}{} \lstnewenvironment{kjs}[1][]{ \lstset{ -% language=kjs, - basicstyle=\ttfamily\small\setstretch{1}, - stringstyle=\color{red}, - showstringspaces=false, - alsoletter={1234567890}, - otherkeywords={\ , \}, \{}, - keywordstyle=\color{blue}, - emph={abstract, break, byte, case, catch, class, const, continue, - debugger, default, delete, do, else, enum, export, extends, - final, finally, for, function, goto, if, implements, in, - instanceof, interface, native, new, package, private, protected, - public, return, static, super, switch, synchronized, throw, - throws, transient, try, typeof, volatile, while, with}, - emphstyle=\color{black}\bfseries, - emph={[2]true, false, null, this}, - emphstyle=[2]\color{green}, - emph={[3]import}, - emphstyle=[3]\color{blue}, - upquote=true, - commentstyle=\color{gray}\slshape, - emph={[4]1, 2, 3, 4, 5, 6, 7, 8, 9, 0}, - emphstyle=[4]\color{blue}, - literate=*{:}{{\textcolor{blue}:}}{1} - {=}{{\textcolor{blue}=}}{1} - {-}{{\textcolor{blue}-}}{1} - {+}{{\textcolor{blue}+}}{1} - {*}{{\textcolor{blue}*}}{1} - {!}{{\textcolor{blue}!}}{1} - {(}{{\textcolor{blue}(}}{1} - {)}{{\textcolor{blue})}}{1} - {[}{{\textcolor{blue}[}}{1} - {]}{{\textcolor{blue}]}}{1} - {<}{{\textcolor{blue}<}}{1} - {>}{{\textcolor{blue}>}}{1}, - framexleftmargin=1mm, - framextopmargin=1mm, - frame=shadowbox, - rulesepcolor=\color{blue}, - #1 - }}{} +% language=kjs, + emph={abstract, break, byte, case, catch, class, const, continue, + debugger, default, delete, do, else, enum, export, extends, + final, finally, for, function, goto, if, implements, in, + instanceof, interface, native, new, package, private, protected, + public, return, static, super, switch, synchronized, throw, + throws, transient, try, typeof, volatile, while, with}, + emph={[2]true, false, null, this}, + emph={[3]import}, + #1 +}}{} \begin{document} \maketitle @@ -157,59 +101,69 @@ \tableofcontents \newpage - \section{Ability} \addtocounter{listing}{1} Abilities add an extra dimension to the battle system. Abilities can help turn the tide in a battle and balance species that are typically under-powered. Abilities were introduced to the original games in the third generation of the games. +Abilities are responsible for keeping track of any information they change during their execution and restoring it if necessary. Changing anything that is not local to the battle will persist after the battle is over (this allows status afflictions and moves that are permanently overwritten to persist). Take note that anything that is species-wide will not persist no matter what happens during the battle (i.e. types, base stats, effort values) since these are copied for the battle so that they can be modified for strategic purposes. + +The APIs for the battle system will be under development in the near future with the beta release of Pok\'eModr. + \subsection{Variables} \paragraph{Name} -This is the name of the ability. This is how the user will see the ability in the game. +This is the name of the ability. This is how the player will see the ability in the game. + +\paragraph{Description} +This should be a succinct description of what the ability does. \paragraph{Script} -This script contains functions that will be triggered by the game when appropriate. Only functions that are written will be called, so dummy functions are not needed for those the ability does not need. The following events can be used in an ability: +This script contains functions that will be triggered by the game when appropriate. Only functions that are written will be called, so dummy functions are not needed for those the ability does not need. The following events can be used in an ability (these are in no way final, the battle system design will provide all of these): \begin{multicols}{3} \begin{itemize} - \item userSentOut - \item userBeginTurn - \item userAttack - \item userHit - \item userDamaged - \item userStatusChanged - \item userStatChanged - \item userFlinch - \item userFaint - \item enemySentOut - \item enemyBeginTurn - \item enemyAttack - \item enemyHit - \item enemyStatusChanged - \item enemyStatChanged - \item enemyFlinch - \item enemyFaint - \item roundBegin - \item roundEnd - \item battleEnd - \item heldItemUsed - \item itemUsed - \item userFlee - \item userSwitch - \item weatherChanged - \item enemyAbilityTriggered - \item mapEntered - \item wildBattleStarted + \item \texttt{userSentOut} + \item \texttt{userBeginTurn} + \item \texttt{userAttack} + \item \texttt{userHit} + \item \texttt{userDamaged} + \item \texttt{userStatusChanged} + \item \texttt{userStatChanged} + \item \texttt{userFlinch} + \item \texttt{userFaint} + \item \texttt{enemySentOut} + \item \texttt{enemyBeginTurn} + \item \texttt{enemyAttack} + \item \texttt{enemyHit} + \item \texttt{enemyStatusChanged} + \item \texttt{enemyStatChanged} + \item \texttt{enemyFlinch} + \item \texttt{enemyFaint} + \item \texttt{roundBegin} + \item \texttt{roundEnd} + \item \texttt{battleEnd} + \item \texttt{heldItemUsed} + \item \texttt{itemUsed} + \item \texttt{userFlee} + \item \texttt{userSwitch} + \item \texttt{weatherChanged} + \item \texttt{enemyAbilityTriggered} + \item \texttt{mapEntered} + \item \texttt{wildBattleStarted} \end{itemize} \end{multicols} \subsection{Examples} -\paragraph{Note} These examples are not guaranteed to work until an API has been made for the game and battle system. +\paragraph{Note} +These examples are not guaranteed to work until an API has been made for the game and battle system. + +\subsubsection{Changing the weather} + +This script will force the weather to be rainy all the time. Other weather effects can be in effect from the time it works until the beginning of the next turn where this ability will kick in and make it rain again. -\subsubsection{Forcing a weather condition} \begin{python} import Kross import Battle @@ -220,33 +174,115 @@ pokemod = Kross.action("pokemod") needChanging = False def setWeather(): - # Set the weather to rain for unlimited turns - Battle.weather = ( pokemod.callFunction( "weather", [ "Rain" ] ), -1 ) - # Let the player know that it has started raining - Game.message( "The skies have opened up!" ) + # Set the weather to rain for unlimited turns + Battle.weather = ( pokemod.callFunction( "weather", ["Rain"] ), -1 ) + # Let the player know that it has started raining + Game.message( "The skies have opened up!" ) def userSentOut(user): - setWeather() + setWeather() def weatherChanged(weather): - # Force the weather back next turn if it the weather change wasn't to rain - if not weather == pokemod.callFunction( "weather", [ "Rain" ] ): - needChanging = True + # Force the weather back next turn if it the weather change wasn't to rain + if not Battle.weather.weather == pokemod.callFunction( "weather", ["Rain"] ): + needChanging = True -def roundBegin(): - # Reset the weather if needed - if needChanging: - setWeather() - needChanging = False +def roundBegin(user, allies, enemies): + # Reset the weather if needed + if needChanging: + setWeather() + needChanging = False + +def userSwitch(user): + # If the owner of the ability is no longer in the battle, set the rain to stop + Battle.weather.duration = 2 + Game.message( "The rain clouds started to dissipate!" ) + +def userFaint(user): + userSwitch(user) +\end{python} + +\subsubsection{Changing types} + +This script will change the user's first type depending on the type of the last move used. + +\begin{python} +originalType = -1 +newType = -1 + +def userAttacks(user, targets, move): + # Save the user's type + newType = move.type + +def roundBegin(user, enemy): + if not newType == -1: + user.types[0] = newType + else: + originalType = user.types[0] def userSwitch(user): - # If the owner of the ability is no longer in the battle, set the rain to stop - Battle.weather.duration = 2 - Game.message( "The rain clouds started to dissipate!" ) + # Restore the type when the user switches + user.types[0] = originalType def userFaint(user): - userSwitch(user) + userSwitch(user) + +def battleEnd(user): + userSwitch(user) \end{python} +\newpage +\section{Author} +\addtocounter{listing}{1} + +This is where the authors of the Pok\'eMod go. This class could be expanded to allow for something more detialed to allow the creation of credits, but it is simple for now. + +\subsection{Variables} + +\paragraph{Name} +This is the name of the author. + +\paragraph{Email} +The email address of the author. + +\paragraph{Role} +This is what the person did. + +\newpage +\section{Badge} +\addtocounter{listing}{1} + +Badges are given to the player after accomplishing a task. In the original games, they were used to allow the player to use moves in the main world to gain access to new parts of the world. They also boosted the stats for in-game battles and allowed the player to train to higher levels without side effects. + +\subsection{Variables} + +\paragraph{Name} +This is the name of the badge. This is the name that the player will see in-game. + +\paragraph{Face} +This is the image that will be used in the game for the badge before it is obtained. + +\paragraph{Badge} +This is an image of the badge and will show up in the player's information window. + +\paragraph{Obey} +This is the level that the player can train to without any side effects. + +\paragraph{Stat} +The multiplier for each stat will be applied to in-game battles to give an extra edge to the player. + +\newpage +\section{Coin List} +\addtocounter{listing}{1} + +Coin lists are used as alternate places to aquire items and team members in exchange for coins that are won at slot machines and card flip games. These are typically much harder to afford than items in an item shop, but they are also usually more valuable. + +\subsection{Variables} + +\paragraph{Name} +This is the internal name of the coin list. The player will not be told what this is. + +\paragraph{Item} +This is the item that contians the ``money'' to buy things. The item should implement an \texttt{amount} function in its script. If one does not exist, the game will not show the list. When the player is not carrying any of this item, the function \texttt{noItem} is called in this script. It should let the player know that they do not have the required item and need to get it to be able to use this \end{document} |
