BasePop
AS INTEGER ' Population in millions planet can support normally ModPop
AS INTEGER ' Population modifier due to Terraforming. MaxPop
AS INTEGER ' Total maximum population planet can support CurPop
AS INTEGER ' Current Population on planet TotalProd
AS INTEGER 'Systems total production ActualProd
AS INTEGER 'Systems adjusted production Bases
AS INTEGER ' Missle defence bases on planet ShipProduction
AS _BYTE 'Ship currently in production ShipCredits
AS INTEGER ' amount of credits currently put toward ship production EcoCredits
AS INTEGER ' amount of credits currently put toward ecology upgrade Relocate
AS _BYTE ' System ships are to relocate to Sheild
AS _BYTE ' Shield level protecting planet SheildCredits
AS INTEGER 'amount of credits currently put toward shield production Waste
AS _UNSIGNED _BYTE 'industrial waste on planet(each factory produces .5BC waste a year) Reserve
AS LONG ' Credits in planetary reserve Owner
AS _BYTE ' which race controls planet Race1Visit
AS _BYTE 'has race 1 visited planet Race2Visit
AS _BYTE 'has race 2 visited planet Race3Visit
AS _BYTE 'has race 3 visited planet Race4Visit
AS _BYTE 'has race 4 visited planet Race5Visit
AS _BYTE 'has race 5 visited planet Race6Visit
AS _BYTE 'has race 6 visited planet Ship
AS _BYTE ' percent of planetary production in Ships Defn
AS _BYTE ' percent of planetary production in Defence Indu
AS _BYTE ' percent of planetary production in Industry Eco
AS _BYTE ' percent of planetary production in Ecology Tech
AS _BYTE ' percent of planetary production in Technology Shiplock
AS _BYTE ' is ship production locked DefnLock
AS _BYTE ' is defence production locked InduLock
AS _BYTE ' is factory production locked EcoLock
AS _BYTE ' is ecology production locked TechLock
AS _BYTE ' is technology production locked Disaster
AS _BYTE ' what threat is facing the planet Years
AS _BYTE ' how long does the planet have Solution
AS INTEGER 'how much is needed until disaster is averted TransLoc
AS _BYTE ' system destination of transports
Frame
AS _BYTE 'vortex animation frame
CONST CENTER
= 2, LEFT
= 1 CONST Black
= 1, White
= 2, Blue
= 3, Green
= 4, Yellow
= 5, Red
= 6, Grey
= 7, YellowG
= 8, WhiteG
= 9, GreyG
= 10, DkGreen
= 11, BrGreen
= 12, MdGreen
= 13, LtGreen
= 14, YellowGA
= 15 CONST NORMAL
= 0, SMALL
= 1, XSMALL
= 2, PLANETOID
= 3, OUTLINE
= 4 CONST UPoor
= 1, Poor
= 2, Norm
= 3, Artifact
= 6, Rich
= 4, URich
= 5, Orion
= 7
DIM SHARED PlanetCount
(4), Planet
(108) AS Planet_Data
, Ship
(5, 5) AS Ship_Data
DATA Human
,Mrrshan
,Silicoid
,Sakkra
,Psilon
,Alkari
,Klackon
,Bulrathi
,Meklar
,Darlok
DATA "Durash IV","Alexander","Strader","Johann III","Lasitus","Bladrov II","Prrsha","Miamar","Mirana","Shandra","Jasana","Yalara","Igneous","Crystous","Geode","Carnax","Sedimin","Granid","Hissa","Kryssta","Sauron","Tyranid","Guanar","Saurak","Tachaon","Quark","Meson","Kelvan","Dynalon","Zygot ","Farseer","Skylord","Ariel","Redwing","Highsoar","Sharpclaw","Ixitixl","K'kalak","Kikitik","Xantak","Kaxal","Klaquan","Grunk","Bullux","Krungo","Monch","Durpp","Smurch","M5-35","TX-1138","CB-715","QX-537","INT-986","TVC-15","Ssithra","Nazgur","Darquan","Morfane","Shador","Narzina" DATA "Sol","Fierias","Cryslon","Sssla","Mentar","Altair","Kholdan","Ursa","Meklon","Nazin","Paranar","Denubius","Antares","Draconis","Zoctan","Rigel","Talas","Moro","Quayal","Neptunus","Jinga","Argus","Escalon","Berel","Collassa","Whynil","Nordia","Tau Cygni","Phyco","Firma","Keeta","Arietis","Rhilus","Willow","Mu Delphi","Stalaz","Gorra","Beta Ceti","Spica","Omicron","Rha","Kailis","Vulcan","Centauri","Herculis","Endoria","Kulthos","Hyboria","Zhardan","Yarrow","Incedius","Paladia","Romulas","Galos","Uxmai","Thrax","Laan","Imra","Selia","Seidon","Tao","Rana","Vox","Maalor","Xudax","Helos","Crypto","Gion","Phantos","Reticuli","Maretta","Toranor","Exis","Tyr","Ajax","Obaca","Dolz","Drakka","Ryoun","Vega","Anraq","Gienah","Rotan","Proxima","Mobas","Iranha","Celtsi","Dunatis","Morrig","Primodius","Nyarl","Ukko","Crius","Hyades","Kronos","Guradas","Rayden","Kakata","Misha","Xendalla","Artemis","Aurora","Proteus","Esper","Darrian","Trax","Xengara","Nitzer","Simius","Bootis","Pollus","Cygni","Aquilae","Volantis","Tauri","Regulus","Klystron","Lyae","Capella","Alcor" 'Font offsets and sizes NORMAL
' 0 1 2 3 4 5 6 7 8 9
DATA 0,6,1,3,0,6,0,7,0,6,0,6,0,6,0,6,0,6,0,6 ' a b c d e f g h i j k l m n o p q r s t u v w x y z - .
DATA 0,7,0,6,0,6,0,6,0,6,0,6,0,6,0,6,2,3,1,5,0,6,0,6,0,7,0,6,0,6,0,6,0,7,0,6,0,6,0,6,0,6,0,7,0,7,0,6,0,6,0,7 DATA 1,4,0,5,0,5,0,5,0,5,0,5,0,5,0,5,2,2,1,4,0,5,2,3,0,7,0,5,0,5,0,5,0,5,0,5,0,5,0,6,0,5,0,6,0,7,0,5,0,5,0,5,0,5,3,4 '----------------------PLANETOID
' 0 1 2 3 4 5 6 7 8 9
DATA 0,7,0,4,0,7,0,7,0,7,0,7,0,7,0,7,0,7,0,7 ' a b c d e f g h i j k l m n o p q r s t u v w x y z - / . :
DATA 0,10,0,10,0,10,0,10,0,10,0,10,0,10,0,10,0,5,0,7,0,10,0,10,0,13,0,10,0,10,0,10,0,11,0,10,0,10,0,9,0,10,0,10,0,13,0,10,0,10,0,10 DATA 0,07,0,07,0,07,0,07,0,07,0,06,0,07,0,07,0,4,0,5,0,07,0,04,0,10,0,07,0,07,0,07,0,07,0,07,0,07,0,6,0,07,0,07,0,10,0,07,0,07,0,07,0,7,0,8,0,9,0,4,0,4
DATA "expert traders,and magnificent,diplomats" DATA "immune to,hostile plant,evniroments" DATA "increased,population,growth" DATA "superior,research,techniques" DATA "increased,worker,production" DATA "terrific ground,fighters" DATA "enhanced,factory,controls" DATA Blue
,Green
,Purple
,Red
,White
,Yellow
'starting ship data
Starting_Ships:
DATA "Scout",0,1,40,3,2,6,1,1,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0 DATA "Fighter",0,2,40,3,2,6,1,1,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0 DATA "Destroyer",1,7,200,18,1,36,1,1,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0 DATA "Bomber",1,8,200,18,1,36,1,1,1,0,0,0,3,0,0,0,1,0,0,0,0,0,0 DATA "Colony Ship",2,13,1000,100,0,200,1,1,1,0,0,0,0,0,0,0,0,0,0,0,2,0,0 Planet_Types:
DATA t
,j
,o
,a
,s
,d
,m
,b
,u
,e
,i
,p
,r
,,n
Planet_Wealth:
DATA "ultra poor","poor","normal","rich","ultra rich","artifact","orion"
Mix&
= _NEWIMAGE(640, 400, 32) 'screen premix layerLayer
(2) = _NEWIMAGE(640, 400, 32) 'Main menu animation layer'Layer(3) = _LOADIMAGE("SpaceLord.bmp", 32)
'Layer(4) = _LOADIMAGE("menuchoice.bmp", 32)
'Layer(5) = _LOADIMAGE("HandPointer.bmp", 32)
'Layer(6) = _LOADIMAGE("NewGame0.bmp", 32)
'Layer(7) = _LOADIMAGE("GameOptions.bmp", 32)
'Layer(8) = _LOADIMAGE("custom0.bmp", 32)
Layer
(9) = _NEWIMAGE(640, 400, 32) 'font transferlayer for _clearcolor'_LOADIMAGE("orionFont.bmp", 32)'Layer(10) = _LOADIMAGE("RaceFaces.bmp", 32)
'Layer(11) = _LOADIMAGE("Flags.bmp", 32)
'Layer(12) = _LOADIMAGE("MainView0.bmp", 32)
'Layer(13) = _LOADIMAGE("Game_Options.bmp", 32)
'Layer(14) = _LOADIMAGE("Design_Screen.bmp", 32)
'Layer(15) = _LOADIMAGE("shipsheet.bmp", 32)
'Layer(16) = _LOADIMAGE("fleetbrb0.bmp", 32)
'Layer(17) = _LOADIMAGE("viewship0.bmp", 32)
'Layer(18) = _LOADIMAGE("shipspec.bmp", 32)
'Layer(19) = _LOADIMAGE("mapview0.bmp", 32)
'Layer(20) = _LOADIMAGE("sky.bmp", 32)
'Layer(28) = _LOADIMAGE("FontAdvanced.bmp", 32)
Layer
(29) = _NEWIMAGE(1080, 64, 256) 'fontlayerLayer
(30) = _NEWIMAGE(640, 400, 32) 'click layer
MFI_Loader "SpaceLordV1.MFI"
'_CLEARCOLOR _RGB32(2, 2, 2), Layer(9)
'randomize timer
InitFont 0
_DELAY .33 'time for window to load
_SOURCE Layer
(30) 'set to Click layer for mouse checking. only layer that needs to be checked.
MFlags = 12 'menu option flags; 1-autosave file found, 2-saved games found,4-new game option, 8-quit game option
Check_Saves
'----------------Load data-----------------
FOR i%%
= 1 TO 10 'load race names FOR i%%
= 1 TO 10 'load leader default names FOR i%%
= 1 TO 120 'load planet default names FOR i%%
= 0 TO 63 'load font offset/sizes NORMAL READ F
(0, i%%
).Xloc
, F
(0, i%%
).Xsiz
'------load font offset/sizes PLANETIOD-----
READ F
(1, 0).Xloc
, F
(1, 0).Xsiz
F(1, 0).Xoff = 0
READ F
(1, i%%
).Xloc
, F
(1, i%%
).Xsiz
F(1, i%%).Xoff = F(1, i%% - 1).Xoff + F(1, i%% - 1).Xsiz
READ Ship
(0, i%%
).Manuver
READ Ship
(0, i%%
).Computer
READ Ship
(0, i%%
).Weapon1
READ Ship
(0, i%%
).Weapon2
READ Ship
(0, i%%
).Weapon3
READ Ship
(0, i%%
).Weapon4
READ Ship
(0, i%%
).Special1
READ Ship
(0, i%%
).Special2
READ Ship
(0, i%%
).Special3
'-----------------------------------------------
G.Player_Race = 1
G.Player_Colr = 1
G.Galaxy_Size = 0
G.Difficulty = 0
G.Races = 0
G.Races = 1
G.Player_Race = 1
G.Player_Colr = 1
G.Galaxy_Size = 1
Player(1).FactoryCost = 10
Player(1).Factorywaste = 100
Player(1).EcoRestore = 2
'Play_Game
'Ship_Design
'Fleet
'SLEEP
'SYSTEM
'END
'------------Main Loop-------------------
Play_Intro
ClearLayer Layer(2)
Nul%% = MainMenu
CASE 1 'Continue game(AutoSaved) G.Start_Game = TRUE
Choose_Leader_Name
Choose_System_Name
ELSE 'user escaped from new game setup ELSE 'user escaped from new game setup ELSE 'user escaped from new game setup ExitFlag%% = TRUE
IF G.Start_Game
THEN Play_Game
'----------------------------------------
PRINT "Thanks for playing Master Of Orion!"
BuildClickLayer Layer(30), 5
'create the Universe!
Make_Planets
'bring up main screen
Opt%% = Check_Pos(MX%, MY%)
Button_Down_Lock
Amt%% = MX% - 504
Planet(G.Selected_Planet).Ship = Amt%% * 2
AdjustProductionValues 1
Amt%% = MX% - 504
Planet(G.Selected_Planet).Defn = Amt%% * 2
AdjustProductionValues 2
Amt%% = MX% - 504
Planet(G.Selected_Planet).Indu = Amt%% * 2
AdjustProductionValues 3
Amt%% = MX% - 504
Planet(G.Selected_Planet).Eco = Amt%% * 2
AdjustProductionValues 4
Amt%% = MX% - 504
Planet(G.Selected_Planet).Tech = Amt%% * 2
AdjustProductionValues 5
Planet(G.Selected_Planet).Ship = Planet(G.Selected_Planet).Ship - 2
IF Planet
(G.Selected_Planet
).Ship
<= -2 THEN Planet
(G.Selected_Planet
).Ship
= 0 AdjustProductionValues 1
Planet(G.Selected_Planet).Defn = Planet(G.Selected_Planet).Defn - 2
IF Planet
(G.Selected_Planet
).Defn
<= -2 THEN Planet
(G.Selected_Planet
).Defn
= 0 AdjustProductionValues 2
Planet(G.Selected_Planet).Indu = Planet(G.Selected_Planet).Indu - 2
IF Planet
(G.Selected_Planet
).Indu
<= -2 THEN Planet
(G.Selected_Planet
).Indu
= 0 AdjustProductionValues 3
Planet(G.Selected_Planet).Eco = Planet(G.Selected_Planet).Eco - 2
IF Planet
(G.Selected_Planet
).Eco
<= -2 THEN Planet
(G.Selected_Planet
).Eco
= 0 AdjustProductionValues 4
Planet(G.Selected_Planet).Tech = Planet(G.Selected_Planet).Tech - 2
IF Planet
(G.Selected_Planet
).Tech
<= -2 THEN Planet
(G.Selected_Planet
).Tech
= 0 AdjustProductionValues 5
Planet(G.Selected_Planet).Ship = Planet(G.Selected_Planet).Ship + 2
IF Planet
(G.Selected_Planet
).Ship
>= 102 THEN Planet
(G.Selected_Planet
).Ship
= 100 AdjustProductionValues 1
Planet(G.Selected_Planet).Defn = Planet(G.Selected_Planet).Defn + 2
IF Planet
(G.Selected_Planet
).Defn
>= 102 THEN Planet
(G.Selected_Planet
).Defn
= 100 AdjustProductionValues 2
Planet(G.Selected_Planet).Indu = Planet(G.Selected_Planet).Indu + 2
IF Planet
(G.Selected_Planet
).Indu
>= 102 THEN Planet
(G.Selected_Planet
).Indu
= 100 AdjustProductionValues 3
Planet(G.Selected_Planet).Eco = Planet(G.Selected_Planet).Eco + 2
IF Planet
(G.Selected_Planet
).Eco
>= 102 THEN Planet
(G.Selected_Planet
).Eco
= 100 AdjustProductionValues 4
Planet(G.Selected_Planet).Tech = Planet(G.Selected_Planet).Tech + 2
IF Planet
(G.Selected_Planet
).Tech
>= 102 THEN Planet
(G.Selected_Planet
).Tech
= 100 AdjustProductionValues 5
IF Planet
(G.Selected_Planet
).Shiplock
THEN Planet
(G.Selected_Planet
).Shiplock
= FALSE
ELSE Planet
(G.Selected_Planet
).Shiplock
= TRUE
IF Planet
(G.Selected_Planet
).DefnLock
THEN Planet
(G.Selected_Planet
).DefnLock
= FALSE
ELSE Planet
(G.Selected_Planet
).DefnLock
= TRUE
IF Planet
(G.Selected_Planet
).InduLock
THEN Planet
(G.Selected_Planet
).InduLock
= FALSE
ELSE Planet
(G.Selected_Planet
).InduLock
= TRUE
IF Planet
(G.Selected_Planet
).EcoLock
THEN Planet
(G.Selected_Planet
).EcoLock
= FALSE
ELSE Planet
(G.Selected_Planet
).EcoLock
= TRUE
IF Planet
(G.Selected_Planet
).TechLock
THEN Planet
(G.Selected_Planet
).TechLock
= FALSE
ELSE Planet
(G.Selected_Planet
).TechLock
= TRUE
Game_Options
IF G.Quit_Game
THEN Exitflag%%
= TRUE
Ship_Design
Fleet
View_Map
IF Planet
(G.Selected_Planet
).Race1Visit
THEN
BuildMainGameDisplay Opt%%
Resource_Display
BuildClickLayer Layer(30), 10
Selection%% = 1
Opt%% = Check_Pos(MX%, MY%)
Clickset%% = TRUE
IF Opt%%
<> 0 THEN Selection%%
= Opt%%
Exitflag%% = TRUE
Clickset%% = FALSE
IF Selection%%
= 1 THEN _PUTIMAGE (490, 52)-STEP(121, 23), Layer
(4), Mix&
, (61, 110)-STEP(60, 11) ELSE _PUTIMAGE (490, 52)-STEP(121, 23), Layer
(4), Mix&
, (0, 110)-STEP(60, 11) IF Selection%%
= 2 THEN _PUTIMAGE (490, 92)-STEP(121, 23), Layer
(4), Mix&
, (61, 122)-STEP(60, 11) ELSE _PUTIMAGE (490, 92)-STEP(121, 23), Layer
(4), Mix&
, (0, 122)-STEP(60, 11) IF Selection%%
= 3 THEN _PUTIMAGE (490, 132)-STEP(121, 23), Layer
(4), Mix&
, (61, 134)-STEP(60, 11) ELSE _PUTIMAGE (490, 132)-STEP(121, 23), Layer
(4), Mix&
, (0, 134)-STEP(60, 11) IF Selection%%
= 4 THEN _PUTIMAGE (490, 360)-STEP(121, 23), Layer
(4), Mix&
, (61, 146)-STEP(60, 11) ELSE _PUTIMAGE (490, 360)-STEP(121, 23), Layer
(4), Mix&
, (0, 146)-STEP(60, 11)
FOR i%%
= 0 TO PlanetCount
(G.Galaxy_Size
) - 1 IF Planet
(i%%
).Race1Visit
THEN _PUTIMAGE (INT(Planet
(i%%
).XLoc
* 2.25), Planet
(i%%
).YLoc
* 2)-STEP(13, 13), Layer
(4), Mix&
, (109 + (Planet
(i%%
).Colr
* 8), 65)-STEP(6, 6) IF Selection%%
= 2 THEN Oprint
INT(Planet
(i%%
).XLoc
* 2.25) + 16, Planet
(i%%
).YLoc
* 2, PT
(Planet
(i%%
).
Environ), Green
, XSMALL
IF Planet
(i%%
).Wealth
= 1 THEN Oprint
INT(Planet
(i%%
).XLoc
* 2.25) - ox%%
, Planet
(i%%
).YLoc
* 2 + 12, PW
(Planet
(i%%
).Wealth
), Red
, XSMALL
IF Planet
(i%%
).Wealth
= 2 THEN Oprint
INT(Planet
(i%%
).XLoc
* 2.25) - ox%%
, Planet
(i%%
).YLoc
* 2 + 12, PW
(Planet
(i%%
).Wealth
), Red
, XSMALL
IF Planet
(i%%
).Wealth
= 4 THEN Oprint
INT(Planet
(i%%
).XLoc
* 2.25) - ox%%
, Planet
(i%%
).YLoc
* 2 + 12, PW
(Planet
(i%%
).Wealth
), Blue
, XSMALL
IF Planet
(i%%
).Wealth
= 5 THEN Oprint
INT(Planet
(i%%
).XLoc
* 2.25) - ox%%
, Planet
(i%%
).YLoc
* 2 + 12, PW
(Planet
(i%%
).Wealth
), Blue
, XSMALL
IF Planet
(i%%
).Wealth
= 6 THEN Oprint
INT(Planet
(i%%
).XLoc
* 2.25) - ox%%
, Planet
(i%%
).YLoc
* 2 + 12, PW
(Planet
(i%%
).Wealth
), Green
, XSMALL
IF Planet
(i%%
).Wealth
= 7 THEN Oprint
INT(Planet
(i%%
).XLoc
* 2.25) - ox%%
, Planet
(i%%
).YLoc
* 2 + 12, PW
(Planet
(i%%
).Wealth
), Green
, XSMALL
_PUTIMAGE (INT(Planet
(i%%
).XLoc
* 2.25) + 1, Planet
(i%%
).YLoc
* 2 + 1)-STEP(9, 9), Layer
(4), Mix&
, (62, 64)-STEP(4, 4) FOR i%%
= 0 TO PlanetCount
(G.Galaxy_Size
) - 1 _PUTIMAGE (INT(Planet
(i%%
).XLoc
* 2.25), Planet
(i%%
).YLoc
* 2)-STEP(13, 13), Layer
(4), Mix&
, (109 + (Planet
(i%%
).Colr
* 8), 65)-STEP(6, 6)
Oprint 482, 14, "Galaxy Map", YellowGA, PLANETOID
Oprint 496, 172, "Map Key", YellowGA, PLANETOID
Oprint 482, 208, "t", Green, XSMALL
Oprint 482, 222, "j", Green, XSMALL
Oprint 482, 236, "o", Green, XSMALL
Oprint 482, 250, "a", Green, XSMALL
Oprint 482, 264, "s", Green, XSMALL
Oprint 482, 278, "d", Green, XSMALL
Oprint 482, 292, "m", Green, XSMALL
Oprint 552, 208, "b", Red, XSMALL
Oprint 552, 222, "u", Red, XSMALL
Oprint 552, 236, "e", Red, XSMALL
Oprint 552, 250, "i", Red, XSMALL
Oprint 552, 264, "p", Red, XSMALL
Oprint 552, 278, "r", Red, XSMALL
Oprint 552, 292, "n", Red, XSMALL
Oprint 494, 208, "terran", Black, XSMALL
Oprint 494, 222, "jungle", Black, XSMALL
Oprint 494, 236, "ocean", Black, XSMALL
Oprint 494, 250, "arid", Black, XSMALL
Oprint 494, 264, "steppe", Black, XSMALL
Oprint 494, 278, "desert", Black, XSMALL
Oprint 494, 292, "minimal", Black, XSMALL
Oprint 564, 208, "barren", Black, XSMALL
Oprint 564, 222, "tundra", Black, XSMALL
Oprint 564, 236, "dead", Black, XSMALL
Oprint 564, 250, "inferno", Black, XSMALL
Oprint 564, 264, "toxic", Black, XSMALL
Oprint 564, 278, "radiated", Black, XSMALL
Oprint 564, 292, "none", Black, XSMALL
Oprint 494, 318, "unable to land on", Black, XSMALL
ClearLayer Mix&
BuildClickLayer Layer(30), 5
BuildClickLayer Layer(30), 6
Opt%% = Check_Pos(MX%, MY%)
Clickset%% = TRUE
Selection%% = Opt%%
Save_Game
Load_Game
G.Quit_Game = TRUE
Exitflag%% = TRUE
G.Sound_Setting = FALSE
G.Sound_Setting = 1
G.Sound_Setting = 2
Exitflag%% = TRUE
Clickset%% = FALSE
BuildClickLayer Layer(30), 5
ClearLayer Mix&
ClearLayer Mix&
BuildClickLayer Layer(30), 9
Opt%% = Check_Pos(MX%, MY%)
Clickset%% = TRUE
Selection%% = Opt%%
Ship_Specs
Selection%% = 0
ExitFlag%% = TRUE
Clickset%% = FALSE
_PUTIMAGE (8 + (x%%
* 88), 34 + (y%%
* 66))-STEP(73, 51), Layer
(4), Mix&
, (128, 84)-STEP(33, 25) Cntr%%
= LEN(RTRIM$(Ship
(0, x%%
- 1).Nam
)) * 6 / 2 Oprint
40 + (x%%
* 88) - Cntr%%
, 12, RTRIM$(Ship
(0, x%%
- 1).Nam
), Yellow
, XSMALL
IF Selection%%
= 1 THEN _PUTIMAGE (362, 364)-STEP(69, 21), Layer
(4), Mix&
, (202, 74)-STEP(34, 10) ELSE _PUTIMAGE (362, 364)-STEP(69, 21), Layer
(4), Mix&
, (166, 74)-STEP(34, 10) IF Selection%%
= 2 THEN _PUTIMAGE (450, 364)-STEP(69, 21), Layer
(4), Mix&
, (202, 86)-STEP(34, 10) ELSE _PUTIMAGE (450, 364)-STEP(69, 21), Layer
(4), Mix&
, (166, 86)-STEP(34, 10) IF Selection%%
= 3 THEN _PUTIMAGE (538, 364)-STEP(69, 21), Layer
(4), Mix&
, (202, 98)-STEP(34, 10) ELSE _PUTIMAGE (538, 364)-STEP(69, 21), Layer
(4), Mix&
, (166, 98)-STEP(34, 10)
ClearLayer Mix&
BuildClickLayer Layer(30), 5
ClearLayer Mix&
BuildClickLayer Layer(30), 10
Opt%% = Check_Pos(MX%, MY%)
Clickset%% = TRUE
Selection%% = Opt%%
ExitFlag%% = TRUE
Clickset%% = FALSE
BuildClickLayer Layer(30), 9
ClearLayer Mix&
BuildClickLayer Layer(30), 7
Opt%% = Check_Pos(MX%, MY%)
Clickset%% = TRUE
Selection%% = Opt%%
ExitFlag%% = TRUE
ExitFlag%% = TRUE
Clickset%% = FALSE
BuildClickLayer Layer(30), 6
ClearLayer Mix&
BuildClickLayer Layer(30), 7
Opt%% = Check_Pos(MX%, MY%)
Clickset%% = TRUE
Selection%% = Opt%%
ExitFlag%% = TRUE
ExitFlag%% = TRUE
Clickset%% = FALSE
BuildClickLayer Layer(30), 6
ClearLayer Mix&
BuildClickLayer Layer(30), 8
Opt%% = Check_Pos(MX%, MY%)
Clickset%% = TRUE
Selection%% = Opt%%
ExitFlag%% = TRUE
ExitFlag%% = TRUE
Clickset%% = FALSE
IF Ship
(0, 0).Siz
= 0 THEN Oprint
52, 326, "SMALL", White
, SMALL
ELSE Oprint
52, 326, "SMALL", Grey
, SMALL
IF Ship
(0, 0).Siz
= 1 THEN Oprint
48, 340, "MEDIUM", White
, SMALL
ELSE Oprint
48, 340, "MEDIUM", Grey
, SMALL
IF Ship
(0, 0).Siz
= 2 THEN Oprint
52, 354, "LARGE", White
, SMALL
ELSE Oprint
52, 354, "LARGE", Grey
, SMALL
IF Ship
(0, 0).Siz
= 3 THEN Oprint
58, 368, "HUGE", White
, SMALL
ELSE Oprint
58, 368, "HUGE", Grey
, SMALL
Oprint 34, 232, "Special 1", DkGreen, SMALL
Oprint 34, 252, "Special 2", DkGreen, SMALL
Oprint 34, 272, "Special 3", DkGreen, SMALL
Oprint 34, 142, "Weapon 1", DkGreen, SMALL
Oprint 34, 162, "Weapon 2", DkGreen, SMALL
Oprint 34, 182, "Weapon 3", DkGreen, SMALL
Oprint 34, 202, "Weapon 4", DkGreen, SMALL
Oprint 118, 122, "Count Ship Weapons Damage Rng Notes", DkGreen, SMALL
Oprint 34, 44, "Computer", DkGreen, SMALL
Oprint 34, 68, "Sheild", DkGreen, SMALL
Oprint 34, 92, "Ecm", DkGreen, SMALL
Oprint 202, 44, "Attack Level", MdGreen, XSMALL
Oprint 202, 68, "", MdGreen, XSMALL
Oprint 202, 92, "Missile Def", MdGreen, XSMALL
Oprint 334, 44, "Armor", DkGreen, SMALL
Oprint 334, 68, "Engine", DkGreen, SMALL
Oprint 334, 92, "Maneuver", DkGreen, SMALL
Oprint 500, 44, "hit points", MdGreen, XSMALL
Oprint 500, 68, "warp def", MdGreen, XSMALL
Oprint 500, 92, "combat speed", MdGreen, XSMALL
' _PUTIMAGE (286, 324)-STEP(11, 41), Layer(4), Mix&, (59, 79)-STEP(5, 20) 'button down
' _PUTIMAGE (286, 358)-STEP(11, 41), Layer(4), Mix&, (59, 96)-STEP(5, 20)
Display_Ship 184, 328, 1, Ship(0, 0).Img, 0
ClearLayer Mix&
BuildClickLayer Layer(30), 5
SUB Display_Ship
(X%
, Y%
, C%
, T%
, F%
) 'X%,Y%- Location to display ship
'C%-Which color ship to display(0-5)
'T%-which type\model of ship(0-35)
'F%-Frame of animation of ship to display(0-4)
C% = C% - 1: T% = T% - 1
_PUTIMAGE (X%
, Y%
)-STEP(63, 47), Layer
(15), Mix&
, (0 + (C%
* 165 + F%
* 33), 0 + (T%
* 25))-STEP(31, 23)
FUNCTION TotalResourceDistrubution~%%
(P%%
) Total~%% = Planet(P%%).Ship + Planet(P%%).Defn + Planet(P%%).Indu
Total~%% = Total~%% + Planet(P%%).Eco + Planet(P%%).Tech
TotalResourceDistrubution~%% = Total~%%
SUB AdjustProductionValues
(Opt%%
) 'auto adjust so maximum production is 100, this is where the actual game cheats from time
' to time by allowing other races to have more than 100% production. Have seen values as
' high at 2600% before.
'try to pull from bottom up save for TECH which pulls from the top down
temp~%% = TotalResourceDistrubution(G.Selected_Planet) 'how much over 100 is planet
temp~%% = temp~%% - 100 'how much needs pulled
IF Planet
(G.Selected_Planet
).Tech
> 0 AND (NOT Planet
(G.Selected_Planet
).TechLock
) THEN Planet(G.Selected_Planet).Tech = Planet(G.Selected_Planet).Tech - 1
temp~%% = temp~%% - 1
ELSEIF Planet
(G.Selected_Planet
).Eco
> 0 AND (NOT Planet
(G.Selected_Planet
).EcoLock
) THEN Planet(G.Selected_Planet).Eco = Planet(G.Selected_Planet).Eco - 1
temp~%% = temp~%% - 1
ELSEIF Planet
(G.Selected_Planet
).Indu
> 0 AND (NOT Planet
(G.Selected_Planet
).InduLock
) THEN Planet(G.Selected_Planet).Indu = Planet(G.Selected_Planet).Indu - 1
temp~%% = temp~%% - 1
ELSEIF Planet
(G.Selected_Planet
).Defn
> 0 AND (NOT Planet
(G.Selected_Planet
).DefnLock
) THEN Planet(G.Selected_Planet).Defn = Planet(G.Selected_Planet).Defn - 1
temp~%% = temp~%% - 1
ELSE 'no other source of free production avaliable Planet(G.Selected_Planet).Ship = Planet(G.Selected_Planet).Ship - 1
temp~%% = temp~%% - 1
IF Planet
(G.Selected_Planet
).Tech
> 0 AND (NOT Planet
(G.Selected_Planet
).TechLock
) THEN Planet(G.Selected_Planet).Tech = Planet(G.Selected_Planet).Tech - 1
temp~%% = temp~%% - 1
ELSEIF Planet
(G.Selected_Planet
).Eco
> 0 AND (NOT Planet
(G.Selected_Planet
).EcoLock
) THEN Planet(G.Selected_Planet).Eco = Planet(G.Selected_Planet).Eco - 1
temp~%% = temp~%% - 1
ELSEIF Planet
(G.Selected_Planet
).Indu
> 0 AND (NOT Planet
(G.Selected_Planet
).InduLock
) THEN Planet(G.Selected_Planet).Indu = Planet(G.Selected_Planet).Indu - 1
temp~%% = temp~%% - 1
ELSEIF Planet
(G.Selected_Planet
).Ship
> 0 AND (NOT Planet
(G.Selected_Planet
).Shiplock
) THEN Planet(G.Selected_Planet).Ship = Planet(G.Selected_Planet).Ship - 1
temp~%% = temp~%% - 1
ELSE 'no other source of free production avaliable Planet(G.Selected_Planet).Defn = Planet(G.Selected_Planet).Defn - 1
temp~%% = temp~%% - 1
IF Planet
(G.Selected_Planet
).Tech
> 0 AND (NOT Planet
(G.Selected_Planet
).TechLock
) THEN Planet(G.Selected_Planet).Tech = Planet(G.Selected_Planet).Tech - 1
temp~%% = temp~%% - 1
ELSEIF Planet
(G.Selected_Planet
).Eco
> 0 AND (NOT Planet
(G.Selected_Planet
).EcoLock
) THEN Planet(G.Selected_Planet).Eco = Planet(G.Selected_Planet).Eco - 1
temp~%% = temp~%% - 1
ELSEIF Planet
(G.Selected_Planet
).Ship
> 0 AND (NOT Planet
(G.Selected_Planet
).Shiplock
) THEN Planet(G.Selected_Planet).Ship = Planet(G.Selected_Planet).Ship - 1
temp~%% = temp~%% - 1
ELSEIF Planet
(G.Selected_Planet
).Defn
> 0 AND (NOT Planet
(G.Selected_Planet
).DefnLock
) THEN Planet(G.Selected_Planet).Defn = Planet(G.Selected_Planet).Defn - 1
temp~%% = temp~%% - 1
ELSE 'no other source of free production avaliable Planet(G.Selected_Planet).Indu = Planet(G.Selected_Planet).Indu - 1
temp~%% = temp~%% - 1
CASE 4 'Ecological change IF Planet
(G.Selected_Planet
).Tech
> 0 AND (NOT Planet
(G.Selected_Planet
).TechLock
) THEN Planet(G.Selected_Planet).Tech = Planet(G.Selected_Planet).Tech - 1
temp~%% = temp~%% - 1
ELSEIF Planet
(G.Selected_Planet
).Ship
> 0 AND (NOT Planet
(G.Selected_Planet
).Shiplock
) THEN Planet(G.Selected_Planet).Ship = Planet(G.Selected_Planet).Ship - 1
temp~%% = temp~%% - 1
ELSEIF Planet
(G.Selected_Planet
).Indu
> 0 AND (NOT Planet
(G.Selected_Planet
).InduLock
) THEN Planet(G.Selected_Planet).Indu = Planet(G.Selected_Planet).Indu - 1
temp~%% = temp~%% - 1
ELSEIF Planet
(G.Selected_Planet
).Defn
> 0 AND (NOT Planet
(G.Selected_Planet
).DefnLock
) THEN Planet(G.Selected_Planet).Defn = Planet(G.Selected_Planet).Defn - 1
temp~%% = temp~%% - 1
ELSE 'no other source of free production avaliable Planet(G.Selected_Planet).Eco = Planet(G.Selected_Planet).Eco - 1
temp~%% = temp~%% - 1
CASE 5 'technology change IF Planet
(G.Selected_Planet
).Ship
> 0 AND (NOT Planet
(G.Selected_Planet
).Shiplock
) THEN Planet(G.Selected_Planet).Ship = Planet(G.Selected_Planet).Ship - 1
temp~%% = temp~%% - 1
ELSEIF Planet
(G.Selected_Planet
).Defn
> 0 AND (NOT Planet
(G.Selected_Planet
).DefnLock
) THEN Planet(G.Selected_Planet).Defn = Planet(G.Selected_Planet).Defn - 1
temp~%% = temp~%% - 1
ELSEIF Planet
(G.Selected_Planet
).Indu
> 0 AND (NOT Planet
(G.Selected_Planet
).InduLock
) THEN Planet(G.Selected_Planet).Indu = Planet(G.Selected_Planet).Indu - 1
temp~%% = temp~%% - 1
ELSEIF Planet
(G.Selected_Planet
).Eco
> 0 AND (NOT Planet
(G.Selected_Planet
).EcoLock
) THEN Planet(G.Selected_Planet).Eco = Planet(G.Selected_Planet).Eco - 1
temp~%% = temp~%% - 1
ELSE 'no other source of free production avaliable Planet(G.Selected_Planet).Tech = Planet(G.Selected_Planet).Tech - 1
temp~%% = temp~%% - 1
ELSE 'a production has been reduced so add to another production bar temp~%% = 100 - temp~%% 'how much to add back in to make 100 again
CASE 1 'ship shifts to tech(if not locked) IF NOT Planet
(G.Selected_Planet
).TechLock
THEN Planet(G.Selected_Planet).Tech = Planet(G.Selected_Planet).Tech + temp~%%
Planet(G.Selected_Planet).Eco = Planet(G.Selected_Planet).Eco + temp~%%
Planet(G.Selected_Planet).Indu = Planet(G.Selected_Planet).Indu + temp~%%
Planet(G.Selected_Planet).Defn = Planet(G.Selected_Planet).Defn + temp~%%
Planet(G.Selected_Planet).Ship = Planet(G.Selected_Planet).Ship + temp~%%
CASE 2 'defn shifts to tech(if not locked) IF NOT Planet
(G.Selected_Planet
).TechLock
THEN Planet(G.Selected_Planet).Tech = Planet(G.Selected_Planet).Tech + temp~%%
Planet(G.Selected_Planet).Eco = Planet(G.Selected_Planet).Eco + temp~%%
Planet(G.Selected_Planet).Indu = Planet(G.Selected_Planet).Indu + temp~%%
Planet(G.Selected_Planet).Ship = Planet(G.Selected_Planet).Ship + temp~%%
ELSE 'everything else is locked so put produciton back in defence Planet(G.Selected_Planet).Defn = Planet(G.Selected_Planet).Defn + temp~%%
CASE 3 'indu shifts to tech(if not locked) IF NOT Planet
(G.Selected_Planet
).TechLock
THEN Planet(G.Selected_Planet).Tech = Planet(G.Selected_Planet).Tech + temp~%%
Planet(G.Selected_Planet).Ship = Planet(G.Selected_Planet).Ship + temp~%%
Planet(G.Selected_Planet).Defn = Planet(G.Selected_Planet).Defn + temp~%%
Planet(G.Selected_Planet).Eco = Planet(G.Selected_Planet).Eco + temp~%%
ELSE 'everything else is locked so put produciton back in industry Planet(G.Selected_Planet).Indu = Planet(G.Selected_Planet).Indu + temp~%%
CASE 4 'eco shifts to tech(if not locked) IF NOT Planet
(G.Selected_Planet
).TechLock
THEN Planet(G.Selected_Planet).Tech = Planet(G.Selected_Planet).Tech + temp~%%
Planet(G.Selected_Planet).Ship = Planet(G.Selected_Planet).Ship + temp~%%
Planet(G.Selected_Planet).Indu = Planet(G.Selected_Planet).Indu + temp~%%
Planet(G.Selected_Planet).Defn = Planet(G.Selected_Planet).Defn + temp~%%
ELSE 'everything else is locked so put produciton back in ecology Planet(G.Selected_Planet).Eco = Planet(G.Selected_Planet).Eco + temp~%%
CASE 5 'tech shifts to ship (if not locked) IF NOT Planet
(G.Selected_Planet
).Shiplock
THEN Planet(G.Selected_Planet).Ship = Planet(G.Selected_Planet).Ship + temp~%%
Planet(G.Selected_Planet).Defn = Planet(G.Selected_Planet).Defn + temp~%%
Planet(G.Selected_Planet).Indu = Planet(G.Selected_Planet).Indu + temp~%%
Planet(G.Selected_Planet).Eco = Planet(G.Selected_Planet).Eco + temp~%%
ELSE 'everything else is locked so put produciton back in techology Planet(G.Selected_Planet).Tech = Planet(G.Selected_Planet).Tech + temp~%%
SUB BuildMainGameDisplay
(MO%
) Oprint
545 - (LEN(RTRIM$(Planet
(G.Selected_Planet
).
Name)) / 2) * 20, 18, Planet
(G.Selected_Planet
).
Name, YellowG
, PLANETOID
Oprint 18, 366, "Game", OUTLINE, OUTLINE
Oprint 86, 366, "Design", OUTLINE, OUTLINE
Oprint 164, 366, "Fleet", OUTLINE, OUTLINE
Oprint 236, 366, "Map", OUTLINE, OUTLINE
Oprint 292, 366, "Races", OUTLINE, OUTLINE
Oprint 366, 366, "Planets", OUTLINE, OUTLINE
Oprint 458, 366, "Tech", OUTLINE, OUTLINE
Oprint 524, 366, "Next Turn", OUTLINE, OUTLINE
IF MO%
= 24 THEN Oprint
18, 368, "Game", White
, NORMAL
ELSE Oprint
18, 368, "Game", Grey
, NORMAL
IF MO%
= 25 THEN Oprint
86, 368, "Design", White
, NORMAL
ELSE Oprint
86, 368, "Design", Grey
, NORMAL
IF MO%
= 26 THEN Oprint
164, 368, "Fleet", White
, NORMAL
ELSE Oprint
164, 368, "Fleet", Grey
, NORMAL
IF MO%
= 27 THEN Oprint
236, 368, "Map", White
, NORMAL
ELSE Oprint
236, 368, "Map", Grey
, NORMAL
IF MO%
= 28 THEN Oprint
292, 368, "Races", White
, NORMAL
ELSE Oprint
292, 368, "Races", Grey
, NORMAL
IF MO%
= 29 THEN Oprint
366, 368, "Planets", White
, NORMAL
ELSE Oprint
366, 368, "Planets", Grey
, NORMAL
IF MO%
= 30 THEN Oprint
458, 368, "Tech", White
, NORMAL
ELSE Oprint
458, 368, "Tech", Grey
, NORMAL
IF MO%
= 31 THEN Oprint
524, 368, "Next Turn", White
, NORMAL
ELSE Oprint
524, 368, "Next Turn", Grey
, NORMAL
Oprint
614 - TotOff%%
, 144, "(" + LTRIM$(RTRIM$(STR$(PlanetProduction
(TOT
)))) + ")", Green
, XSMALL
FOR I%%
= 0 TO PlanetCount
(G.Galaxy_Size
) - 1 Planet
(I%%
).
Name = Planets
(10 + I%%
) Planet
(I%%
).XLoc
= INT(RND * 185) + 10 Planet
(I%%
).YLoc
= INT(RND * 150) + 10 Planet
(I%%
).XLoc
= INT(RND * 250) + 10 Planet
(I%%
).YLoc
= INT(RND * 190) + 10 Planet
(I%%
).XLoc
= INT(RND * 290) + 10 Planet
(I%%
).YLoc
= INT(RND * 240) + 10 Planet
(I%%
).XLoc
= INT(RND * 365) + 10 Planet
(I%%
).YLoc
= INT(RND * 320) + 10
Good%% = TRUE
IF Planet
(I%%
).XLoc
> Planet
(j%%
).XLoc
- 20 AND Planet
(I%%
).XLoc
< Planet
(j%%
).XLoc
+ 20 THEN Good%%
= FALSE
ELSE Good%%
= TRUE
IF Planet
(I%%
).YLoc
> Planet
(j%%
).YLoc
- 20 AND Planet
(I%%
).YLoc
< Planet
(j%%
).YLoc
+ 20 THEN Good%%
= FALSE
ELSE Good%%
= TRUE
Planet
(I%%
).Colr
= INT(RND * 6) population~%% = 10
CASE 1 TO 4 'max population <=50 population~%%
= (INT(RND * 8) + 2) * 5 CASE 5 TO 7 'max population <=70 population~%%
= (INT(RND * 12) + 2) * 5 CASE 9 TO 11 'max population <=95 population~%%
= (INT(RND * 17) + 2) * 5 CASE 12, 13 'max population <=120 population~%%
= (INT(RND * 22) + 2) * 5 Planet(I%%).BasePop = population~%%
Planet(I%%).ModPop = population~%%
Planet(I%%).MaxPop = population~%%
Planet(I%%).Race1Visit = TRUE
'------------make players system--------------
G.Selected_Planet
= INT(RND * PlanetCount
(G.Galaxy_Size
)) Planet
(G.Selected_Planet
).
Name = Planets
(G.Player_Race
) Planet(G.Selected_Planet).Owner = 1
Planet(G.Selected_Planet).Race1Visit = TRUE
Planet(G.Selected_Planet).CurPop = 50
Planet(G.Selected_Planet).LastPop = 50
Planet(G.Selected_Planet).Factory = 30
Planet(G.Selected_Planet).Ship = 0
Planet(G.Selected_Planet).Defn = 0
Planet(G.Selected_Planet).Indu = 60
Planet(G.Selected_Planet).Eco = 40
Planet(G.Selected_Planet).Tech = 0
'----------------------------------------------
Planet(G.Selected_Planet).Wealth = Norm
Planet(G.Selected_Planet).ActualProd = PlanetProduction(ACT)
Planet(G.Selected_Planet).TotalProd = PlanetProduction(TOT)
'draws the planetary resource distrubution display
bar(0) = 52 * (Planet(G.Selected_Planet).Ship / 100) - 1
bar(1) = 52 * (Planet(G.Selected_Planet).Defn / 100) - 1
bar(2) = 52 * (Planet(G.Selected_Planet).Indu / 100) - 1
bar(3) = 52 * (Planet(G.Selected_Planet).Eco / 100) - 1
bar(4) = 52 * (Planet(G.Selected_Planet).Tech / 100) - 1
IF Planet
(G.Selected_Planet
).Shiplock
THEN Lok
(1) = 26 ELSE Lok
(1) = 0 IF Planet
(G.Selected_Planet
).DefnLock
THEN Lok
(2) = 26 ELSE Lok
(2) = 0 IF Planet
(G.Selected_Planet
).InduLock
THEN Lok
(3) = 26 ELSE Lok
(3) = 0 IF Planet
(G.Selected_Planet
).EcoLock
THEN Lok
(4) = 26 ELSE Lok
(4) = 0 IF Planet
(G.Selected_Planet
).TechLock
THEN Lok
(5) = 26 ELSE Lok
(5) = 0
IF bar
(0) > 0 THEN 'shipyard alotment _PUTIMAGE (506, 168)-STEP(bar
(0), 7), Layer
(12), Mix&
, (320 + Lok
(1), 194)-STEP(bar
(0) \
2, 3) Oprint 596, 166, "NONE", Black, XSMALL
IF bar
(1) > 0 THEN 'defence alotment _PUTIMAGE (506, 191)-STEP(bar
(1), 7), Layer
(12), Mix&
, (320 + Lok
(2), 194)-STEP((bar
(1) \
2), 3) Oprint 596, 189, "NONE", Black, XSMALL
IF bar
(2) > 0 THEN 'industry alotment _PUTIMAGE (506, 213)-STEP(bar
(2), 7), Layer
(12), Mix&
, (320 + Lok
(3), 194)-STEP((bar
(2) \
2), 3) bar(2) = Planet(G.Selected_Planet).ActualProd * (Planet(G.Selected_Planet).Indu / 100)
IF bar
(2) / Player
(Planet
(G.Selected_Planet
).Owner
).FactoryCost
< 10 THEN Fact$
= LEFT$(LTRIM$(RTRIM$(STR$(bar
(2) / Player
(Planet
(G.Selected_Planet
).Owner
).FactoryCost
))), 3) + "/Y" Fact$
= LEFT$(LTRIM$(RTRIM$(STR$(bar
(2) / Player
(Planet
(G.Selected_Planet
).Owner
).FactoryCost
))), 2) + "/Y" Oprint
610 - LEN(Fact$
) * 4, 211, Fact$
, Black
, XSMALL
Oprint 596, 211, "NONE", Black, XSMALL
'---------------------planetary alotment--------------------
'determine factory waste by # of factories * factorywaste%(100,80,60,40,20,0)
IF bar
(3) > 0 THEN _PUTIMAGE (506, 235)-STEP(bar
(3), 7), Layer
(12), Mix&
, (320 + Lok
(4), 194)-STEP((bar
(3) \
2), 3) bar(3) = Planet(G.Selected_Planet).Eco
waste%
= INT((Planet
(G.Selected_Planet
).Factory
)) * (Player
(Planet
(G.Selected_Planet
).Owner
).Factorywaste
/ 100) test% = (PlanetProduction(ACT) * (bar(3) / 100)) * Player(Planet(G.Selected_Planet).Owner).EcoRestore
Oprint 584, 233, "CLEAN", Black, XSMALL
Oprint 584, 233, "WASTE", Black, XSMALL
IF bar
(4) > 0 THEN 'technology alotment _PUTIMAGE (506, 257)-STEP(bar
(4), 7), Layer
(12), Mix&
, (320 + Lok
(5), 194)-STEP((bar
(4) \
2), 3) bar(4) = Planet(G.Selected_Planet).ActualProd * (Planet(G.Selected_Planet).Tech / 100)
Oprint 602, 255, "0", Black, XSMALL
Result%% = FALSE
BuildClickLayer Layer(30), 1
opt%% = Check_Pos(X%, Y%)
Result%% = opt%%
IF opt%%
THEN exitflag%%
= TRUE
GetFrame Sizs(G.Frame), Offs(G.Frame), 2
ShowMenuOptions Check_Pos(X%, Y%)
MainMenu = Result%%
G.Frame = G.Frame + 1
IF G.Frame
>= 48 THEN G.Frame
= 0
G.Frame = G.Frame + 1
IF G.Frame
>= 10 THEN G.Frame
= 0
SUB BuildClickLayer
(LID&
, M_ID%%
) 'resource distribution area
'----bars---
LINE (504, 234)-STEP(51, 8), _RGB32(4, 1, 1), BF
'ecological production LINE (504, 256)-STEP(51, 8), _RGB32(5, 1, 1), BF
'technological production '---arrows---
'-------reduce-------
'------increase------
'-----Lock resource-----
'---ShipYard Area---
LINE (456, 280)-STEP(94, 70), _RGB32(21, 1, 1), BF
'change ship in production(area) LINE (564, 280)-STEP(56, 20), _RGB32(21, 1, 1), BF
'change ship in production(button) LINE (564, 304)-STEP(56, 20), _RGB32(22, 1, 1), BF
'relocate ship button LINE (564, 328)-STEP(56, 20), _RGB32(23, 1, 1), BF
'transport colonist button '----Bottom Area----
LINE (360, 362)-STEP(82, 26), _RGB32(29, 1, 1), BF
'colonized planet information LINE (450, 362)-STEP(58, 26), _RGB32(30, 1, 1), BF
'technology reserch CASE 6 'game option screen CASE 7 'Load\Save Game screen CASE 8 'Ship Design screen CASE 9 'Fleet specs screen
SUB ShowMenuOptions
(opt%%
) IF MFlags
AND 1 THEN _PUTIMAGE (239, 274)-STEP(162, 32), Layer
(4), Mix&
, (0, 0)-STEP(81, 15) ELSE _PUTIMAGE (239, 274)-STEP(162, 32), Layer
(4), Mix&
, (82, 0)-STEP(81, 15) IF MFlags
AND 2 THEN _PUTIMAGE (239, 306)-STEP(162, 32), Layer
(4), Mix&
, (0, 16)-STEP(81, 15) ELSE _PUTIMAGE (239, 306)-STEP(162, 32), Layer
(4), Mix&
, (82, 16)-STEP(81, 15) IF MFlags
AND 4 THEN _PUTIMAGE (239, 338)-STEP(162, 32), Layer
(4), Mix&
, (0, 32)-STEP(81, 15) ELSE _PUTIMAGE (239, 338)-STEP(162, 32), Layer
(4), Mix&
, (82, 32)-STEP(81, 15) IF MFlags
AND 8 THEN _PUTIMAGE (239, 370)-STEP(162, 32), Layer
(4), Mix&
, (0, 48)-STEP(81, 15) ELSE _PUTIMAGE (239, 370)-STEP(162, 32), Layer
(4), Mix&
, (82, 48)-STEP(81, 15)
FOR i%%
= 1 TO 6 'check for manual save games IF _FILEEXISTS(FE$
) THEN MFlags
= MFlags
+ 2: i%%
= 7 ' if any save game exists then exit loop
Result%% = 0
Check_Pos = Result%%
SUB Oprint
(X%
, Y%
, TXT$
, C%%
, TYP%%
) InitFont C%%
xs% = xs% + 6
Lxo% = 4 * (T%% - 40)
IF T%%
= 49 OR T%%
= 73 THEN xs%
= xs%
- 2 IF T%%
= 49 OR T%%
= 73 THEN xs%
= xs%
+ 6 ELSE xs%
= xs%
+ 8 xs% = xs% + 8
Ys% = Ys% + 14
xs% = 0
T%% = T%% - 45
IF T%%
= 4 OR T%%
= 28 THEN xs%
= xs%
- 2 _PUTIMAGE (X%
+ xs%
- XC%%
, Y%
+ Ys%
)-STEP(9, 9), Layer
(29), Mix&
, (0 + 5 * T%%
, 6)-STEP(4, 4) xs% = xs% + 10
IF T%%
= 32 OR T%%
= 42 OR T%%
= 43 OR T%%
= 41 OR T%%
= 39 THEN xs%
= xs%
+ 2 LastLetter%% = TRUE 'if the last letter was upper case
T%% = T%% - 97
IF T%%
= 8 OR T%%
= 11 THEN xs%
= xs%
- 2 'remove excess space infront of `i` and `l` IF T%%
= 12 OR T%%
= 22 THEN xs%
= xs%
+ 2 'add space before `m` and `w` IF LastLetter%%
THEN xs%
= xs%
- 2 'remove extra space after upper case letter _PUTIMAGE (X%
+ xs%
- XC%%
, Y%
+ Ys%
)-STEP(9, 11), Layer
(29), Mix&
, (235 + 5 * T%%
, 6)-STEP(4, 5) xs% = xs% + 8
IF T%%
= 8 OR T%%
= 11 THEN xs%
= xs%
- 2 'remove excess space after of `i` and `l` IF T%%
= 12 OR T%%
= 22 THEN xs%
= xs%
+ 2 'add space after `m` and `w` LastLetter%% = FALSE 'if the last letter was not upper case
xs% = xs% + 10
Lxo% = 7 * 62 + F(0, 62).Xloc
_PUTIMAGE (X%
+ xs%
, Y%
)-STEP(F
(0, 62).Xsiz
* 2, 18), Layer
(29), Mix&
, (Lxo%
, 12)-STEP(F
(0, 62).Xsiz
, 9) xs% = xs% + (F(0, 62).Xsiz * 2)
Lxo% = 7 * 63 + F(0, 63).Xloc
_PUTIMAGE (X%
+ xs%
, Y%
)-STEP(F
(0, 63).Xsiz
* 2, 18), Layer
(29), Mix&
, (Lxo%
, 12)-STEP(F
(0, 63).Xsiz
, 9) xs% = xs% + (F(0, 63).Xsiz * 2)
Lxo% = 7 * (T%% - 48) + F(0, T%% - 48).Xloc
_PUTIMAGE (X%
+ xs%
, Y%
)-STEP(F
(0, T%%
- 48).Xsiz
* 2 + 1, 13), Layer
(29), Mix&
, (Lxo%
, 12)-STEP(F
(0, T%%
- 48).Xsiz
, 6) xs% = xs% + (F(0, T%% - 48).Xsiz * 2)
Lxo% = 7 * (T%% - 65) + F(0, 10 + T%% - 65).Xloc + 70
_PUTIMAGE (X%
+ xs%
, Y%
)-STEP(F
(0, 10 + T%%
- 65).Xsiz
* 2 + 1, 13), Layer
(29), Mix&
, (Lxo%
, 12)-STEP(F
(0, 10 + T%%
- 65).Xsiz
, 6) xs% = xs% + (F(0, 10 + T%% - 65).Xsiz * 2)
Lxo% = 7 * (T%% - 97) + F(0, 36 + T%% - 97).Xloc + 252
_PUTIMAGE (X%
+ xs%
, Y%
)-STEP(F
(0, 36 + T%%
- 97).Xsiz
* 2 + 1, 17), Layer
(29), Mix&
, (Lxo%
, 12)-STEP(F
(0, 36 + T%%
- 97).Xsiz
, 8) xs% = xs% + (F(0, 36 + T%% - 97).Xsiz * 2)
xs% = xs% + 10
Lxo% = F(1, 62).Xoff
_PUTIMAGE (X%
+ xs%
, Y%
)-STEP(F
(1, 62).Xsiz
* 2, 21), Layer
(29), Mix&
, (Lxo%
, 33)-STEP(F
(1, 62).Xsiz
- 1, 10) xs% = xs% + (F(1, 62).Xsiz * 2 - 2)
Lxo% = F(1, 63).Xoff
_PUTIMAGE (X%
+ xs%
, Y%
)-STEP(F
(1, 63).Xsiz
* 2 - 1, 21), Layer
(29), Mix&
, (Lxo%
, 33)-STEP(F
(1, 63).Xsiz
- 1, 10) xs% = xs% + (F(1, 63).Xsiz * 2 - 2)
Lxo% = F(1, T%% - 48).Xoff
_PUTIMAGE (X%
+ xs%
, Y%
)-STEP(F
(1, T%%
- 48).Xsiz
* 2 - 1, 21), Layer
(29), Mix&
, (Lxo%
, 33)-STEP(F
(1, T%%
- 48).Xsiz
- 1, 10) xs% = xs% + (F(1, T%% - 48).Xsiz * 2 - 2)
Lxo% = F(1, 10 + T%% - 65).Xoff
_PUTIMAGE (X%
+ xs%
, Y%
)-STEP(F
(1, 10 + T%%
- 65).Xsiz
* 2 - 1, 21), Layer
(29), Mix&
, (Lxo%
, 33)-STEP(F
(1, 10 + T%%
- 65).Xsiz
- 1, 10) xs% = xs% + (F(1, 10 + T%% - 65).Xsiz * 2 - 2)
Lxo% = F(1, 36 + T%% - 97).Xoff
_PUTIMAGE (X%
+ xs%
, Y%
)-STEP(F
(1, 36 + T%%
- 97).Xsiz
* 2 - 1, 21), Layer
(29), Mix&
, (Lxo%
, 33)-STEP(F
(1, 36 + T%%
- 97).Xsiz
- 1, 10) xs% = xs% + (F(1, 36 + T%% - 97).Xsiz * 2 - 2)
C%% = C%% + 1
xs% = xs% + 10
Lxo% = 7 * 62 + F(0, 62).Xloc
_PUTIMAGE (X%
+ xs%
, Y%
)-STEP(F
(0, 62).Xsiz
* 2, 21), Layer
(29), Mix&
, (Lxo%
, 21)-STEP(F
(0, 62).Xsiz
, 11) xs% = xs% + (F(0, 62).Xsiz * 2)
Lxo% = 7 * 63 + F(0, 63).Xloc
_PUTIMAGE (X%
+ xs%
, Y%
)-STEP(F
(0, 63).Xsiz
* 2, 21), Layer
(29), Mix&
, (Lxo%
, 21)-STEP(F
(0, 63).Xsiz
, 11) xs% = xs% + (F(0, 63).Xsiz * 2)
Lxo% = 7 * (T%% - 48) + F(0, T%% - 48).Xloc
_PUTIMAGE (X%
+ xs%
, Y%
)-STEP(F
(0, T%%
- 48).Xsiz
* 2 + 1, 17), Layer
(29), Mix&
, (Lxo%
, 21)-STEP(F
(0, T%%
- 48).Xsiz
, 8) xs% = xs% + (F(0, T%% - 48).Xsiz * 2)
Lxo% = 7 * (T%% - 65) + F(0, 10 + T%% - 65).Xloc + 70
_PUTIMAGE (X%
+ xs%
, Y%
)-STEP(F
(0, 10 + T%%
- 65).Xsiz
* 2 + 1, 17), Layer
(29), Mix&
, (Lxo%
, 21)-STEP(F
(0, 10 + T%%
- 65).Xsiz
, 8) xs% = xs% + (F(0, 10 + T%% - 65).Xsiz * 2)
Lxo% = 7 * (T%% - 97) + F(0, 36 + T%% - 97).Xloc + 252
_PUTIMAGE (X%
+ xs%
, Y%
)-STEP(F
(0, 36 + T%%
- 97).Xsiz
* 2 + 1, 21), Layer
(29), Mix&
, (Lxo%
, 21)-STEP(F
(0, 36 + T%%
- 97).Xsiz
, 10) xs% = xs% + (F(0, 36 + T%% - 97).Xsiz * 2)
' _CLEARCOLOR _RGB32(0, 0, 0), Layer(9)
' _PUTIMAGE , Layer(9), Mix&
REM'$include:'DeInflator.bi' FileSize
= LEN(text$
): CompSize
= compressBound
(FileSize
) _MEMPUT m
, m.OFFSET
, text$
'set the variable length text into a memblock so it won't move in memory as we access it. Result
= compress2
(_OFFSET(CompBuff
(1)), CompSize
, m.OFFSET
, FileSize
, 9) Deflate$
= MKL$(FileSize
) + Deflate$
text1$
= MID$(text$
, 5): temp$
= SPACE$(FileSize&
) Result
= uncompress
(m.OFFSET
, FileSize&
, m1.OFFSET
, LEN(text1$
)) Inflate$ = temp$
REM '$include:'Play_Intro.bi' DIM Offs
(Elements%
) AS LONG, Sizs
(Elements%
) AS LONG, FadeIns%
(8), FadeOuts%
(8) DATA 0,115,145,215,284,324 DATA 114,144,214,283,323,533
NF%% = 0: NFO%% = 0
'-----------Fade image in--------------
GetFrame Sizs(i%), Offs(i%), 1
LINE (0, 0)-(639, 399), _RGBA32(0, 0, 0, fade%
* 4), BF
NF%% = NF%% + 1
'-----------Fade image out----------------
GetFrame Sizs(i%), Offs(i%), 1
LINE (0, 0)-(639, 399), _RGBA32(0, 0, 0, fade%
* 4), BF
NFO%% = NFO%% + 1
GetFrame Sizs(i%), Offs(i%), 1
REM'$include:'New_Game.bi' Result%% = 4
BuildClickLayer Layer(30), 2
opt%% = Check_Pos(X%, Y%)
Result%% = opt%%
G.Galaxy_Size = G.Galaxy_Size + 1
IF G.Galaxy_Size
= 4 THEN G.Galaxy_Size
= 0 G.Difficulty = G.Difficulty + 1
IF G.Difficulty
= 5 THEN G.Difficulty
= 0 G.Races = G.Races + 1
IF G.Races
= 5 THEN G.Races
= 0 exitflag%% = TRUE
exitflag%% = TRUE
_PUTIMAGE (354, 62)-STEP(111, 26), Layer
(7), Mix&
, (0, 0 + 13 * G.Galaxy_Size
)-STEP(55, 12) 'size _PUTIMAGE (354, 140)-STEP(111, 26), Layer
(7), Mix&
, (55, 0 + 13 * G.Difficulty
)-STEP(55, 12) 'difficulty _PUTIMAGE (354, 218)-STEP(111, 26), Layer
(7), Mix&
, (110, 0 + 13 * G.Races
)-STEP(55, 12) 'races
NewGame = Result%%
Result%% = -1
selection%% = 1
BuildClickLayer Layer(30), 3
opt%% = Check_Pos(X%, Y%)
Result%% = opt%%
exitflag%% = TRUE
opt%% = Check_Pos(X%, Y%)
IF opt%%
THEN selection%%
= opt%%
Oprint 20, 20, "Choose Race", White, NORMAL
'selection hi-lite
LINE (20, 42 + ((selection%%
- 1) * 24))-STEP(110, 21), _RGBA32(255, 255, 255, 56), BF
'display race face
_PUTIMAGE (182, 22)-STEP(79, 69), Layer
(10), Mix&
, (0 + (selection%%
- 1) * 40, 0)-STEP(40, 34) 'display race description
Oprint 162, 100, Rdescript(selection%%), 0, SMALL
Oprint 36, 20 + 24 * i%%, Races(i%%), Black, NORMAL
G.Player_Race = Result%%
Choose_Race = Result%%
Result%% = -1
selection%% = 1
Frame%% = 0
BuildClickLayer Layer(30), 4
opt%% = Check_Pos(X%, Y%)
Result%% = opt%%
exitflag%% = TRUE
opt%% = Check_Pos(X%, Y%)
IF opt%%
THEN selection%%
= opt%%
Oprint 20, 20, "Choose Banner", White, NORMAL
'selection hi-lite
LINE (20, 42 + ((selection%%
- 1) * 24))-STEP(110, 21), _RGBA32(255, 255, 255, 56), BF
'display race face
_PUTIMAGE (182, 22)-STEP(79, 69), Layer
(10), Mix&
, (0 + (G.Player_Race
- 1) * 40, 0)-STEP(40, 34) 'display flag
_PUTIMAGE (182, 108)-STEP(80, 72), Layer
(11), Mix&
, (0 + 40 * G.Frame
, 0 + 36 * (selection%%
- 1))-STEP(39, 35)
Oprint 36, 20 + 24 * i%%, Colrs(i%%), Black, NORMAL
G.Player_Colr = Result%%
Choose_Flag = Result%%
temp$
= Leaders
(G.Player_Race
, INT(RND * 6) + 1) Result%% = opt%%
exitflag%% = TRUE
' IF LEN(temp$) < 13 THEN temp$ = temp$ + CHR$(KBD&)
IF NameLength
(temp$
) < 130 THEN temp$
= temp$
+ CHR$(KBD&
) G.Player_Name = temp$
exitflag%% = TRUE
Oprint 20, 20, "Your Name...", White, NORMAL
'display race face
_PUTIMAGE (182, 22)-STEP(79, 69), Layer
(10), Mix&
, (0 + (G.Player_Race
- 1) * 40, 0)-STEP(40, 34) 'display flag
_PUTIMAGE (182, 108)-STEP(80, 72), Layer
(11), Mix&
, (0 + 40 * G.Frame
, 0 + 36 * (G.Player_Colr
- 1))-STEP(39, 35) 'coursor
_PUTIMAGE (22 + NameLength
(temp$
), 45)-STEP(8, 14), Layer
(4), Mix&
, (42, 87 + G.Frame
* 2)-STEP(4, 7) 'print name
Oprint 22, 45, temp$, Black, NORMAL
temp$ = Planets(G.Player_Race)
Result%% = opt%%
exitflag%% = TRUE
G.Player_Name = temp$
exitflag%% = TRUE
Oprint 20, 20, "Home World...", White, NORMAL
'display race face
_PUTIMAGE (182, 22)-STEP(79, 69), Layer
(10), Mix&
, (0 + (G.Player_Race
- 1) * 40, 0)-STEP(40, 34) 'display flag
_PUTIMAGE (182, 108)-STEP(80, 72), Layer
(11), Mix&
, (0 + 40 * G.Frame
, 0 + 36 * (G.Player_Colr
- 1))-STEP(39, 35) 'coursor
_PUTIMAGE (22 + (LEN(temp$
)) * 10, 45)-STEP(8, 14), Layer
(4), Mix&
, (42, 87 + G.Frame
* 2)-STEP(4, 7) 'print name
Oprint 22, 45, temp$, Black, NORMAL
SUB GetFrame
(SID&
, OID&
, F%%
) Frame$ = Inflate(temp$)
Result~%% = Result~%% + 10
Result~%% = Result~%% + (F(0, 62).Xsiz * 2)
Result~%% = Result~%% + (F(0, 63).Xsiz * 2)
Result~%% = Result~%% + F(0, T%% - 48).Xsiz * 2
Result~%% = Result~%% + F(0, 10 + T%% - 65).Xsiz * 2
Result~%% = Result~%% + F(0, 36 + T%% - 97).Xsiz * 2
NameLength~%% = Result~%%
'ship maintance is 2% of ship production cost(ie: 600bc to build, maintance is 12bc)
Result% = Planet(G.Selected_Planet).CurPop * .51 + Player(Planet(G.Selected_Planet).Owner).Planetology * 2
Result% = Result% + Planet(G.Selected_Planet).Factory
Result% = Result% * (1 + trade)
Result% = Result% * (1 - ships - spys - bases)
Result% = Planet(G.Selected_Planet).CurPop * .51 + Player(Planet(G.Selected_Planet).Owner).Planetology * 2
Result% = Result% + Planet(G.Selected_Planet).Factory
PlanetProduction = Result%
ButtonDown%% = TRUE
'--------lock mouse until button release---------
'------------------------------------------------
'LINE (ox%, oy%)-STEP(1, 1), _RGB(R~%%, G~%%, B~%%), BF '2x font size
ox% = ox% + 2
ox% = 0
oy% = oy% + 2
CASE 15 'yellow gradiant Brown outline
GET #1, , c~%%
'retrieve number of files FOffset&(I~%%) = FOffset&(I~%%) + 1
'load the files where they go here----------
' Layer(2) = LoadGFX(FOffset(1), Size(1)) '_LOADIMAGE("Upper_Card.png", 32) 'upper score card
Layer(3) = LoadGFX(FOffset(1), Size(1)) ' Layer(3) = _LOADIMAGE("SpaceLord.bmp", 32)
Layer(4) = LoadGFX(FOffset(2), Size(2)) ' Layer(4) = _LOADIMAGE("menuchoice.bmp", 32)
Layer(5) = LoadGFX(FOffset(3), Size(3)) ' Layer(5) = _LOADIMAGE("HandPointer.bmp", 32)
Layer(6) = LoadGFX(FOffset(4), Size(4)) ' Layer(6) = _LOADIMAGE("NewGame0.bmp", 32)
Layer(7) = LoadGFX(FOffset(5), Size(5)) ' Layer(7) = _LOADIMAGE("GameOptions.bmp", 32)
Layer(8) = LoadGFX(FOffset(6), Size(6)) ' Layer(8) = _LOADIMAGE("custom0.bmp", 32)
Layer(10) = LoadGFX(FOffset(7), Size(7)) ' Layer(10) = _LOADIMAGE("RaceFaces.bmp", 32)
Layer(11) = LoadGFX(FOffset(8), Size(8)) ' Layer(11) = _LOADIMAGE("Flags.bmp", 32)
Layer(12) = LoadGFX(FOffset(9), Size(9)) ' Layer(12) = _LOADIMAGE("MainView0.bmp", 32)
Layer(13) = LoadGFX(FOffset(10), Size(10)) ' Layer(13) = _LOADIMAGE("Game_Options.bmp", 32)
Layer(14) = LoadGFX(FOffset(11), Size(11)) ' Layer(14) = _LOADIMAGE("Design_Screen.bmp", 32)
Layer(15) = LoadGFX(FOffset(12), Size(12)) ' Layer(15) = _LOADIMAGE("shipsheet.bmp", 32)
Layer(16) = LoadGFX(FOffset(13), Size(13)) ' Layer(16) = _LOADIMAGE("fleetbrb0.bmp", 32)
Layer(17) = LoadGFX(FOffset(14), Size(14)) ' Layer(17) = _LOADIMAGE("viewship0.bmp", 32)
Layer(18) = LoadGFX(FOffset(15), Size(15)) ' Layer(18) = _LOADIMAGE("shipspec.bmp", 32)
Layer(19) = LoadGFX(FOffset(16), Size(16)) ' Layer(19) = _LOADIMAGE("mapview0.bmp", 32)
Layer(20) = LoadGFX(FOffset(17), Size(17)) ' Layer(20) = _LOADIMAGE("sky.bmp", 32)
Layer(28) = LoadGFX(FOffset(18), Size(18)) ' Layer(28) = _LOADIMAGE("FontAdvanced.bmp", 32)
LoadData FOffset(19), Size(19)
LoadData FOffset(20), Size(20)
'-------------------------------------------
FUNCTION LoadFFX&
(Foff&
, Size&
, Fize%%
) LoadFFX&
= _LOADFONT("temp.dat", Fize%%
, "monospace")
SUB LoadData
(Foff&
, Size&
)