0 CLEAR200:DIMA(45),A$(45),C1,CC,M$:C1=RND(-(PEEK(9)*256+PEEK(10))):GOTO100
1 C1=1:CC=32
2 IFMID$(M$,CC,1)<>""ANDMID$(M$,CC,1)<>" "THENCC=CC-1:GOTO2
3 PRINTMID$(M$,C1,CC-C1):C1=CC+1:CC=C1+31:IFC1<=LEN(M$)THEN2
4 RETURN

5 PRINT"hit any key";
6 F$=INKEY$:IFF$=""THEN6
7 FORT=1TO11:PRINTCHR$(8);:NEXT:RETURN

100 A(1)=6500:A(2)=0:A(3)=50:A(4)=28:A(5)=350:A(6)=25:A(7)=0:A(8)=1:A(9)=0:A(10)=500:A(11)=0:A(42)=0:A(12)=0:EF=0:PF=0
120 A(13)=150:A(14)=50:A(15)=10:A(16)=35:A(17)=35:A(18)=15:A(19)=50:A(20)=0:A(21)=40:A(22)=0:A(23)=0:A(24)=0
REM INTEGERS
130 A(25)=6:A(26)=5:A(27)=2:A(28)=2:A(29)=2:A(30)=1:A(31)=2:A(32)=0:A(33)=2:A(34)=0:A(35)=0:A(36)=0
140 A(37)=0:A(38)=0:A(39)=0:A(40)=0:A(43)=0:A(44)=0:A(45)=0:X=0:Y=0:Z=0:A(41)=7:SA=0:LO=0
160 FORT=1TO45:READA$(T):NEXT:GOTO400

REM SAVE:
300 INPUT"ENTER SAVE FILENAME";F$:IFF$<>""THENCSAVE*A,F$
320 GOTO400
350 INPUT"ENTER LOAD FILENAME";F$:IFF$<>""THENCLOAD*A,F$
360 GOTO400

REM MAIN:
REM MENU:
400 CLS:PRINT"WELCOME TO MINISTRY! (V 4.2)":PRINT"MADE BY WESLEY MAY (2002)":PRINT"PLEASE CHOOSE AN OPTION BELOW:"
420 PRINT"1) START GAME":PRINT"2) SAVE GAME":PRINT"3) LOAD GAME":PRINT"4) CREDITS":PRINT"5) QUIT"
430 INPUTC:ONCGOTO500,300,350,7000,8000
440 GOTO400

REM ----------
REM START GAME
REM ----------

REM GAME:
500 IFA(42)<>0THEN540
520 M$="WHAT WILL YOUR EMPIRE'S SPECIALITY BE?":GOSUB1
530 PRINT"1) HORTICULTURE":PRINT"2) SCIENCE":PRINT"3) COMBAT":PRINT"4) POLITICS":PRINT"5) ROMANCE":INPUTC
540 IFC<1ORC>5THEN520
550 IFC=1THENA(42)=1:A(40)=A(40)+150
560 IFC=2THENA(42)=2
570 IFC=3THENA(42)=3:A(39)=A(39)+150
580 IFC=4THENA(42)=4:A(44)=A(44)+100:A(38)=A(38)+50
590 IFC=5THENA(42)=5:A(45)=A(45)+150

REM ------------------
REM START USER CONTROL

REM CONTROL:
600 PRINT"HOW WILL YOU MANAGE YOUR TOWN?"
620 PRINT"1) CONSTRUCT BUILDINGS":PRINT"2) TRAIN WORKERS":PRINT"3) UTILIZE UNITS/BUILDINGS"
630 PRINT"4) EXPLORE NEW LAND":PRINT"5) EMPIRE STATUS":PRINT"6) END DAY":PRINT"7) BACK TO MAIN"
640 INPUTC:ONCGOTO650,720,970,820,860,2000,400:GOTO600

