Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | RSS feed

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