Вы находитесь на странице: 1из 171

Rem * Title : Star Flight 2000

Rem * Author : Ed Upton (EdzUp)


Rem * Date : 25-05-2000
`******************** planet arrays follow here ***************************
`planet atmosphere Array (predominant color)
`0 : no atmosphere (grey)
`1 : oxygen (teal)
`2 : cyanide (green)
`3 : molten (red)
`4 : water (navy)
`5 : gas (purple)
`6 : rocky (brown)
`********** Debug SYSTEM *************
`0=off 1=on
Dim Debug(0)=1
set text font "arial"
set text size 16
`Dimension Globals For Marks Warp effect
Dim ImageCounter(0)
Dim ShipMass#(0)
Dim ShipSpeed#(0)
Dim WarpSphere(0)
Dim WarpScale#(0)
Dim WarpTexture(0)
Dim WarpSpeed#(0)
`Elite control method switch (0 off 1 on)
Dim EliteControl(0)
EliteControl(0)=1
`Lazer images
Load Image "bmp\Star3.bmp",56400,1
Load Image "bmp\Star6.bmp",56401,1
Load Image "bmp\Star4.bmp",56402,1
Load Image "bmp\Star5.bmp",56403,1
Load Image "bmp\Star7.bmp",56404,1
Load Image "bmp\Star2.bmp",56405,1
Load Image "bmp\Star1.bmp",56406,1
Dim WarpTexture(0)
`Laser Variables
Dim ShotArray(1000)
Dim ShotPower(1000)
Dim ShotSpeed(1000)
Dim LaserMesh(0)
Dim GunType(0)
Dim GunImage(0)
Dim ShotErray#(1000)
Dim Current(0)
ShotVelocity#=2.5
`lazer image 0 (current(0)+56400 = lazer image)
current(0)=0

Dim music$(5)
remstart
keys are:
0)Up
1)Down
2)Left
3)Right
4)Accelerate
5)Decelerate
6)Fire Lazer
7)Comms
8)Identify
9)Jump drive
10)Stop dead
11)Fire Missle
12)Eject
13)Shockwave
14)Pause
15)FTL jump
remend
Dim keys(16)
Dim loadr(1)
`0=
`1=
Dim
Dim

0 Keyboard (Default), 1 Mouse, 2 Analogue Joystick 3 Digital Joystick


sensitivity (Not keyboard)
control(2)
idsys(1)

hide mouse
cls 0
print "Loading please wait..."
`load previously saved keyboard definition is it exists.
Redefine(0)
`ten races each With 18 ships + two user defined races
Dim hatred$(12,12)
`X, Y, Tech, Ships, description lines, no of hated races,race #,start ship
Dim raceinfo(12,8)
`name, 5 line description
Dim racedesc$(12,6)
Dim racerank$(12,12)
Dim shipdata(600,14)
Dim shipname$(600)
Dim shipmodel$(600)
Dim racemisc$(600,3)
For n=0 To 12
racedesc$(n,0)=""
Next n
Dim shipyarditem$(36)
Dim shipyarddata(36,2)
Initraces()
`load any races defined in x.info.txt files
`For example Phargoyde.info.txt
cls 0
LoadRaces()
Dim alttimer(5)

`Array To remember asteroid info


Dim asteroidtype(200,4)
remstart
Cargo canisters jettisoned from ships under attack!!!
0) active
1) carrying
2) speed
remend
Dim cargo(50,3)
remstart
Debris from destroyed ships
0) active
1) timer
2) speed
remend
Dim debris(50,2)
`Shot id
`speed, power, time left, firing object
Dim shot(1000,4)
`x#,y#,z#,xrot#,yrot#,zrot#
Dim shotdata#(1000,6)
`speed,power,time left, firing object,target,missle type
Dim missle(50,6)
`x,y,z,xrot,yrot,zrot
Dim missledata#(50,6)
load
load
load
load
load
load
load
load
load

sound
sound
sound
sound
sound
sound
sound
sound
sound

"sound\bigexp.wav",1 : `
"sound\explode.wav",2 :`
"sound\explode2.wav",3:`
"sound\lasergun.wav",4:`
"sound\launch.wav",5 : `
"sound\lock.wav",6 : `
"sound\phaser.wav",7 : `
"sound\wind.wav",8 : `
"sound\wind2.wav",9 : `

create bitmap 1,640,480


load bitmap "bmp\Title.bmp",1
get image 1000,0,0,600,100
cls 0
load bitmap "bmp\metal04.bmp",1
get image 1006,0,0,256,256
cls 0
load bitmap "bmp\ice01.bmp",1
get image 1001,0,0,256,256
cls 0
load bitmap "bmp\rocky04.bmp",1
get image 1002,0,0,256,256
cls 0
load bitmap "bmp\rock04.bmp",1
get image 1003,0,0,256,256
cls 0
load bitmap "bmp\pointer.bmp",1
get image 2000,0,0,32,32
cls 0

Major explosion
Other explosion
another explosion
Laser gun sound
Mass driver cannon sound
Ident lock And Missle lock sound
another laser sound
Planetary surface wind sound
planetary breeze

load bitmap "bmp\bottomdash.bmp",1


get image 1005,0,0,640,150
get image 1004,0,0,640,150
cls 0
load bitmap "bmp\sky.bmp",1
get image 1006,0,0,256,256
cls 0
load bitmap "bmp\star.bmp",1
get image 1011,0,0,256,256
cls 0
load bitmap "bmp\loading.bmp",1
get image 1200,0,0,256,256
ink RGB(255,255,255),0
box 0,0,256,256
get image 2001,0,0,256,256
get image 2006,0,0,256,256
ink RGB(255,0,0),0
box 0,0,256,256
get image 2002,0,0,256,256
ink RGB(255,255,0),0
box 0,0,256,256
get image 2003,0,0,256,256
ink RGB(0,0,255),0
box 0,0,256,256
get image 2004,0,0,256,256
ink RGB(100,100,255),0
box 0,0,256,256
get image 2005,0,0,256,256
delete bitmap 1
load image "bmp\dumbfire.bmp",2006
load image "bmp\dumbfirehe.bmp",2007
load image "bmp\homer.bmp",2008
load image "bmp\homerhe.bmp",2009
load image "bmp\mine.bmp",2010
load image "bmp\minehe.bmp",2011
load image "bmp\dummymine.bmp",2012
Dim
Dim
Dim
Dim
Dim
Dim
Dim
Dim
Dim
Dim
Dim
Dim

pla(20) :` planets atmosphere


pseed(20) : `planet seed To create surface
rs#(20) : ` rotation speed
cr(20) : ` current rotation
pa(20) : ` planet angle (around sun)
rg(20) : ` planet range (from sun)
ps#(20) :` planet speed
psize(20) :` planet size
pname$(20):` planets actual name
pgrav(20):` planets actual gravity (measured in G's Earth has 1 earth G)
ptemp(20):` planets temperature
psurf(20):` planets predominant surface

Dim
Dim
Dim
Dim
Dim
Dim
Dim
Dim
Dim
Dim

mla(20): ` moons atmosphere


mseed(20) : `moon seed To create surface
ms(20) : ` rotation speed
mr#(20) : ` current rotation
ma#(20) : ` moon angle (around planet)
mg(20) : ` moon range (from planet) (Not too much)
ms(20) :`
moon speed (rotating around planet)
msize(20) :` moon size
mplanet(20):`planet moon is orbiting
mname$(20): `moons actual name

Dim mgrav(20):` moons actual gravity (measured in G's Earth has 1 earth G)
Dim mtemp(20):` moons temperature
Dim msurf(20):` moons predominant surface
`NOTE STATIONS DO Not HAVE NAMES!!!
Dim sseed(10): ` stations seed
Dim sa(10) : ` station angle (around planet)
Dim sg(10) : ` station range (from planet) (Not too much)
Dim ss(10) :`
station speed (rotating around planet)
Dim ssize(10) :` station size
Dim splanet(10):`planet station is orbiting
`NOR DO ASTEROIDS
Dim aa(200) : ` asteroid angle (around sun)
Dim ag(200) : ` asteroid range (from sun) (Not too much)
Dim As(200) :` asteroid speed (rotating around sun)
Dim ax(200)
Dim ay(200)
Dim az(200)
Dim ata(200) : ` asteroid active
Dim lax#(200): ` last x,y,z coords
Dim lay#(200)
Dim laz#(200)
Dim
Dim
Dim
Dim
Dim

sunsize(1)
sunname$(1)
PMiddle$(160)
PLast$(38)
PFirst$(9)

REMSTART
`player
0) X
1) Y
2) Current System
3) sectorX
4) sectorY
5) shipid
6) dest sector X
7) dest sector Y
8) dest system
9) system screen X
10) system screen Y
11) fuel required
12) fuel onboard
13) maximum fuel
14) cargo space
15) Ndata entry
16) Relative To which object
17) message timer
18) EARTH FORCE RANK
19) PHARGOYDE RANK
20) TESSERAK RANK
21) ALLHECK RANK
22) MECH RANK
23) VORDRAX RANK
24) ORTAX RANK
25) VARZING RANK
26) Q-TIE RANK

27) ALMOCK RANK


28) GALACTIC POLICE RANK
29) GALACTIC POLICE WANTED LEVEL
30) UNDERWORLD RANK
31) ELITE RATING
32) SPECIAL FORCES
33) Credit amount
34) Free space
35) Player ship number (racial info)
REMEND
Dim playinfo(35)
Dim playername$(1)
`players cargo And 'bought at' price
`And also ship parts Not fitted (in cargo storage)
Dim playcargo(44)
Dim playprice(44)
remstart
0)Murder
1)Piracy
2)Handling Stolen property
3)Unlawful discharge of weapon
4)Assaulting an officer
5)Permit violation
6)Illegal Mining
7)Illegal Dumping
8)Causing an obstruction
9)Attempted Bribery
10) Threatening behavior
11) current fine amount
remend
Dim record(11)
`missions undertaken by player (30 max)
`Name of sender, And target (If blank just take it there), location
Dim playMname$(30,3)
`active, beginning time, ending time, cash amount
Dim playMinfo(30,3)
Dim playcrew$(100)
Dim playpay(100)
remstart
Bitz on the players ship
0) Current Engine
1) Front Lazer
2) Rear Lazer
3) Left Lazer
4) Right Lazer
5) Top Turret Lazer
6) Bottom Turret Lazer
7) How many Dumb Fire missles are onboard
8) How many Fire And Forget missles are onboard
9) how many HE Dumb Fire Missles are onboard
10)If Cargo scoop fitted
11)If FTL analyser fitted
12)If Shockwave device fitted
13)If Escape capsule fitted
14)How many Lazer Generators are fitted
15)How many shield boosters are fitted

16)If Auto-Loaders are fitted


17)Energy Booster
18)ECM
19)Naval ECM
20)Cloak
21)Galactic Jumpdrive
22)Translator
23)Auto-Repairer
24)Lazer Cooler
25)Dummy Mines
26)Standard mines
27)HE Mines
28)Fuel Scoop
29)HE Dumb Fires
30)Information system
remend
Dim shipbitz(30)
`system And planet seeds, also news items of system currently in!!!
Dim sysinfo(5)
`sectordata =
`
`
`
`
`
`
`
`
`
`
`
`
`
` sname$
=
` system_desc

number of viewable sectors on Map (1)


max systems per sector
0) system seed
1) system planet seed
2) Screen X (For clicking on!!!)
3) Screen Y (also For clicking on!!!)
4) Number of planets
5) Number of Moons
6) Number of Space Stations
7) Number of Asteroids
8) asteroid range
9) system inhabited (o no, 1 yes)
10)tech level 1-255
11)owner
system name (using ol' Elites method!!!)
description of planet

Dim sectordata(6,13)
Dim sname$(6)
Dim sd$(6)
`ALL Data IS ONLY UPDATED WHEN ENTERING A STATION
`Bulletin board bitz so NPC can request To go To a different sector
Dim BBSsectordata(6,12)
Dim BBSsname$(6)
Dim BBSsd$(6)
`bulletin board ship List
Dim BBSShips(30,2)
Dim opt(2):`camera range And maximum asteroids
opt(0)=10000 : `camera max range
opt(1)=200 : ` maximum number of asteroids
opt(2)=4 : `
Scale To times size And distances by!!!!
`crange = 10000 : `camera's visual range
`maxast = 200 : `maximum asteroids available
set camera range 1,10000*opt(2)
fog distance (9900*opt(2))-100
`Ship information

remstart
0) Ship race (0 Terrans,...)
1) Hull Mass
2) Internal Space (No engine)
3) Crew needed
4) Front gun mounts
5) Left Gun mounts
6) Right Gun mounts
7) Rear Gun mounts
8) Top Turret Gun mounts
9) Bottom Turret Gun mounts
10)Missle Mountings
11)Tech level needed For ship To become available
12)Cost /1000
remend
REMSTART
NPC ships Data (50 ships)
Ndata= 0) active (0 no, 1 Yes)
Ndata= 1) type (Pirate, scavenger, Pilot)
2) alliegence
3) color Or texture
4) current speed
5) current damage
6) current target
(0 For none!!!)
7) current shield
8) maximum speed
9) maximum shield
(0 For none!!!)
10) race
11) bounty (If any)
12) gun type (0 none, 1 pulse, 2 rapid)
13) engine type (0 none)
14) Hyperspace analyser
15) shockwave device
16) escape capsule
17) carrying (number of cargo items)
18) object (current object the ship is using so it can be hidden again)
19) Turn speed (To come To new headings)
20) move timer
21) jump out star timer
22) jump in star timer
23) Status (docked, flying etc)
24) ship type (Terran, Phargoyde etc)
25) Max damage (For repairs And radar color)
26) Approaching target (0) Or moving away (1)!!!
27) Target (target object)
28) Lazer temp
29) New X angle
30) new Y angle
31) Max missle pylons
32) Pylons free
Npos#= x,y,z,xrot,yrot,zrot
get target location For each pass of the ship
NShipid$ = 0) Ships ID (For example IXA-27154)
1) Ships Captain (Example Murlock Darkheart)
REMEND
Dim Ndata(50,32)
Dim npos#(50,6)
Dim NShipid$(50,1)
autocam off

stations=0
sync on
Dim NPCName$(100,1) : `First And Last names (random order when picked)
Dim NPCCompany$(100,2):`First middle(optional) And last!!!
`example of NPCName : Joe Blade
`example of Companies: Sirius Corporation, Sirius Metal Corporation
Dim comms(20) : `Communications options
Dim com$(1) : ` answer string
Dim comp(1) : `string pos on screen!!!
`Bulletin Board information
Dim BBS$(20,3) : `4 lines max each entry
Dim BBSinfo(20,3): `type of Add
Dim BBSName$(20) : `Person posting the Add
Dim BBSBuy(28) : `Buying price For goods
Dim BBSSell(28) : `selling price For goods
Dim BBSQty(28) : `how much the station has
`bbs messages
Dim msg$(31)
`0) message type
`1) how trusting!!!
`2) If they are paying
`3) How much they are offering
`4) How many there are of them
`5) passage type
`6) NPC first name
`7) NPC second name
`8) NPC company first part
`9) NPC company middle part
`10) NPC company ending
`11) sector X
`12) sector y
`13) system number
Dim mesinfo(35,13)
Dim mesinfoname$(35)
Dim messysname$(35)
`jump To main loop bypassing functions And code segments
Goto MAIN
REMSTART
on every pass of the function point the ship at the target And get coordinates
then Return ship To original facing direction, this will allow the ship To
turn To face the direction they should be facing rather than where they
would otherwise go!!!
REMEND
`function To make sure moons do Not occupy the same area
FUNCTION checkmoon(planet,curmoon)
If Debug(0)=1 then text 0,0,"DEBUG: CheckMoon"
For cm=0 To curmoon-1
If mplanet(cm)=planet then a=a+10
Next cm
ENDFUNCTION a
` ******************** MARKS CODE HERE **************************
Function Do_Warp(WarpSign)
If Debug(0)=1 then text 0,0,"DEBUG: Do_Warp"

True=-1:One=1
If WarpSign=One
WarpReturn=True
`Initialise Warp environment
WarpSphere(0)=Create_WarpField(1024,65535)
EndIf
If WarpSign=True
`Apply Warp effect
WarpScale#(0)=WarpScale#(0)+50.0
Scale Object WarpSphere(0),100.0,100.0,100.0+WarpScale#(0)
If WarpScale#(0)>15000.0 then WarpReturn=-2
EndIf
If WarpSign=-2
`Apply Warp acceleration
If ShipSpeed#(0)<(WarpSpeed#(0)-0.0001)
Difference#=WarpSpeed#(0)-ShipSpeed#(0)
Acell#=(Difference#/ShipMass#(0)/2.0)
ShipSpeed#(0)=ShipSpeed#(0)+Acell#
Else
WarpReturn=-3
EndIf
ScrVal#=(ShipSpeed#(0)/10000.0)*-10.0
Scroll Object Texture WarpSphere(0),0.0,ScrVal#
EndIf
If WarpSign=-3
`Hold maximum speed
ScrVal#=(ShipSpeed#(0)/10000.0)*-10.0
Scroll Object Texture WarpSphere(0),0.0,ScrVal#
EndIf
If WarpSign=-4
`Decelerate
If ShipSpeed#(0)>False#
Difference#=ShipSpeed#(0)-WarpSpeed#(0)
Decell#=(Difference#/ShipMass#(0)/2.0)*-10.0
ShipSpeed#(0)=ShipSpeed#(0)-Decell#
Else
ShipSpeed#(0)=0.0
WarpReturn=-5
EndIf
ScrVal#=(ShipSpeed#(0)/10000.0)*-10.0
Scroll Object Texture WarpSphere(0),0.0,ScrVal#
EndIf
If WarpSign=-5
`Collapse Warp field
WarpScale#(0)=WarpScale#(0)-50.0
Scale Object WarpSphere(0),100.0,100.0,100.0+WarpScale#(0)
If WarpScale#(0)<1.0 then WarpReturn=-6
EndIf
If WarpSign=-6
Hide Object WarpSphere(0)
WarpSign=0
EndIf

EndFunction WarpReturn
Function Create_WarpField(BumpSize,NoStars)
If Debug(0)=1 then text 0,0,"DEBUG: Create_WarpField"
BumpNumber=NewBump()
Create Bitmap BumpNumber,BumpSize,BumpSize
For StarLoop=1 To NoStars
InkCol=RND(100)+50
Ink RGB(InkCol+RND(100),InkCol+RND(100),InkCol+RND(100)),0
X=RND(BumpSize):Y=RND(BumpSize)
Dot X,Y
Next StarLoop
WarpTexture(0)=1234
Get Image WarpTexture(0),1,1,BumpSize,BumpSize
Delete Bitmap BumpNumber
Position Camera 0.0,0.0,0.0
Point Camera 0.0,0.0,500.0
ObjNumber=NewObject()
Make Object Sphere ObjNumber,1000.0
set object ObjNumber,1,1,0,1,0,0,0
Position Object ObjNumber,Camera Position X(),Camera Position Y(),Camera
Position Z()
`
Set Object ObjNumber,1,1,0,1
Texture Object ObjNumber,WarpTexture(0)
XRotate Object ObjNumber,90.0
Fix Object Pivot ObjNumber
EndFunction ObjNumber
Function NewBump()
If Debug(0)=1 then text 0,0,"DEBUG: NewBump"
Do
Inc TestBump
If Bitmap Exist(TestBump)=0
BumpNumber=TestBump
Exit
EndIf
Loop
EndFunction BumpNumber
Function NewObject()
If Debug(0)=1 then text 0,0,"DEBUG: NewObject"
Do
Inc TestObject
If Object Exist(TestObject)=0
ObjectNumber=TestObject
Exit
EndIf
Loop
EndFunction ObjectNumber
`********************** End OF MARKS CODE ************************
`*************HYPERSPACE CODE*******************

FUNCTION starfield()
If Debug(0)=1 then text 0,0,"DEBUG: Starfield"
`Assign globals
ShipMass#(0)=120.0:WarpSpeed#(0)=1.0
`Color BackDrop 0
state=0
WarpSign=1
load sound "sounds\Hyper1.wav",1020
load sound "sounds\VoidHum.wav",1022
sndplay=0
Repeat
If sound playing(1022)=0 And WarpSign<>1 then play sound 1022
ok=0
`
Set Cursor 0,10:Print Screen FPS()
`
A$=Upper$(Inkey$())
`
If A$="H"
`
If WarpSign=0 then WarpSign=1
`
EndIf
If WarpSign=-1 And sndplay=0
play sound 1020
sndplay=1
EndIf
If WarpSign then WarpDone=Do_Warp(WarpSign)
WarpSign=WarpDone
If WarpSign=-3 then WarpSign=-4
`
Print WarpSign;" : ";ShipSpeed#(0)
state=1-state
If state=1 then Sync
If WarpSign=-6 then ok=1
Until ok=1 Or keystate(1)=1
If keystate(1)=1 then End
stop sound 1022
delete sound 1020
delete sound 1022
Delete Object WarpSphere(0)
Delete Image WarpTexture(0)
ENDFUNCTION
`function For creating moon surfaces
FUNCTION create_surface(planet,tex,opn)
If Debug(0)=1 then text 0,0,"DEBUG: Create_surface"
create bitmap 5,258,258
set current bitmap 5
cls RGB(150,150,150)
If tex>21
mseed(planet)=rnd(65535)
randomize mseed(planet)
mla(planet)=rnd(6)
ma#(planet)=rnd(65535)
ms(planet)=rnd(10)+25
msize(planet)=rnd(5)+5
mgrav(planet)=rnd(2500)
mtemp(planet)=rnd(1000)-500
msurf(planet)=rnd(3)
Else
pseed(planet)=rnd(65535)
randomize pseed(planet)
pla(planet)=rnd(6)
pa(planet)=rnd(65535)

ps#(planet)=0.1*(rnd(5)+1)
psize(planet)=rnd(100)+10
pgrav(planet)=rnd(2500)
ptemp(planet)=rnd(1000)-500
psurf(planet)=rnd(3)
EndIf
`planet atmosphere Array (predominant color)
`0 : no atmosphere (grey)
`1 : oxygen (teal)
`2 : cyanide (green)
`3 : molten (red)
`4 : water (navy)
`5 : gas (purple)
`6 : rocky (brown)
If tex>21 then a=mla(planet) Else a=pla(planet)
r=50
g=50
b=50
If a=0 then ink RGB(50,50,50),0
If a=1 then ink RGB(50,50,150),0
If a=2 then ink RGB(0,150,0),0
If a=3 then ink RGB(150,0,0),0
If a=4 then ink RGB(0,0,150),0
If a=5 then ink RGB(150,0,150),0
If a=6 then ink RGB(150,55,10),0
`draw in predominant surface
box 0,0,256,256
msf=rnd(5)+5
col=Point(0,0)
r=rgbr(col)
g=rgbg(col)
b=rgbb(col)
If a=0
`barren worlds no atmosphere (moons etc)
ink RGB(10,10,10),0
For ln=0 To msf*3
lx=rnd(200)+25
ly=rnd(200)+25
circle lx,ly,rnd(5)+3
Next ln
EndIf
If a=1 Or a=3 Or a=4 Or a=6
`standard planet surfaces
For ln=0 To msf
lx=rnd(256)
ly=rnd(256)
ink RGB(rnd(255),rnd(255),rnd(255)),0
For cnta=0 To rnd(500)
dot lx,ly
inc ly,rnd(2)
dec ly,rnd(2)
inc lx,rnd(2)
dec lx,rnd(2)
If lx<0 then lx=256
If lx>256 then lx=0
If ly<0 then ly=256
If ly>256 then ly=0
Next cnta

Next ln
EndIf
If a=2 Or a=5
`gas giants
For ln=0 To msf
lyp=rnd(256)
bw=rnd(25)+1
coli=rnd(100)
nr=r+coli
If nr>255 then nr=255
ng=g+coli
If ng>255 then ng=255
nb=b+coli
If nb>255 then nb=255
ink RGB(nr,ng,nb),0
For lsx=0 To 128
line 128+lsx,lyp-bw,128+lsx,lyp+bw
line 128-lsx,lyp-bw,128-lsx,lyp+bw
wa=rnd(50)
If bw>25 then wa=1
If bw<2 then wa=40
If wa<20 then bw=bw-1
If wa>30 then bw=bw+1
Next lsx
Next ln
EndIf
get image tex,0,0,256,256
delete bitmap 5
ENDFUNCTION
`update debris
FUNCTION position_debris()
If Debug(0)=1 then text 0,0,"DEBUG: Position_Debris"
`Twinkle by rotating all debree objects (wrap stars around)
For t=800 To 900
rotate object t,wrapvalue(object angle x(t)+1),wrapvalue(object angle y(
t)+4),0
dx#=object position x(t)
dy#=object position y(t)
dz#=object position z(t)
x#=camera position x()
y#=camera position y()
z#=camera position z()
If dx#>x#+250 then dx#=dx#-500 : dy#=y#+rnd(1000)-250
If dx#<x#-250 then dx#=dx#+500 : dy#=y#+rnd(1000)-250
If dz#>z#+250 then dz#=dz#-500 : dy#=y#+rnd(1000)-250
If dz#<z#-250 then dz#=dz#+500 : dy#=y#+rnd(1000)-250
position object t,dx#,dy#,dz#
If dx#>x#-400 And dx#<x#+400 And dy#>y#-400 And dy#<y#+400 And dz#>z#-400 And
dz#<z#+400
show object t
Else
hide object t
EndIf
Next t
ENDFUNCTION
`function To position planet on screen And update movement

FUNCTION position_planet(planet,obj)
If Debug(0)=1 then text 0,0,"DEBUG: Position Planet"
If object exist(obj)=1
olx#=object position x(obj)
olz#=object position z(obj)
prx#=season+Sin((2*pa(planet))*3.1415923/360)*rg(planet)
pry#=0+Cos((2*pa(planet))*3.1415923/360)*rg(planet)
cr(planet)=cr(planet)+rs#(planet)
If cr(planet)>360 then cr(planet)=cr(planet)-360
rotate object obj,0,cr(planet),0
If prx#<>olx# Or pry#<>olz#
position object obj,prx#,0,pry#
EndIf
pa(planet)=pa(planet)+ps#(planet)
EndIf
ENDFUNCTION
`code segment To update moon on screen And update movement
FUNCTION position_moon(planet,obj)
If Debug(0)=1 then text 0,0,"DEBUG: Position_Moon"
If (mplanet(planet)>0)
If object exist(mplanet(planet))=1 And object exist(obj)=1
ox=object position x(mplanet(planet))
oy=object position z(mplanet(planet))
olx#=object position x(obj)
olz#=object position z(obj)
mrx#=ox+Sin((2*mr#(planet))*3.1415923/360)*mg(planet)
mry#=oy+Cos((2*mr#(planet))*3.1415923/360)*mg(planet)
If mrx#<>olx# And mry#<>olz#
position object obj,mrx#,0,mry#
EndIf
mr#(planet)=mr#(planet)+ms(planet)
EndIf
EndIf
ENDFUNCTION
`code segment To update station on screen And update movement
FUNCTION position_station(planet,obj)
If Debug(0)=1 then text 0,0,"DEBUG: Position_Station"
If (splanet(planet)>0)
If object exist(splanet(planet))=1 And object exist(obj)=1
If sg(planet)<200 then hide object obj
ox=object position x(splanet(planet))
oy=object position z(splanet(planet))
olx#=object position x(obj)
olz#=object position z(obj)
mrx#=ox+Sin((2*sa(planet))*3.1415923/360)*sg(planet)
mry#=oy+Cos((2*sa(planet))*3.1415923/360)*sg(planet)
If mrx#<>olx# Or mry#<>olz#
position object obj,mrx#,0,mry#
show object obj
point object obj,object position x(splanet(planet)),object position y(splane
t(planet)),object position z(splanet(planet))
EndIf
sa(planet)=sa(planet)+ss(planet)
EndIf
EndIf
ENDFUNCTION
`code segment To update asteroid on screen And update movement

FUNCTION position_asteroid(planet,obj)
If Debug(0)=1 then text 0,0,"DEBUG: Position_Asteroid"
cx#=camera position x()
cy#=camera position y()
cz#=camera position z()
If ata(obj-103)=1
If object exist(obj)=1
lax#(obj-103)=object position x(obj)
lay#(obj-103)=object position y(obj)
laz#(obj-103)=object position z(obj)
EndIf
sx#=lax#(obj-103)
sy#=lay#(obj-103)
sz#=laz#(obj-103)
tx#=cx#-1500
ty#=cz#-1500
bx#=cx#+1500
by#=cz#+1500
`If asteroid within 1500 units of player then its drawn otherwise its
`Not shown
If sx#>tx# And sx#<bx# And sz#>ty# And sz#<by#
mrx#=0+Sin((2*aa(planet))*3.1415923/360)*ag(planet)
mry#=0+Cos((2*aa(planet))*3.1415923/360)*ag(planet)
lax#(obj-103)=mrx#
lay#(obj-103)=asteroidtype(obj-103,4)
laz#(obj-103)=mry#
If object exist(obj)=1
position object obj,mrx#,object position y(obj),mry#
Else
make object obj,1,0
fade object obj,1
texture object obj,1001+asteroidtype(obj-103,0)
scale object obj,asteroidtype(obj-103,1),asteroidtype(obj-103,2),asteroidty
pe(obj-103,3)
position object obj,mrx#,asteroidtype(obj-103,4),mry#
EndIf
Else
If object exist(obj)=1
delete object obj
EndIf
EndIf
If object exist(obj)=1
tx=object angle x(obj)
tx=tx+ax(planet)
If tx>360 then tx=tx-360
ty=object angle y(obj)
ty=ty+ax(planet)
If ty>360 then ty=ty-360
tz=object angle z(obj)
tz=tz+ax(planet)
If tz>360 then tz=tz-360
rotate object obj,tx,ty,tz
EndIf
aa(planet)=aa(planet)+As(planet)
EndIf
ENDFUNCTION
`code To control ships
FUNCTION position_ship(shipid)
If Debug(0)=1 then text 0,0,"DEBUG: Position_ship"

If Ndata(shipid,0)<>0
show object 306+shipid
sx=npos#(shipid,0)
sy=npos#(shipid,1)
sz=npos#(shipid,2)
vis=1
If sx<camera position x()-1000 Or sx>camera position x()+1000 then vis=0
If sy<camera position y()-1000 Or sy>camera position y()+1000 then vis=0
If sz<camera position z()-1000 Or sz>camera position z()+1000 then vis=0
If sx<camera position x()-2000 Or sx>camera position x()+2000 then vis=2
If sy<camera position y()-2000 Or sy>camera position y()+2000 then vis=2
If sz<camera position z()-2000 Or sz>camera position z()+2000 then vis=2
`outside visual range then hide it!!!
If vis=0 then hide object 306+shipid
`outside chasing range then deactivate it!!!
If vis=2
ndata(shipid,0)=0
EndIf
`If object visible update!!!
If vis=1
position object 306+shipid,npos#(shipid,0),npos#(shipid,1),npos#(shipid,2)
show object 306+shipid
EndIf
`otherwise
If vis<>2
`change course (cc) will Return 1 If NPC is getting too near To something
`Or 0 If its safe To Continue!!!
`***************************
`* SHIP MOVEMENT CODE HERE *
`***************************
`***************************************************************************
If ndata(shipid,7)<ndata(shipid,9) then ndata(shipid,7)=ndata(shipid,7)+1
`code To make ship turn To face target
ndata(shipid,4)=2
If ndata(shipid,28)>0 then ndata(shipid,28)=ndata(shipid,28)-1
If Ndata(shipid,27)>0
ndata(shipid,4)=3
`get positions of objects tx,ty,tz is the target
`ndata 26 : 0 approach 1 move away 2 avoid collision 3 evasive move
cfx#=object angle x(306+shipid)
cfy#=object angle y(306+shipid)
cfz#=object angle z(306+shipid)
tx#=object position x(Ndata(shipid,27))
ty#=object position y(Ndata(shipid,27))
tz#=object position z(Ndata(shipid,27))
tax#=object angle x(ndata(shipid,27))
cx#=object position x(306+shipid)
cy#=object position y(306+shipid)
cz#=object position z(306+shipid)
If cx#>tx#-4 And cx#<tx#+4 And cy#>ty#-4 And cy#<ty#+4 And cz#>tz#-4 And cz#
<tz#+4
ndata(shipid,26)=2
If ndata(shipid,29)=-1
ntd=100+rnd(70)
ndata(shipid,29)=wrapvalue(cfx#-ntd)
EndIf
If ndata(shipid,30)=-1
ntd=100+rnd(70)
ndata(shipid,30)=wrapvalue(cfy#-ntd)
EndIf

EndIf
`If far enough away attack again
If ndata(shipid,26)=1 Or ndata(shipid,26)=2
If cx#<tx#-10 Or cx#>tx#+10
If cy#<ty#-10 Or cy#>ty#+10 then ndata(shipid,26)=0
EndIf
EndIf
If ndata(shipid,26)=0
point object 306+shipid,tx#,ty#,tz#
nfx#=object angle x(306+shipid)
nfy#=object angle y(306+shipid)
rotate object 306+shipid,cfx#,cfy#,cfz#
EndIf
`rotation code follows here
`td? =turn direction 0 left 1 right
If ndata(shipid,26)=0
If tx#>cx#-40 And tx#<cx#+40 And tz#>cz#-40 And tz#<cz#+40 And ty#>cy#-40 A
nd ty#<cy#+40
`If near enough To fire then FIRE!!!
If ndata(shipid,28)<100
Fire(3,306+shipid,ndata(shipid,4))
ndata(shipid,28)=ndata(shipid,28)+5
EndIf
EndIf
If ndata(shipid,26)=2
`If on avoid collision updata AI directions
nfx#=ndata(shipid,29)
nfy#=ndata(shipid,30)
Else
ndata(shipid,29)=-1
ndata(shipid,30)=-1
EndIf
If ndata(shipid,26)=0
`only rotate To targets heading If on approach vector
If nfx#>wrapvalue(cfx#) then tdx=1 Else tdx=0
If nfy#>wrapvalue(cfy#) then tdy=1 Else tdy=0
If tdx=0 then xrotate object 306+shipid,wrapvalue(cfx#-ndata(shipid,19))
If tdx=1 then xrotate object 306+shipid,wrapvalue(cfx#+ndata(shipid,19))
If tdy=0 then yrotate object 306+shipid,wrapvalue(cfy#-ndata(shipid,19))
If tdy=1 then yrotate object 306+shipid,wrapvalue(cfy#+ndata(shipid,19))
If nfx#<wrapvalue(cfx#+ndata(shipid,19)) Or nfx#>wrapvalue(cfx#-ndata(ship
id,19))
xrotate object 306+shipid,nfx#
EndIf
If nfy#<wrapvalue(cfy#+ndata(shipid,19)) Or nfy#>wrapvalue(cfy#-ndata(ship
id,19))
yrotate object 306+shipid,nfy#
EndIf
EndIf
EndIf
EndIf
`ship looses interest in player If player docked!!!
If ndata(shipid,27)=304
If ndata(playinfo(15),23)>0 then ndata(shipid,27)=0
EndIf
`make NPC ships move at thier MAX speed
`this allows fast ships To out run slow transports ;)
a=Abs(ndata(shipid,8))
If a>0 then a=a/2
If ndata(shipid,8)<0 then a=0-a

move object 306+shipid,a


npos#(shipid,0)=object position x(306+shipid)
npos#(shipid,1)=object position y(306+shipid)
npos#(shipid,2)=object position z(306+shipid)
npos#(shipid,3)=object angle x(306+shipid)
npos#(shipid,4)=object angle y(306+shipid)
npos#(shipid,5)=object angle z(306+shipid)
If ndata(shipid,20)>0
ndata(shipid,20)=ndata(shipid,20)-1
EndIf
If ndata(shipid,5)<=0 And object exist(306+shipid)=1
If object visible(306+shipid)=1 And ndata(shipid,0)=1
`test If ship destroyed by cargo canisters Or ship debris
hide object 306+shipid
dc=ndata(shipid,25)/10
If dc>10 then dc=10
place_alloys(dc,306+shipid)
ndata(shipid,0)=0
EndIf
EndIf
`jump in star effect
If ndata(shipid,22)>0
hide object 306+shipid
position object 360+shipid,npos#(shipid,0),npos#(shipid,1),npos#(shipid,2)
rotate object 360+shipid,npos#(shipid,3),npos#(shipid,4),npos#(shipid,5)
show object 360+shipid
ndata(shipid,4)=0
scl=100-(ndata(shipid,22)*5)
ndata(shipid,22)=ndata(shipid,22)-1
scale object 360+shipid,scl,scl,scl
If ndata(shipid,22)<1
hide object 360+shipid
ndata(shipid,4)=2
show object 306+shipid
EndIf
Else
hide object 360+shipid
EndIf
If ndata(shipid,27)=0
`jump out star effect
If ndata(shipid,21)=0
If npos#(shipid,0)>2000 Or npos#(shipid,1)>2000 Or npos#(shipid,2)>2000
If ndata(shipid,20)=0
hide object 306+shipid
position object 360+shipid,npos#(shipid,0),npos#(shipid,1),npos#(shipid,2
)
rotate object 360+shipid,npos#(shipid,3),npos#(shipid,4),npos#(shipid,5)
show object 360+shipid
ndata(shipid,4)=0
ndata(shipid,21)=5
scl=100-(ndata(shipid,21)*5)
scale object 360+shipid,scl,scl,scl
EndIf
EndIf
Else
hide object 306+shipid
position object 360+shipid,npos#(shipid,0),npos#(shipid,1),npos#(shipid,2)
rotate object 360+shipid,npos#(shipid,3),npos#(shipid,4),npos#(shipid,5)
show object 360+shipid
ndata(shipid,4)=0

ndata(shipid,21)=ndata(shipid,21)-1
scl=100-(ndata(shipid,21)*5)
scale object 360+shipid,scl,scl,scl
If ndata(shipid,21)<1
hide object 360+shipid
ndata(shipid,0)=0
EndIf
EndIf
EndIf
EndIf
Else
hide object 306+shipid
hide object 360+shipid
EndIf
ENDFUNCTION
FUNCTION place_new_ship()
If Debug(0)=1 then text 0,0,"DEBUG: Place_new_ship"
`player object (the players ship)
po=304
show object 304
co=0
ok=0
Repeat
`If ship active increment co Else ok=1 (weve found a ship To place!!!)
If ndata(co,0)=1 then co=co+1 Else ok=1
Until co>20 Or ok=1
If ok=1
remstart
***********************************************************
DUE To THERE IS NO COPY OBJECT FUNCTION THIS SEGMENT
WILL HAVE To WAIT... CONVERTING OBJECTS FROM MESHES DOES
Not WORK PROPERLY (NO LIMBS To PUT DIFFERENT TEXTURES ONTO)
And LOADING EACH ONE EVERYTIME A SHIP ENTERS THE AREA ADDS
A HALF A SECOND PAUSE For EACH SHIP.
***********************************************************
a=rnd(7)
If a=0
load object "sfighter.x",306+co
EndIf
If a=1 then load object "mfighter.x",306+co
If a=2 then load object "hfighter.x",306+co
If a=3 then load object "ship.x",306+co
If a=4 then load object "police.x",306+co
If a=5 then load object "ufo.x",306+co
If a=6 then load object "Allhecklf.x",306+co
remend
`cargo objects
nax=rnd(100)
If nax<3
ndata(co,17)=rnd(3)
EndIf
`set up Array so details point To the selected object
ndata(co,18)=306+co
`sets the ships speed
ndata(co,4)=rnd(10)+1
`If ship is faster than player ship can move in behind player!!!
If ndata(co,4)>ndata(playinfo(15),4) then sd=rnd(3) Else sd=rnd(2)
` text 50,200,str$(co)
` text 100,200,str$(po)

` text 50,250,str$(co+306)
` text 100,250,str$(sd)
ndata(co,29)=-1
ndata(co,30)=-1
show object 306+co
a=rnd(1)
If a=0 then dif=rnd(900) Else dif=0-rnd(900)
If a=0 then hr=rnd(50) Else hr=0-rnd(50)
cpx#=camera position x()
cpy#=camera position y()
cpz#=camera position z()
If sd=0
`front on!!!
position object 306+co,cpx#+(object position x(po)+dif),cpy#+(object position
y(po)+hr),object position z(po)
rotate object 306+co,object angle x(po),object angle y(po),object angle z(po)
move object 306+co,999
EndIf
If sd=1
`left side!!!
ls=object angle x(po)-90
If ls<0 then ls=ls+360
position object 306+co,object position x(po),cpy#+(object position y(po)+hr),
cpz#+(object position z(po)+dif)
rotate object 306+co,object angle x(po),ls,object angle z(po)
move object 306+co,999
EndIf
If sd=2
`right side!!!
ls=object angle x(po)+90
If ls>359 then ls=ls-360
position object 306+co,object position x(po),cpy#+(object position y(po)+hr),
cpz#+(object position z(po)+dif)
rotate object 306+co,object angle x(po),ls,object angle z(po)
move object 306+co,999
EndIf
If sd=3
`behind!!!
ls=object angle x(po)-180
If ls<0 then ls=ls+360
position object 306+co,cpx#+(object position x(po)+dif),cpy#+(object position
y(po)+hr),object position z(po)
rotate object 306+co,object angle x(po),ls,object angle z(po)
move object 306+co,999
EndIf
`setup ship details
NShipid$(co,0)=""
NShipid$(co,1)=""
`setup ID
For ida=0 To 2
id$=chr$(rnd(25)+65)
NShipid$(co,0)=NShipid$(co,0)+id$
Next ida
id$="-"
NShipid$(co,0)=NShipid$(co,0)+id$
idn=rnd(65535)
id$=str$(idn)
NShipid$(co,0)=NShipid$(co,0)+id$
If Ndata(co,11)>0

Nshipid$(co,1)="Unknown"
Else
idn=rnd(99)
NShipid$(co,1)=Nshipid$(co,1)+NPCname$(idn,0)
id$=" "
NShipid$(co,1)=NShipid$(co,1)+id$
idn=rnd(99)
id$=NPCname$(idn,1)
NShipid$(co,1)=NShipid$(co,1)+id$
EndIf
ndata(co,0)=1
ndata(co,4)=2
ndata(co,8)=2
ndata(co,21)=0
`see If BIG ships have shields on board
sdc=rnd(100)
If ndata(co,25)>50 And sdc>90
generate=rnd(ndata(co,25)/20)+1
ndata(co,7)=100*generate : `current shield
ndata(co,9)=100*generate : `max shield
Else
ndata(co,7)=0
ndata(co,9)=0
EndIf
ndata(co,20)=rnd(150)+50
ndata(co,11)=rnd(100)
ndata(co,19)=5
ndata(co,27)=0
If ndata(co,11)<5 then ndata(co,11)=(rnd(10)+1)*50 Else ndata(co,11)=0
If ndata(co,11)>0
`If theres a bounty then the pirate will Select a victim
tim=0
Repeat
To=rnd(20)
tim=tim+1
Until ndata(To,0)=1 And To<>co Or tim>50
If tim<50
targ=rnd(100)
If targ<5 then ndata(co,27)=304 Else ndata(co,27)=306+To
`
ndata(co,27)=304
ndata(co,26)=0
`make sure target is actually flying around
If ndata(playinfo(15),23)>0 then ndata(co,27)=0
If object exist(306+To)=0 then ndata(co,27)=0
If object visible(306+To)=0 then ndata(co,27)=0
EndIf
EndIf
npos#(co,0)=object position x(306+co)
npos#(co,1)=object position y(306+co)
npos#(co,2)=object position z(306+co)
npos#(co,3)=object angle x(306+co)
npos#(co,4)=object angle y(306+co)
npos#(co,5)=object angle z(306+co)
in=rnd(1)
dg=rnd(45)
a=npos#(co,3)
a=a+180
If in=0 then a=a+dg Else a=a-dg
If a>359 then a=a-360
npos#(co,4)=a

rotate object 306+co,npos#(co,3),npos#(co,4),npos#(co,5)


If npos#(co,0)>1500 Or npos#(co,1)>1500 Or npos#(co,2)>1500
ndata(co,22)=5
EndIf
EndIf
ENDFUNCTION
FUNCTION setupships()
If Debug(0)=1 then text 0,0,"DEBUG: SetupShips"
For cs=0 To 50
Ndata(cs,0)=0 : `set all ships To inactive
Next cs
ENDFUNCTION
`****************************
`* creates the systems
*
`****************************
`sp = stations present
FUNCTION create_system(sysseed,planseed,nop,nom,sta,astr,noa,op,sysn$)
If Debug(0)=1 then text 0,0,"DEBUG: Create_system"
`owner of sector -1 For nobody
sectorown=0
set ambient light 1
create bitmap 1,640,480
set current bitmap 1
sunname$(0)=sysn$
autocam off
randomize sysseed
sunsize(0)=((rnd(3)+1)*100)*opt(2)
If nop>0 then sp=1
sp=sp+(rnd(9)+1)
pd=(sunsize(0))*opt(2)
`10 space stations
For cs=51 To 61
st=10
load object "models\corilis.x",cs
scale object cs,st,st,st
hide object cs
Next cs
`40 cargo canisters
For cs=62 To 102
cargo(cs-62,0)=0
` load object "cargo.x",cs
` scale object cs,5,5,5
` hide object cs
Next cs
`200 asteroids
at=rnd(2)
For n=0 To 200
asteroidtype(n,0)=at
asteroidtype(n,1)=(5+rnd(20))*opt(2)
asteroidtype(n,2)=(5+rnd(20))*opt(2)
asteroidtype(n,3)=(5+rnd(20))*opt(2)
zr=0
zr=zr+rnd(20)
zr=zr-rnd(20)
asteroidtype(n,4)=zr
Next n
`ship.x (other ship)
`ufo.x (Phargoyde ship)

If ndata(playinfo(15),24)=3200 then load object "models\cobra.x",304


If ndata(playinfo(15),24)=3201 then load object "models\doohickey.x",304
If ndata(playinfo(15),24)<3200
If object exist(304)=1 then delete object 304
st$="models\"
st$=st$+shipmodel$(ndata(playinfo(15),24))
load object st$,304
If object exist(304)=0 then End
EndIf
`scaled so it doesnt cause display problems
scale object 304,5,5,5
For cs=1 To 51
If cs<>22
st=rnd(raceinfo(sectorown,3))
selship=sectorown*50
If st>0 then st=st-1
selship=selship+st
st$="models\"
st$=st$+shipmodel$(selship)
load object st$,305+cs
` set current bitmap 0
` cls 0
` text 0,0,st$
If object exist(305+cs)=0 then End
ndata(cs-1,25)=shipdata(selship,8)
ndata(cs-1,5)=shipdata(selship,8)
ndata(cs-1,24)=selship
ndata(cs-1,8)=shipdata(selship,11)
ndata(cs-1,31)=shipdata(selship,7)
ndata(cs-1,32)=0
ndata(cs-1,19)=shipdata(selship,12)
load object "models\jumpstar.x",359+cs
hide object 359+cs
texture object 359+cs,2001 : `bright white blob
scale object 305+cs,20,20,20
hide object 305+cs
EndIf
Next cs
`make sun
make object plain 50,sunsize(0)*8,sunsize(0)*8
set object 50,1,0,0,1,0,0,0
texture object 50,1011
ghost object on 50
randomize planseed
set current bitmap 0
ink RGB(255,0,0),0
If op=0 then center text 320,280,"Getting Planet Telemetry"
If op=1 then center text 320,280,"Calibrating FTL Drive"
sync
set current bitmap 1
`***************** planet creation follows here ****************************
If nop>0
For n=1 To nop+1
rs#(n)=0.1*(rnd(20)+1)
cr(n)=rnd(360)
rg(n)=pd
create_surface(n,n+2,op)
Repeat
pd=pd+rnd(5)+5
pd=pd*(opt(2)/2)

Until pd<astr-10 Or pd>astr+10


make object sphere n,(psize(n))*opt(2)
texture object n,n+2
fade object n,1
pname$(n)=""
fst=rnd(100)
If fst<25
fst=rnd(8)
pname$(n)=Pfirst$(fst)
fr=1
EndIf
If fr=1
bz$=" "
pname$(n)=pname$(n)+bz$
EndIf
fst=rnd(159)
bz$=Pmiddle$(fst)
If bz$<>""
pname$(n)=pname$(n)+bz$
bz$=" "
pname$(n)=pname$(n)+bz$
EndIf
fst=rnd(100)
If fr=0 then fst=0
If fst<50
fst=rnd(37)
bz$=Plast$(fst)
pname$(n)=pname$(n)+bz$
EndIf
Next n
EndIf
`********************* End planet creation *********************************
set current bitmap 0
ink RGB(255,0,0),0
If op=0 then center text 320,300,"Scanning for Debris"
If op=1 then center text 320,300,"Scanning for obstructions"
sync
set current bitmap 1
`********************** Make space debree **********************************
For t=800 To 900
make object plain t,1,1
fade object t,1
position object t,rnd(1000)-500,rnd(1000)-500,rnd(1000)-500
rotate object t,rnd(359),rnd(359),rnd(359)
Next t
`***************************************************************************
set current bitmap 0
ink RGB(255,0,0),0
If op=0 then center text 320,320,"Getting Moon Telemetry"
If op=1 then center text 320,320,"Plotting course"
sync
set current bitmap 1
`****************** moon creation follows here *****************************
If nom>0
For n=1 To nom
a=0
ms(n)=rnd(1)+1
mr#(n)=rnd(360)
mplanet(n)=rnd(nop-1)+1
create_surface(n,n+22,op)

pd=psize(mplanet(n))+(msize(n)+20)
If n>0
a=checkmoon(mplanet(n),n)
pd=pd+a
pd=pd*opt(2)
EndIf
mg(n)=pd
make object sphere n+22,(msize(n))*opt(2)
fade object n+22,1
texture object n+22,n+22
Next n
EndIf
`********************* End planet creation *********************************
set current bitmap 0
ink RGB(255,0,0),0
If op=0 then center text 320,340,"Scanning for Stations"
If op=1 then center text 320,340,"Recalibrating FTL Sequence"
sync
set current bitmap 1
`************************* put station in game *****************************
If nop>0
For n=0 To sta
splanet(n)=rnd(nop-1)+1
ss(n)=rnd(1)
sa(n)=rnd(65535)
sg(n)=(psize(splanet(n)))*opt(2)
sseed(n)=rnd(65535)
Next n
EndIf
`************************ End station placement ****************************
set current bitmap 0
ink RGB(255,0,0),0
If op=0 then center text 320,360,"Scanning for Asteroids"
If op=1 then center text 320,360,"Calibrations complete"
sync
set current bitmap 1
`************************* ASTEROID PLACEMENT ******************************
If noa>0
For n=0 To noa
aa(n)=rnd(65535)
ag(n)=rnd(100)+astr
ag(n)=rnd(100)-astr
As(n)=rnd(1)+1
ax(n)=rnd(2)
ay(n)=rnd(2)
az(n)=rnd(2)
mrx#=0+Sin((2*aa(planet))*3.1415923/360)*ag(planet)
mry#=0+Cos((2*aa(planet))*3.1415923/360)*ag(planet)
lax#(n)=mrx#
laz#(n)=mry#
lay#(n)=asteroidtype(n,4)
ata(n)=1
Next n
EndIf
`********************* End OF ASTEROID PLACEMENT ***************************
set current bitmap 0
ink RGB(255,0,0),0
If op=0 then center text 320,380,"Scan Complete"
If op=1 then center text 320,380,"Initiating jump"
sync

set current bitmap 1


delete bitmap 1
rem Space texture To create all those loverly nebulas
create bitmap 2,256,256
ink RGB(55,55,205),RGB(0,0,0) : cls
nx=rnd(256)
ny=rnd(256)
t=rnd(500)+1000
Repeat
nx=nx+rnd(1)
ny=ny+rnd(1)
nx=nx-rnd(1)
ny=ny-rnd(1)
If nx<0 then nx=256
If nx>256 then nx=0
If ny<20 then ny=235
If ny>235 then ny=20
dot nx,ny
t=t-1
Until t<0
nebc=rnd(20)+5
For nc=0 To nebc
ink RGB(rnd(255),rnd(255),rnd(255)),RGB(0,0,0)
nx=rnd(256)
ny=rnd(256)
t=rnd(1000)+1000
Repeat
nx=nx+rnd(1)
ny=ny+rnd(1)
nx=nx-rnd(1)
ny=ny-rnd(1)
If nx<0 then nx=256
If nx>256 then nx=0
If ny<20 then ny=235
If ny>235 then ny=20
dot nx,ny
t=t-1
Until t<0
Next nc
blur bitmap 2,3
get image 6002,0,0,256,256
delete bitmap 2
randomize timer()
If op=1
`**** ending starfield effect goes here
starfield()
If sound exist(1021) then delete sound 1021
load sound "sounds\Hyper2.wav",1021
play sound 1021
EndIf
cls
ENDFUNCTION
FUNCTION reset_system()
If Debug(0)=1 then text 0,0,"DEBUG: Reset_System"
For n=1 To 65500
a=object exist(n)
If a=1 And n<>6002 And n<>6103 then delete object n
Next n
For n=0 To 50

ndata(n,0)=0
Next n
For a=0 To 50
debris(a,0)=0
Next a
For a=0 To 1000
shot(a,2)=0
Next a
For a=0 To 50
cargo(a,0)=0
missle(a,1)=-1
Next a
set current bitmap 0
For n=2 To 10
If bitmap exist(n)=1 then delete bitmap n
Next n
ENDFUNCTION
FUNCTION Title_bar(title$)
If Debug(0)=1 then text 0,0,"DEBUG: Title_Bar"
ink RGB(255,255,255),0
paste image 1000,20,10
center text 320,110,"Copyright 2000 EdzUp"
center text 320,125,"written in DarkBasic by Ed Upton"
center text 320,140,"comments or suggestions to sf2000@edzup.co.uk"
ink RGB(255,0,0),0
box 220,169,420,188
ink RGB(255,255,255),0
center text 320,170,title$
ENDFUNCTION
FUNCTION select_race()
If Debug(0)=1 then text 0,0,"DEBUG: Select_Race"
If playinfo(35)<3200
ok2=-1
ok=-1
While ok2<>1
Repeat
ok=-1
cls 0
Title_bar("Select your race")
bob 1,1000,1000,1005
cp=198
For n=0 To 9
ink RGB(50,50,50),0
box 0,cp,639,cp+19
ink RGB(255,255,255),0
center text 320,cp+2,racedesc$(n,0)
cp=cp+21
Next n
ink RGB(255,255,255),0
bob 1,MouseX(),MouseY(),2000
sync
mx=MouseX()
my=MouseY()
If mouseclick()=1
mp=0
sp=198
Repeat
If my<sp Or my>sp+19

mp=mp+1
sp=sp+21
EndIf
Until mp>9 Or my>sp And my<sp+19
If mp<10 then ok=mp
EndIf
Until ok<>-1
Repeat
cls 0
Title_bar(racedesc$(ok,0))
ok2=-1
center text 320,200,racedesc$(ok,1)
center text 320,216,racedesc$(ok,2)
center text 320,232,racedesc$(ok,3)
center text 320,248,racedesc$(ok,4)
center text 320,264,racedesc$(ok,5)
mx=MouseX()
my=MouseY()
If (mx>219 And mx<421 And my>412 And my<434)
ink RGB(100,100,100),0
box 220,411,420,433
ink RGB(255,255,255),0
center text 320,415,"Pick Race"
If mouseclick()=1 then ok2=1
Else
ink RGB(0,0,0),0
box 220,411,420,433
ink RGB(255,255,255),0
center text 320,415,"Pick Race"
EndIf
If (mx>219 And mx<421 And my>436 And my<458)
ink RGB(100,100,100),0
box 220,435,420,457
ink RGB(255,255,255),0
center text 320,439,"Cancel"
If mouseclick()=1 then ok2=2
Else
ink RGB(0,0,0),0
box 220,435,420,457
ink RGB(255,255,255),0
center text 320,439,"Cancel"
EndIf
bob 1,MouseX(),MouseY(),2000
sync
Until ok2<>-1
endwhile
EndIf
If playinfo(35)<3200
ndata(playinfo(15),10)=ok
playinfo(35)=(ok*50)+raceinfo(ok,8)
ndata(playinfo(15),24)=playinfo(35)
playinfo(3)=raceinfo(ok,0)
playinfo(4)=raceinfo(ok,1)
ndata(playinfo(15),8)=shipdata(playinfo(35),11)
Else
ndata(playinfo(15),10)=0
playinfo(3)=0
playinfo(4)=0
ndata(playinfo(15),8)=20

EndIf
ENDFUNCTION
FUNCTION Get_playername()
If Debug(0)=1 then text 0,0,"DEBUG: Get_PlayerName"
cls 0
Title_bar("Enter your name")
bob 1,1000,1000,1005
playinfo(35)=0
nm$=""
kt=0
Repeat
Repeat
kt=kt-1
If scancode()<>0 And kt<=0 then k=scancode() Else k=0
ink RGB(50,50,50),0
box 0,220,639,270
ink RGB(255,255,255),0
center text 320,240,nm$
sync
If k=kdown
Repeat
Until keystate(kdown)=0
k=0
EndIf
key$=""
If k=41 then key$="~"
If k>1 And k<11 then key$=str$(k-1)
If k=11 then key$="0"
If k=12 then key$="-"
If k=13 then key$="="
If k=16 then key$="Q"
If k=17 then key$="W"
If k=18 then key$="E"
If k=19 then key$="R"
If k=20 then key$="T"
If k=21 then key$="Y"
If k=22 then key$="U"
If k=23 then key$="I"
If k=24 then key$="O"
If k=25 then key$="P"
If k=26 then key$="["
If k=27 then key$="]"
If k=30 then key$="A"
If k=31 then key$="S"
If k=32 then key$="D"
If k=33 then key$="F"
If k=34 then key$="G"
If k=35 then key$="H"
If k=36 then key$="J"
If k=37 then key$="K"
If k=38 then key$="L"
If k=39 then key$=";"
If k=40 then key$="@"
If k=43 then key$="#"
If k=86 then key$="\"
If k=44 then key$="Z"
If k=45 then key$="X"
If k=46 then key$="C"
If k=47 then key$="V"

If k=48 then key$="B"


If k=49 then key$="N"
If k=50 then key$="M"
If k=51 then key$=","
If k=52 then key$="."
If k=53 then key$="/"
If k=57 then key$=" "
If k<>14
nm$=nm$+key$
kdown=0
If key$<>"" then kdown=k
Else
ns$=""
For nc=0 To Len(nm$)-1
cc$=mid$(nm$,nc)
ns$=ns$+cc$
Next nc
nm$=ns$
wait 50
EndIf
Until scancode()=28
ok=0
If upper$(nm$)="SLARTIBARDFAST"
ink RGB(0,0,0),0
box 0,340,639,420
ink RGB(255,255,255),0
center text 320,350,"Welcome back Universal Hero"
center text 320,380,"A Bonus for saving the Universe last time."
ok=1
playinfo(33)=2000000000
nm$=""
EndIf
If upper$(nm$)="ARCH ANGEL JAMESON"
ink RGB(0,0,0),0
box 0,340,639,420
ink RGB(255,255,255),0
center text 320,350,"Welcome back Commander Jameson"
center text 320,380,"We have kept her just as you wanted!!!"
ok=1
playinfo(35)=3200
ndata(playinfo(15),24)=3200
nm$=""
EndIf
If upper$(nm$)="LOONEY JETMAN"
ink RGB(0,0,0),0
box 0,340,639,420
ink RGB(255,255,255),0
center text 320,350,"BANG, CRUNCH... Where am I?!?!?"
center text 320,380,"(Just look out for commanders with swollen toes!!!)"
ok=1
playinfo(35)=3201
ndata(playinfo(15),24)=3201
nm$=""
EndIf
Until ok=0 And nm$<>""
playername$(0)=nm$
If playinfo(35)<>3200 And playinfo(15)<>3201 then select_race()
ENDFUNCTION
FUNCTION Options()

If Debug(0)=1 then text 0,0,"DEBUG: Options"


position mouse 320,260
crge=opt(0)
mst=opt(1)
Repeat
cls 0
ok=0
Title_bar("Options")
ink RGB(255,255,255),0
set cursor 10,200
print "Visual range (the higher the value the further you can see)"
set cursor 10,260
print "Maximum Asteroids (fewer asteroids the speeds up performance)"
set cursor 0,222
print "Short"
set cursor 0,282
print "Less"
set cursor 585,222
print "Long"
set cursor 585,282
print "More"
ink RGB(255,0,0),0
box 50,220,570,240
box 50,280,570,300
ink RGB(0,255,0),0
box 50,220,50+((crge-2000)/15.3846),240
box 50,280,50+((mst-10)/0.3653846),300
ink RGB(255,255,255),0
center text 320,222,str$(crge)
center text 320,282,str$(mst)
mx=MouseX()
my=MouseY()
If (mx>49 And mx<572 And my>219 And my<241 And mouseclick()=1)
cp=2000+((MouseX()-50)*15.3846)
If cp<2000 then cp=2000
If cp>10000 then cp=10000
crge=cp
ink RGB(rnd(255),rnd(255),rnd(255)),0
EndIf
If (mx>49 And mx<572 And my>279 And my<301 And mouseclick()=1)
cp=10+((MouseX()-50)*0.3653846)
If cp<10 then cp=10
If cp>200 then cp=200
mst=cp
ink RGB(rnd(255),rnd(255),rnd(255)),0
EndIf
If (mx>219 And mx<421 And my>387 And my<409)
ink RGB(100,100,100),0
box 220,388,420,408
ink RGB(255,255,255),0
center text 320,390,"Ok"
If mouseclick()=1 then ok=1
Else
ink RGB(0,0,0),0
box 220,388,420,408
ink RGB(255,255,255),0
center text 320,390,"Ok"
EndIf
sync
bob 1,MouseX(),MouseY(),2000

Until ok=1
opt(0)=crge
opt(1)=mst
set camera range 1,(crge)*opt(2)
fog distance (crge*opt(2))-100
Title_sequence()
ENDFUNCTION
FUNCTION Credits()
If Debug(0)=1 then text 0,0,"DEBUG: Credits"
Dim cred$(100)
For ax=0 To 100
cred$(ax)=""
Next ax
cred$(18)="Star Flight 2000"
cred$(19)="Copyright 2000 EdzUp"
cred$(22)="Written by"
cred$(23)="Ed Upton"
cred$(24)="Mark Markinson"
cred$(26)="Ideas by"
cred$(27)="Ed Upton"
cred$(28)="Rue Upton"
cred$(29)="Antony Wells"
cred$(30)="Mark Markinson"
cred$(33)="Thanks to"
cred$(34)="Lee Bamber (for Dark Basic)"
cred$(35)="Arjen Schumacher and Arno Verheij for the sun texture"
cred$(36)="Richard Markinson for additional models"
cred$(37)="Lawrence Grant from the band 'Pyramid' for music and stuff"
cred$(38)="Everyone at the Dark Basic Forum who's support is welcomed"
cred$(39)="Thanks to http://www.wallisnet.demon.co.uk/elite/ for the Elite Mode
ls"
cred$(40)="Original Elite Copyright 1984 Ian Bell and David Braben"
create bitmap 2,640,480
cl=0
sp=190
vil=0
`ut is the update timer!!!
ut=0
Repeat
cls 0
ok=0
set current bitmap 0
Title_bar("Credits")
set current bitmap 2
cp=sp
cls 0
For axl=cl To cl+17
center text 320,cp,cred$(axl)
cp=cp+16
Next axl
ut=0
If ut<=0
sp=sp-2
If sp<=174
cl=cl+1
sp=190
EndIf
If cl>48 then cl=0
ut=5

EndIf
If ut>0 then ut=ut-1
get image 1754,0,190,639,387
set current bitmap 0
paste image 1754,0,190
mx=MouseX()
my=MouseY()
If (mx>219 And mx<421 And my>387 And my<409)
ink RGB(100,100,100),0
box 220,388,420,408
ink RGB(255,255,255),0
center text 320,390,"Ok"
If mouseclick()=1 then ok=1
Else
ink RGB(0,0,0),0
box 220,388,420,408
ink RGB(255,255,255),0
center text 320,390,"Ok"
EndIf
sync
bob 1,MouseX(),MouseY(),2000
sync
Until ok=1
delete image 1754
delete bitmap 2
undim cred$(100)
Title_sequence()
ENDFUNCTION
FUNCTION getkey()
If Debug(0)=1 then text 0,0,"DEBUG: getkey"
Repeat
ok=0
ky=scancode()
If ky<>0
`NO F KEYS these are reserved For Star Flight 2000
If ky>57 And ky<69 then ok=-1 Else ok=1
If ky=183 then ok=-1
If ky=70 then ok=-1
If ky=197 then ok=-1
If ky=69 then ok=-1
EndIf
Until ok=1
ENDFUNCTION ky
FUNCTION showkey(x,y,k)
If Debug(0)=1 then text 0,0,"DEBUG: showkey"
key$="Undefined"
If k=41 then key$="~"
If k>1 And k<11 then key$=str$(k-1)
If k=11 then key$="0"
If k=12 then key$="-"
If k=13 then key$="="
If k=14 then key$="BackSpace"
If k=15 then key$="Tab"
If k=16 then key$="Q"
If k=17 then key$="W"
If k=18 then key$="E"
If k=19 then key$="R"
If k=20 then key$="T"

If
If
If
If
If
If
If
If
If
If
If
If
If
If
If
If
If
If
If
If
If
If
If
If
If
If
If
If
If
If
If
If
If
If
If
If
If
If
If
If
If
If
If
If
If
If
If
If
If
If
If
If
If
If
If
If
If
If
If
If

k=21 then key$="Y"


k=22 then key$="U"
k=23 then key$="I"
k=24 then key$="O"
k=25 then key$="P"
k=26 then key$="["
k=27 then key$="]"
k=28 then key$="Enter"
k=30 then key$="A"
k=31 then key$="S"
k=32 then key$="D"
k=33 then key$="F"
k=34 then key$="G"
k=35 then key$="H"
k=36 then key$="J"
k=37 then key$="K"
k=38 then key$="L"
k=39 then key$=";"
k=40 then key$="@"
k=43 then key$="#"
k=42 then key$="Left Shift"
k=86 then key$="\"
k=44 then key$="Z"
k=45 then key$="X"
k=46 then key$="C"
k=47 then key$="V"
k=48 then key$="B"
k=49 then key$="N"
k=50 then key$="M"
k=51 then key$=","
k=52 then key$="."
k=53 then key$="/"
k=54 then key$="Right Shift"
k=29 then key$="Left Ctrl"
k=219 then key$="Left W95 Key"
k=56 then key$="Left Alt"
k=57 then key$="Space"
k=184 then key$="Alt Gr"
k=220 then key$="Right W95 Key"
k=221 then key$="W95 Menu Key"
k=157 then key$="Right Ctrl"
k=199 then key$="Home"
k=201 then key$="PgUp"
k=207 then key$="End"
k=209 then key$="PgDn"
k=211 then key$="Delete"
k=210 then key$="Insert"
k=200 then key$="Cursor Up"
k=208 then key$="Cursor Down"
k=203 then key$="Cursor Left"
k=205 then key$="Cursor Right"
k=181 then key$="Numpad /"
k=55 then key$="Numpad *"
k=74 then key$="Numpad -"
k=78 then key$="Numpad +"
k=156 then key$="Numpad Enter"
k=71 then key$="Numpad 7"
k=72 then key$="Numpad 8"
k=73 then key$="Numpad 9"
k=75 then key$="Numpad 4"

If k=76 then key$="Numpad


If k=77 then key$="Numpad
If k=79 then key$="Numpad
If k=80 then key$="Numpad
If k=81 then key$="Numpad
If k=82 then key$="Numpad
If k=83 then key$="Numpad
text x,y,key$
ENDFUNCTION

5"
6"
1"
2"
3"
0"
."

FUNCTION Redefine(op)
If Debug(0)=1 then text 0,0,"DEBUG: redefine"
If op=0
`load controls
If file exist("data\SF2000.Config")=0
keys(0)=72
keys(1)=80
keys(2)=75
keys(3)=77
keys(4)=30
keys(5)=44
keys(6)=57
keys(7)=46
keys(8)=23
keys(9)=36
keys(10)=76
keys(11)=50
keys(12)=18
keys(13)=15
keys(14)=25
keys(15)=35
music$(1)="sound\Adblue.mid"
control(0)=0
control(1)=0
Else
open To Read 1,"data\SF2000.Config"
For ckc=0 To 15
Read word 1,keys(ckc)
Next ckc
Read string 1,st$
Read string 1,music$(1)
Read string 1,a$
control(0)=Val(a$)
Read string 1,a$
control(1)=Val(a$)
close file 1
EndIf
EndIf
If op=1
Dim oldkeys(15)
For ckc=0 To 15
oldkeys(ckc)=keys(ckc)
Next ckc
Repeat
cls 0
ok=0
Title_bar("Redefine Controls")
ink RGB(255,255,255),0
text 10,200,"Up"
showkey(150,200,keys(0))

text 10,220,"Down"
showkey(150,220,keys(1))
text 10,240,"Left"
showkey(150,240,keys(2))
text 10,260,"Right"
showkey(150,260,keys(3))
text 10,280,"Accelerate"
showkey(150,280,keys(4))
text 10,300,"Decelerate"
showkey(150,300,keys(5))
text 10,320,"Stop Dead"
showkey(150,320,keys(10))
text 10,340,"Fire"
showkey(150,340,keys(6))
text 350,200,"Fire Missle"
showkey(490,200,keys(11))
text 350,220,"Communications"
showkey(490,220,keys(7))
text 350,240,"Identify"
showkey(490,240,keys(8))
text 350,260,"Jump drive"
showkey(490,260,keys(9))
text 350,280,"FTL Jump"
showkey(490,280,keys(15))
text 350,300,"Eject"
showkey(490,300,keys(12))
text 350,320,"Shockwave device"
showkey(490,320,keys(13))
text 350,340,"Pause"
showkey(490,340,keys(14))
center text 320,370,"Click on the control you wish to redefine"
mx=MouseX()
my=MouseY()
If mouseclick()=1
bob 1,1000,1000,2000
sync
If mx>10 And mx<310 And my>199 And my<218 then keys(0)=getkey()
If mx>10 And mx<310 And my>219 And my<238 then keys(1)=getkey()
If mx>10 And mx<310 And my>239 And my<258 then keys(2)=getkey()
If mx>10 And mx<310 And my>259 And my<278 then keys(3)=getkey()
If mx>10 And mx<310 And my>279 And my<298 then keys(4)=getkey()
If mx>10 And mx<310 And my>299 And my<318 then keys(5)=getkey()
If mx>10 And mx<310 And my>319 And my<338 then keys(10)=getkey()
If mx>10 And mx<310 And my>339 And my<358 then keys(6)=getkey()
If mx>350 And mx<630 And my>199
If mx>350 And mx<630 And my>219
If mx>350 And mx<630 And my>239
If mx>350 And mx<630 And my>259
If mx>350 And mx<630 And my>279
If mx>350 And mx<630 And my>299
If mx>350 And mx<630 And my>319
If mx>350 And mx<630 And my>339
EndIf
If (mx>219 And mx<421 And my>387
ink RGB(100,100,100),0
box 220,388,420,408
ink RGB(255,255,255),0
center text 320,390,"Cancel"
If mouseclick()=1 then ok=1

And
And
And
And
And
And
And
And

my<218
my<238
my<258
my<278
my<298
my<318
my<338
my<358

And my<409)

then
then
then
then
then
then
then
then

keys(11)=getkey()
keys(7)=getkey()
keys(8)=getkey()
keys(9)=getkey()
keys(15)=getkey()
keys(12)=getkey()
keys(13)=getkey()
keys(14)=getkey()

Else
ink RGB(0,0,0),0
box 220,388,420,408
ink RGB(255,255,255),0
center text 320,390,"Cancel"
EndIf
If (mx>219 And mx<421 And my>417 And my<439)
ink RGB(100,100,100),0
box 220,418,420,438
ink RGB(255,255,255),0
center text 320,420,"Ok"
If mouseclick()=1 then ok=2
Else
ink RGB(0,0,0),0
box 220,418,420,438
ink RGB(255,255,255),0
center text 320,420,"Ok"
EndIf
sync
bob 1,MouseX(),MouseY(),2000
Until ok>0
EndIf
If op=2 Or ok=2
If ok<>1 Or op=2
`save controls code here
If file exist("data\SF2000.Config")=1 then delete file "data\SF2000.Config"
open To write 1,"data\SF2000.Config"
For ckc=0 To 15
write word 1,keys(ckc)
Next ckc
st$=""
write string 1,st$
write string 1,music$(1)
write string 1,str$(control(0))
write string 1,str$(control(1))
close file 1
Else
For ckc=0 To 15
keys(ckc)=oldkeys(ckc)
Next ckc
EndIf
undim oldkeys(15)
If op<>2 then Controls()
EndIf
ENDFUNCTION
FUNCTION Devices()
If Debug(0)=1 then text 0,0,"DEBUG: devices"
mst=control(1)
Repeat
cls 0
ok=0
Title_bar("Control Devices")
If control(0)=0 then Button(290,197,315,219,1)
text 223,200,"Keyboard"
If control(0)=1 then Button(325,197,350,219,1)
text 355,200,"Mouse"
If control(0)=2 then Button(290,237,315,259,1)
text 168,240,"Analogue Joystick"
If control(0)=3 then Button(325,237,350,259,1)

Else Button(290,197,315,219,0)
Else Button(325,197,350,219,0)
Else Button(290,237,315,259,0)
Else Button(325,237,350,259,0)

text 355,240,"Digital Joystick"


center text 320,280,"Sensitivity"
ink RGB(255,0,0),0
box 50,300,570,320
ink RGB(50,255,50),0
box 50,300,50+((mst)*26),320
ink RGB(255,255,255),0
center text 320,304,str$(mst)
mx=MouseX()
my=MouseY()
If mouseclick()=1
If mx>290 And my>197 And mx<315 And my<219 then control(0)=0
If mx>325 And my>197 And mx<350 And my<219 then control(0)=1
If mx>290 And my>237 And mx<315 And my<259 then control(0)=2
If mx>325 And my>237 And mx<350 And my<259 then control(0)=3
EndIf
If (mx>49 And mx<572 And my>299 And my<321 And mouseclick()=1)
cp=((MouseX()-50)/26)
If cp<0 then cp=0
If cp>20 then cp=20
mst=cp
ink RGB(rnd(255),rnd(255),rnd(255)),0
EndIf
If (mx>219 And mx<421 And my>387 And my<409)
ink RGB(100,100,100),0
box 220,388,420,408
ink RGB(255,255,255),0
center text 320,390,"Ok"
If mouseclick()=1 then ok=1
Else
ink RGB(0,0,0),0
box 220,388,420,408
ink RGB(255,255,255),0
center text 320,390,"Ok"
EndIf
sync
bob 1,MouseX(),MouseY(),2000
Until ok<>0
control(1)=mst
Controls()
ENDFUNCTION
FUNCTION Controls()
If Debug(0)=1 then text 0,0,"DEBUG: Controls"
wait 25
Repeat
cls 0
ok=0
Title_bar("Controls")
ink RGB(255,255,255),0
text 10,200,"Up"
showkey(150,200,keys(0))
text 10,220,"Down"
showkey(150,220,keys(1))
text 10,240,"Left"
showkey(150,240,keys(2))
text 10,260,"Right"
showkey(150,260,keys(3))
text 10,280,"Accelerate"
showkey(150,280,keys(4))

text 10,300,"Decelerate"
showkey(150,300,keys(5))
text 10,320,"Stop Dead"
showkey(150,320,keys(10))
text 10,340,"Fire"
showkey(150,340,keys(6))
text 350,200,"Fire Missle"
showkey(490,200,keys(11))
text 350,220,"Communications"
showkey(490,220,keys(7))
text 350,240,"Identify"
showkey(490,240,keys(8))
text 350,260,"Jump drive"
showkey(490,260,keys(9))
text 350,280,"FTL Jump"
showkey(490,280,keys(15))
text 350,300,"Eject"
showkey(490,300,keys(12))
text 350,320,"Shockwave device"
showkey(490,320,keys(13))
text 350,340,"Pause"
showkey(490,340,keys(14))
center text 320,370,"Alt+Q to quit game"
mx=MouseX()
my=MouseY()
If (mx>9 And mx<211 And my>387 And my<409)
ink RGB(100,100,100),0
box 9,388,211,408
ink RGB(255,255,255),0
center text 114,390,"Control Devices"
If mouseclick()=1 then ok=3
Else
ink RGB(0,0,0),0
box 9,388,211,408
ink RGB(255,255,255),0
center text 114,390,"Control Devices"
EndIf
If (mx>429 And mx<631 And my>387 And my<409)
ink RGB(100,100,100),0
box 430,388,630,408
ink RGB(255,255,255),0
center text 530,390,"Redefine"
If mouseclick()=1 then ok=2
Else
ink RGB(0,0,0),0
box 430,388,630,408
ink RGB(255,255,255),0
center text 530,390,"Redefine"
EndIf
If (mx>219 And mx<421 And my>387 And my<409)
ink RGB(100,100,100),0
box 220,388,420,408
ink RGB(255,255,255),0
center text 320,390,"Ok"
If mouseclick()=1 then ok=1
Else
ink RGB(0,0,0),0
box 220,388,420,408
ink RGB(255,255,255),0
center text 320,390,"Ok"

EndIf
sync
bob 1,MouseX(),MouseY(),2000
Until ok>0
If ok=2 then Redefine(1)
If ok=3 then devices()
If ok=1
Redefine(2)
Title_sequence()
EndIf
ENDFUNCTION
`*********************************************************************
`LOAD CODE GOES IN THIS FUNCTION
`*********************************************************************
FUNCTION Loadsavegame(gn)
If Debug(0)=1 then text 0,0,"DEBUG: LoadSaveGame"
set cursor 10,10
f$="data\"
f$=f$+str$(gn)
f$=f$+".CDR"
If file exist(f$)=1
open To Read 1,f$
Read string 1,filename$
Read string 1,playername$(0)
For ca=0 To 35
Read string 1,a$
playinfo(ca)=Val(a$)
Next ca
For ca=0 To 11
Read string 1,a$
record(ca)=Val(a$)
Next ca
For ca=0 To 44
Read string 1,a$
playcargo(ca)=Val(a$)
Next ca
For ca=0 To 44
Read string 1,a$
playprice(ca)=Val(a$)
Next ca
For n=0 To 30
For ca=0 To 3
Read string 1,playmname$(n,ca)
Read string 1,a$
playminfo(n,ca)=Val(a$)
Next ca
Next n
For n=0 To 100
Read string 1,playcrew$(n)
Read string 1,a$
playpay(n)=Val(a$)
Next n
For n=0 To 30
Read string 1,a$
shipbitz(n)=Val(a$)
Next n
For n=0 To 6
For a=0 To 13
Read string 1,a$

BBSsectordata(n,a)=Val(a$)
Next a
Next n
For n=0 To 6
Read string 1,BBSname$(n)
Read string 1,BBSsd$(n)
Next n
For n=0 To 30
Read string 1,a$
BBSShips(n)=Val(a$)
Next n
For n=0 To 50
For a=0 To 32
Read string 1,a$
ndata(n,a)=Val(a$)
Next a
Next n
For n=0 To 50
For a=0 To 6
Read float 1,npos#(n,a)
If a>2 then npos#(n,a)=wrapvalue(npos#(n,a))
Next a
Next n
For n=0 To 50
For a=0 To 1
Read string 1,nshipid$(n,a)
Next a
Next n
For n=0 To 20
For a=0 To 3
Read string 1,BBS$(n,a)
Read string 1,a$
BBSinfo(n,a)=Val(a$)
Read string 1,BBSname$(n,a)
Next a
Next n
For n=0 To 28
Read string 1,a$
BBSBuy(n)=Val(a$)
Read string 1,a$
BBSSell(n)=Val(a$)
Read string 1,a$
BBSQty(n)=Val(a$)
Next n
For n=0 To 31
Read string 1,msg$(n)
Next n
For n=0 To 35
For a=0 To 13
Read string 1,a$
mesinfo(n,a)=Val(a$)
Next a
Read string 1,mesinfoname$(n)
Next n
For n=0 To 5
Read string 1,a$
sysinfo(n)=Val(a$)
Next n
For n=0 To 6
For a=0 To 12

Read string 1,a$


sectordata(n,a)=Val(a$)
Next a
Read string 1,sname$(n)
Read string 1,sd$(n)
Next n
close file 1
EndIf
loadr(0)=1
autocam off
sync on
bob 1,1000,1000,2000
bob 65500,1000,1000,1005
cls 0
Loading_screen()
ENDFUNCTION
FUNCTION Savesavegame(gn)
If Debug(0)=1 then text 0,0,"DEBUG: SaveSaveGame"
d$=get date$()
t$=get time$()
f$=d$
f$=f$+" "
f$=f$+t$
filename$="data\"
filename$=filename$+str$(gn)
filename$=filename$+".CDR"
If file exist(filename$)=1
`this averts the file already exist error!!!
delete file filename$
EndIf
open To write 1,filename$
write string 1,f$
write string 1,playername$(0)
For ca=0 To 35
write string 1,str$(playinfo(ca))
Next ca
For ca=0 To 11
write string 1,str$(record(ca))
Next ca
For ca=0 To 44
write string 1,str$(playcargo(ca))
Next ca
For ca=0 To 44
write string 1,str$(playprice(ca))
Next ca
For n=0 To 30
For ca=0 To 3
write string 1,playmname$(n,ca)
write string 1,str$(playminfo(n,ca))
Next ca
Next n
For n=0 To 100
write string 1,playcrew$(n)
write string 1,str$(playpay(n))
Next n
For n=0 To 30
write string 1,str$(shipbitz(n))
Next n
For n=0 To 6

For a=0 To 12
write string 1,str$(BBSsectordata(n,a))
Next a
Next n
For n=0 To 6
write string 1,BBSname$(n)
write string 1,BBSsd$(n)
Next n
For n=0 To 30
write string 1,str$(BBSShips(n))
Next n
For n=0 To 50
For a=0 To 32
write string 1,str$(ndata(n,a))
Next a
Next n
For n=0 To 50
For a=0 To 6
write float 1,npos#(n,a)
Next a
Next n
For n=0 To 50
For a=0 To 1
write string 1,nshipid$(n,a)
Next a
Next n
For n=0 To 20
For a=0 To 3
write string 1,BBS$(n,a)
write string 1,str$(BBSinfo(n,a))
write string 1,BBSname$(n,a)
Next a
Next n
For n=0 To 28
write string 1,str$(BBSBuy(n))
write string 1,str$(BBSSell(n))
write string 1,str$(BBSQty(n))
Next n
For n=0 To 31
write string 1,msg$(n)
Next n
For n=0 To 35
For a=0 To 13
write string 1,str$(mesinfo(n,a))
Next a
write string 1,mesinfoname$(n)
Next n
For n=0 To 5
write string 1,str$(sysinfo(n))
Next n
For n=0 To 6
For a=0 To 13
write string 1,str$(sectordata(n,a))
Next a
write string 1,sname$(n)
write string 1,sd$(n)
Next n
close file 1
ENDFUNCTION

FUNCTION Loadsavemenu(op,dock)
If Debug(0)=1 then text 0,0,"DEBUG: LoadSaveMenu"
loadr(0)=0
Dim savefilename$(10)
For n=0 To 9
nm$="data\"
nm$=nm$+str$(n)
nm$=nm$+".CDR"
If file exist(nm$)=1
open To Read 1,nm$
Read string 1,savefilename$(n)
close file 1
Else
savefilename$(n)="-Empty-"
EndIf
Next n
mousetime=50
Repeat
cls 0
`This does the Load And saving screens!!!
If op=0 then Title_bar("Load game") Else Title_bar("Save game")
cp=198
For n=0 To 9
ink RGB(50,50,50),0
box 0,cp,639,cp+19
ink RGB(255,255,255),0
center text 320,cp+2,savefilename$(n)
cp=cp+21
Next n
ink RGB(255,255,255),0
ok=0
mx=MouseX()
my=MouseY()
If mousetime>0 then mousetime=mousetime-1
If mouseclick()=1 And mousetime<=0
cp=198
sp=0
ok=0
Repeat
If my>cp-1 And my<cp+20 then ok=sp+1
cp=cp+21
sp=sp+1
Until ok<>0 Or sp>9
If ok<>0
If op=0
If savefilename$(ok-1)<>"-Empty-" then loadsavegame(ok-1) Else ok=0
Else
savesavegame(ok-1)
EndIf
EndIf
EndIf
If loadr(0)=0
If (mx>219 And mx<421 And my>407 And my<429)
ink RGB(100,100,100),0
box 220,408,420,428
ink RGB(255,255,255),0
center text 320,410,"Cancel"
If mouseclick()=1 then ok=58
Else
ink RGB(0,0,0),0

box 220,408,420,428
ink RGB(255,255,255),0
center text 320,410,"Cancel"
EndIf
sync
bob 1,MouseX(),MouseY(),2000
EndIf
Until ok<>0
If ok<>58 Or dock<>0
stop music 1
Else
Title_sequence()
EndIf
undim savefilename$(10)
ENDFUNCTION
FUNCTION Title_sequence()
If Debug(0)=1 then text 0,0,"DEBUG: Title_sequence"
loadr(0)=0
` center text 320,170,"Main menu"
position mouse 320,350
ok=0
Repeat
op=0
cls 0
Title_bar("Main Menu")
ink RGB(255,0,0),0
bob 1,MouseX(),MouseY(),2000
mx=MouseX()
my=MouseY()
If (mx>219 And mx<421 And my>197 And my<219)
ink RGB(100,100,100),0
box 220,198,420,218
ink RGB(255,255,255),0
center text 320,200,"Launch"
op=1
Else
ink RGB(0,0,0),0
box 220,198,420,218
ink RGB(255,255,255),0
center text 320,200,"Launch"
EndIf
If (mx>219 And mx<421 And my>227 And my<249)
ink RGB(100,100,100),0
box 220,228,420,248
ink RGB(255,255,255),0
center text 320,230,"Options"
op=2
Else
ink RGB(0,0,0),0
box 220,228,420,248
ink RGB(255,255,255),0
center text 320,230,"Options"
EndIf
If (mx>219 And mx<421 And my>257 And my<279)
ink RGB(100,100,100),0
box 220,258,420,278
ink RGB(255,255,255),0

center text 320,260,"Credits"


op=3
Else
ink RGB(0,0,0),0
box 220,258,420,278
ink RGB(255,255,255),0
center text 320,260,"Credits"
EndIf
If (mx>219 And mx<421 And my>287 And my<309)
ink RGB(100,100,100),0
box 220,287,420,309
ink RGB(255,255,255),0
center text 320,290,"Controls"
op=4
Else
ink RGB(0,0,0),0
box 220,287,420,309
ink RGB(255,255,255),0
center text 320,290,"Controls"
EndIf
If (mx>219 And mx<421 And my>317 And my<339)
ink RGB(100,100,100),0
box 220,317,420,339
ink RGB(255,255,255),0
center text 320,320,"Load Game"
op=5
Else
ink RGB(0,0,0),0
box 220,317,420,339
ink RGB(255,255,255),0
center text 320,320,"Load Game"
EndIf
If (mx>219 And mx<421 And my>387 And my<409)
ink RGB(100,100,100),0
box 220,388,420,408
ink RGB(255,255,255),0
center text 320,390,"Quit"
op=50
Else
ink RGB(0,0,0),0
box 220,388,420,408
ink RGB(255,255,255),0
center text 320,390,"Quit"
EndIf
sync
If mouseclick()=1 And op<>0 then ok=1
Until ok=1
If op=1
get_playername()
stop music 1
EndIf
If op=3 then credits() Else
If op=2 then options() Else
If op=4 then controls() Else
If op=5 then loadsavemenu(0,0) Else
If op=50
stop music 1

Redefine(2)
End
EndIf
ENDFUNCTION
FUNCTION draw_box(tx,ty,bx,by,r,g,b)
If Debug(0)=1 then text 0,0,"DEBUG: DrawBox"
ink RGB(r,g,b),0
line tx,ty,bx,ty
line tx,ty,tx,by
line bx,ty,bx,by
line tx,by,bx,by
ENDFUNCTION
FUNCTION Make_Desc(sysno,name$)
If Debug(0)=1 then text 0,0,"DEBUG: Make_Desc"
descno=rnd(4)
sysinfo(3)=-1
sysinfo(4)=-1
If
If
If
If
If

descno=0
descno=1
descno=2
descno=3
descno=4

then
then
then
then
then

desc$="This
desc$="This
desc$="This
desc$="This
desc$="8 is

1
1
1
1
4

is
is
is
is
by

an unremarkable place" Else


3 2 for 5 but 4 by 6" Else
3 2 for its inhabitants 7 5 but 4 by 6" Else
3 2 for its 5 and its 5" Else
6"

adest$=""
For cp=0 To Len(desc$)
cc$=""
cc$=mid$(desc$,cp)
If Asc(cc$)>47 And Asc(cc$)<58
If Asc(cc$)=49
vl=rnd(1)
If vl=0 then cc$="system" Else cc$="star system"
EndIf
If Asc(cc$)=50
vl=rnd(4)
If vl=0 then cc$="fabled" Else
If vl=1 then cc$="notable" Else
If vl=2 then cc$="well known" Else
If vl=3 then cc$="famous" Else
If vl=4 then cc$="noted"
EndIf
If Asc(cc$)=51
vl=3
If vl=0 then cc$="very" Else
If vl=1 then cc$="mildly" Else
If vl=2 then cc$="mostly" Else
If vl=3 then cc$="reasonably"
EndIf
If Asc(cc$)=52
vl=4
If vl=0 then cc$="beset" Else
If vl=1 then cc$="plagued" Else
If vl=2 then cc$="ravaged" Else
If vl=3 then cc$="cursed" Else
If vl=4 then cc$="scourged"
EndIf
If Asc(cc$)=53
vl=rnd(18)

If vl=0 then cc$="fine wines" Else


If vl=1 then cc$="sculptures" Else
If vl=2 then cc$="luxuries" Else
If vl=3 then cc$="pets" Else
If vl=4 then cc$="rituals" Else
If vl=5 then cc$="fine jewelery" Else
If vl=6 then cc$="breathtaking panoramas" Else
If vl=7 then cc$="heritage" Else
If vl=8 then cc$="casinos" Else
If vl=9 then cc$="drinking establishments" Else
If vl=10 then cc$="night life" Else
If vl=11 then cc$="polite attitude" Else
If vl=12 then cc$="structure" Else
If vl=13 then cc$="exports" Else
If vl=14 then cc$="activities" Else
If vl=15 then cc$="media" Else
If vl=16 then cc$="interests" Else
If vl=17 then cc$="science" Else
If vl=18 then cc$="sports" Else
If vl=19 then cc$="entertainers" Else
If vl=20 then cc$="hospitality" Else
If vl=21 then cc$="crystaline technology"
sysinfo(4)=vl
EndIf
If Asc(cc$)=54
vl=rnd(15)
If vl=0 then cc$="plagues" Else
If vl=1 then cc$="solar activity" Else
If vl=2 then cc$="solar storms" Else
If vl=3 then cc$="xenophobia" Else
If vl=4 then cc$="pirates" Else
If vl=5 then cc$="corruption" Else
If vl=6 then cc$="solar flares" Else
If vl=7 then cc$="pollution" Else
If vl=8 then cc$="space Weavels" Else
If vl=9 then cc$="terrorism" Else
If vl=10 then cc$="journalism" Else
If vl=11 then cc$="wars" Else
If vl=12 then cc$="crime" Else
If vl=13 then cc$="constant fighting" Else
If vl=14 then cc$="media interest" Else
If vl=15 then cc$="military actions"
sysinfo(3)=vl
EndIf
If Asc(cc$)=55
vl=rnd(4)
If vl=0 then cc$="insane" Else
If vl=1 then cc$="eccentric" Else
If vl=2 then cc$="strange" Else
If vl=3 then cc$="bizarre" Else
If vl=4 then cc$="wierd"
EndIf
If Asc(cc$)=56 then cc$=name$
EndIf
adest$=adest$+cc$
Next cp
` text 0,20,cc$
` text 0,40,adest$
` text 0,60,name$
` text 0,0,str$(sysno)

sd$(sysno)=adest$
` sync
` End
` text 0,80,system_desc$(sysno)
ENDFUNCTION adest$
`**************************************************************************
FUNCTION Loading_screen()
cls 0
If Debug(0)=1 then text 0,0,"DEBUG: Loading_screen"
ink RGB(255,255,255),0
paste image 1200,220,190
sync
ENDFUNCTION
FUNCTION Galactic_map(text$,op,secx,secy,opa)
If Debug(0)=1 then text 0,0,"DEBUG: Galactic_map"
`If op=1 this means set player coordinates To this system!!!
`If op=0 just set destination coordinates If system selected
`If op=2 update sectordata With new sector information
`Goto STATEMENT To REGENERATE NEW SECTOR
For nv=0 To 6
For a=0 To 12
If opa=0 then sectordata(nv,a)=0 Else BBSsectordata(nv,a)=0
Next a
If opa=0 then sname$(nv)="" Else BBSsname$(nv)=""
Next nv
mout=3
randomize galaxyseed
If opa=0
bob 1,1000,1000,1005
bob 2,1000,1000,1005
bob 65500,1000,1000,1005
bob 1008,1000,1000,1005
cposx=playinfo(9)
cposy=playinfo(10)
EndIf
Generate_Sector:
inc=rnd(65535)
ss=65535
If opa=0 then cls 0
secseed=secy*(secx*(secy+secx)-(secy-secx)+(secy*secx*secy)+(galaxyseed+1))
If secy=0 then secseed=secseed+secx
If secx<0 then secseed=secseed+50
If secx>0 then secseed=secseed-48
If secy<0 then secseed=secseed+500
If secy>0 then secseed=secseed+450
randomize secseed
sed$=""
For ax=0 To 20
ch$=chr$(rnd(255))
sed$=sed$+ch$
Next ax
sed$=sed$+str$(secx)
sed$=sed$+":"
sed$=sed$+str$(secy)
secseed=0
For ax=0 To Len(sed$)
ch$=mid$(sed$,ax)
secseed=secseed+Asc(ch$)

secseed=secseed+rnd(1000)
Next ax
randomize secseed
nos=rnd(6)
If nos>0
For ns=0 To nos
nas=rnd(5)
If nas=0 then nms$="nnccnnccn" Else
If nas=1 then nms$="cncncncnc" Else
If nas=2 then nms$="cnnccnncc" Else
If nas=3 then nms$="nccnnccnn" Else
If nas=4 then nms$="nccnnccnn" Else
If nas=5 then nms$="ncncncncc"
nl=rnd(5)+3
sysname$=""
For nc=0 To nl
need$=""
need$=mid$(nms$,nc)
If need$="n" then ch=0 Else ch=1
Repeat
ok=1
oc$=cc$
cc$=""
cc$=chr$(rnd(25)+65)
If ch=0
If cc$="A" Or cc$="E" Or cc$="I" Or cc$="O" Or cc$="U" then ok=0
Else
If cc$<>"A" And cc$<>"E" And cc$<>"I" And cc$<>"O" And cc$<>"U" then ok=0
EndIf
Until ok=1
If nc>0 then cc$=lower$(cc$)
sysname$=sysname$+cc$
Next nc
If opa=0 then sname$(ns)=sysname$ Else BBSsname$(ns)=sysname$
If opa=0
sectordata(ns,0)=rnd(65535) :`system seed
sectordata(ns,1)=rnd(65535) :`planet seed
sectordata(ns,2)=rnd(300)+170:`screen X
sectordata(ns,3)=rnd(300)+90 :`screen Y
Else
BBSsectordata(ns,0)=rnd(65535) :`system seed
BBSsectordata(ns,1)=rnd(65535) :`planet seed
BBSsectordata(ns,2)=rnd(300)+170:`screen X
BBSsectordata(ns,3)=rnd(300)+90 :`screen Y
EndIf
Next ns
For ns=0 To nos
`*************************** OWNER CHECK GOES HERE *********************
`at the moment the first race (race 0) owns everything
sectordata(ns,13)=0
If opa=0
randomize sectordata(ns,0)
sectordata(ns,4)=rnd(18)+1 :`number of planets
sectordata(ns,5)=rnd(sectordata(ns,4)):`number of moons
sectordata(ns,6)=rnd(sectordata(ns,4)):`number of stations
If sectordata(ns,6)>10 then sectordata(ns,6)=10
Else
randomize BBSsectordata(ns,0)
BBSsectordata(ns,4)=rnd(18)+1 :`number of planets
BBSsectordata(ns,5)=rnd(BBSsectordata(ns,4)):`number of moons

BBSsectordata(ns,6)=rnd(BBSsectordata(ns,4)):`number of stations
If BBSsectordata(ns,6)>10 then BBSsectordata(ns,6)=10
EndIf
hnoa=rnd(50)
If opa=0
If hnoa<25 then sectordata(ns,7)=rnd(opt(1)) Else sectordata(ns,7)=0
sectordata(ns,8)=rnd(400)+250
If sectordata(ns,4)>0
ic=100
If sectordata(ns,5)=0 then ic=ic-25
If sectordata(ns,6)=0 then ic=ic-50
ich=rnd(100)
If ich<=ic then sectordata(ns,9)=1 Else sectordata(ns,9)=0
If sectordata(ns,6)=0
sectordata(ns,9)=rnd(3)
If sectordata(ns,9)>0 then sectordata(ns,9)=1
EndIf
If sectordata(ns,9)=0 then sectordata(ns,10)=0 Else sectordata(ns,10)=rnd(1
55)+(sectordata(ns,6)*10)
EndIf
make_desc(ns,sname$(ns))
Else
If hnoa<25 then BBSsectordata(ns,7)=rnd(opt(1)) Else BBSsectordata(ns,7)=0
BBSsectordata(ns,8)=rnd(400)+250
If BBSsectordata(ns,4)>0
ic=100
If BBSsectordata(ns,5)=0 then ic=ic-25
If BBSsectordata(ns,6)=0 then ic=ic-50
ich=rnd(100)
If ich<=ic then BBSsectordata(ns,9)=1 Else BBSsectordata(ns,9)=0
If BBSsectordata(ns,6)=0
BBSsectordata(ns,9)=rnd(3)
If BBSsectordata(ns,9)>0 then BBSsectordata(ns,9)=1
EndIf
If BBSsectordata(ns,9)=0 then BBSsectordata(ns,10)=0 Else BBSsectordata(ns,
10)=rnd(155)+(sectordata(ns,6)*10)
EndIf
EndIf
Next ns
EndIf
`only If player is using F4 Or starting a game do they need the Map!!!
If opa=0
If op<>2
display_map:
Repeat
ok=0
cls 0
draw_box(170,90,470,390,0,255,0)
line 140,240,160,220
line 140,240,160,260
line 160,220,160,260
line 500,240,480,220
line 500,241,480,261
line 480,220,480,260
line 320,60,340,80
line 320,60,300,80
line 340,80,300,80

line 321,420,341,400
line 320,420,300,400
line 340,400,300,400
ink RGB(255,255,255),0
center text 320,0,text$
text 170,50,str$(secx)
text 170,70,str$(secy)
If nos=0 then center text 320,20,"There are no systems in this sector"
If nos>0
center text 320,16,"Click on a system to see details"
For ns=0 To nos
ink RGB(255,0,0),RGB(255,0,0)
circle sectordata(ns,2),sectordata(ns,3),3
ink RGB(255,255,255),0
text sectordata(ns,2)+8,sectordata(ns,3)-8,sname$(ns)
Next ns
EndIf
If playinfo(2)<10 And playinfo(3)=secx And playinfo(4)=secy
px=sectordata(playinfo(2),2)
py=sectordata(playinfo(2),3)
ccol=rnd(5)*50
ink RGB(ccol,ccol,ccol),0
line px-5,py,px+5,py
line px,py-5,px,py+5
EndIf
If ss<>65535
cp=110
ink RGB(255,255,255),0
text 0,90,"System name : "
text 100,90,sname$(ss)
hnop=sectordata(ss,4)
hnom=sectordata(ss,5)
hsta=sectordata(ss,6)
hnoa=sectordata(ss,7)
If hnop=0
text 0,cp,"No planets in system"
cp=cp+20
EndIf
If hnop=0
text 0,cp,"No moons in system"
cp=cp+20
EndIf
If hsta=0
text 0,cp,"No space stations in system"
cp=cp+20
EndIf
If hnoa=0
text 0,cp,"No asteroids in system"
cp=cp+20
EndIf
If hnoa>0
text 0,cp,"Asteroids found in system"
cp=cp+20
EndIf
If sectordata(ss,9)=1
text 0,cp,"System inhabited"
text 0,cp+20,"Tech level
: "
vl#=(sectordata(ss,10)/10)+1
text 100,cp+20,str$(vl#)

cp=cp+60
If Len(sd$(ss))>80
fs$=""
secs$=""
curs=0
For sps=0 To Len(sd$(ss))
cc$=mid$(sd$(ss),sps)
If curs=0 then fs$=fs$+cc$ Else secs$=secs$+cc$
If sps>50 And Asc(cc$)=32 then curs=1
Next sps
text 0,cp,fs$
cp=cp+20
If curs=1
text 0,cp,secs$
cp=cp+20
EndIf
Else
text 1,cp,sd$(ss)
cp=cp+20
EndIf
Else
text 0,cp,"System uninhabited"
cp=cp+20
EndIf
If playinfo(2)<10
`difference in sectors
If cposx<sectordata(ss,2)
xdist=sectordata(ss,2)-cposx
Else
xdist=cposx-sectordata(ss,2)
EndIf
If cposy<sectordata(ss,3)
ydist=sectordata(ss,3)-cposy
Else
ydist=cposy-sectordata(ss,3)
EndIf
If secx<playinfo(9) then sdx=secx-playinfo(9) Else sdx=playinfo(9)-secx
If secy<playinfo(10) then sdy=secy-playinfo(10) Else sdy=playinfo(10)-secy
If sdx>218 Or sdy>218
xdist=-1
ydist=-1
text 0,cp,"Out of range"
cp=cp+20
Else
If xdist>ydist then mdist=xdist Else mdist=ydist
text 0,cp,"Distance
: "
frac#=mdist/42.857142
value$=str$(Int(frac#))
frac#=frac#-Int(frac#)
ext$="."
value$=value$+ext$
ext$=str$(frac#)
fc$=mid$(ext$,3)
value$=value$+fc$
playinfo(11)=Val(value$)
fc$=" (ly)"
value$=value$+fc$
If mdist>0 then text 100,cp,value$ Else text 100,cp,"None"
cp=cp+20
If playinfo(11)<=playinfo(12)

text 0,cp,"Fuel required: "


text 100,cp,str$(playinfo(11))
cp=cp+20
Else
text 0,cp,"Insufficient fuel"
cp=cp+20
EndIf
EndIf
EndIf
`sync
EndIf
bob 1,MouseX(),MouseY(),2000
mx=MouseX()
my=MouseY()
If (mx>219 And mx<421 And my>447 And my<469 And ss<>65535)
ink RGB(100,100,100),0
box 220,448,420,468
ink RGB(255,255,255),0
center text 320,450,"Ok"
If mouseclick()=1 then ok=1
Else
ink RGB(0,0,0),0
box 220,448,420,468
If ss<>65535 then ink RGB(255,255,255),0 Else ink RGB(50,50,50),0
center text 320,450,"Ok"
EndIf
sync
If mt>0 then mt=mt-1
Until mouseclick()=1 And mt<=0
If mx>139 And mx<161 And my>219 And my<261
secx=secx-1
mt=mout
cposx=cposx+300
Goto Generate_sector
EndIf
If mx>479 And mx<501 And my>219 And my<261
secx=secx+1
cposx=cposx-300
mt=mout
Goto Generate_sector
EndIf
If mx>299 And mx<341 And my>59 And my<81
secy=secy-1
cposy=cposy+300
mt=mout
Goto Generate_sector
EndIf
If mx>299 And mx<341 And my>399 And my<421
secy=secy+1
mt=mout
cposy=cposy-300
Goto Generate_sector
EndIf
If mx>169 And mx<471 And my>89 And my<391
cs=65535
For ns=0 To nos
If MouseX()>sectordata(ns,2)-3 And MouseX()<sectordata(ns,2)+3
If MouseY()>sectordata(ns,3)-3 And MouseY()<sectordata(ns,3)+3
cs=ns
EndIf

EndIf
Next ns
If cs<>65535 then ss=cs Else ss=65535
EndIf
If scancode()=46 And op<>1
secx=playinfo(3)
secy=playinfo(4)
Goto Generate_sector
EndIf
If ok=0 then Goto display_map Else
If ok=1 And ss<>65535
sysinfo(0)=sectordata(ss,0)
sysinfo(1)=sectordata(ss,1)
If op=1
Loading_screen()
playinfo(2)=ss
playinfo(3)=secx
playinfo(4)=secy
playinfo(9)=sectordata(ss,2)
playinfo(10)=sectordata(ss,3)
EndIf
EndIf
If ss=65535 then Goto display_map
If op=0
playinfo(6)=secx
playinfo(7)=secy
playinfo(8)=ss
EndIf
EndIf
If op=2
`update sysinfo With destination system (when generating sector) With no
`selection option (ie no Map clicking!!!)
sysinfo(0)=sectordata(playinfo(8),0)
sysinfo(1)=sectordata(playinfo(8),1)
`update players current coordinates To destination whilst in hyperspace
playinfo(2)=playinfo(8)
playinfo(3)=playinfo(6)
playinfo(4)=playinfo(7)
playinfo(9)=sectordata(playinfo(2),2)
playinfo(10)=sectordata(playinfo(2),3)
EndIf
EndIf
bob 1,1000,1000,2000
ENDFUNCTION
FUNCTION ExitHyperspace()
make object cube 5200,0.1
hide object 5200
make object cube 5201,0.1
hide object 5201
scale object 5201,50,50,1000
For sa=0 To 50
ndata(sa,0)=0
Next sa
nop=sectordata(playinfo(2),4)
nom=sectordata(playinfo(2),5)
sta=sectordata(playinfo(2),6)
noa=sectordata(playinfo(2),7)
astr=(sectordata(playinfo(2),8))*opt(2)
create_system(sysinfo(0),sysinfo(1),nop,nom,sta,astr,noa,1,sname$(playinfo(2)))

`
`
`
`
`
`

fog on
fog color RGB(0,0,0)
color backdrop RGB(0,0,0)
backdrop off
backdrop on
texture backdrop 1
sync
cx#=0
cy#=0
cz#=0
bx#=0
by#=0
season=rnd(100)
shipspeed#=0
nx=0+rnd(100)
nx=nx-rnd(100)
` position camera nx,0,8000+rnd(100)
` point camera 0,0,0
xx=0+Sin((2*rnd(65535))*3.1415923/360)*8000
yy=0+Cos((2*rnd(65535))*3.1415923/360)*8000
position camera xx,0,yy
` point camera 0,0,0
sync
` set camera rotation zyx
xrot#=camera angle x()
yrot#=camera angle y()
zrot#=camera angle z()
playinfo(12)=playinfo(12)-playinfo(11)
playinfo(11)=0
playinfo(8)=6555
randomize timer()
For n=0 To 1000
shot(n,2)=0
Next n
ENDFUNCTION
FUNCTION EnterHyperspace()
r=0
wait 25
For n=1 To 1000
If object exist(n)=1 then hide object n
Next n
Galactic_map("",2,playinfo(6),playinfo(7),0)
reset_system()
set current bitmap 0
bob 1,1000,1000,2000
autocam off
position camera -15000,0,0
`color backdrop RGB(128,128,128)
bob 3,0,380,1005
set bob 3,0,1
sync
wait 25
` color backdrop RGB(0,0,0)
bob 3,0,380,1005
set bob 3,0,1
sync
Exithyperspace()
ENDFUNCTION

FUNCTION Radar(scrx,scry,rvs)
create bitmap 3,640,480
` ink RGB(50,255,50),0
` box scrx-125,scry-44,scrx+125,scry+44
ink RGB(0,0,0),0
box scrx-124,scry-44,scrx+124,scry+44
ink RGB(255,0,0),0
cz=camera position y()
yr=camera angle y()
px#=camera position x()
py#=camera position y()
pz#=camera position z()
ink RGB(255,0,0),0
If rvs=0 then irc=0 Else irc=180
ink RGB(20,255,20),0
Line ((scrx+1)-Sin(yr+irc)*10),(scry+Cos(yr+irc)*6),((scrx+1)-Sin((yr+140)+irc)
*10),(scry+Cos((yr+140)+irc)*6)
Line ((scrx+1)-Sin(yr+irc)*10),(scry+Cos(yr+irc)*6),((scrx+1)-Sin((yr-140)+irc)
*10),(scry+Cos((yr-140)+irc)*6)
Line ((scrx+1)-Sin((yr+140)+irc)*10),(scry+Cos((yr+140)+irc)*6),((scrx+1)-Sin((
yr-140)+irc)*10),(scry+Cos((yr-140)+irc)*6)
For n=1 To 400
If object exist(n)=1
If object visible(n)=1
tx#=object position x(n)
ty#=object position y(n)
tz#=object position z(n)
If tx#>px#-480 And tx#<px#+480 And tz#>pz#-480 And tz#<pz#+480
rx#=(px#-tx#)/3.87
rz#=(pz#-tz#)/11.428
ink RGB(255,255,255),0
If n>304 And n<330
csid=n-305
hm=ndata(csid,25)
If hm>0 And hm<16 then ink RGB(20,20,255),0 Else
If hm>15 And hm<32 then ink RGB(20,255,20),0 Else
If hm>31 And hm<64 then ink RGB(150,20,150),0 Else
If hm>63 And hm<112 then ink RGB(255,20,20),0 Else
If hm>111 And hm<160 then ink RGB(255,150,150),0 Else
If hm>159 And hm<208 then ink RGB(20,255,255),0 Else
If hm>207 And hm<300 then ink RGB(150,150,150),0 Else
If hm>299 then ink RGB(255,255,255),0
EndIf
If n<>304
If ty#<>py#
line scrx+Int(rx#),scry-Int(rz#),scrx+Int(rx#),(scry-(rz#))-((ty#-py#)/2)
line scrx+Int(rx#),(scry-(rz#))-((ty#-py#)/2),(scrx+Int(rx#))+1,(scry-(rz
#))-((ty#-py#)/2)
EndIf
If ty#=py#
Dot scrx+Int(rx#),scry-Int(rz#)
Dot (scrx+Int(rx#))-1,(scry-Int(rz#))
Dot (scrx+Int(rx#))+1,(scry-Int(rz#))
EndIf
EndIf
EndIf
EndIf
EndIf
Next n
get image 1008,scrx-124,scry-64,scrx+124,scry+64

delete bitmap 3
bob 1008,scrx,scry,1008
set bob 1008,0,1
ENDFUNCTION
FUNCTION Missleinfo()
ink RGB(255,255,255),0
If shipbitz(25)>0
bob 1015,10,166,2012
set bob 105,0,1
text 48,174,str$(shipbitz(25))
EndIf
If shipbitz(7)>0
bob 1009,10,200,2006
set bob 1009,0,1
text 48,208,str$(shipbitz(7))
EndIf
If shipbitz(29)>0
bob 1010,10,234,2007
set bob 1010,0,1
text 48,242,str$(shipbitz(29))
EndIf
If shipbitz(8)>0
bob 1011,10,268,2008
set bob 1011,0,1
text 48,274,str$(shipbitz(8))
EndIf
If shipbitz(9)>0
bob 1012,10,302,2009
set bob 1012,0,1
text 48,310,str$(shipbitz(9))
EndIf
If shipbitz(26)>0
bob 1013,10,336,2010
set bob 1013,0,1
text 48,344,str$(shipbitz(26))
EndIf
If shipbitz(27)>0
bob 1014,10,370,2011
set bob 1014,0,1
text 48,378,str$(shipbitz(27))
EndIf
ENDFUNCTION
FUNCTION information()
ok=-2
ENDFUNCTION ok
FUNCTION idobj(obj)
If object visible(obj)=1
If object in screen(obj)=1
scx=object screen x(obj)
scy=object screen y(obj)
draw_box(scx-5,scy-5,scx+5,scy+5,20,255,20)
EndIf
If shipbitz(30)>0
ink RGB(255,0,0),0
If obj>0 then text 450,80,"Target Locked"
If obj>0 then text 450,100,"Information"
ink RGB(255,255,255),0

If obj>0 And obj<21


`ident a planet
text 450,120,pname$(obj)
EndIf
If obj>20 And obj<41
`ident a moon
text 450,120,"Orbital Body"
EndIf
If obj=50 then text 450,120,sunname$(0)
If obj>50 And obj<62
`ident a space station
text 450,120,"Space Station"
EndIf
If obj>61 And obj<103
`ident a cargo canister
text 450,120,"Cargo canister"
EndIf
If obj>102 And obj<304 then text 450,120,"Asteroid"
If obj>304 And obj<356
`ident a ship
text 450,120,"Space Ship"
text 450,140,"ID
:"
text 490,140,NShipid$(obj-306,0)
text 450,160,"Pilot:"
text 490,160,NShipid$(obj-306,1)
If ndata(obj-306,14)=1 then text 450,180,"FTL jump analyser"
If ndata(obj-306,15)=1 then text 450,200,"Shockwave device"
If ndata(obj-306,16)=1 then text 450,220,"Escape Capsule"
If ndata(obj-306,17)>0 then text 450,240,"Carrying Goods"
If ndata(obj-306,11)>0
ink RGB(255,50,50),0
text 450,280,"Bounty:"
text 510,280,str$(Ndata(obj-306,11))
ink RGB(255,255,255),0
EndIf
EndIf
Else
ink RGB(255,0,0),0
If obj>0 then text 450,80,"Target Locked"
If obj>0 then text 450,100,"Information"
ink RGB(255,255,255),0
If obj>0 And obj<21
`ident a planet
text 450,120,pname$(obj)
EndIf
If obj>20 And obj<41
`ident a moon
text 450,120,"Orbital Body"
EndIf
If obj=50 then text 450,120,sunname$(0)
If obj>50 And obj<62
`ident a space station
text 450,120,"Space Station"
EndIf
If obj>61 And obj<103
`ident a cargo canister
text 450,120,"Cargo canister"
EndIf
If obj>102 And obj<304 then text 450,120,"Asteroid"
If obj>304 And obj<356 then text 450,120,"Unknown Ship"

EndIf
Else
obj=0
EndIf
ENDFUNCTION obj
`****************************
`*
MODEL DISPLAY
*
`****************************
FUNCTION ModelDisplay()
Dim shipn$(605)
Dim shipm$(605)
Dim srace$(605)
set ambient light 50
`current ship pointer For listing avaiable racial ships.
curp=0
For r=0 To 12
If racedesc$(r,0)<>""
For n=0 To raceinfo(r,3)-1
ifp=(r*50)+n
shipn$(curp)=shipname$(ifp)
shipm$(curp)="models\"
shipm$(curp)=shipm$(curp)+shipmodel$(ifp)
srace$(curp)=racedesc$(r,0)
curp=curp+1
Next n
EndIf
Next r
` Blue Danube Docking And Title music
Load music music$(1),1
loop music 1
play music 1
cls 0
autocam off
backdrop on
texture backdrop 1
timr=0
num=-1
cdist=0
name$=""
position mouse 320,400
loop music 1
zdir=0 : `zoom in
bob 1,1000,1000,1005
bob 2,1000,1000,1005
bob 3,1000,1000,1005
bob 1008,1000,1000,1005
Repeat
ok=0
If timr=0
If object exist(1)=1
delete object 1
EndIf
num=num+1
timr=600
If num>curp-1 then num=0
ink RGB(255,255,255),0

`
`
`
`
`
`
`

REMMED CODE BLOCK For DIAGNOSTICS


Repeat
text 0,20,shipmodel$(num)
text 0,0,shipn$(num)
sync
Until scancode()<>0
End
load object shipm$(num),1
name$=shipn$(num)
sze=object size(1)
If sze>12 then cdist#=2+((sze-10)/10) Else cdist#=1.5
set object 1,1,1,1,1
scale object 1,5,5,5
zdir=0
dist#=100
xr#=rnd(360)
yr#=rnd(360)
zr#=rnd(360)
EndIf
`move camera To object
position camera 0,0,dist#
` point camera 0,0,0
If dist#>cdist# And zdir=0 then dist#=dist#-1
If dist#<cdist# then dist#=cdist#
If timr<=100-cdist then zdir=1
If zdir=1 then dist#=dist#+1
bob 564,10,10,1000
ink RGB(255,255,255),0
center text 320,110,"Copyright 2000 EdzUp"
center text 320,125,"written in DarkBasic by Ed Upton"
center text 320,140,"comments or suggestions to sf2000@edzup.co.uk"
center text 320,400,srace$(num)
center text 320,420,name$
`positon And rotate object
position object 1,0,0,0
rotate object 1,xr#,yr#,zr#
show object 1
xr#=xr#+1
If xr#>359 then xr#=xr#-360
yr#=yr#+2
If yr#>359 then yr#=yr#-360
zr#=zr#+1
If zr#>359 then zr#=zr#-360
bob 1,MouseX(),MouseY(),2000
mx=MouseX()
my=MouseY()
If (mx>219 And mx<421 And my>447 And my<469 And ss<>65535)
ink RGB(100,100,100),0
box 220,448,420,468
ink RGB(255,255,255),0
center text 320,450,"Continue"
If mouseclick()=1 then ok=1
Else
ink RGB(0,0,0),0
box 220,448,420,468
If ss<>65535 then ink RGB(255,255,255),0 Else ink RGB(50,50,50),0
center text 320,450,"Continue"
EndIf
sync
If timr>0 then timr=timr-1

Until ok=1
delete object 1
delete bob 564
backdrop off
autocam off
undim shipn$(605)
undim shipm$(605)
undim srace$(605)
ENDFUNCTION
FUNCTION Button(tx,ty,bx,by,fill)
If fill<>0
ink RGB(100,100,100),0
box tx,ty,bx,by
EndIf
ink RGB(50,50,50),0
line bx,by,tx,by
line bx,by,bx,ty
ink RGB(150,150,150),0
line tx,ty,tx,by
line tx,ty,bx,ty
ink RGB(255,255,255),0
ENDFUNCTION
FUNCTION CommsOptions(cm)
cpx=MouseX()
cpy=MouseY()
butx=50
buty=100
co=0
ok=0
Repeat
If cpx>butx-1 And cpx<butx+10 And cpy>buty-1 And cpy<buty+10
`If you click on a button Return the menu associated With it!!!
cbm=comms(co)
ok=1
EndIf
If ok=0
buty=buty+20
co=co+1
EndIf
Until ok=1 Or co>20
If cbm=-1
` Or ok=0 Or co>20
playinfo(17)=1
comp(0)=100
cbm=-1
EndIf
ENDFUNCTION cbm
FUNCTION Communications(menu,obj)
`function To display current menu (specified by menu)
`Standard menu
rel=playinfo(16) : `relative To what body!!!
co=0
bp=0
If menu=1
eb=0
Button(50,100,60,110,1)
text 70,98,"Broadcast message in all directions"

comms(0)=2
Button(50,120,60,130,1)
text 70,118,"Request stock market information"
comms(1)=4
bp=140
co=2
If obj=0 And rel=0
Button(50,140,60,150,1)
text 70,138,"End communication"
comms(co)=-1
comms(co+1)=0
eb=1
EndIf
If obj<>0 And obj>304
Button(50,140,60,150,1)
mes$="Send message to "
targ$=NShipid$(obj-305,0)
mes$=mes$+targ$
text 70,138,mes$
comms(co)=3
comms(co+1)=0
co=co+1
bp=bp+20
EndIf
If rel<>0
rel$=""
If rel>0 And rel<21
rel$="Request Docking clearance from "
dcr$=pname$(rel)
rel$=rel$+dcr$
EndIf
If rel>20 And rel<41 then rel$="Request Docking clearance from Moon"
If rel>50 And rel<62 then rel$="Request Docking clearance from Space Station"
If rel$<>""
Button(50,bp,60,bp+10,1)
text 70,bp-2,rel$
comms(co)=11
comms(co+1)=0
co=co+1
EndIf
EndIf
If eb=0
If obj=0 And rel<>0 Or obj<>0 And rel=0 then bp=160 Else bp=180
Button(50,bp,60,bp+9,1)
text 70,bp-2,"End communications"
comms(co)=-1
comms(co+1)=0
co=co+1
EndIf
active=1
EndIf
`Broadcast message in all directions
If menu=2
Button(50,100,60,110,1)
text 70,98,"HELP!!! Im under attack"
comms(0)=5
Button(50,120,60,130,1)
text 70,118,"Help, my ship has broken down"
comms(1)=6

Button(50,140,60,150,1)
text 70,138,"End communication"
comms(2)=-1
comms(3)=0
active=1
EndIf
`send message To ship xxx-xxxxx
If menu=3
Button(50,100,60,110,1)
text 70,98,"What are you doing here?"
comms(0)=7
Button(50,120,60,130,1)
text 70,118,"What are you carrying?"
comms(1)=8
Button(50,140,60,150,1)
text 70,138,"Can I join you?"
comms(2)=9
Button(50,160,60,170,1)
text 70,158,"Surrender or die!!!"
comms(3)=10
Button(50,180,60,190,1)
text 70,178,"End communication"
comms(4)=-1
comms(5)=0
active=1
EndIf
`request system information (stock markets)
If menu=4
comms(0)=0
comp(0)=100
active=0
EndIf
`HELP im under attack
If menu=5
on=304
a=rnd(50)
`MAKE PIRATE SHOW INTEREST IN THE VICTIM
If a<25
cp=0
oki=-1
Repeat
If ndata(cp,11)>0
If object exist(ndata(cp,6))=1
If object visible(ndata(cp,6))=0
ndata(cp,6)=on
oki=1
EndIf
EndIf
EndIf
cp=cp+1
Until oki<>-1 Or cp>20
EndIf
comms(0)=0
active=0
EndIf
`help my ship has broken down
If menu=6
on=304
a=rnd(50)

`MAKE PIRATE SHOW INTEREST IN THE VICTIM


If a<25
cp=0
oki=-1
Repeat
If ndata(cp,11)>0
If object exist(ndata(cp,6))=1
If object visible(ndata(cp,6))=0
ndata(cp,6)=on
oki=1
EndIf
EndIf
EndIf
cp=cp+1
Until oki<>-1 Or cp>20
EndIf
comms(0)=0
active=0
EndIf
`what are you doing here
If menu=7
a=rnd(3)
If a=0 then com$(0)="None of your business!!!"
If a=1 then com$(0)="Why should I tell you?"
If a=2 then com$(0)="I not telling you that!!!"
If a=3 then com$(0)="Get lost"
comms(0)=0
comp(0)=100
active=0
playinfo(17)=10
EndIf
`what are you carrying
If menu=8
a=rnd(3)
If a=0 then com$(0)="None of your business im sure!!!"
If a=1 then com$(0)="Nothing of any value!!!"
If a=2 then com$(0)="Rubbish, this is a garbage transporter"
If a=3 then com$(0)="Radioactives to be processed."
comms(0)=0
comp(0)=100
active=0
EndIf
`can I join you
If menu=9
a=rnd(3)
If a=0 then com$(0)="No I work alone"
If a=1 then com$(0)="Not at the moment thanks"
If a=2 then com$(0)="No way!!!"
If a=3 then com$(0)="Thanks but no thanks!!!"
comp(0)=200
comms(0)=0
active=0
EndIf
`surrender Or die
If menu=10
a=rnd(3)
If a=0 then com$(0)="You are no match for a Elite Pilot like myself"
If a=1 then com$(0)="You dont stand a chance"
If a=2 then com$(0)="Get lost"
If a=3 then com$(0)="This will be your final warning"

comp(0)=100
comms(0)=0
active=0
If playinfo(16)>0 And playinfo(16)<62 And playinfo(16)<>50
com$(0)="Police: That sort of behavior is not tolerated here"
record(10)=record(10)+1
record(11)=record(11)+100
EndIf
EndIf
`request docking clearance
If menu=11
a=rnd(3)
If a=0 then com$(0)="Docking clearance granted, guiding you in"
If a=1 then com$(0)="Surrender your computer to central on my mark...Mark!!!"
If a=2 then com$(0)="Clearance granted, proceed to docking station"
If a=3 then com$(0)="Clearance granted, proceed to landing bay"
comp(0)=100
active=0
Docking()
EndIf
ENDFUNCTION active
FUNCTION Relativity()
`psize(n)*opt(2) PLANETS (rnd(100)+10)
`msize(n)*opt(2) MOONS (rnd(5)+5)
`stations are uniform range As are asteroids!!!
px#=npos#(playinfo(15),0)
py#=npos#(playinfo(15),1)
pz#=npos#(playinfo(15),2)
ok=0
n=1
robj=0
rdist#=5000
Repeat
If object exist(n)=1
dist#=Distance(0,n)
If n>0 And n<21 then rg#=(psize(n)*opt(2))
If n>20 And n<41 then rg#=(msize(n-20)*opt(2))
If n=50 then rg#=sunsize(0)
If n>50 And n<61 then rg#=50
If dist#<rg# And dist#<rdist#
robj=n
rdist#=dist#
ok=n
EndIf
EndIf
n=n+1
Until ok<>0 Or n>303
If ok<>0 And n<304
If ok>0 And ok<21 then rel$=pname$(ok)
If ok>20 And ok<41 then rel$="Moon"
If ok=50 Or ok>61 And ok<103 then rel$=sunname$(0)
If ok>50 And ok<62 then rel$="Space Station"
If ok>102 then rel$="Asteroid"
Else
rel$=sunname$(0)
playinfo(16)=-1
ok=-1
EndIf
ink RGB(200,200,200),0

text 10,410,"Relative to:"


text 10,426,rel$
playinfo(16)=ok
ENDFUNCTION
FUNCTION surface_tex(r,g,b)
create bitmap 5,258,258
set current bitmap 0
paste image 1003,0,0
For cty=0 To 256
For ctx=0 To 256
cc=Point(ctx,cty)
rd=rgbr(cc)
gd=rgbg(cc)
bd=rgbb(cc)
rc=cc+r
gc=cc+g
bc=cc+b
ink RGB(rc,gc,bc),0
dot ctx,cty
Next ctx
Next cty
get image 1300,0,0,256,256
delete bitmap 5
ENDFUNCTION
FUNCTION enterorbit(obj,sped#,crx#,cry#,crz#)
load sound "sound\wind.wav",10
loop sound 10
play sound 10
px=rnd(10000)+30000
py=rnd(10000)+30000
If playinfo(16)>0 And playinfo(16)<22 then ca=pla(playinfo(16))
If playinfo(16)>21 And playinfo(16)<43 then ca=mla(playinfo(16))
If ca=0
ink RGB(0,0,0),0
paste image 1003,0,0
get image 1300,0,0,256,256
stop sound 10
EndIf
If ca=4
ink RGB(255,255,255),0
paste image 1003,0,0
get image 1300,0,0,256,256
EndIf
If ca=2
ink RGB(0,55,0),0
` surface_tex(0,55,0)
paste image 1003,0,0
get image 1300,0,0,256,256
EndIf
If ca=3 Or ca=6
ink RGB(50,50,50),0
paste image 1003,0,0
get image 1300,0,0,256,256
EndIf
If ca=5
ink RGB(255,0,255),0
` surface_tex(255,0,255)
paste image 1003,0,0

get image 1300,0,0,256,256


EndIf
box 0,0,256,256
If ca=0 then paste image 1,0,0
get image 1010,0,0,256,256
cspeed#=sped#
For so=1 To 25000
If object exist(so)=1
hide object so
EndIf
Next so
make matrix 1,5000,5000,10,10
If ca<>0 then make matrix 2,5000,5000,10,10
make matrix 3,5000,5000,10,10
prepare matrix texture 1,1003,1,1
If ca<>0 then prepare matrix texture 2,1006,1,1
prepare matrix texture 3,1001,1,1
If ca<>0 then position matrix 2,0,240,0
position matrix 1,0,0,0
position matrix 3,0,0,0
randomize matrix 1,30
position camera 2500,250,2500
show object 304
altdeath=0
ax=2500
az=2500
landed=0
`fog color RGB(50,50,50)
fgd=rnd(200)+500
skymod=0
Repeat
If ca<>0 And sound playing(10)=0 then play sound 10
vol=80+Abs(Int(cspeed#*10))
If vol>100 then vol=100
If vol<80 then vol=80
set sound volume 10,vol
xa#=camera angle x()
ya#=camera angle y()
za#=camera angle z()
move camera cspeed#
palt#=camera position y()
cx#=camera position x()
cz#=camera position z()
xd=0
zd=0
If Int(cx#)<ax-499 then xd=-1
If Int(cx#)>ax+499 then xd=1
If Int(cz#)<az-499 then zd=-1
If Int(cz#)>az+499 then zd=1
`If below cloud layer obscure view With fog.
If palt#<241 And skymod=0
If playinfo(16)>0 And playinfo(16)<22 then ca=pla(playinfo(16))
If playinfo(16)>21 And playinfo(16)<43 then ca=mla(playinfo(16))
If ca=0
If matrix exist(2)=1
delete matrix 2
EndIf
fog color RGB(0,0,0)

fog distance (9900*opt(2))-100


EndIf
If ca=4
fog color RGB(255,255,255)
EndIf
If ca=2
fog color RGB(0,55,0)
EndIf
If ca=3 Or ca=6
fog color RGB(50,50,50)
EndIf
If ca=5
fog color RGB(255,0,255)
EndIf
fog distance fgd
texture backdrop 1010
If ca=0 then texture backdrop 1
skymod=1
` set camera range 1,10000*opt(2)
EndIf
`If above the cloud layer change backdrop To stars
If palt#>242 And skymod=1
fog color RGB(0,0,0)
fog distance (9900*opt(2))-100
texture backdrop 1
skymod=0
` set camera range 1,10000*opt(2)
EndIf
If playinfo(16)>0 And playinfo(16)<22 then ca=pla(playinfo(16))
If playinfo(16)>21 And playinfo(16)<43 then ca=mla(playinfo(16))
If ca=0
fog color RGB(0,0,0)
fog distance fgd
EndIf
` If skymod=1 then text 0,0,"BELOW" Else text 0,0,"ABOVE"
` text 10,20,str$(palt#)
If xd=-1
If matrix exist(2)=1 then shift matrix right 2
shift matrix right 1
px=px+1
position camera 2500,palt#,cz#
EndIf
If xd=1
If matrix exist(2)=1 then shift matrix left 2
shift matrix left 1
px=px-1
position camera 2500,palt#,cz#
EndIf
If zd=-1
If matrix exist(2)=1 then shift matrix down 2
shift matrix down 1
py=py-1
position camera cx#,palt#,2500
EndIf
If zd=1
If matrix exist(2)=1 then shift matrix up 2
shift matrix up 1
py=py+1
position camera cx#,palt#,2500
EndIf

position object 304,camera position x(),camera position y(),camera position z(


)
scroll backdrop bx#,by#
bob 65500,MouseX(),MouseY(),2000
set bob 65500,0,1
Radar(198,365,0)
ink RGB(255,255,255),0
text 500,456,"Fuel"
If blag=0
fg$=str$(playinfo(12))
fga$=" / "
fg$=fg$+fga$
fga$=str$(playinfo(13))
fg$=fg$+fga$
text 550,456,fg$
Else
text 550,456,"Unlimited"
playinfo(13)=65535
playinfo(12)=65535
EndIf
ink RGB(255,255,255),0
a$="Damage "
a$=a$+str$(ndata(playinfo(15),5))
a$=a$+"\"
a$=a$+str$(ndata(playinfo(15),25))
text 500,408,a$
If rapid=0 then text 500,426,"Charged" Else text 500,426,"Rapid"
text 10,370,"Altitude"
a=Int(camera position y())
b=a-get ground height(1,camera position x(),camera position z())
c=get ground height(1,camera position x(),camera position z())
al$=str$(a)
al$=al$+"["
al$=al$+str$(b)
al$=al$+"]"
text 10,386,al$
sync
If keystate(59)=1 And landed=1
For al=c To c+10
position camera cx#,al,cz#
position object 304,cx#,palt,cz#
sync
Next al
EndIf
If c>0 then landed=0
If control(0)<>0 And cscr=0
mok=0
If control(0)=1 And mouselock=1 then mok=-1
If mok=0 then Otherdevice(xrot#,yrot#,zrot#)
xrot#=camera angle x()
yrot#=camera angle y()
zrot#=camera angle z()
EndIf
If keystate(keys(0))=1 And landed=0
xrotate camera wrapvalue(camera angle x()+2)
by#=by#+10
If by#>90 then by#=0
EndIf
If keystate(keys(1))=1 And landed=0

xrotate camera wrapvalue(camera angle x()-2)


by#=by#-10
If by#<0 then by#=90
EndIf
If keystate(keys(2))=1 And landed=0
yrotate camera wrapvalue(camera angle y()-2)
bx#=bx#-10
If bx#<0 then bx#=90
EndIf
If keystate(keys(3))=1 And landed=0
yrotate camera wrapvalue(camera angle y()+2)
bx#=bx#+10
If bx#>90 then bx#=0
EndIf
jfb=0
If joystick fire c()=1 then jfb=1
If joystick fire d()=1 then jfb=2
If joystick fire c()=1 And joystick fire d()=1 then jfb=3
If keystate(keys(4))=1 Or jfb=2
If landed=0 then cspeed#=cspeed#+0.2
EndIf
If keystate(keys(5))=1 Or jfb=1
If landed=0 then cspeed#=cspeed#-0.2
EndIf
If keystate(keys(10))=1 Or jfb=3 then cspeed#=0
If cspeed#<-10 then cspeed#=-10
If cspeed#>10 then cspeed#=10
If b<=0 And cspeed#>2 Or camera position y()<=0
altdeath=1
position object 304,object position x(304),object position y(304)+1,object po
sition z(304)
EndIf
If c<=0 And cspeed#<3 Or b<=0 And cspeed#=0 Or b<=0 And cspeed#<3
If cspeed#>0 then cspeed#=0
rotate camera xa#,0,za#
center text 320,320,"-=Landed=-"
center text 320,338,"Press F1 to take off"
landed=1
EndIf
Until palt#>275 Or altdeath<>0
If palt#>275 And altdeath=0
delete matrix 1
If matrix exist(2)=1 then delete matrix 2
delete matrix 3
backdrop on
fog on
fog color RGB(0,0,0)
texture backdrop 1
set camera range 1,10000*opt(2)
fog distance (9900*opt(2))-100
For so=1 To 25000
If object exist(so)=1
If so<>50 And object position x(so)=0 And object position y(so)=0 And object
position z(so)=0
hide object so
Else
show object so
EndIf
EndIf
Next so

n=playinfo(16)
If n>0 And n<21 then rg#=(psize(n)*opt(2))
If n>20 And n<41 then rg#=(msize(n-20)*opt(2))
If n=50 then rg#=sunsize(0)
`make a cube And then move it out of range of the planet
`then place the player there.
ety#=(rg#/100)*60
ox#=object position x(playinfo(16))
oy#=object position y(playinfo(16))
oz#=object position z(playinfo(16))
dt=0
make object cube 60000,5
position object 60000,ox#,oy#,oz#
point object 60000,rnd(360),rnd(360),0
Repeat
move object 60000,1
dt=dt+1
Until dt>(ety#+15)
oxx#=object position x(60000)
oyy#=object position y(60000)
ozz#=object position z(60000)
position camera oxx#,oyy#,ozz#
rotate camera object angle x(60000),object angle y(60000),object angle z(60000
)
position object 304,camera position x(),camera position y(),camera position z(
)
delete object 60000
altdeath=-1
EndIf
If altdeath=1 then position camera camera position x(),(0+c)+2,camera position
z()
If altdeath<>1
If sound playing(10)=1 then stop sound 10
EndIf
ENDFUNCTION altdeath
Function Distance(Obj1,Obj2)
`code provided by Mark Markinson (converted from the DB Forum)
If Obj1=0
X#=Camera Position X()
Y#=Camera Position Y()
Z#=Camera Position Z()
Else
If object exist(obj1)=1
X#=Object Position X(Obj1)
Y#=Object Position Y(Obj1)
Z#=Object Position Z(Obj1)
EndIf
EndIf
If Obj2=0
X2#=Camera Position X()
Y2#=Camera Position Y()
Z2#=Camera Position Z()
Else
If object exist(Obj2)
X2#=Object Position X(Obj2)
Y2#=Object Position Y(Obj2)
Z2#=Object Position Z(Obj2)
EndIf

EndIf
EndFunction sqrt((x#-x2#)*(x#-x2#)+(y#-y2#)*(y#-y2#)+(z#-z2#)*(z#-z2#))
FUNCTION Altitude(speed#)
`psize(n)*opt(2) PLANETS (rnd(100)+10)
`msize(n)*opt(2) MOONS (rnd(5)+5)
`stations are uniform range As are asteroids!!!
px#=npos#(playinfo(15),0)
py#=npos#(playinfo(15),1)
pz#=npos#(playinfo(15),2)
ok=0
alt#=-1
If playinfo(16)>0 And playinfo(16)<42 Or playinfo(16)=50
ok=1
alt#=Distance(0,playinfo(16))
n=playinfo(16)
If n>0 And n<21 then rg#=(psize(n)*opt(2))
If n>20 And n<41 then rg#=(msize(n-20)*opt(2))
If n=50 then rg#=sunsize(0)
entry#=(rg#/100)*60
alt#=alt#-entry#
If playinfo(16)<>50 then text 10,370,"Altitude" Else text 10,370,"Cabin Temp."
EndIf
ink RGB(200,200,200),0
n=playinfo(16)
If n>0 And n<21 then rg#=(psize(n)*opt(2))
If n>20 And n<41 then rg#=(msize(n-20)*opt(2))
If n=50 then rg#=sunsize(0)
entry#=(rg#/100)*60
percent#=((rg#/100)*40)/100
If n<>50 And n<42
ink RGB(0,255,0),0
text 10,386,str$(alt#)
Else
If n=50
ink RGB(255,20,20),0
tmp=((rg#-entry#)-((alt#-entry#)))-66
text 10,386,str$(tmp)
EndIf
EndIf
`If alt less than entry# then enter the orbit
alx=0
If alt#>0
crx#=camera angle x()
cry#=camera angle y()
crz#=camera angle z()
EndIf
If alttimer(0)>0 then alttimer(0)=alttimer(0)-1
If alt#<0 And alttimer(0)<=0
If playinfo(16)>0 And playinfo(16)<41 then alx=enterorbit(playinfo(16),speed#,
crx#,cry#,crz#)
EndIf
If alx=-1
alx=0
alttimer(0)=50
EndIf
If alt#<0 And playinfo(16)=50 then alx=1
ENDFUNCTION alx
FUNCTION Launch()

playinfo(17)=1
ok=1
ENDFUNCTION ok
FUNCTION Select_system(cmn)
sels$=""
count=0
Repeat
sel=0
cx=playinfo(3)
cy=playinfo(4)
dx=cx
dy=cy
cx=cx+rnd(5)
cx=cx-rnd(5)
cy=cy+rnd(5)
cy=cy-rnd(5)
Galactic_map("",0,cx,cy,1)
sys=rnd(6)
`check If system inhabited (nobody will ask To go To a binary system!!!)
If BBSsectordata(sys,9)=1 then sel=1
count=count+1
Until sel=1 Or count>50
If count>50
msg$(30)="MIFFED"
Else
`setup message information
sels$=BBSsname$(sys)
`system name
mesinfoname$(cmn)=sels$
mesinfo(cmn,11)=cx
mesinfo(cmn,12)=cy
mesinfo(cmn,13)=sys
n$=" ["
sels$=sels$+n$
n$=str$(cx)
sels$=sels$+n$
n$=","
sels$=sels$+n$
n$=str$(cy)
sels$=sels$+n$
n$="]"
sels$=sels$+n$
If dx<cx then xd=cx-dx
If cx<dx then xd=dx-cx
If dy<cy then yd=cy-dy
If cy<dy then yd=dy-cy
If xd<yd
msg$(31)=str$(yd+1)
Else
msg$(31)=str$(xd+1)
EndIf
EndIf
ENDFUNCTION sels$
FUNCTION makemessage(msed)
`To STOP THOSE @$&*$@ 'DUFF MESSAGES'
nm=rnd(29)
mil=0
If nm>0

For nq=0 To nm
`Have To call randomize repeatedly With a different seed due To bug
`in randomize code which makes it generate numbers incorrectly.
randomize msed+(nq*2)
Repeat
msg$(nq)=""
m1$=""
f$=""
fn$=""
a$=""
a=0
`47 characters max For each message line!!!
Repeat
ok=1
mestype=rnd(11)
If mil=1 And mestype=10 then ok=0
Until ok=1
ok=0
`PROMOTIONS (eat at joes etc)
mesinfo(nq,0)=mestype
`set up persons name And company information
mesinfo(nq,6)=rnd(99)
mesinfo(nq,7)=rnd(99)
mesinfo(nq,8)=rnd(99)
a=rnd(50)
If a<25 then mesinfo(nq,9)=rnd(99) Else mesinfo(nq,9)=-1
mesinfo(nq,10)=rnd(99)
If mestype=0
m1$="PROMOTION:"
ok=1
a=rnd(2)
If a=0 then ad$="Try "
If a=1 then ad$="Use "
If a=2 then ad$="Buy "
m1$=m1$+ad$
a$=""
an=rnd(99)
ad$=NPCcompany$(an,0)
m1$=m1$+ad$
ad$=" "
m1$=m1$+ad$
a=rnd(99)
ad$=NPCcompany$(an,2)
m1$=m1$+ad$
ad$=" products. "
m1$=m1$+ad$
ad$=""
msg$(nq)=m1$
Goto ENDFUNC
EndIf
`JOB vacancies wanted
If mestype=1
a=rnd(2)
If a=0 then m1$="JOB WANTED:"
If a=1 then m1$="VACANCY:"
If a=2 then m1$="JOB WANTED: to feed disabled spouse"
ok=1
If a<2
a=rnd(3)
If a=0

mt$="Would make a valuable crew member"


EndIf
If a=1 then mt$="Have lots of experience"
If a=2 then mt$="Have extensive service career"
If a=3 then mt$="Have long Military career"
m1$=m1$+mt$
EndIf
msg$(nq)=m1$
Goto ENDFUNC
EndIf
`MISSING PERSONS
If mestype=2
a=rnd(2)
If a=0 then m1$="HAVE YOU SEEN: "
If a=1 then m1$="MISSING: "
If a=2 then m1$="WANTED: "
ok=1
n1=rnd(99)
fn$=NPCname$(n1,0)
m1$=m1$+fn$
fn$=" "
m1$=m1$+fn$
n1=rnd(99)
fn$=NPCname$(n1,1)
m1$=m1$+fn$
fn$=Select_System(nq)
If msg$(30)="MIFFED"
ok=0
m1$=""
msg$(nq)=""
EndIf
msg$(30)=""
fn$=". "
m1$=m1$+fn$
a=(rnd(10)+1)*50
fn$=str$(a)
m1$=m1$+fn$
fn$="(Cr) Reward."
m1$=m1$+fn$
msg$(nq)=m1$
Goto ENDFUNC
EndIf
`GOODS BOUGHT And SOLD
If mestype=3
a=rnd(2)
nl=0
If a=0
m1$="GOODS BOUGHT AND SOLD:At "
nl=1
EndIf
If a=1 then m1$="TRADE:At "
If a=2 then m1$="GOODS TRADED:At "
ok=1
fn$=""
a=rnd(50)
If a<25 then fn$="honest "
m1$=m1$+fn$
a=rnd(99)
fn$=NPCname$(a,0)
m1$=m1$+fn$

fn$="'s!."
m1$=m1$+fn$
fn$=""
msg$(nq)=m1$
Goto ENDFUNC
EndIf
`SUBSCRIPTIONS
If mestype=4
a=rnd(2)
If a=0 then m1$="SUBSCRIPTION:"
If a=1 then m1$="Subscribe to "
If a=2 then m1$="JOIN MILLIONS: subscribe to "
ok=1
n=rnd(99)
f$=NPCcompany$(n,1)
m1$=m1$+f$
f$=""
a=rnd(3)
If a=0 then f$=" Weekly"
If a=1 then f$=" Fortnightly"
If a=2 then f$=" Monthly"
If a=3 then f$=" Quarterly"
m1$=m1$+f$
msg$(nq)=m1$
Goto ENDFUNC
EndIf
`TRANSPORT REQUIRED
If mestype=5
a=rnd(2)
If a=0 then m1$="TRANSPORT:"
If a=1 then m1$="TRANSPORT REQUIRED:"
If a=2 then m1$="URGENT TRANSPORT:"
If a=2 then urgent=1 Else urgent=0
ok=1
a=rnd(3)
If a=0 then fn$=" Call for details"
If a=1 then fn$=" Click for details"
If a=2 then fn$=" Ask for details"
If a=3 then fn$=" Call for information"
ag$=Select_System(nq)
If msg$(30)="MIFFED" then ok=0
msg$(30)=""
m1$=m1$+fn$
msg$(nq)=m1$
st=Val(msg$(31))
msg$(31)=""
If urgent=0 then mesinfo(nq,3)=(rnd(st)+1)*100 Else mesinfo(nq,3)=(rnd(st)
+1)*250
Goto ENDFUNC
EndIf
`ESCORT WANTED
If mestype=6
a=rnd(2)
If a=0 then m1$="ESCORT WANTED:"
If a=1 then m1$="ESCORT REQUIRED:"
If a=2 then m1$="PROFESSIONAL NEEDED:"
ok=1
a=rnd(3)
If a=0 then fn$=" Call for details"
If a=1 then fn$=" Click for details"

If a=2 then fn$=" Ask for details"


If a=3 then fn$=" Call for mission"
m1$=m1$+fn$
msg$(nq)=m1$
ag$=Select_System(nq)
If msg$(30)="MIFFED" then ok=0
msg$(30)=""
st=Val(msg$(31))
msg$(31)=""
mesinfo(nq,3)=(rnd(st)+1)*1000
Goto ENDFUNC
EndIf
`ASSASINATIONS
If mestype=7
a=rnd(3)
If a=0 then m1$="ASSASSINATION:"
If a=1 then m1$="EARLY RETIREMENT:"
If a=2 then m1$="COMPANY RESTRUCTURING:"
If a=3 then m1$="REMOVAL REQUIRED:"
ok=1
a=rnd(3)
If a=0 then fn$=" Call for details"
If a=1 then fn$=" Click for details"
If a=2 then fn$=" Ask for details"
If a=3 then fn$=" Call for mission"
ag$=Select_System(nq)
If msg$(30)="MIFFED" then ok=0
msg$(30)=""
m1$=m1$+fn$
msg$(nq)=m1$
mesinfo(nq,3)=rnd(10)*10000
Goto ENDFUNC
EndIf
`STEALING MISSIONS
If mestype=8
a=rnd(2)
If a=0 then m1$="RETRIEVAL:"
If a=1 then m1$="AQUIRE:"
If a=2 then m1$="RETRIEVE GOODS:"
ok=1
a=rnd(3)
If a=0 then fn$=" Call for details"
If a=1 then fn$=" Click for details"
If a=2 then fn$=" Ask for details"
If a=3 then fn$=" Call for mission"
ag$=Select_System(nq)
If msg$(30)="MIFFED" then ok=0
msg$(30)=""
mesinfo(nq,3)=rnd(10)*5000
m1$=m1$+fn$
msg$(nq)=m1$
Goto ENDFUNC
EndIf
`DONATIONS (GROVEL)
If mestype=9
a=rnd(2)
If a=0 then m1$="DONATIONS: to help the "
If a=1 then m1$="CASH NEEDED: for the "
If a=2 then m1$="DONATE CASH: to "
nn=rnd(99)

fn$=NPCname$(nn,0)
m1$=m1$+fn$
a=rnd(5)
If a=0 then fn$=" Fund"
If a=1 then fn$=" Foundation"
If a=2 then fn$=" Society"
If a=3 then fn$=" Trust"
If a=4 then fn$=" Institute"
If a=5 then fn$=" Hospital"
m1$=m1$+fn$
ok=1
msg$(nq)=m1$
Goto ENDFUNC
EndIf
`MILITARY (only one per board)
If mestype=10
a=rnd(2)
If a=0 then m1$="MILITARY: we need you for a tour of duty"
If a=1 then m1$="MILITARY: why not sign up, explore the galaxy"
If a=2 then m1$="MILITARY: join up now, we need you"
ok=1
mil=1
msg$(nq)=m1$
Goto ENDFUNC
EndIf
`PASSAGE etc
If mestype=11
a=rnd(1)
If a=0 then m1$="PASSAGE:"
If a=1 then m1$="PASSAGE WANTED:"
ok=1
fn$=Select_System(nq)
If msg$(30)="MIFFED" then ok=0
msg$(30)=""
m1$=m1$+fn$
fn$=" system, "
m1$=m1$+fn$
`st is the RANGE To the system (in sectors)
st=Val(msg$(31))
msg$(31)=""
mt=rnd(7)
If mt=0 then cv=250*st : `To meet a friend
If mt=1 then cv=400*st : `visiting a sick relative
If mt=2 then cv=600*st
If mt=3 then cv=1000*st : `I owe someone money
If mt=4 then cv=2000*st : `I worked As a corporate spy
If mt=5 then cv=2500*st : `The Mafia want me dead
If mt=6 then cv=1800*st : `x has assassins on my trail
If mt=7 then cv=800*st : `I a tax inspector doing my rounds
fn$=str$(cv)
mesinfo(nq,1)=rnd(100)
If mt=2 then mesinfo(nq,2)=1 Else mesinfo(nq,2)=0
mesinfo(nq,3)=cv
mesinfo(nq,4)=rnd(7)+1
mesinfo(nq,5)=mt
m1$=m1$+fn$
fn$="(Cr)"
m1$=m1$+fn$
msg$(nq)=m1$
Goto ENDFUNC

EndIf
ENDFUNC:
`miffed checker
If mestype<0 Or mestype>11 then msg$(nq)=""
If ok<>1 then msg$(nq)=""
Until msg$(nq)<>""
Next nq
EndIf
ENDFUNCTION nm
FUNCTION Promotions()
cm=1
timr=5
Repeat
ok=0
ink RGB(10,10,155),0
box 0,0,10,479
box 0,0,639,50
box 200,0,639,479
box 0,250,211,479
ink RGB(200,200,200),0
text 10,10,"Promotion"
showcredits(12,260)
position object 5400,50002.62,50005,50001.1
rotate object 5400,xr#,yr#,zr#
show object 5400
xr#=xr#+1
If xr#>359 then xr#=xr#-360
yr#=yr#+2
If yr#>359 then yr#=yr#-360
zr#=zr#+1
If zr#>359 then zr#=zr#-360
ink RGB(255,255,255),0
bob 1,MouseX(),MouseY(),2000
text 305,178,"No additional information"
Button(10,450,30,470,1)
text 35,453,"Main Menu"
mx=MouseX()
my=MouseY()
If timr>0 then timr=timr-1
If mouseclick()=1 And timr<=0
If mx>10 And mx<30 And my>450 And my<470 then ok=1
EndIf
sync
Until ok=1
ENDFUNCTION
FUNCTION Subscriptions()
cm=1
timr=5
Repeat
ok=0
ink RGB(10,10,155),0
box 0,0,10,479
box 0,0,639,50
box 200,0,639,479
box 0,250,211,479
ink RGB(200,200,200),0
text 10,10,"Subscriptions"
showcredits(12,260)

position object 5400,50002.62,50005,50001.1


rotate object 5400,xr#,yr#,zr#
show object 5400
xr#=xr#+1
If xr#>359 then xr#=xr#-360
yr#=yr#+2
If yr#>359 then yr#=yr#-360
zr#=zr#+1
If zr#>359 then zr#=zr#-360
ink RGB(255,255,255),0
bob 1,MouseX(),MouseY(),2000
text 305,178,"Check the local news for details"
Button(10,450,30,470,1)
text 35,453,"Main Menu"
mx=MouseX()
my=MouseY()
If timr>0 then timr=timr-1
If mouseclick()=1 And timr<=0
If mx>10 And mx<30 And my>450 And my<470 then ok=1
EndIf
sync
Until ok=1
ENDFUNCTION
FUNCTION Vacancies(mes)
cm=1
timr=5
a=rnd(2)
If a=0 then t$="Hi there im "
If a=1 then t$="Hi im "
If a=2 then t$="Hello, im "
t$=t$+NPCname$(mesinfo(mes,6),0)
a$=" "
t$=t$+a$
t$=t$+NPCname$(mesinfo(mes,7),1)
a$="."
t$=t$+a$
Repeat
ok=0
ink RGB(10,10,155),0
box 0,0,10,479
box 0,0,639,50
box 200,0,639,479
box 0,250,211,479
ink RGB(200,200,200),0
text 10,10,"Job vacancy"
showcredits(12,260)
text 230,50,t$
position object 5400,50002.62,50005,50001.1
rotate object 5400,xr#,yr#,zr#
show object 5400
xr#=xr#+1
If xr#>359 then xr#=xr#-360
yr#=yr#+2
If yr#>359 then yr#=yr#-360
zr#=zr#+1
If zr#>359 then zr#=zr#-360
ink RGB(255,255,255),0
bob 1,MouseX(),MouseY(),2000
Button(230,80,250,100,1)

text 255,83,"Do you have any experience?"


Button(230,101,250,121,1)
text 255,104,"Why do you need this job?"
Button(230,122,250,142,1)
text 255,125,"I will pay you 200(Cr) a week"
Button(230,143,250,163,1)
text 255,146,"I will pay you 150(Cr) a week"
Button(230,164,250,184,1)
text 255,167,"I will pay you 100(Cr) a week"
Button(230,185,250,205,1)
text 255,188,"I will pay you 50(Cr) a week"
Button(230,206,250,226,1)
text 255,209,"I will think about it. Hangup"
Button(230,227,250,247,1)
text 255,230,"Your not what im looking for. Hangup"
Button(230,248,250,268,1)
text 255,251,"Hangup"
mx=MouseX()
my=MouseY()
If timr>0 then timr=timr-1
If mouseclick()=1 And timr<=0
If mx>230 And mx<250 And my>248 And my<268 then ok=1
EndIf
sync
Until ok=1
ENDFUNCTION
FUNCTION Missingperson(mes)
cm=1
timr=5
Repeat
ok=0
ink RGB(10,10,155),0
box 0,0,10,479
box 0,0,639,50
box 200,0,639,479
box 0,250,211,479
ink RGB(200,200,200),0
text 10,10,"Missing Person"
showcredits(12,260)
text 230,50,msg$(mes)
position object 5400,50002.62,50005,50001.1
rotate object 5400,xr#,yr#,zr#
show object 5400
xr#=xr#+1
If xr#>359 then xr#=xr#-360
yr#=yr#+2
If yr#>359 then yr#=yr#-360
zr#=zr#+1
If zr#>359 then zr#=zr#-360
ink RGB(255,255,255),0
bob 1,MouseX(),MouseY(),2000
Button(230,80,250,100,1)
text 255,83,"I have not seen them"
Button(230,101,250,121,1)
text 255,104,"I will help you look for them"
Button(230,122,250,142,1)
text 255,125,"Why do you want them?"
Button(230,143,250,163,1)
text 255,146,"They are onboard my ship!!"

Button(230,164,250,184,1)
text 255,167,"They have an add on this BBS"
Button(230,185,250,205,1)
text 255,188,"Hangup"
mx=MouseX()
my=MouseY()
If timr>0 then timr=timr-1
If mouseclick()=1 And timr<=0
If mx>230 And mx<250 And my>185 And my<205 then ok=1
EndIf
sync
Until ok=1
ENDFUNCTION
FUNCTION BlackMarket()
cm=1
timr=5
Repeat
ok=0
ink RGB(10,10,155),0
box 0,0,10,479
box 0,0,639,50
box 200,0,639,479
box 0,250,211,479
ink RGB(200,200,200),0
text 10,10,"Goods Bought and Sold"
showcredits(12,260)
text 230,50,"We need the following goods"
position object 5400,50002.62,50005,50001.1
rotate object 5400,xr#,yr#,zr#
show object 5400
xr#=xr#+1
If xr#>359 then xr#=xr#-360
yr#=yr#+2
If yr#>359 then yr#=yr#-360
zr#=zr#+1
If zr#>359 then zr#=zr#-360
ink RGB(255,255,255),0
bob 1,MouseX(),MouseY(),2000
Button(230,80,250,100,1)
text 255,83,"Narcotics"
Button(230,101,250,121,1)
text 255,104,"Firearms"
Button(230,122,250,142,1)
text 255,125,"Slaves"
Button(230,143,250,163,1)
text 255,146,"Explosives"
Button(230,164,250,184,1)
text 255,167,"Alien Items"
Button(230,185,250,205,1)
text 255,188,"Radioactives"
Button(230,206,250,226,1)
text 255,209,"Battle Weapons"
Button(230,227,250,247,1)
text 255,230,"Antiques"
Button(230,248,250,268,1)
text 255,251,"Hangup"
mx=MouseX()
my=MouseY()
If timr>0 then timr=timr-1

If mouseclick()=1 And timr<=0


If mx>230 And mx<250 And my>248 And my<268 then ok=1
EndIf
sync
Until ok=1
ENDFUNCTION
FUNCTION Transport(mes)
cm=1
timr=5
tm$=""
a=rnd(4)
If a=0 then tm$="We would like you to transport goods to "
If a=1 then tm$="All we want is someone to transport goods to "
If a=2 then tm$="Take some goods to "
If a=3 then tm$="Will you transport good to "
If a=4 then tm$="We need you to transport good to "
tm$=tm$+mesinfoname$(mes)
tm$=tm$+" ["
tm$=tm$+str$(mesinfo(mes,11))
tm$=tm$+","
tm$=tm$+str$(mesinfo(mes,12))
tm$=tm$+"]."
tm2$="We are offering "
tm2$=tm2$+str$(mesinfo(mes,3))
tm2$=tm2$+"(Cr)."
Repeat
ok=0
ink RGB(10,10,155),0
box 0,0,10,479
box 0,0,639,50
box 200,0,639,479
box 0,250,211,479
ink RGB(200,200,200),0
text 10,10,"Transport items"
showcredits(12,260)
text 230,30,tm$
text 230,46,tm2$
position object 5400,50002.62,50005,50001.1
rotate object 5400,xr#,yr#,zr#
show object 5400
xr#=xr#+1
If xr#>359 then xr#=xr#-360
yr#=yr#+2
If yr#>359 then yr#=yr#-360
zr#=zr#+1
If zr#>359 then zr#=zr#-360
ink RGB(255,255,255),0
bob 1,MouseX(),MouseY(),2000
Button(230,80,250,100,1)
text 255,83,"Where are the good now"
Button(230,101,250,121,1)
text 255,104,"What are the goods"
Button(230,122,250,142,1)
text 255,125,"When must the goods be delivered"
Button(230,143,250,163,1)
text 255,146,"What risks are involved"
Button(230,164,250,184,1)
text 255,167,"I want more money"
Button(230,185,250,205,1)

text 255,188,"Ok, agreed"


Button(230,206,250,226,1)
text 255,209,"Hangup"
mx=MouseX()
my=MouseY()
If timr>0 then timr=timr-1
If mouseclick()=1 And timr<=0
If mx>230 And mx<250 And my>206 And my<226 then ok=1
EndIf
sync
Until ok=1
ENDFUNCTION
FUNCTION Escort(mes)
cm=1
timr=5
tm$=""
a=rnd(2)
If a=0 then tm$="We want you to escort one of our "
If a=1 then tm$="All we want is you to escort a "
If a=2 then tm$="Escort one of our to "
a=rnd(3)
If a=0 then tm$=tm$+"shuttles to "
If a=1 then tm$=tm$+"transports to "
If a=2 then tm$=tm$+"employees to "
If a=3 then tm$=tm$+"associates to "
tm$=tm$+mesinfoname$(mes)
tm$=tm$+" ["
tm$=tm$+str$(mesinfo(mes,11))
tm$=tm$+","
tm$=tm$+str$(mesinfo(mes,12))
tm$=tm$+"]."
tm2$="We are offering "
tm2$=tm2$+str$(mesinfo(mes,3))
tm2$=tm2$+"(Cr)."
Repeat
ok=0
ink RGB(10,10,155),0
box 0,0,10,479
box 0,0,639,50
box 200,0,639,479
box 0,250,211,479
ink RGB(200,200,200),0
text 10,10,"Escort mission"
showcredits(12,260)
text 230,30,tm$
text 230,46,tm2$
position object 5400,50002.62,50005,50001.1
rotate object 5400,xr#,yr#,zr#
show object 5400
xr#=xr#+1
If xr#>359 then xr#=xr#-360
yr#=yr#+2
If yr#>359 then yr#=yr#-360
zr#=zr#+1
If zr#>359 then zr#=zr#-360
ink RGB(255,255,255),0
bob 1,MouseX(),MouseY(),2000
Button(230,80,250,100,1)
text 255,83,"Where are they now"

Button(230,101,250,121,1)
text 255,104,"Is the ship armed"
Button(230,122,250,142,1)
text 255,125,"When must they get there"
Button(230,143,250,163,1)
text 255,146,"What risks are involved"
Button(230,164,250,184,1)
text 255,167,"I want more money"
Button(230,185,250,205,1)
text 255,188,"Ok, agreed"
Button(230,206,250,226,1)
text 255,209,"Hangup"
mx=MouseX()
my=MouseY()
If timr>0 then timr=timr-1
If mouseclick()=1 And timr<=0
If mx>230 And mx<250 And my>206 And my<226 then ok=1
EndIf
sync
Until ok=1
ENDFUNCTION
FUNCTION Assasin(mes)
cm=1
timr=5
tm$=""
a=rnd(2)
If a=0 then tm$="We want you to remove one of our "
If a=1 then tm$="All we want is you to retire our "
If a=2 then tm$="Assasinate one of our "
a=rnd(3)
If a=0 then tm$=tm$+"competitors"
If a=1 then tm$=tm$+"directors"
If a=2 then tm$=tm$+"employees"
If a=3 then tm$=tm$+"associates"
tm$=tm$+" in "
tm2$=mesinfoname$(mes)
tm2$=tm2$+" ["
tm2$=tm2$+str$(mesinfo(mes,11))
tm2$=tm2$+","
tm2$=tm2$+str$(mesinfo(mes,12))
tm2$=tm2$+"]."
tm2$=tm2$+"We are offering "
tm2$=tm2$+str$(mesinfo(mes,3))
tm2$=tm2$+"(Cr)."
Repeat
ok=0
ink RGB(10,10,155),0
box 0,0,10,479
box 0,0,639,50
box 200,0,639,479
box 0,250,211,479
ink RGB(200,200,200),0
text 10,10,"Assasination mission"
showcredits(12,260)
text 230,30,tm$
text 230,46,tm2$
position object 5400,50002.62,50005,50001.1
rotate object 5400,xr#,yr#,zr#
show object 5400

xr#=xr#+1
If xr#>359 then xr#=xr#-360
yr#=yr#+2
If yr#>359 then yr#=yr#-360
zr#=zr#+1
If zr#>359 then zr#=zr#-360
ink RGB(255,255,255),0
bob 1,MouseX(),MouseY(),2000
Button(230,80,250,100,1)
text 255,83,"When must this be carried out"
Button(230,101,250,121,1)
text 255,104,"What ship will they be travelling on"
Button(230,122,250,142,1)
text 255,125,"What sort of arms does the ship have"
Button(230,143,250,163,1)
text 255,146,"What risks are involved"
Button(230,164,250,184,1)
text 255,167,"I want more money"
Button(230,185,250,205,1)
text 255,188,"Ok, agreed"
Button(230,206,250,226,1)
text 255,209,"Hangup"
mx=MouseX()
my=MouseY()
If timr>0 then timr=timr-1
If mouseclick()=1 And timr<=0
If mx>230 And mx<250 And my>206 And my<226 then ok=1
EndIf
sync
Until ok=1
ENDFUNCTION
FUNCTION Aquire(mes)
cm=1
timr=5
tm$=""
a=rnd(2)
If a=0 then tm$="We want you to retrieve a "
If a=1 then tm$="All we want is you to steal a "
If a=2 then tm$="steal a "
a=rnd(3)
If a=0 then tm$=tm$+"prototype from "
If a=1 then tm$=tm$+"chemical from "
If a=2 then tm$=tm$+"weapon design from "
If a=3 then tm$=tm$+"document from "
tm$=tm$+mesinfoname$(mes)
tm$=tm$+" ["
tm$=tm$+str$(mesinfo(mes,11))
tm$=tm$+","
tm$=tm$+str$(mesinfo(mes,12))
tm$=tm$+"]."
tm2$="We are offering "
tm2$=tm2$+str$(mesinfo(mes,3))
tm2$=tm2$+"(Cr)."
Repeat
ok=0
ink RGB(10,10,155),0
box 0,0,10,479
box 0,0,639,50
box 200,0,639,479

box 0,250,211,479
ink RGB(200,200,200),0
text 10,10,"Aquire mission"
showcredits(12,260)
text 230,30,tm$
text 230,46,tm2$
position object 5400,50002.62,50005,50001.1
rotate object 5400,xr#,yr#,zr#
show object 5400
xr#=xr#+1
If xr#>359 then xr#=xr#-360
yr#=yr#+2
If yr#>359 then yr#=yr#-360
zr#=zr#+1
If zr#>359 then zr#=zr#-360
ink RGB(255,255,255),0
bob 1,MouseX(),MouseY(),2000
Button(230,80,250,100,1)
text 255,83,"Where is the item now"
Button(230,101,250,121,1)
text 255,104,"What is in the package"
Button(230,122,250,142,1)
text 255,125,"When must the goods be delivered"
Button(230,143,250,163,1)
text 255,146,"What risks are involved"
Button(230,164,250,184,1)
text 255,167,"I want more money"
Button(230,185,250,205,1)
text 255,188,"Ok, agreed"
Button(230,206,250,226,1)
text 255,209,"Hangup"
mx=MouseX()
my=MouseY()
If timr>0 then timr=timr-1
If mouseclick()=1 And timr<=0
If mx>230 And mx<250 And my>206 And my<226 then ok=1
EndIf
sync
Until ok=1
ENDFUNCTION
FUNCTION Donations(mes)
cm=1
timr=5
tm$=""
Repeat
ok=0
ink RGB(10,10,155),0
box 0,0,10,479
box 0,0,639,50
box 200,0,639,479
box 0,250,211,479
ink RGB(200,200,200),0
text 10,10,"Donations"
showcredits(12,260)
text 230,50,msg$(mes)
position object 5400,50002.62,50005,50001.1
rotate object 5400,xr#,yr#,zr#
show object 5400
xr#=xr#+1

If xr#>359 then xr#=xr#-360


yr#=yr#+2
If yr#>359 then yr#=yr#-360
zr#=zr#+1
If zr#>359 then zr#=zr#-360
ink RGB(255,255,255),0
bob 1,MouseX(),MouseY(),2000
Button(230,80,250,100,1)
text 255,83,"Donate 1(Cr)"
Button(230,101,250,121,1)
text 255,104,"Donate 10(Cr)"
Button(230,122,250,142,1)
text 255,125,"Donate 100(Cr)"
Button(230,143,250,163,1)
text 255,146,"Donate 1000(Cr)"
Button(230,164,250,184,1)
text 255,167,"Donate 10000(Cr)"
Button(230,185,250,205,1)
text 255,188,"Hangup"
mx=MouseX()
my=MouseY()
If timr>0 then timr=timr-1
If mouseclick()=1 And timr<=0
If mx>230 And mx<250 And my>185 And my<205 then ok=1
EndIf
sync
Until ok=1
ENDFUNCTION
FUNCTION Military(mes)
cm=1
timr=5
tm$=""
Repeat
ok=0
ink RGB(10,10,155),0
box 0,0,10,479
box 0,0,639,50
box 200,0,639,479
box 0,250,211,479
ink RGB(200,200,200),0
text 10,10,"Military missions"
showcredits(12,260)
text 230,50,msg$(mes)
position object 5400,50002.62,50005,50001.1
rotate object 5400,xr#,yr#,zr#
show object 5400
xr#=xr#+1
If xr#>359 then xr#=xr#-360
yr#=yr#+2
If yr#>359 then yr#=yr#-360
zr#=zr#+1
If zr#>359 then zr#=zr#-360
ink RGB(255,255,255),0
bob 1,MouseX(),MouseY(),2000
Button(230,185,250,205,1)
text 255,188,"Hangup"
mx=MouseX()
my=MouseY()
If timr>0 then timr=timr-1

If mouseclick()=1 And timr<=0


If mx>230 And mx<250 And my>185 And my<205 then ok=1
EndIf
sync
Until ok=1
ENDFUNCTION
FUNCTION Passage(mes)
cm=1
timr=5
tm$=""
a=rnd(2)
If a=0 then tm$="We want to go to "
If a=1 then tm$="Will you take us to "
If a=2 then tm$="We wish to travel to "
tm$=tm$+mesinfoname$(mes)
tm$=tm$+" ["
tm$=tm$+str$(mesinfo(mes,11))
tm$=tm$+","
tm$=tm$+str$(mesinfo(mes,12))
tm$=tm$+"]."
tm2$="We are offering "
tm2$=tm2$+str$(mesinfo(mes,3))
tm2$=tm2$+"(Cr)."
Repeat
ok=0
ink RGB(10,10,155),0
box 0,0,10,479
box 0,0,639,50
box 200,0,639,479
box 0,250,211,479
ink RGB(200,200,200),0
text 10,10,"Passage required"
showcredits(12,260)
text 230,30,tm$
text 230,46,tm2$
position object 5400,50002.62,50005,50001.1
rotate object 5400,xr#,yr#,zr#
show object 5400
xr#=xr#+1
If xr#>359 then xr#=xr#-360
yr#=yr#+2
If yr#>359 then yr#=yr#-360
zr#=zr#+1
If zr#>359 then zr#=zr#-360
ink RGB(255,255,255),0
bob 1,MouseX(),MouseY(),2000
Button(230,80,250,100,1)
text 255,83,"How many of you are there"
Button(230,101,250,121,1)
text 255,104,"When must you be there"
Button(230,122,250,142,1)
text 255,125,"Do I need any special documentation"
Button(230,143,250,163,1)
text 255,146,"What risk is involved"
Button(230,164,250,184,1)
text 255,167,"I want more money"
Button(230,185,250,205,1)
text 255,188,"Ok, agreed"
Button(230,206,250,226,1)

text 255,209,"Hangup"
mx=MouseX()
my=MouseY()
If timr>0 then timr=timr-1
If mouseclick()=1 And timr<=0
If mx>230 And mx<250 And my>206 And my<226 then ok=1
EndIf
sync
Until ok=1
ENDFUNCTION
FUNCTION BBS(nom)
timr=50
cm=0
Repeat
ok=0
ink RGB(10,10,155),0
box 0,0,10,479
box 0,0,639,50
box 200,0,639,479
box 0,250,211,479
ink RGB(200,200,200),0
text 10,10,"Bulletin Board System"
showcredits(12,260)
position object 5400,50002.62,50005,50001.1
rotate object 5400,xr#,yr#,zr#
show object 5400
xr#=xr#+1
If xr#>359 then xr#=xr#-360
yr#=yr#+2
If yr#>359 then yr#=yr#-360
zr#=zr#+1
If zr#>359 then zr#=zr#-360
ink RGB(255,255,255),0
If nom>0
bx=230
by=50
cur=cm
Repeat
Button(bx,by,bx+19,by+19,1)
text bx+24,by+3,msg$(cur)
by=by+20
cur=cur+1
Until cur>cm+16 Or cur>nom
text 305,20,str$(nom+1)
text 325,20,"messages posted"
If cm>1
Button(260,400,280,420,1)
text 285,403,"Previous"
EndIf
If nom>6 And cm+16<nom
Button(260,430,280,450,1)
text 285,433,"Next"
EndIf
Button(10,450,30,470,1)
text 35,453,"Main Menu"
Else
text 305,178,"No messages posted"
Button(10,450,30,470,1)
text 35,453,"Main Menu"

EndIf
bob 1,MouseX(),MouseY(),2000
mx=MouseX()
my=MouseY()
If timr>0 then timr=timr-1
If mouseclick()=1 And timr<=0
If mx>10 And mx<30 And my>450 And my<470 then ok=1
If mx>230 And mx<250 And my>50 And my<390
mc=(my-50)/20
mc=mc+cm
If mesinfo(mc,0)<>-1
If mesinfo(mc,0)=0 then Promotions()
If mesinfo(mc,0)=1 then Vacancies(mc)
If mesinfo(mc,0)=2 then Missingperson(mc)
If mesinfo(mc,0)=3 then Blackmarket()
If mesinfo(mc,0)=4 then Subscriptions()
If mesinfo(mc,0)=5 then Transport(mc)
If mesinfo(mc,0)=6 then Escort(mc)
If mesinfo(mc,0)=7 then Assasin(mc)
If mesinfo(mc,0)=8 then Aquire(mc)
If mesinfo(mc,0)=9 then Donations(mc)
If mesinfo(mc,0)=10 then military(mc)
If mesinfo(mc,0)=11 then passage(mc)
EndIf
EndIf
If mx>260 And mx<280
If my>400 And my<420
If cm>1 then cm=cm-1
EndIf
If my>430 And my<450
If cm+16<nom then cm=cm+1
EndIf
EndIf
EndIf
sync
Until ok=1
ENDFUNCTION
FUNCTION PoliceBBS()
cm=1
Repeat
ok=0
ink RGB(10,10,155),0
box 0,0,10,479
box 0,0,639,50
box 200,0,639,479
box 0,250,211,479
ink RGB(200,200,200),0
text 10,10,"Local Police Agency"
showcredits(12,260)
position object 5400,50002.62,50005,50001.1
rotate object 5400,xr#,yr#,zr#
show object 5400
xr#=xr#+1
If xr#>359 then xr#=xr#-360
yr#=yr#+2
If yr#>359 then yr#=yr#-360
zr#=zr#+1
If zr#>359 then zr#=zr#-360
ink RGB(255,255,255),0

bob 1,MouseX(),MouseY(),2000
text 305,178,"No bounties posted"
Button(10,450,30,470,1)
text 35,453,"Main Menu"
mx=MouseX()
my=MouseY()
If mouseclick()=1
If mx>10 And mx<30 And my>450 And my<470 then ok=1
EndIf
sync
Until ok=1
ENDFUNCTION
FUNCTION GNS(seed)
Dim nstr$(300)
randomize seed
`ni news items
ni=rnd(5)+1
`cl=current line
cl=0
For num=0 To ni
`nit = news item type
If cl<95 then nit=rnd(14) Else nit=-1
If nit=0
`exports increasing
a=rnd(2)
If a=0 then a$="Exports of "
If a=1 then a$="Exports of our famous "
If a=2 then a$="Our famous export "
vl=sysinfo(3)
If vl=0 then vl=rnd(21)
If vl=0 then a$=a$+"fine wines" Else
If vl=1 then a$=a$+"sculptures" Else
If vl=2 then a$=a$+"luxuries" Else
If vl=3 then a$=a$+"pets" Else
If vl=4 then a$=a$+"ritual guides" Else
If vl=5 then a$=a$+"fine jewelery" Else
If vl=6 then a$=a$+"postcards" Else
If vl=7 then a$=a$+"merchandise" Else
If vl=8 then a$=a$+"gambling implements" Else
If vl=9 then a$=a$+"liquor" Else
If vl=10 then a$=a$+"entertainment media" Else
If vl=11 then a$=a$+"servants" Else
If vl=12 then a$=a$+"architects" Else
If vl=13 then a$=a$+"goods" Else
If vl=14 then a$=a$+"sports equipment" Else
If vl=15 then a$=a$+"media" Else
If vl=16 then a$=a$+"books" Else
If vl=17 then a$=a$+"medicines" Else
If vl=18 then a$=a$+"sports equipment" Else
If vl=19 then a$=a$+"holovids" Else
If vl=20 then a$=a$+"brochures" Else
If vl=21 then a$=a$+"crystal products" Else
If vl<0 Or vl>21 then a$=a$+"masterpieces"
a=rnd(2)
If a=0 then a$=a$+" increased today after"
If a=1 then a$=a$+" is on the increase after"
If a=2 then a$=a$+" is up after "
nstr$(cl)=a$
cl=cl+1

a$=""
cb=rnd(99)
a$=NPCcompany$(cb,0)
a$=a$+" "
cb=rnd(99)
a$=a$+npccompany$(cb,2)
a=rnd(3)
If a=0 then a$=a$+" changed thier"
If a=1 then a$=a$+" streamlined thier"
If a=2 then a$=a$+" altered the"
If a=3 then a$=a$+" changed the"
a=rnd(3)
If a=0 then a$=a$+" production methods,"
If a=1 then a$=a$+" design strategy,"
If a=2 then a$=a$+" advertising method,"
If a=3 then a$=a$+" pricing strategy,"
nstr$(cl)=a$
cl=cl+1
a$="the company said '"
a=rnd(3)
If a=0 then a$=a$+"we should have done it long ago'."
If a=1 then a$=a$+"it was a good idea at this time'."
If a=2 then a$=a$+"were very happy with the result'."
If a=3 then a$=a$+"buy our product its the best!!!'."
nstr$(cl)=a$
cl=cl+1
cl=cl+1
EndIf
If nit=1
`War against smuggling Or crime
a=rnd(2)
If a=0 then a$="The Galactic Police Agency "
If a=1 then a$="The Galactic Police Service "
If a=2 then a$="The Police Federation "
a=rnd(2)
If a=0 then a$=a$+"increased thier "
If a=1 then a$=a$+"stepped up thier "
If a=2 then a$=a$+"moved up thier "
nstr$(cl)=a$
cl=cl+1
a=rnd(3)
If a=0 then a$="war against "
If a=1 then a$="confict against "
If a=2 then a$="capture of "
If a=3 then a$="arrests of "
a=rnd(3)
If a=0 then a$=a$+"known pirates today,"
If a=1 then a$=a$+"corrupt police officials today,"
If a=2 then a$=a$+"known terrorists today,"
If a=3 then a$=a$+"illegal traders today,"
nstr$(cl)=a$
cl=cl+1
a$="after there were renewed calls for "
a=rnd(3)
If a=0 then a$=a$+"zero tolerance."
If a=1 then a$=a$+"stiffer sentences."
If a=2 then a$=a$+"public executions."
If a=3 then a$=a$+"an inquiry."
nstr$(cl)=a$

cl=cl+1
a=rnd(3)
a$="A Police official said '"
If a=0 then a$=a$+"we can only follow the law'."
If a=1 then a$=a$+"these people will suffer'."
If a=2 then a$=a$+"we need more policing'."
If a=3 then a$=a$+"we need the publicity'."
nstr$(cl)=a$
cl=cl+1
cl=cl+1
EndIf
If nit=2
`Prosecutions
a=rnd(2)
If a=0 then a$="An Official of "
If a=1 then a$="An Employee of "
If a=2 then a$="An Agent for "
a=rnd(99)
a$=a$+NPCcompany$(a,0)
a$=a$+" "
a=rnd(1000)
If a<100
a$=a$+NPCcompany$(a,1)
a$=a$+" "
EndIf
a=rnd(99)
a$=a$+NPCcompany$(a,2)
a$=a$+","
nstr$(cl)=a$
cl=cl+1
a=rnd(4)
If a=0 then a$="was prosecuted today for "
If a=1 then a$="was in the dock today for "
If a=2 then a$="was sent to prison today for "
If a=3 then a$="was executed today for "
If a=4 then a$="was sentenced today for "
a=rnd(14)
If a=0 then a$=a$+"'drug smuggling'."
If a=1 then a$=a$+"'money laudering'."
If a=2 then a$=a$+"'piracy'."
If a=3 then a$=a$+"'murder'."
If a=4 then a$=a$+"'fraud'."
If a=5 then a$=a$+"'breach of contract'."
If a=6 then a$=a$+"'attempted murder'."
If a=7 then a$=a$+"'kidnapping'."
If a=8 then a$=a$+"'robbery'."
If a=9 then a$=a$+"'theft'."
If a=10 then a$=a$+"'gunrunning'."
If a=11 then a$=a$+"'arson'."
If a=12 then a$=a$+"'hunting'."
If a=13 then a$=a$+"'corruption'."
If a=14 then a$=a$+"'Terrorism'."
nstr$(cl)=a$
cl=cl+1
a=rnd(5)
If a=0 then a$="The company will fight the ruling."
If a=1 then a$="The judge said 'Nobody is beyond the law'."
If a=2 then a$="'were shocked' said one official."
If a=3 then a$="The company has set up an investigation."

If a=4 then a$="The company refused to comment."


If a=5 then a$="'no comment' said the company official."
nstr$(cl)=a$
cl=cl+1
cl=cl+1
EndIf
If nit=3
`Latest arrests
a=rnd(2)
If a=0 then a$="An Official of "
If a=1 then a$="An Employee of "
If a=2 then a$="An Agent for "
a=rnd(99)
a$=a$+NPCcompany$(a,0)
a$=a$+" "
a=rnd(1000)
If a<100
a$=a$+NPCcompany$(a,1)
a$=a$+" "
EndIf
a=rnd(99)
a$=a$+NPCcompany$(a,2)
a$=a$+","
nstr$(cl)=a$
cl=cl+1
a=rnd(3)
If a=0 then a$="was arrested today for "
If a=1 then a$="was caught today for "
If a=2 then a$="was detained today for "
If a=3 then a$="was held today for "
a=rnd(14)
If a=0 then a$=a$+"'drug smuggling'."
If a=1 then a$=a$+"'money laudering'."
If a=2 then a$=a$+"'piracy'."
If a=3 then a$=a$+"'murder'."
If a=4 then a$=a$+"'fraud'."
If a=5 then a$=a$+"'breach of contract'."
If a=6 then a$=a$+"'attempted murder'."
If a=7 then a$=a$+"'kidnapping'."
If a=8 then a$=a$+"'robbery'."
If a=9 then a$=a$+"'theft'."
If a=10 then a$=a$+"'gunrunning'."
If a=11 then a$=a$+"'arson'."
If a=12 then a$=a$+"'hunting'."
If a=13 then a$=a$+"'corruption'."
If a=14 then a$=a$+"'Terrorism'."
nstr$(cl)=a$
cl=cl+1
a=rnd(5)
If a=0 then a$="The company is said to be shocked."
If a=1 then a$="The company has now set up a screening process."
If a=2 then a$="'were shocked' said one official."
If a=3 then a$="The company has set up an investigation."
If a=4 then a$="The company refused to comment."
If a=5 then a$="'no comment' said the company official."
nstr$(cl)=a$
cl=cl+1
cl=cl+1
EndIf

If nit=4
`Deaths of someone famous
a=rnd(1)
If a=0 then a$="We are saddened today to report the death of "
If a=1 then a$="Join us in our sorrow for the family of "
nstr$(cl)=a$
cl=cl+1
a=rnd(4)
If a=0 then a$="the famous star "
If a=1 then a$="the famous film star "
If a=2 then a$="the famous sports star "
If a=3 then a$="the famous pioneer "
If a=4 then a$="the famous explorer "
a=rnd(99)
a$=a$+NPCname$(a,0)
a$=a$+" "
a=rnd(99)
a$=a$+NPCname$(a,1)
a=rnd(1)
If a=0 then a$=a$+" who died today."
If a=1 then a$=a$+" who died yesterday."
nstr$(cl)=a$
cl=cl+1
cl=cl+1
EndIf
If nit=5
`Galactic wars
race1=rnd(10)
Repeat
race2=rnd(10)
Until race2<>race1
a=rnd(3)
If a=0 then a$="There has been renewed fighting between the"
If a=1 then a$="War has broken out again between the"
If a=2 then a$="More fighting between rebel factions of the"
If a=3 then a$="More conflict yesterday between the"
nstr$(cl)=a$
cl=cl+1
If race1=0 then a$="Phargoyde Alliance"
If race1=1 then a$="Terran Defence Force"
If race1=2 then a$="Tesserak High Council"
If race1=3 then a$="Allmock Rebel Alliance"
If race1=4 then a$="Siex"
If race1=5 then a$="Allheck Empire"
If race1=6 then a$="Varzing"
If race1=7 then a$="Q-Tie"
If race1=8 then a$="Mysterious 'Quadrill'"
If race1=9 then a$="Terran Special Forces"
If race1=10 then a$="Mechs"
a$=a$+" and the "
If race2=0 then a$=a$+"Phargoyde Alliance,"
If race2=1 then a$=a$+"Terran Defence Force,"
If race2=2 then a$=a$+"Tesserak High Council,"
If race2=3 then a$=a$+"Allmock Rebel Alliance,"
If race2=4 then a$=a$+"Siex,"
If race2=5 then a$=a$+"Allheck Empire,"
If race2=6 then a$=a$+"Varzing,"
If race2=7 then a$=a$+"Q-Tie,"

If race2=8 then a$=a$+"mysterious 'Quadrill',"


If race2=9 then a$=a$+"Terran Special Forces,"
If race2=10 then a$=a$+"Mechs"
nstr$(cl)=a$
cl=cl+1
a=rnd(1)
If race1<>8 And race2<>8
If a=0 then a$="Will these wars never end."
If a=1 then a$="The price of peace is war."
Else
If a=0 then a$="Who are these mysterious Quadrill anyway??"
If a=1 then a$="The mysterious Quadrill make another appearance"
EndIf
nstr$(cl)=a$
cl=cl+1
cl=cl+1
EndIf
If nit=6
`Terrorist activity
a$="Terrorists destroyed a "
a=rnd(5)
If a=0 then a$=a$+"processing plant "
If a=1 then a$=a$+"data core "
If a=2 then a$=a$+"refuelling depot "
If a=3 then a$=a$+"warehouse "
If a=4 then a$=a$+"packaging center "
If a=5 then a$=a$+"recycling plant "
a$=a$+"belonging to"
nstr$(cl)=a$
cl=cl+1
a=rnd(99)
a$=npccompany$(a,0)
a$=a$+" "
a=rnd(1000)
If a<100
a$=a$+npccompany$(a,1)
a$=a$+" "
EndIf
a=rnd(99)
a$=a$+npccompany$(a,2)
a$=a$+" "
a=rnd(2)
If a=0 then a$=a$+"a company official said"
If a=1 then a$=a$+"a representative said"
If a=2 then a$=a$+"a police official said"
nstr$(cl)=a$
cl=cl+1
a=rnd(4)
If a=0 then a$="'we are shocked, this never happens here'"
If a=1 then a$="'we will bring these people to justice'"
If a=2 then a$="'why attack this company'"
If a=3 then a$="'we will investigate this fully'"
If a=4 then a$="'we are starting an investigation'"
nstr$(cl)=a$
cl=cl+1
cl=cl+1
EndIf
If nit=7

`Information on celebrity activity


a=rnd(99)
a$=npcname$(a,0)
a$=a$+" "
a=rnd(99)
a$=a$+npcname$(a,1)
a$=a$+" the famous "
a=rnd(5)
If a=0 then a$=a$+"singer "
If a=1 then a$=a$+"performer "
If a=2 then a$=a$+"pioneer "
If a=3 then a$=a$+"explorer "
If a=4 then a$=a$+"representative "
If a=5 then a$=a$+"politician "
a=rnd(2)
If a=0 then a$=a$+"will be at the"
If a=1 then a$=a$+"will be attending the"
If a=2 then a$=a$+"will be here at the"
nstr$(cl)=a$
cl=cl+1
a=rnd(99)
a$=npccompany$(a,0)
a$=a$+" "
a=rnd(1000)
If a<100
a$=a$+npccompany$(a,1)
a$=a$+" "
EndIf
a=rnd(99)
a$=a$+npccompany$(a,2)
a$=a$+" "
a=rnd(5)
If a=0 then a$=a$+"gala "
If a=1 then a$=a$+"festival "
If a=2 then a$=a$+"training center "
If a=3 then a$=a$+"college "
If a=4 then a$=a$+"carnival "
If a=5 then a$=a$+"party "
a=rnd(1)
If a=0 then a$=a$+"today"
If a=1 then a$=a$+"tomorrow"
nstr$(cl)=a$
cl=cl+1
a=rnd(2)
If a=0 then a$="Its nice to see celebs socialising with us"
If a=1 then a$="Come down and join us in the celebrations"
If a=2 then a$="Join us in welcoming this famous celebrity"
nstr$(cl)=a$
cl=cl+1
cl=cl+1
EndIf
If nit=8
`Mysterious appearances
a=rnd(2)
If a=0 then a$="There has been another appearance of the race"
If a=1 then a$="Another sighting of the yet unknown race"
If a=2 then a$="Yet another sighting of the unknown race"
nstr$(cl)=a$
cl=cl+1

a$="called the 'Quadrill', "


a=rnd(2)
If a=0 then a$=a$+"little is known about"
If a=1 then a$=a$+"we know nothing about"
If a=2 then a$=a$+"noone knows about"
nstr$(cl)=a$
cl=cl+1
a=rnd(2)
If a=0 then a$="this strange race!"
If a=1 then a$="this race, where they come from or go to!"
If a=2 then a$="this mysterious race!"
nstr$(cl)=a$
cl=cl+1
cl=cl+1
EndIf
If nit=9
`ghost ships
a$="A ship belonging to the "
race2=rnd(9)
If race2=0 then a$=a$+"Phargoyde Alliance"
If race2=1 then a$=a$+"Terran Defence Force"
If race2=2 then a$=a$+"Tesserak High Council"
If race2=3 then a$=a$+"Allmock Rebel Alliance"
If race2=4 then a$=a$+"Siex"
If race2=5 then a$=a$+"Allheck Empire"
If race2=6 then a$=a$+"Varzing"
If race2=7 then a$=a$+"Q-Tie"
If race2=8 then a$=a$+"Terran Special Forces"
If race2=9 then a$=a$+"Mechs"
a$=a$+" was found"
nstr$(cl)=a$
cl=cl+1
a=rnd(1)
If a=0 then a$="yesterday, "
If a=1 then a$="today, "
a=rnd(2)
If a=0 then a$=a$+"however the ship was deserted."
If a=1 then a$=a$+"the ship had no signs of life aboard."
If a=2 then a$=a$+"there was nobody aboard at all."
nstr$(cl)=a$
cl=cl+1
a=rnd(4)
If a=0 then a$="This is another mystery which will never be solved"
If a=1 then a$="the ship is intact, no signs of a struggle either"
If a=2 then a$="nobody used any escape pods, hell they just disappeared"
If a=3 then a$="The ship has been taken by the military for analysis."
If a=4 then a$="Was this anything to do with the Quadrill"
nstr$(cl)=a$
cl=cl+1
cl=cl+1
EndIf
If nit=10
`strange phenomenon
a$="With the appearance of the Quadrill we have had serveral"
nstr$(cl)=a$
cl=cl+1
a=rnd(1)
If a=0 then a$="incidents, yesterday "

If a=1 then a$="incidents, today "


a$=a$+"we had "
a=rnd(4)
If a=0 then a$=a$+"people disappear "
If a=1 then a$=a$+"vehicles disappear "
If a=2 then a$=a$+"items disappear "
If a=3 then a$=a$+"cargo disappear "
If a=4 then a$=a$+"artifacts disappear "
a$=a$+"before our"
nstr$(cl)=a$
cl=cl+1
a$="very eyes. "
a=rnd(3)
If a=0 then a$=a$+"Are they only information gathering, or what?"
If a=1 then a$=a$+"Are they trying to stop us locating them?"
If a=2 then a$=a$+"Are they stopping us learning about them?"
If a=3 then a$=a$+"They seem to be interested in all of us!!!"
nstr$(cl)=a$
cl=cl+1
cl=cl+1
EndIf
If nit=11
`solar activity
a=rnd(1)
If a=0 then a$="Yesterday we saw " Else a$="Today we saw "
a=rnd(3)
If a=0 then a$=a$+"a bright colorful solar flare,"
If a=1 then a$=a$+"a supernova in a distant galaxy,"
If a=2 then a$=a$+"a colorful comet entering our system,"
If a=3 then a$=a$+"a meteor entering our system,"
nstr$(cl)=a$
cl=cl+1
a=rnd(3)
If a=0 then a$="scientists are clammering to get information."
If a=1 then a$="the science community is excited about this."
If a=2 then a$="scientists are already examining the data."
If a=3 then a$="the data is being examined as we speak."
nstr$(cl)=a$
cl=cl+1
a=rnd(3)
If a=0 then a$="With the latest computers is there nothing we cant do!"
If a=1 then a$="This will happen again, but it could be ages!"
If a=2 then a$="The more information we get, the less work we have to do!"
If a=3 then a$="This is the find of the day!!!"
nstr$(cl)=a$
cl=cl+1
cl=cl+1
EndIf
If nit=12
`medical news
i=rnd(1)
If i=0
a$="OUTBREAK: of "
a=rnd(9)
If a=0 then a$=a$+"an unknown virus"
If a=1 then a$=a$+"Jute"
If a=2 then a$=a$+"Insect"
If a=3 then a$=a$+"Animal"

If a=4 then a$=a$+"Avian"


If a=5 then a$=a$+"Hatine"
If a=6 then a$=a$+"Kaltarn"
If a=7 then a$=a$+"Aldrarn"
If a=8 then a$=a$+"Indy"
If a=9 then a$=a$+"Nutain"
If a<>0
a=rnd(5)
If a=0 then a$=a$+" syndrome"
If a=1 then a$=a$+" bites"
If a=2 then a$=a$+" attacks"
If a=3 then a$=a$+" fever"
If a=4 then a$=a$+"s"
If a=5 then a$=a$+" spots"
EndIf
a$=a$+" has increased our need"
nstr$(cl)=a$
cl=cl+1
a$="for medical supplies."
nstr$(cl)=a$
cl=cl+1
a$="Nobody is to explore the planet until further notice!!"
nstr$(cl)=a$
cl=cl+1
cl=cl+1
BBSbuy(6)=BBSbuy(6)*rnd(3)+2
Else
a$="THANKS: to all the pilots who helped get us the"
nstr$(cl)=a$
cl=cl+1
a$="much needed medical supplies we needed to combat the"
nstr$(cl)=a$
cl=cl+1
a$="emergency that we were facing. Once again thanks!"
nstr$(cl)=a$
cl=cl+1
cl=cl+1
EndIf
EndIf
If nit=13
`science news
a$="Scientists have discovered a way to make "
a=rnd(6)
If a=0 then a$=a$+"a better cuppa,"
If a=1 then a$=a$+"a better coffee,"
If a=2 then a$=a$+"better fuel,"
If a=3 then a$=a$+"cleaner engines,"
If a=4 then a$=a$+"a fat free burger,"
If a=5 then a$=a$+"fat free chocolate,"
If a=6 then a$=a$+"a better AI system,"
nstr$(cl)=a$
cl=cl+1
If a<>6 then a=rnd(5) Else a=rnd(7)
If a=0 then a$="it will be several years till we see it though."
If a=1 then a$="now all they need is to do is mass produce it!!."
If a=2 then a$="they are awaiting funding before production continues."
If a=3 then a$="something good to report at last."
If a=4 then a$="its good to see science creating something useful."
If a=5 then a$="this could start a trend!!!"

If a=6 then a$="we will see it when it stops argueing with them!!!."
If a=7 then a$="at the moment it wont shut up, hope they fix it soon."
nstr$(cl)=a$
cl=cl+1
cl=cl+1
EndIf
If nit=14
`mysterious disapearances
a$="One of our "
a=rnd(6)
If a=0 then a$=a$+"transports "
If a=1 then a$=a$+"fighter wings "
If a=2 then a$=a$+"explorers "
If a=3 then a$=a$+"frigates "
If a=4 then a$=a$+"cruisers "
If a=5 then a$=a$+"Generals "
If a=6 then a$=a$+"Politicians "
a=rnd(1)
If a=0 then a$=a$+"disappeared"
If a=1 then a$=a$+"vanished"
a$=a$+" without a trace"
nstr$(cl)=a$
cl=cl+1
a=rnd(1)
If a=0 then a$="yesterday," Else a$="today,"
a$=a$+"this has caused a state of alarm"
nstr$(cl)=a$
cl=cl+1
a$="in the local "
a=rnd(2)
If a=0 then a$=a$+"populous."
If a=1 then a$=a$+"police force."
If a=2 then a$=a$+"military."
nstr$(cl)=a$
cl=cl+1
cl=cl+1
EndIf
Next num
cm=1
cvl=0
Repeat
ok=0
ink RGB(10,10,155),0
box 0,0,10,479
box 0,0,639,50
box 200,0,639,479
box 0,250,211,479
ink RGB(200,200,200),0
text 10,10,"Galactic News service"
showcredits(12,260)
position object 5400,50002.62,50005,50001.1
rotate object 5400,xr#,yr#,zr#
show object 5400
xr#=xr#+1
If xr#>359 then xr#=xr#-360
yr#=yr#+2
If yr#>359 then yr#=yr#-360
zr#=zr#+1
If zr#>359 then zr#=zr#-360

ink RGB(255,255,255),0
bob 1,MouseX(),MouseY(),2000
cp=30
For vl=cvl To cvl+26
If vl<200 then text 230,cp,nstr$(vl)
cp=cp+14
Next vl
` text 305,178,"No news available"
Button(10,450,30,470,1)
text 35,453,"Main Menu"
mx=MouseX()
my=MouseY()
If mouseclick()=1
If mx>10 And mx<30 And my>450 And my<470 then ok=1
EndIf
sync
Until ok=1
undim nstr$(200)
ENDFUNCTION
FUNCTION Stockmarket()
cm=1
ci=-1
Repeat
ok=0
ink RGB(10,10,155),0
box 0,0,10,479
box 0,0,639,50
box 200,0,639,479
box 0,250,211,479
ink RGB(200,200,200),0
text 10,10,"Local Stock Market"
showcredits(12,260)
position object 5400,50002.62,50005,50001.1
rotate object 5400,xr#,yr#,zr#
show object 5400
xr#=xr#+1
If xr#>359 then xr#=xr#-360
yr#=yr#+2
If yr#>359 then yr#=yr#-360
zr#=zr#+1
If zr#>359 then zr#=zr#-360
ink RGB(255,255,255),0
bob 1,MouseX(),MouseY(),2000
text 230,12,"Item"
text 400,12,"Buy"
text 470,12,"Sell"
text 540,12,"Qty"
text 590,0,"Ships"
text 590,12,"Hold"
a$="Cargo Space:"
a$=a$+str$(playinfo(34))
a$=a$+"/"
a$=a$+str$(shipdata(playinfo(35),9))
text 10,290,a$
a$="Last Paid:"
If ci>0
If playprice(ci)>0
a$=a$+str$(playprice(ci))
a$=a$+"(Cr)"

Else
a$=a$+"Unknown"
EndIf
Else
a$=a$+"Unknown"
EndIf
text 10,310,a$
BBSBuy(22)=BBSSell(22)*2
BBSBuy(23)=BBSSell(23)*2
For cid=0 To 28
If cid=ci then ink RGB(255,0,0),0 Else ink RGB(255,255,255),0
text 400,30+(cid*14),str$(Abs(BBSBuy(cid)))
text 470,30+(cid*14),str$(BBSSell(cid))
If BBSqty(cid)>0 then text 540,30+(cid*14),str$(BBSQty(cid)) Else text 540,30
+(cid*14),"-"
If playcargo(cid)>0 then text 590,30+(cid*14),str$(playcargo(cid)) Else text
590,30+(cid*14),"-"
If ak=0 then ak=1 Else ak=0
Next cid
If ci=0 then ink RGB(255,0,0),0 Else ink RGB(255,255,255),0
text 230,30,"Oxygen"
If ci=1 then ink RGB(255,0,0),0 Else ink RGB(255,255,255),0
text 230,44,"Grain"
If ci=2 then ink RGB(255,0,0),0 Else ink RGB(255,255,255),0
text 230,58,"Fruit and Veg"
If ci=3 then ink RGB(255,0,0),0 Else ink RGB(255,255,255),0
text 230,72,"Organic Meat"
If ci=4 then ink RGB(255,0,0),0 Else ink RGB(255,255,255),0
text 230,86,"Synthetic Meat"
If ci=5 then ink RGB(255,0,0),0 Else ink RGB(255,255,255),0
text 230,100,"Liquor and Wines"
If ci=6 then ink RGB(255,0,0),0 Else ink RGB(255,255,255),0
text 230,114,"Medical Supplies"
If ci=7 then ink RGB(255,0,0),0 Else ink RGB(255,255,255),0
text 230,128,"Fertilizer"
If ci=8 then ink RGB(255,0,0),0 Else ink RGB(255,255,255),0
text 230,142,"Furs"
If ci=9 then ink RGB(255,0,0),0 Else ink RGB(255,255,255),0
text 230,156,"Livestock"
If ci=10 then ink RGB(255,0,0),0 Else ink RGB(255,255,255),0
text 230,170,"Luxuries"
If ci=11 then ink RGB(255,0,0),0 Else ink RGB(255,255,255),0
text 230,184,"Plastics"
If ci=12 then ink RGB(255,0,0),0 Else ink RGB(255,255,255),0
text 230,198,"Alloys"
If ci=13 then ink RGB(255,0,0),0 Else ink RGB(255,255,255),0
text 230,212,"Farm Machinery"
If ci=14 then ink RGB(255,0,0),0 Else ink RGB(255,255,255),0
text 230,226,"Industrial Machinery"
If ci=15 then ink RGB(255,0,0),0 Else ink RGB(255,255,255),0
text 230,240,"Firearms"
If ci=16 then ink RGB(255,0,0),0 Else ink RGB(255,255,255),0
text 230,254,"Battle Droids"
If ci=17 then ink RGB(255,0,0),0 Else ink RGB(255,255,255),0
text 230,268,"Slaves"
If ci=18 then ink RGB(255,0,0),0 Else ink RGB(255,255,255),0
text 230,282,"Narcotics"
If ci=19 then ink RGB(255,0,0),0 Else ink RGB(255,255,255),0
text 230,296,"Energy"
If ci=20 then ink RGB(255,0,0),0 Else ink RGB(255,255,255),0

text 230,310,"Gemstones"
If ci=21 then ink RGB(255,0,0),0 Else ink RGB(255,255,255),0
text 230,324,"Precious Metals"
If ci=22 then ink RGB(255,0,0),0 Else ink RGB(255,255,255),0
text 230,338,"Rubbish"
If ci=23 then ink RGB(255,0,0),0 Else ink RGB(255,255,255),0
text 230,352,"Radioactives"
If ci=24 then ink RGB(255,0,0),0 Else ink RGB(255,255,255),0
text 230,364,"Explosives"
If ci=25 then ink RGB(255,0,0),0 Else ink RGB(255,255,255),0
text 230,378,"Battle Weapons"
If ci=26 then ink RGB(255,0,0),0 Else ink RGB(255,255,255),0
text 230,392,"Ore and Minerals"
If ci=27 then ink RGB(255,0,0),0 Else ink RGB(255,255,255),0
text 230,406,"Antiques"
If ci=28 then ink RGB(255,0,0),0 Else ink RGB(255,255,255),0
text 230,420,"Alien Artifacts"
Button(10,450,30,470,1)
text 35,453,"Main Menu"
button(220,450,240,470,1)
text 245,453,"Buy"
button(420,450,440,470,1)
text 445,453,"Sell"
mx=MouseX()
my=MouseY()
If mouseclick()=1
If mx>220 And my>450 And mx<240 And my<470
`Buy code
If BBSSell(ci)<=playinfo(33) And BBSQty(ci)>0 And playinfo(34)>0
BBSqty(ci)=BBSqty(ci)-1
playcargo(ci)=playcargo(ci)+1
playinfo(33)=playinfo(33)-BBSSell(ci)
playprice(ci)=BBSSell(ci)
playinfo(34)=playinfo(34)-1
EndIf
EndIf
If mx>420 And my>450 And mx<440 And my<470
`sell
sok=1
If ci=22 Or ci=23
sok=0
If playinfo(33)>Abs(BBSBuy(22)) And ci=22 then sok=1
If playinfo(33)>Abs(BBSBuy(23)) And ci=23 then sok=1
EndIf
If playcargo(ci)>0 And sok=1
playcargo(ci)=playcargo(ci)-1
BBSqty(ci)=BBSqty(ci)+1
playinfo(33)=playinfo(33)+BBSBuy(ci)
playinfo(34)=playinfo(34)+1
EndIf
EndIf
If my>30 And my<434 And mx>230
ci=0+((my-30)/14)
EndIf
If mx>10 And mx<30 And my>450 And my<470 then ok=1
EndIf
sync
Until ok=1
ENDFUNCTION

FUNCTION newships(shno)
cm=1
ci=0
oldci=0
cps=playinfo(35)
If playinfo(35)=3200 Or playinfo(35)=3201
ok=0
Repeat
ink RGB(10,10,155),0
box 0,0,10,479
box 0,0,639,50
box 200,0,639,479
box 0,250,211,479
ink RGB(255,255,255),0
text 10,10,"Local Shipyard: New and used ships"
text 290,178,"You cannot change that ship"
bob 1,MouseX(),MouseY(),2000
Button(10,450,30,470,1)
text 35,453,"Main Menu"
mx=MouseX()
my=MouseY()
sync
If mouseclick()=1
If mx>10 And mx<30 And my>450 And my<470 then ok=1
EndIf
Until ok=1
Else
shipvalue=shipdata(cps,10)*1000
nsv#=shipvalue/100
shipvalue=nsv#*75
btime=0
Repeat
ok=0
ink RGB(10,10,155),0
box 0,0,10,479
box 0,0,639,50
box 200,0,639,479
box 0,250,211,479
ink RGB(255,255,255),0
text 10,10,"Local Shipyard: New and used ships"
text 210,30,"Ship"
text 400,30,"Price"
text 460,30,"Part Ex"
text 540,30,"Hull"
text 580,30,"Free"
remstart
-) Name
0) Crew
1) Front
2) Left
3) Right
4) Rear
5) Top
6) Bottom gun mounts
7) Missle pylons
8) Hull Mass
9) Internal space
10)Cost
-) Model name
remend

cp=46
If shno>0
For si=0 To shno
If BBSShips(si,0)>-1
If si=ci then ink RGB(255,0,0),0 Else ink RGB(255,255,255),0
text 210,cp,shipname$((BBSShips(si,0)*50)+BBSShips(si,1))
text 400,cp,str$(shipdata((BBSShips(si,0)*50)+BBSShips(si,1),10)*1000)
text 460,cp,str$((shipdata((BBSShips(si,0)*50)+BBSShips(si,1),10)*1000)-sh
ipvalue)
text 540,cp,str$(shipdata((BBSShips(si,0)*50)+BBSShips(si,1),8))
text 580,cp,str$(shipdata((BBSShips(si,0)*50)+BBSShips(si,1),9))
cp=cp+16
EndIf
Next si
button(400,425,420,445,1)
text 425,428,"Buy Ship"
Else
center text 447,240,"No ships at the moment, call back later"
EndIf
showcredits(12,260)
position object 5400,50002.62,50005,50001.1
rotate object 5400,xr#,yr#,zr#
show object 5400
xr#=xr#+1
If xr#>359 then xr#=xr#-360
yr#=yr#+2
If yr#>359 then yr#=yr#-360
zr#=zr#+1
If zr#>359 then zr#=zr#-360
ink RGB(255,255,255),0
bob 1,MouseX(),MouseY(),2000
Button(10,450,30,470,1)
text 35,453,"Main Menu"
mx=MouseX()
my=MouseY()
If btime>0 then btime=btime-1
If mouseclick()=1 And btime<=0
`BUY BUTTON To BUY ONE OF THOSE LOVERLY SHIPS
`IN CAPS SO I CAN LOCATE IT LATER
If mx>400 And mx<420 And my>425 And my<445 And shno>0
If playinfo(33)>=((shipdata((BBSShips(ci,0)*50)+BBSShips(ci,1),10)*1000)-sh
ipvalue)
cred=(shipdata((BBSShips(ci,0)*50)+BBSShips(ci,1),10)*1000)-shipvalue
os=playinfo(35)
playinfo(35)=(BBSShips(ci,0)*50)+BBSShips(ci,1)
ndata(playinfo(15),24)=playinfo(35)
playinfo(34)=shipdata(playinfo(35),9)
For sc=0 To 44
playcargo(sc)=0
Next sc
If st<3200
st$="models\"
st$=st$+shipmodel$(ndata(playinfo(15),24))
load object st$,5400
If object exist(5400)=0 then End
If object size(5400)<12 then scale object 5400,35,35,35
EndIf
playinfo(14)=shipdata((BBSShips(ci,0)*50)+BBSShips(ci,1),9)
ndata(playinfo(15),25)=shipdata((BBSShips(ci,0)*50)+BBSShips(ci,1),8)
ndata(playinfo(15),5)=shipdata((BBSShips(ci,0)*50)+BBSShips(ci,1),8)

playinfo(12)=7
playinfo(13)=7
shipbitz(0)=1
For rst=1 To 6
If shipdata((BBSShips(ci,0)*50)+BBSShips(ci,1),rst)>0
shipbitz(rst)=-1
Else
shipbitz(rst)=0
EndIf
Next rst
For rst=7 To 30
shipbitz(rst)=0
Next rst
If cred>0
playinfo(33)=playinfo(33)-((shipdata((BBSShips(ci,0)*50)+BBSShips(ci,1),1
0)*1000)-shipvalue)
Else
playinfo(33)=playinfo(33)+Abs((shipdata((BBSShips(ci,0)*50)+BBSShips(ci,1
),10)*1000)-shipvalue)
EndIf
race=os/50
If race>0 then os=os-(race*50)
BBSShips(ci,0)=race
BBSShips(ci,1)=os
cps=playinfo(35)
shipvalue=shipdata(cps,10)*1000
nsv#=shipvalue/100
shipvalue=nsv#*75
EndIf
btime=5
EndIf
If mx>210 And mx<640 And my>46 And my<416
oldci=ci
ci=0+((my-46)/16)
If BBSShips(ci,0)=-1 then ci=oldci
EndIf
If mx>10 And mx<30 And my>450 And my<470 then ok=1
EndIf
sync
Until ok=1
EndIf
ENDFUNCTION
FUNCTION upgrades()
Dim required(36)
Dim sybuy(36)
Dim sysell(36)
cm=1
`bi buying item (the one you buy If you click buy part!!!)
`highlighted in RED
bi=0
`ui upgrade item
ui=0
`tech level between 1-25
techlevel=(sectordata(playinfo(2),10)/10)+1
Repeat
cp=30
ok=0
ink RGB(10,10,155),0

box 0,0,10,479
box 0,0,639,50
box 200,0,639,479
box 0,250,211,479
ink RGB(200,200,200),0
text 10,10,"Local Shipyard: Upgrades"
showcredits(12,260)
position object 5400,50002.62,50005,50001.1
rotate object 5400,xr#,yr#,zr#
show object 5400
xr#=xr#+1
If xr#>359 then xr#=xr#-360
yr#=yr#+2
If yr#>359 then yr#=yr#-360
zr#=zr#+1
If zr#>359 then zr#=zr#-360
ink RGB(255,255,255),0
itm=ui
text 255,14,"Part"
text 400,14,"To Fit"
text 480,14,"Remove"
text 540,14,"Size"
text 580,14,"Qty."
Repeat
If shipyarddata(itm,2)<=techlevel
If itm=bi then ink RGB(255,0,0),0 Else ink RGB(255,255,255),0
text 255,cp,shipyarditem$(itm)
topaymod=(techlevel-shipyarddata(itm,2))
If topaymod>0
v#=(shipyarddata(itm,0)/10)*(10-(topaymod/10))
topay=Int(v#)
Else
topay=shipyarddata(itm,0)
EndIf
`player buy price
sybuy(itm)=topay
`removal price
sysell(itm)=(topay/3)*2
text 400,cp,str$(topay)
text 480,cp,str$(((topay/3)*2))
text 540,cp,str$(shipyarddata(itm,1))
If required(itm)>0 then text 580,cp,str$(required(itm)) Else text 580,cp,"-"
cp=cp+16
EndIf
itm=itm+1
Until itm>35 Or cp>400
If cp>400 And itm<35 then more=1 Else more=0
If ui>0 then less=1 Else less=0
`less button
If less=1
button(230,425,250,445,1)
text 255,428,"Previous"
EndIf
`more button
If more=1
button(230,450,250,470,1)
text 255,453,"Next"
EndIf
button(400,425,420,445,1)
text 425,428,"Buy Part"

button(400,450,420,470,1)
text 425,453,"Sell Part"
bob 1,MouseX(),MouseY(),2000
Button(10,450,30,470,1)
text 35,453,"Main Menu"
mx=MouseX()
my=MouseY()
If err>0
If bk=2
If err=1 then center text 320,440,"We cannot fit any of those!!!"
If err=2 then center text 320,440,"You cannot afford one of those!!!"
If err=3 then center text 320,440,"You dont have enough space for that item!
!!"
EndIf
If bk=1
If err=1 then center text 320,440,"You dont have any of those fitted!!!"
If err=2 then center text 320,440,"You dont have any of those on the pylons"
EndIf
EndIf
sync
err=0
`function perfect from here
If mouseclick()=1
itsz=shipyarddata(bi,1)
`************************ Buy button *********************************
If mx>400 And mx<420 And my>425 And my<445
err=1
bk=2
`missles And Mines
If bi>-1 And bi<7
`check If there is a free pylon
If ndata(playinfo(15),32)<ndata(playinfo(15),31)
`
playinfo(33)=playinfo(33)-sybuy(bi)
If playinfo(33)>=sybuy(bi)
If bi=0 then inci=7
If bi=1 then inci=29
If bi=2 then inci=8
If bi=3 then inci=9
If bi=4 then inci=25
If bi=5 then inci=26
If bi=6 then inci=27
shipbitz(inci)=shipbitz(inci)+1
ndata(playinfo(15),32)=ndata(playinfo(15),32)+1
err=0
Else
err=2
EndIf
EndIf
EndIf
If playinfo(34)>=itsz
If bi=7
EndIf
If bi=8 And shipbitz(17)=0
shipbitz(17)=1
err=0
EndIf
If bi=9
shipbitz(15)=shipbitz(15)+1
err=0
EndIf

If bi=10 And shipbitz(14)<100


shipbitz(14)=shipbitz(14)+1
err=0
EndIf
If bi=11 And shipbitz(24)=0
shipbitz(24)=1
err=0
EndIf
If bi=12 And shipbitz(13)=0
shipbitz(13)=1
err=0
EndIf
If bi=13 And shipbitz(12)=0
shipbitz(12)=1
err=0
EndIf
If bi=14 And shipbitz(10)=0
shipbitz(10)=1
err=0
EndIf
If bi=15 And shipbitz(28)=0
shipbitz(28)=1
err=0
EndIf
If bi=16 And shipbitz(11)=0
shipbitz(11)=1
err=0
EndIf
If bi=17 And shipbitz(30)=0
shipbitz(30)=1
err=0
EndIf
If bi=18 And shipbitz(23)=0
shipbitz(23)=1
err=0
EndIf
If bi=19 And shipbitz(22)=0
shipbitz(22)=1
err=0
EndIf
If bi=20
err=0
EndIf
If bi=21 And shipbitz(21)=0
shipbitz(21)=1
err=0
EndIf
If bi=22 And shipbitz(20)=0
shipbitz(20)=1
err=0
EndIf
If bi=23 And shipbitz(18)=0
shipbitz(18)=1
err=0
EndIf
If bi=24 And shipbitz(19)=0
shipbitz(19)=1
err=0
EndIf
If bi=25 And shipbitz(0)=-1

playinfo(13)=0
playinfo(12)=0
shipbitz(0)=0
err=0
EndIf
If bi>25 And shipbitz(0)=-1
playinfo(13)=(bi-25)*7
shipbitz(0)=(bi-25)
playinfo(12)=1
err=0
EndIf
If err=0
If playinfo(33)>=sybuy(bi)
playinfo(33)=playinfo(33)-sybuy(bi)
If bi>6 then playinfo(34)=playinfo(34)-shipyarddata(bi,1)
Else
err=2
EndIf
Else
err=3
EndIf
EndIf
EndIf
`************************ Sell button *********************************
If mx>400 And mx<420 And my>450 And my<470
err=1
bk=1
text 0,0,str$(bi)
sync
`missles And Mines
If bi>-1 And bi<7
`check If there is a free pylon
If ndata(playinfo(15),32)>0
inci=0
If bi=0 then inci=7
If bi=1 then inci=29
If bi=2 then inci=8
If bi=3 then inci=9
If bi=4 then inci=25
If bi=5 then inci=26
If bi=6 then inci=27
If inci=0 Or shipbitz(inci)=0 then err=2
If inci>0
shipbitz(inci)=shipbitz(inci)-1
ndata(playinfo(15),32)=ndata(playinfo(15),32)-1
playinfo(33)=playinfo(33)+sysell(bi)
err=0
EndIf
EndIf
EndIf
If bi=7
EndIf
If bi=8 And shipbitz(17)=1
shipbitz(17)=0
err=0
EndIf
If bi=9 And shipbitz(15)>0
shipbitz(15)=shipbitz(15)-1
err=0
EndIf

If bi=10 And shipbitz(14)>0


shipbitz(14)=shipbitz(14)-1
err=0
EndIf
If bi=11 And shipbitz(24)=1
shipbitz(24)=0
err=0
EndIf
If bi=12 And shipbitz(13)=1
shipbitz(13)=0
err=0
EndIf
If bi=13 And shipbitz(12)=1
shipbitz(12)=0
err=0
EndIf
If bi=14 And shipbitz(10)=1
shipbitz(10)=0
err=0
EndIf
If bi=15 And shipbitz(28)=1
shipbitz(28)=0
err=0
EndIf
If bi=16 And shipbitz(11)=1
shipbitz(11)=0
err=0
EndIf
If bi=17 And shipbitz(30)=1
shipbitz(30)=0
err=0
EndIf
If bi=18 And shipbitz(23)=1
shipbitz(23)=0
err=0
EndIf
If bi=19 And shipbitz(22)=1
shipbitz(22)=0
err=0
EndIf
If bi=20
err=0
EndIf
If bi=21 And shipbitz(21)=1
shipbitz(21)=0
err=0
EndIf
If bi=22 And shipbitz(20)=1
shipbitz(20)=0
err=0
EndIf
If bi=23 And shipbitz(18)=1
shipbitz(18)=0
err=0
EndIf
If bi=24 And shipbitz(19)=1
shipbitz(19)=0
err=0
EndIf
If bi>24 And shipbitz(0)>-1

If shipbitz(0)=bi-25
playinfo(13)=0
playinfo(12)=0
shipbitz(0)=-1
err=0
Else
err=1
EndIf
Else
err=1
EndIf
If err=0 And bi>6
playinfo(33)=playinfo(33)+sysell(bi)
If bi>6 then playinfo(34)=playinfo(34)+shipyarddata(bi,1)
EndIf
EndIf
`Select an item
If mx>255 And mx<639 And my>30 And my<416
sp=30
mc=0
`locate the item the mouse clicked on
`by testing every 16 pixel chunk from line 30
`each text line is 16 pixels To allow correct spacing
Repeat
ok=0
If my>=sp And my<sp+16
ok=1
Else
mc=mc+1
sp=sp+16
EndIf
Until ok=1 Or sp>400
If mc>23 then mc=23
If ok=1
`now we need To count the items from the top of the List
si=ui
For ne=0 To mc
If si<36
Repeat
If shipyarddata(si,2)>techlevel then si=si+1
Until shipyarddata(si,2)<=techlevel Or si>35
si=si+1
EndIf
Next ne
If si<36 then bi=si-1
EndIf
EndIf
ok=0
`Next
If mx>230 And mx<250 And my>450 And my<470 And more=1
ci=ui
err=0
Repeat
ci=ci+1
If ci>35
err=1
ci=35
EndIf
Until shipyarddata(ci,2)<=techlevel Or err=1
If err=0 then ui=ci

EndIf
`PREVIOUS
If mx>230 And mx<250 And my>425 And my<445 And less=1
ci=ui
err=0
Repeat
ci=ci-1
If ci<0
err=1
ci=0
EndIf
Until shipyarddata(ci,2)<=techlevel Or err=1
If err=0 then ui=ci Else ui=0
EndIf
If mx>10 And mx<30 And my>450 And my<470 then ok=1
EndIf
Until ok=1
`when you buy shields you WOULD like To use them!!!
ndata(playinfo(15),9)=shipbitz(15)*100
undim required(36)
undim sybuy(36)
undim sysell(36)
ENDFUNCTION
FUNCTION repairs()
cm=1
Repeat
ok=0
ink RGB(10,10,155),0
box 0,0,10,479
box 0,0,639,50
box 200,0,639,479
box 0,250,211,479
ink RGB(200,200,200),0
text 10,10,"Local Shipyard: Repairs and Servicing"
showcredits(12,260)
position object 5400,50002.62,50005,50001.1
rotate object 5400,xr#,yr#,zr#
show object 5400
xr#=xr#+1
If xr#>359 then xr#=xr#-360
yr#=yr#+2
If yr#>359 then yr#=yr#-360
zr#=zr#+1
If zr#>359 then zr#=zr#-360
ink RGB(255,255,255),0
bob 1,MouseX(),MouseY(),2000
Button(10,450,30,470,1)
text 35,453,"Main Menu"
mx=MouseX()
my=MouseY()
If mouseclick()=1
If mx>10 And mx<30 And my>450 And my<470 then ok=1
EndIf
sync
Until ok=1
ENDFUNCTION
FUNCTION Shipyard(sseed,sno)

cm=1
Repeat
ok=0
ink RGB(10,10,155),0
box 0,0,10,479
box 0,0,639,50
box 200,0,639,479
box 0,250,211,479
ink RGB(200,200,200),0
text 10,10,"Local Shipyard"
showcredits(12,260)
position object 5400,50002.62,50005,50001.1
rotate object 5400,xr#,yr#,zr#
show object 5400
xr#=xr#+1
If xr#>359 then xr#=xr#-360
yr#=yr#+2
If yr#>359 then yr#=yr#-360
zr#=zr#+1
If zr#>359 then zr#=zr#-360
Button(230,50,250,70,1)
text 255,53,"New and used ships"
Button(230,90,250,110,1)
text 255,93,"Customisation department"
Button(230,130,250,150,1)
text 255,133,"Repairs and Servicing"
ink RGB(255,255,255),0
bob 1,MouseX(),MouseY(),2000
Button(10,450,30,470,1)
text 35,453,"Main Menu"
mx=MouseX()
my=MouseY()
If mouseclick()=1
If mx>230 And mx<250 And my>50 And my<70 then newships(sno)
If mx>230 And mx<250 And my>90 And my<110 then upgrades()
If mx>230 And mx<250 And my>130 And my<150 then repairs()
If mx>10 And mx<30 And my>450 And my<470 then ok=1
EndIf
sync
Until ok=1
ENDFUNCTION
`docked at a port!!!
FUNCTION Docked()
Dim Iprice(28)
For si=0 To 30
BBSShips(si,0)=-1
Next si
ndata(playinfo(15),23)=1
Iprice(0)=8
Iprice(1)=5
Iprice(2)=4
Iprice(3)=12
Iprice(4)=8
Iprice(5)=24
Iprice(6)=80
Iprice(7)=5
Iprice(8)=60
Iprice(9)=10

Iprice(10)=100
Iprice(11)=25
Iprice(12)=35
Iprice(13)=50
Iprice(14)=60
Iprice(15)=90
Iprice(16)=50
Iprice(17)=12
Iprice(18)=150
Iprice(19)=8
Iprice(20)=20
Iprice(21)=50
Iprice(22)=5
Iprice(23)=20
Iprice(24)=30
Iprice(25)=40
Iprice(26)=8
Iprice(27)=80
Iprice(28)=75
cpx#=camera position x()
cpy#=camera position y()
cpz#=camera position z()
crx#=camera angle x()
cry#=camera angle y()
crz#=camera angle z()
`position And point camera For 3D objects on BBS
position camera 50000,50000,50000
` point camera 50000,50100,50000
bob 1,1000,1000,1005
bob 2,1000,1000,1005
bob 3,1000,1000,1005
bob 65500,1000,1000,1005
For n=1008 To 1015
bob n,1000,1000,1005
Next n
If playinfo(16)>0 And playinfo(16)<21
title$="Starport Bulletin Board"
seedinc=pseed(playinfo(16)-1)
EndIf
If playinfo(16)>20 And playinfo(16)<41
title$="Moonbase Bulletin Board"
seedinc=mseed(playinfo(16)-21)
EndIf
If playinfo(16)>50 And playinfo(16)<62
title$="Space Station Bulletin Board"
seedinc=sseed(playinfo(16)-51)
EndIf
menu=0
st=ndata(playinfo(15),24)
If st<3200
st$="models\"
st$=st$+shipmodel$(ndata(playinfo(15),24))
load object st$,5400
If object exist(5400)=0 then End
EndIf
If st=3200 then load object "models\cobra.x",5400
If st=3201 then load object "models\doohickey.x",5400
If st<>3201 then scale object 5400,10,10,10 Else scale object 5400,30,30,30
If object size(5400)<12 then scale object 5400,35,35,35
xr#=rnd(359)

yr#=rnd(259)
zr#=rnd(359)
`*************************CREATING BBS SYSTEM******************************
`the date will be used For ship availability
d$=get date$()
`time is used To create bulletin board posts
t$=get time$()
mil=0
sed$=""
nseed=0
For n=0 To Len(t$)-2
ch$=mid$(t$,n)
If ch$<>":" then sed$=sed$+ch$
Next n
mseed=Val(sed$)+seedinc
sed$=""
For n=0 To Len(d$)-2
ch$=mid$(d$,n)
If ch$<>"/" then sed$=sed$+ch$
Next n
mseed=mseed+Val(sed$)
nseed=Val(sed$)+sysinfo(0)
randomize mseed
`*************************************************************************
`setup ships For BBS system
tl=(sectordata(playinfo(2),10)/10)+1
If tl<1 then tl=1
shipno=rnd(4+tl)
If shipno>14 then shipno=14
If shipno>0
For si=0 To shipno
Repeat
BBSShips(si,0)=sectordata(playinfo(2),13)
`randomize ships To max ships available To that race!!!
a=sectordata(playinfo(2),13)
ms=raceinfo(a,3)-1
If ms>-1
ss=(a*50)
ss=ss+rnd(ms)
BBSShips(si,1)=ss
EndIf
Until shipdata(ss,10)>0
Next si
EndIf
`*************************************************************************
For n=0 To 28
BBSQty(n)=rnd(100)
If BBSQty(n)<10 then BBSSell(n)=Iprice(n)+(rnd(Iprice(n))) Else BBSSell(n)=Ipr
ice(n)/2+(rnd(IPrice(n)))
BBSBuy(n)=((BBSSell(n)/5)*4)+1
Next n
BBSSell(28)=0
BBSQty(28)=0
BBSBuy(23)=30
BBSSell(23)=0-BBSSell(23)
BBSBuy(22)=5
BBSSell(22)=0-BBSSell(22)
`messages only change every minute of REAL TIME Not game time!!!
For n=0 To 31
msg$(n)=""

mesinfo(n,0)=-1
Next n
nm=makemessage(mseed)
Repeat
ok=0
If keystate(68)=1 then loadsavemenu(1,1)
ink RGB(10,10,155),0
box 0,0,10,479
box 0,0,639,50
box 200,0,639,479
box 0,250,211,479
ink RGB(200,200,200),0
text 10,10,title$
showcredits(12,260)
position object 5400,50002.62,50005,50001.1
show object 5400
If menu=0
Button(280,50,300,70,1)
text 305,53,"Launch Request"
Button(280,100,300,120,1)
text 305,103,"Shipyard"
Button(280,160,300,180,1)
text 305,163,"Local Law Agency"
Button(280,220,300,240,1)
text 305,223,"Bulletin Board System"
Button(280,280,300,300,1)
text 305,283,"Latest News"
Button(280,340,300,360,1)
text 305,343,"Stock Market"
EndIf
If menu=1
shipyard(seed,shipno)
menu=0
EndIf
If menu=2
PoliceBBS()
menu=0
EndIf
If menu=3
BBS(nm)
menu=0
EndIf
If menu=4
GNS(nseed)
menu=0
EndIf
If menu=5
Stockmarket()
menu=0
EndIf
If mouseclick()=1
mx=MouseX()
my=MouseY()
If menu=0
`LAUNCH REQUEST
If mx>280 And mx<300
If my>50 And my<70
ok=launch()
EndIf
If my>100 And my<120

menu=1
EndIf
If my>160 And my<180
menu=2
EndIf
If my>220 And my<240
menu=3
EndIf
If my>280 And my<300
menu=4
EndIf
If my>340 And my<360
menu=5
EndIf
EndIf
EndIf
EndIf
bob 1,MouseX(),MouseY(),2000
rotate object 5400,xr#,yr#,zr#
show object 5400
xr#=xr#+1
If xr#>359 then xr#=xr#-360
yr#=yr#+2
If yr#>359 then yr#=yr#-360
zr#=zr#+1
If zr#>359 then zr#=zr#-360
sync
Until ok=1
bob 1,1000,1000,2000
position camera cpx#,cpy#,cpz#
delete object 5400
rotate camera crz#,cry#,crx#
playinfo(17)=1
ndata(playinfo(15),23)=0
undim Iprice(28)
ENDFUNCTION
`docking anim
FUNCTION docking()
` center text 320,310,"Docking clearance granted, guiding you in"
If playinfo(16)>50 And playinfo(16)<62
EndIf
Docked()
ENDFUNCTION
FUNCTION InitRaces()
ENDFUNCTION
FUNCTION rankpos(value,op)
remstart
op=0 : Elite rating
op=1 : one of the other ranking systems
op=2 : Wanted level
op=4 : Special Forces Rank
Points gain For Elite rating based on crew aboard ship Not the bounty!!!
this means a small fighter will only be 1 point but a Battleship is worth
a lot more!!!
Elite Rating

Score

Harmless
Mostly Harmless
Novice
Poor
Below Average
Average
Above Average
Competent
Skilled
Dangerous
Veteran
Deadly
ELITE

0 (you start at this)


4
8
16
32
64
128
256
512
1024
2048
4096
8192 ...

Military Scoring
Delivery
Assassination
Photography Mission
Missile Attack
Photography Mission
Stealing an item
Kidnapping

Points
2
12
16
18
20
50
100

***************************** NOTES: ************************************


POLICE RANKS AFFECT ALL OTHER MISSIONS ON OFFER To YOU, MILITARY WILL Not
OFFER ANY HIGH RISK JOBS, THE CRIMINAL UNDERWORLD WILL Not HAVE ANYTHING
To DO With YOU, And To MAKE MATTERS WORSE YOU WILL Not BE OFFERED ANY
CIVILIAN ASSASSINATIONS EITHER. HOWEVER TRANSPORTING GOODS Or PEOPLE YOU
MAY BE ABLE To GET A BIT EXTRA CASH (DEPENDING WHETHER Or Not THEY LIKE
POLICE Or Not!!!)
*************************************************************************
All ranks have different names these are Earth Force ranks!!!
Military Ranks
Score
None
0 (you start at this,Not shown in information)
Private
1
Corporal
16
Sergeant
82
Sergeant-Major
256
Major
576
Colonel
1296
Lieutenant
2402
Lieutenant Commander
4096
Captain
6562
Commodore
10000
Rear Admiral
14642
Admiral
20736
remend
If op=0
If value>-1 And value<4 then pos=0
If value>3 And value<8 then pos=1
If value>7 And value<16 then pos=2
If value>15 And value<32 then pos=3
If value>31 And value<64 then pos=4
If value>63 And value<128 then pos=5
If value>127 And value<256 then pos=6
If value>255 And value<512 then pos=7
If value>511 And value<1024 then pos=8
If value>1023 And value<2048 then pos=9
If value>2047 And value<4096 then pos=10

If value>4095 And value<8192 then pos=11


If value>8191 then pos=12
EndIf
If op=1
If value>0 And value<16 then pos=1
If value>15 And value<82 then pos=2
If value>81 And value<256 then pos=3
If value>255 And value<576 then pos=4
If value>575 And value<1296 then pos=5
If value>1295 And value<2402 then pos=6
If value>2401 And value<4096 then pos=7
If value>4095 And value<6562 then pos=8
If value>6561 And value<10000 then pos=9
If value>9999 And value<14642 then pos=10
If value>14641 And value<20736 then pos=11
If value>20735 then pos=12
EndIf
If op=2
EndIf
ENDFUNCTION pos
FUNCTION showcredits(crx,cry)
cxp=crx
cyp=cry
ink RGB(255,255,255),0
text cxp,cyp,"Cash "
cxp=cxp+40
text cxp,cyp,"C"
line cxp+4,cyp+1,cxp+4,cyp+14
cxp=cxp+8
text cxp,cyp,str$(playinfo(33))
ENDFUNCTION
FUNCTION Screen(scr)
If scr<>0
If scr=1 then ink RGB(10,10,155),0
If scr=2 then ink RGB(154,10,10),0
If scr=3 then ink RGB(128,87,8),0
box 0,0,639,479
bob 1,1000,1000,1005
bob 2,1000,1000,1005
bob 3,1000,1000,1005
For n=1008 To 1015
bob n,1000,1000,1005
Next n
ink RGB(255,255,255),0
EndIf
If scr=1
`Ranks And criminal record
text 10,10,"Pilot information"
ink RGB(200,200,200),0
text 10,30,"Status and Ranks attained"
text 331,30,"Criminal Record"
If record(11)>0
a$="[Outstanding fines C"
a$=a$+str$(record(11))
a$=a$+"]"
text 440,30,a$
line 567,31,567,45
EndIf

cp=46
If record(0)>0
text 331,cp,"Murder"
cp=cp+16
EndIf
If record(1)>0
text 331,cp,"Piracy"
cp=cp+16
EndIf
If record(2)>0
text 331,cp,"Handling Stolen property"
cp=cp+16
EndIf
If record(3)>0
text 331,cp,"Unlawful discharge of weapon"
cp=cp+16
EndIf
If record(4)>0
text 331,cp,"Assaulting an officer"
cp=cp+16
EndIf
If record(5)>0
text 331,cp,"Permit violation"
cp=cp+16
EndIf
If record(6)>0
text 331,cp,"Illegal mining"
cp=cp+16
EndIf
If record(7)>0
text 331,cp,"Illegal dumping"
cp=cp+16
EndIf
If record(8)>0
text 331,cp,"Causing an obstruction"
cp=cp+16
EndIf
If record(9)>0
text 331,cp,"Attempted Bribery"
cp=cp+16
EndIf
If record(4)>0
text 331,cp,"Threatening behavior"
cp=cp+16
EndIf
text 331,240,"Medals and Permits"
line 319,10,319,470
line 321,10,321,470
line 321,238,630,238
text 10,50,"Legal status "
a=rankpos(playinfo(29),2)
If a=0 then text 160,50,"Clean"
If a=1 then text 160,50,"Offender"
If a=2 then text 160,50,"Criminal"
If a=3 then text 160,50,"Outlaw"
If a=4 then text 160,50,"Public Enemy #1"
text 10,70,"Elite rating"
a=rankpos(playinfo(31),0)
If a=0 then text 160,70,"Harmless"
If a=1 then text 160,70,"Mostly Harmless"

If a=2 then text 160,70,"Novice"


If a=3 then text 160,70,"Poor"
If a=4 then text 160,70,"Below Average"
If a=5 then text 160,70,"Average"
If a=6 then text 160,70,"Above Average"
If a=7 then text 160,70,"Competent"
If a=8 then text 160,70,"Skilled"
If a=9 then text 160,70,"Dangerous"
If a=10 then text 160,70,"Veteran"
If a=11 then text 160,70,"Deadly"
If a=12
text 160,70,"Elite"
If playinfo(31)>30000 then playinfo(31)=30000
EndIf
cp=110
If playinfo(28)>0
`when you have a good Elite rating you could join the Police
pos=rankpos(playinfo(28),1)
text 10,cp,"Galactic Police Force "
If pos=1 then text 160,cp,"Constable"
If pos=2 then text 160,cp,"Sergeant"
If pos=3 then text 160,cp,"Lieutenant"
If pos=4 then text 160,cp,"Captain"
If pos=5 then text 160,cp,"Assistant Chief"
If pos=6 then text 160,cp,"Chief"
If pos=7 then text 160,cp,"Commandant"
If pos=8 then text 160,cp,"Assistant Commissioner"
If pos>8 then text 160,cp,"Commissioner"
If playinfo(28)>30000 then playinfo(28)=30000
cp=cp+20
EndIf
If playinfo(30)>0
`working For crminals
text 10,cp,"Criminal Underworld"
pos=rankpos(playinfo(30),1)
If pos=1 then text 160,cp,"Lowlife"
If pos=2 then text 160,cp,"Gang Member"
If pos=3 then text 160,cp,"Team Leader"
If pos=4 then text 160,cp,"Lieutenant"
If pos=5 then text 160,cp,"Hit man"
If pos=6 then text 160,cp,"Private Guard"
If pos=7 then text 160,cp,"Gang Boss"
If pos=8 then text 160,cp,"Crime Boss"
If pos=9 then text 160,cp,"Crime Lord"
If pos>9 then text 160,cp,"Godfather"
If playinfo(30)>30000 then playinfo(30)=30000
cp=cp+20
EndIf
If playinfo(18)>0
`Terran defence force
text 10,cp,"Earth Force"
pos=rankpos(playinfo(18),1)
If pos=1 then text 160,cp,racerank$(0,0)
If pos=2 then text 160,cp,racerank$(0,1)
If pos=3 then text 160,cp,racerank$(0,2)
If pos=4 then text 160,cp,racerank$(0,3)
If pos=5 then text 160,cp,racerank$(0,4)
If pos=6 then text 160,cp,racerank$(0,5)
If pos=7 then text 160,cp,racerank$(0,6)
If pos=8 then text 160,cp,racerank$(0,7)

If pos=9 then text 160,cp,racerank$(0,8)


If pos=10 then text 160,cp,racerank$(0,9)
If pos=11 then text 160,cp,racerank$(0,10)
If pos=12 then text 160,cp,racerank$(0,11)
If playinfo(18)>30000 then playinfo(18)=30000
cp=cp+20
EndIf
If playinfo(32)>0
`Earth Special Forces
text 10,cp,"Special Forces"
pos=rankpos(playinfo(31),1)
If pos=1 then text 160,cp,"Mercenary"
If pos=2 then text 160,cp,"Agent"
If pos=3 then text 160,cp,"Special Agent"
If pos=4 then text 160,cp,"Undercover Agent"
If pos>4 then text 160,cp,"Government Agent"
If playinfo(31)>30000 then playinfo(31)=30000
cp=cp+20
EndIf
If playinfo(19)>0
`insectoid race
text 10,cp,racedesc$(2,0)
pos=rankpos(playinfo(19),1)
If pos=1 then text 160,cp,racerank$(1,0)
If pos=2 then text 160,cp,racerank$(1,1)
If pos=3 then text 160,cp,racerank$(1,2)
If pos=4 then text 160,cp,racerank$(1,3)
If pos=5 then text 160,cp,racerank$(1,4)
If pos=6 then text 160,cp,racerank$(1,5)
If pos=7 then text 160,cp,racerank$(1,6)
If pos=8 then text 160,cp,racerank$(1,7)
If pos=9 then text 160,cp,racerank$(1,8)
If pos=10 then text 160,cp,racerank$(1,9)
If pos=11 then text 160,cp,racerank$(1,10)
If pos=12 then text 160,cp,racerank$(1,11)
If playinfo(19)>30000 then playinfo(19)=30000
cp=cp+20
EndIf
If playinfo(20)>0
`Reptilian
text 10,cp,"Tesserak"
pos=rankpos(playinfo(20),1)
If pos=1 then text 160,cp,racerank$(2,0)
If pos=2 then text 160,cp,racerank$(2,1)
If pos=3 then text 160,cp,racerank$(2,2)
If pos=4 then text 160,cp,racerank$(2,3)
If pos=5 then text 160,cp,racerank$(2,4)
If pos=6 then text 160,cp,racerank$(2,5)
If pos=7 then text 160,cp,racerank$(2,6)
If pos=8 then text 160,cp,racerank$(2,7)
If pos=9 then text 160,cp,racerank$(2,8)
If pos=10 then text 160,cp,racerank$(2,9)
If pos=11 then text 160,cp,racerank$(2,10)
If pos=12 then text 160,cp,racerank$(2,11)
If playinfo(20)>30000 then playinfo(20)=30000
cp=cp+20
EndIf
If playinfo(21)>0
`Ancient (Unknown) (VERY WARLIKE, MAJORLY EVIL)
text 10,cp,"Allheck"

pos=rankpos(playinfo(21),1)
If pos=1 then text 160,cp,racerank$(3,0)
If pos=2 then text 160,cp,racerank$(3,1)
If pos=3 then text 160,cp,racerank$(3,2)
If pos=4 then text 160,cp,racerank$(3,3)
If pos=5 then text 160,cp,racerank$(3,4)
If pos=6 then text 160,cp,racerank$(3,5)
If pos=7 then text 160,cp,racerank$(3,6)
If pos=8 then text 160,cp,racerank$(3,7)
If pos=9 then text 160,cp,racerank$(3,8)
If pos=10 then text 160,cp,racerank$(3,9)
If pos=11 then text 160,cp,racerank$(3,10)
If pos=12 then text 160,cp,racerank$(3,11)
If playinfo(21)>30000 then playinfo(21)=30000
cp=cp+20
EndIf
If playinfo(22)>0
`Robotic
text 10,cp,"Mechanoid"
pos=rankpos(playinfo(22),1)
If pos=1 then text 160,cp,racerank$(4,0)
If pos=2 then text 160,cp,racerank$(4,1)
If pos=3 then text 160,cp,racerank$(4,2)
If pos=4 then text 160,cp,racerank$(4,3)
If pos=5 then text 160,cp,racerank$(4,4)
If pos=6 then text 160,cp,racerank$(4,5)
If pos=7 then text 160,cp,racerank$(4,6)
If pos=8 then text 160,cp,racerank$(4,7)
If pos=9 then text 160,cp,racerank$(4,8)
If pos=10 then text 160,cp,racerank$(4,9)
If pos=11 then text 160,cp,racerank$(4,10)
If pos=12 then text 160,cp,racerank$(4,11)
If playinfo(22)>30000 then playinfo(22)=30000
cp=cp+20
EndIf
If playinfo(23)>0
`Energy based
text 10,cp,"Vordrax"
pos=rankpos(playinfo(23),1)
If pos=1 then text 160,cp,racerank$(5,0)
If pos=2 then text 160,cp,racerank$(5,1)
If pos=3 then text 160,cp,racerank$(5,2)
If pos=4 then text 160,cp,racerank$(5,3)
If pos=5 then text 160,cp,racerank$(5,4)
If pos=6 then text 160,cp,racerank$(5,5)
If pos=7 then text 160,cp,racerank$(5,6)
If pos=8 then text 160,cp,racerank$(5,7)
If pos=9 then text 160,cp,racerank$(5,8)
If pos=10 then text 160,cp,racerank$(5,9)
If pos=11 then text 160,cp,racerank$(5,10)
If pos=12 then text 160,cp,racerank$(5,11)
If playinfo(23)>30000 then playinfo(23)=30000
cp=cp+20
EndIf
If playinfo(24)>0
`Feline
text 10,cp,"Ortax"
pos=rankpos(playinfo(24),1)
If pos=1 then text 160,cp,racerank$(6,0)
If pos=2 then text 160,cp,racerank$(6,1)

If pos=3 then text 160,cp,racerank$(6,2)


If pos=4 then text 160,cp,racerank$(6,3)
If pos=5 then text 160,cp,racerank$(6,4)
If pos=6 then text 160,cp,racerank$(6,5)
If pos=7 then text 160,cp,racerank$(6,6)
If pos=8 then text 160,cp,racerank$(6,7)
If pos=9 then text 160,cp,racerank$(6,8)
If pos=10 then text 160,cp,racerank$(6,9)
If pos=11 then text 160,cp,racerank$(6,10)
If pos=12 then text 160,cp,racerank$(6,11)
If playinfo(24)>30000 then playinfo(24)=30000
cp=cp+20
EndIf
If playinfo(25)>0
`Ancient (Unknown) (PEACEFUL, VERY GOOD)
text 10,cp,"Varzing"
pos=rankpos(playinfo(25),1)
If pos=1 then text 160,cp,racerank$(7,0)
If pos=2 then text 160,cp,racerank$(7,1)
If pos=3 then text 160,cp,racerank$(7,2)
If pos=4 then text 160,cp,racerank$(7,3)
If pos=5 then text 160,cp,racerank$(7,4)
If pos=6 then text 160,cp,racerank$(7,5)
If pos=7 then text 160,cp,racerank$(7,6)
If pos=8 then text 160,cp,racerank$(7,7)
If pos=9 then text 160,cp,racerank$(7,8)
If pos=10 then text 160,cp,racerank$(7,9)
If pos=11 then text 160,cp,racerank$(7,10)
If pos=12 then text 160,cp,racerank$(7,11)
If playinfo(25)>30000 then playinfo(25)=30000
cp=cp+20
EndIf
If playinfo(26)>0
`Round race who likes stealing tech
text 10,cp,"Q-Tie"
pos=rankpos(playinfo(26),1)
If pos=1 then text 160,cp,racerank$(8,0)
If pos=2 then text 160,cp,racerank$(8,1)
If pos=3 then text 160,cp,racerank$(8,2)
If pos=4 then text 160,cp,racerank$(8,3)
If pos=5 then text 160,cp,racerank$(8,4)
If pos=6 then text 160,cp,racerank$(8,5)
If pos=7 then text 160,cp,racerank$(8,6)
If pos=8 then text 160,cp,racerank$(8,7)
If pos=9 then text 160,cp,racerank$(8,8)
If pos=10 then text 160,cp,racerank$(8,9)
If pos=11 then text 160,cp,racerank$(8,10)
If pos=12 then text 160,cp,racerank$(8,11)
If playinfo(26)>30000 then playinfo(26)=30000
cp=cp+20
EndIf
If playinfo(27)>0
`peace loving race of Avians (BIRDS)
text 10,cp,"Almock"
pos=rankpos(playinfo(27),1)
If pos=1 then text 160,cp,racerank$(9,0)
If pos=2 then text 160,cp,racerank$(9,1)
If pos=3 then text 160,cp,racerank$(9,2)
If pos=4 then text 160,cp,racerank$(9,3)
If pos=5 then text 160,cp,racerank$(9,4)

If pos=6 then text 160,cp,racerank$(9,5)


If pos=7 then text 160,cp,racerank$(9,6)
If pos=8 then text 160,cp,racerank$(9,7)
If pos=9 then text 160,cp,racerank$(9,8)
If pos=10 then text 160,cp,racerank$(9,9)
If pos=11 then text 160,cp,racerank$(9,10)
If pos=12 then text 160,cp,racerank$(9,11)
If playinfo(27)>30000 then playinfo(27)=30000
cp=cp+20
EndIf
EndIf
If scr=2
`cargo screen
text 10,10,"Cargo roster"
text 20,36,"Oxygen"
text 20,50,"Grain"
text 20,64,"Fruit and Veg"
text 20,78,"Organic Meat"
text 20,92,"Synthetic Meat"
text 20,106,"Liquor and Wines"
text 20,120,"Medical Supplies"
text 20,134,"Fertilizer"
text 20,148,"Furs"
text 20,162,"Livestock"
text 20,176,"Luxuries"
text 20,190,"Plastics"
text 20,204,"Alloys"
text 20,218,"Farm Machinery"
text 20,232,"Industrial Machinery"
text 20,246,"Firearms"
text 20,260,"Battle Droids"
text 20,274,"Slaves"
text 20,288,"Narcotics"
text 20,302,"Energy"
text 20,316,"Gemstones"
text 20,330,"Precious Metals"
text 20,344,"Rubbish"
text 20,358,"Radioactives"
text 20,372,"Explosives"
text 20,386,"Battle Weapons"
text 20,400,"Ore and Minerals"
text 20,414,"Antiques"
text 20,428,"Alien Artifacts"
lp=36
text 220,22,"Paid"
text 300,22,"Qty"
If playcargo(19)>0
text 120,10,"Refuel 1(t)"
Button(190,11,204,25,1)
EndIf
For ci=0 To 28
If playcargo(ci)=0
text 220,lp,"-"
text 300,lp,"-"
Else
text 220,lp,str$(playprice(ci))
Button(340,lp+1,354,lp+14,1)
a$=str$(playcargo(ci))
a$=a$+"(t)"
text 300,lp,a$

EndIf
lp=lp+14
Next ci
bob 3,MouseX(),MouseY(),2000
set bob 3,0,1
EndIf
If scr=3
text 10,10,"Ship status"
a$="["
If playinfo(35)<3200 then a$=a$+shipname$(playinfo(35)) Else
If playinfo(35)=3200 then a$=a$+"Cobra Mk III" Else
If playinfo(35)=3201 then a$=a$+"Doohickey"
a$=a$+"]"
text 90,10,a$
cp=36
text 36,cp,"Drive"
If shipbitz(0)>-1 then ssd$=shipyarditem$(shipbitz(0)+25) Else ssd$="None"
If shipbitz(0)>0
ssd$=ssd$+" [approx "
ssd$=ssd$+str$(playinfo(12))
ssd$=ssd$+"ly]"
Else
ssd$=ssd$+" [no FTL jump capability]"
EndIf
text 90,cp,ssd$
cp=cp+16
line 0,cp+8,639,cp+8
cp=cp+16
If shipbitz(1)=1
text 36,cp,"Front lazer fitted"
cp=cp+16
EndIf
If shipbitz(2)=1
text 36,cp,"Rear lazer fitted"
cp=cp+16
EndIf
If shipbitz(3)=1
text 36,cp,"Left lazer fitted"
cp=cp+16
EndIf
If shipbitz(4)=1
text 36,cp,"Right lazer fitted"
cp=cp+16
EndIf
If shipbitz(5)=1
text 36,cp,"Top Turret lazer fitted"
cp=cp+16
EndIf
If shipbitz(6)=1
text 36,cp,"Bottom Turret lazer fitted"
cp=cp+16
EndIf
If shipbitz(7)>0
a$=str$(shipbitz(7))
a$=a$+" Dumb-Fire missle"
If shipbitz(7)>1 then a$=a$+"s"
a$=a$+" fitted"
text 36,cp,a$
cp=cp+16
EndIf

If shipbitz(29)>0
a$=str$(shipbitz(19))
a$=a$+" HE Dumb-Fire missle"
If shipbitz(19)>1 then a$=a$+"s"
a$=a$+" fitted"
text 36,cp,a$
cp=cp+16
EndIf
If shipbitz(8)>0
a$=str$(shipbitz(8))
a$=a$+" Homing missle"
If shipbitz(8)>1 then a$=a$+"s"
a$=a$+" fitted"
text 36,cp,a$
cp=cp+16
EndIf
If shipbitz(9)>0
a$=str$(shipbitz(9))
a$=a$+" HE Homing missle"
If shipbitz(9)>1 then a$=a$+"s"
a$=a$+" fitted"
text 36,cp,a$
cp=cp+16
EndIf
If shipbitz(25)>0
a$=str$(shipbitz(25))
a$=a$+" Dummy mine"
If shipbitz(25)>1 then a$=a$+"s"
a$=a$+" fitted"
text 36,cp,a$
cp=cp+16
EndIf
If shipbitz(26)>0
a$=str$(shipbitz(26))
a$=a$+" Standard mine"
If shipbitz(26)>1 then a$=a$+"s"
a$=a$+" fitted"
text 36,cp,a$
cp=cp+16
EndIf
If shipbitz(27)>0
a$=str$(shipbitz(17))
a$=a$+" HE mine"
If shipbitz(17)>1 then a$=a$+"s"
a$=a$+" fitted"
text 36,cp,a$
cp=cp+16
EndIf
If shipbitz(10)=1
text 36,cp,"Cargo scoop fitted"
cp=cp+16
EndIf
If shipbitz(28)=1
text 36,cp,"Energy Conversion Device fitted"
cp=cp+16
EndIf
If shipbitz(11)=1
text 36,cp,"FTL analyser fitted"
cp=cp+16
EndIf

If shipbitz(12)=1
text 36,cp,"Shockwave device fitted"
cp=cp+16
EndIf
If shipbitz(13)=1
text 36,cp,"Escape Capsule fitted"
cp=cp+16
EndIf
If shipbitz(14)>0
a$=str$(shipbitz(14))
a$=a$+" Lazer generator"
If shipbitz(14)>1 then a$=a$+"s"
a$=a$+" fitted"
text 36,cp,a$
cp=cp+16
EndIf
If shipbitz(15)>0
a$=str$(shipbitz(15))
a$=a$+" Shield generator"
If shipbitz(15)>1 then a$=a$+"s"
a$=a$+" fitted"
text 36,cp,a$
cp=cp+16
EndIf
If shipbitz(16)=1
text 36,cp,"Auto loader fitted"
cp=cp+16
EndIf
If shipbitz(17)=1
text 36,cp,"Energy Booster Unit fitted"
cp=cp+16
EndIf
If shipbitz(18)=1
text 36,cp,"ECM fitted"
cp=cp+16
EndIf
If shipbitz(19)=1
text 36,cp,"Military Grade ECM fitted"
cp=cp+16
EndIf
If shipbitz(20)=1
text 36,cp,"Cloaking Device fitted"
cp=cp+16
EndIf
If shipbitz(21)=1
text 36,cp,"Galactic Jump Drive fitted"
cp=cp+16
EndIf
If shipbitz(22)=1
text 36,cp,"Universal Translator fitted"
cp=cp+16
EndIf
If shipbitz(23)=1
text 36,cp,"Auto Repairer fitted"
cp=cp+16
EndIf
If shipbitz(24)=1
text 36,cp,"Lazer Cooler fitted"
cp=cp+16
EndIf

If shipbitz(30)=1
text 36,cp,"Information system fitted"
cp=cp+16
EndIf
EndIf
ENDFUNCTION
FUNCTION Fireb(power,obj,speed)
sn=0
Repeat
ok=0
`If shot timer is 0 then use this one
If shot(sn,2)=0 then ok=1
If ok=0 then sn=sn+1
Until sn>1000 Or ok=1
If ok=1
make object 5000+sn,4,0
set object rotation zyx 5000+sn
shot(sn,1)=power+1
shot(sn,0)=speed+2
shot(sn,3)=obj
shot(sn,2)=50
shotdata#(sn,0)=object position x(obj)
shotdata#(sn,1)=object position y(obj)
shotdata#(sn,2)=object position z(obj)
If obj<>304
shotdata#(sn,3)=object angle x(obj)
shotdata#(sn,4)=object angle y(obj)
shotdata#(sn,5)=object angle z(obj)
Else
shotdata#(sn,3)=camera angle x()
shotdata#(sn,4)=camera angle y()
shotdata#(sn,5)=camera angle z()
EndIf
p=power+1
fx#=object position x(obj)
fy#=object position y(obj)
fz#=object position z(obj)
ffx#=object angle x(obj)
ffy#=object angle y(obj)
ffz#=object angle z(obj)
position object 5000+sn,fx#,fy#,fz#
rotate object 5000+sn,wrapvalue(ffx#+90),ffy#,ffz#
move object 5000+sn,1
rotate object 5000+sn,ffx#,ffy#,ffz#
If p>0 And p<6 then texture object 5000+sn,2002 Else
If p>5 And p<51 then texture object 5000+sn,2003 Else
If p>50 And p<91 then texture object 5000+sn,2004 Else
If p>90 And p<96 then texture object 5000+sn,2005 Else
If p>95 then texture object 5000+sn,2006
play sound 4
If obj=304
If playinfo(16)<>16 And playinfo(16)>-1 And playinfo(16)<62
record(3)=record(3)+1
record(11)=record(11)+600
playinfo(17)=5
com$(0)="Thats a 600cr fine for Unlawful discharge of weapon."
comp(0)=200

playinfo(29)=playinfo(29)+6
EndIf
EndIf
EndIf
ENDFUNCTION
FUNCTION place_alloys(num,obj)
alnum=num
sn=0
ok=0
Repeat
If debris(sn,0)=0 And object exist(sn+7002)=0 And object exist(obj)=1
make object sn+7002,2,0
make object plain sn+7055,1,1
a=rnd(5)
texture object sn+7055,2001+a
position object sn+7002,object position x(obj),object position y(obj),object
position z(obj)
position object sn+7055,object position x(obj),object position y(obj),object
position z(obj)
rotate object sn+7002,rnd(359),rnd(359),rnd(359)
rotate object sn+7055,rnd(359),rnd(359),rnd(359)
debris(sn,0)=1
alnum=alnum-1
debris(sn,1)=rnd(30)+20
debris(sn,2)=rnd(2)+1
If alnum<=0 then ok=1
EndIf
sn=sn+1
Until sn>50 Or ok=1
ENDFUNCTION
FUNCTION position_alloys(num)
obj=num+7002
sobj=num+7055
If object exist(obj)=1 And debris(num,0)=1
dx#=object position x(obj)
dy#=object position y(obj)
dz#=object position z(obj)
For sp=0 To 21
If ndata(sp,0)=1 And ndata(sp,18)>0
If object exist(ndata(sp,18))=1
sx#=npos#(sp,0)
sy#=npos#(sp,1)
sz#=npos#(sp,2)
If dx#>sx#-1 And dx#<sx#+1 And dy#>sy#-1 And dy#<sy#+1 And dz#>sz#-1 And dz
#<sz#+1
If ndata(sp,1)=1
`ship is a scavenger
If sp<>21
ndata(sp,17)=ndata(sp,17)+1
Else
`If player then Alloys cargo is incremented by 1
playcargo(12)=playcargo(12)+1
EndIf
Else
ndata(sp,5)=ndata(sp,5)-(rnd(5)+1)
EndIf
EndIf
EndIf

EndIf
Next sp
debris(num,1)=debris(num,1)-1
If debris(num,1)<=0
delete object obj
delete object sobj
debris(num,0)=0
Else
move object obj,debris(num,2)
move object sobj,debris(num,2)
EndIf
EndIf
ENDFUNCTION
FUNCTION place_cargo(num,obj,carry)
alnum=num
sn=0
ok=0
Repeat
If cargo(sn,0)=0 And object exist(sn+62)=0 And object exist(obj)=1
make object sn+62,3,0
position object sn+62,object position x(obj),object position y(obj),object po
sition z(obj)
rotate object sn+62,rnd(359),rnd(359),rnd(359)
texture object sn+62,2004
cargo(sn,0)=1
alnum=alnum-1
tpe=rnd(28)
If carry>-1 then tpe=carry
If tpe=2 Or tpe=3 Or tpe=4 Or tpe=5 Or tpe=9 Or tpe=17 then tpe=22
If tpe=28
test=rnd(10000)
If test>100 then tpe=22
EndIf
cargo(sn,1)=tpe
cargo(sn,2)=rnd(2)+1
If alnum<=0 then ok=1
EndIf
sn=sn+1
Until sn>40 Or ok=1
ENDFUNCTION
FUNCTION position_cargo(num)
obj=num+62
If object exist(obj)=1 And cargo(num,0)=1
dx#=object position x(obj)
dy#=object position y(obj)
dz#=object position z(obj)
For sp=0 To 21
If ndata(sp,0)=1 And ndata(sp,18)>0
If object exist(ndata(sp,18))=1
sx#=npos#(sp,0)
sy#=npos#(sp,1)
sz#=npos#(sp,2)
If dx#<sx#-1000 Or dx#>sx#+1000 Or dy#<sy#-1000 Or dy#>sy#+1000 Or dz#<sz#1000 Or dz#>sz#+1000 then rge=1 Else rge=0
If dx#>sx#-1 And dx#<sx#+1 And dy#>sy#-1 And dy#<sy#+1 And dz#>sz#-1 And dz
#<sz#+1 And rge=0
If ndata(sp,1)=1
`ship is a scavenger

If sp<>21
ndata(sp,17)=ndata(sp,17)+1
Else
`If player then Alloys cargo is incremented by 1
playcargo(12)=playcargo(12)+1
EndIf
Else
ndata(sp,5)=ndata(sp,5)-(rnd(5)+1)
EndIf
EndIf
EndIf
EndIf
Next sp
If rge=1
delete object obj
cargo(num,0)=0
Else
move object obj,cargo(num,2)
EndIf
EndIf
ENDFUNCTION
FUNCTION IDNames()
`model numbers are:
`1-22
Planets
`23-45 Moons
`50
Sun
`305-356 Ships
`check sun
ink RGB(255,255,255),0
If object exist(50)=1
If object visible(50)=1
If object in screen(50)=1
ox=object screen x(50)
oy=object screen y(50)
Text ox+4,oy-8,sunname$(0)
EndIf
EndIf
EndIf
For n=1 To 20
If object exist(n)=1
If object visible(n)=1
If object in screen(n)=1
ox=object screen x(n)
oy=object screen y(n)
Text ox+4,oy-8,pname$(n)
EndIf
EndIf
EndIf
Next n
For n=22 To 42
If object exist(n)=1
If object visible(n)=1
If object in screen(n)=1
ox=object screen x(n)
oy=object screen y(n)
Text ox+4,oy-8,mname$(n-22)
EndIf
EndIf

EndIf
Next n
For n=305 To 355
If object exist(n)=1
If object visible(n)=1
If object in screen(n)=1
ox=object screen x(n)
oy=object screen y(n)
Text ox+4,oy-8,Nshipid$(n-305,0)
EndIf
EndIf
EndIf
Next n
ENDFUNCTION
FUNCTION deathanim()
timr=0
place_alloys(10,304)
cr=rnd(359)
ox#=object position x(304)
oy#=object position y(304)
oz#=object position z(304)
snd=rnd(2)
bob 1,1000,1000,1005
bob 2,1000,1000,1005
bob 3,1000,1000,1005
bob 1008,1000,1000,1005
play sound snd+1
hide object 304
hide object 5200
hide object 5201
Repeat
For a=0 To 49
position_alloys(a)
Next a
cpx#=ox#+Sin((2*cr)*3.1415923/360)*20
cpz#=oz#+Cos((2*cr)*3.1415923/360)*20
position camera cpx#,oy#,cpz#
point camera ox#,oy#,oz#
cr=cr+10
ink RGB(255,255,255),0
center text 320,350,"-=GAME OVER=-"
center text 320,370,"Press Enter to continue"
sync
Until scancode()=28
backdrop on
fog on
fog color RGB(0,0,0)
texture backdrop 1
set camera range 1,10000*opt(2)
fog distance (9900*opt(2))-100
ENDFUNCTION
FUNCTION moveshots()
For sn=0 To 1000
If object exist(5000+sn)=1
If shot(sn,2)<>0
shot(sn,2)=shot(sn,2)-1
If shot(sn,2)>0
move object 5000+sn,shot(sn,0)

`PUT IN COLLISION ROUTINE HERE


`Not USING ANY OF THE DARK BASIC COLLISION SYSTEMS
`THEY PUT A 10 SECOND PAUSE IN THE ACTION :(
For on=304 To 357
If object exist(on)=1
If object visible(on)=1
Dist#=Distance(5000+sn,on)
If Dist#<2
`If object hit is different from firing object
If on<>shot(sn,3)
If on=304
If ndata(playinfo(15),7)<=0
ndata(playinfo(15),5)=ndata(playinfo(15),5)-shot(sn,1)
Else
`If shields decrement ships shields according To damage
a=ndata(playinfo(15),7)
a=a-(shot(sn,1)*2)
If a<0
`difference in sheild power And damage, causes damage To ship
b=(shot(sn,1)*2)-ndata(playinfo(15),7)
ndata(playinfo(15),5)=ndata(playinfo(15),5)-(b/2)
EndIf
ndata(playinfo(15),7)=a
`shield flash
make object sphere 8000+304,5
position object 8000+304,object position x(304),object position y(30
4),object position z(304)
ghost object on 8000+304
EndIf
If ndata(playinfo(15),5)<=0
playdead=1
snd=rnd(2)
If object visible(on)=1 And ndata(playinfo(15),0)=1 then play sound
snd+1
Else
playdead=0
If object visible(on)=1 then play sound 5
EndIf
EndIf
If on>304 And on<325
If ndata(on-306,5)<ndata(on-306,25)/2
a=rnd(4)
If a=0 then com$(0)="DISTRESS: Help we are under attack."
If a=1 then com$(0)="DISTRESS: If anyone reads this please help."
If a=2 then com$(0)="DISTRESS: Help please, pirate attack"
If a=3 then com$(0)="DISTRESS: Help"
If a=4 then com$(0)="DISTRESS: We are under attack by pirates, pleas
e help"
comp(0)=200
a=rnd(50)
`MAKE PIRATE SHOW INTEREST IN THE VICTIM
If a<25
cp=0
oki=-1
Repeat
If ndata(cp,11)>0
If ndata(cp,6)>0
If object exist(ndata(cp,6))=1
If object visible(ndata(cp,6))=0
ndata(cp,6)=on

oki=1
EndIf
EndIf
EndIf
EndIf
cp=cp+1
Until oki<>-1 Or cp>20
EndIf
EndIf
`decrement ships damage by shot power
If ndata(on-306,7)<1
ndata(on-306,5)=ndata(on-306,5)-shot(sn,1)
Else
`If shields decrement ships shields according To damage
a=ndata(on-306,7)
a=a-(shot(sn,1)*2)
If a<0
`difference in sheild power And damage, causes damage To ship
b=(shot(sn,1)*2)-ndata(on-306,7)
ndata(on-306,5)=ndata(on-306,5)-(b/2)
EndIf
ndata(on-306,7)=a
`shield flash
make object sphere 8000+on,5
position object 8000+on,object position x(on),object position y(on),
object position z(on)
ghost object on 8000+on
EndIf
`make target aggresive towards attacker
ndata(on-306,27)=shot(sn,3)
If ndata(on-306,5)<=0
`If ship dead
snd=rnd(2)
If object visible(on)=1 And ndata(on-306,0)=1 then play sound snd+1
dc=ndata(on-306,25)/10
If dc>10 then dc=10
place_alloys(dc,on)
place_cargo(ndata(on-306,17),on,-1)
hide object on
ndata(on-306,0)=0
If shot(sn,3)=304
If ndata(on-306,11)>0
`If bounty increase players credits by bounty And Elite rating
playinfo(33)=playinfo(33)+ndata(on-306,11)
playinfo(31)=playinfo(31)+ndata(on-306,25)/10
Else
`otherwise increase Elite And wanted ratings
If playinfo(16)>-1 And playinfo(16)<62 And playinfo(16)<>50
record(0)=record(0)+1
record(11)=record(11)+10000
playinfo(17)=5
com$(0)="Murder is not tolerated here, thats a 10000cr fine"
comp(0)=200
playinfo(29)=playinfo(29)+ndata(on-306,25)/10
EndIf
playinfo(31)=playinfo(31)+ndata(on-306,25)/10
EndIf
EndIf
EndIf
If object visible(on)=1 And ndata(on-306,0)=1 then play sound 5

EndIf
delete object 5000+sn
shot(sn,2)=0
EndIf
EndIf
EndIf
EndIf
Next on
Else
delete object 5000+sn
shot(sn,2)=0
EndIf
EndIf
EndIf
Next sn
ENDFUNCTION playdead
FUNCTION Loadracefile(racefile$)
Dim checks(10)
sync on
For ax=0 To 10
checks(ax)=0
Next ax
If file exist(racefile$)=0
print "File access error: File cannot be found"
Else
open To Read 1,racefile$
`set file To no access mode And race number Not set
mode=-1
race=-1
Repeat
Read string 1,readstr$
If readstr$<>"" And mid$(readstr$,0)<>";"
If upper$(readstr$)="RACE NO"
If file End(1)=0
Read string 1,readstr$
race=Val(readstr$)
checks(0)=1
EndIf
EndIf
If upper$(readstr$)="RACE NAME"
If file End(1)=0 And race<>-1
Read string 1,readstr$
set cursor 0,race*16
print readstr$
racedesc$(race,0)=readstr$
checks(1)=1
EndIf
EndIf
If upper$(readstr$)="RACE INFO"
If file End(1)=0 And race<>-1
Read string 1,readstr$
racemisc$(race,0)=readstr$
Read string 1,readstr$
racemisc$(race,1)=readstr$
checks(7)=1
EndIf

EndIf
If upper$(readstr$)="MISSLE MODEL"
If file End(1)=0 And race<>-1
Read string 1,readstr$
racemisc$(race,2)=readstr$
checks(8)=1
EndIf
EndIf
If upper$(readstr$)="START SHIP"
If file End(1)=0 And race<>-1
Read string 1,readstr$
raceinfo(race,8)=Val(readstr$)
checks(9)=1
EndIf
EndIf
If upper$(readstr$)="DESCRIPTION"
If file End(1)=0 And race<>-1
Read string 1,readstr$
lns=Val(readstr$)
If lns>0
For rl=0 To lns-1
If file End(1)=0
Read string 1,racedesc$(race,rl+1)
EndIf
Next rl
EndIf
checks(2)=1
EndIf
EndIf
If upper$(readstr$)="RANK INFO"
If file End(1)=0 And race<>-1
For rn=0 To 11
If file End(1)=0
Read string 1,readstr$
racerank$(race,rn)=readstr$
EndIf
Next rn
checks(3)=1
EndIf
EndIf
If upper$(readstr$)="HOME SECTOR"
If file End(1)=0 And race<>-1
Read string 1,readstr$
raceinfo(race,0)=Val(readstr$)
Read string 1,readstr$
raceinfo(race,1)=Val(readstr$)
Read string 1,readstr$
raceinfo(race,2)=Val(readstr$)
set cursor 380,(race)*16
print raceinfo(race,0);"-";raceinfo(race,1);" ";raceinfo(race,2)
checks(4)=1
EndIf
EndIf
If upper$(readstr$)="HATRED"
If file End(1)=0 And race<>-1
Read string 1,readstr$
lns=Val(readstr$)
set cursor 180,race*16
print "Hates : ";lns
If lns>0

For rn=0 To lns-1


Read string 1,hatred$(race,rn)
Next rn
EndIf
checks(5)=1
EndIf
EndIf
If upper$(readstr$)="SHIP INFO"
If file End(1)=0 And race<>-1
Read string 1,readstr$
lns=Val(readstr$)
raceinfo(race,3)=lns
set cursor 280,race*16
print "Ships : ";lns
If lns>0
For rn=0 To lns-1
Read string 1,shipname$((race*50)+rn)
For sd=0 To 12
Read string 1,readstr$
shipdata((race*50)+rn,sd)=Val(readstr$)
Next sd
Read string 1,shipmodel$((race*50)+rn)
If race=0
`
text 0,250+(rn*16),shipname$((race*50)+rn)
`
text 200,250+(rn*16),shipmodel$((race*50)+rn)
EndIf
Next rn
Else
close file 1
print "Error:Race must have at least one ship type"
print "Press a key to quit"
suspend For key
End
EndIf
checks(6)=1
EndIf
EndIf
EndIf
Until file End(1)=1
close file 1
EndIf
ok=-1
For ax=0 To 9
If checks(ax)=0 then ok=ax
Next ax
If ok<>-1
If ok=0 then print "Error: Race number"
If ok=1 then print "Error: Race name"
If ok=2 then print "Error: Race description"
If ok=3 then print "Error: Rank Information"
If ok=4 then print "Error: Home Sector details"
If ok=5 then print "Error: Hatred details"
If ok=6 then print "Error: Ship information"
If ok=7 then print "Error: Race information"
If ok=8 then print "Error: Missle Model information"
If ok=9 then print "Error: Start Ship information"
print " missing or incorrectly placed"
print "Press a key to exit"
suspend For key
End

EndIf
sync off
undim checks(7)
ENDFUNCTION
FUNCTION LoadRaces()
`number of races
nor=0
set dir "data"
rem Begin search For files in current working directory
find first
rem Create Array And index variable
Dim item$(512)
items=1
cur=0
ink RGB(255,255,255),0
rem begin Repeat loop
Repeat
rem add To item Array If file found
If get file type()=0
nm$=get file name$()
sp=0
Repeat
cc$=mid$(nm$,sp)
sp=sp+1
Until sp>Len(nm$) Or cc$="."
ext$=""
Repeat
cc$=mid$(nm$,sp)
ext$=ext$+cc$
sp=sp+1
Until sp>Len(nm$)
If upper$(ext$)="INFO.TXT"
cur=cur+16
nor=nor+1
loadracefile(nm$)
item$(items)=nm$
items=items+1
EndIf
EndIf
rem Find Next file in current working directory
find Next
Rem Repeat loop Until no more files in current working directory
Until get file type()=-1
set dir ".."
If nor=0
print "No race files found, make sure they are in the data directory"
print "Press return to quit"
Repeat
Until scancode()=28
End
EndIf
undim item$(512)

ENDFUNCTION
FUNCTION movemissle()
de=0
For n=0 To 50
If missle(n,2)>-1
If object exist(15500+n)=1
move object 15500+n,missle(n,0)
show object 15500+n
`
zrotate object 15500+n,wrapvalue(object angle z(15500+n)+1.5)
missle(n,2)=missle(n,2)-1
If missle(n,2)<0
delete object 15500+n
missle(n,1)=-1
place_alloys(3,15500+n)
EndIf
`
com$(0)=str$(missle(n,5))
`
comp(0)=200
`
com$(0)=com$(0)+":"
`
com$(0)=com$(0)+str$(missle(n,3))
`homing missle guidance system
If missle(n,5)=3 Or missle(n,5)=4
`If target destroyed by something Else then destroy missle
If object exist(missle(n,4))=0 then missle(n,2)=-1
If missle(n,2)>0
`get current rotation of missle
cxr#=object angle x(15500+n)
cyr#=object angle y(15500+n)
czr#=object angle z(15500+n)
`get position of target
nx#=object position x(missle(n,4))
ny#=object position y(missle(n,4))
nz#=object position z(missle(n,4))
`get desired rotation of missle (towards target)
point object 15500+n,nx#,ny#,nz#
nxr#=object angle x(15500+n)
nyr#=object angle y(15500+n)
nzr#=object angle z(15500+n)
`Return missle To original rotation
rotate object 15500+n,cxr#,cyr#,czr#
`rotate missle a little (10 degrees) towards target this is To simulate
`the missle tracking the enemy
If nxr#<cxr#
xrotate object 15500+n,wrapvalue(cxr#-10)
EndIf
If nxr#>cxr#
xrotate object 15500+n,wrapvalue(cxr#+10)
EndIf
If nyr#<cyr#
yrotate object 15500+n,wrapvalue(cyr#-10)
EndIf
If nyr#>cyr#
yrotate object 15500+n,wrapvalue(cyr#+10)
EndIf
If nxr#<wrapvalue(cxr#+5) Or nxr#>wrapvalue(cxr#-5)
xrotate object 15500+n,nxr#
EndIf
If nyr#<wrapvalue(cyr#+5) Or nyr#>wrapvalue(cyr#-5)
yrotate object 15500+n,nyr#

EndIf
EndIf
EndIf
If object exist(15500+n)
sx#=object position x(15500+n)
sy#=object position y(15500+n)
sz#=object position z(15500+n)
EndIf
If missle(n,5)=1 then dam=100
If missle(n,5)=2 then dam=250
If missle(n,5)=3 then dam=100
If missle(n,5)=4 then dam=250
If missle(n,5)=5 then dam=150
If missle(n,5)=6 then dam=350
If missle(n,5)=7 then dam=0
`7 is a dummy mine ;)
If missle(n,5)<>7
For on=1 To 400
If object exist(on)=1
If object visible(on)=1
ox#=object position x(on)
oy#=object position y(on)
oz#=object position z(on)
If ox#>sx#-2 And ox#<sx#+2 And oz#>sz#-2 And oz#<sz#+2 And oy#>sy#-2 And
oy#<sy#+2
`If object hit is different from firing object
If on<>missle(n,3)
If on=304
If ndata(playinfo(15),7)<=0
ndata(playinfo(15),5)=ndata(playinfo(15),5)-dam
Else
`If shields decrement ships shields according To damage
a=ndata(playinfo(15),7)
a=a-(dam*2)
If a<0
`difference in sheild power And damage, causes damage To ship
b=(dam*2)-ndata(playinfo(15),7)
ndata(playinfo(15),5)=ndata(playinfo(15),5)-(b/2)
EndIf
ndata(playinfo(15),7)=a
`shield flash
make object sphere 8000+304,5
position object 8000+304,object position x(304),object position y(30
4),object position z(304)
ghost object on 8000+304
EndIf
If ndata(playinfo(15),5)<=0
playdead=1
snd=rnd(2)
If object visible(on)=1 And ndata(playinfo(15),0)=1 then play sound
snd+1
Else
playdead=0
If object visible(on)=1 then play sound 5
EndIf
EndIf
If on>304 And on<325
If ndata(on-306,5)<ndata(on-306,25)/2
a=rnd(4)
If a=0 then com$(0)="DISTRESS: Help we are under attack."

If
If
If
If

a=1
a=2
a=3
a=4

then
then
then
then

com$(0)="DISTRESS:
com$(0)="DISTRESS:
com$(0)="DISTRESS:
com$(0)="DISTRESS:

If anyone reads this please help."


Help please, pirate attack"
Help"
We are under attack by pirates, pleas

e help"
comp(0)=200
a=rnd(50)
`MAKE PIRATE SHOW INTEREST IN THE VICTIM
If a<25
cp=0
oki=-1
Repeat
If ndata(cp,11)>0
If ndata(cp,6)>0
If object exist(ndata(cp,6))=1
If object visible(ndata(cp,6))=0
ndata(cp,6)=on
oki=1
EndIf
EndIf
EndIf
EndIf
cp=cp+1
Until oki<>-1 Or cp>20
EndIf
EndIf
`decrement ships damage by shot power
If ndata(on-306,7)<1
ndata(on-306,5)=ndata(on-306,5)-dam
Else
`If shields decrement ships shields according To damage
a=ndata(on-306,7)
a=a-(dam*2)
If a<0
`difference in sheild power And damage, causes damage To ship
b=(dam*2)-ndata(on-306,7)
ndata(on-306,5)=ndata(on-306,5)-(b/2)
EndIf
ndata(on-306,7)=a
`shield flash
make object sphere 8000+on,5
position object 8000+on,object position x(on),object position y(on),
object position z(on)
ghost object on 8000+on
EndIf
`make target aggresive towards attacker
ndata(on-306,27)=missle(n,3)
If ndata(on-306,5)<=0
`If ship dead
snd=rnd(2)
If object visible(on)=1 And ndata(on-306,0)=1 then play sound snd+1
dc=ndata(on-306,25)/10
If dc>10 then dc=10
place_alloys(dc,on)
place_cargo(ndata(on-306,17),on,-1)
hide object on
ndata(on-306,0)=0
If missle(n,3)=304
If ndata(on-306,11)>0
`If bounty increase players credits by bounty And Elite rating

playinfo(33)=playinfo(33)+ndata(on-306,11)
playinfo(31)=playinfo(31)+ndata(on-306,25)/10
Else
`otherwise increase Elite And wanted ratings
If playinfo(16)>-1 And playinfo(16)<62 And playinfo(16)<>50
record(0)=record(0)+1
record(11)=record(11)+10000
playinfo(17)=5
com$(0)="Murder is not tolerated here, thats a 10000cr fine"
comp(0)=200
playinfo(29)=playinfo(29)+ndata(on-306,25)/10
EndIf
playinfo(31)=playinfo(31)+ndata(on-306,25)/10
EndIf
EndIf
EndIf
If object visible(on)=1 And ndata(on-306,0)=1 then play sound 5
EndIf
delete object 15500+n
missle(n,2)=-1
EndIf
EndIf
EndIf
EndIf
Next on
EndIf
Else
missle(n,2)=-1
EndIf
EndIf
Next n
ENDFUNCTION de
FUNCTION FireMissle(obj,speed,target,mtype)
`model 15500-15550
ok=-1
Repeat
ok=ok+1
Until missle(ok,2)=-1 Or ok>50
If ok<51
`located missle To fire.
If object exist(15500+ok)=0
If mtype<5 then make object 15500+ok,5,0 Else make object sphere 15500+ok,1
set object rotation zyx 15500+ok
make object sphere 15600,5
missle(ok,0)=speed+1
missle(ok,1)=250
missle(ok,2)=250
If mtype>4
`dummy mines dont explode they Continue drifting
missle(ok,0)=1
If mtype=7 then missle(ok,2)=65500
EndIf
missle(ok,3)=obj
missle(ok,4)=target
missle(ok,5)=mtype
fx#=object position x(obj)
fy#=object position y(obj)
fz#=object position z(obj)
ffx#=object angle x(obj)

ffy#=object angle y(obj)


ffz#=object angle z(obj)
position object 15600,fx#,fy#,fz#
rotate object 15600,wrapvalue(ffx#+90),ffy#,ffz#
move object 15600,1
rotate object 15600,ffx#,ffy#,ffz#
position object 15500+ok,object position x(15600),object position y(15600),ob
ject position z(15600)
rotate object 15500+ok,object angle x(15600),object angle y(15600),object ang
le z(15600)
delete object 15600
missledata#(ok,0)=object position x(obj)
missledata#(ok,1)=object position y(obj)
missledata#(ok,2)=object position z(obj)
missledata#(ok,3)=object angle x(obj)
missledata#(ok,4)=object angle y(obj)
missledata#(ok,5)=object angle z(obj)
EndIf
EndIf
ENDFUNCTION
FUNCTION Otherdevice(xr#,yr#,zr#)
`MOUSE
If control(0)=1
`adjust sensitivity
If control(1)>0 then div=control(1)/10
xmm=mousemovex()*(div)
ymm=mousemovey()*(div)
rotate camera wrapvalue(xr#+ymm),wrapvalue(yr#+xmm),zr#
EndIf
`ANALOGUE LOYSTICK
If control(0)=2
If control(1)>0
xd=(joystick x()/(10-control(1)))
yd=(joystick y()/(10-control(1)))
Else
xd=joystick x()
yd=joystick y()
EndIf
xr#=xr#+yd
yr#=yr#+xd
rotate camera wrapvalue(xr#),wrapvalue(yr#),zr#
EndIf
`DIGITAL JOYSTICK
If control(0)=3
If joystick up()=1 then xr#=xr#+2
If joystick down()=1 then xr#=xr#-2
If joystick Left()=1 then yr#=yr#-2
If joystick Right()=1 then yr#=yr#+2
rotate camera wrapvalue(xr#),wrapvalue(yr#),zr#
EndIf
ENDFUNCTION
FUNCTION Eject()
bob 1,1000,1000,1005
bob 2,1000,1000,1005
bob 3,1000,1000,1005
bob 1008,1000,1000,1005
scale object 304,20,20,20
make object cube 55000,1

hide object 55000


hide object 5200
hide object 5201
xrotate object 55000,wrapvalue(camera angle x()-90)
For n=0 To 50
move object 55000,0.1
ox#=object position x(55000)
oy#=object position y(55000)
position camera ox#,oy#,camera position z()
` point camera object position x(304),object position y(304),object position z(
304)
sync
Next n
delete object 55000
`locate populated planet Or station And position player there
If sectordata(playinfo(2),9)=1
ok=0
If sectordata(playinfo(2),6)>0
`If stations exist in system place player nearby ;)
position object 304,object position x(51),object position y(51),object positi
on z(51)
scale object 304,5,5,5
position camera object position x(51),object position y(51),object position z
(51)
playinfo(16)=51
Docked()
ok=1
Else
`otherwise land on planet =)
position object 304,object position x(1),object position y(1),object position
z(1)
scale object 304,5,5,5
position camera object position x(1),object position y(1),object position z(1
)
playinfo(16)=1
Docked()
ok=1
EndIf
Else
Repeat
ok=0
ink RGB(50,50,50),0
box 0,0,639,479
ink RGB(255,255,255),0
text 20,20,"Message from : Deep Salvage Corp (Galactic Insurance Group)."
text 20,36,"To : Escape Capsule Occupant"
center text 320,70,"We recieved your distress call and managed to get here in
time,"
center text 320,86,"however your ship was very badly damaged from the conflic
t that you were"
center text 320,102,"involved in. We have replaced your craft with one of a s
imilar make and"
center text 320,118,"model with 7(ly) of fuel (as per your insurance agreemen
t)."
center text 320,146,"However we enforce the right to 'confiscate' all cargo f
rom the"
center text 320,162,"salvaged ship and its surrounding area. I would recommen
d that"
center text 320,178,"you set a course for the nearest inhabited system and ge

t the"
center text 320,196,"components to continue your travels."
center text 320,230,"Deep Salvage Corp"
center text 320,246,"A G.I.S. member"
mx=MouseX()
my=MouseY()
bob 65500,MouseX(),MouseY(),2000
If (mx>219 And mx<421 And my>447 And my<469 And ss<>65535)
ink RGB(100,100,100),0
box 220,448,420,468
ink RGB(255,255,255),0
center text 320,450,"Continue"
If mouseclick()=1 then ok=1
Else
ink RGB(0,0,0),0
box 220,448,420,468
If ss<>65535 then ink RGB(255,255,255),0 Else ink RGB(50,50,50),0
center text 320,450,"Continue"
EndIf
sync
Until ok<>0
ok=1
EndIf
If ok=0
EndIf
For n=0 To 44
playcargo(n)=0
Next n
shipbitz(13)=0
If shipbitz(0)>0 then shipbitz(12)=7
ENDFUNCTION
`Function To make inserting NEW code nice And neat
Function UpdateShots()
`Adjusted update shot functions (created by Mark And Ed)
Deletions=0
`If there be shots
If ShotArray(0)
`Check shots For deletion
For ShotClear=1 To ShotArray(0)
`If distance is greater than 2k
ShotErray#(ShotClear)=ShotErray#(ShotClear)+(2.5+ShotSpe
ed(ShotClear))
If ShotErray#(ShotClear)>250.0
`Delete exhausted round
If object exist(ShotArray(ShotClear))=1
Delete Object ShotArray(ShotClear)
EndIf
ShotErray#(ShotClear)=0.0
Inc Deletions
EndIf
Next ShotClear
`If Deletions were made Re-Shuffle index Array
If Deletions
For ShuffleLoop=1 To ShotArray(0)-1
If ShotErray#(ShuffleLoop)=0.0
ShotErray#(ShuffleLoop)=ShotErray#(Shuff
leLoop+1)
ShotPower(ShuffleLoop)=ShotPower(ShuffleLoop+1)
ShotSpeed(ShuffleLoop)=ShotSpeed(ShuffleLoop+1)

ShotArray(ShuffleLoop)=ShotArray(Shuffle
Loop+1)
ShotErray#(ShuffleLoop+1)=0.0
EndIf
Next ShuffleLoop
`Decrement shots counter
ShotArray(0)=ShotArray(0)-Deletions
Deletions=0
EndIf
`Move remaining shots
If ShotArray(0)
For ShotClear=1 To ShotArray(0)
If Object Exist(ShotArray(ShotClear))=1
Move Object ShotArray(ShotClear),2.5+ShotSpeed(S
hotClear)
EndIf
`ADD SHOT COLLISION CHECK IN HERE (only ships)
Scroll Object Texture ShotArray(ShotClear),(0.01
*RND(GunType(0)))*State,(0.01*RND(GunType(0)))*State
Next ShotClear
EndIf
EndIf
EndFunction
Function Fire(power,obj,speed)
`locate free show object
sa=0
Repeat
sa=sa+1
Until sa>999 Or object exist(sa+5000)=0
If sa<1000
`Marks updated Lazer function (With additions from Ed)
p=power
`OBJ = Firing object
ShotArray(0)=ShotArray(0)+1
ShotArray(ShotArray(0))=sa+5000
If p>0 And p<6 then Current(0)=4 Else
If p>5 And p<51 then Current(0)=5 Else
If p>50 And p<91 then Current(0)=2 Else
If p>90 And p<96 then Current(0)=1 Else
If p>95 then Current(0)=6
Make Object ShotArray(ShotArray(0)),LaserMesh(0),Current(0)+56400
ShotPower(ShotArray(0))=power
ShotSpeed(ShotArray(0))=speed
`If obj=0 then Camera fires otherwise shot comes from an Object (For NPC's e
tc)
If obj=0
Position Object ShotArray(ShotArray(0)),Camera Position X(),Camera Positio
n Y(),Camera Position Z()
Set Object To Camera Orientation ShotArray(ShotArray(0))
Pitch Object Down ShotArray(ShotArray(0)),75.0
Move Object ShotArray(ShotArray(0)),2.5
Pitch Object Up ShotArray(ShotArray(0)),75.0
Else
If object exist(obj)=1
Position Object ShotArray(ShotArray(0)),Object Position X(obj),Object Pos
ition Y(obj),Object Position Z(obj)
Set Object To Object Orientation ShotArray(ShotArray(0)),obj

EndIf
EndIf
Scale Object ShotArray(ShotArray(0)),100.0,100.0,1000.0
Set Object ShotArray(ShotArray(0)),1,1,0,1,0,0,0
Ghost Object On ShotArray(ShotArray(0))
Scroll Object Texture ShotArray(ShotArray(0)),0.0,0.5
EndIf
EndFunction
`MAIN LOOP
MAIN:
create bitmap 1,256,256
`front facing cam
cscr=0
cls 0
`id system To show planet names etc
idsys(0)=1
`make all shots inactive
For n=0 To 500
shot(n,4)=-1
Next n
`create stars
ink RGB(255,255,255),RGB(0,0,0)
For n=0 To 25
sx=Int(rnd(256))
sy=Int(rnd(256))
dot sx,sy
Next n
ink RGB(155,155,155),RGB(0,0,0)
For n=0 To 25
sx=Int(rnd(256))
sy=Int(rnd(256))
dot sx,sy
Next n
ink RGB(55,55,55),RGB(0,0,0)
For n=0 To 25
sx=Int(rnd(256))
sy=Int(rnd(256))
dot sx,sy
Next n
`backdrop starfield
get image 1,0,0,256,256
delete bitmap 1
rem Space texture
create bitmap 2,256,256
ink RGB(55,55,205),RGB(0,0,0) : cls
nx=rnd(256)
ny=rnd(256)
t=rnd(500)+1000
Repeat
nx=nx+rnd(1)
ny=ny+rnd(1)
nx=nx-rnd(1)
ny=ny-rnd(1)
If nx<0 then nx=256
If nx>256 then nx=0
If ny<10 then ny=245
If ny>245 then ny=10
dot nx,ny

t=t-1
Until t<0
For nc=0 To rnd(40)+5
ink RGB(rnd(255),rnd(255),rnd(255)),RGB(0,0,0)
nx=rnd(255)
ny=rnd(255)
t=rnd(500)+1000
Repeat
nx=nx+rnd(1)
ny=ny+rnd(1)
nx=nx-rnd(1)
ny=ny-rnd(1)
If nx<0 then nx=256
If nx>256 then nx=0
If ny<10 then ny=245
If ny>245 then ny=10
dot nx,ny
t=t-1
Until t<0
Next nc
blur bitmap 2,3
get image 6002,0,0,256,256
delete bitmap 2
camdir=0
ink RGB(0,0,0),0
box 0,0,639,479
ink RGB(255,255,255),0
Loading_screen()
bob 1,1000,1000,2000
bob 2,1000,1000,2000
bob 3,1000,1000,2000
sync
Restore NPCName
For n=0 To 100
na$=""
Read na$
NPCname$(n,0)=na$
Next n
For n=0 To 100
na$=""
Read na$
NPCname$(n,1)=na$
Next n
Restore NPCCompany
For n=0 To 100
na$=""
Read na$
NPCcompany$(n,0)=na$
Next n
For n=0 To 100
na$=""
Read na$
NPCcompany$(n,1)=na$
Next n
For n=0 To 100
na$=""
Read na$
NPCcompany$(n,2)=na$
Next n

`Read in planet names


Restore Planetname
For n=0 To 159
na$=""
Read na$
PMiddle$(n)=na$
Next n
For n=0 To 37
na$=""
Read na$
Plast$(n)=na$
Next n
For n=0 To 7
na$=""
Read na$
Pfirst$(n)=na$
Next n
`shipyard items
Restore shipyardinformation
For n=0 To 35
Read shipyarditem$(n)
For a=0 To 2
Read shipyarddata(n,a)
Next a
Next n
galaxyseed=0
playinfo(2)=0
playinfo(15)=21
`Disables the escape key so user use the Alt+Q combination
`this also makes the game look more professional
` disable escapekey
backdrop off
autocam off
hide mouse
sync on
`create mesh For laser shots,debris And cargo
load object "models\asteroid.x",5000
make mesh from object 1,5000
delete object 5000
load object "models\debris.x",5000
make mesh from object 2,5000
delete object 5000
load object "models\cargo.x",5000
scale object 5000,50,50,50
make mesh from object 3,5000
delete object 5000
load object "models\lazershot.x",5000
make mesh from object 4,5000
delete object 5000
load object "models\missle.x",5000
make mesh from object 5,5000
delete object 5000
`Create Laser mesh
Make Object Sphere 1,1.0
LaserMesh(0)=6
Make Mesh from Object 6,1
Delete Object 1
missleselect=0
fuelinc=0
blag=0 : `cheat variable

setupships()
bob 1,MouseX(),MouseY(),2000
ModelDisplay()
playinfo(33)=100
Title_sequence()
cls
create bitmap 14,520,520
`create stars
ink RGB(254,254,254),RGB(0,0,0)
For n=0 To 255
sx=Int(rnd(512))
sy=Int(rnd(512))
dot sx,sy
Next n
ink RGB(200,200,200),RGB(0,0,0)
For n=0 To 255
sx=Int(rnd(512))
sy=Int(rnd(512))
dot sx,sy
Next n
ink RGB(155,155,155),RGB(0,0,0)
For n=0 To 255
sx=Int(rnd(512))
sy=Int(rnd(512))
dot sx,sy
Next n
`backdrop starfield
get image 1,0,0,512,512
delete bitmap 14
If loadr(0)=0
playinfo(12)=7
playinfo(11)=0
playinfo(13)=7
playinfo(14)=0
playinfo(5)=304
playinfo(15)=21
playinfo(16)=-1
op=1
playinfo(8)=6555
playinfo(2)=6555
playinfo(34)=shipdata(playinfo(35),9)
shipbitz(0)=1
shipbitz(1)=1
`missle pylons
ndata(playinfo(15),31)=shipdata(playinfo(35),7)
ndata(playinfo(15),32)=0
`ship damages etc
ndata(playinfo(15),5)=shipdata(playinfo(35),8)
ndata(playinfo(15),25)=shipdata(playinfo(35),8)
`If player using mode 3200
If playinfo(35)=3200
ndata(playinfo(15),5)=100
ndata(playinfo(15),25)=100
ndata(playinfo(15),7)=1000
ndata(playinfo(15),9)=1000
playinfo(34)=80
playinfo(33)=100
playinfo(8)=35
shipbitz(1)=1
shipbitz(2)=0

shipbitz(3)=0
shipbitz(4)=0
shipbitz(8)=4
shipbitz(28)=1
shipbitz(10)=1
shipbitz(13)=1
shipbitz(17)=1
shipbitz(18)=1
shipbitz(21)=1
shipbitz(15)=10
ndata(playinfo(15),31)=4
ndata(playinfo(15),32)=0
playinfo(31)=32000
EndIf
`If player using mode 3201
If playinfo(35)=3201
ndata(playinfo(15),5)=65500
ndata(playinfo(15),25)=65500
playinfo(34)=65500
playinfo(33)=playinfo(33)+1000000
playinfo(12)=65500
playinfo(13)=65500
playinfo(8)=35
blag=1
shipbitz(1)=1
shipbitz(28)=1
shipbitz(10)=1
shipbitz(13)=1
shipbitz(17)=1
shipbitz(18)=1
shipbitz(21)=1
ndata(playinfo(15),31)=0
ndata(playinfo(15),32)=0
EndIf
rapid=0
For n=0 To 30
playMinfo(n,0)=0
Next n
For n=0 To 100
playpay(n)=0
playcrew$(n)=""
Next n
turretx#=camera angle x()
turrety#=camera angle y()
turretz#=camera angle z()
make object cube 5200,0.1
make object cube 5201,0.1
scale object 5201,50,50,1000
JUMP:
autocam on
set current bitmap 0
backdrop off
bob 1,1000,1000,2000
cls 0
sysinfo(0)=0
sysinfo(1)=0
If op=1
Galactic_map("Please select your starting system",1,playinfo(3),playinfo(4),0
)
autocam off

backdrop off
position camera 55000,55000,55000
op=0
Else
Galactic_map("Hyperspace to which system",0,0,0,0)
cls 0
Title_bar("Hyperspacing now")
EndIf
bob 1,1000,1000,2000
` center text 320,220,"Creating system please wait this may take a while..."
autocam off
EndIf
nop=sectordata(playinfo(2),4)
nom=sectordata(playinfo(2),5)
sta=sectordata(playinfo(2),6)
noa=sectordata(playinfo(2),7)
astr=(sectordata(playinfo(2),8))*opt(2)
create_system(sysinfo(0),sysinfo(1),nop,nom,sta,astr,noa,0,sname$(playinfo(2)))
`ERRORTRAPPING
backdrop on
fog on
fog color RGB(0,0,0)
` color backdrop RGB(0,0,0)
texture backdrop 1
cx#=0
cy#=0
cz#=0
bx#=0
by#=0
ca=0
season=rnd(100)
shipspeed=0
If loadr(0)=0
xx=0+Sin((2*rnd(65535))*3.1415923/360)*8000
yy=0+Cos((2*rnd(65535))*3.1415923/360)*8000
position camera xx,0,yy
` point camera 0,0,0
` sync
Else
`If loading put player where they should be!!!
position camera npos#(playinfo(15),0),npos#(playinfo(15),1),npos#(playinfo(15)
,2)
rotate camera npos#(playinfo(15),3),npos#(playinfo(15),4),npos#(playinfo(15),5
)
` sync
EndIf
`set camera rotation zyx
xrot#=camera angle x()
yrot#=camera angle y()
zrot#=camera angle z()
lmc=0
pausetime=0
rem Make sky sphere
make object sphere 6002,40000
set object 6002,1,0,0,1,0,0,0
load object "models\world.x",6103
scale object 6103,700000,700000,700000
set object 6103,1,1,0,1,0,0,0
texture object 6002,6002
` set object 6103,1,1,0

texture object 6103,1


make light 1
set point light 1,0,0,0
Repeat
If ndata(playinfo(15),24)=3200 Or playinfo(35)=3200 then ndata(playinfo(15),8)=
35
`rotate sun To face player
point object 50,camera position x(),camera position y(),camera position z()
ang#=camera angle x()
If ang#>90 And ang#<270 then rev=1 Else rev=0
cpx#=camera position x()
cpy#=camera position y()
cpz#=camera position z()
` spx=object position x(50)
` spy=object position y(50)
` spz=object position z(50)
`relative To Sun (close proximity!!!)
If playinfo(16)=50
If playinfo(12)<playinfo(13)
fuelinc=fuelinc+1
fia=1
If fuelinc=500
playinfo(12)=playinfo(12)+1
fuelinc=0
EndIf
EndIf
Else
fia=0
EndIf
If comp(0)>0
ink RGB(255,255,255),0
center text 320,310,com$(0)
comp(0)=comp(0)-5
EndIf
If stime>0 then stime=stime-1
`Key (F1) For information system
If keystate(59)=1 And stime<=0
cscr=cscr+1
If cscr>3 then cscr=0
stime=5
EndIf
If camtime>0 then camtime=camtime-1
If keystate(60)=1 And camtime<=0
camdir=camdir+1
camtime=20
If camdir>3 then camdir=0
EndIf
If keystate(61)=1 And stime<=0
If rapid=0 then rapid=1 Else rapid=0
stime=5
EndIf
If cscr<>0 Or cm<>0 then mouselock=1 Else mouselock=0
If keystate(keys(8))=1 then coi=information()
If cscr=0 And coi=-2 And mouseclick()=1
n=1
loc=-1
mx=MouseX()
my=MouseY()
Repeat
If object exist(n)=1

If object in screen(n)=1
If object screen x(n)>mx-6 And object screen x(n)<mx+6
If object screen y(n)>my-6 And object screen y(n)<my+6
coi=n
loc=n
EndIf
EndIf
EndIf
EndIf
n=n+1
Until n>356 Or loc>-1
If loc=-1 then coi=0
EndIf
If coi=-2
ink RGB(255,255,255),0
text 500,50,"ID Active"
EndIf
If coi>0 then ido=idobj(coi)
If ido=0 And coi<>-2 then coi=0
jfb=0
If joystick fire c()=1 then jfb=1
If joystick fire d()=1 then jfb=2
If joystick fire c()=1 And joystick fire d()=1 then jfb=3
If keystate(keys(4))=1 Or jfb=2 then shipspeed=shipspeed+1
If keystate(keys(5))=1 Or jfb=1 then shipspeed=shipspeed-1
If keystate(keys(7))=1
cm=1
ca=1
Communications(cm,coi)
EndIf
If control(0)<>0 And cscr=0
mok=0
If control(0)=1 And mouselock=1 then mok=-1
If mok=0 then Otherdevice(xrot#,yrot#,zrot#)
xrot#=camera angle x()
yrot#=camera angle y()
zrot#=camera angle z()
EndIf
If keystate(keys(1))=1
xrot#=wrapvalue(xrot#-2)
If xrot#<0 then xrot#=xrot#+360
by#=by#-10
If by#<0 then by#=90
pitch camera up 2
EndIf
If keystate(keys(0))=1
xrot#=wrapvalue(xrot#+2)
If xrot#>359 then xrot#=xrot#-360
by#=by#+10
If by#>90 then by#=0
pitch camera down 2
EndIf
If keystate(keys(2))=1
If rev=0 then yrot#=wrapvalue(yrot#-2) Else yrot#=wrapvalue(yrot#+2)
If yrot#<0 then yrot#=yrot#+360
bx#=bx#-5
If bx#<0 then bx#=95
If bx#>95 then bx#=0
If EliteControl(0)=0 then turn camera left 2 Else roll camera left 2
EndIf

If keystate(keys(12))=1 then Eject()


If keystate(keys(3))=1
If rev=0 then yrot#=wrapvalue(yrot#+2) Else yrot#=wrapvalue(yrot#-2)
If yrot#>359 then yrot#=yrot#-360
bx#=bx#+5
If bx#>95 then bx#=0
If bx#<0 then bx#=95
If EliteControl(0)=0 then turn camera right 2 Else roll camera right 2
EndIf
` rotate camera xrot#,yrot#,zrot#
rotate object 304,xrot#,yrot#,zrot#
position object 304,camera position x(),camera position y(),camera position z()
Npos#(playinfo(15),0)=camera position x()
Npos#(playinfo(15),1)=camera position y()
Npos#(playinfo(15),2)=camera position z()
Npos#(playinfo(15),3)=camera angle x()
Npos#(playinfo(15),4)=camera angle y()
Npos#(playinfo(15),5)=camera angle z()
If scancode()=58 then blag=1
If scancode()=62 then galactic_map("Hyperspace to which system",0,playinfo(3),p
layinfo(4),0)
If keystate(keys(15))=1 And playinfo(8)<10
If shipbitz(0)>0
If playinfo(16)>0 And playinfo(16)<41 Or playinfo(16)>50 And playinfo(16)<62
com$(0)="FTL Drive is proximity locked"
comp(0)=100
Else
If playinfo(11)<=playinfo(12)
If playinfo(8)<>playinfo(2)
EnterHyperspace()
nop=sectordata(playinfo(2),4)
nom=sectordata(playinfo(2),5)
sta=sectordata(playinfo(2),6)
noa=sectordata(playinfo(2),7)
astr=sectordata(playinfo(2),8)
EndIf
EndIf
EndIf
Else
com$(0)="Drive does not have FTL capability"
comp(0)=100
EndIf
EndIf
If keystate(keys(10))=1 Or jfb=3 then shipspeed=0
` If scancode()<>0
` set cursor 100,100
` print scancode()
` EndIf
cx#=camera angle x()
cy#=camera angle y()
cz#=camera angle z()
rotate object 304,cx#,cy#,cz#
If cx#<0 then cx#=cx#+360
If cx#>359 then cx#=cx#-360
` ndata(playinfo(15),33)=ndata(playinfo(15),33)-Abs(shipspeed*3)
jmp=0
If keystate(keys(9))=1
If playinfo(16)>0 And playinfo(16)<41 Or playinfo(16)>49 And playinfo(16)<62
com$(0)="Jump Drive is proximity locked"
comp(0)=100

Else
ndata(playinfo(15,33)=0
jmp=1
EndIf
EndIf
a=Abs(shipspeed)
If a>0 then a=a/2
If shipspeed<0 then a=0-a
ndata(playinfo(15),4)=a
If jmp=0 then move camera a Else move camera a*10
position object 6002,camera position x(),camera position y(),camera position z(
)
position object 6103,camera position x(),camera position y(),camera position z(
)
position object 304,camera position x(),camera position y(),camera position z()
` rotate object 304,camera angle x(),camera angle y(),camera angle z()
ox#=object angle x(304)
oy#=object angle y(304)
oz#=object angle z(304)
If camdir=1 then rotate camera oz#,wrapvalue(oy#+180),ox#
If camdir=2 then rotate camera oz#,wrapvalue(oy#-90),ox#
If camdir=3 then rotate camera oz#,wrapvalue(oy#+90),ox#
scroll backdrop bx#,by#
If state=1
ink RGB(255,255,255),0
If camdir=0 then center text 320,20,"Front"
If camdir=1 then center text 320,20,"Rear"
If camdir=2 then center text 320,20,"Left"
If camdir=3 then center text 320,20,"Right"
If ndata(playinfo(15),28)>0
text 10,368,"Lazer temp."
ink RGB(50,255,50),0
a=ndata(playinfo(15),28)
If a>100 then a=100
box 10,385,10+a,395
EndIf
ink RGB(255,0,0),0
line 10,445,10,465
If shipspeed>ndata(playinfo(15),8) then shipspeed=ndata(playinfo(15),8)
If shipspeed<0-ndata(playinfo(15),8) then shipspeed=0-ndata(playinfo(15),8)
If shipspeed>0 then ink RGB(0,255,0),0 Else ink RGB(255,0,0),0
If shipspeed<>0
speed=Abs(shipspeed)
If ndata(playinfo(15),8)>0 then div=100/ndata(playinfo(15),8)
box 10,450,10+(div*speed),460
EndIf
` If shipspeed#<0 then box 10,450,10-(shipspeed#*10),460
If fia=1 And playinfo(12)<playinfo(13)
` ink RGB(((fuelinc+1)/2)+5,0,0),0
` box 8,428,108,448
ink RGB(255,0,0),0
box 499,457,499+fuelinc/6,471
EndIf
ink RGB(255,255,255),0
text 500,456,"Fuel"
If blag=0
fg$=str$(playinfo(12))
fga$=" / "
fg$=fg$+fga$
fga$=str$(playinfo(13))

fg$=fg$+fga$
text 550,456,fg$
Else
text 550,456,"Unlimited"
playinfo(13)=65535
playinfo(12)=65535
EndIf
ink RGB(255,255,255),0
a$="Damage "
a$=a$+str$(ndata(playinfo(15),5))
a$=a$+"\"
a$=a$+str$(ndata(playinfo(15),25))
text 500,408,a$
If rapid=0 then text 500,426,"Charged" Else text 500,426,"Rapid"
a=screen fps()
text 0,0,str$(a)
If cscr=0
Radar(198,365,rev)
Missleinfo()
EndIf
` missle selector
If mouseclick()=1
mx=MouseX()
my=MouseY()
If mx>9 And mx<43
a=missleselect
If my>166 And my<199 And shipbitz(25)>0 then missleselect=7
If my>199 And my<233 And shipbitz(7)>0 then missleselect=1
If my>233 And my<267 And shipbitz(29)>0 then missleselect=2
If my>267 And my<301 And shipbitz(8)>0 then missleselect=3
If my>301 And my<335 And shipbitz(9)>0 then missleselect=4
If my>335 And my<369 And shipbitz(26)>0 then missleselect=5
If my>369 And my<403 And shipbitz(27)>0 then missleselect=6
If missleselect<>a
a=missleselect
If a=1 then com$(0)="Dumb-Fire missle selected" Else
If a=2 then com$(0)="High Explosive Dumb-Fire missle Selected" Else
If a=3 then com$(0)="Homing missle selected" Else
If a=4 then com$(0)="High Explosive Homing missle selected" Else
If a=5 then com$(0)="Mine selected" Else
If a=6 then com$(0)="High Explosive Mine selected"
If a=7 then com$(0)="Dummy Mine selected"
comp(0)=100
EndIf
EndIf
EndIf
` text 50,250,str$(xrot#)
` text 80,250,str$(yrot#)
` text 110,250,str$(zrot#)
` text 50,280,str$(npos#(playinfo(15),0))
` text 50,310,str$(npos#(playinfo(15),1))
` text 50,340,str$(npos#(playinfo(15),2))
`ca currently active (If comms is active)
`cm current menu (what menu is active)
`**************************************************************************
If ca>0 then ca=Communications(cm,coi)
If lmc>0 then lmc=lmc-1
If cscr=2 And mouseclick()=1
`190,11,204,25
mx=MouseX()

my=MouseY()
If mx>189 And mx<205 And my>10 And my<26 And playcargo(19)>0
If playinfo(12)<playinfo(13)
playcargo(19)=playcargo(19)-1
playinfo(12)=playinfo(12)+1
EndIf
EndIf
If mx>339 And mx<354
bpy=22
cob=-1
Repeat
bpy=bpy+14
cob=cob+1
Until my>bpy And my<bpy+14 Or cob>28
If cob<29
apx#=camera position x()
apy#=camera position y()
apz#=camera position z()
If playcargo(cob)>0
place_cargo(1,304,cob)
playcargo(cob)=playcargo(cob)-1
playinfo(34)=playinfo(34)+1
If apx#>-7000 And apx#<7000 Or apy#>-7000 And apy#<7000 Or apz#>-7000 And
apz#<7000
`players will get fined 100cr per jettisoned item, If in a inhabited system
If sectordata(playinfo(2),11)=1
record(7)=record(7)+1
record(11)=record(11)+100
playinfo(29)=playinfo(29)+1
com$(0)="Thats a 100cr fine for illegal dumping"
comp(0)=100
EndIf
EndIf
EndIf
EndIf
EndIf
EndIf
If mouseclick()=1 And lmc<=0 And MouseX()>49 And MouseX()<61
` If active test To see where they clicked
If ca>0 then cm=CommsOptions(cm)
lmc=15
EndIf
bob 2,0,380,1005
set bob 2,0,1
bob 65500,MouseX(),MouseY(),2000
set bob 65500,0,1
ink RGB(0,128,0),0
If shipbitz(camdir+1)<>0
line 318,240,308,240
line 322,240,332,240
line 320,238,320,228
line 320,242,320,252
EndIf
ink RGB(200,200,200),0
showcredits(500,442)
relativity()
EndIf
` text 100,100,str$(ca)
` text 100,120,str$(cm)

position object 304,camera position x(),camera position y(),camera position z()


rotate object 304,camera angle x(),camera angle y(),camera angle z()
Screen(cscr)
If pausetime>0 then pausetime=pausetime-1
`PAUSE setup
If keystate(keys(14))=1 And pausetime=0
timez=50
Repeat
ink RGB(255,255,255),0
center text 320,230,"PAUSED"
center text 320,250,"Computer in suspended animation mode"
sync
timez=timez-1
Until keystate(keys(14))=1 And timez<0
pausetime=50
EndIf
`Alt-Q quit requester
`QUIT KEYS
If keystate(56)=1 And keystate(16)=1
position mouse 320,240
Repeat
ok=0
ink RGB(0,0,100),0
box 230,220,410,280
ink RGB(255,255,255),0
center text 320,227,"Do you really want to quit"
Button(250,250,310,270,1)
center text 280,252,"Yes"
Button(330,250,390,270,1)
center text 360,252,"No"
bob 65500,MouseX(),MouseY(),2000
If mouseclick()=1
mx=MouseX()
my=MouseY()
If mx>250 And my>250 And mx<310 And my<270 then ok=1
If mx>330 And my>250 And mx<390 And my<270 then ok=2
EndIf
sync
Until ok<>0
If ok=1
bob 2,1000,1000,1005
bob 65500,1000,1000,2000
reset_system()
set current bitmap 0
Goto MAIN
EndIf
EndIf
mfire=0
If control(0)>1 And joystick fire b()=1 then mfire=1
If keystate(keys(11))=1 And mtime<=0 Or control(0)=1 And mouseclick()=3 Or mfir
e=1
ok=-1
If missleselect=1 And shipbitz(7)>0 then ok=7
If missleselect=2 And shipbitz(29)>0 then ok=29
If missleselect=3 And shipbitz(8)>0 then ok=8
If missleselect=4 And shipbitz(9)>0 then ok=9
If missleselect=5 And shipbitz(26)>0 then ok=26
If missleselect=6 And shipbitz(27)>0 then ok=27
If missleselect=7 And shipbitz(25)>0 then ok=25
If ok<>-1

FireMissle(304,Int(shipspeed),coi,missleselect)
shipbitz(ok)=shipbitz(ok)-1
mtime=10
EndIf
Else
If mtime>0 then mtime=mtime-1
EndIf
lfire=0
If control(0)>1 And joystick fire a()=1 then lfire=1
`FIRE key
If keystate(keys(6))=1 Or control(0)=1 And mouseclick()=2 Or lfire=1
ink RGB(255,0,0),0
box 270,340,370,350
ink RGB(255,255,0),0
box 275,340,370,350
ink RGB(0,0,255),0
box 320,340,370,350
ink RGB(100,100,255),0
box 360,340,370,350
ink RGB(255,255,255),0
box 365,340,370,350
box 270,342,270+charge,348
charge=charge+(shipbitz(14)+1)
If charge>99 then charge=99
EndIf
If ndata(playinfo(15),9)>0 And cscr=0
ink RGB(50,50,255),0
box 10,350,10+(ndata(playinfo(15),7)/shipbitz(15)),360
EndIf
If ndata(playinfo(15),28)>0 then ndata(playinfo(15),28)=ndata(playinfo(15),28)1
`id system names on Or off key
If keystate(65)=1
idsys(0)=1-idsys(0)
EndIf
state=1-state
If keystate(keys(6))=0 And charge>0 Or charge>0 And rapid=1
If ndata(playinfo(15),28)<99
`put fire code in here
Fire(charge,0,ndata(playinfo(15),4))
ndata(playinfo(15),28)=ndata(playinfo(15),28)+(charge*2)
charge=0
EndIf
EndIf
If state=1
If idsys(0)=1 And cscr=0 then IDNames()
text 100,0,str$(shotarray(0))
sync
For axl=304 To 326
If object exist(8000+axl)=1
delete object 8000+axl
EndIf
Next axl
ndata(playinfo(15),4)=Int(shipspeed#)
newship=rnd(100)
If newship<5 then place_new_ship()
EndIf
position_debris()
For n=0 To 20
position_ship(n)

Next n
position object 6002,camera position x(),camera position y(),camera position z
()
position object 6103,camera position x(),camera position y(),camera position z
()
position object 304,camera position x(),camera position y(),camera position z(
)
death=UpdateShots()
` death=moveshots()
death2=movemissle()
altdeath=0
If playinfo(16)>0
altdeath=altitude(shipspeed#)
EndIf
If death=1 Or altdeath=1 Or death2=1
deathanim()
bob 65500,1000,1000,2000
If matrix exist(1)=1
delete matrix 1
EndIf
If matrix exist(2)=1
delete matrix 2
EndIf
If matrix exist(3)=1
delete matrix 3
EndIf
reset_system()
playinfo(16)=0
death=0
altdead=0
delete object 6002
Goto MAIN
EndIf
For n=0 To 49
position_alloys(n)
Next n
For n=0 To 39
position_cargo(n)
Next n
If nop>0
For n=1 To nop+1
position_planet(n,n)
Next n
For n=0 To sta
position_station(n,51+n)
Next n
EndIf
If nom>0
For n=0 To nom
position_moon(n,n+22)
Next n
EndIf
If noa>0
For n=0 To noa
position_asteroid(n,103+n)
Next n
EndIf
Until no_exit_here=5555
`CODE BLOCK BELOW NEVER ACTUALLY RUN!!!
If ESCAPEKEY()=1 then End

reset_system()
set current bitmap 0
Goto JUMP:
`Exit when Escape pressed
End
NPCName:
`100 first names
Data "Joe","Sam","Rue","Ed","Mike","Pat","Jen","John","Paul","Rob"
Data "Antony","Frank","Fran","Angela","Bill","Bonnie","Jim","Rick","Smudge","Opa
l"
Data "Sei","Ami","Amy","Martin","Jo","Will","Gav","Gavin","Max","Jamie"
Data "Ricky","Mira","Claudia","Laura","May","Jake","Natsuni","Wayne","Mark","Jes
"
Data "Kevin","Pauline","Lisa","Dave","Adrian","Si","Simon","Steve","Stephen","Ca
rl"
Data "Herbert","Erol","Lara","Winston","Adolf","Erwin","Edwin","Edward","Pandora
","Bob"
Data "Buzz","Ksenia","Linda","James","Sid","Peter","Larry","Tobias","Kate","Chri
s"
Data "Nick","Ross","Matt","Jeff","Seikai","Kurt","Marylin","Bruce","Sylvester","
Arnold","Francis"
Data "Helen","Sarah","Harry","Clint","Micheal","Robert","David","Marge","Luke","
Tom"
Data "Geoff","George","Adrian","Alan","Brian","Billie","Collin","Charles","Dwigh
t","Erwin"
Data "Gary","Ian","Jake","Dale","Ollie","Phil","Quentin","Trevor","Victor","Tony
"
`100 last names
Data "O'Hara","O'Connell","Upton","Franks","Wells","Croft","Torell","Garrett","S
aint","Nicklin"
Data "Mayor","Smith","King","Brown","Patten","Lindsey","Butler","Shepperd","Shul
tz","Dillinger","Goodwin"
Data "Russell","Little","Walken","Walker","Jones","McDonell","Newton","Clyde","C
arpenter","Hancock"
Data "James","Mullins","Aldrin","Cole","Thompson","Farrel","Rock","Simms","Winds
or","Twice"
Data "Nicols","Ranger","Ellis","Blair","Kyle","Thornton","Wood","Andrews","Moss"
,"Marbo"
Data "Miles","Dan","Rico","Dredd","Benson","Collins","Lawrence","Twain","Sherida
n","Sinclair"
Data "Firlan","Christian","Doyle","Dolby","Metcalfe","O'Brien","O'Sullivan","Kip
ling","Wilson","Reid"
Data "Randell","Rowan","White","Bell","Dickinson","Brayben","Bien","Massey","Bod
kin","Hall"
Data "Ripley","Drake","Burke","Hudson","Vequess","Ferro","Apone","Gorman","Hicks
","Weizbasky"
Data "Arris","Miner","Minter","Ash","Detriech","Crowe","Weaver","Harper","Butche
r","Maclain"
NPCCompany:
`100 First parts
Data "Earth","Terran","Phargoyde","Allheck","Ancients","Siex","Almock","Ulgmundi
","Tesserak","Terrisil"
Data "Sirius","Hydro","Gleam","Air","Ultimate","Gothic","Bolfan","World","Power"
,"Mandarin"
Data "Soloco","Solaco","Terano","Melcan","Space","Frontier","Elite","Grand","Tra
nsca","Federal"
Data "Imperial","Centauri","Beta","United","Advanced","Auto","Star","Fortune","U
niversal","Intergalactic"

Data "Elco","Alcom","Storm","Millenium","Space Station","Multi","Maxin","Micron"


,"Atom","Lycin"
Data "Inter","Eurocorp","Intel","Terestrial","Tyrell","Allied","Sector","Locall"
,"Sylika","Mortis"
Data "Cobra","Jameson","Rigel","Lave","Turbo","Gates","Blade","Nucel","Amiga","S
pectrum"
Data "Encounters","Belville","Dubyi","Apollo","Voyager","Luna","Columbus","Tulis
","Express","Tronik"
Data "Data","Core","Arm","Trek","Machines","Zaphos","Zorbra","Cecco","Premier","
Alert"
Data "Freylis","Ion","Nuclear","Stasis","Zero-G","HiGrav","Worldwide","Corolys",
"Sukia","Tkoi"
`100 middle parts (Metal, computers etc)
Data "Metal","Iron","Gold","Silver","Computer","Construction","Systems","Pilot",
"Soldier","Cyborg"
Data "Humanoid","Slave","Liquor","Medical","Food","Luxury","Official","Terrorist
","Off world","Platinum"
Data "Turvidium","Titanium","Plastic","Software","Dig","Survey","Hacking","Law",
"Lawyer","Barrister"
Data "Police","Militant","Water","Financial","Printing","Petroleum","Electric","
Entertainment","Media","Trade"
Data "Diamonds","Artwork","Freedom","Help","Quitiline","Engine","Ore","Antiques"
,"Excavations","Space"
Data "Investigation","Pirate","Satellite","Seperatist","Hermit","Science","Deep
Space","Outer Rim","Planetary","Taxi"
Data "Bio-weapons","Weapons","Crystal","Quartz","Molybendium","Adamantium","Robo
t","Droid","Tourism","Hunting"
Data "Prisons","Appeal","Colonists","Marine","Transporting","Liberation","War","
Workers","News","Technology"
Data "Courts","Brotherhood","Music","Intelligence","Organic","Games","Automation
s","Programming","Banking","Oceanic"
Data "Interstellar","Biology","Wildlife","Guard","Army","Relations","Scrap","Sto
ck","Livestock","Goods"
`100 ending parts
Data "Limited","Corporation","Academy","Department","Military","Inc.","Organisat
ion","Company","Group","Enterprise"
Data "Shipyard","Explorations","Program","Division","Order","Council","Front","H
ouse","Services","Movement"
Data "Agency","Faction","Band","Union","Federation","Interactive","Fund","Protec
torate","Merchants","Market"
Data "Labs.","Laboratory","Experiments","Unit","Office","Base","Resort","Syndica
te","Interactive","Publishing"
Data "Medicines","Communications","Design","Developments","Associates","Producti
ons","League","Trust","Stores","Co. GmBh"
Data "Travel","Electronics","Society","Partnership","Foundation","Studio","Corp.
","College","University","School"
Data "Establishment","Center","Park","Site","Technology","Campus","Regime","Init
iative","Systems","Research"
Data "Station","Monastery","Programme","Commission","Tech.","International","Meg
a Corporation","MCorp.","Board","Grp."
Data "Aggrigates","Satellite","Orbital","Cruise","Force","Gas","Tankers","Realit
y","Unite","Republic"
Data "Dome","House","Study","Library","Press","Hospital","Institute","Sanitarium
","Hosp.","Uni."
`Data To make up planet names For player information
PlanetName:
`Middle bits (160)

Data "Beta","Alpha","Delta","Epsilon","Gamma","Hydri","Sigma","Draconis","Fomalh
ault","Lyten"
Data "Pavonis","Lande","Lalande","Rigel","Luyten","Epsilon","Ross","Wolf","Arlan
da","Kapeain"
Data "Riedquat","Karakis","Targ","Vega","Altair","Regulus","Eris","Lave","Arakis
","Pacificus"
Data "Atlanticus","Majoris","Siria","Groombridge","Eradini","Erandi","Caponius",
"Teliss","Herodani","Helix"
Data "Hyrin","Carpernicus","Kapteyns","Omnicron","Omicron","Drykan","Ceti","Ilra
n","Makorn","Giclas"
Data "Lacille","Indi","Kruger","Cygni","Kranis","Cassiopelia","Cassiopeia","Stru
ve","Teserak","Aldrani"
Data "Zayonce","Leysti","Drakon","Wriken","Kappa","Zeta","Theta","Phydran","Serk
ei","Korax"
Data "Backlarn","Baji","Bhrax","Tiai","Sie","Seres","Oberon","Mira","Tyrax","Ter
ran"
Data "Mason","Phyi","Niani","Myzon","Kalernin","Jorka","Illia","Forlan","Bie","M
elaketh"
Data "Mylo","Imperius","Federal","Alexandri","Zelini","Xydra","Vordrax","Wydrani
","Quadran","Wydrany"
Data "Omega","Tarn","Char","Demios","Europa","Titan","Jupitus","Zeus","Neptune",
"Fury"
Data "Styx","Karius","Serkiss","Elsing","Enterra","Melfantoris","Delsor","Troi",
"Landri","Kerentel"
Data "Africa","Britania","America","Amolis","Oceanis","Ferral","Catanis","Semile
s","Joran","Morlan"
Data "Atlantis","Babylon","Logan","Korinthius","Cannis","Moranis","Crius","Serca
","Petra","Athos"
Data "Tersa","Corinthias","Ankell","Janus","Juno","Baal","Terkesh","Hitine","Cit
adel","Vortan"
Data "Tarsoni","Arth","Uranus","Saturn","Earth","Mercury","Venus","Mars","Jupite
r","Pluto"
`Last part (optional) (38)
Data "Prime","Secondus","Niran","Quintis","Gateway","Major","World","Centauri","
I","II"
Data "III","IV","V","VI","VII","VIII","IX","X","XI","XII"
Data "Station","Landing","Depot","Mines","Processing","Research","Federation","S
hipyard","Retreat","Facility"
Data "Outpost","Research Facility","Military Outpost","Rock","Training Facility"
,"Core","Colony"
`beginning bits (9) (optional)
Data "LV","CD","New","Los","UV","Tau","Ursa","Eta","YZ"
`Item name, Price, Space (t), Tech needed
Shipyardinformation:
Data "Dumb-fire Missle",30,1,1
Data "HE Dumb-fire Missle",75,1,2
Data "Homing Missle",50,1,2
Data "HE Homing Missle",100,1,2
Data "Dummy Mine",30,1,1
Data "Standard Mine",50,1,3
Data "HE Mine",75,1,4
Data "Lazer",1500,2,2
Data "Energy Booster",5000,5,12
Data "Shield Unit",2500,4,15
Data "Lazer Generator",5000,4,18
Data "Lazer Cooler",2500,1,8
Data "Escape Capsule",500,4,13

Data
Data
Data
Data
Data
Data
Data
Data
Data
Data
Data
Data
Data
Data
Data
Data
Data
Data
Data
Data
Data
Data
Data
;
;
;
;

"Shockwave Device",25000,10,20
"Cargo Scoop",5000,5,10
"Energy Scoop",7500,3,10
"FTL Analyser",2500,1,12
"Information System",2500,1,10
"Hull Auto-repairer",10000,45,10
"Universal Translator",5000,4,12
"Auto Turret System",5000,5,14
"Galactic Jumpdrive",100000,2,25
"Cloaking Device",50000,50,25
"ECM System",1200,1,5
"Military ECM",5000,2,10
"Interplanetary Drive",250,2,1
"FTL Drive Mk I",1000,2,1
"FTL Drive Mk II",2500,12,2
"FTL Drive Mk III",6000,35,4
"FTL Drive Mk IV",14000,70,5
"FTL Drive Mk V",25000,120,7
"FTL Drive Mk VI",60000,200,9
"FTL Drive Mk VII",100000,350,12
"FTL Drive Mk VIII",150000,500,15
"FTL Drive Mk IX",280000,800,20
"FTL Drive Mk X",400000,1200,24

IDE Options = PureBasic 5.00 (Windows - x86)


CursorPosition = 9930
FirstLine = 9878
EnableXP