REM BUILD:
650 PRINT"WHAT WOULD YOU LIKE TO BUILD?"
660 PRINT"1) HOUSES          (500/10)":PRINT"2) FARMS           (500/15)":PRINT"3) LUMBERYARDS     (500/15)"
670 PRINT"4) POLICE STATIONS (1000/20)":PRINT"5) FIRE STATIONS   (1000/20)":PRINT"6) UNIVERSITIES    (1750/25)"
675 PRINT"7) BARRACKS        (2000/30)":PRINT"8) BANKS           (2500/30)":PRINT"9) HOSPITALS       (2000/30)"
680 PRINT"10) MARKETPLACES   (3000/45)":PRINT"11) TEMPLES        (1750/35)":PRINT"12) EMBASSIES      (2750/40)"
690 PRINT"TYPE '0' FOR EMPIRE MENU":INPUTC:IFC<1ORC>12THEN600
691 I=C+24:M$="HOW MANY "+A$(I)+" WOULD YOU LIKE TO BUILD?":GOSUB1:INPUTC:IFC<1THEN600
692 ONI-24GOSUB701,703,703,705,705,706,707,708,709,710,711,712
693 IFX>A(1)THENM$="YOU NEED"+STR$(X)+" ZEN. YOU ONLY HAVE"+STR$(A(1)):GOSUB1:GOTO600
694 IFY>A(6)THENM$="YOU NEED"+STR$(Y)+" LUMBER. YOU ONLY HAVE"+STR$(A(6)):GOSUB1:GOTO600
695 IFC>A(4)THENM$="YOU NEED"+STR$(C)+" FREE LAND. YOU ONLY HAVE"+STR$(A(4)):GOSUB1:GOTO600
696 A(I)=A(I)+C:A(1)=A(1)-X:A(6)=A(6)-Y:A(4)=A(4)-C
697 IFC>1THENM$="YOU HAVE SUCCESSFULLY CONSTRUCTED"+STR$(C)+" "+A$(I)+".":GOSUB1:GOSUB5:GOTO600
698 M$="YOU HAVE SUCCESSFULLY CONSTRUCTED A "+LEFT$(A$(I),LEN(A$(I))-1)+".":GOSUB1:GOSUB5:GOTO600
REM -------------

701 X=500*C:Y=10*C:RETURN
703 X=500*C:Y=15*C:RETURN
705 X=1000*C:Y=20*C:RETURN
706 X=1750*C:Y=25*C:RETURN
707 X=2000*C:Y=30*C:RETURN
708 X=2500*C:Y=30*C:RETURN
709 X=2000*C:Y=20*C:RETURN
710 X=3000*C:Y=45*C:RETURN
711 X=1750*C:Y=35*C:RETURN
712 X=2750*C:Y=40*C:RETURN

REM -------------
REM -------------
REM END OF BUILD CONTROL


REM -------------
REM TRAIN:

720 PRINT"WHAT WOULD YOU LIKE TO TRAIN?"
730 PRINT"1) FARMERS      (50)":PRINT"2) LUMBERJACKS  (50)":PRINT"3) OFFICERS     (80)"
740 PRINT"4) FIREFIGHTERS (80)":PRINT"5) SCHOLARS     (110)":PRINT"6) TROOPS       (150)"
750 PRINT"7) BANKERS      (135)":PRINT"8) DOCTORS      (170)":PRINT"9) MERCHANTS    (120)"
760 PRINT"10) PRIESTS     (130)":PRINT"11) POLITICIANS (160)":INPUT"TYPE '0' FOR EMPIRE MENU";C:IFC<1ORC>11THEN600
770 I=C+13:M$="HOW MANY "+A$(I)+" WOULD YOU LIKE TO TRAIN?":GOSUB1:INPUTC:IFC<1THEN600
780 ONI-13GOSUB801,801,803,803,805,806,807,808,809,810,811
790 IFX>A(1)THENM$="YOU NEED"+STR$(X)+" ZEN. YOU ONLY HAVE"+STR$(A(1)):GOSUB1:GOTO600
791 IFC>A(13)THENM$="YOU NEED"+STR$(C)+" CIVILIANS. YOU ONLY HAVE"+STR$(A(13)):GOSUB1:GOTO600
792 A(I)=A(I)+C:A(1)=A(1)-X:A(13)=INT(A(13)-C)
793 IFC>1THENM$="YOU HAVE SUCCESSFULLY TRAINED "+STR$(C)+" "+A$(I)+"!":GOSUB1:GOSUB5:GOTO600
794 M$="YOU HAVE SUCCESSFULLY TRAINED A "+LEFT$(A$(I),LEN(A$(I))-1)+"!":GOSUB1:GOSUB5:GOTO600


REM -------------

801 X=50*C:RETURN
803 X=80*C:RETURN
805 X=110*C:RETURN
806 X=150*C:RETURN
807 X=135*C:RETURN
808 X=170*C:RETURN
809 X=120*C:RETURN
810 X=130*C:RETURN
811 X=160*C:RETURN

REM -------------
REM END OF TRAIN CONTROL

