summaryrefslogtreecommitdiffstats
path: root/sigmodr/sigmodr.tex
blob: 97a21690b9cb57521712ab56f2723a44f5fa1280 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
\documentclass[12pt,notitlepage]{report}

\newcommand{\version}{0.0.2}

\title{Sigmodr v\version}
\author{Ben Boeckel $<$\texttt{\href{mailto:mathStuf@gmail.com}%
    {MathStuf@gmail.com}}$>$}

\usepackage[unicode]{hyperref}
\hypersetup{%
    colorlinks=true,%
    citecolor=red,%
    urlcolor=red,%
    filecolor=red,%
    linkcolor=red,%
    pdfauthor={Ben Boeckel},%
    pdftitle={Sigmodr Documentation},%
}
\usepackage{listings}
\usepackage{color}
\usepackage{setspace}
\usepackage{multicol}
\usepackage{fontenc}
\usepackage{textcomp}
\usepackage[debugshow]{xtab}

% This gives syntax highlighting in the python/ruby/kjs environments
% 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}%
        {>}{{\textcolor{blue}>}}{1},%
    framexleftmargin=1mm,%
    framextopmargin=1mm,%
    frame=shadowbox,%
    rulesepcolor=\color{blue}%
}

\lstnewenvironment{python}[1][]{%
\lstset{%
    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,%
    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=javascript,%
    emph={abstract,break,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%
}}{}

\lstnewenvironment{java}[1][]{%
\lstset{%
    language=java,%
    emph={abstract,assert,break,case,catch,class,continue,default,%
        do,else,enum,extends,final,finally,for,private,implements,%
        instanceof,interface,native,new,package,private,protected,%
        public,return,static,strictfp,super,switch,synchronized,%
        throw,throws,transient,try,volatile,while},%
    emph={[2]true,false,null,this},%
    emph={[3]import},%
    #1%
}}{}

\lstnewenvironment{falcon}[1][]{%
\lstset{%
%     language=falcon,%
    emph={and,attributes,break,case,catch,const,continue,default,%
        directive,dropping,elif,else,end,enum,for,firfirst,formiddle,%
        forlast,from,function,give,global,has,hasnt,if,in,init,%
        innerfunc,lambda,launch,loop,not,object,or,pass,provides,%
        return,select,static,switch,to,try,while},%
    emph={[2]true,false,nil,self,sender},%
    emph={[3]import,load,export},%
    #1%
}}{}

\lstnewenvironment{php}[1][]{%
\lstset{%
    language=PHP,%
    emph={},%
    emph={[2]true,false,nil,self,sender},%
    emph={[3]import,load,export},%
    #1%
}}{}

\lstnewenvironment{lua}[1][]{%
\lstset{%
    language=Lua,%
    emph={},%
    emph={[2]true,false,nil,self,sender},%
    emph={[3]import,load,export},%
    #1%
}}{}

\lstnewenvironment{c-sharp}[1][]{%
\lstset{%
    language=CSharp,%
    emph={},%
    emph={[2]true,false,nil,self,sender},%
    emph={[3]import,load,export},%
    #1%
}}{}

\begin{document}

\maketitle

\tableofcontents

\newpage
\chapter{What is Sigmodr?}


\chapter{Sigmod Classes}
\label{sigmod-classes}

\section{Ability}
\label{ability}

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}
\label{ability-variables}

\paragraph{Name}
\label{ability-name}
The name of the ability. This is how the player will see the ability in the game.

\paragraph{Description}
\label{ability-description}
A succinct description of what the ability does.

\paragraph{Script}
\label{ability-script}
The 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}{2}
\begin{itemize}
    \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}

See chapter \ref{scripting} on page \pageref{scripting} for more infomation on scripting.

\subsection{Examples}
\label{ability-examples}

\paragraph{Note}
These examples are not guaranteed to work until an API has been made for the game and battle system.

\subsubsection{Changing types}

This script will change the user's first type depending on the type of the last move used. Since types do not persist outside of the battle, the type only needs to be reset when the owner of the ability switches out or faints.

\begin{python}[caption={Type changer},label=script:type-changer]
import sigmod # Data from the Sigmod
import owner  # The owner of the ability

# Get the first type of the user
originalType = owner.type(0)
# Set the type requested
ghost = sigmod.type("Ghost")

def setType():
    # Set the type
    owner.setType(0, ghost)

def retreat():
    # Reset the type
    owner.setType(0, originalType)

owner.connect("sentOut()", setType)
owner.connect("switch()", retreat)
owner.connect("faint()", retreat)
\end{python}

\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.

\begin{python}[caption={Weather changer},label=script:weather-changer]
import arena  # The battle system
import client # Used for messaging
import sigmod # Data from the Sigmod
import owne   # The owner of the ability

# Get the handle for the "Rain" weather
rain = sigmod.weather("Rain")

# Local variable to keep track of when to force the weather
needChanging = False

def setWeather():
    # Set the weather to rain for unlimited turns
    arena.setWeather(rain, -1)
    # Let the player(s) know that it has started raining
    client.message("The skies have opened up!")

def sentOut():
    setWeather()

def weatherChanged():
    # Force the weather back next turn
    # if it the weather change wasn't to rain
    if not arena.weather() == rain:
        needChanging = True

def roundStart():
    # Reset the weather if needed
    if needChanging:
        setWeather()
        needChanging = False

def retreat():
    # If the owner of the ability is
    # no longer in the battle, set the rain to stop
    if arena.weather() == rain:
        arena.setWeatherDuration() = 2
        client.message("The skies are clearing!")

