/ Vijos / 讨论 / 游戏 /

来发个pascal游戏,呵呵

复制、粘贴到free pascal 就搞定了

program game;
var a:char;
i,j,m,n:integer;
ma:array[1..10,1..10]of integer;
hp,mp,money,ql,dengji,fy,atc,mc,hpmax,mpmax,zhiye,jy,mcp:integer;
procedure map;
begin
randomize;
m:=random(10);
n:=random(10);
writeln('*******地图********');
for i:=1 to 10 do
begin
for j:=1 to 10 do
begin
if (i=m)and(j=n)then
begin
ma[i,j]:=9;
write('9 ');
end
else
begin
ma[i,j]:=random(3);
if ma[i,j]=0 then write('0 ');
if ma[i,j]=1 then write('1 ');
if ma[i,j]=2 then write('2 ');
end;
end;
writeln;
end;
writeln('*******************');
readln;
end;
procedure save;
var t:text;
begin
rewrite(t);
writeln(t,dengji);
writeln(t,hpmax,' ',hp);
writeln(t,mpmax,' ',mp);
writeln(t,ql);
writeln(t,fy);
writeln(t,mc);
writeln(t,atc);
writeln(t,money);
end;
procedure load;
var t:text;
begin
reset(t);
readln(t,dengji);
readln(t,hpmax,hp);
readln(t,mpmax,mp);
readln(t,ql);
readln(t,fy);
readln(t,mc);
readln(t,atc);
readln(t,money);
end;
procedure ziliao;
begin
writeln('********************人物资料**********************');
writeln('等级:',dengji);
writeln('生命:',hpmax,'/',hp);
writeln('魔力:',mpmax,'/',mp);
writeln('金钱:',money);
writeln('升级经验/现在经验:',dengji*100+30,'/',JY);
writeln('**************************************************');
end;
procedure shengji;
begin
if jy>=dengji*100+30 then
begin
writeln('升级了!大家鼓掌!!呕~~~~~~~~~');
dengji:=dengji+1;
jy:=jy-dengji*100-30;
atc:=atc+dengji*2+10;
fy:=fy+dengji*2+10;
mcp:=mcp+dengji*2+4;
hpmax:=hpmax+dengji*10;
mpmax:=mpmax+dengji*8;
writeln('#############资料###########');
writeln('等级:',dengji);
hp:=hpmax;
writeln('生命:',hpmax,'/',hp);
mp:=mpmax;
writeln('魔力:',mpmax,'/',mp);
writeln('攻击力:',atc);
writeln('防御力:',fy);
writeln('魔击力:',mc);
end;
end;

procedure guaishou;
var p:char;
z,ghp,fyl,gatc,hp0,jy,mcp:integer;
begin
gatc:=random(100)+dengji*10;
writeln('你遇到了怪兽,现在:Y:战斗;N:逃跑。Y/N');
readln(p);
ghp:=random(100)*20;
hp0:=ghp;
fyl:=fy;
if p='Y' then
begin
writeln('战斗开始');
while (hp>0)and(ghp>0) do
begin
writeln('你的HP:',hpmax,'/',hp,' ','MP:',mpmax,'/',mp,' ','气力',ql);
writeln('怪兽的HP:',hp0,'/',ghp);
writeln('攻击:1:普通攻击 2:魔法攻击 3:必杀 4:防御 5:逃跑 ');
readln(p);
z:=random(11);
if z=5 then
begin
if p='1' then
begin
write('攻击无效!');
readln;
end;
if p='2' then
begin
write('没打中');
readln;
end;
end
else
begin
if p='1'
then
begin
ghp:=ghp-atc;
if ghp<=0
then
begin
write('打败怪兽! 经验+',hp0);
readln;
z:=random(5);
jy:=jy+hp0;
if z=2 then writeln('得到金钱',(hp0 div 10)*10);
money:=money+((hp0 div 10)*10);
readln;
ql:=ql+10;
break;
end
else
begin
write('怪兽受到伤害,HP-',atc,'怪HP:',hp0,'/',ghp);
readln;
ql:=ql+10;
end;
end;
if p='2'
then
begin
begin
writeln('选择魔法:');
if dengji>=0 then writeln('1.火球:初始攻击力110 mp-2');
if dengji>=2 then writeln('2.火焰:初始攻击力150 mp-5');
if dengji>=4 then writeln('3.冰球:初始攻击力200,冰冻效果,怪兽一回合不能攻击 mp-10');
if dengji>=6 then writeln('4.冰柱:初始攻击力250,冰冻效果,怪兽三回合不能攻击 mp-20');
if dengji>=8 then writeln('5.猛虎炎神:初始攻击力400,灼伤效果,怪兽每回合hp减少10% mp-40');
if dengji>=10 then writeln('6.冰环暴:初始攻击力450,冰冻效果,怪兽三回合不能攻击 mp-40');
readln(p);
if p='1' then
if mp>=2
then
begin
mp:=mp-2;
mcp:=110+mc;
end
else writeln('魔力不够!');
if p='2' then
if mp>=5
then
begin
mp:=mp-5;
mcp:=150+mc;
end
else writeln('魔力不够!');
if p='3' then
if mp>=10
then
begin
mp:=mp-10;
mcp:=200+mc;
end
else writeln('魔力不够!');
if p='4' then
if mp>=20
then
begin
mp:=mp-20;
mcp:=250+mc;
end
else writeln('魔力不够!');
if p='5' then
if mp>=40
then
begin
mp:=mp-40;
mcp:=400+mc;
end
else writeln('魔力不够!');
if p='6' then
if mp>=40
then
begin
mp:=mp-40;
mcp:=400+mc;
end
else writeln('魔力不够!');
end;
ghp:=ghp-mcp;
if ghp<0
then
begin
write('打败怪兽! 经验+',(hp0 mod 10+10));
readln;
jy:=jy+hp0;
z:=random(5);
if z=3 then writeln('得到金钱',(hp0 div 10*10));
money:=money+((hp0 div 10)*10);
ql:=ql+10;
break;
end
else
begin
write('怪兽受到伤害,HP-',mcp,'怪HP:',hp0,'/',ghp);
readln;
ql:=ql+10;
end;
end;
if p='4' then fyl:=fy*2;
if p='5' then begin
z:=random(4);
if z=3 then writeln('逃跑失败!')
else exit;
end;
end;
writeln('回合结束');
writeln('怪兽攻击!');
z:=random(9);
if z=1 then
begin
write('miss! ye!');
readln;
end
else
begin
if fy>=gatc then