REM EXPLORE:
820 X=A(3)+50:M$="IT WILL COST YOU"+STR$(X)+" ZEN FOR EACH LAND YOU EXPLORE.":GOSUB1
830 M$="HOW MUCH LAND SHOULD YOUR SCOUT EXPLORE?":GOSUB1:INPUTC
840 Y=C*X:IFY>A(1)THENM$="IT WILL COST"+STR$(Y)+" ZEN TO EXPLORE THAT MUCH. YOU ONLY HAVE"+STR$(A(1)):GOSUB1:GOTO600
850 A(1)=A(1)-Y:A(9)=A(9)+C:M$="YOU WILL HAVE"+STR$(A(9))+" MORE LAND TOMORROW.":GOSUB1:GOTO600

REM END OF EXPLORE CONTROL


REM STATUS:

860 PRINT"WHICH REPORT DO YOU WANT TO SEE?";:PRINT"1) GENERAL INFORMATION":PRINT"2) BUILDINGS AND UNITS"
870 PRINT"3) RESEARCH":PRINT"4) RESOURCE FLOW":PRINT"5) DISASTERS":INPUTC:IFC<1ORC>5THEN600
880 ONCGOTO910,915,930,940,950
910 PRINT"EMPIRE STATUS:":PRINT"DAY",A(8):PRINT"ZEN",A(1):PRINT"NETWORTH",A(2):PRINT"TOTAL LAND",A(3):PRINT"FREE LAND",A(4)
911 PRINT"CIVILIANS",A(13):PRINT"PROTECTION",A(41):PRINT"FOOD",A(5):PRINT"LUMBER",A(6):GOSUB5:GOTO600

915 PRINT"HOUSES      "A(25)TAB(18)STR$(A(13))"/"MID$(STR$(A(10)),2)
916 PRINT"FARMS       "A(26)TAB(18)STR$(A(14))"/"MID$(STR$(A(26)*50),2)
917 PRINT"LUMBERYARDS "A(27)TAB(18)STR$(A(15))"/"MID$(STR$(A(27)*50),2)
918 PRINT"POLICE STNS "A(28)TAB(18)STR$(A(16))"/"MID$(STR$(A(28)*50),2)
919 PRINT"FIRE STNS   "A(29)TAB(18)STR$(A(17))"/"MID$(STR$(A(29)*50),2)
920 PRINT"UNIVERSITIES"A(30)TAB(18)STR$(A(18))"/"MID$(STR$(A(30)*50),2)
921 PRINT"BARRACKS    "A(31)TAB(18)STR$(A(19))"/"MID$(STR$(A(31)*50),2)
922 PRINT"BANKS       "A(32)TAB(18)STR$(A(20))"/"MID$(STR$(A(32)*50),2)
923 PRINT"HOSPITALS   "A(33)TAB(18)STR$(A(21))"/"MID$(STR$(A(33)*50),2)
924 PRINT"MARKETPLACES"A(34)TAB(18)STR$(A(22))"/"MID$(STR$(A(34)*50),2)
925 PRINT"TEMPLES     "A(35)TAB(18)STR$(A(23))"/"MID$(STR$(A(35)*50),2)
926 PRINT"EMBASSIES   "A(36)TAB(18)STR$(A(24))"/"MID$(STR$(A(36)*50),2):GOSUB5:GOTO600

930 PRINT"SPARE RP   "A(7):PRINT"HOUSING LV "A(37):PRINT"ECONOMY LV "A(38):PRINT"COMBAT LV  "A(39)
931 PRINT"HORT LV    "A(40):PRINT"RELIGION LV"A(43):PRINT"POLITICS LV"A(44):PRINT"ROMANCE LV "A(45):GOSUB5:GOTO600

940 PRINT"FOOD GAIN",A(14)-INT(A(13)/4):PRINT"LUMBER GAIN",A(15):PRINT"RP GAIN",A(18):PRINT"ZEN GAIN",A(13)*5
941 PRINT"MAX. CIVILIANS",A(25)*50:GOSUB5:GOTO600

950 X=INT(A(13)/4):IFA(16)>XTHENPRINT"ANGRY MOB: CONTROLLED"
951 IFA(16)<=XTHENM$="ANGRY MOB: POSSIBLE ("+MID$(STR$(A(16)),2)+"/"+MID$(STR$(X),2)+")":GOSUB1
952 X=INT(A(25)*4):IFA(17)>XTHENPRINT"ARSON: CONTROLLED"
953 IFA(17)<=XTHENM$="ARSON: POSSIBLE ("+MID$(STR$(A(17)),2)+"/"+MID$(STR$(X),2)+")":GOSUB1
954 X=INT(A(30)*7):IFA(16)>XTHENPRINT"SABOTAGE: CONTROLLED"
955 IFA(16)<=XTHENM$="SABOTAGE: POSSIBLE ("+MID$(STR$(A(16)),2)+"/"+MID$(STR$(X),2)+")":GOSUB1
956 X=INT(A(32)*5):IFA(16)>XTHENPRINT"ROBBERY: CONTROLLED"
957 IFA(16)<=XTHENM$="ROBBERY: POSSIBLE ("+MID$(STR$(A(16)),2)+"/"+MID$(STR$(X),2)+")":GOSUB1
958 X=INT(A(13)/7):IFA(21)>XTHENPRINT"PLAGUE: CONTROLLED":GOSUB5:GOTO600
959 M$="PLAGUE: POSSIBLE ("+MID$(STR$(A(21)),2)+"/"+MID$(STR$(X),2)+")":GOSUB1:GOSUB5:GOTO600

