2个回答
2013-09-19
展开全部
var
ch2:char;
tf,bosstf:boolean;
name:string;
jd,qn:longint;
t,boss,hpboss,bossatt,ene,n,eneatt,my,myatt,hpmy,hpene:integer;
i,j,i1,j1,x,y:integer;
ch:char;
dt:array[0..11,0..11] of string;
procedure hpfirst;
begin
my:=400;
hpmy:=400;
myatt:=350;
qn:=10;
jd:=10;
ene:=350;
hpene:=350;
eneatt:=300;
boss:=10000;
hpboss:=10000;
bossatt:=5000;
end;
procedure hpfull;
begin
inc(hpmy,30);
my:=hpmy;
inc(hpene,30);
ene:=hpene;
inc(myatt,10);
inc(eneatt,20);
if t=10 then begin inc(qn); inc(jd);end;
end;
procedure beg;
begin
write('制作人:刘志健。');
readln;
write('公布网站:bbs.oifans.cn');
readln;
write('用户名:liuzhijian');
readln;
writeln;
writeln;
write('游戏开始?');
readln;
end;
procedure map;
begin
for i:=1 to 10 do
for j:=1 to 10 do begin
if j<>10 then write(dt[i,j]);
if j=10 then writeln(dt[i,j]);
end;
end;
procedure input;
begin
writeln('骑士:',name,' 你的体力:',my);
writeln('H:帮助,M:移动,B:挑BOSS:');
readln(ch);
end;
procedure help;
begin
writeln('@是没敌人的,*是有敌人的,~是自己,!是宝物。');
writeln('潜能可以伤3倍的血,绝对必杀是必杀招,起初各有十次,后来每战斗十次各加1个。');
readln;
end;
procedure full;
begin
my:=hpmy;
ene:=hpene;
end;
procedure enem;
var
ch:string;
begin
repeat
writeln('敌人出现!!!!');
writeln('A普通攻击,B使用潜能,C绝对必杀');
readln(ch);
if bosstf then begin
if (ch='a') or (ch='A') then dec(boss,myatt);
if ((ch='b') or (ch='B')) and (qn<>0) then dec(boss,myatt*3);
if ((ch='c') or (ch='C')) and (jd<>0) then dec(boss,boss);
if boss<=0 then begin writeln('战斗胜利!'); tf:=true; exit;end;
dec(my,bossatt);
if my<=0 then begin writeln('游戏结束!');tf:=true; exit;end;
end
else begin
if (ch='a') or (ch='A') then dec(ene,myatt);
if ((ch='b') or (ch='B')) and (qn<>0) then dec(ene,myatt*3);
if ((ch='c') or (ch='C')) and (jd<>0) then dec(ene,ene);
if ene<=0 then begin writeln('战斗胜利!'); t:=t+1; break; end;
dec(my,eneatt);
if my<=0 then begin writeln('游戏结束!');exit; end;
end;
until 1<>1;
if my<=0 then exit;
if boss<=0 then exit;
full;hpfull;
end;
procedure move;
var
ch2:string;
begin
map;
writeln('W是上,A是左,S是下,D是右');
readln(ch2);
if (ch2='w') or (ch2='W') then begin
if dt[x+1,y]=' *' then enem
else begin dt[x+1,y]:=' ~'; dt[x,y]:=' @'; x:=x+1; end;
end;
if (ch2='a') or (ch2='A') then begin
if dt[x,y-1]=' *' then enem
else begin dt[x,y-1]:=' ~'; dt[x,y]:=' *'; y:=y-1; end;
end;
if (ch2='s') or (ch2='S') then begin
if dt[x-1,y]=' *' then enem
else begin dt[x-1,y]:='~ '; dt[x,y]:=' *'; x:=x-1; end;
end;
if (ch2='d') or (ch2='D') then begin
if dt[x,y+1]=' *' then enem
else begin dt[x,y+1]:=' ~'; dt[x,y]:=' *'; y:=y+1; end;
end;
end;
function f(ch:char):integer;
begin
if (ch='H') or (ch='h') then help;
if (ch='M') or (ch='m') then move;
if (ch='B') or (ch='b') then begin bosstf:=true;enem; end;
end;
begin
randomize;
hpfirst;
beg;
write('Your name:');readln(name);
for i:=1 to 10 do
for j:=1 to 10 do begin
n:=random(2);
if n=0 then dt[i,j]:=' @';
if n=1 then dt[i,j]:=' *';
end;
i:=random(10)+1;
j:=random(10)+1;
repeat
i1:=random(10)+1;
j1:=random(10)+1;
until (i<>i1) or (j<>j1);
x:=i;
y:=j;
dt[i,j]:=' ~';
dt[i1,j1]:=' !';
repeat
if tf then exit;
map;
input;
f(ch);
until 1<>1;
end.
ch2:char;
tf,bosstf:boolean;
name:string;
jd,qn:longint;
t,boss,hpboss,bossatt,ene,n,eneatt,my,myatt,hpmy,hpene:integer;
i,j,i1,j1,x,y:integer;
ch:char;
dt:array[0..11,0..11] of string;
procedure hpfirst;
begin
my:=400;
hpmy:=400;
myatt:=350;
qn:=10;
jd:=10;
ene:=350;
hpene:=350;
eneatt:=300;
boss:=10000;
hpboss:=10000;
bossatt:=5000;
end;
procedure hpfull;
begin
inc(hpmy,30);
my:=hpmy;
inc(hpene,30);
ene:=hpene;
inc(myatt,10);
inc(eneatt,20);
if t=10 then begin inc(qn); inc(jd);end;
end;
procedure beg;
begin
write('制作人:刘志健。');
readln;
write('公布网站:bbs.oifans.cn');
readln;
write('用户名:liuzhijian');
readln;
writeln;
writeln;
write('游戏开始?');
readln;
end;
procedure map;
begin
for i:=1 to 10 do
for j:=1 to 10 do begin
if j<>10 then write(dt[i,j]);
if j=10 then writeln(dt[i,j]);
end;
end;
procedure input;
begin
writeln('骑士:',name,' 你的体力:',my);
writeln('H:帮助,M:移动,B:挑BOSS:');
readln(ch);
end;
procedure help;
begin
writeln('@是没敌人的,*是有敌人的,~是自己,!是宝物。');
writeln('潜能可以伤3倍的血,绝对必杀是必杀招,起初各有十次,后来每战斗十次各加1个。');
readln;
end;
procedure full;
begin
my:=hpmy;
ene:=hpene;
end;
procedure enem;
var
ch:string;
begin
repeat
writeln('敌人出现!!!!');
writeln('A普通攻击,B使用潜能,C绝对必杀');
readln(ch);
if bosstf then begin
if (ch='a') or (ch='A') then dec(boss,myatt);
if ((ch='b') or (ch='B')) and (qn<>0) then dec(boss,myatt*3);
if ((ch='c') or (ch='C')) and (jd<>0) then dec(boss,boss);
if boss<=0 then begin writeln('战斗胜利!'); tf:=true; exit;end;
dec(my,bossatt);
if my<=0 then begin writeln('游戏结束!');tf:=true; exit;end;
end
else begin
if (ch='a') or (ch='A') then dec(ene,myatt);
if ((ch='b') or (ch='B')) and (qn<>0) then dec(ene,myatt*3);
if ((ch='c') or (ch='C')) and (jd<>0) then dec(ene,ene);
if ene<=0 then begin writeln('战斗胜利!'); t:=t+1; break; end;
dec(my,eneatt);
if my<=0 then begin writeln('游戏结束!');exit; end;
end;
until 1<>1;
if my<=0 then exit;
if boss<=0 then exit;
full;hpfull;
end;
procedure move;
var
ch2:string;
begin
map;
writeln('W是上,A是左,S是下,D是右');
readln(ch2);
if (ch2='w') or (ch2='W') then begin
if dt[x+1,y]=' *' then enem
else begin dt[x+1,y]:=' ~'; dt[x,y]:=' @'; x:=x+1; end;
end;
if (ch2='a') or (ch2='A') then begin
if dt[x,y-1]=' *' then enem
else begin dt[x,y-1]:=' ~'; dt[x,y]:=' *'; y:=y-1; end;
end;
if (ch2='s') or (ch2='S') then begin
if dt[x-1,y]=' *' then enem
else begin dt[x-1,y]:='~ '; dt[x,y]:=' *'; x:=x-1; end;
end;
if (ch2='d') or (ch2='D') then begin
if dt[x,y+1]=' *' then enem
else begin dt[x,y+1]:=' ~'; dt[x,y]:=' *'; y:=y+1; end;
end;
end;
function f(ch:char):integer;
begin
if (ch='H') or (ch='h') then help;
if (ch='M') or (ch='m') then move;
if (ch='B') or (ch='b') then begin bosstf:=true;enem; end;
end;
begin
randomize;
hpfirst;
beg;
write('Your name:');readln(name);
for i:=1 to 10 do
for j:=1 to 10 do begin
n:=random(2);
if n=0 then dt[i,j]:=' @';
if n=1 then dt[i,j]:=' *';
end;
i:=random(10)+1;
j:=random(10)+1;
repeat
i1:=random(10)+1;
j1:=random(10)+1;
until (i<>i1) or (j<>j1);
x:=i;
y:=j;
dt[i,j]:=' ~';
dt[i1,j1]:=' !';
repeat
if tf then exit;
map;
input;
f(ch);
until 1<>1;
end.
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2013-09-19
展开全部
..
没听过 好复杂`
没听过 好复杂`
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询