Merci à tous, je vais potasser vos propositions, ne serait-ce que pour m’améliorer un peu en syntaxe.
Voici ce que j’ai bricolé en attendant :
[code]« map » by Pieyre Wittmann
Include French by Eric Forgeot.
Use French Language.
Include Basic Screen Effects by Emily Short.
Include boussole by Benjamin Roux.
A maproom is a kind of room.
A room can be plaine, forêt, marais or désert. A room is usually plaine.
Before printing the locale description when player is in a plaine room, say « [line break]Vous êtes dans une plaine. ».
Before printing the locale description when player is in a forêt room, say « [line break]Vous êtes dans une forêt. ».
Before printing the locale description when player is in a marais room, say « [line break]Vous êtes dans des marais. ».
Before printing the locale description when player is in a désert room, say « [line break]Vous êtes dans un désert. ».
After printing the locale description when player is in a maproom, say « [line break]Il est : [bold type][time of day][roman type]. Les directions possibles sont :[line break][exits] ».
A room can be faite. A room is usually not faite.
A direction can be flat. A direction is usually flat. Outside is not flat. Inside is not flat. Up is not flat. Down is not flat.
Before going somewhere :
clear the screen.
Before going somewhere when player is in a plaine room:
repeat with x running from 1 to a random number between 5 and 15
begin;
follow the turn sequence rules;
end repeat.
Before going somewhere when player is in a forêt room:
repeat with x running from 1 to a random number between 15 and 45
begin;
follow the turn sequence rules;
end repeat.
Before going somewhere when player is in a marais room:
repeat with x running from 1 to a random number between 45 and 120
begin;
follow the turn sequence rules;
end repeat.
Room1 is a maproom.
Room2 is a maproom.
Room3 is a maproom.
Room4 is a maproom.
Room5 is a maproom.
Room6 is a maproom.
Room7 is a maproom.
Room8 is a maproom.
Room9 is a maproom.
Room10 is a maproom.
Room11 is a maproom.
Room12 is a maproom.
Room13 is a maproom.
Room14 is a maproom.
Room15 is a maproom.
Room16 is a maproom.
Room17 is a maproom.
Room18 is a maproom.
Room19 is a maproom.
Room20 is a maproom.
To say exits:
repeat with D running through directions:
if the room D from the location is a room, say « [line break]• [D][line break] ».
An arbre is a kind of thing.
A sapin is a kind of arbre. There are 100 sapin.
A chêne is a kind of arbre. There are 100 chêne.
A hêtre is a kind of arbre. There are 100 hêtre.
When play begins:
[ ROOM 1 —> R ]
let R be a random not faite maproom which is not Room1;
let D1 be a random flat direction;
let D2 be the opposite of D1;
change the D1 exit of Room1 to R;
change the D2 exit of R to Room1;
now Room1 is faite;
now R is faite;
[ TYPE DE ROOM ]
if a random chance of 1 in 5 succeeds
begin;
now R is forêt;
let ARB be a random number between 5 and 15;
repeat with x running from 1 to ARB
begin;
move a random arbre to R;
end repeat;
otherwise if a random chance of 1 in 15 succeeds;
now R is marais;
otherwise if a random chance of 1 in 50 succeeds;
now R is désert;
end if;
[ R —> R2 ]
let R2 be a random not faite maproom which is not Room1;
let D1 be a random flat direction;
let D2 be the opposite of D1;
change the D1 exit of R to R2;
change the D2 exit of R2 to R;
now R2 is faite;
[ TYPE DE ROOM ]
if a random chance of 1 in 5 succeeds
begin;
now R2 is forêt;
let ARB be a random number between 5 and 15;
repeat with x running from 1 to ARB
begin;
move a random arbre to R2;
end repeat;
otherwise if a random chance of 1 in 15 succeeds;
now R2 is marais;
otherwise if a random chance of 1 in 50 succeeds;
now R2 is désert;
end if;
[ R —> R3 ]
let R3 be a random not faite maproom which is not Room1;
let D1 be a random flat direction;
let D2 be the opposite of D1;
change the D1 exit of R to R3;
change the D2 exit of R3 to R;
now R3 is faite;
[ TYPE DE ROOM ]
if a random chance of 1 in 5 succeeds
begin;
now R3 is forêt;
let ARB be a random number between 5 and 15;
repeat with x running from 1 to ARB
begin;
move a random arbre to R3;
end repeat;
otherwise if a random chance of 1 in 15 succeeds;
now R3 is marais;
otherwise if a random chance of 1 in 50 succeeds;
now R3 is désert;
end if;
[ R2 —> R4 ]
let R4 be a random not faite maproom which is not Room1;
let D1 be a random flat direction;
let D2 be the opposite of D1;
change the D1 exit of R2 to R4;
change the D2 exit of R4 to R2;
now R4 is faite;
[ TYPE DE ROOM ]
if a random chance of 1 in 5 succeeds
begin;
now R4 is forêt;
let ARB be a random number between 5 and 15;
repeat with x running from 1 to ARB
begin;
move a random arbre to R4;
end repeat;
otherwise if a random chance of 1 in 15 succeeds;
now R4 is marais;
otherwise if a random chance of 1 in 50 succeeds;
now R4 is désert;
end if.
Player is in Room1[/code]
La map est générée aléatoirement - sa taille est variable. Et j’ai mis un petit système qui détermine aléatoirement, aussi, le type de terrain. C’est très brouillon mais à partir de là tout est possible.
J’ai corrigé ce qui me semblait buguer - le problème étant qu’en allant au nord, puis au sud, par exemple, on ne revenait pas forcément au point de départ.
Si quelqu’un se sent de faire x essais pour vérifier … j’en fais moi aussi de mon côté.