REM END OF STATUS CONTROL

REM UTIL:

970 PRINT"WHAT WOULD YOU LIKE TO DO?":PRINT"1) RESEARCH":PRINT"2) ATTACK":PRINT"3) CONVERT":PRINT"4) BANKING"
980 INPUT"TYPE '0' FOR EMPIRE MENU";C:IFC<1ORC>5THEN600
990 ONCGOTO1000,1100,1200,1300,1400

995 M$="HOW MANY MORE POINTS WILL YOU PUT INTO "+A$(I)+"?":GOSUB1:INPUTC:IFC<1THEN970
996 IFC>A(7)THENM$="YOU DON'T HAVE THAT MANY RESEARCH POINTS LEFT.":GOSUB1:GOTO1000
997 A(7)=A(7)-C:A(I)=A(I)+C

1000 M$="WHAT WOULD YOU LIKE TO DO MORE RESEARCH ON?":GOSUB1
1001 PRINT"1) HOUSING":PRINT"2) ECONOMY":PRINT"3) COMBAT":PRINT"4) HORTICULTURE":PRINT"5) RELIGION":PRINT"6) POLITICS"
1002 PRINT"7) ROMANCE":PRINT"8) CHECK CURRENT RESEARCH":M$="YOU HAVE"+STR$(A(7))+" RESEARCH POINTS.":GOSUB1
1003 INPUT"TYPE '0' FOR EMPIRE MENU";C:IFC<1ORC>8THEN600
1004 IFC>4ANDC<8THENI=C+2+36:GOTO1006
1005 I=C+36
1006 IFC<8THENM$="YOU HAVE"+STR$(A(I))+" RESEARCH POINTS IN "+A$(I):GOSUB1
1007 ONCGOTO1010,1020,1030,1040,1050,1060,1070,1080:GOTO600

REM -------------

1010 M$="YOU HAVE A"+STR$(INT((A(I)/100)*1000)/1000)+"% BONUS TO YOUR MAXIMUM POPULATION.":GOSUB1:GOTO995

REM -------------

1020 M$="YOU HAVE A"+STR$(INT((A(I)/100)*1000)/1000)+"% BONUS TO YOUR TAX REVENUE.":GOSUB1:GOTO995

REM -------------

1030 M$="YOU HAVE A"+STR$(INT((A(I)/100)*1000)/1000)+"% BONUS TO YOUR COMBAT POWER.":GOSUB1:GOTO995

REM -------------

1040 M$="YOU HAVE A"+STR$(INT((A(I)/100)*1000)/1000)+"% BONUS TO YOUR FOOD/LUMBER PRODUCTION.":GOSUB1:GOTO995

REM -------------

1050 M$="YOU HAVE A"+STR$(INT((A(I)/100)*1000)/1000)+"% BONUS TO YOUR CONVERSION RATE.":GOSUB1:GOTO995

REM -------------

1060 M$="YOU HAVE A"+STR$(INT((A(I)/100)*1000)/1000)+"% BONUS TO YOUR PROTECTION.":GOSUB1:GOTO995

REM -------------

1070 M$="YOU HAVE A"+STR$(INT((A(I)/100)*1000)/1000)+"% BONUS TO YOUR REPRODUCTION.":GOSUB1:GOTO995

REM -------------

1080 PRINT"RESEARCH STATUS:"
1081 PRINT"HOUSING      "STR$(INT((A(37)/100)*1000)/1000)"%"
1082 PRINT"ECONOMY      "STR$(INT((A(38)/100)*1000)/1000)"%"
1083 PRINT"COMBAT       "STR$(INT((A(39)/100)*1000)/1000)"%"
1084 PRINT"HORTICULTURE "STR$(INT((A(40)/100)*1000)/1000)"%"
1085 PRINT"RELIGION     "STR$(INT((A(43)/100)*1000)/1000)"%"
1086 PRINT"POLITICS     "STR$(INT((A(44)/100)*1000)/1000)"%"
1087 PRINT"ROMANCE      "STR$(INT((A(45)/100)*1000)/1000)"%":GOSUB5:GOTO1000

