home *** CD-ROM | disk | FTP | other *** search
/ Amiga Elysian Archive / AmigaElysianArchive.iso / comm / stel220.lha / STELLAR / stellar_0.prx < prev    next >
Text File  |  1993-07-15  |  69KB  |  2,126 lines

  1.  
  2. /*Stellar War v2.20 Jul 15, 1993 */
  3. /* A lost and forgottened and abandoned game */
  4. /* Full of defects rebuilt with care based on */
  5. /* the original Created by a Unknown author by */
  6. /* the handle of Delta Leader who no longer exists */
  7. /* with a bbs or number, I hope you like this version */
  8. /* and call me for help with future improvements. */
  9. /*  Robert Lehman, Maxnet 90:51/0 1-219-289-3275 */
  10.  
  11.  
  12. parse arg Uname
  13. RealName = upper(uname)
  14. Handle = upper(uname)
  15. options results
  16. options prompt '?> '
  17. signal on error
  18. signal on syntax
  19. signal on ioerr
  20. signal on BREAK_C
  21.  
  22. number = -1; msgnumber = 0; flags = 0; collected = 0; plays = 0; jmpflg = 0
  23. file1 = 'Doors:Stellar/config'
  24. file2 = 'Doors:Stellar/user/user'
  25. file3 = 'Doors:Stellar/messages/message'
  26. file4 = 'Doors:Stellar/mailflag'
  27. file5 = 'Doors:Stellar/log'
  28. file6 = 'Doors:Stellar/army/army'
  29. file7 = 'Doors:Stellar/players.dat'
  30. file8 = 'Doors:Stellar/welcome.txt'
  31. file9 = 'Doors:Stellar/exit.txt'
  32. file10 = 'Doors:Stellar/Story'
  33. file11 = 'Doors:Stellar/calldata'
  34. file12 = 'Doors:Stellar/galaxy'
  35. file13 = 'Doors:Stellar/flags/mail_for'
  36. file14 = 'Doors:Stellar/current'
  37. file15 = 'Doors:Stellar/Days/User'
  38. file16 = 'Doors:Stellar/questions'
  39. file17 = 'Doors:Stellar/send/send'
  40. file18 = 'Doors:Stellar/DaysLeft.dat'
  41. file19 = 'Doors:Stellar/Instructions'
  42.  
  43. flg = 0
  44. ANSPICK:
  45. call open file, (file8),'R'
  46. do until eof(file)
  47.          data = readln(file)
  48.         say data
  49. end
  50. call close file
  51. say 'Please enter your choice of graphics'
  52. say 'Color (Y/n)'
  53. pull result 
  54. graphics = upper(result)
  55.  
  56. if graphics ~= 'N' then do
  57. CLS = 'H'
  58. BLACK = ''
  59. RED = ''
  60. GREEN = ''
  61. YELLOW = ''
  62. BLUE = ''
  63. PURPLE = ''
  64. LBLUE = ''
  65. WHITE = ''
  66. flg = 1
  67. end
  68. if graphics = 'N' then do
  69.         CLS = ''
  70.         WHITE = ''
  71.         BLACK = ''
  72.         YELLOW = ''
  73.         GREEN = ''
  74.         LBLUE = ''
  75.         RED = ''
  76.         BLUE = ''
  77.         PURPLE = ''
  78. end
  79. wrtms = 0
  80. datz = date("C")
  81. call open file, (file14),'R'
  82.    tday = readln(file)
  83. call close file
  84. if tday<datz then do
  85.         say YELLOW' Please Hold....'LBLUE'Updating player data structures.'
  86.         call open file, (file18),'R'
  87.                 dleft = readln(file)
  88.         call close file
  89.         call open file, (file18),'W'
  90.                 dleft = dleft - (datz-tday)
  91.                 call writeln file, dleft
  92.         call close file
  93.         if dleft = 0 then do
  94.                 count = 0
  95.                 call open file, (file7),'R'
  96.                 do until eof(file)
  97.                    count = count + 1
  98.                    temp = readln(file)
  99.                 end
  100.                 do x = 1 to count
  101.                         call open file, (file2'-'count'.dat'),'R'
  102.                              temp = readln(file)
  103.                              temp = readln(file)
  104.                              pts = readln(file)
  105.                              temp = readln(file)
  106.                              if pts>crtpts then crttop = count
  107.                         call close file
  108.                 end
  109.                 call open file, (file7),'R'
  110.                         temp = readln(file)
  111.                         do count = 1 to crttop
  112.                                 champ = readln(file)
  113.                         end
  114.                 call close file
  115.                 call open file, (file7),'W'
  116.                         data = 'Stellar War v2.0 ReCreated by Robert Lehman, SouthWinds bbs'
  117.                         call writeln file, data
  118.                 call close file
  119.                 call open file, (file11),'W'
  120.                         call writeln file, 0
  121.                         call writeln file, 0
  122.                 call close file
  123.                 call open file, (file5),'W'
  124.                         data = ' Stellar War v2.0     Log of Events'
  125.                         datb = ' -----------------------------------'
  126.                         datc = ' Last Periods Champion : 'champ
  127.                         call writeln file, data
  128.                         call writeln file, datb
  129.                         call writeln file, datc
  130.                 call close file
  131.                 call open file, (file18),'W'
  132.                         data = 30
  133.                         call writeln file, data
  134.                 call close file
  135.         end
  136. end
  137. tday=datz
  138. if tday=datz then signal ATMAINTPASS
  139. options prompt 'Press enter to continue.'
  140. pull result
  141. say YELLOW'Please hold....'BLUE'conducting maintenance.'
  142. call open file, (file11),'R'
  143.         members = readln(file)
  144. call close file
  145. do count = 1 to members
  146.    call open file, (file2'-'count'.dat'),'R'
  147.         tpl = readln(file)
  148.     call close file
  149.     if (tpl<0) then do
  150.         count2 = count + 1
  151.         do until (count2 = members)
  152.         call open file, (file2'-'count2'.dat'),'R'
  153.             ta = readln(file)
  154.             tb = readln(file)
  155.             tc = readln(file)
  156.             td = readln(file)
  157.         call close file
  158.         call open file, (file2'-'count2-1'.dat'),'W'
  159.             call writeln file, ta
  160.             call writeln file, tb
  161.             call writeln file, tc
  162.             call writeln file, td
  163.         call close file
  164.         call open file, (file6'-'count2'.dat'),'R'
  165.             ta = readln(file)
  166.             tb = readln(file)
  167.             tc = readln(file)
  168.             td = readln(file)
  169.             te = readln(file)
  170.             tf = readln(file)
  171.             tg = readln(file)
  172.             th = readln(file)
  173.         call close file
  174.         call open file, (file6'-'count2-1'.dat'),'W'
  175.             call writeln file, ta
  176.             call writeln file, tb
  177.             call writeln file, tc
  178.             call writeln file, td
  179.             call writeln file, te
  180.             call writeln file, tf
  181.             call writeln file, tg
  182.             call writeln file, th
  183.         call close file
  184.         call open file, (file7),'R'
  185.             count4 = 1
  186.             ta = readln(file)
  187.             do until(eof(file))
  188.                 nm.count4 = readln(file)
  189.                 count4 = count4 + 1
  190.             end
  191.         call close file
  192.         call open file, (file7),'W'
  193.             data = 'Stellar War v2.00 list of players'
  194.             call writeln file, data
  195.             do count5 = 1 to count4
  196.                 if not(count5=count2-1) then call writeln file, nm.count5
  197.             end
  198.         call close file
  199.         call open file, (file11),'R'
  200.             ta = readln(file)
  201.             tb = readln(file)
  202.         call close file
  203.         call open file, (file11),'W'
  204.             ta = ta - 1
  205.             call writeln file, ta
  206.             call writeln file, tb
  207.         call close file
  208.         call open file, (file13'-'count2),'R'
  209.             count4 = 1
  210.             do until (eof(file))
  211.                 mlm.count4 = readln(file)
  212.             end
  213.         call close file
  214.         call open file, (file13'-'count2-1),'W'
  215.             do count5 = 1 to count4
  216.                 call writeln file, mlm.count5
  217.             end
  218.         call close file
  219.         call open file, (file15'-'count2),'R'
  220.             ta = readln(file)
  221.         call close file
  222.         call open file, (file15'-'count2-1),'W'
  223.             call writeln file, ta
  224.         call close file
  225.         call open file, (file17'-'count2'.dat'),'R'
  226.             ta = readln(file)
  227.             tb = readln(file)
  228.             tc = readln(file)
  229.             td = readln(file)
  230.         call close file
  231.         call open file, (file17'-'count2-1'.dat'),'W'
  232.             call writeln file, ta
  233.             call writeln file, tb
  234.             call writeln file, tc
  235.             call writeln file, td
  236.         call close file
  237.         call open file, (file5),'A'
  238.             tp = count2-1
  239.             dnm = nm.tp
  240.             data = dnm' was completly slaughtered and has been forced to drop out of the game.'
  241.             call writeln file, data
  242.         call close file
  243.     end
  244. end
  245. ATMAINTPASS:
  246. call open file, (file18),'R'
  247.         dleft = readln(file)
  248. call close file
  249. say BLUE'Only 'YELLOW||dleft||BLUE' days before a winner of this round is decided!'
  250. call open file, (file14),'W'
  251.    call writeln file, datz
  252. call close file
  253. options prompt GREEN'Do you want to read the story 'WHITE'('RED'y/N'WHITE')? '
  254. pull result
  255. answer = upper(result)
  256. myn = 0
  257. if answer = 'y' | answer = 'Y' then do
  258.       call open file, (file10),'R'
  259.         do until eof(file)
  260.                 myn = myn + 1
  261.                 data = readln(file)
  262.                 say data
  263.                 if myn=20 then do
  264.                         options prompt 'More [Y/N]? '
  265.                         pull result
  266.                         answer = upper(result)
  267.                         if upper(answer)='Y' then myn = 0
  268.                         if upper(answer)='N' then signal OVERAA
  269.                         if upper(answer)='' then myn = 0
  270.                 end
  271.                 if mny = 20 then signal OVERAA
  272.         end
  273. end
  274. OVERAA:
  275. call close file
  276. options prompt GREEN'Do you want to read the instructions 'WHITE'('RED'y/N'WHITE')? '
  277. pull result
  278. answer = upper(result)
  279. mny = 0
  280. if upper(answer)='Y' then do
  281.         call open file, (file19),'R'
  282.           do until eof(file)
  283.                 mny = mny + 1
  284.                 data = readln(file)
  285.                 say data
  286.                 if mny=20 then do
  287.                         options prompt 'More [Y/N]'
  288.                  pull result 
  289.                         answer = upper(result)
  290.                         if upper(answer)='Y' then mny = 0
  291.                         if upper(answer)='' then mny = 0
  292.                         if upper(answer)='N' then signal OVERAB
  293.                 end
  294.                 if mny=20 then signal OVERAB
  295.           end
  296. end
  297. OVERAB:
  298. call close file
  299. say ' '
  300. say CLS; say ' '; say ' '; say ' '
  301. say YELLOW'Please wait....'BLUE'conducting maintenance.'
  302. call open file, (file1),'R'
  303.    maxuser = readln(file)
  304.    maxturn = readln(file)
  305.    maxplanet = readln(file)
  306.    newreceive = readln(file)
  307.    newmoney = readln(file)
  308.    newmen = readln(file)
  309.    newfighters = readln(file)
  310.    newcarriers = readln(file)
  311.    newbattleships = readln(file)
  312.         newpopulation = readln(file)
  313. call close file
  314. search = RealName
  315. call find
  316. if sflag = 1 then do
  317.    number = count
  318.    handle = listname
  319.    signal CONT
  320. end
  321. say GREEN'You do not currently have an account on Stellar War.'
  322. say YELLOW'Please hold....'
  323. call open file, (file11),'R'
  324.    members = readln(file)
  325.         msgnumber = readln(file)
  326. call close file
  327.    if members = maxuser then do
  328.       say RED'I am sorry, but this game is filled right now.  Try'
  329.       say 'in a few days.'
  330.       signal LEAVE
  331.    end
  332. ADDING:
  333. say LBLUE'Adding you to the membership role.'
  334. call open file, (file5),'A'
  335.         data = handle' joined as a new player.'
  336.    call writeln file, data
  337. call close file
  338. messages = 0; points = 0; trades = 0
  339. call open file, (file2'-'members+1'.dat'),'W'
  340.    call writeln file, newreceive
  341.    call writeln file, messages
  342.    call writeln file, points
  343.    call writeln file, newmoney
  344. call close file
  345. call open file, (file7),'A'
  346.    call writeln file, handle
  347. call close file
  348. say ' '
  349. say LBLUE'Creating your army.'
  350. wins = 0; losses = 0; moral = 3
  351. call open file, (file6'-'members+1'.dat'),'W'
  352.    call writeln file, newpopulation
  353.    call writeln file, newmen
  354.    call writeln file, newfighters
  355.    call writeln file, newcarriers
  356.    call writeln file, newbattleships
  357.    call writeln file, wins
  358.    call writeln file, losses
  359.    call writeln file, moral
  360. call close file
  361. call open file, (file17'-'members+1'.dat'),'W'
  362.         dats = 80
  363.         call writeln file, dats
  364.         call writeln file, dats
  365.         call writeln file, dats
  366.         call writeln file, dats
  367. call close file
  368. call open file, (file11),'W'
  369.    call writeln file, members+1
  370.    call writeln file, msgnumber
  371. call close file
  372. number = members+1
  373. call open file, (file13'-'number),'W'
  374.    data = 0
  375.    call writeln file, data
  376. call close file
  377. call open file, (file15'-'number),'W'
  378.    call writeln file, dat
  379.         wrtms = 0
  380.         call writeln file, wrtms
  381. call close file
  382. CONT:
  383. call YOUATTRA
  384. call YOUATTRB
  385. call open file, (file15'-'number),'R'
  386.         tz = readln(file)
  387.         wrtms = readln(file)
  388. call close file
  389. if tz<datz then wrtms = 0
  390. call open file, (file13'-'number),'R'
  391. msg = readln(file)
  392. if msg=0 then do
  393.    call close file
  394.         say ' '; say ' '
  395.    say YELLOW'You have no mail waiting.'
  396.        signal CONTWO
  397. end
  398. call close file
  399. call open file, (file13'-'number),'R'
  400. say YELLOW'The following pieces of mail are for you:'
  401. ttlmsg = 0
  402. do until eof(file)
  403.    msg = readln(file)
  404.    if (msg = '') then signal NOTEQUAL
  405.         title = readln(file)
  406.    sender = readln(file)
  407.    ttlmsg = ttlmsg + 1
  408.    say WHITE||ttlmsg') 'RED'#'msg' from 'sender'.'
  409. end
  410. NOTEQUAL:
  411. call close file
  412. call open file, (file13'-'number),'R'
  413. do count = 1 to ttlmsg
  414.    msg = readln(file)
  415.    if msg = '' then signal STOP
  416.    title = readln(file)
  417.    sender = readln(file)
  418.    options prompt GREEN'Press enter to read #'msg'.'
  419.    pull result
  420.    say CLS
  421.    say WHITE'Message # - 'RED||msg
  422.    say WHITE'From      - 'RED||sender
  423.    say WHITE'About     - 'RED||title
  424.    call open fil2, (file3'-'msg),'R'
  425.         say WHITE
  426.         do until eof(fil2)
  427.                 data = readln(fil2)
  428.                 say data
  429.         end
  430.         call close fil2
  431.    say ' ';
  432.     call open fil2, (file3'-'msg),'W'
  433.     call close fil2        
  434. end
  435. STOP:
  436. call close file
  437. call open file, (file13'-'number),'W'
  438.    data = 0
  439.    call writeln file, data
  440. call close file
  441. CONTWO:
  442. options prompt ' ' GREEN'Do you want to read the news letter 'WHITE'('RED'Y/n'WHITE')? '
  443. pull result
  444. answer = upper(result)
  445. if upper(answer) = 'N' then signal SKIPS
  446. say CLS
  447. call open file, (file5),'R'
  448. mny = 0
  449. do until eof(file)
  450.         mny = mny + 1
  451.         data = readln(file)
  452.         say data
  453.         if mny=20 then do
  454.                 options prompt 'More [Y/N]? '
  455.                 pull result
  456.                 answer = upper(result)
  457.                 if upper(answer)='Y' then mny = 0
  458.                 if upper(answer)='' then mny = 0
  459.         end
  460.         if mny=20 then signal OVERAC
  461. end
  462. OVERAC:
  463. call close file
  464. say ' '; say ' '
  465. options prompt BLUE'Press enter to continue.'
  466. pull result
  467. SKIPS:
  468. call YOUATTRA
  469. call YOUATTRB
  470. call open file, (file11),'R'
  471.    members = readln(file)
  472.    msgnumber = readln(file)
  473. call close file
  474. call STATS
  475. signal MAINMENU
  476. STATS:
  477.  
  478. say CLS
  479. say LBLUE'                     <<<<<'YELLOW' Personal Statistics 'LBLUE'>>>>>'
  480. say ' '
  481. say RED'Name         : 'WHITE||handle
  482. say RED'Account #    : 'WHITE||number
  483. say RED'Messages     : 'WHITE||messages
  484. say RED'Money        : 'WHITE||money
  485. say RED'Points       : 'WHITE||points
  486. say RED'Population   : 'WHITE||population
  487. say ' '
  488. say LBLUE'                  <<<<<'YELLOW' Army Statistical Summary'LBLUE' >>>>>'
  489. say ' '
  490. say RED'Men          : 'WHITE||men
  491. say RED'Fighters     : 'WHITE||fighters
  492. say RED'Carriers     : 'WHITE||carriers
  493. say RED'BattleShips  : 'WHITE||battleships
  494. say RED'Planets      : 'WHITE||planets
  495. say RED'Wins         : 'WHITE||wins
  496. say RED'Losses       : 'WHITE||losses
  497. winlos = wins + losses
  498. if winlos>0 then percentage = wins/winlos
  499. if winlos=0 then percentage = 1
  500. percentage = percentage*100
  501. say RED'Percentage   : 'WHITE||percentage'%'
  502. call MORALFIG
  503. if moral = 1 then say RED'Moral of Men : 'WHITE'Exceptional'
  504. if moral = 2 then say RED'Moral of Men : 'WHITE'Confident'
  505. if moral = 3 then say RED'Moral of Men : 'WHITE'Unsure'
  506. if moral = 4 then say RED'Moral of Men : 'WHITE'Frightened'
  507. if moral = 5 then say RED'Moral of Men : 'WHITE'Unstable'
  508. say ' '
  509. options prompt BLUE'Press enter to continue.'
  510. pull result
  511. return
  512. MAINMENU:
  513. say CLS
  514. say LBLUE' <<<'YELLOW' Options'LBLUE' >>>'
  515. say ' '
  516. say YELLOW'[S]  'GREEN'Show your statistical summary'
  517. say YELLOW'[M]  'GREEN'Send a message'
  518. say YELLOW'[D]  'GREEN'Draft Men (Only used in extreme crisis)'
  519. say YELLOW'[T]  'GREEN'Trade with another player'
  520. say YELLOW'[R]  'GREEN'Request a trade with another player'
  521. say YELLOW'[B]  'GREEN'Buy and sell equipment'
  522. say YELLOW'[C]  'GREEN'Collect taxes from population'
  523. say YELLOW'[W]  'GREEN'War and Spy menus'
  524. say YELLOW'[P]  'GREEN'Set up your defense tactics'
  525. say ' '
  526. say PURPLE'[I]  'GREEN'Display game instructions'
  527. say PURPLE'[H]  'GREEN'Read the story of the program.'
  528. say PURPLE'[Q]  'GREEN'Quit this game - return to BBS'
  529. say ' '; say ' '; say ' '
  530. options prompt YELLOW'Enter your choice>> 'WHITE
  531. pull result
  532. answer = upper(result)
  533. if answer = '' then signal MAINMENU
  534. cm = upper(answer)
  535. if cm='S' then call STATS
  536. if cm='M' then signal MESSAGE
  537. if cm='D' then signal DRAFT
  538. if cm='H' then signal HELP
  539. if cm='T' then signal TRADE
  540. if cm='R' then signal REQUEST
  541. if cm='E' then signal ENDDIE
  542. if cm='B' then signal MARKET
  543. if cm='Q' then signal LEAVE
  544. if cm='W' then signal WAR
  545. if cm='C' then call TAXCOLLECT
  546. if cm='P' then signal TACTICS
  547. if cm='I' then call REALINSTRUCT
  548. signal MAINMENU
  549.  
  550. REALINSTRUCT:
  551. say CLS
  552. call open file, (file19),'R'
  553. mny = 0
  554. do until eof(file)
  555.         mny = mny + 1
  556.         data = readln(file)
  557.         say data
  558.         if mny = 20 then do
  559.                 options prompt 'More [Y/N]? '
  560.                 pull result
  561.                 answer = upper(result)
  562.                 if upper(answer)='Y' then mny = 0
  563.         end
  564.         if mny=20 then signal OVERAD
  565. end
  566. OVERAD:
  567. call close file
  568. say ' '
  569. options prompt BLUE'Press enter to continue.'
  570. pull result
  571. return
  572.  
  573. MESSAGE:
  574. say CLS
  575. say ' '
  576. say ' '
  577. say YELLOW'                                   Message Menu'
  578. say ' '; say ' '; say ' ';
  579. say WHITE'[1]  'RED'Send a message'
  580. say WHITE'[2]  'RED'List current members'
  581. say WHITE'[3]  'RED'Quit to main menu'
  582. say ' '; say ' '
  583. options prompt YELLOW'Enter your choice>> 'WHITE
  584. pull result
  585. answer = upper(result)
  586. if answer = '' then signal MESSAGE
  587. if answer = '3' then signal MAINMENU
  588. if answer = '1' then signal ENTER
  589. if answer = '2' then call LISTER
  590. signal MESSAGE
  591. ENTER:
  592. say CLS
  593. options prompt GREEN'Address to> 'WHITE
  594. pull result
  595. address = upper(result)
  596. if address = '' then signal MESSAGE
  597. search = address
  598. call FIND
  599. call SELFCHECK
  600. if flag = 1 then signal ENTER
  601. if sflag = 0 then do
  602.    say YELLOW'Sorry, but this user does not currently exist.'
  603.    options prompt BLUE'Press enter to continue.'
  604.    pull result
  605.    signal MESSAGE
  606. end
  607. options prompt GREEN'Title     > 'WHITE
  608. pull result
  609. title = upper(result)
  610. if title = '' then title = 'None Given'
  611. say ' '
  612. line = 1
  613. say ' '; say ' '
  614. call open file, (file3'-'msgnumber),'W'
  615. say WHITE'You must do your own word wrapping.  Sorry for the inconvenience.'
  616. say WHITE'Enter up to'PURPLE' 75 'WHITE'lines of text.  Enter a S to save text.  '
  617. say WHITE'Enter an A to Abort your message and return to the main options menu.'
  618. say LBLUE'  [----:----:----:----:----:----]'
  619. indent = 1
  620. LINES:
  621. options prompt '?> '
  622. if indent = 0 then say PURPLE||line'>'WHITE;pull result
  623. if indent = 1 then say PURPLE||line'>'WHITE;pull result
  624.   text = result
  625. if text = 'S' | text = 's' then signal SAVE
  626. if text = 'A' | text = 'a' then do
  627.    call close file
  628.    signal MAINMENU
  629. end
  630. call writeln file, text
  631. if line = 9 then indent = 0
  632. if line=75 then do
  633.    say ' '
  634.         say YELLOW'Out of space.  Message being saved.....'
  635.    call close file
  636.    say ' '
  637.    say ' '
  638.    options prompt BLUE'Press enter to continue.'
  639.    pull result
  640.    call NOTIFY
  641.    signal MESSAGE
  642. end
  643. line = line + 1
  644. signal LINES
  645. SAVE:
  646.    call close file
  647.    say ' '
  648.    say YELLOW'Saving file.....'
  649. call NOTIFY
  650. signal MESSAGE
  651. DRAFT:
  652.         if drft = 1 then signal MAINMENU
  653.    if percentage>15 then do
  654.       say WHITE'You are not in a time of 'GREEN'total crisis'WHITE'.  You cannot draft'
  655.       say 'troops yet.'
  656.                 say ' '; say ' '
  657.       options prompt BLUE'Press enter to continue.'
  658.       pull result
  659.       signal MAINMENU
  660.    end
  661.         if moral<5 then do
  662.                 say WHITE'Your 'GREEN'army moral'WHITE' is suitable enough that there is no need to'
  663.                 say 'draft any more right now.'
  664.                 say ' '; say ' '
  665.                 options prompt BLUE'Press enter to continue.'
  666.                 pull result
  667.         signal MAINMENU
  668.         end
  669.    totaldraft = population/100
  670.    totaldraft = totaldraft*15
  671. POPULATION:
  672.    say CLS; say ' '; say ' '; say ' '
  673.    say WHITE'Out of 'GREEN||population||WHITE', only 'GREEN||totaldraft||WHITE' are in the condition'
  674.    say 'to be drafted.'
  675.    say ' '
  676.    say ' '
  677.    options prompt YELLOW'How many men do you want to draft 'WHITE'('RED'Max of 'totaldraft||WHITE')? '
  678.    pull result
  679.    answer = upper(result)
  680.    if answer = '' then signal POPULATION
  681.    if answer>totaldraft then do
  682.       say RED'You do not have those kind of resources...'YELLOW'try again.'
  683.       do count=1 to 50; end
  684.       signal POPULATION
  685.    end
  686.         say ' '; say ' '
  687.    say WHITE'You have drafted 'GREEN||answer||WHITE' men.'
  688.    say ' '
  689.    population = population - answer
  690.    men = men + answer
  691.    do count = 1 to 50; end
  692.    drft = 1
  693.         moral = moral - 1
  694. signal MAINMENU
  695. HELP:
  696.         mny = 0
  697.         say CLS
  698.    call open file, (file10),'R'
  699.         do until eof(file)
  700.                 mny = mny + 1
  701.                 data = readln(file)
  702.                 say data
  703.                 if mny = 20 then do
  704.                         options prompt 'More [Y/N]? '
  705.                         pull result
  706.                         answer = upper(result)
  707.                         if upper(answer) = 'Y' then mny = 0
  708.                 end
  709.                 if mny = 20 then signal OVERAE
  710.         end
  711. OVERAE:
  712.         call close file
  713.    signal MAINMENU
  714. TRADE:
  715.    say CLS
  716.    say ' '; say ' '; say ' '
  717.    options prompt GREEN'Who do you want to trade with 'WHITE'('RED'Q=Quit, L=List'WHITE')? '
  718.    pull result
  719.    aname = upper(result)
  720.    if aname = '' then signal TRADE
  721.    search = aname
  722.    call SELFCHECK
  723.    if flag = 1 then signal TRADE
  724.    if upper(aname)='Q' then signal MAINMENU
  725.    if upper(aname)='L' then do
  726.       call lister
  727.       signal TRADE
  728.    end
  729.    search = aname
  730.    call FIND
  731.    if sflag = 1 then signal FOUND
  732.    if flag = 0 then do
  733.       say LBLUE'Sorry, this user is not a member as of right now.'
  734.                 say ' '
  735.       options prompt BLUE'Press enter to continue.'
  736.       pull result
  737.    end
  738.    signal TRADE
  739. FOUND:
  740.    call close file
  741.    call ATTRIBUTEA
  742.    call ATTRIBUTEB
  743.    say PURPLE'Ok, member has been located.  Continue....'
  744. DISTRD:   
  745.         say ' '; say ' '; say CLS
  746.    say YELLOW'                            Main Trade Menu'
  747.    say ' '
  748.    say WHITE'[1]  'RED'Men'
  749.    say WHITE'[2]  'RED'Fighters'
  750.    say WHITE'[3]  'RED'Carriers'
  751.    say WHITE'[4]  'RED'Battle Ships'
  752.    say WHITE'[5]  'RED'Planets'
  753.    say WHITE'[6]  'RED'General Population'
  754.    say WHITE'[7]  'RED'Money'
  755.    say ' '; say ' '; say ' '
  756.    options prompt GREEN'Enter what you want to trade away 'WHITE'('RED'Q=Quit'WHITE')>> '
  757.    pull result
  758.    answer = upper(result)
  759.    if answer = '' then signal DISTRD
  760.    if upper(answer)='Q' then signal MAINMENU
  761.    if answer>7 then signal DISTRD
  762.    if answer<1 then signal DISTRD
  763.    say ' '; say ' '
  764.    if answer = 1 then do
  765.       tradeitem = 'Men'
  766.       max = men
  767.    end
  768.    if answer = 2 then do
  769.       tradeitem = 'Fighters'
  770.       max = fighters
  771.    end
  772.    if answer = 3 then do
  773.       tradeitem = 'Carriers'
  774.       max = carriers
  775.    end
  776.    if answer = 4 then do
  777.       tradeitem = 'Battle ships'
  778.       max = battleships
  779.    end
  780.    if answer = 5 then do
  781.       tradeitem = 'Planets'
  782.       max = planets
  783.    end
  784.    if answer = 6 then do
  785.       tradeitem = 'People'
  786.       max = population
  787.    end
  788.    if answer = 7 then do
  789.       tradeitem = 'Dollars'
  790.       max = money
  791.    end
  792. GETTRADE:
  793.    options prompt GREEN||tradeitem' to trade 'WHITE'('RED'Max of 'max||WHITE') ? '
  794.    pull result
  795.    trade = upper(result)
  796.    if trade = '' then signal 
  797.    if trade > max then do DISTRD
  798.       say WHITE'You do not have that many'GREEN||tradeitem'!'
  799.       signal GETTRADE
  800.    end
  801.    call ATTRIBUTEA
  802.    if answer = 1 then do
  803.       bmen = bmen + trade
  804.       men = men - trade
  805.    end
  806.    if answer = 2 then do
  807.       bfit = bfit + trade
  808.       fighters = fighters - trade
  809.    end
  810.    if answer = 3 then do
  811.       bcar = bcar + trade
  812.       carriers = carriers - trade
  813.    end
  814.    if answer = 4 then do
  815.       bbat = bbat + trade
  816.       battleships = battleships - trade
  817.    end
  818.    if answer = 5 then do
  819.       call ATTRIBUTEB
  820.       bpln = bpln + trade
  821.       planets = planets - trade
  822.       call WRTATTRB
  823.    end
  824.    if answer = 6 then do
  825.       bpop = bpop + trade
  826.       population = population - trade
  827.    end
  828.    if answer = 7 then do
  829.       call ATTRIBUTEB
  830.       bmny = bmny + trade
  831.       money = money - trade
  832.       call WRTATTRB
  833.    end
  834.    call WRTATTRA
  835.    call WRTATTRB
  836.    flags = 1
  837.    tradenumber = trade
  838.    datac= handle'  has made a trade of 'tradenumber||tradeitem' to you.'
  839.    datad= ' '
  840. REQUEST:
  841.    if flags= 1 then signal OVERPASS
  842.    flags = 0
  843.    say ' '
  844.    say ' '
  845.         say ' '; say ' '; say ' '
  846.         say CLS
  847.    options prompt GREEN 'Who do you want to trade with 'WHITE'('RED'L=List, Q=Quit'WHITE')? '
  848.    pull result
  849.    aname = upper(result)
  850.    if aname = '' then signal REQUEST
  851.    search = aname
  852.    call SELFCHECK
  853.    if flag= 1 then signal REQUEST
  854.    if upper(aname)='Q' then signal MAINMENU
  855.    if upper(aname)='L' then do
  856.       call lister
  857.       signal request
  858.    end
  859.    search = aname
  860.    call FIND
  861.    if sflag = 1 then do
  862.       aname = check
  863.       call ATTRIBUTEA
  864.       call ATTRIBUTEB
  865.       signal FOUNDB
  866.    end
  867.    say LBLUE'Sorry, this user is not currently on the membership role.'
  868.         say ' '; say ' '; say ' '
  869.    options prompt BLUE'Press enter to continue.'
  870.    pull result
  871.    signal REQUEST
  872. FOUNDB:
  873.    call close file
  874.    say PURPLE'Ok, user has been located.  Continue...'
  875.    jmpflg = 0
  876. OVERPASS:
  877.         say CLS
  878.    say YELLOW'                         Trade Request Menu'
  879.    say ' '; say ' '
  880.    say WHITE'[1]  'RED'Men'
  881.    say WHITE'[2]  'RED'Fighters'
  882.    say WHITE'[3]  'RED'Carriers'
  883.    say WHITE'[4]  'RED'Battle ships'
  884.    say WHITE'[5]  'RED'Planets'
  885.    say WHITE'[6]  'RED'General Population'
  886.    say WHITE'[7]  'RED'Money'
  887.    say ' '; say ' '; say ' '
  888.    options prompt GREEN'What do you request for a trade 'WHITE'('RED'Q=Quit'WHITE')? '
  889.    pull result
  890.    answer = upper(result)
  891.    if answer = '' then signal OVERPASS
  892.    if upper(answer) = 'Q' then do
  893.       if flags=1 then do
  894.          datae = handle' has not requested anything for the trade'
  895.          dataf = 'as of yet.'
  896.          signal TRADEMSGS
  897.       end   
  898.       if flags=0 then do
  899.          signal WHT
  900.       end
  901.    end
  902. FIGS:
  903.    if answer > 7 then signal OVERPASS
  904.    if answer < 1 then signal OVERPASS
  905.    if answer=1 then data = 'men'
  906.    if answer=2 then data = 'fighters'
  907.    if answer=3 then data = 'carriers'
  908.    if answer=4 then data = 'battle ships'
  909.    if answer=5 then data = 'planets'
  910.    if answer=6 then data = 'general population'
  911.    if answer=7 then data = 'dollars'
  912.         if (jmflg = 1) then do
  913.                 if answer = 2 then data = 'carriers'
  914.                 if answer = 3 then data = 'battle ships'
  915.                 if answer = 4 then data = 'planets'
  916.                 if answer = 5 then data = 'general population'
  917.                 if answer = 6 then data = 'dollars'
  918.         end
  919.    say ' '
  920.    if jmflg = 1 then signal JMA
  921.    options prompt GREEN'How many would you like to request? '
  922.    pull result
  923.    answer = upper(result)
  924.    if answer = '' then signal OVERPASS
  925.    datb = answer
  926.    datae = handle' would like to request 'datb||data' from you.  Please respond to his'
  927.    dataf = 'request whether you will trade with him or not.  '
  928.         if flags = 1 then signal TRADEMSGS
  929. WHT:
  930.         say ' '; say CLS
  931.    say YELLOW'                       Trade Return Menu'
  932.    say ' '; say ' '; say ' ';
  933.    say WHITE'[1]  'RED'Men'
  934.    say WHITE'[2]  'RED'Carriers'
  935.    say WHITE'[3]  'RED'Battle Ships'
  936.    say WHITE'[4]  'RED'Planets'
  937.    say WHITE'[5]  'RED'General Population'
  938.    say WHITE'[6]  'RED'Money'
  939.    say ' '; say ' '
  940.    options prompt GREEN'What will you give in return 'WHITE'('RED'Q=Quit'WHITE')? '
  941.    pull result
  942.    answer = upper(result)
  943.    jmflg = 1
  944.    if answer = '' then signal WHT
  945.    call FIGS
  946. JMA:
  947.    jmpflg = 0
  948.    datah = data
  949.         say ' '
  950.    options prompt GREEN'How many will you give? '
  951.    pull result
  952.    number = upper(result)
  953.    if number = '' then signal JMA
  954.    if upper(number) = 'Q' then do
  955.       datag = handle' has not promised anything in return however.'
  956.       signal TRADEMSGS
  957.    end
  958.         say ' '
  959.    datag = 'In return 'handle' will give you 'number||datah'.'
  960. TRADEMSGS:
  961.    call open file, (file3'-'msgnumber),'W'
  962.       if flags = 1 then do
  963.          call writeln file, datac
  964.          call writeln file, datad
  965.       end
  966.       call writeln file, datae
  967.       call writeln file, dataf
  968.       call writeln file, datag
  969. TRADENOTIFY:
  970.    aname = listname
  971.         say ' '; say ' '
  972.    say YELLOW||aname||RED'will be notified the next time they enter the game.'
  973.         say ' '; say ' '
  974.    options prompt BLUE'Press enter to continue.'
  975.    pull result
  976.    call close file
  977.    title = 'Trade Information'
  978.    call WRTATTRA
  979.    call WRTATTRB
  980.    call YOUUPDTA
  981.    call YOUUPDTB
  982.    realhandle = handle
  983.    handle = 'Stellar War Trading Post'
  984. call NOTIFY
  985. handle = realhandle
  986. flags = 0
  987. signal MAINMENU
  988. ENDDIE:
  989.    signal MAINMENU
  990. MARKET:
  991.         say CLS
  992.    say YELLOW'                            Stellar War Market'
  993.    say ' '; say ' '; say ' '; say ' '; say ' '
  994.    say WHITE'[1]  'RED'Buy supplies for your army'
  995.    say WHITE'[2]  'RED'Sell supplies of your army'
  996.         say ' '; say ' '; say ' '; say ' '
  997.    options prompt GREEN'Enter your choice 'WHITE'('RED'Q=Quit'WHITE')? '
  998.    pull result
  999.    answer = upper(result)
  1000.    if answer = '1' then signal BUY
  1001.    if answer = '2' then signal SELL
  1002.    if upper(answer) = 'Q' then signal MAINMENU
  1003. signal MARKET
  1004. BUY:
  1005.    say CLS
  1006.    say YELLOW'                            Supply Menu'
  1007.    say ' '; say ' '; say ' '
  1008.    say RED'Num.'WHITE'| 'YELLOW' Description'WHITE'     |'PURPLE'      Cost  'WHITE'  |   'GREEN'Current'
  1009.    say WHITE'----+------------------+--------------+-----------'
  1010.    say RED' 1  'WHITE'| 'YELLOW' Soldiers    'WHITE'    |'PURPLE'       1000 'WHITE'  |   'GREEN||men
  1011.    say RED' 2  'WHITE'| 'YELLOW' Fighters    'WHITE'    |'PURPLE'      10000 'WHITE'  |   'GREEN||fighters
  1012.    say RED' 3  'WHITE'| 'YELLOW' Carriers    'WHITE'    |'PURPLE'      14000 'WHITE'  |   'GREEN||carriers
  1013.    say RED' 4  'WHITE'| 'YELLOW' Battle Ships'WHITE'    |'PURPLE'      17000 'WHITE'  |   'GREEN||battleships
  1014.    say RED' 5  'WHITE'| 'YELLOW' Planets     'WHITE'    |'PURPLE'      40000 'WHITE'  |   'GREEN||planets
  1015.    say WHITE'--------------------------------------------------'
  1016.    say ' '; say ' '
  1017.    say PURPLE'You currently have 'WHITE||money||PURPLE' dollars.'
  1018.         say ' '
  1019.    options prompt GREEN'Enter item to purchase 'WHITE'('RED'Q=Quit'WHITE') >> '
  1020.    pull result 
  1021.    answer = upper(result)
  1022.    if answer = '' then signal BUY
  1023.    if upper(answer)='Q' then signal MARKET
  1024.    if answer<1 then signal BUY
  1025.    if answer>5 then signal BUY
  1026.    if answer = 1 then cost = 1000
  1027.    if answer = 2 then cost = 10000
  1028.    if answer = 3 then cost = 14000
  1029.    if answer = 4 then cost = 17000
  1030.    if answer = 5 then cost = 40000
  1031.    call FIGITEM
  1032.    call TRUNCMAX
  1033. HOWMANY:
  1034.         say ' '
  1035.    options prompt GREEN'How many 'item' do you want 'WHITE'('RED'Max of 'max||WHITE')? '
  1036.    pull result
  1037.    answer = upper(result)
  1038.    if answer = '' then signal BUY
  1039.    if answer>max then do
  1040.       say RED'You do not have that kind of money!'
  1041.       signal HOWMANY
  1042.    end
  1043.     if (answer<0) then do
  1044.         say GREEN'We do not sell 'WHITE'NEGATIVE'GREEN||item'!'
  1045.         signal HOWMANY
  1046.     end
  1047.    money = money - (answer*cost)
  1048.    if item = 'men' then men=men+answer
  1049.    if item = 'fighters' then fighters = fighters + answer
  1050.    if item = 'carriers' then carriers = carriers + answer
  1051.    if item = 'battleships' then battleships = battleships + answer
  1052.    if item = 'planets' then planets = planets + answer
  1053. signal BUY
  1054. FIGITEM:
  1055.    if answer = 1 then item = 'men'
  1056.    if answer = 2 then item = 'fighters'
  1057.    if answer = 3 then item = 'carriers'
  1058.    if answer = 4 then item = 'battleships'
  1059.    if answer = 5 then item = 'planets'
  1060. RETURN
  1061. TRUNCMAX:
  1062.    temp = (money/cost)
  1063.         max = trunc(temp)
  1064. RETURN
  1065. SELL:
  1066.         say CLS
  1067.    say YELLOW'                           Stellar War Selling Market'
  1068.    say ' '; say ' '; say ' '
  1069.    say RED'Num.'WHITE'|'YELLOW'   Description            'WHITE' |   'GREEN'Re-Sale Price   'WHITE'|  'PURPLE'Current'
  1070.    say WHITE'----+---------------------------+-------------------+---------'
  1071.    say RED' 1  'WHITE'|'YELLOW'   Soldiers               'WHITE' |   'GREEN'      750       'WHITE'|  'PURPLE||men
  1072.    say RED' 2  'WHITE'|'YELLOW'   Fighters               'WHITE' |   'GREEN'     6500       'WHITE'|  'PURPLE||fighters
  1073.    say RED' 3  'WHITE'|'YELLOW'   Carriers               'WHITE' |   'GREEN'     9000       'WHITE'|  'PURPLE||carriers
  1074.    say RED' 4  'WHITE'|'YELLOW'   Battle Ships           'WHITE' |   'GREEN'    11050       'WHITE'|  'PURPLE||battleships
  1075.    say RED' 5  'WHITE'|'YELLOW'   Planets                'WHITE' |   'GREEN'    28000       'WHITE'|  'PURPLE||planets
  1076.    say WHITE'----+---------------------------+-------------------+---------'
  1077.    say ' '; say ' ';
  1078.    say PURPLE'You currently have 'YELLOW||money||PURPLE' dollars. '
  1079.         say ' '
  1080.    options prompt GREEN'What do you want to sell 'WHITE'('RED'Q=Quit'WHITE')? '
  1081.    pull result
  1082.    answer = upper(result)
  1083.    if upper(answer)='Q' then signal MARKET
  1084.    if answer='' then signal SELL
  1085.    if answer = 1 then max = men - (fighters + carriers + battleships)
  1086.    if answer = 2 then max = fighters
  1087.    if answer = 3 then max = carriers
  1088.    if answer = 4 then max = battleships
  1089.    if answer = 5 then max = (planets - 1)
  1090.         if answer>5 then signal SELL
  1091.         if answer<1 then signal SELL
  1092. RESK:
  1093.         say ' '
  1094.         if max<1 then do
  1095.                 say GREEN'Sorry, but you have none to sell.'
  1096.                 hotkey BLUE'Press enter to continue.'
  1097.                 signal SELL
  1098.         end
  1099.    options prompt GREEN'How many do you want to sell 'WHITE'('RED'Max of 'max||WHITE')? '
  1100.    pull result
  1101.    amount = upper(result)
  1102.    if amount>max then do
  1103.       say RED'You do not have that many!'
  1104.       signal RESK
  1105.    end
  1106.    if amount=0 then signal SELL
  1107.         if amount<0 then signal SELL
  1108.    if answer = 1 then do
  1109.       men = men - amount
  1110.       money = money + amount*750
  1111.       say LBLUE'You have received 'YELLOW||amount*750||LBLUE' dollars for your sale.'
  1112.    end
  1113.    if answer = 2 then do
  1114.       fighters = fighters - amount
  1115.       money = money + amount*6500
  1116.       say LBLUE'You have received 'YELLOW||amount*6500||LBLUE' dollars for your sale.'
  1117.    end
  1118.    if answer = 3 then do
  1119.       carriers = carriers - amount
  1120.       money = money + amount*9000
  1121.       say LBLUE'You have received 'YELLOW||amount*9000||LBLUE' dollars for your sale.'
  1122.    end
  1123.    if answer = 4 then do
  1124.       battleships = battleships - amount
  1125.       money = money + amount*11050
  1126.       say LBLUE'You have received 'YELLOW||amount*11050||LBLUE' dollars for your sale.'
  1127.    end
  1128.         if answer = 5 then do
  1129.                 planets = planets - amount
  1130.                 money = money + amount*28000
  1131.                 say LBLUE'You have received 'YELLOW||amount*28000||LBLUE' dollars for your sale.'
  1132.         end
  1133.         say ' '; say ' '
  1134.    options prompt BLUE'Press enter to continue.'
  1135.    pull result
  1136. signal SELL
  1137. WAR:
  1138.         say CLS
  1139.    say YELLOW'                             Main War Menu'
  1140.         say ' '; say ' '
  1141.         say ' '; say ' '; say ' '; say ' '
  1142.    say WHITE'[1]  'RED'Engage in war'
  1143.    say WHITE'[2]  'RED'Spy on other players'
  1144.    say WHITE'[3]  'RED'List of other players'
  1145.    say WHITE'[4]  'RED'Quit to main menu'
  1146.    say ' '; say ' '; say ' '
  1147.    options prompt GREEN'Enter your choice>> 'WHITE
  1148.    pull result
  1149.    answer = upper(result)
  1150.    if answer = '' then signal WAR
  1151.    if answer = '1' then signal WARMENU
  1152.    if answer = '2' then signal SPYMENU
  1153.    if answer = '3' then do
  1154.       call open file, (file7),'R'
  1155.       do until eof(file)
  1156.          listname = readln(file)
  1157.          say listname
  1158.       end
  1159.        call close file
  1160.       options prompt BLUE'Press enter to continue.'
  1161.       pull result
  1162.    end
  1163.    if answer = '4' then signal MAINMENU
  1164. signal WAR
  1165.  
  1166. WARMENU:
  1167.         if wrtms = 8 then do
  1168.                 say RED' You have already engaged in too many battles today.  Your'
  1169.                 say ' troops grow weary.'
  1170.                 options prompt BLUE'Press enter to continue.'
  1171.                 pull result
  1172.         signal WAR
  1173.         end
  1174.         if planets<1 then do
  1175.                 say RED' You do not have enough planets to engage in war.  You are not'
  1176.                 say 'permitted to engage in war until you have at least 1 planet.'
  1177.                 options prompt BLUE'Press enter to continue.'
  1178.                 pull result
  1179.                 signal WAR
  1180.         end
  1181.         say ' '; say ' '; say ' '
  1182.         say CLS
  1183.    options prompt GREEN'Who do you want to engage in war with 'WHITE'('RED'L=List, Q=Quit'WHITE')? '
  1184.    pull result
  1185.    enemy = upper(result)
  1186.    if enemy = '' then signal WARMENU
  1187.    if upper(enemy)='Q' then signal WAR
  1188.    if upper(enemy)='L' then do
  1189.       call LISTER
  1190.       signal WARMENU
  1191.    end
  1192.    search = enemy
  1193.    call SELFCHECK
  1194.    if flag = 1 then signal WARMENU
  1195.    call FIND
  1196.    if sflag = 1 then signal AIGHT
  1197.         say ' '; say ' '
  1198.    say LBLUE' Sorry, this user has not been found.'
  1199.         say ' '
  1200.    options prompt BLUE'Press enter to continue.'
  1201.    pull result
  1202.    signal WAR
  1203. AIGHT:
  1204.         wrtms = wrtms + 1
  1205.    enemy = listname
  1206.    call ATTRIBUTEA
  1207.    call ATTRIBUTEB
  1208.         if bpln = 0 then do
  1209.                 say RED'Sorry, this user is in protection due to his vulnerability.  This will'
  1210.                 say RED'change soon, so keep trying!'
  1211.                 signal WARMENU
  1212.         end
  1213.         say CLS
  1214.    options prompt GREEN'Send how many men 'WHITE'('RED'Max of 'men||WHITE')? '
  1215.    pull result
  1216.    smen = upper(result)
  1217.    if smen = '' then smen = men
  1218.    if smen>men then do
  1219.                 say ' '
  1220.       say RED' Sorry, you do not have that many men.'
  1221.                 say ' '; say ' '
  1222.       options prompt BLUE'Press enter to continue.'
  1223.       pull result
  1224.       signal AIGHT
  1225.    end
  1226. SFIGHT:
  1227.    say YELLOW||smen' men are now prepared to fight.'
  1228.         say ' '
  1229.    options prompt GREEN'Send how many fighters 'WHITE'('RED'Max of 'fighters||WHITE')? '
  1230.    pull result
  1231.    sfighters = upper(result)
  1232.    if sfighters = '' then sfighters = fighters
  1233.    if sfighters>fighters then do
  1234.                 say ' '
  1235.       say RED' Sorry, you do not have that many fighters.'
  1236.                 say ' '
  1237.       options prompt BLUE'Press enter to continue.'
  1238.       pull result
  1239.       signal SFIGHT
  1240.    end
  1241. SCARR:
  1242.    say YELLOW||sfighters' fighters are now prepared to fight.'
  1243.         say ' '
  1244.    say WHITE' Each carrier can hold 150 men. '
  1245.    options prompt GREEN'Send how many carriers (Max of 'carriers')? '
  1246.    pull result
  1247.    scarrier = upper(result)
  1248.    if scarrier = '' then scarrier = carriers
  1249.    if scarrier>carriers then do
  1250.                 say ' '
  1251.       say RED' Sorry, you do not have that many carriers.'
  1252.                 say ' '
  1253.       options prompt BLUE'Press enter to continue.'
  1254.       pull result
  1255.       signal SCARR
  1256.    end
  1257. SBATT:
  1258.    say YELLOW||scarrier' carriers are now prepared to fight.'
  1259.    mostmen = scarrier*150
  1260.    if mostmen<smen then do
  1261.       smen = mostmen
  1262.       say RED' Since you have only sent 'scarrier' carriers'
  1263.       say'  you can only hold'
  1264.       say' a total of 'smen' men.'
  1265.    end
  1266.    atotal = 0; btotal = 0
  1267.    if moral = 1 then amoral=5
  1268.    if moral = 2 then amoral=4
  1269.    if moral = 3 then amoral=3
  1270.    if moral = 4 then amoral=2
  1271.    if moral = 5 then amoral=1
  1272.    if bmor = 1 then bmoral=5
  1273.    if bmor = 2 then bmoral=4
  1274.    if bmor = 3 then bmoral=3
  1275.    if bmor = 4 then bmoral=2
  1276.    if bmor = 5 then bmoral=1
  1277.    btotal = btotal + bmoral*500
  1278.    atotal = atotal + amoral*500
  1279.         say ' '
  1280.    options prompt GREEN'Send how many battle ships 'WHITE'('RED'Max of 'battleships||WHITE')? '
  1281.    pull result
  1282.    sbattle = upper(result)
  1283.    if sbattle = '' then sbattle = battleships
  1284.    if sbattle>battleships then do
  1285.                 say ' '
  1286.       say RED' Sorry, you do not have that many battle ships.'
  1287.                 say ' '
  1288.       options prompt BLUE'Press enter to continue.'
  1289.       pull result
  1290.       signal SBATT
  1291.    end
  1292.    say YELLOW||sbattle' battle ships are now prepared to fight.'
  1293.    do t=1 to 500; end
  1294.         say CLS
  1295.    say LBLUE' You are off to battle....'
  1296.    atotal = atotal + smen*10
  1297.    say GREEN'Your generals have given the order for your men to charge....'
  1298.    say GREEN'   They are now storming the enemy headquarters...'
  1299.    do x=1 to 500; end
  1300.         call open file, (file17'-'count'.dat'),'R'
  1301.                 sendmen = readln(file)
  1302.                 sendfit = readln(file)
  1303.                 sendbat = readln(file)
  1304.                 sendcar = readln(file)
  1305.         call close file
  1306.    bbmen = bmen*(sendmen/100); bbmen = trunc(bbmen)
  1307.         bbcara = (sendcar/100)
  1308.         bbcar = bcar * bbcara
  1309.         bbcar = trunc(bbcar)
  1310.  
  1311.         /* bbmen = bmen*(sendmen/100); bbmen = trunc(bbmen) */
  1312.         /* bbcar = bcar*(sendcar/100); bbcar = trunc(bbcar) */
  1313.         /* if bbmen>(bbcar*150) then bbmen = bbcar*150 */
  1314.  
  1315.         if bmen > (bbcar*150) then bbmen = (bbcar*150)
  1316.    bbfit = bfit*(sendfit/100); bbfit = trunc(bbfit)
  1317.    bbbat = bbat*(sendbat/100); bbbat = trunc(bbbat)
  1318. CALCPASS:
  1319.    btotal = btotal + bbmen
  1320.    if (bbmen>(smen*10)) then say RED'The enemy manages to suppress their attempts.  The men are retreating.'
  1321.    if (bbmen<(smen*10)) then say YELLOW'You have overcome the enemies troops.'
  1322.    if (bbmen=(smen*10)) then say LBLUE'Neither side has broken.  This fighting is not working at all.'
  1323.    do x=1 to 500; end
  1324.    atotal = atotal + sfighters*75
  1325.    dbbfit = random(bbfit,bfit,time('s'))*75
  1326.         say ' '
  1327.    say GREEN'Your fighters have now entered the battle and are blasting away at'
  1328.    say '   the enemy fortresses....'
  1329.    do x=1 to 500; end
  1330.    btotal = btotal + dbbfit
  1331.    if (dbbfit>(sfighters*75)) then say RED'The enemies fighters suppress your attack.'
  1332.    if (dbbfit<(sfighters*75)) then say YELLOW'Your fighters have destroyed a large portion of the enemies territory.'
  1333.    if (dbbfit=(sfighters*75)) then say LBLUE'Niether side has broken.  This fighting is not working at all.'
  1334.    do x=1 to 500; end
  1335.    atotal = atotal + sbattle*300
  1336.         say ' '
  1337.    say GREEN'Your battleships have now engaged in firing on the enemy.  The heavy'
  1338.    say '  has begun to wear down the enemy, but now his battleships enter the'
  1339.    say '  battle as well.'
  1340.    atotal = atotal + random(1,30,time('s'))*100
  1341.    cbbat1 = random(bbbat,bbat,time('s'))
  1342.    cbbat = cbbat1 * 300
  1343.    /* was cbbat = (bbbat,bbat,time('s')) *300  */
  1344.    btotal = btotal + cbbat
  1345.    do x=1 to 500; end
  1346.    temp = sbattle*300
  1347.    if (cbbat<temp) then say RED'The enemies battleships are now retreating back to their base.'
  1348.    if (cbbat>temp) then say YELLOW'The enemies battleships have driven your fleet back.'
  1349.    if (cbbat=temp) then say LBLUE'Neither side has broken.  This fighting is not working at all.'
  1350.    atotal = atotal + planets*25
  1351.    btotal = btotal + random(1,30,time('s'))*100
  1352.    btotal = btotal + bpln*25
  1353.    if atotal>btotal then do
  1354.       overall = atotal-btotal
  1355.       wins = wins + 1
  1356.       blos = blos + 1
  1357.                 points = atotal - btotal
  1358.       favor = 1
  1359.    end
  1360.    if atotal<btotal then do
  1361.       overall = btotal-atotal
  1362.       bwin = bwin + 1
  1363.       losses = losses + 1
  1364.                 bpts = btotal - atotal
  1365.       favor = 2
  1366.    end
  1367.    if atotal=btotal then do
  1368.       overall = 1
  1369.       favor = random(1,2,time('s'))
  1370.    end
  1371.  
  1372.         say ' '; say ' '
  1373.    say YELLOW'                              NEWS FLASH!!!!'
  1374.    say GREEN'                              =============='
  1375.    if overall<2000 then do
  1376.                 say ' '; say ' '
  1377.       say LBLUE'The battle raged on for months with virutally nothing lost or gained on'
  1378.       say 'either side.  The soldiers began to flee.  For a long time it appeared that'
  1379.       say 'neither side would win the battle.  'handle' set out with all the men he'
  1380.       say 'gather and rushed 'enemy' and his forces.  This became the most critical '
  1381.       say 'period of the war. '
  1382.       if favor=1 then say handle
  1383.       if favor=2 then say enemy
  1384.       say 'ended up making a critical error.  That error was simply underestimating'
  1385.       say 'the forces of '
  1386.       if favor=1 then say enemy'.'
  1387.       if favor=2 then say handle'.'
  1388.       say '  As the war finally came to an end, both sides suffered tremendous loss of'
  1389.       say 'men, but in the end there was only one victor.  That victor was none other'
  1390.       say' than... '
  1391.       if favor=1 then say handle'.'
  1392.       if favor=2 then say enemy'.'
  1393.                 say ' '; say ' '
  1394.       options prompt BLUE'Press enter to continue.'
  1395.       pull result
  1396.       losspercentl = 0.25; losspercentw = 0.4;
  1397.       signal LOSSES
  1398.    end
  1399.    if overall<5000 then do
  1400.       say LBLUE' The battle, all though at first very close, soon shifted in the favor of'
  1401.       if favor = 1 then say handle'.'
  1402.       if favor = 2 then say enemy'.'
  1403.       say 'Although this was not a battle of total domination, it was a'
  1404.       say ' significant victory for '
  1405.       if favor = 1 then say handle'.'
  1406.       if favor = 2 then say enemy'.'
  1407.       say '  The losses were not very heavy for'
  1408.       say 'either side since this was such a short battle.  '
  1409.       losspercentl = 0.15; losspercentw = 0.12;
  1410.       signal LOSSES
  1411.    end
  1412.    if overall<9000 then do
  1413.       say LBUE'This battle will be known as one of the shorter ones in this galaxy.  It'
  1414.       say 'was not one of the easiest however.  Both sides suffered, but even that was'
  1415.       say 'not very significant.  In the end it became a very easy victory for '
  1416.       if favor = 1 then say handle'.'
  1417.       if favor = 2 then say enemy'.'
  1418.       losspercentl = 0.10; losspercentw = 0.02
  1419.       signal LOSSES
  1420.    end
  1421.    if overall>8999 then do
  1422.       say LBLUE'A battle such as this can only be described as one thing.  Total Domination.'
  1423.       if favor = 1 then say handle
  1424.       if favor = 2 then say enemy
  1425.       say 'virtually crushed the weak forces of '
  1426.       if favor = 1 then say enemy'.'
  1427.       if favor = 2 then say handle'.'
  1428.       say 'The losses were very insignificant because of the speed in which it was'
  1429.       say 'over.'
  1430.       losspercentl = 0.07; losspercentw = 0.02
  1431.       signal LOSSES
  1432.    end
  1433. LOSSES:
  1434.    if favor=2 then do
  1435.       lamen = smen*losspercentl; lafit = sfighters*losspercentl; labat = sbattle*losspercentl; lapln = planets*losspercentl; lacar = carriers*losspercentl
  1436.       lamen = trunc(lamen); lafit = trunc(lafit); labat = trunc(labat); lapln = trunc(lapln); lacar = trunc(lacar)
  1437.       lbmen = lamen*losspercentw; lbfit = lafit*losspercentw; lbbat = labat*losspercentw; lbpln = lapln*losspercentw;lbcar = lacar*losspercentw;
  1438.       lbmen = trunc(lbmen); lbfit = trunc(lbfit); lbbat = trunc(lbbat); lbpln = trunc(lbpln); lbcar = trunc(lbcar)
  1439.            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'))
  1440.                 if (lbpln<0) then lbpln=random(0,1,time('s')); if (lbcar<0) then lbcar=random(0,3,time('s'))
  1441.    end
  1442.    if favor=1 then do
  1443.                 lbmen = bbmen*losspercentl
  1444.                 lbfit = bbfit*losspercentl
  1445.                 lbbat = bbbat*losspercentl
  1446.                 lbpln = bpln*losspercentl
  1447.                 lbcar = bbcar*losspercentl
  1448.  lbmen = trunc(lbmen)
  1449.  lbfit = trunc(lbfit)
  1450.  lbbat = trunc(lbbat)
  1451.  lbpln = trunc(lbpln)
  1452.  lbcar = trunc(lbcar) /* was l = trunc(l) */
  1453.                 lamen = lbmen*losspercentw
  1454.  lafit = lbfit*losspercentw
  1455.  labat = lbbat*losspercentw
  1456.  lapln = lbpln*losspercentw
  1457.  lacar = lbcar*losspercentw /* was lacar = l*losspercentw */
  1458.                 lamen = trunc(lamen); lafit = trunc(lafit); labat = trunc(labat); lapln = trunc(lapln); lacar = trunc(lacar)
  1459.            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'))
  1460.                 if (lapln<0) then lapln=random(0,1,time('s')); if (lacar<0) then lacar=random(0,3,time('s'))
  1461.    end
  1462.         if favor = 1 then do
  1463.       if lbpln=0 then lbpln=1
  1464.    end
  1465.    if favor = 2 then do
  1466.       if lapln=0 then lapln=1
  1467.    end
  1468.     if (population<0) then population = 0
  1469.     if (bpop<0) then bpop = 0
  1470.         say ' '
  1471.    options prompt 'Press any key to continue.'
  1472.    pull result
  1473.    say CLS
  1474.    say YELLOW'                            BATTLE SUMMARY'
  1475.    say  GREEN'                            =============='
  1476.    say ''
  1477.    say RED'             Name: 'WHITE||handle
  1478.    if favor=1 then say RED'           Status: 'WHITE'Victor'
  1479.    if favor=2 then say RED'           Stauts: 'WHITE'Conquered'
  1480.    say RED'         Men Lost: 'WHITE||lamen
  1481.    say RED'    Fighters Lost: 'WHITE||lafit
  1482.    say RED'    Carriers Lost: 'WHITE||lacar
  1483.    say RED' BattleShips Lost: 'WHITE||labat
  1484.    if favor=1 then say RED'     Planets Lost: 'WHITE'0'
  1485.    if favor=2 then say RED'     Planets Lost: 'WHITE||lapln
  1486.    if favor=1 then say RED'   Planets Gained: 'WHITE||lbpln
  1487.    if favor=2 then say RED'   Planets Gained: 'WHITE'0'
  1488.    say ' '
  1489.    say RED'             Name: 'WHITE||enemy
  1490.    if favor=2 then say RED'           Status: 'WHITE'Victor'
  1491.    if favor=1 then say RED'           Status: 'WHITE'Conquered'
  1492.    say RED'         Men Lost: 'WHITE||lbmen
  1493.    say RED'    Fighters Lost: 'WHITE||lbfit
  1494.    say RED'    Carriers Lost: 'WHITE||lbcar /* was l */
  1495.    say RED' BattleShips Lost: 'WHITE||lbbat
  1496.    if favor=2 then say RED'     Planets Lost: 'WHITE'0'
  1497.    if favor=1 then say RED'     Planets Lost: 'WHITE||lbpln
  1498.    if favor=2 then say RED'   Planets Gained: 'WHITE||lapln
  1499.    if favor=1 then say RED'   Planets Gained: 'WHITE'0'
  1500.    men = men - lamen; fighters = fighters - lafit; carriers = carriers - lacar
  1501.    battleships = battleships - labat
  1502.    if favor = 1 then do
  1503.       planets = planets + lbpln
  1504.       bpln = bpln - lbpln
  1505.    end
  1506.    bmen = bmen - lbmen; bfit = bfit - lbfit
  1507.    bcar = bcar - lbcar /* was all fucked up as = - l and that was it */
  1508.    bbat = bbat - lbbat
  1509.    if favor = 2 then do
  1510.       planets = planets - lapln
  1511.       bpln = bpln + lapln
  1512.    end
  1513.    options prompt BLUE'Press enter to continue.'
  1514.    pull result
  1515.    if favor=1 then enmpop = lbpln*10000
  1516.    if favor=2 then enmpop = lapln*10000
  1517.    enmcas = enmpop * losspercentl
  1518.    enmpop = enmpop - enmcas
  1519.    tempa = enmpop*.2; tempa = tempa/10; tempa = trunc(tempa)
  1520.    tempb = enmpop*.4; tempb = tempb/10; tempb = trunc(tempb)
  1521.    if (tempb - tempa) > 999 then do
  1522.       tempx = tempb - tempa
  1523.       tempb = tempb - tempx
  1524.    end
  1525.    enmrec = random(tempa,tempb,time('s'))
  1526.    enmrec = enmrec*10
  1527.    enmpop = enmpop - enmrec
  1528.    tempa = enmpop*.2; tempa = tempa/100; tempa = trunc(tempa)
  1529.    tempb = enmpop*.25; tempb = tempb/100; tempb = trunc(tempb)
  1530.    enmesc = random(tempa,tempb,time('s'))
  1531.    enmesc = enmesc*100; enmesc = enmesc + random(1,99,time('s'))
  1532.    enmpop = enmpop - enmesc
  1533.    enmgen = enmpop
  1534.    if favor=1 then do
  1535.       population = population + enmgen
  1536.                 bpop = bpop - enmgen
  1537.                 bpop = bpop + enmesc
  1538.       men = men + enmrec
  1539.       enmbcas = enmcas
  1540.       enmacas = 0
  1541.    end
  1542.    if favor=2 then do
  1543.       population = population - enmgen
  1544.       population = population + enmesc
  1545.       bpop = bpop + enmgen
  1546.       bmen = bmen + enmrec
  1547.       enmbcas = 0
  1548.       enmacas = enmcas
  1549.    end
  1550.         say CLS
  1551.    say YELLOW'                                POPULATION SUMMARY'
  1552.    say GREEN'                                =================='
  1553.    say ' '; say ' '; say ' '
  1554.    if favor = 1 then do
  1555.       say RED'                Enemy Casualties: 'WHITE||enmbcas
  1556.       say RED'           Recruits to your army: 'WHITE||enmrec
  1557.       say RED' People added to your population: 'WHITE||enmgen
  1558.       say RED'   People escaped to home planet: 'WHITE||enmesc
  1559.    end
  1560.    if favor = 2 then do
  1561.       say RED'                 Your Casualties: 'WHITE||enmacas
  1562.       say RED'        Recruits to enemies army: 'WHITE||enmrec
  1563.       say RED'  People added to his population: 'WHITE||enmgen
  1564.       say RED'       People who escaped to you: 'WHITE||enmesc
  1565.    end
  1566.    call WRTATTRA; call WRTATTRB
  1567.    call YOUUPDTA; call YOUUPDTB
  1568.    title = 'War Information'
  1569.    dataa = 'Your empire has been attacked by 'handle'.  Here is a briefing'
  1570.    datab = 'on your battle statistics:'
  1571.    if favor = 2 then datac = '           Status: Victor'
  1572.    if favor = 1 then datac = '           Status: Conquered'
  1573.    datad = '        Men Lost: 'lbmen
  1574.    datae = '   Fighters Lost: 'lbfit
  1575.    dataf = '   Carriers Lost: 'lbcar /* was l */
  1576.    datag = 'BattleShips Lost: 'lbbat
  1577.    if favor = 2 then datah = '  Planets Gained: 'lapln
  1578.    if favor = 1 then datah = '    Planets Lost: 'lbpln
  1579.    call open file, (file3'-'msgnumber),'W'
  1580.       call writeln file, dataa
  1581.       call writeln file, datab
  1582.       call writeln file, datac
  1583.       call writeln file, datad
  1584.       call writeln file, datae
  1585.       call writeln file, dataf
  1586.       call writeln file, datag
  1587.       call writeln file, datah
  1588.    call close file
  1589.         call open file, (file5),'A'
  1590.                 if favor = 1 then data = ''handle' defeated 'enemy' in a war.'
  1591.                 if favor = 2 then data = ''enemy' defeated 'handle' in a war.'
  1592.                 call writeln file, data
  1593.         call close file
  1594.    realhandle = handle
  1595.    handle = 'Stellar War Battle Monitor'
  1596.    call NOTIFY
  1597.    handle = realhandle
  1598.    say ' '; say ' '; say ' '; say ' '; say ' '
  1599.    options prompt BLUE'Press enter to continue.'
  1600.    pull result
  1601. signal WAR
  1602. SPYMENU:
  1603.         say ' '; say ' '; say ' '
  1604.         say CLS
  1605.    options prompt GREEN'Who do you want to spy on 'WHITE'('RED'L=List,Q=Quit'WHITE')? '
  1606.    pull result
  1607.    aname = upper(result)
  1608.    if aname = '' then signal SPYMENU
  1609.    if upper(aname)='L' then do
  1610.       call lister
  1611.       signal SPYMENU
  1612.    end
  1613.    if upper(aname)='Q' then signal WAR
  1614.    search = aname
  1615.    call FIND
  1616.    if sflag = 0 then do
  1617.                 say ' '; say ' '
  1618.       say RED'Sorry, this user does not exist.'
  1619.                 say ' '; say ' '; say ' '
  1620.       options prompt BLUE'Press enter to continue.'
  1621.       pull result
  1622.       signal WAR
  1623.    end
  1624.         sk = 0
  1625.    if (upper(aname))=(upper(spyname)) then do sk = 1; signal SPYSKIP; end
  1626.         flpop = 0; flmen = 0; flfit = 0; flcar = 0
  1627.    flpln = 0; flpln = 0; flmny = 0; flbat = 0
  1628. SPYSKIP:
  1629.    aname = listname
  1630.    call ATTRIBUTEA
  1631.    call ATTRIBUTEB
  1632.    if flpop=1 then signal SPYSKIPA
  1633.    fpop = 'UNKNOWN'
  1634. SPYSKIPA:
  1635.    if flmen=1 then signal SPYSKIPB
  1636.    fmen = 'UNKNOWN'
  1637. SPYSKIPB:
  1638.    if flfit=1 then signal SPYSKIPC
  1639.    ffit = 'UNKNOWN'
  1640. SPYSKIPC:
  1641.    if flcar=1 then signal SPYSKIPD
  1642.    fcar = 'UNKNOWN'
  1643. SPYSKIPD:
  1644.    if flbat=1 then signal SPYSKIPE
  1645.    fbat = 'UNKNOWN'
  1646. SPYSKIPE:
  1647.    if flmor=1 then signal SPYSKIPF
  1648.    fmor = 'UNKNOWN'
  1649. SPYSKIPF:
  1650.    if flpln=1 then signal SPYSKIPG
  1651.    fpln = 'UNKNOWN'
  1652. SPYSKIPG:
  1653.    if flmny=1 then signal SPYSCR
  1654.    fmny = 'UNKNOWN'
  1655. SPYSCR:
  1656.    say CLS
  1657.    say YELLOW'                                 Spy Menu'
  1658.    say ' '; say ' '
  1659.    say RED'Now spying on : 'WHITE||aname
  1660.    say ' '
  1661.    say RED'Number 'WHITE'| 'GREEN'Spy on          'WHITE' |  'PURPLE'Cost  'WHITE'|  'YELLOW'Status'
  1662.    say WHITE'-------+------------------+--------+----------'
  1663.    say RED'  1    'WHITE'| 'GREEN' Population     'WHITE' |  'PURPLE'100   'WHITE'|  'YELLOW||fpop
  1664.    say RED'  2    'WHITE'| 'GREEN' Men            'WHITE' |  'PURPLE'300   'WHITE'|  'YELLOW||fmen
  1665.    say RED'  3    'WHITE'| 'GREEN' Fighters       'WHITE' |  'PURPLE'500   'WHITE'|  'YELLOW||ffit
  1666.    say RED'  4    'WHITE'| 'GREEN' Carriers       'WHITE' |  'PURPLE'600   'WHITE'|  'YELLOW||fcar
  1667.    say RED'  5    'WHITE'| 'GREEN' Battle Ships   'WHITE' |  'PURPLE'800   'WHITE'|  'YELLOW||fbat
  1668.    say RED'  6    'WHITE'| 'GREEN' Planets        'WHITE' | 'PURPLE'1000   'WHITE'|  'YELLOW||fpln
  1669.    say RED'  7    'WHITE'| 'GREEN' Money          'WHITE' | 'PURPLE' 400   'WHITE'|  'YELLOW||fmny
  1670.         temp = moral; moral = fmor
  1671.         call MORALFIG; if moral = 1 then morl = 'Exceptional'; if moral = 2 then morl = 'Confident'
  1672.         if moral = 3 then morl = 'Unsure'; if moral = 4 then morl = 'Frightened'
  1673.         if moral = 5 then morl = 'Unstable'
  1674.         moral = temp
  1675.    say RED'  8    'WHITE'|  'GREEN'Moral          'WHITE' | 'PURPLE'1500  'WHITE' |  'YELLOW||fmor
  1676.    say WHITE'----------------------------------------------'
  1677.         say ' '
  1678.    say PURPLE'Your current money: 'YELLOW||money
  1679.         say ' '; say ' '
  1680.    options prompt GREEN'What information would you like to know 'WHITE'('RED'Q=Quit'WHITE')? '
  1681.    pull result
  1682.    spyitem = upper(result)
  1683.    if spyitem = '' then signal SPYSCR
  1684.    if upper(spyitem) = 'Q' then signal WAR
  1685.    if upper(spyitem) = 'L' then do
  1686.       call LISTER
  1687.       signal SPYSCR
  1688.    end
  1689.    if spyitem>8 then signal SPYSCR
  1690.    if spyitem<1 then signal SPYSCR
  1691.    if (spyitem = 1) then do
  1692.       money = money - 100
  1693.       if money<0 then do
  1694.          money = money + 100
  1695.          signal SORRY
  1696.       end
  1697.       fpop = bpop
  1698.       flpop = 1
  1699.       signal SPYSCR
  1700.    end
  1701.    if (spyitem = 2) then do
  1702.       money = money - 300
  1703.       if money<0 then do
  1704.          money = money + 300
  1705.          signal SORRY
  1706.       end
  1707.       fmen = bmen
  1708.       flmen = 1
  1709.       signal SPYSCR
  1710.    end
  1711.    if (spyitem = 3) then do
  1712.       money = money - 500
  1713.       if money<0 then do
  1714.          money = money + 500
  1715.          signal SORRY
  1716.       end
  1717.       ffit = bfit
  1718.       flfit = 1
  1719.       signal SPYSCR
  1720.    end
  1721.    if (spyitem = 4) then do
  1722.       money = money - 600
  1723.       if money<0 then do
  1724.          money = money + 600
  1725.          signal SORRY
  1726.       end
  1727.       fcar = bcar /* was missing bcar */
  1728.       flcar = 1
  1729.       signal SPYSCR
  1730.    end
  1731.    if (spyitem = 5) then do
  1732.       money = money - 800
  1733.       if money<0 then do
  1734.          money = money + 800
  1735.          signal SORRY
  1736.       end
  1737.       fbat = bbat
  1738.       flbat = 1
  1739.       signal SPYSCR
  1740.    end
  1741.    if (spyitem = 6) then do
  1742.       money = money - 1000
  1743.       if money<0 then do
  1744.          money = money + 1000
  1745.          signal SORRY
  1746.       end
  1747.       fpln = bpln
  1748.       flpln = 1
  1749.       signal SPYSCR
  1750.    end
  1751.    if (spyitem = 7) then do
  1752.       money = money - 400
  1753.       if money<0 then do
  1754.          money = money + 400
  1755.          signal SORRY
  1756.       end
  1757.       fmny = bmny
  1758.       flmny = 1
  1759.       signal SPYSCR
  1760.    end
  1761.    if (spyitem = 8) then do
  1762.       money = money - 1500
  1763.       if money<0 then do
  1764.          money = money + 1500
  1765.          signal SORRY
  1766.       end
  1767.       fmor = morl
  1768.       flmor = 1
  1769.       signal SPYSCR
  1770.    end
  1771. SORRY:
  1772.         say ' '
  1773.    say RED'Sorry, you you do not have the money to do that.'
  1774.         say ' '; say ' '
  1775.    options prompt BLUE'Press enter to continue.'
  1776.    pull result
  1777. signal SPYSCR
  1778. MORALFIG:
  1779.    if percentage>85 then do
  1780.       moral = 1
  1781.       return
  1782.    end
  1783.    if percentage>70 then do
  1784.       moral = 2
  1785.       return
  1786.    end
  1787.    if percentage>49 then do
  1788.       moral = 3
  1789.       return
  1790.    end
  1791.    if percentage>25 then do
  1792.       moral = 4
  1793.       return
  1794.    end
  1795.    moral = 5
  1796. return
  1797. TACTICS:
  1798.         call open file, (file17'-'number'.dat'),'R'
  1799.                 sendmen = readln(file)
  1800.                 sendfit = readln(file)
  1801.                 sendbat = readln(file)
  1802.                 sendcar = readln(file)
  1803.         call close file
  1804. TACTICSM:
  1805.         say CLS
  1806.         say YELLOW'                          Personal Defense Tactics'
  1807.         say ' '; say ' '; say ' '; say ' '
  1808.         say LBLUE' This determines the percentages of your resources you will send if and when'
  1809.         say ' you are attacked on the battlefield.'
  1810.         say '  '; say ' '; say ' '
  1811.         say WHITE' [1] 'RED' Percentage of men          'WHITE'('GREEN'Currently 'sendmen'%'WHITE')  = 'PURPLE||trunc(men*(sendmen/100))' men.'
  1812.         say WHITE' [2] 'RED' Percentage of fighters     'WHITE'('GREEN'Currently 'sendfit'%'WHITE')  = 'PURPLE||trunc(fighters*(sendfit/100))' fighters.'
  1813.         say WHITE' [3] 'RED' Percentage of battleships  'WHITE'('GREEN'Currently 'sendbat'%'WHITE')  = 'PURPLE||trunc(battleships*(sendbat/100))' battleships.'
  1814.         say WHITE' [4] 'RED' Percentage of carriers     'WHITE'('GREEN'Currently 'sendcar'%'WHITE')  = 'PURPLE||trunc(carriers*(sendcar/100))' carriers.'
  1815.         say ' '; say ''
  1816.         options prompt GREEN' Enter your choice 'WHITE'('RED'Q=Quit'WHITE')> '
  1817.         pull result
  1818.         answer = upper(result)
  1819.         if answer = '' then signal TACTICSM
  1820.         if upper(answer) = 'Q' then do
  1821.            call open file, (file17'-'number'.dat'),'W'
  1822.                 call writeln file, sendmen
  1823.                 call writeln file, sendfit
  1824.                 call writeln file, sendbat
  1825.                 call writeln file, sendcar
  1826.            call close file
  1827.           signal MAINMENU
  1828.         end
  1829. TACTA:
  1830.         if answer = 1 then do
  1831.                 say WHITE ' Current percentage of men is 'GREEN||sendmen'%.'
  1832.                 options prompt GREEN'  Enter new percentage ' WHITE '('RED'Do not include % sign'WHITE')> '
  1833.                 pull result
  1834.                 answer = upper(result) 
  1835.                 if answer>100 then signal TACTA
  1836.                 if answer<0 then signal TACTA
  1837.                 sendmen = answer
  1838.         end
  1839. TACTB:
  1840.         if answer = 2 then do
  1841.                 say WHITE' Current percentage of fighters is 'GREEN||sendfit'%.'
  1842.                 options prompt GREEN'  Enter new percentage 'WHITE'('RED'Do not include % sign'WHITE')> '
  1843.                 pull result
  1844.                 answer = upper(result)
  1845.                 if answer>100 then signal TACTB
  1846.                 if answer<0 then signal TACTB
  1847.                 sendfit = answer
  1848.         end
  1849. TACTC:
  1850.         if answer = 3 then do
  1851.                 say WHITE' Current percentage of battleships is 'GREEN||sendbat'%.'
  1852.                 options prompt GREEN'  Enter new percentage 'WHITE'('RED'Do not include % sign'WHITE')> '
  1853.                 pull result
  1854.                 answer = upper(result)
  1855.                 if answer>100 then signal TACTC
  1856.                 if answer<0 then signal TACTC
  1857.                 sendbat = answer
  1858.         end
  1859. TACTD:
  1860.         if answer = 4 then do
  1861.                 say WHITE' Current percentage of carriers is 'GREEN||sendcar'%.'
  1862.                 options prompt GREEN'  Enter new percentage 'WHITE'('RED'Do not include % sign'WHITE')> '
  1863.                 pull result
  1864.                 answer = upper(result)
  1865.                 if answer>100 then signal TACTD
  1866.                 if answer<0 then signal TACTD
  1867.                 sendcar = answer
  1868.         end
  1869. signal TACTICSM
  1870. BREAK_C:
  1871.    say RED'Carrier Dropped.  Returning to board.'
  1872. exit
  1873. exit
  1874.  
  1875. IOERR:
  1876.         say YELLOW'FATAL: 'RED'IO Error has been detected.  Please notify SysOp.'
  1877.         say '       Line number of detection: 'WHITE||SIGL
  1878.         say RED'              Severity of error: 'WHITE||RC
  1879.         say WHITE
  1880.         exit
  1881. exit
  1882. ERROR:
  1883.         say RED'IO ERROR in line: 'WHITE||sigl||RED'  Severity: 'WHITE||RC
  1884.         say YELLOW'Notify SysOp Immediately!!'
  1885.         say ' '
  1886.         say WHITE
  1887.         exit
  1888. exit
  1889. SYNTAX:
  1890.         say ' '; say ' '; say ' '
  1891.    say WHITE'FATAL: 'RED'Syntax error in line: 'WHITE||sigl
  1892.         say RED'         Severity of error : 'WHITE||RC
  1893.         say ' '
  1894.    say YELLOW'        Please notify SysOp immediately.'
  1895.         say ' '; say ' '; say ' '
  1896.    say LBLUE'Now saving/updating your records....'
  1897.    call YOUUPDTA
  1898.         call YOUUPDTB
  1899.    call open file, (file11),'R'
  1900.       members = readln(file)
  1901.    call close file
  1902.    call open file, (file11),'W'
  1903.       call writeln file, members
  1904.       call writeln file, msgnumber
  1905.    call close file
  1906.    call open file, (file15'-'number),'W'
  1907.       call writeln file, datz
  1908.                 call writeln file, wrtms
  1909.    call close file
  1910.    say GREEN'Thank you for playing 'WHITE'Stellar War v2.20.'
  1911. exit
  1912. exit
  1913. LEAVE: 
  1914.         say ' '; say ' '; say ' '
  1915.    say LBLUE'Now saving/updating your records....'
  1916.    call YOUUPDTA
  1917.         call YOUUPDTB
  1918.    call open file, (file11),'R'
  1919.       members = readln(file)
  1920.    call close file
  1921.    call open file, (file11),'W'
  1922.       call writeln file, members
  1923.       call writeln file, msgnumber
  1924.    call close file
  1925.    call open file, (file15'-'number),'W'
  1926.       call writeln file, datz
  1927.                 call writeln file, wrtms
  1928.    call close file
  1929.    say GREEN'Thank you for playing 'WHITE'Stellar War v2.00.'
  1930. QUESTSKIP:
  1931. exit
  1932. exit
  1933.  
  1934. LISTER:
  1935.    call open file, (file7),'R'
  1936.       do until eof(file)
  1937.          listname = readln(file)
  1938.          say ' 'listname
  1939.       end
  1940.    call close file
  1941.    options prompt BLUE'Press enter to continue.'
  1942.    pull result
  1943. RETURN
  1944.  
  1945. FIND:
  1946.    sflag = 0
  1947.    call open file, (file7),'R'
  1948.       count = 0
  1949.       do until eof(file)
  1950.          count = count + 1
  1951.          listname = readln(file)
  1952.          if upper(search) = upper(listname) then do
  1953.             sflag = 1
  1954.             signal FINDEX
  1955.          end
  1956.       end
  1957. FINDEX:
  1958.    call close file
  1959. RETURN
  1960.  
  1961. ATTRIBUTEA:
  1962.    call open file, (file6'-'count'.dat'),'R'
  1963.       bpop = readln(file)
  1964.       bmen = readln(file)
  1965.       bfit = readln(file)
  1966.       bcar = readln(file)
  1967.       bbat = readln(file)
  1968.       bwin = readln(file)
  1969.       blos = readln(file)
  1970.       bmor = readln(file)
  1971.    call close file
  1972. RETURN
  1973.  
  1974. ATTRIBUTEB:
  1975.    call open file, (file2'-'count'.dat'),'R'
  1976.       bpln = readln(file)
  1977.       bmes = readln(file)
  1978.       bpts = readln(file)
  1979.       bmny = readln(file)
  1980.    call close file
  1981. RETURN
  1982.  
  1983. WRTATTRA:
  1984.    call open file, (file6'-'count'.dat'),'W'
  1985.       call writeln file, bpop
  1986.       call writeln file, bmen
  1987.       call writeln file, bfit
  1988.       call writeln file, bcar /* was missing */
  1989.       call writeln file, bbat
  1990.       call writeln file, bwin
  1991.       call writeln file, blos
  1992.       call writeln file, bmor
  1993.    call close file
  1994. RETURN
  1995.  
  1996. WRTATTRB:
  1997.    call open file, (file2'-'count'.dat'),'W'
  1998.       call writeln file, bpln
  1999.       call writeln file, bmes
  2000.       call writeln file, bpts
  2001.       call writeln file, bmny
  2002.    call close file
  2003. RETURN
  2004.  
  2005. NOTIFY:
  2006.    call open file, (file13'-'count),'R'
  2007.       high = readln(file)
  2008.       if high = 0 then do
  2009.          call close file
  2010.          call open file, (file13'-'count),'W'
  2011.             call writeln file, msgnumber
  2012.             call writeln file, title
  2013.             call writeln file, handle
  2014.          call close file
  2015.          signal UPDATE
  2016.       end
  2017.    call close file
  2018.    call open file, (file13'-'count),'A'
  2019.       data = msgnumber
  2020.       call writeln file, data
  2021.       call writeln file, title
  2022.       call writeln file, handle
  2023.    call close file
  2024. UPDATE:
  2025.    messages = messages + 1
  2026.    call open file, (file11),'R'
  2027.       members = readln(file)
  2028.    call close file
  2029.    msgnumber = msgnumber + 1
  2030.    call open file, (file11),'W'
  2031.       call writeln file, members
  2032.       call writeln file, msgnumber
  2033.    call close file
  2034. RETURN
  2035.  
  2036. YOUUPDTA:
  2037.    call open file, (file2'-'number'.dat'),'W'
  2038.       call writeln file, planets
  2039.       call writeln file, messages
  2040.       call writeln file, points
  2041.       call writeln file, money
  2042.    call close file
  2043. RETURN
  2044.  
  2045. YOUUPDTB:
  2046.    call open file, (file6'-'number'.dat'),'W'
  2047.       call writeln file, population
  2048.       call writeln file, men
  2049.       call writeln file, fighters
  2050.       call writeln file, carriers
  2051.       call writeln file, battleships
  2052.       call writeln file, wins
  2053.       call writeln file, losses
  2054.       call writeln file, moral
  2055.    call close file
  2056. RETURN
  2057.  
  2058. SELFCHECK:
  2059.    flag = 0
  2060.    if upper(search) = upper(handle) then do
  2061.       flag = 1
  2062.       say RED' Pardon me, but I believe that is you...'
  2063.                 say ' '
  2064.       options prompt BLUE'Press enter to continue.'
  2065.       pull result
  2066.       end
  2067. RETURN
  2068.  
  2069. YOUATTRA:
  2070.    call open file, (file2'-'number'.dat'),'R'
  2071.       planets = readln(file)
  2072.       messages = readln(file)
  2073.       points = readln(file)
  2074.       money = readln(file)
  2075.    call close file
  2076. RETURN
  2077.  
  2078. YOUATTRB:
  2079.    call open file, (file6'-'number'.dat'),'R'
  2080.       population = readln(file)
  2081.       men = readln(file)
  2082.       fighters = readln(file)
  2083.       carriers = readln(file)
  2084.       battleships = readln(file)
  2085.       wins = readln(file)
  2086.       losses = readln(file)
  2087.       moral = readln(file)
  2088.    call close file
  2089. RETURN
  2090.  
  2091. TAXCOLLECT:
  2092.    collect = 0
  2093.    collected = collected + 1
  2094.    if collected > 2 then do
  2095.                 say CLS
  2096.       say WHITE' You have forced the population of your empire to REVOLT against'
  2097.       say ' your taxation.  The people have been taxed too many times this game period.'
  2098.       say ' The rallying mobs destroy many government buildings which you must repair.'
  2099.                 say ' '; say ' '
  2100.       cost = money * 0.30; cost = trunc(cost)
  2101.       say RED' Total cost to repair property: 'WHITEcost
  2102.       money = money - cost
  2103.       plays = plays + 1
  2104.                 say ' '; say ' '
  2105.       options prompt BLUE'Press enter to continue.'
  2106.       pull result
  2107.       return
  2108.    end
  2109.    collect = population*0.2; collect = trunc(collect)
  2110.    addition = random(1,50,time('s'))
  2111.    addition = addition * 100
  2112.    collect = collect + addition
  2113.         say CLS
  2114.    say LBLUE' The people wearily pay their taxes.  The total money received from the'
  2115.    say ' collection of taxes is: 'collect
  2116.    if collected = 2 then do
  2117.                 say ' '; say ' '
  2118.       say YELLOW' WARNING:  'GREEN'You have begun to overtax your population.  Be careful,'
  2119.       say '          they may try to revolt.'
  2120.    end
  2121.    money = money + collect
  2122.         say ' '; say ' '
  2123.    options prompt BLUE'Press enter to continue.'
  2124.    pull result
  2125. RETURN
  2126.