'System Buider 0.1
'companion utility to CT-Vector
'primary reference shall be DGP's WBH
' MAIN MODULE
TYPE unitpoint
' relative unit placement
TYPE body
' Celestial bodies parnt
AS STRING * 20 ' name of parent body radi
AS _INTEGER64 ' Size (needs _INTEGER64 in event of large star) rota
AS SINGLE ' Rotational period (days) dens
AS SINGLE ' Density, basis for grav(Gs) calculation rank
AS _BYTE ' 1=primary, 2=planet/companion, 3=satelite star
AS _BYTE ' -1=star 0=non-stellar body class
AS STRING * 2 ' Two digit code, use for stellar class, GG, etc. siz
AS STRING * 3 ' three digit code, use for stellar size, maxor
AS _BYTE ' Maximum orbits for body ps
AS unitpoint
' coordinate position
class
AS INTEGER ' orbit class <3 no not use orbit
' VARIABLE DECLARATIONS
DIM SHARED clr&
(0 TO 15) ' 32 bit equivalent of SCREEN 0 colors DIM SHARED starroll
(4) AS roll
' memorize star class and size DMs DIM SHARED orbit
(21, 5) AS layer
' Main system orbit shells 'DIM SHARED in AS INTEGER ' planetary index
'DIM SHARED orbitclass AS INTEGER ' 0 thru 6: interior,vaporized,inner,habitable,outer,too far
DIM SHARED starin&
' stellar details screen handle
' DEFINE SCREEN IMAGES
main&
= _NEWIMAGE(1200, 688, 32) ' main screen image 1200 x 600 32bit colorstarin&
= _NEWIMAGE(640, 688, 32) ' stellar details screen 80x48 text'plcmnt& = _LOADIMAGE("jup.jpg", 32)
SCREEN main&
' Initiate main screen
SetEnviron
RefreshPrompt
' DATA SECTION
colors:
' colors 0-4
DATA 0,0,0,0,0,168,0,168,0,0,168,168,168,0,0 ' colors 5-9
DATA 168,0,168,168,84,0,168,168,168,84,84,84,84,84,252 ' colors 10-14
DATA 84,252,84,84,252,252,252,84,84,252,84,252,252,252,84 ' color 15
stellar_details:
'Steller data & orbit zones tables
'Orbit Class: Size, Type, Mass(in solar masses), Radius(in solar radii), 1=interior, 2=vaporized, 3=inner, 4=habitable, 5=outer, 6=too far
DATA "Ia","B0",60,52,1,2,2,2,2,2,2,2,3,3,3,3,3,4,5,5,5,5,5,5,5,6 DATA "Ia","B5",30,75,1,2,2,2,2,2,2,3,3,3,3,3,4,5,5,5,5,5,5,5,5,6 DATA "Ia","A0",18,135,1,1,2,2,2,2,2,3,3,3,3,3,4,5,5,5,5,5,5,5,5,6 DATA "Ia","A5",15,149,1,1,2,2,2,2,2,3,3,3,3,3,4,5,5,5,5,5,5,5,5,6 DATA "Ia","F0",13,174,1,1,1,2,2,2,3,3,3,3,3,3,4,5,5,5,5,5,5,5,5,6 DATA "Ia","F5",12,204,1,1,1,2,2,2,3,3,3,3,3,4,5,5,5,5,5,5,5,5,5,6 DATA "Ia","G0",12,298,1,1,1,1,2,2,2,3,3,3,3,3,4,5,5,5,5,5,5,5,5,6 DATA "Ia","G5",13,454,1,1,1,1,1,2,2,3,3,3,3,3,4,5,5,5,5,5,5,5,5,6 DATA "Ia","K0",14,654,1,1,1,1,1,1,2,3,3,3,3,3,4,5,5,5,5,5,5,6 DATA "Ia","K5",18,1010,1,1,1,1,1,1,2,3,3,3,3,3,4,5,5,5,5,5,5,6 DATA "Ia","M0",20,1467,1,1,1,1,1,1,1,3,3,3,3,3,4,5,5,5,5,6 DATA "Ia","M5",25,3020,1,1,1,1,1,1,1,1,3,3,3,3,4,5,5,5,5,6 DATA "Ia","M9",30,3499,1,1,1,1,1,1,1,1,3,3,3,3,4,5,5,5,5,6 DATA "Ib","B0",50,30,1,2,2,2,2,2,2,2,3,3,3,3,3,4,5,5,5,5,5,5,5,6 DATA "Ib","B5",25,35,1,2,2,2,2,2,3,3,3,3,3,4,5,5,5,5,5,5,5,5,5,6 DATA "Ib","A0",16,50,1,2,2,2,2,3,3,3,3,3,3,4,5,5,5,5,5,5,5,5,5,6 DATA "Ib","A5",13,55,1,2,2,2,2,3,3,3,3,3,4,5,5,5,5,5,5,5,5,5,5,6 DATA "Ib","F0",12,59,1,2,2,2,2,3,3,3,3,3,4,5,5,5,5,5,5,5,5,5,5,6 DATA "Ib","F5",10,60,1,2,2,2,3,3,3,3,3,3,4,5,5,5,5,5,5,5,5,5,5,6 DATA "Ib","G0",10,84,1,2,2,2,3,3,3,3,3,3,4,5,5,5,5,5,5,5,5,5,5,6 DATA "Ib","G5",12,128,1,1,2,2,2,3,3,3,3,3,4,5,5,5,5,5,5,5,5,5,5,6 DATA "Ib","K0",13,216,1,1,1,1,2,3,3,3,3,3,4,5,5,5,5,5,5,5,5,6 DATA "Ib","K5",16,392,1,1,1,1,1,2,3,3,3,3,3,5,5,5,5,5,5,5,5,6 DATA "Ib","M0",16,857,1,1,1,1,1,1,3,3,3,3,3,5,5,5,5,5,5,6 DATA "Ib","M5",20,2073,1,1,1,1,1,1,1,3,3,3,3,4,4,5,5,5,5,6 DATA "Ib","M9",25,2876,1,1,1,1,1,1,1,1,3,3,3,4,4,5,5,5,5,6 DATA "II","B0",30,22,1,2,2,2,2,2,2,3,3,3,3,3,4,5,5,5,5,5,5,5,5,6 DATA "II","B5",20,20,1,2,2,2,2,3,3,3,3,3,3,4,5,5,5,5,5,5,5,5,5,6 DATA "II","A0",14,18,1,2,2,3,3,3,3,3,3,4,5,5,5,5,5,5,5,5,5,5,5,6 DATA "II","A5",11,14,1,2,3,3,3,3,3,3,4,5,5,5,5,5,5,5,5,5,5,5,5,6 DATA "II","F0",10,16,1,2,3,3,3,3,3,3,4,5,5,5,5,5,5,5,5,5,5,5,5,6 DATA "II","F5",8.1,18,1,2,3,3,3,3,3,3,4,5,5,5,5,5,5,5,5,5,5,5,5,6 DATA "II","G0",8.1,25,1,2,3,3,3,3,3,3,4,5,5,5,5,5,5,5,5,5,5,5,5,6 DATA "II","G5",10,37,1,2,3,3,3,3,3,3,4,5,5,5,5,5,5,5,5,5,5,5,5,6 DATA "II","K0",11,54,1,2,3,3,3,3,3,3,3,4,5,5,5,5,5,5,5,5,5,6 DATA "II","K5",14,124,1,1,2,3,3,3,3,3,3,4,5,5,5,5,5,5,5,5,5,6 DATA "II","M0",14,237,1,1,1,1,3,3,3,3,3,3,4,5,5,5,5,5,5,6 DATA "II","M5",16,712,1,1,1,1,1,1,3,3,3,3,3,4,5,5,5,5,5,6 DATA "II","M9",18,931,1,1,1,1,1,1,3,3,3,3,3,4,5,5,5,5,5,6 DATA "III","B0",25,16,1,2,2,2,2,2,2,3,3,3,3,3,4,5,5,5,5,6 DATA "III","B5",15,10,1,2,2,2,3,3,3,3,3,3,4,5,5,5,5,5,5,6 DATA "III","A0",12,6.2,1,3,3,3,3,3,3,3,4,5,5,5,5,5,5,5,5,6 DATA "III","A5",9,4.6,1,3,3,3,3,3,3,4,5,5,5,5,5,5,5,5,5,6 DATA "III","F0",8,4.7,1,3,3,3,3,3,4,5,5,5,5,5,5,5,5,5,5,6 DATA "III","F5",5,5.2,1,3,3,3,3,3,4,5,5,5,5,5,5,5,5,5,5,6 DATA "III","G0",2.5,7.1,1,3,3,3,3,3,4,5,5,5,5,5,5,5,5,5,5,6 DATA "III","G5",3.2,11,1,3,3,3,3,3,3,4,5,5,5,5,5,5,5,5,5,6 DATA "III","K0",4,16,1,3,3,3,3,3,3,4,5,5,5,5,5,5,5,6 DATA "III","K5",5,42,1,3,3,3,3,3,3,3,4,5,5,5,5,5,5,6 DATA "III","M0",6.3,63,1,2,3,3,3,3,3,3,4,5,5,5,5,6 DATA "III","M5",7.4,228,1,1,1,1,3,3,3,3,3,4,5,5,5,6 DATA "III","M9",9.2,360,1,1,1,1,1,3,3,3,3,4,5,5,5,6 DATA "IV","B0",20,13,2,2,2,2,2,2,2,3,3,3,3,3,4,5,6 DATA "IV","B5",10,5.3,2,2,2,3,3,3,3,3,3,4,5,5,5,5,6 DATA "IV","A0",6,4.5,2,3,3,3,3,3,3,4,5,5,5,5,5,5,6 DATA "IV","A5",4,2.7,3,3,3,3,3,3,4,5,5,5,5,5,5,5,6 DATA "IV","F0",2.5,2.7,3,3,3,3,3,3,4,5,5,5,5,5,5,5,6 DATA "IV","F5",2,2.6,3,3,3,3,3,4,5,5,5,5,5,5,5,5,6 DATA "IV","G0",1.75,2.5,3,3,3,3,3,4,5,5,5,5,5,5,5,5,6 DATA "IV","G5",2,2.8,3,3,3,3,3,4,5,5,5,5,5,5,5,5,6 DATA "IV","K0",2.3,3.3,3,3,3,3,4,5,5,5,5,5,5,6 DATA "V","B0",18,10,2,2,2,2,2,2,3,3,3,3,3,3,4,6 DATA "V","B5",6.5,4.4,2,2,2,2,3,3,3,3,3,4,5,5,5,6 DATA "V","A0",3.2,3.2,3,3,3,3,3,3,3,4,5,5,5,5,5,6 DATA "V","A5",2.1,1.8,3,3,3,3,3,3,4,5,5,5,5,5,5,6 DATA "V","F0",1.7,1.7,3,3,3,3,3,4,5,5,5,5,5,5,5,6 DATA "V","F5",1.3,1.4,3,3,3,3,4,5,5,5,5,5,5,5,5,6 DATA "V","G0",1.04,1.03,3,3,3,4,5,5,5,5,5,5,5,5,5,6 DATA "V","G5",0.94,0.91,3,3,4,5,5,5,5,5,5,5,5,5,5,6 DATA "V","K0",0.825,0.908,3,3,4,5,5,5,5,5,5,5,5,6 DATA "V","K5",0.57,0.566,4,5,5,5,5,5,5,5,5,5,5,6 DATA "V","M0",0.489,0.549,4,5,5,5,5,5,5,5,5,6 DATA "V","M5",0.331,0.358,5,5,5,5,5,5,5,5,5,6 DATA "V","M9",0.215,0.201,5,5,5,5,5,5,5,5,5,6 DATA "VI","F5",0.8,1.14,3,3,3,4,5,6 DATA "VI","G0",0.6,1.02,3,3,4,5,5,6 DATA "VI","G5",0.528,0.55,3,4,5,5,5,6 DATA "VI","K0",0.430,0.4,3,4,5,5,5,6 DATA "VI","K5",0.33,0.308,5,5,5,5,5,6 DATA "VI","M0",0.154,0.256,5,5,5,5,5,6 DATA "VI","M5",0.104,0.104,5,5,5,5,5,6 DATA "VI","M9",0.058,0.053,5,5,5,5,5,6 DATA "D","B0",0.26,0.018,4,5,5,5,6 DATA "D","A0",0.36,0.017,5,5,5,5,6 DATA "D","F0",0.42,0.013,5,5,5,5,6 DATA "D","G0",0.63,0.012,5,5,5,5,6 DATA "D","K0",0.83,0.009,5,5,5,5,6 DATA "D","M0",1.11,0.006,5,5,5,5,6
Orbits:
'Orbit radii in AU
DATA 0.2,0.4,0.7,1,1.6,2.8,5.2,10,19.6,38.8,77.2 DATA 154,307.6,614.8,1229.2,2458,4915.6,9830.8,19661.2,39322
' END DATA SECTION
' END MAIN MODULE
FOR x%
= 0 TO heavens
(var
).maxor
CASE 1: orbit
(x%
, var
).prsnt
= 0 CASE 2 TO 5: orbit
(x%
, var
).prsnt
= -1 CASE 6: orbit
(x%
, var
).prsnt
= 0:
EXIT FOR ' <<< subtract 1 from heavens(var).maxor or set to x% ??? orbit(x%, var).prsnt = 0
x% = x% + 1
Choose% = ch%
'Rolls any number of dice of any number of sides and adds modifiers
'syntax usage: DiceRoll% (number of dice rolled, number of sides, any modifier)
t% = plus ' add modifier
FOR x%
= 1 TO quan
' roll die <quan>tity of times t%
= t%
+ INT(RND * dice
) + 1 ' total up results DiceRoll% = t%
'Accepts a planetary body index (var) and finds the index of its parent body
IF heavens
(var
).parnt
= heavens
(x%
).nam
THEN p%
= x%
FindParent = p%
DIM x$
, chk&
, rl%
, gp%
, n%
, x%
, y%
, zc%
, yc%
, z%
, ggs%
, sz%
, noa%
, ggdet
AS body
gp% = GetAnswer%("Gas Giant Present?: <Y>es <N>o <R>oll", "YNR")
CASE 3: rl%
= DiceRoll%
(2, 6, 0) ' roll for GG presence n% = GetAnswer%("Number of gas giants: <1> <2> <3> <4> <5> <R>oll", "12345R")
ggs% = n%
rl% = DiceRoll%(2, 6, 0) ' roll for GG number
ggs%
= INT((rl%
- 1) / 2) 'check for sufficient orbits for gas giants <<<CAN THIS BE SUBBED OUT?
noa% = 0
FOR z%
= 0 TO heavens
(y%
).maxor
IF orbit
(z%
, y%
).class
> 2 AND orbit
(z%
, y%
).class
< 6 THEN IF orbit
(z%
, y%
).pin
= 0 AND orbit
(z%
, y%
).prsnt
THEN noa% = noa% + 1
IF noa%
< ggs%
THEN ggs%
= noa%
'Do GG orbits and details
yc% = 1: zc% = 0
ggdet.class = "GG"
rl% = DiceRoll%(1, 6, 0) ' roll for GG size (S/L)
IF rl%
< 4 THEN ' determine radi as per WBH ggdet.siz = "S"
rl% = DiceRoll%(2, 6, 0)
CASE IS < 9: sz%
= (rl%
- 1) * 10 CASE 10 TO 12: sz%
= (rl%
- 2) * 10 ggdet.siz = "L"
rl% = DiceRoll%(3, 6, 0)
CASE IS < 8: sz%
= (rl%
+ 8) * 10 CASE 8 TO 18: sz%
= (rl%
+ 7) * 10 ggdet.radi = (((sz% * 1000) + (DiceRoll%(2, 6, -7) * 1000) + (DiceRoll%(2, 6, -7) * 100) + (DiceRoll%(2, 6, -7) * 10) + DiceRoll%(2, 6, -7)) * 1.6) / 2
' density
rl% = DiceRoll%(3, 6, 0)
CASE IS < 8: ggdet.dens
= (rl%
+ 7) / 100 CASE 8 TO 11: ggdet.dens
= (rl%
* 2) / 100 CASE 12, 13: ggdet.dens
= (rl%
+ 11) / 100 CASE 14 TO 18: ggdet.dens
= (rl%
+ 12) / 100
'Gas Giant Placement routine here or call
'Screen 0 color array
'0=black,1=blue,2=green,3=aqua,4=red,5=purple,6=brown,7=white
'8=gray, +8=bright color, except 14=yellow,
SCREEN plcmnt&
' <<<CAN THIS BE SUBBED OUT TOO? PRINT x%;
"- "; ggdet.siz; ggdet.class;
" radius="; ggdet.radi;
" density="; ggdet.dens
PRINT SPC(5 * (heavens
(y%
).rank
- 1));
_TRIM$(heavens
(y%
).nam
);
" "; heavens
(y%
).class; heavens
(y%
).siz
FOR z%
= 0 TO heavens
(y%
).maxor
IF orbit
(zc%
, yc%
).class
< 3 THEN zc%
= zc%
+ 1 IF orbit
(zc%
, yc%
).prsnt
= 0 THEN zc%
= zc%
+ 1 IF orbit
(zc%
, yc%
).pin
> 0 THEN zc%
= zc%
+ 1 IF zc%
> heavens
(yc%
).maxor
THEN zc% = 0: yc% = yc% + 1
LINE (1, 1)-(22, 22), clr&
(4), B:
LINE (2, 2)-(21, 21), clr&
(15), B
' display active orbit box IF orbit
(z%
, y%
).prsnt
= 0 OR orbit
(z%
, y%
).pin
> 0 THEN ' Check box greyed out or available 'chk& = _COPYIMAGE(chkbx&)
'_PUTIMAGE (3, 3)-(20, 20), chk&, chkbx&
IF orbit
(z%
, y%
).class
> 1 THEN _PUTIMAGE (((heavens
(y%
).rank
- 1) * 40) + (56 * z%
) + 16, (48 + ((y%
- 1) * 80))), chkbx&
, plcmnt&
orbs = orbs + 1
heavens(orbs) = ggdet ' sets class, size, radius, density
INPUT "Name of Gas Giant: ", heavens
(orbs
).nam
' sets name heavens(orbs).parnt = heavens(yc%).nam ' sets parent name
heavens(orbs).orad = orbit(zc%, yc%).orad ' sets orbital radius (relative to .parnt
orbit(zc%, yc%).pin = orbs ' places in orbital slot
GGnone:
PRINT "No gas giants present"
FUNCTION GetAnswer%
(prompt$
, validChars$
)
'-------------------------QUERY------------------------------------------------------CLEARED
' FUNCTION: GetAnswer%
'
' Purpose:
' Display a menu prompt.
' Get a character of input from the keyboard and return a numerical expression
' to represent choice for SELECT CASE or similar control functions. Rejects any
' invalid characters entered. A standard library routine stolen from "QBasic
' for Dummies". Why reinvent a wheel?
'
' Passed Variables:
' prompt$ sends menu prompt to be displayed
' validChars$ sends list of acceptable hotkey choices
'
'------------------------------------------------------------------------------------
DIM inChar$
, charPos%
, okchar%
' added for OPTION _EXPLICIT
charPos%
= INSTR(validChars$
, inChar$
) ' examine the input. okchar% = 1
okchar% = 0
LOOP UNTIL okchar%
' Stop looping when a valid character is received.
GetAnswer% = charPos%
'conduct main world UPP entry
DIM x%
, y%
, mx%
, sc$
, sz$
, sm!
, sr!
, typt$
, dm%
, rl%
, o$
STATIC o2$
' used to avoid duplicating inner orbits
'Find the proper table of orbits, when found exit with data set
x% = 0
IF rbits%
(x%
) = 6 THEN EXIT DO ' beyond available orbits for star type 6 is delimiter x% = x% + 1
PRINT sc$;
" "; sz$;
" ";
heavens(id).radi = sr! * Solrad
heavens
(id
).dens
= sm!
/ (1.333 * _PI * (sr!
^ 3)) ' .255 solar density
orbit(y%, id).class = rbits%(y%)
IF orbit
(y%
, id
).class
= 1 THEN orbit
(y%
, id
).prsnt
= 0 ' within star photosphere PRINT orbit
(y%
, id
).class;
IF siz
= "Ia" OR siz
= "Ib" OR siz
= "II" THEN ' determine size modifier dm% = dm% + 8
dm% = dm% + 4
'no die modifier
dm% = dm% - 4
dm% = dm% - 2
'no die modifier
mx%
= GetAnswer%
("Choose max. orbits, DM of " + STR$(dm%
) + " applied: (2 - 9) A=10, B=11, C=12, <R>oll:", "23456789ABCR") heavens(id).maxor = mx% + 1 + dm%
heavens(id).maxor = DiceRoll%(2, 6, dm%) ' roll for maximum orbits
AvailableOrbit id
rl% = DiceRoll%(2, 6, 0) ' roll for companion orbit
CASE 2 TO 3: o$
= "c" ' close companion CASE 4: o$
= "1" ' orbit 1 CASE 5: o$
= "2" ' orbit 2 CASE 6: o$
= "3" ' orbit 3 CASE 7: o$
= STR$(4 + DiceRoll%
(1, 6, 0)) ' orbit 4 + 1D CASE 8: o$
= STR$(5 + DiceRoll%
(1, 6, 0)) ' orbit 5 + 1D CASE 9: o$
= STR$(6 + DiceRoll%
(1, 6, 0)) ' orbit 6 + 1D CASE 10: o$
= STR$(7 + DiceRoll%
(1, 6, 0)) ' orbit 7 + 1D CASE 11: o$
= STR$(8 + DiceRoll%
(1, 6, 0)) ' orbit 8 + 1D o2$ = o$
PlaceStar id, o$
try_again:
rl% = DiceRoll%(2, 6, 4) ' roll for second companion orbit
CASE 6: o$
= "3" ' orbit 3 CASE 7: o$
= STR$(4 + DiceRoll%
(1, 6, 0)) ' orbit 4 + 1D CASE 8: o$
= STR$(5 + DiceRoll%
(1, 6, 0)) ' orbit 5 + 1D CASE 9: o$
= STR$(6 + DiceRoll%
(1, 6, 0)) ' orbit 6 + 1D CASE 10: o$
= STR$(7 + DiceRoll%
(1, 6, 0)) ' orbit 7 + 1D CASE 11: o$
= STR$(8 + DiceRoll%
(1, 6, 0)) ' orbit 8 + 1D IF o$
= o2$
AND o$
<> "f" THEN GOTO try_again
' Don't put in same orbit as #2, but take a chance on far orbits PlaceStar id, o$
'id 4 & 5 on recursive call for far companion binary stars?
rl% = DiceRoll%(2, 6, -4)
CASE 7: o$
= STR$(4 + DiceRoll%
(1, 6, 0)) CASE 8: o$
= STR$(5 + DiceRoll%
(1, 6, 0)) PlaceStar id, o$
'Place body(var) into (orbit)
DIM x%
, y%
, ao%
, rl%
, sc%
, sz%
'DIM zo% ' DIM l%
IF orbst
= "c" THEN ' close companion heavens(var).orad = heavens(1).radi + heavens(var).radi + DiceRoll%(1, 100000, 20000)
heavens(var).maxor = 0
heavens(var).orad = (DiceRoll%(1, 6, 0) * 1000) * AUtokm
rl% = DiceRoll%(2, 6, -1) ' is this one a binary?
'configure far binary companion here
y% = 0
DO ' find next empty array element y% = y% + 1
heavens(y%).star = -1
heavens(y%).rank = 3
INPUT "Name of far companion binary star: ", heavens
(y%
).nam
heavens(y%).parnt = heavens(var).nam
orbs = orbs + 1: sysnat = sysnat + 1
'Star Spectral Class
sc% = GetAnswer%("Spectral class: <B><A><F><G><K><M> or <R>oll ", "BAFGKMR")
heavens(y%).class = StarClass$(y%, sc%)
'Star Size
sz% = GetAnswer%("Star Size: <A.Ia><B.Ib><2.II><3.III><4.IV><5.V><6.VI><D> or <R>oll ", "AB23456DR")
heavens(y%).siz = StarSize$(y%, sz%)
MaxOrbits y%, heavens(y%).class, heavens(y%).siz
IF orbit
(x%
, FindParent
(var
)).orad
< heavens
(FindParent
(var
)).radi
THEN 'if parent star bigger than orbit then heavens(var).orad = heavens(FindParent(var)).radi + heavens(var).radi + DiceRoll%(1, 100000, 20000) 'close companion of giant star
heavens(var).orad = orbit(x%, FindParent(var)).orad
orbit(x%, FindParent(var)).pin = var
'determine available orbits here
heavens(var).maxor = ao%
AvailableOrbit var
DO ' delete inner orbits from parent ao% = ao% + 1:
orbit(ao%, FindParent(var)).prsnt = 0
orbit(ao%, FindParent(var)).prsnt = -1
orbit(ao%, FindParent(var)).prsnt = 0
'if there is a main world pre-generated, enter it first and set MWin to -1
'IF YesOrNo$("Is there a main world to enter?") = "Y" THEN MainIn
'FOR x% = 0 TO 19
' PRINT x%; " "; orbit(x%, 1).orad
'NEXT x%
'SLEEP
StarSystem ' Rank 1 primary & rank 2 companion(s)
GasGiants
SystemDisplay
'WorldSize 2
DIM x%
, y%
, r%
, g%
, b%
, ob!
orbs = 0
FOR x%
= 0 TO 15 ' iterate colors 0 thru 15 READ r%
' get red component READ g%
' get green component READ b%
' get blue component clr&
(x%
) = _RGB32(r%
, g%
, b%
) ' mix color x into array
'Setup radii of orbit shells
'set orbital radii in km
orbit(x%, y%).orad = ob! * AUtokm
CASE 1:
IF MWin
THEN dm%
= 4 ' add UPP details when coded CASE 2 TO 5: dm%
= starroll
(FindParent
(var
)).c
'add DM of parent rl% = DiceRoll%(2, 6, dm%): starroll(var).c = rl% - dm%
sz$ = "V"
sz$ = "V"
sz$ = "IV"
CASE IS = 8: sz$
= "D": heavens
(var
).class
= LEFT$(heavens
(var
).class
, 1) CASE 2 TO 5: dm%
= starroll
(FindParent
(var
)).s
'add DM of parent rl% = DiceRoll%(2, 6, dm%): starroll(var).s = rl% - dm%
CASE 4 ' K5 thru M don't exist in size IV make them V sz$ = "V"
sz$ = "V"
sz$ = "IV"
CASE IS >= 12: sz$
= "D": heavens
(var
).class
= LEFT$(heavens
(var
).class
, 1) StarSize$ = sz$
'dimension local
DIM x%
, rl%
, sn%
, sc%
, sz%
PRINT "STAR SYSTEM DETAILS" sn% = GetAnswer%("System nature: <1> solo, <2> binary, <3> trinary, <R>oll ", "123R")
sysnat = sn%
rl% = DiceRoll%(2, 6, 0) ' roll for system nature
'spectral class & size
heavens(x%).star = -1
heavens(x%).rank = 1
INPUT "Name of primary star: ", heavens
(x%
).nam
heavens(x%).ps.pX = 0: heavens(x%).ps.pY = 0: heavens(x%).ps.pZ = 0 'Primary Star
orbs = orbs + 1
heavens(x%).rank = 2
INPUT "Name of companion star: ", heavens
(x%
).nam
heavens(x%).parnt = heavens(1).nam
orbs = orbs + 1
'Star Spectral Class
sc% = GetAnswer%("Spectral class: <B><A><F><G><K><M> or <R>oll ", "BAFGKMR")
heavens(x%).class = StarClass$(x%, sc%)
'Star Size
sz% = GetAnswer%("Star Size: <A.Ia><B.Ib><2.II><3.III><4.IV><5.V><6.VI><D> or <R>oll ", "AB23456DR")
heavens(x%).siz = StarSize$(x%, sz%)
MaxOrbits x%, heavens(x%).class, heavens(x%).siz
PRINT "Press any key to continue"
PRINT SPC(5 * (heavens
(x%
).rank
- 1)); tl$;
PRINT " ";
_TRIM$(heavens
(x%
).nam
);
" "; heavens
(x%
).class; heavens
(x%
).siz;
" orbital radius"; heavens
(x%
).orad;
" density"; heavens
(x%
).dens;
" Max orbits"; heavens
(x%
).maxor
'PRINT "* ";
PRINT z%;
" "; heavens
(z%
).nam;
" "; heavens
(z%
).siz; heavens
(z%
).class;
" orbital radius="; heavens
(z%
).orad;
" from "; heavens
(z%
).parnt
'determines world radius heavens(x).radi in km
heavens(in).radi = (((s * 1000) + (DiceRoll%(2, 6, -7) * 100) + (DiceRoll%(2, 6, -7) * 10) + DiceRoll%(2, 6, -7)) * 1.6) / 2
'-------------------------QUERY------------------------------------------------------CLEARED
' FUNCTION: YesOrNo$
'
' Purpose:
' Display a question and wait for the user to type Y or N returning result to
' calling routine for further processing. A standard library function that is used
' to verify deletion of an active PC.
'
' Passed Variables:
' question sends displayed prompt for Yes or No choice
'
'------------------------------------------------------------------------------------
YesOrNo$ = answer$
rl% = DiceRoll%(1, 6, 0)