REM -------------

1100 M$="YOU SEND YOUR TROOPS TO ATTACK THE ENEMY!!":GOSUB1:EF=RND(A(13)):Y=RND(15):Z=EF*Y:Z=Z/100:EF=EF+Z:EF=INT(EF+A(12))
1120 M$="YOU ATTACK WITH"+STR$(A(19))+" TROOPS!":GOSUB1:M$="THE ENEMY DEFENDS WITH"+STR$(EF)+" TROOPS!":GOSUB1
1130 PF=A(19):Y=RND(15):Z=PF*Y:Z=INT(Z/100):PF=PF+Z:Y=A(39)/100:Z=PF*Y:Z=Z/100:PF=INT(PF+Z)
1140 IFA(42)=3THENX=A(19)/20:PF=INT(PF+X)
1150 M$="WITH BONUSES YOUR"+STR$(A(19))+" TROOPS HAVE THE POWER OF"+STR$(PF)+"!":GOSUB1
1151 GOSUB5:IFPF<=EFTHEN1180
1160 PRINT"YOU WIN THE BATTLE!!":X=INT(A(19)/2):A(19)=A(19)-X
1161 M$=MID$(STR$(X),2)+" OF YOUR TROOPS WERE KILLED.":GOSUB1:Y=PF-EF:Z=INT(Y/10):A(4)=A(4)+Z:A(3)=A(3)+Z
1162 M$="YOU TOOK CONTROL OF"+STR$(Z)+" LAND!":GOSUB1:Z=Y*50:IFZ>A(1)THENZ=A(1)
1163 A(1)=A(1)-Z:M$=MID$(STR$(Z),2)+" ZEN WAS STOLEN FROM THE ENEMY!":GOSUB1
1164 Y=RND(250):A(39)=A(39)+Y:M$="OUR TROOPS GAINED"+STR$(Y)+" BATTLE EXPERIENCE!":GOSUB1
1165 Z=RND(3):A(12)=A(12)+Z:GOTO1184

1180 M$="YOU LOST THE BATTLE...":GOSUB1
1181 X=INT(EF/2):IFX>A(19)THENX=A(19)
1182 A(19)=A(19)-X:M$=MID$(STR$(X),2)+" OF YOUR TROOPS DIED IN THE BATTLE.":GOSUB1
1183 IFA(19)<0THENA(19)=0
1184 GOSUB5:GOTO600

REM --------

1200 IFA(23)<1THENPRINT"YOU DON'T HAVE ANY PRIESTS.":GOTO600
1220 M$="YOU SEND"+STR$(A(23))+" PRIESTS TO CONVERT ENEMY CIVILIANS.":GOSUB1
1230 Z=0:FORX=A(23)TO1STEP-1:Y=RND(100):IFY<75THENZ=Z+1
1240 NEXT:Y=A(43)/100:X=Z*Y:X=INT(X/100):Z=Z+X:M$="YOU MANAGE TO CONVERT"+STR$(Z)+" CIVILIANS!":GOSUB1
1250 A(13)=INT(A(13)+Z):X=A(23)-Z:IFX<0THENX=0
1260 M$=MID$(STR$(X),2)+" PRIESTS WERE CAPTURED BY THE ENEMY.":GOSUB1:A(23)=A(23)-X:GOSUB5:GOTO600

REM --------
REM --------

