{$ifndef unix}
{$A+,B-,D+,E+,F-,G+,I+,L+,N+,P+,Q-,R-,S+,T-,V-,X+,Y+}
{$M 16384}
{$else}
{$B-,I+,S+,T-,X+}
{$endif}
program planets;
uses
{$ifndef unix}
 crt,
{$else}
 xcrt,
{$endif}
 data,
 dos,
 evbios,
 evgraph,
 evtext,
 grafik,
 hsiraw,
 kb,
 listen,
 maus2kb,
 ovrfirst,
 schedule,
{$ifndef unix}
 swapit,
{$endif}
{system,}
 tstring,
 types,
 utils,
 vbios,
 font1,
 menus1,{Schiffs-Menü}
 menus2,{Basis-Menü}
 menus3,{Planeten-Menü}
 menus4,{Schiffs-Menüfunktionen}
 menus5,{Haupt-Menü}
 menus6,{Minenfelder}
 menus7,{Meldungen}
 menus8,{Nachrichten schreiben}
 menus9;{Rassenauswahl}

{$ifndef unix}
{$S 65535}
{$endif}

const
 rt=7;

procedure test;
begin
 msganz:=2;
 with msglist^[0] do begin
  concern1:=4;
  concern2:=6;
  concern3:=7;
 end;
 with msglist^[1] do begin
  concern1:=1;
  concern2:=2;
  concern3:=3;
 end;
 mfeldanz:=2;
 with mfelder[0] do begin
  posx:=10;
  posy:=30;
  posz:=0*300;
  anz:=100;
  typid:=8;
 end;
 with mfelder[1] do begin
  posx:=10;
  posy:=20;
  posz:=0*300;
  anz:=100;
  typid:=9;
 end;
 UsedRassen:=-5;
 planetsanz:=5;
 randomize;
 fillchar(planets1^[0],sizeof(planets1^[0]),0);
 with planets1^[0] do begin
  name:='Testplanet';
  racetyp:=rt;
  raceanz:=56789;
  nativeanz:=13000;
  nativetyp:=2;
  racetax:=10;
  nativetax:=20;
  racecont:=75;
  nativecont:=100;
  minedneutr:=346;
  minedMolyb:=336;
  minedDura:=344;
  minedtrit:=446;
  vertneutr:=78;
  vertmolyb:=32;
  vertdura:=86;
  verttrit:=99;
  neutr:=6874;
  molyb:=5874;
  dura:=8574;
  trit:=4531;
  supplies:=3333;
  Creds:=556;
  bild:=274;
  climate:=random(65535);
  size:=99999999;
 end;
 fillchar(planets1^[1],sizeof(planets1^[1]),0);
 with planets1^[1] do begin
  name:='Testplanet1';
  racetyp:=1;
  raceanz:=23456789;
  minedneutr:=346;
  minedMolyb:=336;
  minedDura:=344;
  minedtrit:=446;
  vertneutr:=78;
  vertmolyb:=32;
  vertdura:=86;
  verttrit:=99;
  neutr:=6874;
  molyb:=5874;
  dura:=8574;
  trit:=4531;
  supplies:=333;
  Creds:=556;
  posx:=40;
  id_nr:=1;
  bild:=275;
  climate:=random(65535);
  size:=9999999;
 end;
 fillchar(planets1^[2],sizeof(planets1^[2]),0);
 with planets1^[2] do begin
  name:='Testplanet2';
  racetyp:=2;
  raceanz:=0;
  neutr:=346;
  Molyb:=336;
  Dura:=344;
  trit:=446;
  supplies:=333;
  Creds:=556;
  posy:=20;
  id_nr:=2;
  bild:=276;
  climate:=random(65535);
  size:=999999;
 end;
 fillchar(planets1^[3],sizeof(planets1^[3]),0);
 with planets1^[3] do begin
  name:='Testplanet3';
  racetyp:=3;
  raceanz:=23456789;
  minedneutr:=346;
  minedMolyb:=336;
  minedDura:=344;
  minedtrit:=446;
  supplies:=333;
  Creds:=556;
  posz:=20;
  id_nr:=3;
  bild:=277;
  climate:=random(65535);
  size:=99999;
 end;
 fillchar(planets1^[4],sizeof(planets1^[4]),0);
 with planets1^[4] do begin
  name:='Testplanet4';
  racetyp:=rt;
  raceanz:=23456789;
  minedneutr:=346;
  minedMolyb:=336;
  minedDura:=344;
  minedtrit:=446;
  supplies:=333;
  Creds:=556;
  posx:=-20;
  id_nr:=4;
  bild:=278;
  climate:=random(65535);
  size:=23456789;
 end;
 basesanz:=1;
 fillchar(bases1^[0],sizeof(bases1^[0]),0);
 with bases1^[0] do begin
  name:='Testbasis';
  owner:=rt;
  crew:=50000;
  fighter:=20;
  torps[1]:=1;
  torps[2]:=2;
  torps[3]:=3;
  torps[4]:=4;
  torps[5]:=5;
  torps[6]:=6;
  torps[7]:=7;
  torps[8]:=8;
  torps[9]:=9;
  minen[1]:=11;
  minen[2]:=12;
  minen[3]:=13;
  minen[4]:=14;
  minen[5]:=15;
  minen[6]:=16;
  minen[7]:=17;
  minen[8]:=18;
  minen[9]:=19;
  techE:=$66;
  techh:=$aa;
  techm:=$11;
  techt:=$22;
  techtl:=$33;
  damage:=101;
{  posx:=50;
  posy:=25;
  posz:=61;}
 end;
 shipsanz:=3;
 with ships1^[0] do begin
  typnr:=0;
  ID_NR:=1;
  Owner:=rt;
  Posx:=0;
  Posy:=0;
  Posz:=0;
  Targetx:=0;
  Targety:=0;
  Targetz:=0;
  Mission1:=25;
  Mission2:=3;
  Mission3:=8+8 shl 8 + 3 shl 16;
  Mission4:=1;
  damage:=1;

  fighter:=0;
  Engtyp:=1;
  warp:=0;
  Beams:=1;
  BeamTyp:=1;
  TorpRohre:=2;
  TorpRohreTyp:=3;
  Bays:=3;
  Minenleger:=6;
  Crew:=2;
  Cred:=12;
  Neutr:=35;
  Molyb:=0;
  Dura:=0;
  Trit:=0;
  Colons:=0;
  supplies:=12;
  fillchar(torps,sizeof(torps),0);
  fillchar(minen,sizeof(minen),0);
  Schiffname:='Mss Bounty';
 end;
 with ships1^[2] do begin
  typnr:=1;
  ID_NR:=3;
  Owner:=1;
  Posx:=10;
  Posy:=20;
  Posz:=30;
  Targetx:=0;
  Targety:=0;
  Targetz:=0;
  Mission1:=25;
  Mission2:=3;
  Mission3:=8+8 shl 8 + 3 shl 16;
  Mission4:=1;
  damage:=0;

  Engtyp:=1;
  warp:=0;
  Beams:=1;
  BeamTyp:=1;
  TorpRohre:=0;
  TorpRohreTyp:=0;
  Bays:=3;
  Minenleger:=0;
  Crew:=9;
  Cred:=12;
  Neutr:=35;
  Molyb:=0;
  Dura:=0;
  Trit:=0;
  Colons:=0;
  fighter:=0;
  supplies:=12;
  fillchar(torps,sizeof(torps),0);
  fillchar(minen,sizeof(minen),0);
  Schiffname:='Mss Mars';
 end;
 with ships1^[1] do begin
  typnr:=2;
  ID_NR:=2;
  Owner:=rt;
  Posx:=0;
  Posy:=20;
  Posz:=0;
  Targetx:=0;
  Targety:=0;
  Targetz:=0;
  Mission1:=1;
  Mission2:=3;
  Mission3:=8+8 shl 8 + 3 shl 16;
  Mission4:=1;
  damage:=0;

  Engtyp:=1;
  warp:=0;
  Beams:=1;
  BeamTyp:=1;
  TorpRohre:=0;
  TorpRohreTyp:=0;
  Bays:=3;
  Minenleger:=0;
  Crew:=9;
  Cred:=12;
  Neutr:=35;
  Molyb:=0;
  Dura:=0;
  Trit:=0;
  Colons:=10;
  fighter:=0;
  supplies:=12;
  fillchar(torps,sizeof(torps),0);
  fillchar(minen,sizeof(minen),0);
  Schiffname:='Mss Twix';
 end;
end;

const
 Copyright:string80='Planets 0.2  * * *  coded and designed by REX IMPERIA'#13#10'$';

begin
 initplanets;
 initmaus3d;
 runmenu(loadscreen,0,0,0,0,0,0);
 menushedule;
 setvideomode(3);
{$ifndef unix}
 asm
  mov ah,9
  mov dx,offset copyright+1
  int $21
 end;
{$else}
 writeln(copyright);
{$endif}
end.
