~ubuntu-branches/debian/stretch/opentyrian/stretch

« back to all changes in this revision

Viewing changes to src/episodes.h

  • Committer: Package Import Robot
  • Author(s): Etienne Millon
  • Date: 2015-03-31 08:48:54 UTC
  • Revision ID: package-import@ubuntu.com-20150331084854-f5a4uoz7uv3vopk6
Tags: upstream-2.1.20130907+dfsg
ImportĀ upstreamĀ versionĀ 2.1.20130907+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* 
 
2
 * OpenTyrian: A modern cross-platform port of Tyrian
 
3
 * Copyright (C) 2007-2009  The OpenTyrian Development Team
 
4
 *
 
5
 * This program is free software; you can redistribute it and/or
 
6
 * modify it under the terms of the GNU General Public License
 
7
 * as published by the Free Software Foundation; either version 2
 
8
 * of the License, or (at your option) any later version.
 
9
 *
 
10
 * This program is distributed in the hope that it will be useful,
 
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
 * GNU General Public License for more details.
 
14
 *
 
15
 * You should have received a copy of the GNU General Public License
 
16
 * along with this program; if not, write to the Free Software
 
17
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
18
 */
 
19
#ifndef EPISODES_H
 
20
#define EPISODES_H
 
21
 
 
22
#include "opentyr.h"
 
23
 
 
24
#include "lvlmast.h"
 
25
 
 
26
 
 
27
/* Episodes and general data */
 
28
 
 
29
#define FIRST_LEVEL 1
 
30
#define EPISODE_MAX 5
 
31
#ifdef TYRIAN2000
 
32
#define EPISODE_AVAILABLE 5
 
33
#else
 
34
#define EPISODE_AVAILABLE 4
 
35
#endif
 
36
 
 
37
typedef struct
 
38
{
 
39
        JE_word     drain;
 
40
        JE_byte     shotrepeat;
 
41
        JE_byte     multi;
 
42
        JE_word     weapani;
 
43
        JE_byte     max;
 
44
        JE_byte     tx, ty, aim;
 
45
        JE_byte     attack[8], del[8]; /* [1..8] */
 
46
        JE_shortint sx[8], sy[8]; /* [1..8] */
 
47
        JE_shortint bx[8], by[8]; /* [1..8] */
 
48
        JE_word     sg[8]; /* [1..8] */
 
49
        JE_shortint acceleration, accelerationx;
 
50
        JE_byte     circlesize;
 
51
        JE_byte     sound;
 
52
        JE_byte     trail;
 
53
        JE_byte     shipblastfilter;
 
54
} JE_WeaponType;
 
55
 
 
56
typedef struct
 
57
{
 
58
        char    name[31]; /* string [30] */
 
59
        JE_byte opnum;
 
60
        JE_word op[2][11]; /* [1..2, 1..11] */
 
61
        JE_word cost;
 
62
        JE_word itemgraphic;
 
63
        JE_word poweruse;
 
64
} JE_WeaponPortType[PORT_NUM + 1]; /* [0..portnum] */
 
65
 
 
66
typedef struct
 
67
{
 
68
        char        name[31]; /* string [30] */
 
69
        JE_word     itemgraphic;
 
70
        JE_byte     power;
 
71
        JE_shortint speed;
 
72
        JE_word     cost;
 
73
} JE_PowerType[POWER_NUM + 1]; /* [0..powernum] */
 
74
 
 
75
typedef struct
 
76
{
 
77
        char    name[31]; /* string [30] */
 
78
        JE_word itemgraphic;
 
79
        JE_byte pwr;
 
80
        JE_byte stype;
 
81
        JE_word wpn;
 
82
} JE_SpecialType[SPECIAL_NUM + 1]; /* [0..specialnum] */
 
83
 
 
84
typedef struct
 