1300 PRINT"WHAT WOULD YOU LIKE TO DO?":PRINT"1) DEPOSIT MONEY":PRINT"2) WITHDRAW MONEY":PRINT"3) BANK STATUS"
1301 INPUT"TYPE '0' FOR EMPIRE MENU";C:IFC<1ORC>3THEN600
1302 ONCGOTO1310,1320,1330
1310 M$="YOU HAVE"+STR$(A(11))+" ZEN IN THE BANK.":GOSUB1:M$="YOU CAN HOLD"+STR$(A(32)*5000)+" ZEN IN TOTAL.":GOSUB1
1311 M$="YOU HAVE"+STR$(A(1))+" ZEN ON HAND.":GOSUB1:INPUT"HOW MUCH WILL YOU DEPOSIT";C:IFC<1THEN600
1312 X=A(32)*5000:Y=C+A(11):IFY>XTHENM$="YOU DON'T HAVE THAT MUCH ROOM IN THE BANK.":GOSUB1:GOTO600
1313 IFC>A(1)THENM$="YOU DON'T HAVE THAT MUCH MONEY":GOSUB1:GOTO600
1314 A(11)=A(11)+C:A(1)=A(1)-C:GOTO600
1320 M$="YOU HAVE"+STR$(A(11))+" ZEN IN THE BANK.":GOSUB1:M$="YOU HAVE"+STR$(A(1))+" ZEN ON HAND.":GOSUB1
1321 INPUT"HOW MUCH WILL YOU WITHDRAW";C:IFC<1THEN600
1322 IFC>A(11)THENM$="YOU DON'T HAVE THAT MUCH MONEY IN THE BANK.":GOSUB1:GOTO600
1323 A(11)=A(11)-C:A(1)=A(1)+C:GOTO600
1330 PRINT"BANK STATUS:":PRINT"GOLD IN BANK",A(11):PRINT"DAILY INTEREST",
1331 Z=0:IFA(11)<=1000THEN1333
1332 X=A(11):Y=(A(20)*100)/(A(32)*50):Z=X*Y:Z=Z/1000:Z=INT(Z*100)/100:IFZ<0THENZ=Z*-1:GOTO1333
1333 PRINTZ:GOSUB5:GOTO600

REM END OF UTILIZE CONTROL

REM END USER CONTROL
REM ------------------

REM ------------         
REM START UPKEEP

REM ENDDAY:

2000 PRINT"DAILY REPORT:"

REM PHASE 1: DISASTER
2010 CC=0:X=A(13)/4:IFA(16)>=XTHEN2020
2012 Y=RND(100)
2013 IFY<20THENZ=INT(A(26)/5):IFZ>0THENA(26)=A(26)-Z:M$=MID$(STR$(Z),2)+" OF YOUR FARMS WERE DESTROYED BY AN ANGRY MOB.":GOSUB1
2020 X=A(25)*4:IFA(17)>=XTHEN2030
2021 Y=RND(100)
2022 IFY<20THENZ=INT(A(25)/6):IFZ>0THENA(25)=A(25)-Z:M$=MID$(STR$(Z),2)+" OF YOUR HOUSES WERE DESTROYED BY AN ARSON.":GOSUB1
2030 X=A(30)*7:IFA(16)>=XTHEN2060
2031 Y=RND(100):IFY>=10THEN2060
2032 FORT=37TO45:IFT=41ORT=42THENNEXT
2040 IFA(T)<=0THEN2050
2041 Z=INT(RND(A(T)/3)):A(T)=A(T)-Z:M$=MID$(STR$(Z),2)+" OF YOUR RESEARCH POINTS IN "+A$(T)+" WERE SABOTAGED.":GOSUB1
2050 NEXT
2060 X=A(32)*5:IFA(16)>=XTHEN2100
2070 Y=RND(100):IFY<10THENZ=INT(A(1)/4):A(1)=A(1)-Z:M$=MID$(STR$(Z),2)+" ZEN WAS STOLEN.":GOSUB1
2100 X=A(13)/7:IFA(21)>=XTHEN2105
2101 Y=RND(100)
2102 IFY<5THENZ=INT(A(13)/3):A(13)=INT(A(13)-Z):M$=MID$(STR$(Z),2)+" OF YOUR CIVILIANS WERE KILLED BY A PLAGUE.":GOSUB1
2105 IFCCTHENGOSUB5