begin
write('成功防御!');
readln;
end
else
begin
hp:=hp+fyl-gatc;
if hp>0 then
begin
write('你的HP-',gatc-fyl,' ',hpmax,'/',hp);
readln;
end
else
begin
write('你挂了!重新开始吧!');
readln;
halt;
end;
end;
write('回合结束');
readln;
end;
end;
shengji;
end;
end;

procedure shangdian;
var p:char;
begin
writeln('*********************商店****************************');
if money<=0 then
begin
writeln('老板:这里不欢迎穷光蛋!滚!!!!');
exit;
end
else
writeln('1.红药:HP+50 100元 2.蓝药 MP+50 100元');
write('(本商店现仅开放这两类药品,你要什么?1/2 Q:Quit)');
while (money>0)and(p<>'Q') do
begin
readln(p);
if p='1' then
begin
if hp+100>hpmax
then
begin
hp:=hpmax;
writeln('生命:',hpmax,'/',hp);
money:=money-100;
end
else
begin
hp:=hp+100;
writeln('生命:',hpmax,'/',hp);
money:=money-100;
end;
end
else
if p='2' then
begin
if mp+50>mpmax
then
begin
mp:=mpmax;
writeln('魔力:',mpmax,'/',mp);
money:=money-100;
end
else
begin
mp:=mp+50;
money:=money-100;
writeln('魔力:',mpmax,'/',mp);
end;
end;
end;
if money<=0 then writeln('店老板:没钱?滚!!!!!');
end;
procedure kaishi;
var s,m,n,k,l:integer;
p:char;
begin
write('请选择角色:1.剑士 2.魔法师 :');
readln(l);
if l=1 then
begin
hp:=500;
hpmax:=hp;
mp:=30;
mpmax:=mp;
money:=1000;
fy:=100;
dengji:=1;
atc:=150;
mc:=50;
zhiye:=1;
end;
if l=2 then
begin
hp:=300;
hpmax:=hp;
mp:=50;
mpmax:=mp;
money:=1000;
fy:=50;
dengji:=1;
atc:=80;
mc:=150;
zhiye:=2;
end;

randomize;
repeat
writeln('hp:',hpmax,'/',hp,' ','mp:',mpmax,'/',mp,' ','money:',money);
m:=1;
n:=1;
writeln('请输入:F:移动 B:购买物品 Z:人物状态 M:地图 Q离开');
readln(p);
if p='F' then
begin
writeln('W:向前 S:向下 A:向左 D:向右 ');
readln(p);
if p='W'
then
begin
m:=m+1;
if m>10 then
begin
writeln('无法前进!');
m:=m-1;
end
else
if ma[m,n]=0 then writeln('什么都没有......');
if ma[m,n]=1 then guaishou;
end;
end;
if p='B' then shangdian;
if p='Z' then ziliao;
if p='M' then map;
until p='Q';
end;

procedure shuoming;
var p:char;
begin
writeln('************************游戏说明******************************');
writeln('你是一个英雄,在峡谷里前进,前方可能有妖怪,也可能有宝物。');
writeln('你遇到野兽时,你可以用身上的东西向他攻击。按G键是攻击,按');
writeln('T键是逃跑,但可能逃不掉哦!你开始只有一把小刀,以后可能拣');
writeln('到其它宝物,要加油哦!你的任务是找到传说中的宝物-CSW之剑');
writeln('然后打败大魔王(剧情比较老土,请见谅......)');
writeln('*************************************************************');
writeln('好了,开始游戏吧!Y/N');
readln(p);
if p='N' then halt
else if p='Y' then kaishi
else
begin
writeln('耍我,死把!');
readln;
halt;
end;
end;

begin
writeln('************************游戏开始******************************');
writeln('F:如何游戏:说明游戏方式');
writeln('B:开始游戏:进入游戏');
writeln('Q:退出游戏:离开游戏');
writeln('**************************************************************');
writeln('请输入:');
readln(a);
if a='F' then shuoming
else if a='B' then kaishi
else if a='Q' then halt;
end.