# Connect signals from the arena
arena.connect("roundStart()", roundStart)
# Connect signals from the owner
owner.connect("sentOut()", sentOut)
owner.connect("switch()", retreat)
owner.connect("faint()", retreat)
\end{python}

\section{Author}
\label{author}

This is where the authors of the Sigmod 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}
\label{author-variables}

\paragraph{Name}
\label{author-name}
The name of the author.

\paragraph{Email}
\label{author-email}
The email address of the author.

\paragraph{Role}
\label{author-role}
What the person did.

\section{Badge}
\label{badge}

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}
\label{badge-variables}

\paragraph{Name}
\label{badge-name}
The name of the badge. This is the name that the player will see in-game.

\paragraph{Face}
\label{badge-face}
The image that will be used in the game for the badge before it is obtained.

\paragraph{Badge}
\label{badge-badge}
The image of the badge and will show up in the player's information window.

\paragraph{Obey}
\label{badge-obey}
The level that the player can train to without any side effects.

\paragraph{Stat}
\label{badge-stat}
The multiplier for each stat will be applied to in-game battles to give an extra edge to the player. It will not have any effect on battles between two games.

\section{Coin List}
\label{coinlist}

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}
\label{coinlist-variables}

\paragraph{Name}
\label{coinlist-name}
This is the internal name of the coin list. The player will not be told what this is.

\paragraph{Script}
\label{coinlist-script}
This script should interface with the user's items to determine the following:
\begin{itemize}
    \item Check to see if the player has an item that can buy the objects on the list
    \item If so:
    \begin{itemize}
        \item Set the \texttt{coinListMoney} object in \texttt{Game} to the amount of curreny that the player has for display
        \item Provide a \texttt{buy} function that takes the object to buy in the list
        \item It should handle giving the object to the player and erroring if anything happens
    \end{itemize}
    \item else:
    \begin{itemize}
        \item Set the \texttt{coinListMoney} object in \texttt{Game} to 0
        \item The game will take this as a signal that the player cannot buy things from this coin list and will not display it
        \item Any messages necessary must be handled in the script
    \end{itemize}
\end{itemize}

\section{Coin List Object}
\label{coinlistobject}

Coin list objects are either items or team members that can be bought from coin lists.

\subsection{Variables}
\label{coinlistobject-variables}

\paragraph{Type}
\label{coinlistobject-type}
Whether the value of the object points to a species for a team member or to an item.

\paragraph{Value}
\label{coinlistobject-value}
The ID number of the item or species.

\paragraph{Amount}
\label{coinlistobject-amount}
The number of the object that the player gets at a time.

\paragraph{Cost}
\label{coinlistobject-cost}
How much the object costs.

\section{Egg Group}
\label{egggroup}

An egg group is a group of species that can breed to create eggs. More details can be found in chapter \ref{breeding} on page \pageref{breeding}.

\subsection{Variables}
\label{egggroup-variables}

\paragraph{Name}
\label{egggroup-name}
The name of the egg group. Used internally only.

\section{Global Script}
\label{globalscript}

Global scripts are functions that are available on demand in any other script. They can do anything that the scripting API allows with the game or any common function that is used a lot in order to save space. They are loaded when the game is loaded and in the \texttt{scripts} action collection. See more on scripting in chapter \ref{scripting} on page \pageref{scripting}.

\subsection{Variables}
\label{globalscript-variables}

\subsubsection{Name}
\label{globalscript-name}
The name of the action in the collection.

\subsubsection{Script}
\label{globalscript-script}
The code of the script.

\section{Item}
\label{item}

Items are used in the game to heal, boost stats, and other similar things. They can be used during in-game battles and on the overworld maps.

\subsection{Variables}
\label{item-variables}

\subsubsection{Name}
The name of the item

\section{Item Type}
\label{itemtype}

Item types are used to group items into sections within the player's item storage.

\subsection{Variables}
\label{itemtype-variables}

\subsubsection{Name}
\label{itemtype-name}
The name of the item type. Used internally only.

\subsubsection{Computer}
\label{itemtype-computer}
How many of the item the computer can store.

\subsubsection{Player}
\label{itemtype-player}
How many of the item the player can carry at once.

\subsubsection{Count}
\label{itemtype-count}
Determines how the items are counted and grouped in its storage. If they can be grouped, multiples of an item will count as one towards the limit of the storage, otherwise duplicates are counted individually.

\section{Map}
\label{map}

Maps are view of the overworld for the game. When not battling, the player travels around the maps in search of other battles and quests.

\section{Map Effect}
\label{mapeffect}



\section{Map Trainer}
\label{maptrainer}

\section{Map Trainer Team Member}
\label{maptrainerteammember}

\section{Map Warp}
\label{mapwarp}

\section{Map Wild List}
\label{mapwildlist}

\section{Map Wild List Encounter}
\label{mapwildlistencounter}

\section{Move}
\label{move}

\section{Nature}
\label{nature}

\section{Sound}
\label{sound}

\section{Species}
\label{species}

\section{Species Ability}
\label{speciesability}

\section{Species Item}
\label{speciesitem}

\section{Species Move}
\label{speciesmove}

\section{Store}
\label{store}

\section{Tile}
\label{tile}

\section{Time}
\label{time}

\section{Trainer}
\label{trainer}

\section{Type}
\label{type}

\chapter{Scripting}
\label{scripting}

\section{Collections}
\label{scripting-collections}

\chapter{Battle System}
\label{battle-system}

\chapter{Breeding}
\label{breeding}

\end{document}