REM PHASE 2: PRODUCE
2110 CC=0:A(3)=A(3)+A(9):A(4)=A(4)+A(9):M$="YOUR SCOUT EXPLORED"+STR$(A(9))+" LAND.":GOSUB1
2120 A(9)=0:X=A(13)*5:Y=A(13)/5:IFY>A(13)THENX=A(13)*7
2130 Y=A(13)/3:IFY>A(13)THENX=A(13)*9
2140 IFA(22)>A(13)THENX=A(13)*11
2150 Z=A(2)/10000:X=X+Z:Y=A(38)/100:Z=X*Y:Z=Z/100:Y=INT(Z+X):A(1)=A(1)+Y:M$="YOU GOT"+STR$(Y)+" ZEN IN TAX REVENUE.":GOSUB1
2160 X=A(13)/4:IFA(5)>XTHENA(5)=INT(A(5)-X):GOTO2180
2170 Y=X-A(5):Z=Y*4:M$=MID$(STR$(Z),2)+" CIVILIANS DIED OF STARVATION.":GOSUB1:A(5)=0
2180 X=A(13)/20:X=X+1:Y=A(45)/100:Z=X*Y:Z=Z/100:X=INT(X+Z):A(13)=INT(A(13)+X)
2181 M$=MID$(STR$(X),2)+" MORE CIVILIANS WERE BORN.":GOSUB1
2190 X=A(15):Y=A(40)/100:Z=X*Y:Z=Z/100:Y=INT(Z+X):A(6)=A(6)+Y:M$="YOU GOT"+STR$(Y)+" MORE LUMBER.":GOSUB1
2200 X=A(14):Y=A(40)/100:Z=X*Y:Z=Z/100:Y=INT(Z+X):IFA(42)=1THENZ=Y/20:Y=INT(Y+Z)
2210 A(5)=A(5)+Y:M$="YOU GOT"+STR$(Y)+" MORE FOOD.":GOSUB1
2220 X=A(18):IFA(42)=2THENY=A(18)/20:X=INT(X+Y)
2230 A(7)=A(7)+X:M$="YOU GOT"+STR$(X)+" MORE RESEARCH POINTS.":GOSUB1
2240 IFA(11)<=1000THEN2270
2250 X=A(11):Y=(A(20)*100)/(A(32)*50):Z=X*Y:Z=Z/1000:Z=INT(Z*100)/100:IFZ<0THENZ=Z*-1
2260 A(11)=X+Z:M$="YOU GOT"+STR$(Z)+" ZEN IN BANK INTEREST.":GOSUB1:X=A(32)*5000:IFA(11)>XTHENA(11)=X
2270 IFCCTHENGOSUB5

REM PHASE 3: OVERMAX

2300 CC=0:FORT=14TO24:X=A(T+12)*50:IFA(T)<=XTHEN2320
2301 Y=A(T)-X:A(T)=A(T)-Y:A(13)=INT(A(13)+Y)
2302 M$=MID$(STR$(Y),2)+" "+A$(T)+" WERE UNEMPLOYED DUE TO LACK OF "+A$(T+12)+".":GOSUB1
2310 X=A(T+13)*50
2320 NEXT
2330 X=A(25)*50:Y=INT(A(37)/100):Z=X*Y:Z=INT(Z/100):A(10)=Z+X:IFA(13)<=A(10)THEN2345
2340 Y=INT(A(13)-A(10)):A(13)=INT(A(13)-Y):M$=MID$(STR$(Y),2)+" CIVILIANS DIED DUE TO LACK OF SHELTER.":GOSUB1
2345 IFCCTHENGOSUB5

REM PHASE 4: COMBAT

2350 CC=0:IFA(41)>=1THEN2400
2351 X=RND(100):IFX>=20THEN2400
2352 M$="YOU WERE ATTACKED BY ENEMY FORCES!!":GOSUB1:EF=RND(A(13)):Y=RND(15):Z=EF*Y:Z=Z/100:EF=EF+Z:EF=INT(EF+A(12))
2353 M$="THE ENEMY ATTACKED WITH"+STR$(EF)+" TROOPS!":GOSUB1:M$="YOU DEFEND WITH"+STR$(A(19))+" TROOPS!":GOSUB1
2354 PF=A(19):Y=RND(15):Z=PF*Y:Z=Z/100:PF=PF+Z:Y=A(39)/100:Z=PF*Y:Z=Z/100:PF=INT(PF+Z)
2355 IFA(42)=3THENX=A(19)/20:PF=INT(PF+X)
2356 M$="WITH BONUSES YOUR"+STR$(A(19))+" TROOPS HAVE THE POWER OF"+STR$(PF)+"!":GOSUB1
2360 GOSUB5:IFEF<=PFTHEN2380
2361 PRINT"YOU LOSE THE BATTLE...":A(41)=2:X=INT(A(19)/2):A(19)=A(19)-X:M$=MID$(STR$(X),2)+" TROOPS WERE KILLED.":GOSUB1
2362 Y=EF-PF:IFY>A(13)THENY=A(13)
2363 A(13)=INT(A(13)-Y):M$=MID$(STR$(Y),2)+" CIVILIANS WERE KILLED.":GOSUB1:X=Y/8:A(41)=A(41)+X:Z=INT(Y/10):IFZ>A(4)THENZ=A(4)
2364 A(4)=A(4)-Z:A(3)=A(3)-Z:M$="THE ENEMY TOOK CONTROL OF"+STR$(Z)+" LAND.":GOSUB1
2365 Z=Y*50:IFZ>A(1)THENZ=A(1)
2366 A(1)=A(1)-Z:M$=MID$(STR$(Z),2)+" ZEN WAS STOLEN BY THE ENEMY.":GOSUB1
2367 Z=0:FORX=A(24)TO1STEP-1:Y=RND(100):IFY<3THENZ=Z+1
2368 NEXT
2370 A(41)=A(41)+Z:IFA(42)=4THENA(41)=A(41)+1
2371 Y=A(44)/100:Z=X*Y:Z=Z/100:A(41)=INT(A(41)+Z):M$="YOU WERE PUT INTO PROTECTION FOR"+STR$(A(41))+" DAYS.":GOSUB1
2372 GOTO2399
2380 M$="YOU SUCCESSFULLY DEFEND YOUR TERRITORY!!":GOSUB1:X=INT(EF/2):A(19)=A(19)-EF
2381 M$=MID$(STR$(X),2)+" OF YOUR TROOPS DIED IN THE BATTLE.":GOSUB1
2382 Y=RND(250):A(39)=A(39)+Y:M$="OUR TROOPS GAINED"+STR$(Y)+" BATTLE EXPERIENCE!":GOSUB1
2383 Z=RND(3):A(12)=A(12)+Z
2399 IFCCTHENGOSUB5