19 条评论

  • @ 2016-08-16 20:58:42

    orz

  • @ 2016-04-04 16:18:31

    今年dsksjcxwkcxqwkxwlxwlx‘21;s21’

    11类食物

  • @ 2016-03-10 17:32:34

    最新修改
    program game;
    var a:char;
    i,j,m,n:integer;
    ma:array[1..10,1..10]of integer;
    hp,mp,money,ql,dengji,fy,atc,mc,hpmax,mpmax,zhiye,mcp,JY:integer;
    procedure map;
    begin
    m:=5;
    n:=5;
    writeln('****map**');
    for i:=1 to 10 do
    begin
    for j:=1 to 10 do
    begin
    if (i=m)and(j=n)then
    begin
    ma[i,j]:=9;
    write('9 ');
    end
    else
    begin
    randomize;
    ma[i,j]:=random(10);
    if ma[i,j]>=5 then write('0 ');
    if ma[i,j]<4 then write('1 ');
    end;
    end;
    writeln;
    end;
    writeln('*************');
    readln;
    end;
    procedure save;
    var t:text;
    begin
    rewrite(t);
    writeln(t,dengji);
    writeln(t,hpmax,' ',hp);
    writeln(t,mpmax,' ',mp);
    writeln(t,ql);
    writeln(t,fy);
    writeln(t,mc);
    writeln(t,atc);
    writeln(t,money);
    end;
    procedure load;
    var t:text;
    begin
    reset(t);
    readln(t,dengji);
    readln(t,hpmax,hp);
    readln(t,mpmax,mp);
    readln(t,ql);
    readln(t,fy);
    readln(t,mc);
    readln(t,atc);
    readln(t,money);
    end;
    procedure ziliao;
    begin
    writeln('**************RENWU*****************');
    writeln('DENGJI',dengji);
    writeln('HP',hpmax,'/',hp);
    writeln('MP',mpmax,'/',mp);
    writeln('money',money);
    writeln('SHENJIJY/xzJY',dengji*100+30,'/',JY);
    writeln('************************************************');
    end;
    procedure shengji;
    begin
    if JY>=dengji*100+30 then
    begin
    writeln('level up');
    dengji:=dengji+1;
    JY:=JY-dengji*100+70;
    if zhiye=1 then
    begin
    atc:=atc+dengji*15;
    fy:=fy+dengji*10;
    mcp:=mcp+dengji*6;
    hpmax:=hpmax+dengji*50;
    mpmax:=mpmax+dengji*3;
    end;
    if zhiye=2 then
    begin
    atc:=atc+dengji*8;
    fy:=fy+dengji*5;
    mcp:=mcp+dengji*15;
    hpmax:=hpmax+dengji*30;
    mpmax:=mpmax+dengji*5;
    end;
    if zhiye=3 then
    begin
    atc:=atc+dengji*25;
    fy:=fy+dengji*4;
    mcp:=mcp+dengji*12;
    hpmax:=hpmax+dengji*20;
    mpmax:=mpmax+dengji*4;
    end;
    writeln('#############ZILIAO###########');
    writeln('dengji',dengji);
    hp:=hpmax;
    writeln('HP',hpmax,'/',hp);
    mp:=mpmax;
    writeln('MP',mpmax,'/',mp);
    writeln('atc',atc);
    writeln('fy',fy);
    writeln('MC',mc);
    end;
    end;

    procedure guaishou;
    var p:char;
    z,ghp,fyl,gatc,gatc1,hp0,mcp,burn,ice:integer;
    begin
    ql:=0;
    ice:=0;
    burn:=0;
    writeln('GUAISHOU Y fight N run Y/N');
    readln(p);
    ghp:=random(2000+dengji*dengji*dengji*4);
    gatc:=ghp mod 5+random(100)+dengji*50;
    hp0:=ghp;
    fyl:=fy;
    if p='Y' then
    begin
    writeln('fight start');
    while (hp>0)and(ghp>0) do
    begin
    writeln('HP',hpmax,'/',hp,' ','MP:',mpmax,'/',mp,' ','QILI',ql);
    writeln('gs HP',hp0,'/',ghp);
    writeln('1 putong 2 mofa 3 bisha 4 fangyu 5 taopao');
    writeln('(bisha de xiaoguo youleijide qili jueding,qilimeihuihe+10)');
    readln(p);
    z:=random(5);
    if z=5 then
    begin
    if p='1' then
    begin
    write('invalid');
    readln;
    end;
    if p='2' then
    begin
    write('miss');
    readln;
    end;
    end
    else
    begin
    if p='1'
    then
    begin
    ghp:=ghp-atc;
    if ghp<=0
    then
    begin
    write('win jy+',hp0 div 5);
    readln;
    z:=random(3);
    JY:=JY+(hp0 div 5);
    if z=2 then
    begin
    writeln('money+',(hp0 div 5));
    money:=money+(hp0 div 5);
    end;
    shengji;
    shengji;
    ql:=ql+10;
    break;
    end
    else
    begin
    write('guai HP-',atc,'guai HP',hp0,'/',ghp);
    readln;
    ql:=ql+10;
    end;
    end;
    if p='2'
    then
    begin
    begin
    writeln('choice mofa');
    if dengji>=0 then writeln('1.fireball -110+ mp-2');
    if dengji>=2 then writeln('2.fire -150+ burn meihuihe-100 mp-5');
    if dengji>=4 then writeln('3.iceball -200+ ice 1 mp-10');
    if dengji>=6 then writeln('4.icecolumn -250+ ice 2 mp-20');
    if dengji>=8 then writeln('5.tigerfire -400+ burn meihuihe-500 mp-40');
    if dengji>=10 then writeln('6.icewind -450+ ice 3 mp-40');
    if dengji>=14 then writeln('7.Gasoline bomb -300+ burn meihuihe-2000 mp-80');
    if dengji>=20 then writeln('8. -600+ absolute zero ice 5 mp-150');
    readln(p);
    if p='1' then
    if mp>=2
    then
    begin
    mp:=mp-2;
    mcp:=110+mc;
    end;
    if p='2' then
    if mp>=5
    then
    begin
    mp:=mp-5;
    mcp:=600+mc*5 mod 4;
    burn:=burn+100;
    end;
    if p='3' then
    if mp>=10
    then
    begin
    mp:=mp-10;
    mcp:=300+mc*3 mod 2;
    ice:=ice+1;
    end;
    if p='4' then
    if mp>=20
    then
    begin
    mp:=mp-20;
    mcp:=250+mc*2;
    ice:=ice+2;
    end;
    if p='5' then
    if mp>=40
    then
    begin
    mp:=mp-40;
    mcp:=800+mc*5 mod 2;
    burn:=burn+500;
    end;
    if p='6' then
    if mp>=40
    then
    begin
    mp:=mp-40;
    mcp:=450+mc*3;
    ice:=ice+3;
    end;
    if p='7' then
    if mp>=80
    then
    begin
    mp:=mp-80;
    mcp:=600+mc*5 mod 2;
    burn:=burn+2000;
    end;
    if p='8' then
    if mp>=150
    then
    begin
    mp:=mp-250;
    mcp:=600+mc*4;
    ice:=ice+5;
    end;
    end;
    ghp:=ghp-mcp;
    if ghp<0
    then
    begin
    write('win jy+',(hp0 div 5));
    readln;
    JY:=JY+(hp0 div 5);
    z:=random(3);
    if z=3
    then
    begin
    writeln('money',(hp0 div 5));
    money:=money+(hp0 div 5);
    end;
    shengji;
    shengji;
    ql:=ql+10;
    break;
    end
    else
    begin
    write('guai HP-',mcp,'guai HP:',hp0,'/',ghp);
    readln;
    ql:=ql+10;
    end;
    end;
    if p='3'
    then
    begin
    ghp:=ghp-ql*dengji*150;
    if ghp<=0
    then
    begin
    write('win jy+',hp0 div 5);
    readln;
    z:=random(3);
    JY:=JY+(hp0 div 5);
    if z=2 then
    begin
    writeln('money+',(hp0 div 5));
    money:=money+(hp0 div 5);
    end;
    shengji;
    shengji;
    ql:=0;
    break;
    end
    else
    begin
    write('guai HP-',atc,'guai HP',hp0,'/',ghp);
    readln;
    ql:=0;
    end;
    end;
    if p='4' then fyl:=fy*2;
    if p='5' then begin
    z:=random(3);
    if z=3 then writeln('run fail')
    else exit;
    end;
    end;
    writeln('huihe over');
    writeln('guaishou gongji');
    z:=random(4);
    if z=1 then
    begin
    write('miss! ye!');
    readln;
    end
    else
    begin
    if ice>0
    then
    begin
    ice:=ice-1;
    gatc1:=0;
    writeln('guaishou ice')
    end
    else
    gatc1:=gatc;
    if fyl>=gatc then
    begin
    write('fangyu chenggong');
    readln;
    end
    else
    begin
    hp:=hp+fyl-gatc1;
    if hp>0 then
    begin
    write('hp-',gatc1-fyl,' ',hpmax,'/',hp);
    readln;
    end
    else
    begin
    write('game over');
    readln;
    halt;
    end;
    end;
    write('huihe over');
    if burn>0 then begin
    writeln('burn guai HP-',burn,'guai HP',hp0,'/',ghp);
    ghp:=ghp-burn;
    if ghp<=0
    then
    begin
    write('win jy+',hp0 div 5);
    readln;
    z:=random(5);
    JY:=JY+(hp0 div 5);
    if z=2 then writeln('money+',(hp0 div 5));
    money:=money+(hp0 div 5);
    shengji;
    ql:=ql+10;
    break;
    end
    end
    end;
    end;
    end;
    end;

    procedure shangdian;
    var p:char;
    begin
    writeln('******************store*************************');
    if money<=0 then
    begin
    writeln('boss:go way');
    exit;
    end
    else
    writeln('1.HPyao HP+100 100yuan 2.MPyao MP+25 100yuan');
    write('(what do you want 1/2 Q:Quit)');
    while (money>0)and(p<>'Q') do
    begin
    readln(p);
    if p='1' then
    begin
    if hp+100>hpmax
    then
    begin
    hp:=hpmax;
    writeln('HP',hpmax,'/',hp);
    money:=money-100;
    end
    else
    begin
    hp:=hp+100;
    writeln('HP',hpmax,'/',hp);
    money:=money-100;
    end;
    end
    else
    if p='2' then
    begin
    if mp+25>mpmax
    then
    begin
    mp:=mpmax;
    writeln('mp',mpmax,'/',mp);
    money:=money-100;
    end
    else
    begin
    mp:=mp+25;
    money:=money-100;
    writeln('mp',mpmax,'/',mp);
    end;
    end;
    end;
    if money<=0 then writeln(' boss:go way');
    end;
    procedure kaishi;
    var s,m,n,k,l:integer;
    p:char;
    begin
    write('choice job 1.jianshi 2.fashi 3.cike:');
    readln(l);
    if l=1 then
    begin
    hp:=500;
    hpmax:=hp;
    mp:=30;
    mpmax:=mp;
    money:=1000;
    fy:=100;
    dengji:=1;
    atc:=150;
    mc:=50;
    zhiye:=1;
    end;
    if l=2 then
    begin
    hp:=300;
    hpmax:=hp;
    mp:=50;
    mpmax:=mp;
    money:=1000;
    fy:=50;
    dengji:=1;
    atc:=80;
    mc:=150;
    zhiye:=2;
    end;
    if l=3 then
    begin
    hp:=200;
    hpmax:=hp;
    mp:=30;
    mpmax:=mp;
    money:=1000;
    fy:=40;
    dengji:=1;
    atc:=250;
    mc:=120;
    zhiye:=3;
    end;
    randomize;
    repeat
    writeln('hp:',hpmax,'/',hp,' ','mp:',mpmax,'/',mp,' ','money:',money);
    m:=1;
    n:=1;
    writeln('F walk B buy Z renwu M:map Q quit');
    readln(p);
    if p='F' then
    begin
    writeln('W/S/A/D');
    readln(p);
    if p='W'
    then
    begin
    m:=m+1;
    if m>10 then
    begin
    writeln('cannot walk');
    m:=m-1;
    end
    else
    guaishou;
    end;
    if p='S'
    then
    begin
    m:=m-1;
    if m<1 then
    begin
    writeln('cannot walk');
    m:=m+1;
    end
    else
    guaishou;
    end;
    if p='D'
    then
    begin
    m:=n+1;
    if n>10 then
    begin
    writeln('cannot walk');
    n:=n-1;
    end
    else guaishou;
    end;
    if p='A'
    then
    begin
    n:=n-1;
    if n<1 then
    begin
    writeln('cannot walk');
    n:=n+1;
    end
    else guaishou;
    end;
    end;
    if p='B' then shangdian;
    if p='Z' then ziliao;
    if p='M' then map;
    until p='Q';
    end;

    procedure shuoming;
    var p:char;
    begin
    writeln('*********************shuoming************************');
    writeln('shuomingshangweiwanshan');
    writeln('......');
    writeln('......');
    writeln('......');
    writeln('......');
    writeln('......');
    writeln('start now Y/N');
    readln(p);
    if p='N' then halt
    else if p='Y' then kaishi
    else
    begin
    writeln('fool me you will die');
    readln;
    halt;
    end;
    end;
    begin
    writeln('*********************start************************');
    writeln('F:shuoming');
    writeln('B:start');
    writeln('Q:quit');
    writeln('***********************************************************');
    writeln('please write');
    readln(a);
    if a='F' then shuoming
    else if a='B' then kaishi
    else if a='Q' then halt;
    end.

  • @ 2016-03-09 18:15:40

    LZ你的程序到底有多少bug
    program game;
    var a:char;
    i,j,m,n:integer;
    ma:array[1..10,1..10]of integer;
    hp,mp,money,ql,dengji,fy,atc,mc,hpmax,mpmax,zhiye,mcp,JY:integer;
    procedure map;
    begin
    m:=5;
    n:=5;
    writeln('****map**');
    for i:=1 to 10 do
    begin
    for j:=1 to 10 do
    begin
    if (i=m)and(j=n)then
    begin
    ma[i,j]:=9;
    write('9 ');
    end
    else
    begin
    randomize;
    ma[i,j]:=random(10);
    if ma[i,j]>=5 then write('0 ');
    if ma[i,j]<4 then write('1 ');
    end;
    end;
    writeln;
    end;
    writeln('*************');
    readln;
    end;
    procedure save;
    var t:text;
    begin
    rewrite(t);
    writeln(t,dengji);
    writeln(t,hpmax,' ',hp);
    writeln(t,mpmax,' ',mp);
    writeln(t,ql);
    writeln(t,fy);
    writeln(t,mc);
    writeln(t,atc);
    writeln(t,money);
    end;
    procedure load;
    var t:text;
    begin
    reset(t);
    readln(t,dengji);
    readln(t,hpmax,hp);
    readln(t,mpmax,mp);
    readln(t,ql);
    readln(t,fy);
    readln(t,mc);
    readln(t,atc);
    readln(t,money);
    end;
    procedure ziliao;
    begin
    writeln('**************RENWU*****************');
    writeln('DENGJI',dengji);
    writeln('HP',hpmax,'/',hp);
    writeln('MP',mpmax,'/',mp);
    writeln('money',money);
    writeln('SHENJIJY/xzJY',dengji*100+30,'/',JY);
    writeln('************************************************');
    end;
    procedure shengji;
    begin
    if JY>=dengji*100+30 then
    begin
    writeln('level up');
    dengji:=dengji+1;
    JY:=JY-dengji*100+70;
    atc:=atc+dengji*20;
    fy:=fy+dengji*10;
    mcp:=mcp+dengji*15;
    hpmax:=hpmax+dengji*50;
    mpmax:=mpmax+dengji*40;
    writeln('#############ZILIAO###########');
    writeln('dengji',dengji);
    hp:=hpmax;
    writeln('HP',hpmax,'/',hp);
    mp:=mpmax;
    writeln('MP',mpmax,'/',mp);
    writeln('atc',atc);
    writeln('fy',fy);
    writeln('MC',mc);
    end;
    end;

    procedure guaishou;
    var p:char;
    z,ghp,fyl,gatc,hp0,mcp,burn,ice:integer;
    begin
    ql:=0;
    ice:=0;
    burn:=0;
    writeln('GUAISHOU Y fight N run Y/N');
    readln(p);
    ghp:=random(100+dengji*75)*10;
    gatc:=ghp mod 5+random(100)+dengji*50;
    hp0:=ghp;
    fyl:=fy;
    if p='Y' then
    begin
    writeln('fight start');
    while (hp>0)and(ghp>0) do
    begin
    writeln('HP',hpmax,'/',hp,' ','MP:',mpmax,'/',mp,' ','QILI',ql);
    writeln('gs HP',hp0,'/',ghp);
    writeln('1 putong 2 mofa 3 bisha 4 fangyu 5 taopao');
    writeln('(bisha de xiaoguo youleijide qili jueding,qilimeihuihe+10)');
    readln(p);
    z:=random(5);
    if z=5 then
    begin
    if p='1' then
    begin
    write('invalid');
    readln;
    end;
    if p='2' then
    begin
    write('miss');
    readln;
    end;
    end
    else
    begin
    if p='1'
    then
    begin
    ghp:=ghp-atc;
    if ghp<=0
    then
    begin
    write('win jy+',hp0 div 5);
    readln;
    z:=random(5);
    JY:=JY+(hp0 div 5);
    if z=2 then writeln('money+',(hp0 div 5));
    money:=money+(hp0 div 5);
    shengji;
    shengji;
    ql:=ql+10;
    break;
    end
    else
    begin
    write('guai HP-',atc,'guai HP',hp0,'/',ghp);
    readln;
    ql:=ql+10;
    end;
    end;
    if p='2'
    then
    begin
    begin
    writeln('choice mofa');
    if dengji>=0 then writeln('1.fireball -110+ mp-2');
    if dengji>=2 then writeln('2.fire -150+ burn meihuihe-100 mp-5');
    if dengji>=4 then writeln('3.iceball -200+ ice 1 mp-10');
    if dengji>=6 then writeln('4.icecolumn -250+ ice 2 mp-20');
    if dengji>=8 then writeln('5.tigerfire -400+ burn meihuihe-300 mp-40');
    if dengji>=10 then writeln('6.icewind -450+ ice 3 mp-40');
    if dengji>=14 then writeln('7.Gasoline bomb -300+ burn meihuihe-500 mp-60');
    if dengji>=20 then writeln('8. -600+ absolute zero ice 5 mp-80');
    readln(p);
    if p='1' then
    if mp>=2
    then
    begin
    mp:=mp-2;
    mcp:=110+mc;
    end;
    if p='2' then
    if mp>=5
    then
    begin
    mp:=mp-5;
    mcp:=150+mc;
    burn:=burn+100;
    end;
    if p='3' then
    if mp>=10
    then
    begin
    mp:=mp-10;
    mcp:=200+mc;
    ice:=ice+1;
    end;
    if p='4' then
    if mp>=20
    then
    begin
    mp:=mp-20;
    mcp:=250+mc;
    ice:=ice+2;
    end;
    if p='5' then
    if mp>=40
    then
    begin
    mp:=mp-40;
    mcp:=400+mc;
    burn:=burn+300;
    end;
    if p='6' then
    if mp>=40
    then
    begin
    mp:=mp-40;
    mcp:=450+mc;
    ice:=ice+3;
    end;
    if p='7' then
    if mp>=60
    then
    begin
    mp:=mp-60;
    mcp:=300+mc;
    burn:=burn+500;
    end;
    if p='8' then
    if mp>=80
    then
    begin
    mp:=mp-80;
    mcp:=600+mc;
    ice:=ice+5;
    end;
    end;
    ghp:=ghp-mcp;
    if ghp<0
    then
    begin
    write('win jy+',(hp0 div 5));
    readln;
    JY:=JY+(hp0 div 5);
    z:=random(5);
    if z=3 then writeln('money',(hp0 div 5));
    money:=money+(hp0 div 5);
    shengji;
    shengji;
    ql:=ql+10;
    break;
    end
    else
    begin
    write('guai HP-',mcp,'guai HP:',hp0,'/',ghp);
    readln;
    ql:=ql+10;
    end;
    end;
    if p='3'
    then
    begin
    ghp:=ghp-ql*dengji*150;
    if ghp<=0
    then
    begin
    write('win jy+',hp0 div 5);
    readln;
    z:=random(5);
    JY:=JY+(hp0 div 5);
    if z=2 then writeln('money+',(hp0 div 5));
    money:=money+(hp0 div 5);
    shengji;
    shengji;
    ql:=0;
    break;
    end
    else
    begin
    write('guai HP-',atc,'guai HP',hp0,'/',ghp);
    readln;
    ql:=0;
    end;
    end;
    if p='4' then fyl:=fy*2;
    if p='5' then begin
    z:=random(3);
    if z=3 then writeln('run fail')
    else exit;
    end;
    end;
    writeln('huihe over');
    writeln('guaishou gongji');
    z:=random(4);
    if z=1 then
    begin
    write('miss! ye!');
    readln;
    end
    else
    begin
    if ice<=0 then
    if fyl>=gatc then
    begin
    write('fangyu chenggong');
    readln;
    end
    else
    begin
    hp:=hp+fyl-gatc;
    if hp>0 then
    begin
    write('hp-',gatc-fyl,' ',hpmax,'/',hp);
    readln;
    end
    else
    begin
    write('game over');
    readln;
    halt;
    end;
    end;
    write('huihe over');
    if burn>0 then begin
    writeln('burn guai HP-',burn,'guai HP',hp0,'/',ghp);
    ghp:=ghp-burn;
    if ghp<=0
    then
    begin
    write('win jy+',hp0 div 5);
    readln;
    z:=random(5);
    JY:=JY+(hp0 div 5);
    if z=2 then writeln('money+',(hp0 div 5));
    money:=money+(hp0 div 5);
    shengji;
    ql:=ql+10;
    break;
    end
    end;
    if ice>0 then ice:=ice-1
    end;
    end;
    end;
    end;

    procedure shangdian;
    var p:char;
    begin
    writeln('******************store*************************');
    if money<=0 then
    begin
    writeln('boss:go way');
    exit;
    end
    else
    writeln('1.HPyao HP+100 100yuan 2.MPyao MP+50 100yuan');
    write('(what do you want 1/2 Q:Quit)');
    while (money>0)and(p<>'Q') do
    begin
    readln(p);
    if p='1' then
    begin
    if hp+100>hpmax
    then
    begin
    hp:=hpmax;
    writeln('HP',hpmax,'/',hp);
    money:=money-100;
    end
    else
    begin
    hp:=hp+100;
    writeln('HP',hpmax,'/',hp);
    money:=money-100;
    end;
    end
    else
    if p='2' then
    begin
    if mp+50>mpmax
    then
    begin
    mp:=mpmax;
    writeln('mp',mpmax,'/',mp);
    money:=money-100;
    end
    else
    begin
    mp:=mp+50;
    money:=money-100;
    writeln('mp',mpmax,'/',mp);
    end;
    end;
    end;
    if money<=0 then writeln(' boss:go way');
    end;
    procedure kaishi;
    var s,m,n,k,l:integer;
    p:char;
    begin
    write('choice job 1.jianshi 2.fashi 3.cike:');
    readln(l);
    if l=1 then
    begin
    hp:=500;
    hpmax:=hp;
    mp:=30;
    mpmax:=mp;
    money:=1000;
    fy:=100;
    dengji:=1;
    atc:=150;
    mc:=50;
    zhiye:=1;
    end;
    if l=2 then
    begin
    hp:=300;
    hpmax:=hp;
    mp:=50;
    mpmax:=mp;
    money:=1000;
    fy:=50;
    dengji:=1;
    atc:=80;
    mc:=150;
    zhiye:=2;
    end;
    if l=3 then
    begin
    hp:=200;
    hpmax:=hp;
    mp:=30;
    mpmax:=mp;
    money:=1000;
    fy:=40;
    dengji:=1;
    atc:=250;
    mc:=120;
    zhiye:=3;
    end;
    randomize;
    repeat
    writeln('hp:',hpmax,'/',hp,' ','mp:',mpmax,'/',mp,' ','money:',money);
    m:=1;
    n:=1;
    writeln('F walk B buy Z renwu M:map Q quit');
    readln(p);
    if p='F' then
    begin
    writeln('W/S/A/D');
    readln(p);
    if p='W'
    then
    begin
    m:=m+1;
    if m>10 then
    begin
    writeln('cannot walk');
    m:=m-1;
    end
    else
    guaishou;
    end;
    if p='S'
    then
    begin
    m:=m-1;
    if m<1 then
    begin
    writeln('cannot walk');
    m:=m+1;
    end
    else
    guaishou;
    end;
    if p='D'
    then
    begin
    m:=n+1;
    if n>10 then
    begin
    writeln('cannot walk');
    n:=n-1;
    end
    else guaishou;
    end;
    if p='A'
    then
    begin
    n:=n-1;
    if n<1 then
    begin
    writeln('cannot walk');
    n:=n+1;
    end
    else guaishou;
    end;
    end;
    if p='B' then shangdian;
    if p='Z' then ziliao;
    if p='M' then map;
    until p='Q';
    end;

    procedure shuoming;
    var p:char;
    begin
    writeln('*********************shuoming************************');
    writeln('shuomingshangweiwanshan');
    writeln('......');
    writeln('......');
    writeln('......');
    writeln('......');
    writeln('......');
    writeln('start now Y/N');
    readln(p);
    if p='N' then halt
    else if p='Y' then kaishi
    else
    begin
    writeln('fool me you will die');
    readln;
    halt;
    end;
    end;
    begin
    writeln('*********************start************************');
    writeln('F:shuoming');
    writeln('B:start');
    writeln('Q:quit');
    writeln('***********************************************************');
    writeln('请输入:');
    readln(a);
    if a='F' then shuoming
    else if a='B' then kaishi
    else if a='Q' then halt;
    end.

    • @ 2016-03-09 18:18:24

      查看地图居然会导致程序出现问题……

  • @ 2016-03-07 21:58:19

    不容易啊

  • @ 2016-03-07 21:58:03

    翻译加bug修复完成,除地图外其他功能已经皆可使用(地图过几天我再修复)。(剧情就不翻译了)
    program game;
    var a:char;
    i,j,m,n:integer;
    ma:array[1..10,1..10]of integer;
    hp,mp,money,ql,dengji,fy,atc,mc,hpmax,mpmax,zhiye,jy,mcp:integer;
    procedure map;
    begin
    m:=5;
    n:=5;
    writeln('****map**');
    for i:=1 to 10 do
    begin
    for j:=1 to 10 do
    begin
    if (i=m)and(j=n)then
    begin
    ma[i,j]:=9;
    write('9 ');
    end
    else
    begin
    randomize;
    ma[i,j]:=random(10);
    if ma[i,j]>=5 then write('0 ');
    if ma[i,j]<4 then write('1 ');
    end;
    end;
    writeln;
    end;
    writeln('*************');
    readln;
    end;
    procedure save;
    var t:text;
    begin
    rewrite(t);
    writeln(t,dengji);
    writeln(t,hpmax,' ',hp);
    writeln(t,mpmax,' ',mp);
    writeln(t,ql);
    writeln(t,fy);
    writeln(t,mc);
    writeln(t,atc);
    writeln(t,money);
    end;
    procedure load;
    var t:text;
    begin
    reset(t);
    readln(t,dengji);
    readln(t,hpmax,hp);
    readln(t,mpmax,mp);
    readln(t,ql);
    readln(t,fy);
    readln(t,mc);
    readln(t,atc);
    readln(t,money);
    end;
    procedure ziliao;
    begin
    writeln('**************RENWU*****************');
    writeln('DENGJI',dengji);
    writeln('HP',hpmax,'/',hp);
    writeln('MP',mpmax,'/',mp);
    writeln('money',money);
    writeln('SHENJIJY/xzJY',dengji*100+30,'/',JY);
    writeln('************************************************');
    end;
    procedure shengji;
    begin
    if jy>=dengji*100+30 then
    begin
    writeln('level up');
    dengji:=dengji+1;
    jy:=jy-dengji*100-30;
    atc:=atc+dengji*2+10;
    fy:=fy+dengji*2+10;
    mcp:=mcp+dengji*2+4;
    hpmax:=hpmax+dengji*10;
    mpmax:=mpmax+dengji*8;
    writeln('#############ZILIAO###########');
    writeln('dengji',dengji);
    hp:=hpmax;
    writeln('HP',hpmax,'/',hp);
    mp:=mpmax;
    writeln('MP',mpmax,'/',mp);
    writeln('atg',atc);
    writeln('fy',fy);
    writeln('MC',mc);
    end;
    end;

    procedure guaishou;
    var p:char;
    z,ghp,fyl,gatc,hp0,jy,mcp:integer;
    begin
    writeln('GUAISHOU Y fight N run Y/N');
    readln(p);
    ghp:=random(100)*20;
    gatc:=ghp mod 5+random(100)+dengji*50;
    hp0:=ghp;
    fyl:=fy;
    if p='Y' then
    begin
    writeln('fight start');
    while (hp>0)and(ghp>0) do
    begin
    writeln('HP',hpmax,'/',hp,' ','MP:',mpmax,'/',mp,' ','QILI',ql);
    writeln('gs HP',hp0,'/',ghp);
    writeln('1 putong 2 mofa 3 bisha 4 fangyu 5 taopao');
    readln(p);
    z:=random(11);
    if z=5 then
    begin
    if p='1' then
    begin
    write('invalid');
    readln;
    end;
    if p='2' then
    begin
    write('miss');
    readln;
    end;
    end
    else
    begin
    if p='1'
    then
    begin
    ghp:=ghp-atc;
    if ghp<=0
    then
    begin
    write('win jy+',hp0);
    readln;
    z:=random(5);
    jy:=jy+hp0;
    if z=2 then writeln('money+',(hp0 div 10)*10);
    money:=money+((hp0 div 10)*10);
    readln;
    ql:=ql+10;
    break;
    end
    else
    begin
    write('guai HP-',atc,'guai HP',hp0,'/',ghp);
    readln;
    ql:=ql+10;
    end;
    end;
    if p='2'
    then
    begin
    begin
    writeln('choice mofa');
    if dengji>=0 then writeln('1.fireball -110+ mp-2');
    if dengji>=2 then writeln('2.fire -150+ mp-5');
    if dengji>=4 then writeln('3.iceball -200+ ice 1 mp-10');
    if dengji>=6 then writeln('4.icecolumn -250+ ice 3 mp-20');
    if dengji>=8 then writeln('5.tigerfire -400+ burn meihuihe-10% mp-40');
    if dengji>=10 then writeln('6.icewind -450+ ice 3 mp-40');
    readln(p);
    if p='1' then
    if mp>=2
    then
    begin
    mp:=mp-2;
    mcp:=110+mc;
    end
    else writeln('mp not enough');
    if p='2' then
    if mp>=5
    then
    begin
    mp:=mp-5;
    mcp:=150+mc;
    end
    else writeln('mp not enough');
    if p='3' then
    if mp>=10
    then
    begin
    mp:=mp-10;
    mcp:=200+mc;
    end
    else writeln('mp not enough');
    if p='4' then
    if mp>=20
    then
    begin
    mp:=mp-20;
    mcp:=250+mc;
    end
    else writeln('mp not enough');
    if p='5' then
    if mp>=40
    then
    begin
    mp:=mp-40;
    mcp:=400+mc;
    end
    else writeln('mp not enough');
    if p='6' then
    if mp>=40
    then
    begin
    mp:=mp-40;
    mcp:=400+mc;
    end
    else writeln('mp not enough');
    end;
    ghp:=ghp-mcp;
    if ghp<0
    then
    begin
    write('win jy+',(hp0 mod 10+10));
    readln;
    jy:=jy+hp0;
    z:=random(5);
    if z=3 then writeln('money',(hp0 div 10*10));
    money:=money+((hp0 div 10)*10);
    ql:=ql+10;
    break;
    end
    else
    begin
    write('guai HP-',mcp,'guai HP:',hp0,'/',ghp);
    readln;
    ql:=ql+10;
    end;
    end;
    if p='4' then fyl:=fy*2;
    if p='5' then begin
    z:=random(4);
    if z=3 then writeln('run fail')
    else exit;
    end;
    end;
    writeln('huihe over');
    writeln('guaishou gongji');
    z:=random(9);
    if z=1 then
    begin
    write('miss! ye!');
    readln;
    end
    else
    begin
    if fy>=gatc mod 2 then
    begin
    write('fangyu chenggong');
    readln;
    end
    else
    begin
    hp:=hp+fyl-gatc;
    if hp>0 then
    begin
    write('hp-',gatc-fyl,' ',hpmax,'/',hp);
    readln;
    end
    else
    begin
    write('game over');
    readln;
    halt;
    end;
    end;
    write('huihe over');
    readln;
    end;
    end;
    shengji;

    end;
    end;

    procedure shangdian;
    var p:char;
    begin
    writeln('******************store*************************');
    if money<=0 then
    begin
    writeln('boss:go way');
    exit;
    end
    else
    writeln('1.HPyao HP+100 100yuan 2.MPyao MP+50 100yuan');
    write('(what do you want 1/2 Q:Quit)');
    while (money>0)and(p<>'Q') do
    begin
    readln(p);
    if p='1' then
    begin
    if hp+100>hpmax
    then
    begin
    hp:=hpmax;
    writeln('HP',hpmax,'/',hp);
    money:=money-100;
    end
    else
    begin
    hp:=hp+100;
    writeln('HP',hpmax,'/',hp);
    money:=money-100;
    end;
    end
    else
    if p='2' then
    begin
    if mp+50>mpmax
    then
    begin
    mp:=mpmax;
    writeln('mp',mpmax,'/',mp);
    money:=money-100;
    end
    else
    begin
    mp:=mp+50;
    money:=money-100;
    writeln('mp',mpmax,'/',mp);
    end;
    end;
    end;
    if money<=0 then writeln(' boss:go way');
    end;
    procedure kaishi;
    var s,m,n,k,l:integer;
    p:char;
    begin
    write('choice job 1.jianshi 2.fashi :');
    readln(l);
    if l=1 then
    begin
    hp:=500;
    hpmax:=hp;
    mp:=30;
    mpmax:=mp;
    money:=1000;
    fy:=100;
    dengji:=1;
    atc:=150;
    mc:=50;
    zhiye:=1;
    end;
    if l=2 then
    begin
    hp:=300;
    hpmax:=hp;
    mp:=50;
    mpmax:=mp;
    money:=1000;
    fy:=50;
    dengji:=1;
    atc:=80;
    mc:=150;
    zhiye:=2;
    end;

    randomize;
    repeat
    writeln('hp:',hpmax,'/',hp,' ','mp:',mpmax,'/',mp,' ','money:',money);
    m:=1;
    n:=1;
    writeln('F walk B buy Z renwu M:map Q quit');
    readln(p);
    if p='F' then
    begin
    writeln('W/S/A/D');
    readln(p);
    if p='W'
    then
    begin
    m:=m+1;
    if m>10 then
    begin
    writeln('cannot walk');
    m:=m-1;
    end
    else
    if ma[m,n]=0 then writeln('nothing');
    if ma[m,n]=1 then guaishou;
    end;
    if p='S'
    then
    begin
    m:=m-1;
    if m<1 then
    begin
    writeln('cannot walk');
    m:=m+1;
    end
    else
    if ma[m,n]=0 then writeln('nothing');
    if ma[m,n]=1 then guaishou;
    end;
    if p='D'
    then
    begin
    m:=n+1;
    if n>10 then
    begin
    writeln('cannot walk');
    n:=n-1;
    end
    else
    if ma[m,n]=0 then writeln('nothing');
    if ma[m,n]=1 then guaishou;
    end;
    if p='A'
    then
    begin
    n:=n-1;
    if n<1 then
    begin
    writeln('cannot walk');
    n:=n+1;
    end
    else
    if ma[m,n]=0 then writeln('nothing');
    if ma[m,n]=1 then guaishou;
    end;
    end;
    if p='B' then shangdian;
    if p='Z' then ziliao;
    if p='M' then map;
    until p='Q';
    end;

    procedure shuoming;
    var p:char;
    begin
    writeln('*********************游戏说明************************');
    writeln('你是一个英雄,在峡谷里前进,前方可能有妖怪,也可能有宝物。');
    writeln('你遇到野兽时,你可以用身上的东西向他攻击。按G键是攻击,按');
    writeln('T键是逃跑,但可能逃不掉哦!你开始只有一把小刀,以后可能拣');
    writeln('到其它宝物,要加油哦!你的任务是找到传说中的宝物-CSW之剑');
    writeln('然后打败大魔王(剧情比较老土,请见谅......)');
    writeln('**********************************************************');
    writeln('start now Y/N');
    readln(p);
    if p='N' then halt
    else if p='Y' then kaishi
    else
    begin
    writeln('fool me,you will die!');
    readln;
    halt;
    end;
    end;

    begin
    writeln('*********************start************************');
    writeln('F:shuoming');
    writeln('B:start');
    writeln('Q:quit');
    writeln('***********************************************************');
    writeln('please write:');
    readln(a);
    if a='F' then shuoming
    else if a='B' then kaishi
    else if a='Q' then halt;
    end.

  • @ 2016-03-07 21:35:23

    我用了30分钟修各种bug,我要投诉这游戏55555555555555

  • @ 2016-03-07 20:15:18

    我正将其中汉字翻译成拼音与简单的英语……55555555555

  • @ 2015-07-09 12:45:21

    一堆乱码实在提不起兴趣来看。

  • @ 2015-05-02 15:08:06

    地图怎么看啊

  • @ 2015-03-27 22:11:14

    给你提一个建议,如果你是Lazarus编译的话,那么请用这个:writeln(utf8toansi('汉字'));

  • @ 2013-10-20 16:04:41

    在pascal里都是一堆乱码

  • @ 2013-08-20 12:37:34

    我记得这个版本有bug

  • @ 2013-08-20 10:01:54

    酱油

  • @ 2013-08-13 20:22:49

    在RQ作死做多了挖坟挖够了跑Tyvj来捣乱了么。。

  • @ 2013-08-12 15:52:43

    感觉很逗= =


    在VJ上发这种东西真的好吗= =

    • @ 2013-08-12 22:25:35

      额、我看里面有个游戏帖,就把以前的玩意发上来了

  • @ 2013-08-12 11:21:22

    *是 9 来表示位置么......

    • @ 2013-08-12 22:47:01

      推荐你看看我另外两个帖子,去游戏专栏里面可以看到

  • @ 2013-08-12 11:20:01

    地图是怎么看的

    • @ 2013-08-12 22:46:37

      不是看的,不完整,是部分的,直接移动

  • @ 2013-08-11 23:17:32

    好吧、、vijos一加*就斜体、、、无语了

  • 1