{$I-} program Business; uses crt,dos; var ge : array[1..5] of word; {good events} be : array[1..4] of word; {bad events} var money,capital,precap,nalsum,contractsum,enddate,l,l2 : longint; popul,pro1,pro2 : integer; status,year,month,day,shops,super,banks,firms,comp,menu,c1,c2,lastday,lastmonth,lastyear : word; sgn1,sgn2,sgn3,sgn4,sgn5,sgn6,build,buildtime,contract,a,b,c : word; quit,load,play : boolean; x,y,guess,punkt,punkt2,level:Byte;otvet,cont:Boolean;ch,button:char; label menugame,newgame,loadgame,main,cont2,cont3,cont4,m1,m2,m3,m4,sm,sm1,sm2; {Procedures and functions} procedure makewin(x1,y1,x2,y2,back,frame:byte;mess:String); {makes window with double frame} var i,j:Byte; begin textattr:=(back*16)+frame; gotoxy(x1,y1); write(#201); for i:=x1+1 to x2-1 do write(#205); write(#187); for i:=y1+1 to y2-1 do begin gotoxy(x1,i); write(#186); for j:=x1+1 to x2-1 do write(' '); write(#186); end; gotoxy(x1,y2); write(#200); for i:=x1+1 to x2-1 do write(#205); write(#188); j:=(x1+(x2-x1) div 2) - (Length(mess) div 2); gotoxy(j,y1); write(mess); end; procedure makewin2(x1,y1,x2,y2,back,front:Byte;mess:String); {makes simple window} var i,j:Byte; begin textattr:=(back*16)+front; gotoxy(x1,y1); write(#218); gotoxy(x2,y1); write(#191); gotoxy(x1,y2); write(#192); gotoxy(x2,y2); write(#217); for i:=x1+1 to x2-1 do begin gotoxy(i,y1); write(#196); end; for j:=y1+1 to y2-1 do begin gotoxy(x1,j); write(#179); for i:=x1+1 to x2-1 do write(' '); write(#179); end; for i:=x1+1 to x2-1 do begin gotoxy(i,y2); write(#196); end; j:=(x1+(x2-x1) div 2) - (Length(mess) div 2); gotoxy(j,y1); write(mess); end; procedure setupscreen;{screen at the start} begin TextAttr:=(cyan*16)+darkgray; ClrScr; HighVideo; end; procedure writeat(x,y,text,back:Byte;sentence:String); {writes text in any place of screen} begin textcolor(text); textbackground(back); gotoxy(x,y); write(sentence); end; procedure ImagePunkt;forward; procedure Key;forward; procedure game; forward; procedure setupscreen2;{winning} begin TextAttr:=(green*16)+darkgray; ClrScr; HighVideo; end; procedure Rules;{help} begin setupscreen; makewin2(18,7,62,20,0,0,''); makewin2(16,6,60,19,6,6,''); writeat(19,8,9,6,'WELCOME TO MY GAME!');textcolor(yellow); write(' ..::BUSINESS::..'); writeat(31,10,15,6,'Rules:'); writeat(19,12,11,6,'This game is economical strategy. At the'); writeat(19,13,11,6,'start you have some money, and your mis-'); writeat(19,14,11,6,'sion is that you have to make your own'); writeat(19,15,11,6,'business and upgrade your reputation. You'); writeat(19,16,11,6,'must get 8th status during 20 months. All'); writeat(19,17,11,6,'management of the game is at the menu.'); readkey; setupscreen; makewin(17,6,60,20,0,15,''); ImagePunkt; end; procedure ImagePunkt;{lightning of the chosen punkt} begin makewin2(25,9,53,17,2,4,'-=MENU=- '); textcolor(15); if punkt=1 then textbackground(1) else textbackground(2); gotoxy(30,11);write(' START THE GAME '); if punkt=2 then textbackground(1) else textbackground(2); gotoxy(30,12);write(' HELP '); if punkt=3 then textbackground(1) else textbackground(2); gotoxy(30,13);write(' QUIT '); end; procedure Key; var ch:Char; begin While true do begin ch:=readkey; if ch=#0 then begin ch:=readkey; case ch of #72 : begin Dec(punkt); if punkt<1 then punkt:=3; ImagePunkt; end; #80 : begin Inc(punkt); if punkt>3 then punkt:=1; ImagePunkt; end; end; end else if ch=#13 then case punkt of 1: begin punkt2:=1; game; end; 2: Rules; 3: exit; end; end; end; {Time} procedure date(var year,month,day : word); begin if (day=15) then textcolor(0) else textcolor(14); write('the ',day,'th of '); case month of 1 : begin write('January'); if day>31 then begin day:=1; inc(month) end; end; 2 : begin write('February'); if ((day>28) and (year mod 4<>0)) or ((day>29) and (year mod 4=0)) then begin day:=1; inc(month,1); end; end; 3 : begin write('March'); if day>31 then begin day:=1; inc(month) end; end; 4 : begin write('April'); if day>30 then begin day:=1; inc(month) end; end; 5 : begin write('May'); if day>31 then begin day:=1; inc(month) end; end; 6 : begin write('June'); if day>30 then begin day:=1; inc(month) end; end; 7 : begin write('July'); if day>31 then begin day:=1; inc(month) end; end; 8 : begin write('August'); if day>31 then begin day:=1; inc(month) end; end; 9 : begin write('September'); if day>30 then begin day:=1; inc(month) end; end; 10: begin write('October'); if day>31 then begin day:=1; inc(month) end; end; 11: begin write('November'); if day>30 then begin day:=1; inc(month) end; end; 12: begin write('December'); if day>31 then begin day:=1; month:=1; inc(year); end; end; end; textcolor(14); write(' ',year); end; {Business} procedure title; begin window(1,1,1,80); textbackground(2); clrscr; gotoxy(27,1); textbackground(5); textcolor(1); write('..::'); textcolor(2); write('B'); textcolor(10); write(' u'); textcolor(11); write(' s'); textcolor(12); write(' i'); textcolor(13); write(' n'); textcolor(6); write(' e'); textcolor(7); write(' s'); textcolor(8); write(' s'); textcolor(9); write('::..'); textbackground(2); end; {Borders} procedure my_ramka(x,y,m,n,colt,colf:byte); var i:byte; begin window (x,y,x+m,x+n); textcolor(colt); textbackground(colf); clrscr; write(#201); for i:=1 to m-2 do write(#205); write(#187); for i:=2 to n-1 do begin gotoxy(1,i); write(#186); gotoxy(m,i); write(#186); end; gotoxy(1,n); write(#200); for i:=1 to m-2 do write(#205); write(#188); end; {Inputting of number} function input(n,m : longint) : longint; var r : longint; x,y,e : word; s : string; c : char; begin textcolor(13); x:=wherex; y:=wherey; if n>m then n:=m; if n=0 then s:='' else str(n,s); repeat val(s,r,e); if m<>0 then while r>m do begin str(m,s); val(s,r,e); end; gotoxy(x,y); clreol; write(s); c:=readkey; case c of '0' : if length(s)<11 then s:=s+'0'; '1' : if length(s)<11 then s:=s+'1'; '2' : if length(s)<11 then s:=s+'2'; '3' : if length(s)<11 then s:=s+'3'; '4' : if length(s)<11 then s:=s+'4'; '5' : if length(s)<11 then s:=s+'5'; '6' : if length(s)<11 then s:=s+'6'; '7' : if length(s)<11 then s:=s+'7'; '8' : if length(s)<11 then s:=s+'8'; '9' : if length(s)<11 then s:=s+'9'; #0 : readkey; #8 : delete(s,length(s),1); #13 : if r=0 then c:=#0; end; until c=#13; input:=r; end; function colorchange(x,y:Byte;s:String):string; var i:Byte; begin gotoxy(x,y); for i:=1 to Length(s) do if i mod 2 =0 then begin textcolor(11); write(s[i]); end else begin textcolor(7); write(s[i]); end; end; procedure blink(x,y,first,second:Byte;del:Integer;mess:String); begin repeat gotoxy(x,y); textcolor(first); write(mess); delay(del); gotoxy(x,y); textcolor(second); write(mess); delay(del); until keypressed; end; procedure result_good;{winning} begin setupscreen; makewin(17,6,60,20,0,15,''); blink(33,12,14,15,30000,'YOU WON!!!'); end; procedure result_bad;{loss} begin setupscreen; makewin(17,6,60,20,0,15,''); blink(33,12,14,15,30000,'YOU LOST!!!'); end; procedure result_gameover;{end} begin setupscreen; makewin(17,6,60,20,0,15,''); blink(33,12,14,15,30000,'GAME OVER'); end; procedure game; label menugame,newgame,loadgame,main,cont4,cont2,cont3,m1,m2,m3,m4,sm,sm1,sm2; begin clrscr; title; textcolor(14); window(1,18,79,25); my_ramka(1,18,78,8,14,2); textcolor(10); window(1,1,80,25); textcolor(14); gotoxy(2,3); write('Time: '); gotoxy(5,5); clreol; window(2,19,77,24); clrscr; window(1,1,80,25); repeat {Winning} if (status=6) and not play then result_good; {Loss} {if (popul<1) or (((shops=0) and (super=0) and (banks=0) and (firms=0) and (comp=0) and (money<4000))) or (enddate-(year*12+month)<0) then if enddate-(year*12+month)<0 then result_gameover else result_bad; } gettime(a,a,c1,a); if c1<>c2 then begin inc(day); c2:=c1; {Изменение параметров} {настройка прибыли} a:=round(shops*0.3); b:=100-a; pro1:=round((capital div 100*a) div 30*1.3*((random(20)+90+(popul div 5))/100)); pro2:=round((capital div 100*b) div 30*1.45*((random(20)+90+(popul div 5))/100)); pro1:=pro1*shops; pro2:=pro2*super; if pro1+pro2>10 then case random(6) of 1 : dec(money,5); 2 : dec(money,2); 3 : inc(money,5); 4 : inc(money,10); end; inc(money,pro1+pro2); {доход от магазинов и супермаркетов} if (day=2) and (firms>0) then {доход от турфирм} begin if (month=6) or (month=7) or (month=8) then l:=round((9000*firms*((random(20)+90+(popul/5))/100))) else l:=round((5000*firms*((random(20)+90+(popul/5))/100))); inc(money,l); inc(nalsum,round(l*0.13)); end; if (day=2) and (banks>0) then {доход от банков} begin l:=round(banks*2000*(popul/5+90+random(20))/100); inc(money,l); inc(nalsum,round(l*0.13)); end; if buildtime>0 then dec(buildtime); inc(nalsum,round((pro1+pro2)*0.13)); end; {конец блока изменения дня} if (buildtime=0) and (build<>0) then begin case build of 1 : begin inc(shops); inc(popul,10); end; 2 : begin inc(super); inc(popul,30); end; 3 : begin inc(banks); inc(popul,20); end; end; build:=0; window(2,5,44,17); writeln; writeln; textcolor(2); writeln(' '); window(1,1,80,25); end; {Отображение даты} if (month=1) and (day=2) and (year<>lastyear) then begin lastyear:=year; contract:=0; inc(popul,2); end; gotoxy(8,3); date(year,month,day); if not play then begin write('(осталось '); if enddate-(year*12+month)>120 then write('120 месяцев) ') else write(enddate-(year*12+month),' месяцев) '); end else write(' '); {Отображение состояния} window(45,5,80,19); writeln(' Ваше состояние:'); writeln; write(' Деньги: '); if money<=100 then textcolor(0); if money>100 then textcolor(4); if money>10000 then textcolor(6); if money>50000 then textcolor(10); writeln(money,'$ '); textcolor(14); write(' Известность: '); if popul<=10 then textcolor(0); if popul>10 then textcolor(4); if popul>50 then textcolor(6); if popul>100 then textcolor(10); writeln(popul,' '); textcolor(14); write(' Статус: '); case status of 0 : begin textcolor(0); writeln('бомж '); end; 1 : begin textcolor(4); writeln('бизнесмен '); end; 2 : begin textcolor(6); writeln('мэр города'); end; 3 : begin textcolor(14); writeln('губернатор'); end; 4 : begin textcolor(10); writeln('депутат '); end; 5 : begin textcolor(9); writeln('миллионер '); end; 6 : begin textcolor(1); writeln('президент '); end; 7 : begin textcolor(5); writeln('олигарх '); end; 8 : begin textcolor(15); writeln('высший статус'); end; end; textcolor(14); writeln(' Магазинов: ',shops,' '); writeln(' Супермаркетов: ',super,' '); writeln(' Банков: ',banks,' '); writeln(' Туристич. фирм: ',firms,' '); writeln(' Нефтян.компаний: ',comp,' '); {Проверка статуса} a:=0; if (money>=100000) and (popul>=200) and (status=1) then a:=2; if (money>=250000) and (popul>=400) and (status=2) then a:=3; if (money>=500000) and (popul>=600) and (status=3) then a:=4; if (money>=1000000) and (popul>=800) and (status=4) then a:=5; if (money>=2000000) and (popul>=1000) and (status=5) then a:=6; if (money>=4000000) and (popul>=1400) and (status=6) then a:=7; if (money>=6000000) and (popul>=2000) and (status=7) then a:=8; if a<>0 then begin window(2,19,77,24); textcolor(10); write('Вы получаете новый статус известности: '); case a of 2 : begin textcolor(6); writeln('мэр города'); status:=2; end; 3 : begin textcolor(14); writeln('губернатор'); status:=3; end; 4 : begin textcolor(10); writeln('депутат'); status:=4; end; 5 : begin textcolor(9); writeln('миллионер'); status:=5; end; 6 : begin textcolor(1); writeln('президент'); status:=6; end; 7 : begin textcolor(5); writeln('олигарх'); status:=7; end; 8 : begin textcolor(15); writeln('высший статус'); status:=8; end; end; textcolor(10); writeln('Поздравляю!'); writeln; writeln('Нажмите любую клавишу.'); readkey; clrscr; end; {Переход к меню} window(2,5,44,17); textcolor(11); case menu of 1 : goto m1; 2 : goto m2; 3 : goto m3; 4 : goto m4; 5 : goto sm; 6 : goto sm1; 7 : goto sm2; else goto main; end; cont4: window(1,1,80,25); {Вклад денег} if (day=15) and (lastmonth<>month) and (shops+super>0) then begin lastmonth:=month; while keypressed do readkey; window(2,19,77,23); textcolor(14); write('15 числа каждого месяца необходимо вносить деньги для покупки товара '); if shops=1 then write('для вашего магазина') else write('для ваших магазинов'); if super=0 then write('.') else write(' и супермаркет'); if super=1 then write('a.') else if super<>0 then write('ов.'); writeln; write('Введите количество денег, которое вы хотите внести: '); if money<1000*shops+3000*super then capital:=input(precap,money) else capital:=input(precap,1000*shops+3000*super); precap:=capital; dec(money,capital); if capital<11 then capital:=0; clrscr; window(1,1,80,25); end; {Блок управления событиями игры} if (random(35000)=0) and (lastday<>day) then begin lastday:=day; window(2,19,77,23); a:=random(21); if a<11 then textcolor(10) else begin if enddate-(year*12+month)>118 then goto cont4; textcolor(4); end; {выбор события} case a of 0,1 : writeln('Местная газета взяля у вас интервью. Ваша известность выросла на 10.'); 2,3 : writeln('Городское радио берёт у вас интервью. Ваша известность выросла на 20.'); 4,5 : writeln('Телевидение берёт у вас интервью. Ваша известность выросла на 40.'); 6,7 : writeln('Вы выиграли на скачках 2000$. Ваша известность выросла на 5.'); 8,9,10 : if (comp=0) or (contract>5*comp) then goto cont2 else begin b:=random(5); case b of 0 : writeln('Компания по производству резины "Mыcrosoft" покупает у вашей компании нефть за 50000$.'); 1 : writeln('Компания "ГоВНО" (ГОсударственная Внутренная Нефтегазовая Отрасль) заключила с вами контракт на 60000$'); 2 : writeln('Компания "РосГосМосРез" (Российская Государственная Московская Резина) купила вашу нефть на 65000$.'); 3 : writeln('Компания "ЖОПА" (Железнодорожная Общественная Промышленная Ассоциация) покупает нефть на 70000$.'); 4 : writeln('Компания "МалиновскийТрансГаз" купила у вас нефть на суму 80000$.'); end; end; 11: writeln('Местные газетчики обвиняют вас во взяточничестве. Ваша известность упала на 15.'); 12: writeln('Вас подозревают в мошенничестве. Ваша известность упала на 25.'); 13: writeln('Уголовный розыск подозревает вас в ваших связях с районной мафией. Ваша из- вестность упала на 5.'); 14: if (sgn10) then writeln('Ваш магазин ограбили. Стоимость украденного: 1000$.') else goto cont2; 15: if (sgn20) then writeln('Ваш супермаркет ограбили. Стоимость украденного: 3000$.') else goto cont2; 16: if (sgn30) then writeln('Ограбление вашего банка. Украдено 7000$.') else goto cont2; 17: if (sgn4=banks) and (banks>0) then writeln('Противопожарной системе удалось потушить пожар, начавшийся в вашем банке. Ущерб: 500$') else if banks>0 then writeln('Один из ваших банков сгорел сегодня ночью. Ваша известность упала на 40.') else goto cont2; 18: if (sgn5=shops) and (shops>0) then writeln('Противопожарная система локализовала пожар, начавшийся в вашем магазине. Ущерб: 700$') else writeln('Пожар уничтожил ваш магазин. Ваша известность упала на 50.'); 19: if (sgn6=super) and (super>0) then writeln('Противопожарная система в вашем супермаркете потушила начавшийся пожар. Ущерб: 1000$') else if super>0 then writeln('Ваш супермаркет сгорел ночью. Ваша известность упала на 70.') else goto cont2; 20: if nalsum=0 then goto cont2 else begin writeln('К вам пришли налоговые инспекторы, и уж явно не на чай.'); if nalsum<1000 then writeln('Вам повезло: ваш долг составил всего ',nalsum,'$, но вам пришлось его выплатить.') else writeln('Зря вы не платили налоги. Вам пришлось заплатить удвоенную сумму - ',nalsum*2,'$.'); end; end; {изменене статистики} case a of 0,1 : inc(ge[1]); 2,3 : inc(ge[2]); 4,5 : inc(ge[3]); 6,7 : inc(ge[4]); 8,9,10 : inc(ge[5]); 11,12,13 : inc(be[1]); 14,15,16 : inc(be[2]); 17,18,19 : inc(be[3]); 20 : inc(be[4]); end; {изменение параметров} case a of 0,1 : inc(popul,10); 2,3 : inc(popul,20); 4,5 : inc(popul,40); 6,7 : begin inc(money,2000); inc(popul,5); end; 8 : begin case b of 0 : begin inc(money,50000); inc(contractsum,50); end; 1 : begin inc(money,60000); inc(contractsum,60); end; 2 : begin inc(money,65000); inc(contractsum,65); end; 3 : begin inc(money,70000); inc(contractsum,70); end; 4 : begin inc(money,80000); inc(contractsum,80); end; end; inc(contract); end; 9,10,11 : dec(popul,15); 12 : dec(popul,25); 13 : dec(popul,5); 14 : dec(money,1000); 15 : dec(money,3000); 16 : dec(money,7000); 17 : if (sgn4=banks) and (banks>0) then dec(money,500) else if banks>0 then begin dec(banks); dec(popul,40); end; 18 : if (sgn5=shops) and (shops>0) then dec(money,700) else if shops>0 then begin dec(shops); dec(popul,50); end; 19 : if (sgn6=super) and (super>0) then dec(money,1000) else if super>0 then begin dec(super); dec(popul,70); end; 20 : if nalsum<1000 then begin nalsum:=0; dec(money,nalsum); end else begin nalsum:=0; dec(money,nalsum*2) end; end; writeln; write('Нажмите любую клавишу.'); readkey; end else goto cont3; cont2: clrscr; window(1,1,80,25); cont3: until quit; clrscr; exit; {Отображение главного меню игры} main: writeln(' Главное меню игры'); writeln; if (money<4000) or (buildtime<>0) then textcolor(8); write('1 > Строительство'); if buildtime<>0 then write('(',buildtime,' дн.)'); writeln('/покупка акций '); if money<1000 then textcolor(8) else textcolor(11); writeln('2 > Реклама'); {установка цвета} if (money<50*shops+150*super+100*banks) or ((sgn1+sgn2+sgn3=shops+super+banks) and (sgn4+sgn5+sgn6=shops+super+banks)) or (shops+super+banks=0) then textcolor(8) else textcolor(11); {вывод комментариев} write('3 > Установка сигнализаций'); if ((sgn1+sgn2+sgn3=shops+super+banks) and (sgn4+sgn5+sgn6=shops+super+banks)) and (shops+super+banks>0) then writeln('(установлено)') else writeln(' '); if (money Уплата налогов - '); if nalsum<1000 then textcolor(10) else textcolor(4); if nalsum=0 then textcolor(8); if nalsum=0 then writeln('уплачено') else writeln(nalsum,'$ '); textcolor(11); writeln('S > Статистика игры'); writeln('ESC > Выход'); if keypressed then case readkey of '1' : if (money<4000) or (buildtime<>0) then else begin clrscr; menu:=1; end; '2' : if money<1000 then else begin clrscr; menu:=2; end; '3' : if (money<50*shops+150*super+100*banks) or ((sgn1+sgn2+sgn3=shops+super+banks) and (sgn4+sgn5+sgn6=shops+super+banks)) or (shops+super+banks=0) then else begin clrscr; menu:=3; end; '4' : if (money Построить магазин'); writeln(' требуется: 4000$, 80 дн.'); if (money<10000) or (popul<25) then textcolor(8) else textcolor(11); writeln('2 > Построить супермаркет'); write(' требуется: 10000$, 30 известн., 250 дн.'); if (money<6000) or (status<2) then textcolor(8) else textcolor(11); writeln('3 > Построить банк'); write(' требуется: 40000$, статус мэра, 150 дн.'); if (money<500000) or (status<4) then textcolor(8) else textcolor(11); writeln('4 > Купить акции туристической фирмы'); writeln(' требуется: 500000$, статус депутата'); if (money<500000) or (status<7) then textcolor(8) else textcolor(11); writeln('5 > Купить акции нефт. компании'); writeln(' требуется: 1500000$, статус олигарха'); textcolor(11); writeln('ESC > Вернуться в главное меню'); if keypressed then case readkey of '1' : if money<4000 then else build:=1; '2' : if (money<10000) or (popul<30) then else build:=2; '3' : if (money<40000) or (status<2) then else build:=3; '4' : if (money<500000) or (status<4) then else build:=4; '5' : if (money<1500000) or (status<7) then else build:=5; #27 : begin menu:=0; clrscr; goto cont4; end; end; if (build=0) or (buildtime<>0) then goto cont4; window(2,19,77,24); textcolor(14); write('Вы выбрали '); case build of 1 : write('строительство магазина'); 2 : write('строительство супермаркета'); 3 : write('строительство банка'); 4 : write('покупку акций туристической фирмы'); 5 : write('покупку акций нефтяной компании'); end; writeln('. Для этого требуется:'); write(' '); case build of 1 : write('4000$, 80 дней'); 2 : write('10000$, 25 единиц известности, 250 дней'); 3 : write('40000$, статус мэра города, 150 дней '); 4 : write('500000$, статус депутата'); 5 : write('1500000$, статус олигарха'); end; writeln('.'); writeln('Ваши доходы составят:'); write(' '); case build of 1 : write((popul+10) div 5+30,'% от вложенных денег, +10 к известности'); 2 : write((popul+30) div 5+45,'% от вложенных денег, +30 к известности'); 3 : write('не менее 2000$ +/-10% ежемесячно, +20 к известности'); 4 : write('не менее 9000$ в летние месяцы и 5000$ в остальные, +45 к известности'); 5 : write('от 50000$ до 80000$ за один контракт, до 5 контрактов в год, +80 к известности'); end; writeln('.'); write('Пробел - OK, друге клавиши - отмена.'); if readkey<>' ' then begin build:=0; clrscr; window(2,5,44,17); clrscr; goto cont4; end; case build of 1 : begin buildtime:=80; dec(money,4000); end; 2 : begin buildtime:=250; dec(money,10000); end; 3 : begin buildtime:=150; dec(money,40000); end; 4 : begin dec(money,500000); inc(popul,45); inc(firms); build:=0; end; 5 : begin dec(money,500000); inc(popul,80); inc(comp); build:=0; end; end; menu:=0; clrscr; window(2,5,44,17); clrscr; goto cont4; {Реклама} m2: writeln(' Реклама'); writeln; if money<1000 then textcolor(8); writeln('1 > Плакатная реклама: +10 к известн.'); writeln(' требуется: 1000$'); if money<2000 then textcolor(8) else textcolor(11); writeln('2 > Реклама по радио: +22 к известн.'); writeln(' требуется: 2000$'); if money<6000 then textcolor(8) else textcolor(11); writeln('3 > Телереклама: +65 к известности'); writeln(' требуется: 6000$'); textcolor(11); writeln; writeln('ESC > Вернуться в главное меню'); a:=0; if keypressed then case readkey of '1' : if money<1000 then else a:=1; '2' : if money<2000 then else a:=2; '3' : if money<6000 then else a:=3; #27 : begin clrscr; menu:=0; end; end; if a=0 then goto cont4; window(2,19,77,24); textcolor(14); write('Вы выбрали '); case a of 1 : write('плакатную рекламу'); 2 : write('рекламу по радио'); 3 : write('телерекламу'); end; writeln('.'); write(' Цена: '); case a of 1 : write('1000$'); 2 : write('2000$'); 3 : write('6000$'); end; writeln('.'); write(' Рост известности:'); case a of 1 : write('+10'); 2 : write('+22'); 3 : write('+65'); end; writeln(' единиц.'); writeln; write('Пробел - OK, друге клавиши - отмена.'); if readkey<>' ' then begin clrscr; window(2,5,44,17); clrscr; goto cont4; end; case a of 1 : begin dec(money,1000); inc(popul,10); end; 2 : begin dec(money,2000); inc(popul,22); end; 3 : begin dec(money,6000); inc(popul,65); end; end; clrscr; goto cont4; {Установка сигнализаций} m3: writeln(' Установка сигнализаций'); writeln; if (money<50*shops+150*super+100*banks) or (sgn1+sgn2+sgn3=shops+super+banks) then textcolor(8) else textcolor(11); write('1 > Установить охранные системы'); if sgn1+sgn2+sgn3=shops+super+banks then writeln('(установл.)') else begin writeln('(',shops+super+banks-sgn1-sgn2-sgn3,')'); writeln(' требуется: ',(shops-sgn1)*50+(super-sgn2)*150+(banks-sgn3)*100,'$'); end; if (money<200*shops+600*super+400*banks) or (sgn4+sgn5+sgn6=shops+super+banks) then textcolor(8) else textcolor(11); write('2 > Уст. противопожарные системы'); if sgn4+sgn5+sgn6=shops+super+banks then writeln('(установл.)') else begin writeln('(',shops+super+banks-sgn4-sgn5-sgn6,')'); writeln(' требуется: ',(shops-sgn5)*200+(super-sgn6)*600+(banks-sgn4)*400,'$'); end; writeln; textcolor(11); write('ESC > Вернуться в главное меню'); a:=0; if keypressed then case readkey of '1' : if (money<50*shops+150*super+100*banks) or (sgn1+sgn2+sgn3=shops+super+banks) then else a:=1; '2' : if (money<200*shops+600*super+400*banks) or (sgn4+sgn5+sgn6=shops+super+banks) then else a:=2; #27 : begin clrscr; menu:=0; goto cont4; end; end; if a=0 then goto cont4; window(2,19,77,24); textcolor(14); write('Вы выбрали установку '); case a of 1 : write('охранных систем'); 2 : write('противопожарных систем'); end; writeln('.'); write(' Цена: '); case a of 1 : write((shops-sgn1)*50+(super-sgn2)*150+(banks-sgn3)*100); 2 : write((shops-sgn5)*200+(super-sgn6)*600+(banks-sgn4)*400); end; writeln('$'); write(' Результат: '); case a of 1 : write('обеспечивается полная защита от ограблений в магазинах, супер- маркетах и банках'); 2 : write('обеспечивается почти полная защита от пожаров в магазинах, су- пермаркетах и банках'); end; writeln('.'); writeln; write('Пробел - OK, друге клавиши - отмена.'); if readkey<>' ' then begin clrscr; window(2,5,44,17); clrscr; goto cont4; end; case a of 1 : begin dec(money,(shops-sgn1)*50+(super-sgn2)*150+(banks-sgn3)*100); sgn1:=shops; sgn2:=super; sgn3:=banks; end; 2 : begin dec(money,(shops-sgn5)*200+(super-sgn6)*600+(banks-sgn4)*400); sgn4:=banks; sgn5:=shops; sgn6:=super; end; end; clrscr; window(2,5,44,17); clrscr; goto cont4; {Уплата налогов} m4: dec(money,nalsum); nalsum:=0; menu:=0; goto cont4; {Статистика} sm: writeln(' Статистика'); writeln; writeln('1 > Статистика по прибыли'); writeln('2 > Статистика по событиям'); writeln; if not play then writeln('общая оценка игры: ',round((enddate/12-year)*status)) else writeln('общая оценка игры: цель игры выполнена'); writeln; writeln('ESC > Вернуться в главное меню'); if keypressed then case readkey of '1' : begin clrscr; menu:=6; goto cont4; end; '2' : begin clrscr; menu:=7; goto cont4; end; #27 : begin clrscr; menu:=0; goto cont4; end; end; goto cont4; sm1: writeln('Сегодняшняя прибыль '); writeln('с магазинов: ',pro1,'$ '); writeln('с супермаркетов: ',pro2,'$ '); writeln('Сегодняшний налог '); writeln('с них: ',round((pro1+pro2)*0.13),'$ '); writeln('Ежемесячная прибыль '); writeln('с банков: ',round(banks*2000*((popul/5+100)/100)),'$ +/-10% '); writeln('Ежемесячная прибыль '); write('c турфирм: '); if (month=6) or (month=7) or (month=8) then l:=round((9000*firms*((popul/5+100)/100))) else l:=round((5000*firms*((popul/5+100)/100))); writeln(l,'$ +/-10% '); writeln('Общая прибыль с '); write('нефтяных компаний: ',contractsum*1000,'$'); if keypressed then begin readkey; clrscr; menu:=5; end; goto cont4; sm2: writeln('Интервью в газетах: ',ge[1]); writeln('Интервью по радио: ',ge[2]); writeln('Телеинтервью: ',ge[3]); writeln('Выигр. на скачках: ',ge[4]); writeln('Контрактов с н\к.: ',ge[5]); writeln('Ложных обвинений: ',be[1]); writeln('Ограблений: ',be[2]); writeln('Пожаров: ',be[3]); writeln('Визитов налоговой: ',be[4]); writeln; writeln('Всего хороших событий: ',ge[1]+ge[2]+ge[3]+ge[4]+ge[5]); writeln('Всего плохих событий: ',be[1]+be[2]+be[3]+be[4]); if keypressed then begin readkey; clrscr; menu:=5; end; goto cont4; window(2,19,77,24); {Новая игра} newgame: getdate(year,month,day,a); dec(day); status:=1; money:=500; capital:=500; precap:=500; nalsum:=0; if day>15 then enddate:=(year*12+month)+121 else enddate:=(year*12+month)+120; popul:=10; shops:=1; super:=0; banks:=0; firms:=0; comp:=0; sgn1:=0; sgn2:=0; sgn3:=0; sgn4:=0; sgn5:=0; sgn6:=0; ge[1]:=0; ge[2]:=0; ge[3]:=0; ge[4]:=0; ge[5]:=0; be[1]:=0; be[2]:=0; be[3]:=0; be[4]:=0; play:=false; end; begin setupscreen;{рисуем начальную заставку} makewin(17,6,60,20,2,15,' - WELCOME! - '); writeat(35,9,12,2,'...GAME'); writeat(26,12,13,2,'"-=B u s i n e SS=-"'); colorchange(28,15,'..::..::..::..::..::..'); colorchange(28,16,'..::..::..::..::..::..'); colorchange(28,17,'..::..::..::..::..::..'); readkey; setupscreen;{вырисовываем окошко с правилами игры и ждем ответа начинать или игру или нет} makewin(17,6,60,20,0,15,''); punkt:=1; ImagePunkt; Key; end.