| 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 | /* Episodes and general data */ |
| 27 | |
| 28 | #define FIRST_LEVEL 1 |
| 29 | #define EPISODE_MAX 5 |
| 30 | #define EPISODE_AVAILABLE 4 |
| 31 | |
| 32 | typedef struct |
| 33 | { |
| 34 | JE_word drain; |
| 35 | JE_byte shotrepeat; |
| 36 | JE_byte multi; |
| 37 | JE_word weapani; |
| 38 | JE_byte max; |
| 39 | JE_byte tx, ty, aim; |
| 40 | JE_byte attack[8], del[8]; /* [1..8] */ |
| 41 | JE_shortint sx[8], sy[8]; /* [1..8] */ |
| 42 | JE_shortint bx[8], by[8]; /* [1..8] */ |
| 43 | JE_word sg[8]; /* [1..8] */ |
| 44 | JE_shortint acceleration, accelerationx; |
| 45 | JE_byte circlesize; |
| 46 | JE_byte sound; |
| 47 | JE_byte trail; |
| 48 | JE_byte shipblastfilter; |
| 49 | } JE_WeaponType; |
| 50 | |
| 51 | typedef struct |
| 52 | { |
| 53 | char name[31]; /* string [30] */ |
| 54 | JE_byte opnum; |
| 55 | JE_word op[2][11]; /* [1..2, 1..11] */ |
| 56 | JE_word cost; |
| 57 | JE_word itemgraphic; |
| 58 | JE_word poweruse; |
| 59 | } JE_WeaponPortType[PORT_NUM + 1]; /* [0..portnum] */ |
| 60 | |
| 61 | typedef struct |
| 62 | { |
| 63 | char name[31]; /* string [30] */ |
| 64 | JE_word itemgraphic; |
| 65 | JE_byte power; |
| 66 | JE_shortint speed; |
| 67 | JE_word cost; |
| 68 | } JE_PowerType[POWER_NUM + 1]; /* [0..powernum] */ |
| 69 | |
| 70 | typedef struct |
| 71 | { |
| 72 | char name[31]; /* string [30] */ |
| 73 | JE_word itemgraphic; |
| 74 | JE_byte pwr; |
| 75 | JE_byte stype; |
| 76 | JE_word wpn; |
| 77 | } JE_SpecialType[SPECIAL_NUM + 1]; /* [0..specialnum] */ |
| 78 | |
| 79 | typedef struct |
| 80 | { |
| 81 | char name[31]; /* string [30] */ |
| 82 | JE_byte pwr; |
| 83 | JE_word itemgraphic; |
| 84 | JE_word cost; |
| 85 | JE_byte tr, option; |
| 86 | JE_shortint opspd; |
| 87 | JE_byte ani; |
| 88 | JE_word gr[20]; /* [1..20] */ |
| 89 | JE_byte wport; |
| 90 | JE_word wpnum; |
| 91 | JE_byte ammo; |
| 92 | JE_boolean stop; |
| 93 | JE_byte icongr; |
| 94 | } JE_OptionType; |
| 95 | |
| 96 | typedef struct |
| 97 | { |
| 98 | char name[31]; /* string [30] */ |
| 99 | JE_byte tpwr; |
| 100 | JE_byte mpwr; |
| 101 | JE_word itemgraphic; |
| 102 | JE_word cost; |
| 103 | } JE_ShieldType[SHIELD_NUM + 1]; /* [0..shieldnum] */ |
| 104 | |
| 105 | typedef struct |
| 106 | { |
| 107 | char name[31]; /* string [30] */ |
| 108 | JE_word shipgraphic; |
| 109 | JE_word itemgraphic; |
| 110 | JE_byte ani; |
| 111 | JE_shortint spd; |
| 112 | JE_byte dmg; |
| 113 | JE_word cost; |
| 114 | JE_byte bigshipgraphic; |
| 115 | } JE_ShipType[SHIP_NUM + 1]; /* [0..shipnum] */ |
| 116 | |
| 117 | /* EnemyData */ |
| 118 | typedef struct |
| 119 | { |
| 120 | JE_byte ani; |
| 121 | JE_byte tur[3]; /* [1..3] */ |
| 122 | JE_byte freq[3]; /* [1..3] */ |
| 123 | JE_shortint xmove; |
| 124 | JE_shortint ymove; |
| 125 | JE_shortint xaccel; |
| 126 | JE_shortint yaccel; |
| 127 | JE_shortint xcaccel; |
| 128 | JE_shortint ycaccel; |
| 129 | JE_integer startx; |
| 130 | JE_integer starty; |
| 131 | JE_shortint startxc; |
| 132 | JE_shortint startyc; |
| 133 | JE_byte armor; |
| 134 | JE_byte esize; |
| 135 | JE_word egraphic[20]; /* [1..20] */ |
| 136 | JE_byte explosiontype; |
| 137 | JE_byte animate; /* 0:Not Yet 1:Always 2:When Firing Only */ |
| 138 | JE_byte shapebank; /* See LEVELMAK.DOC */ |
| 139 | JE_shortint xrev, yrev; |
| 140 | JE_word dgr; |
| 141 | JE_shortint dlevel; |
| 142 | JE_shortint dani; |
| 143 | JE_byte elaunchfreq; |
| 144 | JE_word elaunchtype; |
| 145 | JE_integer value; |
| 146 | JE_word eenemydie; |
| 147 | } JE_EnemyDatType[ENEMY_NUM + 1]; /* [0..enemynum] */ |
| 148 | |
| 149 | extern JE_WeaponPortType weaponPort; |
| 150 | extern JE_WeaponType weapons[WEAP_NUM + 1]; /* [0..weapnum] */ |
| 151 | extern JE_PowerType powerSys; |
| 152 | extern JE_ShipType ships; |
| 153 | extern JE_OptionType options[OPTION_NUM + 1]; /* [0..optionnum] */ |
| 154 | extern JE_ShieldType shields; |
| 155 | extern JE_SpecialType special; |
| 156 | extern JE_EnemyDatType enemyDat; |
| 157 | extern JE_byte initial_episode_num, episodeNum; |
| 158 | extern JE_boolean episodeAvail[EPISODE_MAX]; |
| 159 | |
| 160 | extern char episode_file[13], cube_file[13]; |
| 161 | |
| 162 | extern JE_longint episode1DataLoc; |
| 163 | extern JE_boolean bonusLevel; |
| 164 | extern JE_boolean jumpBackToEpisode1; |
| 165 | |
| 166 | void JE_loadItemDat(void); |
| 167 | void JE_initEpisode(JE_byte newEpisode); |
| 168 | unsigned int JE_findNextEpisode(void); |
| 169 | void JE_scanForEpisodes(void); |
| 170 | |
| 171 | #endif /* EPISODES_H */ |