85
{
 
86
        char        name[31]; /* string [30] */
 
87
        JE_byte     pwr;
 
88
        JE_word     itemgraphic;
 
89
        JE_word     cost;
 
90
        JE_byte     tr, option;
 
91
        JE_shortint opspd;
 
92
        JE_byte     ani;
 
93
        JE_word     gr[20]; /* [1..20] */
 
94
        JE_byte     wport;
 
95
        JE_word     wpnum;
 
96
        JE_byte     ammo;
 
97
        JE_boolean  stop;
 
98
        JE_byte     icongr;
 
99
} JE_OptionType;
 
100
 
 
101
typedef struct
 
102
{
 
103
        char    name[31]; /* string [30] */
 
104
        JE_byte tpwr;
 
105
        JE_byte mpwr;
 
106
        JE_word itemgraphic;
 
107
        JE_word cost;
 
108
} JE_ShieldType[SHIELD_NUM + 1]; /* [0..shieldnum] */
 
109
 
 
110
typedef struct
 
111
{
 
112
        char        name[31]; /* string [30] */
 
113
        JE_word     shipgraphic;
 
114
        JE_word     itemgraphic;
 
115
        JE_byte     ani;
 
116
        JE_shortint spd;
 
117
        JE_byte     dmg;
 
118
        JE_word     cost;
 
119
        JE_byte     bigshipgraphic;
 
120
} JE_ShipType[SHIP_NUM + 1]; /* [0..shipnum] */
 
121
 
 
122
/* EnemyData */
 
123
typedef struct
 
124
{
 
125
        JE_byte     ani;
 
126
        JE_byte     tur[3]; /* [1..3] */
 
127
        JE_byte     freq[3]; /* [1..3] */
 
128
        JE_shortint xmove;
 
129
        JE_shortint ymove;
 
130
        JE_shortint xaccel;
 
131
        JE_shortint yaccel;
 
132
        JE_shortint xcaccel;
 
133
        JE_shortint ycaccel;
 
134
        JE_integer  startx;
 
135
        JE_integer  starty;
 
136
        JE_shortint startxc;
 
137
        JE_shortint startyc;
 
138
        JE_byte     armor;
 
139
        JE_byte     esize;
 
140
        JE_word     egraphic[20];  /* [1..20] */
 
141
        JE_byte     explosiontype;
 
142
        JE_byte     animate;       /* 0:Not Yet   1:Always   2:When Firing Only */
 
143
        JE_byte     shapebank;     /* See LEVELMAK.DOC */
 
144
        JE_shortint xrev, yrev;
 
145
        JE_word     dgr;
 
146
        JE_shortint dlevel;
 
147
        JE_shortint dani;
 
148
        JE_byte     elaunchfreq;
 
149
        JE_word     elaunchtype;
 
150
        JE_integer  value;
 
151
        JE_word     eenemydie;
 
152
} JE_EnemyDatType[ENEMY_NUM + 1]; /* [0..enemynum] */
 
153
 
 
154
extern JE_WeaponPortType weaponPort;
 
155
extern JE_WeaponType weapons[WEAP_NUM + 1]; /* [0..weapnum] */
 
156
extern JE_PowerType powerSys;
 
157
extern JE_ShipType ships;
 
158
extern JE_OptionType options[OPTION_NUM + 1]; /* [0..optionnum] */
 
159
extern JE_ShieldType shields;
 
160
extern JE_SpecialType special;
 
161
extern JE_EnemyDatType enemyDat;
 
162
extern JE_byte initial_episode_num, episodeNum;
 
163
extern JE_boolean episodeAvail[EPISODE_MAX];
 
164
 
 
165
extern char episode_file[13], cube_file[13];
 
166
 
 
167
extern JE_longint episode1DataLoc;
 
168
extern JE_boolean bonusLevel;
 
169
extern JE_boolean jumpBackToEpisode1;
 
170
 
 
171
void JE_loadItemDat( void );
 
172
void JE_initEpisode( JE_byte newEpisode );
 
173
unsigned int JE_findNextEpisode( void );
 
174
void JE_scanForEpisodes( void );
 
175
 
 
176
#endif /* EPISODES_H */
 
177