Κώδικας: Επιλογή όλων
program spectre;
Uses Crt;
var a, b, x, weapon:integer;
selection, direction : char;
raceName, className, myName : String;
strength, intelligence, agility, location : integer;
weapons:array[1..5] of string;
begin
TextColor (lightred);
writeln ('welcome to my game');
writeln (' ___ ____ ____ ___ ____ ____ ____ ');
writeln ('/ __)( _ \( ___)/ __)(_ _)( _ \( ___)');
writeln ('\__ \ )___/ )__)( (__ )( ) / )__) ');
writeln ('(___/(__) (____)\___) (__) (_)\_)(____)');
writeln();
writeln ('Please, what is your name oh great one!?');
readln(myName);
writeln('Welcome oh magestic ', myName);
writeln ('------------------------');
repeat
writeln ('(1) human');
writeln ('(2) orc');
writeln ('(3) undead');
writeln ('(4) elf');
writeln();
writeln ('please choose your race');
read (a);
writeln();
until (a>=1) and (a<=4);
case (a) of
1:begin
writeln ('you choose to be a Human');
raceName:='Human';
strength:= 20;
intelligence :=15;
agility := 15;
end;
2:begin
writeln ('you choose to be an orc');
raceName:='Orc';
strength:= 40;
intelligence :=0;
agility := 10;
end;
3:begin
writeln ('you choose to be an undead');
raceName:='Undead';
strength:= 10;
intelligence :=20;
agility := 20;
end;
4:begin
writeln ('you choose to be an elf');
raceName:='Elf';
strength:= 10;
intelligence :=40;
agility := 0;
end;
end;
writeln();
repeat
writeln ('(1) mage');
writeln ('(2)warrior');
writeln ('(3)priest');
writeln('(4) archer');
writeln();
writeln ('please select your class');
read(b);
writeln();
until (b>=1) and (b<=4);
case (b) of
1:begin
writeln ('you choose to be a mage');
className:='Mage';
strength:= strength + 35;
intelligence := intelligence + 0;
agility := agility + 15;
end;
2:begin
writeln ('you choose to be a warrior');
className:='Warrior';
strength:= strength + 0;
intelligence := intelligence + 50;
agility := agility + 0;
end;
3:begin
writeln ('you choose to be a priest');
className:='Priest';
strength:= strength + 10;
intelligence := intelligence + 0;
agility := agility + 40;
end;
4:begin
writeln ('you choose to be an archer');
className:='Archer';
strength:= strength + 10;
intelligence := intelligence + 40;
agility := agility + 0;
end;
end;
repeat
weapons[1]:= 'Scepter';
weapons[2]:= 'Longsword';
weapons[3]:= 'staff';
weapons[4]:= 'bow';
writeln('------------------------------');
writeln('Please choose your weapon!!! ');
for x:=1 to 4 do
writeln(weapons[x]);
read(weapon);
until (weapon<=4) and (weapon>=1);
writeln();
writeln('Your weapon is,', weapons[weapon]);
writeln();
writeln('--------------------------------');
write('Thank you very much amazing ', raceName, ' ', className, '!!!');
write('Your Stats are: Strength: ', strength, ' Intelligence: ', intelligence, ' Agility: ', agility, 'Your weapon is:', weapons[weapon], '!');
writeln ();
readln(); // must be here!
writeln('-----------------------------');
{repeat
writeln ('Where you want me to go?');
readln(selection);
until (selection='N') or (selection='W') or (selection='S') or (selection='E');
if (selection = 'N') then
begin
writeln ('you are in a cave');
end
else if (selection = 'W') then
begin
writeln ('you are in a lake');
end
else if (selection = 'S') then
begin
writeln ('you are in a forest');
end
else if (selection = 'E') then
begin
writeln ('you are in a village');
end;
writeln();}
location:=0;
//readln();
repeat
case(location) of
0:
begin
writeln('You are in the SUMMONER RIFT ');
writeln('Choose your next step');
writeln('For moving North press(n)');
writeln('For moving South press(s)');
writeln('For moving East press(e)');
writeln('For moving West press(w)');
readln(direction);
case(direction) of
'n':
begin
location:=1;
end;
'e':
begin
location:=2;
end;
's':
begin
location:=3;
end;
'w':
begin
location:=4;
end;
end;
end;
1:
begin
writeln('You moving to the forest');
writeln('went south. You are in a junction');
writeln('For moving South press(s)');
readln(direction);
case(direction) of
's':
begin
location:=0;
end;
end;
end;
2:
begin
writeln('You are entering a lake ');
writeln('went west. You are in a junction');
writeln('For moving West press(w)');
readln(direction);
case(direction) of
'w':
begin
location:=0;
end;
end;
end;
3:
begin
writeln('You enter to a cave ');
writeln('You went north. You are in a junction');
writeln('For moving North press(n)');
readln(direction);
case(direction) of
'n':
begin
location:=0;
end;
end;
end;
4:
begin
writeln('You are entering the village');
writeln('You went east. You are in a junction');
writeln('For moving East press(e)');
readln(direction);
case(direction) of
'e':
begin
location:=0;
end;
end;
end;
end;
until(direction='a');
end.