REM PHASE 5: NETWORTH CALCULATION
2400 A(2)=0:FORT=25TO36:A(2)=A(2)+A(T):NEXT:A(2)=A(2)*50
2410 X=0:FORT=14TO24:X=X+A(T):NEXT:X=X*2
2410 A(2)=A(2)+X:A(2)=A(2)+A(13):A(2)=A(2)+(A(5)/3):A(2)=A(2)+(A(6)/2):X=A(4)*5:A(2)=A(2)+X:A(8)=A(8)+1
2420 A(2)=A(2)*100:A(2)=INT(A(2)):A(2)=A(2)/100:IFA(41)>0THENA(41)=A(41)-1
2430 GOTO600
REM END UPKEEP
REM ------------


REM --------
REM END GAME
REM --------
REM CREDITS:

7000 M$="CONCEPT, PROGRAMMING, AND BASICALLY ALMOST EVERYTHING: WESLEY MAY":GOSUB1:PRINT"SPECIAL THANKS TO:"
7020 M$="JORDAN M., FOR LETTING ME TAKE YOUR IDEAS.":GOSUB1:M$="PETER NEUFELD, FOR FINDING SOME BUGS.":GOSUB1
7030 M$="CONVERSION TO MICRO COLOR BASIC: JIM GERRIE":GOSUB1:GOSUB5:GOTO400

REM QUIT:
8000 END

9000 DATA ZEN,NETWORTH,LAND,FLAND,FOOD,LUMBER,RESPOINTS,DAYS,EXPLORE,MAXPOP,BANKED,EBONUS,POP,FARMERS,LUMBERJACKS
9010 DATA OFFICERS,FIREFIGHTERS,SCHOLARS,TROOPS,BANKERS,DOCTORS,MERCHANTS,PRIESTS,POLITICIANS,HOUSES,FARMS,LUMBERYARDS
9020 DATA "POLICE STATIONS","FIRE STATIONS",UNIVERSITIES,BARRACKS,BANKS,HOSPITALS,MARKETPLACES,TEMPLES,EMBASSIES
9030 DATA HOUSING,ECONOMY,COMBAT,HORTICULTURE,PROTECT,TYPE,RELIGION,POLITICS,ROMANCE

REM 1 ZEN
REM 2 NETWORTH
REM 3 LAND
REM 4 FLAND
REM 5 FOOD
REM 6 LUMBER
REM 7 RESPOINTS
REM 8 DAYS
REM 9 EXPLORE
REM 10 MAXPOP
REM 11 BANKED
REM 12 EBONUS
REM 13 POP
REM 14 FARMERS
REM 15 LUMBERJACKS
REM 16 OFFICERS
REM 17 FIREFIGHTERS
REM 18 SCHOLARS
REM 19 TROOPS
REM 20 BANKERS
REM 21 DOCTORS
REM 22 MERCHANTS
REM 23 PRIESTS
REM 24 POLITICIANS
REM 25 HOUSES
REM 26 FARMS
REM 27 LUMBERYARDS
REM 28 PS
REM 29 FS
REM 30 UNIVERSITIES
REM 31 BARRACKS
REM 32 BANKS
REM 33 HOSPITALS
REM 34 MARKETPLACES
REM 35 TEMPLES
REM 36 EMBASSIES
REM 37 HOUSING
REM 38 ECONOMY
REM 39 COMBAT
REM 40 HORTICULTURE
REM 41 PROTECT
REM 42 TYPE
REM 43 RELIGION
REM 44 POLITICS
REM 45 ROMANCE
