#apptype windows
#reference 'System.Windows.Forms.dll'
#reference 'System.Drawing.dll'
#resource 'new.png'
uses GraphABC,System.Windows.Forms,Microsoft.Win32,System.Drawing,Utils;
Const level1exp = 20;
level2exp = 50;
level3exp = 100;
level4exp = 200;
level5exp = 500;
var
name,s,s1,s2,s3,s4,s5,s6,udari1,udarm1,hp1,maxhp1,hpmonster1,maxhpmonster1:string;
y,str,agi,dex,vit,xmax,xmax1,bitva,live,hp,maxhp,livemonster,udari,udarm,hpmonster,maxhpmonster,
exp,level,nakogo,battle,monster,mindmonster,maxdmonster,parametr:integer;
myForm: Form;
procedure harakteristiki;
begin
y:= 0;
xmax:= 620;
s := IntToStr(str);
s1 := IntToStr(agi);
s2 := IntToStr(dex);
s3 := IntToStr(vit);
s4 := IntToStr(level);
s5 := IntToStr(exp);
s6 := IntToStr(level1exp);
if exp >= 10 then xmax1:=xmax1+7;
TextOut(xmax, y, 'Ваши характеристики: ');
TextOut(xmax, y + 20, 'Ваша сила: ');
TextOut(xmax + 75, y + 20, s);
TextOut(xmax, y + 40, 'Ваша ловкость: ');
TextOut(xmax + 100, y + 40, s1);
TextOut(xmax, y + 60, 'Ваша точность: ');
TextOut(xmax + 100, y + 60, s2);
TextOut(xmax, y + 80, 'Ваша живучесть: ');
TextOut(xmax + 110, y + 80, s3);
TextOut(xmax, y + 100, 'Ваш уровень: ');
TextOut(xmax + 90, y + 100, s4);
TextOut(xmax, y + 120, 'Ваш опыт: ');
TextOut(xmax + 70, y + 120, s5);
TextOut(xmax1 + 78, y + 120, '/');
TextOut(xmax1 + 83, y + 120, s6);
end;
procedure hpsp;
begin
xmax:= 420;
y:= 0;
xmax1:= 420;
hp1 := IntToStr(hp);
maxhp1 := IntToStr(maxhp);
if hp < 10 then xmax1:=xmax1 + 7;
TextOut(xmax, y, 'Ваши жизни: ');
TextOut(xmax1 + 80, y, hp1);
TextOut(xmax + 95, y, '/');
TextOut(xmax + 100, y, maxhp1);
end;
procedure vosstanovlenie;
begin
repeat
hp:=hp + 1;
sleep (2000);
until (hp=maxhp) and (battle=1);
end;
procedure hpmob;
begin
if battle=1 then begin
xmax:= 420;
y:= 0;
xmax1:=420;
if monster=0 then begin
hpmonster1 := IntToStr(hpmonster);
maxhpmonster1 := IntToStr(maxhpmonster);
if hpmonster < 10 then xmax1:=xmax1 + 7;
TextOut (xmax - 27, y + 20, 'Жизни монстра:');
TextOut (xmax1 + 68, y + 20, hpmonster1);
TextOut (xmax + 83, y + 20, '/');
TextOut (xmax + 92, y + 20, maxhpmonster1 );
end;
if monster=1 then begin
hpmonster1 := IntToStr(hpmonster);
maxhpmonster1 := IntToStr(maxhpmonster);
if hpmonster < 10 then xmax1:=xmax1 + 7;
TextOut (xmax - 17, y + 20, 'Жизни монстра:');
TextOut (xmax1 + 80, y + 20, hpmonster1);
TextOut (xmax + 96, y + 20, '/');
TextOut (xmax + 102, y + 20, maxhpmonster1 );
end;
end;
end;
procedure obnovit(sender:object; args:System.EventArgs);
begin
cls;
harakteristiki;
hpsp;
hpmob;
end;
procedure battle1;
begin
if monster=0 then begin
hpmonster:=10;
maxhpmonster:=10;
mindmonster:=1;
maxdmonster:=2;
end;
if monster=1 then begin
hpmonster:=15;
maxhpmonster:=15;
mindmonster:=1;
maxdmonster:=3;
end;
battle:=1;
live:=1;
livemonster:=1;
writeln ('Битва началась!');
sleep (2000);
ClearWindow;
hpmob;
harakteristiki;
hpsp;
repeat
xmax:=0;
y:=0;
udari:=random (1,3);
udarm:=random (mindmonster,maxdmonster);
udari1 := IntToStr(udari);
udarm1 := IntToStr(udarm);
TextOut (xmax, y, 'Вы ударили монстра на ');
TextOut (xmax + 147, y, udari1);
TextOut (xmax + 158, y, 'урона');
sleep (1000);
TextOut (xmax, y + 16, 'Вас ударил монстр на ');
TextOut (xmax + 142, y + 16, udarm1);
TextOut (xmax + 153, y + 16, 'урона');
sleep (1000);
hp:=hp-udarm;
hpmonster:=hpmonster-udari;
if hpmonster < 0 then hpmonster:=0;
ClearWindow;
harakteristiki;
hpsp;
hpmob;
if hpmonster <= 0 then livemonster:=0;
if hp <= 0 then live:=0;
until (live = 0) or (livemonster = 0);
if live=0 then begin
writeln ('Вы проиграли..');
exit;
end;
if livemonster=0 then begin
writeln ('Вы одолели монстра!');
battle:=0;
if monster = 0 then
exp:=exp+10;
if monster = 1 then
exp:=exp+15;
monster:=1000;
if exp >= level1exp then begin level:=2;
hp:=25;
maxhp:=25;
writeln ('Вы получили 2 уровень!');
writeln ('Выберите параметр, который хотите увеличить!');
writeln ('1-Сила, 2-Ловкость, 3-Точность, 4-Живучесть');
readln (parametr);
if parametr=1 then
str:=str+1;
if parametr=2 then
agi:=agi+1;
if parametr=3 then
dex:=dex+1;
if parametr=4 then
vit:=vit+1;
end;
ClearWindow;
harakteristiki;
hpsp;
if level = 1 then begin
writeln ('Список монстров:');
writeln ('1 - Волк[1], 2 - Медведь[2]');
readln (nakogo);
if nakogo = 1 then begin
monster:=0;
battle1;
end;
if nakogo = 2 then begin
monster:=1;
battle1;
end;
end;
if level = 2 then begin
writeln ('Список монстров:');
writeln ('1 - Медведь[2], 2 - Ёжик[2]');
readln (nakogo);
if nakogo = 1 then begin
monster:=1;
battle1;
end;
if nakogo=2 then begin
monster:=2;
battle1;
end;
end;
end;
end;
begin
SetWindowSize(800, 600);
hp:=20;
maxhp:=20;
str:= 1;
agi:= 1;
dex:= 1;
vit:= 1;
level:=1;
exp:=0;
harakteristiki;
hpsp;
application.EnableVisualStyles(); //активируем стили Windows
myForm := new Form; // создаём форму
//Создаем меню
var toolStrip1 := new ToolStrip;
var myToolStrip := new ToolStripMenuItem('MyToolStrip');
MyToolStrip.DropDownItems.Add(new ToolStripMenuItem('1', new System.Drawing.Bitmap(GetResourceStream('new.png'))));
toolStrip1.Items.Add(MyToolStrip);
myForm.Controls.Add(toolStrip1);
Application.Run(myForm);
writeln ('Введите ваше имя');
readln (name);
writeln ('Ваше имя ',name);
writeln ('На вас напал Волк!!');
writeln ('Ваши действия?');
writeln ('1 - Попытаться сбежать, 2 - Начать битву');
readln (bitva);
if bitva=2 then begin
monster:=0;
battle1;
end;
end.
|