home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Elysian Archive
/
AmigaElysianArchive.iso
/
comm
/
stel210.lha
/
stellar_0.prx
< prev
next >
Wrap
Text File
|
1993-06-25
|
69KB
|
2,123 lines
/*Stellar War v2.00 Jan 30, 1993 (c)pending */
/* A lost and forgottened and abandoned game */
/* Full of defects rebuilt with care based on */
/* the original Created by a Unknown author by */
/* the handle of Delta Leader who no longer exists */
/* with a bbs or number, I hope you like this version */
/* and call me for help with future improvements. */
/* Robert Lehman, Maxnet 90:51/0 1-219-289-3275 */
parse arg Uname
RealName = upper(uname)
Handle = upper(uname)
options results
options prompt '?> '
signal on error
signal on syntax
signal on ioerr
signal on BREAK_C
number = -1; msgnumber = 0; flags = 0; collected = 0; plays = 0; jmpflg = 0
file1 = 'Doors:Stellar/config'
file2 = 'Doors:Stellar/user/user'
file3 = 'Doors:Stellar/messages/message'
file4 = 'Doors:Stellar/mailflag'
file5 = 'Doors:Stellar/log'
file6 = 'Doors:Stellar/army/army'
file7 = 'Doors:Stellar/players.dat'
file8 = 'Doors:Stellar/welcome.txt'
file9 = 'Doors:Stellar/exit.txt'
file10 = 'Doors:Stellar/Story'
file11 = 'Doors:Stellar/calldata'
file12 = 'Doors:Stellar/galaxy'
file13 = 'Doors:Stellar/flags/mail_for'
file14 = 'Doors:Stellar/current'
file15 = 'Doors:Stellar/Days/User'
file16 = 'Doors:Stellar/questions'
file17 = 'Doors:Stellar/send/send'
file18 = 'Doors:Stellar/DaysLeft.dat'
file19 = 'Doors:Stellar/Instructions'
flg = 0
ANSPICK:
call open file, (file8),'R'
do until eof(file)
data = readln(file)
say data
end
call close file
say 'Please enter your choice of graphics'
say '1 for color ansi or 0 for b&w'
options prompt 'Enter 1 for ansi enabled)> '
pull result
graphics = upper(result)
if graphics = 1 then do
CLS = 'H'
BLACK = '
'
RED = '
'
GREEN = '
'
YELLOW = '
'
BLUE = '
'
PURPLE = '
'
LBLUE = '
'
WHITE = '
'
flg = 1
end
if graphics = 0 then do
CLS = ''
WHITE = ''
BLACK = ''
YELLOW = ''
GREEN = ''
LBLUE = ''
RED = ''
BLUE = ''
PURPLE = ''
end
wrtms = 0
datz = date("C")
call open file, (file14),'R'
tday = readln(file)
call close file
if tday<datz then do
say YELLOW' Please Hold....'LBLUE'Updating player data structures.'
call open file, (file18),'R'
dleft = readln(file)
call close file
call open file, (file18),'W'
dleft = dleft - (datz-tday)
call writeln file, dleft
call close file
if dleft = 0 then do
count = 0
call open file, (file7),'R'
do until eof(file)
count = count + 1
temp = readln(file)
end
do x = 1 to count
call open file, (file2'-'count'.dat'),'R'
temp = readln(file)
temp = readln(file)
pts = readln(file)
temp = readln(file)
if pts>crtpts then crttop = count
call close file
end
call open file, (file7),'R'
temp = readln(file)
do count = 1 to crttop
champ = readln(file)
end
call close file
call open file, (file7),'W'
data = 'Stellar War v2.0 ReCreated by Robert Lehman, SouthWinds bbs'
call writeln file, data
call close file
call open file, (file11),'W'
call writeln file, 0
call writeln file, 0
call close file
call open file, (file5),'W'
data = ' Stellar War v2.0 Log of Events'
datb = ' -----------------------------------'
datc = ' Last Periods Champion : 'champ
call writeln file, data
call writeln file, datb
call writeln file, datc
call close file
call open file, (file18),'W'
data = 30
call writeln file, data
call close file
end
end
tday=datz
if tday=datz then signal ATMAINTPASS
options prompt 'Press enter to continue.'
pull result
say YELLOW'Please hold....'BLUE'conducting maintenance.'
call open file, (file11),'R'
members = readln(file)
call close file
do count = 1 to members
call open file, (file2'-'count'.dat'),'R'
tpl = readln(file)
call close file
if (tpl<0) then do
count2 = count + 1
do until (count2 = members)
call open file, (file2'-'count2'.dat'),'R'
ta = readln(file)
tb = readln(file)
tc = readln(file)
td = readln(file)
call close file
call open file, (file2'-'count2-1'.dat'),'W'
call writeln file, ta
call writeln file, tb
call writeln file, tc
call writeln file, td
call close file
call open file, (file6'-'count2'.dat'),'R'
ta = readln(file)
tb = readln(file)
tc = readln(file)
td = readln(file)
te = readln(file)
tf = readln(file)
tg = readln(file)
th = readln(file)
call close file
call open file, (file6'-'count2-1'.dat'),'W'
call writeln file, ta
call writeln file, tb
call writeln file, tc
call writeln file, td
call writeln file, te
call writeln file, tf
call writeln file, tg
call writeln file, th
call close file
call open file, (file7),'R'
count4 = 1
ta = readln(file)
do until(eof(file))
nm.count4 = readln(file)
count4 = count4 + 1
end
call close file
call open file, (file7),'W'
data = 'Stellar War v2.00 list of players'
call writeln file, data
do count5 = 1 to count4
if not(count5=count2-1) then call writeln file, nm.count5
end
call close file
call open file, (file11),'R'
ta = readln(file)
tb = readln(file)
call close file
call open file, (file11),'W'
ta = ta - 1
call writeln file, ta
call writeln file, tb
call close file
call open file, (file13'-'count2),'R'
count4 = 1
do until (eof(file))
mlm.count4 = readln(file)
end
call close file
call open file, (file13'-'count2-1),'W'
do count5 = 1 to count4
call writeln file, mlm.count5
end
call close file
call open file, (file15'-'count2),'R'
ta = readln(file)
call close file
call open file, (file15'-'count2-1),'W'
call writeln file, ta
call close file
call open file, (file17'-'count2'.dat'),'R'
ta = readln(file)
tb = readln(file)
tc = readln(file)
td = readln(file)
call close file
call open file, (file17'-'count2-1'.dat'),'W'
call writeln file, ta
call writeln file, tb
call writeln file, tc
call writeln file, td
call close file
call open file, (file5),'A'
tp = count2-1
dnm = nm.tp
data = dnm' was completly slaughtered and has been forced to drop out of the game.'
call writeln file, data
call close file
end
end
ATMAINTPASS:
call open file, (file18),'R'
dleft = readln(file)
call close file
say BLUE'Only 'YELLOW||dleft||BLUE' days before a winner of this round is decided!'
call open file, (file14),'W'
call writeln file, datz
call close file
options prompt GREEN'Do you want to read the story 'WHITE'('RED'y/N'WHITE')? '
pull result
answer = upper(result)
myn = 0
if answer = 'y' | answer = 'Y' then do
call open file, (file10),'R'
do until eof(file)
myn = myn + 1
data = readln(file)
say data
if myn=20 then do
options prompt 'More [Y/N]? '
pull result
answer = upper(result)
if upper(answer)='Y' then myn = 0
if upper(answer)='N' then signal OVERAA
if upper(answer)='' then myn = 0
end
if mny = 20 then signal OVERAA
end
end
OVERAA:
call close file
options prompt GREEN'Do you want to read the instructions 'WHITE'('RED'y/N'WHITE')? '
pull result
answer = upper(result)
mny = 0
if upper(answer)='Y' then do
call open file, (file19),'R'
do until eof(file)
mny = mny + 1
data = readln(file)
say data
if mny=20 then do
options prompt 'More [Y/N]'
pull result
answer = upper(result)
if upper(answer)='Y' then mny = 0
if upper(answer)='' then mny = 0
if upper(answer)='N' then signal OVERAB
end
if mny=20 then signal OVERAB
end
end
OVERAB:
call close file
say ' '
say CLS; say ' '; say ' '; say ' '
say YELLOW'Please wait....'BLUE'conducting maintenance.'
call open file, (file1),'R'
maxuser = readln(file)
maxturn = readln(file)
maxplanet = readln(file)
newreceive = readln(file)
newmoney = readln(file)
newmen = readln(file)
newfighters = readln(file)
newcarriers = readln(file)
newbattleships = readln(file)
newpopulation = readln(file)
call close file
search = RealName
call find
if sflag = 1 then do
number = count
handle = listname
signal CONT
end
say GREEN'You do not currently have an account on Stellar War.'
say YELLOW'Please hold....'
call open file, (file11),'R'
members = readln(file)
msgnumber = readln(file)
call close file
if members = maxuser then do
say RED'I am sorry, but this game is filled right now. Try'
say 'in a few days.'
signal LEAVE
end
ADDING:
say LBLUE'Adding you to the membership role.'
call open file, (file5),'A'
data = handle' joined as a new player.'
call writeln file, data
call close file
messages = 0; points = 0; trades = 0
call open file, (file2'-'members+1'.dat'),'W'
call writeln file, newreceive
call writeln file, messages
call writeln file, points
call writeln file, newmoney
call close file
call open file, (file7),'A'
call writeln file, handle
call close file
say ' '
say LBLUE'Creating your army.'
wins = 0; losses = 0; moral = 3
call open file, (file6'-'members+1'.dat'),'W'
call writeln file, newpopulation
call writeln file, newmen
call writeln file, newfighters
call writeln file, newcarriers
call writeln file, newbattleships
call writeln file, wins
call writeln file, losses
call writeln file, moral
call close file
call open file, (file17'-'members+1'.dat'),'W'
dats = 80
call writeln file, dats
call writeln file, dats
call writeln file, dats
call writeln file, dats
call close file
call open file, (file11),'W'
call writeln file, members+1
call writeln file, msgnumber
call close file
number = members+1
call open file, (file13'-'number),'W'
data = 0
call writeln file, data
call close file
call open file, (file15'-'number),'W'
call writeln file, dat
wrtms = 0
call writeln file, wrtms
call close file
CONT:
call YOUATTRA
call YOUATTRB
call open file, (file15'-'number),'R'
tz = readln(file)
wrtms = readln(file)
call close file
if tz<datz then wrtms = 0
call open file, (file13'-'number),'R'
msg = readln(file)
if msg=0 then do
call close file
say ' '; say ' '
say YELLOW'You have no mail waiting.'
signal CONTWO
end
call close file
call open file, (file13'-'number),'R'
say YELLOW'The following pieces of mail are for you:'
ttlmsg = 0
do until eof(file)
msg = readln(file)
if (msg = '') then signal NOTEQUAL
title = readln(file)
sender = readln(file)
ttlmsg = ttlmsg + 1
say WHITE||ttlmsg') 'RED'#'msg' from 'sender'.'
end
NOTEQUAL:
call close file
call open file, (file13'-'number),'R'
do count = 1 to ttlmsg
msg = readln(file)
if msg = '' then signal STOP
title = readln(file)
sender = readln(file)
options prompt GREEN'Press enter to read #'msg'.'
pull result
say CLS
say WHITE'Message # - 'RED||msg
say WHITE'From - 'RED||sender
say WHITE'About - 'RED||title
call open fil2, (file3'-'msg),'R'
say WHITE
do until eof(fil2)
data = readln(fil2)
say data
end
call close fil2
say ' ';
call open fil2, (file3'-'msg),'W'
call close fil2
end
STOP:
call close file
call open file, (file13'-'number),'W'
data = 0
call writeln file, data
call close file
CONTWO:
options prompt ' ' GREEN'Do you want to read the news letter 'WHITE'('RED'Y/n'WHITE')? '
pull result
answer = upper(result)
if upper(answer) = 'N' then signal SKIPS
say CLS
call open file, (file5),'R'
mny = 0
do until eof(file)
mny = mny + 1
data = readln(file)
say data
if mny=20 then do
options prompt 'More [Y/N]? '
pull result
answer = upper(result)
if upper(answer)='Y' then mny = 0
if upper(answer)='' then mny = 0
end
if mny=20 then signal OVERAC
end
OVERAC:
call close file
say ' '; say ' '
options prompt BLUE'Press enter to continue.'
pull result
SKIPS:
call YOUATTRA
call YOUATTRB
call open file, (file11),'R'
members = readln(file)
msgnumber = readln(file)
call close file
call STATS
signal MAINMENU
STATS:
say CLS
say LBLUE' <<<<<'YELLOW' Personal Statistics 'LBLUE'>>>>>'
say ' '
say RED'Name : 'WHITE||handle
say RED'Account # : 'WHITE||number
say RED'Messages : 'WHITE||messages
say RED'Money : 'WHITE||money
say RED'Points : 'WHITE||points
say RED'Population : 'WHITE||population
say ' '
say LBLUE' <<<<<'YELLOW' Army Statistical Summary'LBLUE' >>>>>'
say ' '
say RED'Men : 'WHITE||men
say RED'Fighters : 'WHITE||fighters
say RED'Carriers : 'WHITE||carriers
say RED'BattleShips : 'WHITE||battleships
say RED'Planets : 'WHITE||planets
say RED'Wins : 'WHITE||wins
say RED'Losses : 'WHITE||losses
winlos = wins + losses
if winlos>0 then percentage = wins/winlos
if winlos=0 then percentage = 1
percentage = percentage*100
say RED'Percentage : 'WHITE||percentage'%'
call MORALFIG
if moral = 1 then say RED'Moral of Men : 'WHITE'Exceptional'
if moral = 2 then say RED'Moral of Men : 'WHITE'Confident'
if moral = 3 then say RED'Moral of Men : 'WHITE'Unsure'
if moral = 4 then say RED'Moral of Men : 'WHITE'Frightened'
if moral = 5 then say RED'Moral of Men : 'WHITE'Unstable'
say ' '
options prompt BLUE'Press enter to continue.'
pull result
return
MAINMENU:
say CLS
say LBLUE' <<<'YELLOW' Options'LBLUE' >>>'
say ' '
say YELLOW'[S] 'GREEN'Show your statistical summary'
say YELLOW'[M] 'GREEN'Send a message'
say YELLOW'[D] 'GREEN'Draft Men (Only used in extreme crisis)'
say YELLOW'[T] 'GREEN'Trade with another player'
say YELLOW'[R] 'GREEN'Request a trade with another player'
say YELLOW'[B] 'GREEN'Buy and sell equipment'
say YELLOW'[C] 'GREEN'Collect taxes from population'
say YELLOW'[W] 'GREEN'War and Spy menus'
say YELLOW'[P] 'GREEN'Set up your defense tactics'
say ' '
say PURPLE'[I] 'GREEN'Display game instructions'
say PURPLE'[H] 'GREEN'Read the story of the program.'
say PURPLE'[Q] 'GREEN'Quit this game - return to BBS'
say ' '; say ' '; say ' '
options prompt YELLOW'Enter your choice>> 'WHITE
pull result
answer = upper(result)
if answer = '' then signal MAINMENU
cm = upper(answer)
if cm='S' then call STATS
if cm='M' then signal MESSAGE
if cm='D' then signal DRAFT
if cm='H' then signal HELP
if cm='T' then signal TRADE
if cm='R' then signal REQUEST
if cm='E' then signal ENDDIE
if cm='B' then signal MARKET
if cm='Q' then signal LEAVE
if cm='W' then signal WAR
if cm='C' then call TAXCOLLECT
if cm='P' then signal TACTICS
if cm='I' then call REALINSTRUCT
signal MAINMENU
REALINSTRUCT:
say CLS
call open file, (file19),'R'
mny = 0
do until eof(file)
mny = mny + 1
data = readln(file)
say data
if mny = 20 then do
options prompt 'More [Y/N]? '
pull result
answer = upper(result)
if upper(answer)='Y' then mny = 0
end
if mny=20 then signal OVERAD
end
OVERAD:
call close file
say ' '
options prompt BLUE'Press enter to continue.'
pull result
return
MESSAGE:
say CLS
say ' '
say ' '
say YELLOW' Message Menu'
say ' '; say ' '; say ' ';
say WHITE'[1] 'RED'Send a message'
say WHITE'[2] 'RED'List current members'
say WHITE'[3] 'RED'Quit to main menu'
say ' '; say ' '
options prompt YELLOW'Enter your choice>> 'WHITE
pull result
answer = upper(result)
if answer = '' then signal MESSAGE
if answer = '3' then signal MAINMENU
if answer = '1' then signal ENTER
if answer = '2' then call LISTER
signal MESSAGE
ENTER:
say CLS
options prompt GREEN'Address to> 'WHITE
pull result
address = upper(result)
if address = '' then signal MESSAGE
search = address
call FIND
call SELFCHECK
if flag = 1 then signal ENTER
if sflag = 0 then do
say YELLOW'Sorry, but this user does not currently exist.'
options prompt BLUE'Press enter to continue.'
pull result
signal MESSAGE
end
options prompt GREEN'Title > 'WHITE
pull result
title = upper(result)
if title = '' then title = 'None Given'
say ' '
line = 1
say ' '; say ' '
call open file, (file3'-'msgnumber),'W'
say WHITE'You must do your own word wrapping. Sorry for the inconvenience.'
say WHITE'Enter up to'PURPLE' 75 'WHITE'lines of text. Enter a S to save text. '
say WHITE'Enter an A to Abort your message and return to the main options menu.'
say LBLUE' [----:----:----:----:----:----]'
indent = 1
LINES:
options prompt '?> '
if indent = 0 then say PURPLE||line'>'WHITE;pull result
if indent = 1 then say PURPLE||line'>'WHITE;pull result
text = result
if text = 'S' | text = 's' then signal SAVE
if text = 'A' | text = 'a' then do
call close file
signal MAINMENU
end
call writeln file, text
if line = 9 then indent = 0
if line=75 then do
say ' '
say YELLOW'Out of space. Message being saved.....'
call close file
say ' '
say ' '
options prompt BLUE'Press enter to continue.'
pull result
call NOTIFY
signal MESSAGE
end
line = line + 1
signal LINES
SAVE:
call close file
say ' '
say YELLOW'Saving file.....'
call NOTIFY
signal MESSAGE
DRAFT:
if drft = 1 then signal MAINMENU
if percentage>15 then do
say WHITE'You are not in a time of 'GREEN'total crisis'WHITE'. You cannot draft'
say 'troops yet.'
say ' '; say ' '
options prompt BLUE'Press enter to continue.'
pull result
signal MAINMENU
end
if moral<5 then do
say WHITE'Your 'GREEN'army moral'WHITE' is suitable enough that there is no need to'
say 'draft any more right now.'
say ' '; say ' '
options prompt BLUE'Press enter to continue.'
pull result
signal MAINMENU
end
totaldraft = population/100
totaldraft = totaldraft*15
POPULATION:
say CLS; say ' '; say ' '; say ' '
say WHITE'Out of 'GREEN||population||WHITE', only 'GREEN||totaldraft||WHITE' are in the condition'
say 'to be drafted.'
say ' '
say ' '
options prompt YELLOW'How many men do you want to draft 'WHITE'('RED'Max of 'totaldraft||WHITE')? '
pull result
answer = upper(result)
if answer = '' then signal POPULATION
if answer>totaldraft then do
say RED'You do not have those kind of resources...'YELLOW'try again.'
do count=1 to 50; end
signal POPULATION
end
say ' '; say ' '
say WHITE'You have drafted 'GREEN||answer||WHITE' men.'
say ' '
population = population - answer
men = men + answer
do count = 1 to 50; end
drft = 1
moral = moral - 1
signal MAINMENU
HELP:
mny = 0
say CLS
call open file, (file10),'R'
do until eof(file)
mny = mny + 1
data = readln(file)
say data
if mny = 20 then do
options prompt 'More [Y/N]? '
pull result
answer = upper(result)
if upper(answer) = 'Y' then mny = 0
end
if mny = 20 then signal OVERAE
end
OVERAE:
call close file
signal MAINMENU
TRADE:
say CLS
say ' '; say ' '; say ' '
options prompt GREEN'Who do you want to trade with 'WHITE'('RED'Q=Quit, L=List'WHITE')? '
pull result
aname = upper(result)
if aname = '' then signal TRADE
search = aname
call SELFCHECK
if flag = 1 then signal TRADE
if upper(aname)='Q' then signal MAINMENU
if upper(aname)='L' then do
call lister
signal TRADE
end
search = aname
call FIND
if sflag = 1 then signal FOUND
if flag = 0 then do
say LBLUE'Sorry, this user is not a member as of right now.'
say ' '
options prompt BLUE'Press enter to continue.'
pull result
end
signal TRADE
FOUND:
call close file
call ATTRIBUTEA
call ATTRIBUTEB
say PURPLE'Ok, member has been located. Continue....'
DISTRD:
say ' '; say ' '; say CLS
say YELLOW' Main Trade Menu'
say ' '
say WHITE'[1] 'RED'Men'
say WHITE'[2] 'RED'Fighters'
say WHITE'[3] 'RED'Carriers'
say WHITE'[4] 'RED'Battle Ships'
say WHITE'[5] 'RED'Planets'
say WHITE'[6] 'RED'General Population'
say WHITE'[7] 'RED'Money'
say ' '; say ' '; say ' '
options prompt GREEN'Enter what you want to trade away 'WHITE'('RED'Q=Quit'WHITE')>> '
pull result
answer = upper(result)
if answer = '' then signal DISTRD
if upper(answer)='Q' then signal MAINMENU
if answer>7 then signal DISTRD
if answer<1 then signal DISTRD
say ' '; say ' '
if answer = 1 then do
tradeitem = 'Men'
max = men
end
if answer = 2 then do
tradeitem = 'Fighters'
max = fighters
end
if answer = 3 then do
tradeitem = 'Carriers'
max = carriers
end
if answer = 4 then do
tradeitem = 'Battle ships'
max = battleships
end
if answer = 5 then do
tradeitem = 'Planets'
max = planets
end
if answer = 6 then do
tradeitem = 'People'
max = population
end
if answer = 7 then do
tradeitem = 'Dollars'
max = money
end
GETTRADE:
options prompt GREEN||tradeitem' to trade 'WHITE'('RED'Max of 'max||WHITE') ? '
pull result
trade = upper(result)
if trade = '' then signal
if trade > max then do DISTRD
say WHITE'You do not have that many'GREEN||tradeitem'!'
signal GETTRADE
end
call ATTRIBUTEA
if answer = 1 then do
bmen = bmen + trade
men = men - trade
end
if answer = 2 then do
bfit = bfit + trade
fighters = fighters - trade
end
if answer = 3 then do
bcar = bcar + trade
carriers = carriers - trade
end
if answer = 4 then do
bbat = bbat + trade
battleships = battleships - trade
end
if answer = 5 then do
call ATTRIBUTEB
bpln = bpln + trade
planets = planets - trade
call WRTATTRB
end
if answer = 6 then do
bpop = bpop + trade
population = population - trade
end
if answer = 7 then do
call ATTRIBUTEB
bmny = bmny + trade
money = money - trade
call WRTATTRB
end
call WRTATTRA
call WRTATTRB
flags = 1
tradenumber = trade
datac= handle' has made a trade of 'tradenumber||tradeitem' to you.'
datad= ' '
REQUEST:
if flags= 1 then signal OVERPASS
flags = 0
say ' '
say ' '
say ' '; say ' '; say ' '
say CLS
options prompt GREEN 'Who do you want to trade with 'WHITE'('RED'L=List, Q=Quit'WHITE')? '
pull result
aname = upper(result)
if aname = '' then signal REQUEST
search = aname
call SELFCHECK
if flag= 1 then signal REQUEST
if upper(aname)='Q' then signal MAINMENU
if upper(aname)='L' then do
call lister
signal request
end
search = aname
call FIND
if sflag = 1 then do
aname = check
call ATTRIBUTEA
call ATTRIBUTEB
signal FOUNDB
end
say LBLUE'Sorry, this user is not currently on the membership role.'
say ' '; say ' '; say ' '
options prompt BLUE'Press enter to continue.'
pull result
signal REQUEST
FOUNDB:
call close file
say PURPLE'Ok, user has been located. Continue...'
jmpflg = 0
OVERPASS:
say CLS
say YELLOW' Trade Request Menu'
say ' '; say ' '
say WHITE'[1] 'RED'Men'
say WHITE'[2] 'RED'Fighters'
say WHITE'[3] 'RED'Carriers'
say WHITE'[4] 'RED'Battle ships'
say WHITE'[5] 'RED'Planets'
say WHITE'[6] 'RED'General Population'
say WHITE'[7] 'RED'Money'
say ' '; say ' '; say ' '
options prompt GREEN'What do you request for a trade 'WHITE'('RED'Q=Quit'WHITE')? '
pull result
answer = upper(result)
if answer = '' then signal OVERPASS
if upper(answer) = 'Q' then do
if flags=1 then do
datae = handle' has not requested anything for the trade'
dataf = 'as of yet.'
signal TRADEMSGS
end
if flags=0 then do
signal WHT
end
end
FIGS:
if answer > 7 then signal OVERPASS
if answer < 1 then signal OVERPASS
if answer=1 then data = 'men'
if answer=2 then data = 'fighters'
if answer=3 then data = 'carriers'
if answer=4 then data = 'battle ships'
if answer=5 then data = 'planets'
if answer=6 then data = 'general population'
if answer=7 then data = 'dollars'
if (jmflg = 1) then do
if answer = 2 then data = 'carriers'
if answer = 3 then data = 'battle ships'
if answer = 4 then data = 'planets'
if answer = 5 then data = 'general population'
if answer = 6 then data = 'dollars'
end
say ' '
if jmflg = 1 then signal JMA
options prompt GREEN'How many would you like to request? '
pull result
answer = upper(result)
if answer = '' then signal OVERPASS
datb = answer
datae = handle' would like to request 'datb||data' from you. Please respond to his'
dataf = 'request whether you will trade with him or not. '
if flags = 1 then signal TRADEMSGS
WHT:
say ' '; say CLS
say YELLOW' Trade Return Menu'
say ' '; say ' '; say ' ';
say WHITE'[1] 'RED'Men'
say WHITE'[2] 'RED'Carriers'
say WHITE'[3] 'RED'Battle Ships'
say WHITE'[4] 'RED'Planets'
say WHITE'[5] 'RED'General Population'
say WHITE'[6] 'RED'Money'
say ' '; say ' '
options prompt GREEN'What will you give in return 'WHITE'('RED'Q=Quit'WHITE')? '
pull result
answer = upper(result)
jmflg = 1
if answer = '' then signal WHT
call FIGS
JMA:
jmpflg = 0
datah = data
say ' '
options prompt GREEN'How many will you give? '
pull result
number = upper(result)
if number = '' then signal JMA
if upper(number) = 'Q' then do
datag = handle' has not promised anything in return however.'
signal TRADEMSGS
end
say ' '
datag = 'In return 'handle' will give you 'number||datah'.'
TRADEMSGS:
call open file, (file3'-'msgnumber),'W'
if flags = 1 then do
call writeln file, datac
call writeln file, datad
end
call writeln file, datae
call writeln file, dataf
call writeln file, datag
TRADENOTIFY:
aname = listname
say ' '; say ' '
say YELLOW||aname||RED'will be notified the next time they enter the game.'
say ' '; say ' '
options prompt BLUE'Press enter to continue.'
pull result
call close file
title = 'Trade Information'
call WRTATTRA
call WRTATTRB
call YOUUPDTA
call YOUUPDTB
realhandle = handle
handle = 'Stellar War Trading Post'
call NOTIFY
handle = realhandle
flags = 0
signal MAINMENU
ENDDIE:
signal MAINMENU
MARKET:
say CLS
say YELLOW' Stellar War Market'
say ' '; say ' '; say ' '; say ' '; say ' '
say WHITE'[1] 'RED'Buy supplies for your army'
say WHITE'[2] 'RED'Sell supplies of your army'
say ' '; say ' '; say ' '; say ' '
options prompt GREEN'Enter your choice 'WHITE'('RED'Q=Quit'WHITE')? '
pull result
answer = upper(result)
if answer = '1' then signal BUY
if answer = '2' then signal SELL
if upper(answer) = 'Q' then signal MAINMENU
signal MARKET
BUY:
say CLS
say YELLOW' Supply Menu'
say ' '; say ' '; say ' '
say RED'Num.'WHITE'| 'YELLOW' Description'WHITE' |'PURPLE' Cost 'WHITE' | 'GREEN'Current'
say WHITE'----+------------------+--------------+-----------'
say RED' 1 'WHITE'| 'YELLOW' Soldiers 'WHITE' |'PURPLE' 1000 'WHITE' | 'GREEN||men
say RED' 2 'WHITE'| 'YELLOW' Fighters 'WHITE' |'PURPLE' 10000 'WHITE' | 'GREEN||fighters
say RED' 3 'WHITE'| 'YELLOW' Carriers 'WHITE' |'PURPLE' 14000 'WHITE' | 'GREEN||carriers
say RED' 4 'WHITE'| 'YELLOW' Battle Ships'WHITE' |'PURPLE' 17000 'WHITE' | 'GREEN||battleships
say RED' 5 'WHITE'| 'YELLOW' Planets 'WHITE' |'PURPLE' 40000 'WHITE' | 'GREEN||planets
say WHITE'--------------------------------------------------'
say ' '; say ' '
say PURPLE'You currently have 'WHITE||money||PURPLE' dollars.'
say ' '
options prompt GREEN'Enter item to purchase 'WHITE'('RED'Q=Quit'WHITE') >> '
pull result
answer = upper(result)
if answer = '' then signal BUY
if upper(answer)='Q' then signal MARKET
if answer<1 then signal BUY
if answer>5 then signal BUY
if answer = 1 then cost = 1000
if answer = 2 then cost = 10000
if answer = 3 then cost = 14000
if answer = 4 then cost = 17000
if answer = 5 then cost = 40000
call FIGITEM
call TRUNCMAX
HOWMANY:
say ' '
options prompt GREEN'How many 'item' do you want 'WHITE'('RED'Max of 'max||WHITE')? '
pull result
answer = upper(result)
if answer = '' then signal BUY
if answer>max then do
say RED'You do not have that kind of money!'
signal HOWMANY
end
if (answer<0) then do
say GREEN'We do not sell 'WHITE'NEGATIVE'GREEN||item'!'
signal HOWMANY
end
money = money - (answer*cost)
if item = 'men' then men=men+answer
if item = 'fighters' then fighters = fighters + answer
if item = 'carriers' then carriers = carriers + answer
if item = 'battleships' then battleships = battleships + answer
if item = 'planets' then planets = planets + answer
signal BUY
FIGITEM:
if answer = 1 then item = 'men'
if answer = 2 then item = 'fighters'
if answer = 3 then item = 'carriers'
if answer = 4 then item = 'battleships'
if answer = 5 then item = 'planets'
RETURN
TRUNCMAX:
temp = (money/cost)
max = trunc(temp)
RETURN
SELL:
say CLS
say YELLOW' Stellar War Selling Market'
say ' '; say ' '; say ' '
say RED'Num.'WHITE'|'YELLOW' Description 'WHITE' | 'GREEN'Re-Sale Price 'WHITE'| 'PURPLE'Current'
say WHITE'----+---------------------------+-------------------+---------'
say RED' 1 'WHITE'|'YELLOW' Soldiers 'WHITE' | 'GREEN' 750 'WHITE'| 'PURPLE||men
say RED' 2 'WHITE'|'YELLOW' Fighters 'WHITE' | 'GREEN' 6500 'WHITE'| 'PURPLE||fighters
say RED' 3 'WHITE'|'YELLOW' Carriers 'WHITE' | 'GREEN' 9000 'WHITE'| 'PURPLE||carriers
say RED' 4 'WHITE'|'YELLOW' Battle Ships 'WHITE' | 'GREEN' 11050 'WHITE'| 'PURPLE||battleships
say RED' 5 'WHITE'|'YELLOW' Planets 'WHITE' | 'GREEN' 28000 'WHITE'| 'PURPLE||planets
say WHITE'----+---------------------------+-------------------+---------'
say ' '; say ' ';
say PURPLE'You currently have 'YELLOW||money||PURPLE' dollars. '
say ' '
options prompt GREEN'What do you want to sell 'WHITE'('RED'Q=Quit'WHITE')? '
pull result
answer = upper(result)
if upper(answer)='Q' then signal MARKET
if answer='' then signal SELL
if answer = 1 then max = men - (fighters + carriers + battleships)
if answer = 2 then max = fighters
if answer = 3 then max = carriers
if answer = 4 then max = battleships
if answer = 5 then max = (planets - 1)
if answer>5 then signal SELL
if answer<1 then signal SELL
RESK:
say ' '
if max<1 then do
say GREEN'Sorry, but you have none to sell.'
hotkey BLUE'Press enter to continue.'
signal SELL
end
options prompt GREEN'How many do you want to sell 'WHITE'('RED'Max of 'max||WHITE')? '
pull result
amount = upper(result)
if amount>max then do
say RED'You do not have that many!'
signal RESK
end
if amount=0 then signal SELL
if amount<0 then signal SELL
if answer = 1 then do
men = men - amount
money = money + amount*750
say LBLUE'You have received 'YELLOW||amount*750||LBLUE' dollars for your sale.'
end
if answer = 2 then do
fighters = fighters - amount
money = money + amount*6500
say LBLUE'You have received 'YELLOW||amount*6500||LBLUE' dollars for your sale.'
end
if answer = 3 then do
carriers = carriers - amount
money = money + amount*9000
say LBLUE'You have received 'YELLOW||amount*9000||LBLUE' dollars for your sale.'
end
if answer = 4 then do
battleships = battleships - amount
money = money + amount*11050
say LBLUE'You have received 'YELLOW||amount*11050||LBLUE' dollars for your sale.'
end
if answer = 5 then do
planets = planets - amount
money = money + amount*28000
say LBLUE'You have received 'YELLOW||amount*28000||LBLUE' dollars for your sale.'
end
say ' '; say ' '
options prompt BLUE'Press enter to continue.'
pull result
signal SELL
WAR:
say CLS
say YELLOW' Main War Menu'
say ' '; say ' '
say ' '; say ' '; say ' '; say ' '
say WHITE'[1] 'RED'Engage in war'
say WHITE'[2] 'RED'Spy on other players'
say WHITE'[3] 'RED'List of other players'
say WHITE'[4] 'RED'Quit to main menu'
say ' '; say ' '; say ' '
options prompt GREEN'Enter your choice>> 'WHITE
pull result
answer = upper(result)
if answer = '' then signal WAR
if answer = '1' then signal WARMENU
if answer = '2' then signal SPYMENU
if answer = '3' then do
call open file, (file7),'R'
do until eof(file)
listname = readln(file)
say listname
end
call close file
options prompt BLUE'Press enter to continue.'
pull result
end
if answer = '4' then signal MAINMENU
signal WAR
WARMENU:
if wrtms = 8 then do
say RED' You have already engaged in too many battles today. Your'
say ' troops grow weary.'
options prompt BLUE'Press enter to continue.'
pull result
signal WAR
end
if planets<1 then do
say RED' You do not have enough planets to engage in war. You are not'
say 'permitted to engage in war until you have at least 1 planet.'
options prompt BLUE'Press enter to continue.'
pull result
signal WAR
end
say ' '; say ' '; say ' '
say CLS
options prompt GREEN'Who do you want to engage in war with 'WHITE'('RED'L=List, Q=Quit'WHITE')? '
pull result
enemy = upper(result)
if enemy = '' then signal WARMENU
if upper(enemy)='Q' then signal WAR
if upper(enemy)='L' then do
call LISTER
signal WARMENU
end
search = enemy
call SELFCHECK
if flag = 1 then signal WARMENU
call FIND
if sflag = 1 then signal AIGHT
say ' '; say ' '
say LBLUE' Sorry, this user has not been found.'
say ' '
options prompt BLUE'Press enter to continue.'
pull result
signal WAR
AIGHT:
wrtms = wrtms + 1
enemy = listname
call ATTRIBUTEA
call ATTRIBUTEB
if bpln = 0 then do
say RED'Sorry, this user is in protection due to his vulnerability. This will'
say RED'change soon, so keep trying!'
signal WARMENU
end
say CLS
options prompt GREEN'Send how many men 'WHITE'('RED'Max of 'men||WHITE')? '
pull result
smen = upper(result)
if smen = '' then smen = men
if smen>men then do
say ' '
say RED' Sorry, you do not have that many men.'
say ' '; say ' '
options prompt BLUE'Press enter to continue.'
pull result
signal AIGHT
end
SFIGHT:
say YELLOW||smen' men are now prepared to fight.'
say ' '
options prompt GREEN'Send how many fighters 'WHITE'('RED'Max of 'fighters||WHITE')? '
pull result
sfighters = upper(result)
if sfighters = '' then sfighters = fighters
if sfighters>fighters then do
say ' '
say RED' Sorry, you do not have that many fighters.'
say ' '
options prompt BLUE'Press enter to continue.'
pull result
signal SFIGHT
end
SCARR:
say YELLOW||sfighters' fighters are now prepared to fight.'
say ' '
say WHITE' Each carrier can hold 150 men. '
options prompt GREEN'Send how many carriers (Max of 'carriers')? '
pull result
scarrier = upper(result)
if scarrier = '' then scarrier = carriers
if scarrier>carriers then do
say ' '
say RED' Sorry, you do not have that many carriers.'
say ' '
options prompt BLUE'Press enter to continue.'
pull result
signal SCARR
end
SBATT:
say YELLOW||scarrier' carriers are now prepared to fight.'
mostmen = scarrier*150
if mostmen<smen then do
smen = mostmen
say RED' Since you have only sent 'scarrier' carriers'
say' you can only hold'
say' a total of 'smen' men.'
end
atotal = 0; btotal = 0
if moral = 1 then amoral=5
if moral = 2 then amoral=4
if moral = 3 then amoral=3
if moral = 4 then amoral=2
if moral = 5 then amoral=1
if bmor = 1 then bmoral=5
if bmor = 2 then bmoral=4
if bmor = 3 then bmoral=3
if bmor = 4 then bmoral=2
if bmor = 5 then bmoral=1
btotal = btotal + bmoral*500
atotal = atotal + amoral*500
say ' '
options prompt GREEN'Send how many battle ships 'WHITE'('RED'Max of 'battleships||WHITE')? '
pull result
sbattle = upper(result)
if sbattle = '' then sbattle = battleships
if sbattle>battleships then do
say ' '
say RED' Sorry, you do not have that many battle ships.'
say ' '
options prompt BLUE'Press enter to continue.'
pull result
signal SBATT
end
say YELLOW||sbattle' battle ships are now prepared to fight.'
do t=1 to 500; end
say CLS
say LBLUE' You are off to battle....'
atotal = atotal + smen*10
say GREEN'Your generals have given the order for your men to charge....'
say GREEN' They are now storming the enemy headquarters...'
do x=1 to 500; end
call open file, (file17'-'count'.dat'),'R'
sendmen = readln(file)
sendfit = readln(file)
sendbat = readln(file)
sendcar = readln(file)
call close file
bbmen = bmen*(sendmen/100); bbmen = trunc(bbmen)
bbcara = (sendcar/100)
bbcar = bcar * bbcara
bbcar = trunc(bbcar)
/* bbmen = bmen*(sendmen/100); bbmen = trunc(bbmen) */
/* bbcar = bcar*(sendcar/100); bbcar = trunc(bbcar) */
/* if bbmen>(bbcar*150) then bbmen = bbcar*150 */
if bmen > (bbcar*150) then bbmen = (bbcar*150)
bbfit = bfit*(sendfit/100); bbfit = trunc(bbfit)
bbbat = bbat*(sendbat/100); bbbat = trunc(bbbat)
CALCPASS:
btotal = btotal + bbmen
if (bbmen>(smen*10)) then say RED'The enemy manages to suppress their attempts. The men are retreating.'
if (bbmen<(smen*10)) then say YELLOW'You have overcome the enemies troops.'
if (bbmen=(smen*10)) then say LBLUE'Neither side has broken. This fighting is not working at all.'
do x=1 to 500; end
atotal = atotal + sfighters*75
dbbfit = random(bbfit,bfit,time('s'))*75
say ' '
say GREEN'Your fighters have now entered the battle and are blasting away at'
say ' the enemy fortresses....'
do x=1 to 500; end
btotal = btotal + dbbfit
if (dbbfit>(sfighters*75)) then say RED'The enemies fighters suppress your attack.'
if (dbbfit<(sfighters*75)) then say YELLOW'Your fighters have destroyed a large portion of the enemies territory.'
if (dbbfit=(sfighters*75)) then say LBLUE'Niether side has broken. This fighting is not working at all.'
do x=1 to 500; end
atotal = atotal + sbattle*300
say ' '
say GREEN'Your battleships have now engaged in firing on the enemy. The heavy'
say ' has begun to wear down the enemy, but now his battleships enter the'
say ' battle as well.'
atotal = atotal + random(1,30,time('s'))*100
cbbat1 = random(bbbat,bbat,time('s'))
cbbat = cbbat1 * 300
/* was cbbat = (bbbat,bbat,time('s')) *300 */
btotal = btotal + cbbat
do x=1 to 500; end
temp = sbattle*300
if (cbbat<temp) then say RED'The enemies battleships are now retreating back to their base.'
if (cbbat>temp) then say YELLOW'The enemies battleships have driven your fleet back.'
if (cbbat=temp) then say LBLUE'Neither side has broken. This fighting is not working at all.'
atotal = atotal + planets*25
btotal = btotal + random(1,30,time('s'))*100
btotal = btotal + bpln*25
if atotal>btotal then do
overall = atotal-btotal
wins = wins + 1
blos = blos + 1
points = atotal - btotal
favor = 1
end
if atotal<btotal then do
overall = btotal-atotal
bwin = bwin + 1
losses = losses + 1
bpts = btotal - atotal
favor = 2
end
if atotal=btotal then do
overall = 1
favor = random(1,2,time('s'))
end
say ' '; say ' '
say YELLOW' NEWS FLASH!!!!'
say GREEN' =============='
if overall<2000 then do
say ' '; say ' '
say LBLUE'The battle raged on for months with virutally nothing lost or gained on'
say 'either side. The soldiers began to flee. For a long time it appeared that'
say 'neither side would win the battle. 'handle' set out with all the men he'
say 'gather and rushed 'enemy' and his forces. This became the most critical '
say 'period of the war. '
if favor=1 then say handle
if favor=2 then say enemy
say 'ended up making a critical error. That error was simply underestimating'
say 'the forces of '
if favor=1 then say enemy'.'
if favor=2 then say handle'.'
say ' As the war finally came to an end, both sides suffered tremendous loss of'
say 'men, but in the end there was only one victor. That victor was none other'
say' than... '
if favor=1 then say handle'.'
if favor=2 then say enemy'.'
say ' '; say ' '
options prompt BLUE'Press enter to continue.'
pull result
losspercentl = 0.25; losspercentw = 0.4;
signal LOSSES
end
if overall<5000 then do
say LBLUE' The battle, all though at first very close, soon shifted in the favor of'
if favor = 1 then say handle'.'
if favor = 2 then say enemy'.'
say 'Although this was not a battle of total domination, it was a'
say ' significant victory for '
if favor = 1 then say handle'.'
if favor = 2 then say enemy'.'
say ' The losses were not very heavy for'
say 'either side since this was such a short battle. '
losspercentl = 0.15; losspercentw = 0.12;
signal LOSSES
end
if overall<9000 then do
say LBUE'This battle will be known as one of the shorter ones in this galaxy. It'
say 'was not one of the easiest however. Both sides suffered, but even that was'
say 'not very significant. In the end it became a very easy victory for '
if favor = 1 then say handle'.'
if favor = 2 then say enemy'.'
losspercentl = 0.10; losspercentw = 0.02
signal LOSSES
end
if overall>8999 then do
say LBLUE'A battle such as this can only be described as one thing. Total Domination.'
if favor = 1 then say handle
if favor = 2 then say enemy
say 'virtually crushed the weak forces of '
if favor = 1 then say enemy'.'
if favor = 2 then say handle'.'
say 'The losses were very insignificant because of the speed in which it was'
say 'over.'
losspercentl = 0.07; losspercentw = 0.02
signal LOSSES
end
LOSSES:
if favor=2 then do
lamen = smen*losspercentl; lafit = sfighters*losspercentl; labat = sbattle*losspercentl; lapln = planets*losspercentl; lacar = carriers*losspercentl
lamen = trunc(lamen); lafit = trunc(lafit); labat = trunc(labat); lapln = trunc(lapln); lacar = trunc(lacar)
lbmen = lamen*losspercentw; lbfit = lafit*losspercentw; lbbat = labat*losspercentw; lbpln = lapln*losspercentw;lbcar = lacar*losspercentw;
lbmen = trunc(lbmen); lbfit = trunc(lbfit); lbbat = trunc(lbbat); lbpln = trunc(lbpln); lbcar = trunc(lbcar)
if (lbmen<0) then lbmen=random(1,10,time('s')); if (lbfit<0) then lbfit=random(1,2,time('s')); if (lbbat<0) then lbbat=random(1,3,time('s'))
if (lbpln<0) then lbpln=random(0,1,time('s')); if (lbcar<0) then lbcar=random(0,3,time('s'))
end
if favor=1 then do
lbmen = bbmen*losspercentl
lbfit = bbfit*losspercentl
lbbat = bbbat*losspercentl
lbpln = bpln*losspercentl
lbcar = bbcar*losspercentl
lbmen = trunc(lbmen)
lbfit = trunc(lbfit)
lbbat = trunc(lbbat)
lbpln = trunc(lbpln)
lbcar = trunc(lbcar) /* was l = trunc(l) */
lamen = lbmen*losspercentw
lafit = lbfit*losspercentw
labat = lbbat*losspercentw
lapln = lbpln*losspercentw
lacar = lbcar*losspercentw /* was lacar = l*losspercentw */
lamen = trunc(lamen); lafit = trunc(lafit); labat = trunc(labat); lapln = trunc(lapln); lacar = trunc(lacar)
if (lamen<0) then lamen=random(1,10,time('s')); if (lafit<0) then lafit=random(1,2,time('s')); if (labat<0) then labat=random(1,3,time('s'))
if (lapln<0) then lapln=random(0,1,time('s')); if (lacar<0) then lacar=random(0,3,time('s'))
end
if favor = 1 then do
if lbpln=0 then lbpln=1
end
if favor = 2 then do
if lapln=0 then lapln=1
end
if (population<0) then population = 0
if (bpop<0) then bpop = 0
say ' '
options prompt 'Press any key to continue.'
pull result
say CLS
say YELLOW' BATTLE SUMMARY'
say GREEN' =============='
say ''
say RED' Name: 'WHITE||handle
if favor=1 then say RED' Status: 'WHITE'Victor'
if favor=2 then say RED' Stauts: 'WHITE'Conquered'
say RED' Men Lost: 'WHITE||lamen
say RED' Fighters Lost: 'WHITE||lafit
say RED' Carriers Lost: 'WHITE||lacar
say RED' BattleShips Lost: 'WHITE||labat
if favor=1 then say RED' Planets Lost: 'WHITE'0'
if favor=2 then say RED' Planets Lost: 'WHITE||lapln
if favor=1 then say RED' Planets Gained: 'WHITE||lbpln
if favor=2 then say RED' Planets Gained: 'WHITE'0'
say ' '
say RED' Name: 'WHITE||enemy
if favor=2 then say RED' Status: 'WHITE'Victor'
if favor=1 then say RED' Status: 'WHITE'Conquered'
say RED' Men Lost: 'WHITE||lbmen
say RED' Fighters Lost: 'WHITE||lbfit
say RED' Carriers Lost: 'WHITE||lbcar /* was l */
say RED' BattleShips Lost: 'WHITE||lbbat
if favor=2 then say RED' Planets Lost: 'WHITE'0'
if favor=1 then say RED' Planets Lost: 'WHITE||lbpln
if favor=2 then say RED' Planets Gained: 'WHITE||lapln
if favor=1 then say RED' Planets Gained: 'WHITE'0'
men = men - lamen; fighters = fighters - lafit; carriers = carriers - lacar
battleships = battleships - labat
if favor = 1 then do
planets = planets + lbpln
bpln = bpln - lbpln
end
bmen = bmen - lbmen; bfit = bfit - lbfit
bcar = bcar - lbcar /* was all fucked up as = - l and that was it */
bbat = bbat - lbbat
if favor = 2 then do
planets = planets - lapln
bpln = bpln + lapln
end
options prompt BLUE'Press enter to continue.'
pull result
if favor=1 then enmpop = lbpln*10000
if favor=2 then enmpop = lapln*10000
enmcas = enmpop * losspercentl
enmpop = enmpop - enmcas
tempa = enmpop*.2; tempa = tempa/10; tempa = trunc(tempa)
tempb = enmpop*.4; tempb = tempb/10; tempb = trunc(tempb)
enmrec = random(tempa,tempb,time('s'))
enmrec = enmrec*10
enmpop = enmpop - enmrec
tempa = enmpop*.2; tempa = tempa/100; tempa = trunc(tempa)
tempb = enmpop*.25; tempb = tempb/100; tempb = trunc(tempb)
enmesc = random(tempa,tempb,time('s'))
enmesc = enmesc*100; enmesc = enmesc + random(1,99,time('s'))
enmpop = enmpop - enmesc
enmgen = enmpop
if favor=1 then do
population = population + enmgen
bpop = bpop - enmgen
bpop = bpop + enmesc
men = men + enmrec
enmbcas = enmcas
enmacas = 0
end
if favor=2 then do
population = population - enmgen
population = population + enmesc
bpop = bpop + enmgen
bmen = bmen + enmrec
enmbcas = 0
enmacas = enmcas
end
say CLS
say YELLOW' POPULATION SUMMARY'
say GREEN' =================='
say ' '; say ' '; say ' '
if favor = 1 then do
say RED' Enemy Casualties: 'WHITE||enmbcas
say RED' Recruits to your army: 'WHITE||enmrec
say RED' People added to your population: 'WHITE||enmgen
say RED' People escaped to home planet: 'WHITE||enmesc
end
if favor = 2 then do
say RED' Your Casualties: 'WHITE||enmacas
say RED' Recruits to enemies army: 'WHITE||enmrec
say RED' People added to his population: 'WHITE||enmgen
say RED' People who escaped to you: 'WHITE||enmesc
end
call WRTATTRA; call WRTATTRB
call YOUUPDTA; call YOUUPDTB
title = 'War Information'
dataa = 'Your empire has been attacked by 'handle'. Here is a briefing'
datab = 'on your battle statistics:'
if favor = 2 then datac = ' Status: Victor'
if favor = 1 then datac = ' Status: Conquered'
datad = ' Men Lost: 'lbmen
datae = ' Fighters Lost: 'lbfit
dataf = ' Carriers Lost: 'lbcar /* was l */
datag = 'BattleShips Lost: 'lbbat
if favor = 2 then datah = ' Planets Gained: 'lapln
if favor = 1 then datah = ' Planets Lost: 'lbpln
call open file, (file3'-'msgnumber),'W'
call writeln file, dataa
call writeln file, datab
call writeln file, datac
call writeln file, datad
call writeln file, datae
call writeln file, dataf
call writeln file, datag
call writeln file, datah
call close file
call open file, (file5),'A'
if favor = 1 then data = ''handle' defeated 'enemy' in a war.'
if favor = 2 then data = ''enemy' defeated 'handle' in a war.'
call writeln file, data
call close file
realhandle = handle
handle = 'Stellar War Battle Monitor'
call NOTIFY
handle = realhandle
say ' '; say ' '; say ' '; say ' '; say ' '
options prompt BLUE'Press enter to continue.'
pull result
signal WAR
SPYMENU:
say ' '; say ' '; say ' '
say CLS
options prompt GREEN'Who do you want to spy on 'WHITE'('RED'L=List,Q=Quit'WHITE')? '
pull result
aname = upper(result)
if aname = '' then signal SPYMENU
if upper(aname)='L' then do
call lister
signal SPYMENU
end
if upper(aname)='Q' then signal WAR
search = aname
call FIND
if sflag = 0 then do
say ' '; say ' '
say RED'Sorry, this user does not exist.'
say ' '; say ' '; say ' '
options prompt BLUE'Press enter to continue.'
pull result
signal WAR
end
sk = 0
if (upper(aname))=(upper(spyname)) then do sk = 1; signal SPYSKIP; end
flpop = 0; flmen = 0; flfit = 0; flcar = 0
flpln = 0; flpln = 0; flmny = 0; flbat = 0
SPYSKIP:
aname = listname
call ATTRIBUTEA
call ATTRIBUTEB
if flpop=1 then signal SPYSKIPA
fpop = 'UNKNOWN'
SPYSKIPA:
if flmen=1 then signal SPYSKIPB
fmen = 'UNKNOWN'
SPYSKIPB:
if flfit=1 then signal SPYSKIPC
ffit = 'UNKNOWN'
SPYSKIPC:
if flcar=1 then signal SPYSKIPD
fcar = 'UNKNOWN'
SPYSKIPD:
if flbat=1 then signal SPYSKIPE
fbat = 'UNKNOWN'
SPYSKIPE:
if flmor=1 then signal SPYSKIPF
fmor = 'UNKNOWN'
SPYSKIPF:
if flpln=1 then signal SPYSKIPG
fpln = 'UNKNOWN'
SPYSKIPG:
if flmny=1 then signal SPYSCR
fmny = 'UNKNOWN'
SPYSCR:
say CLS
say YELLOW' Spy Menu'
say ' '; say ' '
say RED'Now spying on : 'WHITE||aname
say ' '
say RED'Number 'WHITE'| 'GREEN'Spy on 'WHITE' | 'PURPLE'Cost 'WHITE'| 'YELLOW'Status'
say WHITE'-------+------------------+--------+----------'
say RED' 1 'WHITE'| 'GREEN' Population 'WHITE' | 'PURPLE'100 'WHITE'| 'YELLOW||fpop
say RED' 2 'WHITE'| 'GREEN' Men 'WHITE' | 'PURPLE'300 'WHITE'| 'YELLOW||fmen
say RED' 3 'WHITE'| 'GREEN' Fighters 'WHITE' | 'PURPLE'500 'WHITE'| 'YELLOW||ffit
say RED' 4 'WHITE'| 'GREEN' Carriers 'WHITE' | 'PURPLE'600 'WHITE'| 'YELLOW||fcar
say RED' 5 'WHITE'| 'GREEN' Battle Ships 'WHITE' | 'PURPLE'800 'WHITE'| 'YELLOW||fbat
say RED' 6 'WHITE'| 'GREEN' Planets 'WHITE' | 'PURPLE'1000 'WHITE'| 'YELLOW||fpln
say RED' 7 'WHITE'| 'GREEN' Money 'WHITE' | 'PURPLE' 400 'WHITE'| 'YELLOW||fmny
temp = moral; moral = fmor
call MORALFIG; if moral = 1 then morl = 'Exceptional'; if moral = 2 then morl = 'Confident'
if moral = 3 then morl = 'Unsure'; if moral = 4 then morl = 'Frightened'
if moral = 5 then morl = 'Unstable'
moral = temp
say RED' 8 'WHITE'| 'GREEN'Moral 'WHITE' | 'PURPLE'1500 'WHITE' | 'YELLOW||fmor
say WHITE'----------------------------------------------'
say ' '
say PURPLE'Your current money: 'YELLOW||money
say ' '; say ' '
options prompt GREEN'What information would you like to know 'WHITE'('RED'Q=Quit'WHITE')? '
pull result
spyitem = upper(result)
if spyitem = '' then signal SPYSCR
if upper(spyitem) = 'Q' then signal WAR
if upper(spyitem) = 'L' then do
call LISTER
signal SPYSCR
end
if spyitem>8 then signal SPYSCR
if spyitem<1 then signal SPYSCR
if (spyitem = 1) then do
money = money - 100
if money<0 then do
money = money + 100
signal SORRY
end
fpop = bpop
flpop = 1
signal SPYSCR
end
if (spyitem = 2) then do
money = money - 300
if money<0 then do
money = money + 300
signal SORRY
end
fmen = bmen
flmen = 1
signal SPYSCR
end
if (spyitem = 3) then do
money = money - 500
if money<0 then do
money = money + 500
signal SORRY
end
ffit = bfit
flfit = 1
signal SPYSCR
end
if (spyitem = 4) then do
money = money - 600
if money<0 then do
money = money + 600
signal SORRY
end
fcar = bcar /* was missing bcar */
flcar = 1
signal SPYSCR
end
if (spyitem = 5) then do
money = money - 800
if money<0 then do
money = money + 800
signal SORRY
end
fbat = bbat
flbat = 1
signal SPYSCR
end
if (spyitem = 6) then do
money = money - 1000
if money<0 then do
money = money + 1000
signal SORRY
end
fpln = bpln
flpln = 1
signal SPYSCR
end
if (spyitem = 7) then do
money = money - 400
if money<0 then do
money = money + 400
signal SORRY
end
fmny = bmny
flmny = 1
signal SPYSCR
end
if (spyitem = 8) then do
money = money - 1500
if money<0 then do
money = money + 1500
signal SORRY
end
fmor = morl
flmor = 1
signal SPYSCR
end
SORRY:
say ' '
say RED'Sorry, you you do not have the money to do that.'
say ' '; say ' '
options prompt BLUE'Press enter to continue.'
pull result
signal SPYSCR
MORALFIG:
if percentage>85 then do
moral = 1
return
end
if percentage>70 then do
moral = 2
return
end
if percentage>49 then do
moral = 3
return
end
if percentage>25 then do
moral = 4
return
end
moral = 5
return
TACTICS:
call open file, (file17'-'number'.dat'),'R'
sendmen = readln(file)
sendfit = readln(file)
sendbat = readln(file)
sendcar = readln(file)
call close file
TACTICSM:
say CLS
say YELLOW' Personal Defense Tactics'
say ' '; say ' '; say ' '; say ' '
say LBLUE' This determines the percentages of your resources you will send if and when'
say ' you are attacked on the battlefield.'
say ' '; say ' '; say ' '
say WHITE' [1] 'RED' Percentage of men 'WHITE'('GREEN'Currently 'sendmen'%'WHITE') = 'PURPLE||trunc(men*(sendmen/100))' men.'
say WHITE' [2] 'RED' Percentage of fighters 'WHITE'('GREEN'Currently 'sendfit'%'WHITE') = 'PURPLE||trunc(fighters*(sendfit/100))' fighters.'
say WHITE' [3] 'RED' Percentage of battleships 'WHITE'('GREEN'Currently 'sendbat'%'WHITE') = 'PURPLE||trunc(battleships*(sendbat/100))' battleships.'
say WHITE' [4] 'RED' Percentage of carriers 'WHITE'('GREEN'Currently 'sendcar'%'WHITE') = 'PURPLE||trunc(carriers*(sendcar/100))' carriers.'
say ' '; say ''
options prompt GREEN' Enter your choice 'WHITE'('RED'Q=Quit'WHITE')> '
pull result
answer = upper(result)
if answer = '' then signal TACTICSM
if upper(answer) = 'Q' then do
call open file, (file17'-'number'.dat'),'W'
call writeln file, sendmen
call writeln file, sendfit
call writeln file, sendbat
call writeln file, sendcar
call close file
signal MAINMENU
end
TACTA:
if answer = 1 then do
say WHITE ' Current percentage of men is 'GREEN||sendmen'%.'
options prompt GREEN' Enter new percentage ' WHITE '('RED'Do not include % sign'WHITE')> '
pull result
answer = upper(result)
if answer>100 then signal TACTA
if answer<0 then signal TACTA
sendmen = answer
end
TACTB:
if answer = 2 then do
say WHITE' Current percentage of fighters is 'GREEN||sendfit'%.'
options prompt GREEN' Enter new percentage 'WHITE'('RED'Do not include % sign'WHITE')> '
pull result
answer = upper(result)
if answer>100 then signal TACTB
if answer<0 then signal TACTB
sendfit = answer
end
TACTC:
if answer = 3 then do
say WHITE' Current percentage of battleships is 'GREEN||sendbat'%.'
options prompt GREEN' Enter new percentage 'WHITE'('RED'Do not include % sign'WHITE')> '
pull result
answer = upper(result)
if answer>100 then signal TACTC
if answer<0 then signal TACTC
sendbat = answer
end
TACTD:
if answer = 4 then do
say WHITE' Current percentage of carriers is 'GREEN||sendcar'%.'
options prompt GREEN' Enter new percentage 'WHITE'('RED'Do not include % sign'WHITE')> '
pull result
answer = upper(result)
if answer>100 then signal TACTD
if answer<0 then signal TACTD
sendcar = answer
end
signal TACTICSM
BREAK_C:
say RED'Carrier Dropped. Returning to board.'
exit
exit
IOERR:
say YELLOW'FATAL: 'RED'IO Error has been detected. Please notify SysOp.'
say ' Line number of detection: 'WHITE||SIGL
say RED' Severity of error: 'WHITE||RC
say WHITE
exit
exit
ERROR:
say RED'IO ERROR in line: 'WHITE||sigl||RED' Severity: 'WHITE||RC
say YELLOW'Notify SysOp Immediately!!'
say ' '
say WHITE
exit
exit
SYNTAX:
say ' '; say ' '; say ' '
say WHITE'FATAL: 'RED'Syntax error in line: 'WHITE||sigl
say RED' Severity of error : 'WHITE||RC
say ' '
say YELLOW' Please notify SysOp immediately.'
say ' '; say ' '; say ' '
say LBLUE'Now saving/updating your records....'
call YOUUPDTA
call YOUUPDTB
call open file, (file11),'R'
members = readln(file)
call close file
call open file, (file11),'W'
call writeln file, members
call writeln file, msgnumber
call close file
call open file, (file15'-'number),'W'
call writeln file, datz
call writeln file, wrtms
call close file
say GREEN'Thank you for playing 'WHITE'Stellar War v2.00.'
exit
exit
LEAVE:
say ' '; say ' '; say ' '
say LBLUE'Now saving/updating your records....'
call YOUUPDTA
call YOUUPDTB
call open file, (file11),'R'
members = readln(file)
call close file
call open file, (file11),'W'
call writeln file, members
call writeln file, msgnumber
call close file
call open file, (file15'-'number),'W'
call writeln file, datz
call writeln file, wrtms
call close file
say GREEN'Thank you for playing 'WHITE'Stellar War v2.00.'
QUESTSKIP:
exit
exit
LISTER:
call open file, (file7),'R'
do until eof(file)
listname = readln(file)
say ' 'listname
end
call close file
options prompt BLUE'Press enter to continue.'
pull result
RETURN
FIND:
sflag = 0
call open file, (file7),'R'
count = 0
do until eof(file)
count = count + 1
listname = readln(file)
if upper(search) = upper(listname) then do
sflag = 1
signal FINDEX
end
end
FINDEX:
call close file
RETURN
ATTRIBUTEA:
call open file, (file6'-'count'.dat'),'R'
bpop = readln(file)
bmen = readln(file)
bfit = readln(file)
bcar = readln(file)
bbat = readln(file)
bwin = readln(file)
blos = readln(file)
bmor = readln(file)
call close file
RETURN
ATTRIBUTEB:
call open file, (file2'-'count'.dat'),'R'
bpln = readln(file)
bmes = readln(file)
bpts = readln(file)
bmny = readln(file)
call close file
RETURN
WRTATTRA:
call open file, (file6'-'count'.dat'),'W'
call writeln file, bpop
call writeln file, bmen
call writeln file, bfit
call writeln file, bcar /* was missing */
call writeln file, bbat
call writeln file, bwin
call writeln file, blos
call writeln file, bmor
call close file
RETURN
WRTATTRB:
call open file, (file2'-'count'.dat'),'W'
call writeln file, bpln
call writeln file, bmes
call writeln file, bpts
call writeln file, bmny
call close file
RETURN
NOTIFY:
call open file, (file13'-'count),'R'
high = readln(file)
if high = 0 then do
call close file
call open file, (file13'-'count),'W'
call writeln file, msgnumber
call writeln file, title
call writeln file, handle
call close file
signal UPDATE
end
call close file
call open file, (file13'-'count),'A'
data = msgnumber
call writeln file, data
call writeln file, title
call writeln file, handle
call close file
UPDATE:
messages = messages + 1
call open file, (file11),'R'
members = readln(file)
call close file
msgnumber = msgnumber + 1
call open file, (file11),'W'
call writeln file, members
call writeln file, msgnumber
call close file
RETURN
YOUUPDTA:
call open file, (file2'-'number'.dat'),'W'
call writeln file, planets
call writeln file, messages
call writeln file, points
call writeln file, money
call close file
RETURN
YOUUPDTB:
call open file, (file6'-'number'.dat'),'W'
call writeln file, population
call writeln file, men
call writeln file, fighters
call writeln file, carriers
call writeln file, battleships
call writeln file, wins
call writeln file, losses
call writeln file, moral
call close file
RETURN
SELFCHECK:
flag = 0
if upper(search) = upper(handle) then do
flag = 1
say RED' Pardon me, but I believe that is you...'
say ' '
options prompt BLUE'Press enter to continue.'
pull result
end
RETURN
YOUATTRA:
call open file, (file2'-'number'.dat'),'R'
planets = readln(file)
messages = readln(file)
points = readln(file)
money = readln(file)
call close file
RETURN
YOUATTRB:
call open file, (file6'-'number'.dat'),'R'
population = readln(file)
men = readln(file)
fighters = readln(file)
carriers = readln(file)
battleships = readln(file)
wins = readln(file)
losses = readln(file)
moral = readln(file)
call close file
RETURN
TAXCOLLECT:
collect = 0
collected = collected + 1
if collected > 2 then do
say CLS
say WHITE' You have forced the population of your empire to REVOLT against'
say ' your taxation. The people have been taxed too many times this game period.'
say ' The rallying mobs destroy many government buildings which you must repair.'
say ' '; say ' '
cost = money * 0.30; cost = trunc(cost)
say RED' Total cost to repair property: 'WHITEcost
money = money - cost
plays = plays + 1
say ' '; say ' '
options prompt BLUE'Press enter to continue.'
pull result
return
end
collect = population*0.2; collect = trunc(collect)
addition = random(1,50,time('s'))
addition = addition * 100
collect = collect + addition
say CLS
say LBLUE' The people wearily pay their taxes. The total money received from the'
say ' collection of taxes is: 'collect
if collected = 2 then do
say ' '; say ' '
say YELLOW' WARNING: 'GREEN'You have begun to overtax your population. Be careful,'
say ' they may try to revolt.'
end
money = money + collect
say ' '; say ' '
options prompt BLUE'Press enter to continue.'
pull result
RETURN