1 /*
2  *
3  *   Copyright (c) 1994, 2002, 2003  Johannes Prix
4  *   Copyright (c) 1994, 2002, 2003  Reinhard Prix
5  *
6  *
7  *  This file is part of Freedroid
8  *
9  *  Freedroid is free software; you can redistribute it and/or modify
10  *  it under the terms of the GNU General Public License as published by
11  *  the Free Software Foundation; either version 2 of the License, or
12  *  (at your option) any later version.
13  *
14  *  Freedroid is distributed in the hope that it will be useful,
15  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  *  GNU General Public License for more details.
18  *
19  *  You should have received a copy of the GNU General Public License
20  *  along with Freedroid; see the file COPYING. If not, write to the
21  *  Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
22  *  MA  02111-1307  USA
23  *
24  */
25 #ifndef _takeover_h
26 #define _takeover_h
27 
28 /* Background-color of takeover-game */
29 #define TO_BG_COLOR			63
30 
31 /* File containing the Takeover-blocks */
32 #define TO_BLOCK_FILE		"to_elem.png"
33 
34 /* --------------- individual block dimensions --------------- */
35 #define NUM_PHASES		5       /* number of color-phases for current "flow" */
36 					/* inclusive "inactive" phase */
37 
38 /* Dimensions of the game-blocks */
39 #define TO_BLOCKS		11	/* anzahl versch. Game- blocks */
40 
41 #define NUM_TO_BLOCKS		2*NUM_PHASES*TO_BLOCKS // total number of takover blocks
42 #define TO_ELEMENTS		6
43 
44 /* Dimensions of the fill-blocks (in led-column */
45 #define NUM_FILL_BLOCKS		3   // yellow, violett and black
46 
47 /* Dimensions of a capsule */
48 #define NUM_CAPS_BLOCKS		3  // yellow, violett and red (?what for)
49 
50 /* Dimensions of ground-, column- und leader blocks */
51 #define NUM_GROUND_BLOCKS	6
52 
53 /* --------------- Timing parameters --------------- */
54 #define COLOR_COUNTDOWN		100	/* Zeit zum Farbe auswaehlen */
55 #define GAME_COUNTDOWN		100	/* Zeit fuer das Spiel */
56 #define CAPSULE_COUNTDOWN	 40	/* 1/10 sec. Lebensdauer einer Kapsel */
57 
58 #define WAIT_MOVEMENT		0	/* 1/18 sekunden Bewegungsgeschw. */
59 #define WAIT_COLOR_ROTATION	2	/* 1/18 sekunden aktive-Kabel */
60 #define WAIT_AFTER_GAME		2*18	/* Wait after a deadlock */
61 
62 #define TO_TICK_LENGTH		40     /* Time in ms between ticks */
63 
64 /* --------------- Playground layout --------------- */
65 
66 #define MAX_CAPSULES		13	/* a 999 has 13 !!! */
67 
68 
69 /* there are two classes of blocks: connectors and non-connectors */
70 #define CONNECTOR		0
71 #define NON_CONNECTOR  		1
72 
73 
74 #define NUM_LAYERS		4	/* dimension of the playground */
75 #define NUM_LINES		12
76 
77 
78 enum _groundblocks
79 {
80   GELB_OBEN,
81   GELB_MITTE,
82   GELB_UNTEN,
83   VIOLETT_OBEN,
84   VIOLETT_MITTE,
85   VIOLETT_UNTEN
86 };
87 
88 
89 /* Konditions in Connection-layer */
90 enum condition
91 {
92   INACTIVE = 0,
93   ACTIVE1,
94   ACTIVE2,
95   ACTIVE3,
96   ACTIVE4
97 };
98 
99 /* Names for you and "him" */
100 enum to_opponents
101 {
102   YOU,
103   ENEMY
104 };
105 
106 /* Color-names */
107 #define TO_COLORS		2
108 enum to_colors
109 {
110   GELB = 0,
111   VIOLETT,
112   REMIS
113 };
114 
115 /* Element - Names */
116 enum to_elements
117 {
118   EL_KABEL,
119   EL_KABELENDE,
120   EL_VERSTAERKER,
121   EL_FARBTAUSCHER,
122   EL_VERZWEIGUNG,
123   EL_GATTER
124 };
125 
126 /* Block-Names */
127 enum to_blocks
128 {
129   KABEL,
130   KABELENDE,
131   VERSTAERKER,
132   FARBTAUSCHER,
133   VERZWEIGUNG_O,
134   VERZWEIGUNG_M,
135   VERZWEIGUNG_U,
136   GATTER_O,
137   GATTER_M,
138   GATTER_U,
139   LEER
140 };
141 
142 
143 /* the playground type */
144 typedef int playground_t[TO_COLORS][NUM_LAYERS][NUM_LINES];
145 
146 
147 #endif
148