hello
me revoilà avec des questions tordues…
j’ai crée dans mon jeu des arbres (containers) permettant qu’on y cueille des fruits. Ca marche comme ça :
[code]An arbrefruitier is a kind of container.
A pommier is a kind of arbrefruitier. It is male. It is undescribed.
A poirier is a kind of arbrefruitier. It is male. It is undescribed.
A cerisier is a kind of arbrefruitier. It is male. It is undescribed.
A fruit is a kind of aliment. Fruit is male.
A pomme is a kind of fruit. It is female.
A poire is a kind of fruit. It is female.
A cerise is a kind of fruit. It is female.
Each pommier contains 80 pommes.
Each poirier contains 80 poires.
Each cerisier contains 80 cerises.
A légume is a kind of aliment. légume is male.
A chou is a kind of légume. It is male. The printed plural name is « choux ».
A patate is a kind of légume. It is female.
Rule for printing the name of an arbrefruitier (called A):
say « [the printed name of A] »;
omit contents in listing.
After printing the name of an arbrefruitier (called P):
if the number of fruits in P is less than 1
begin;
say " (sans fruits)";
end if.
Carry out looking :
if player is in a room which contains an pommier
begin;
if the number of pommiers in the location of the player is less than 2
begin;
let P be a random pommier in the location of the player;
say « [if the number of fruits in P is less than 1]Il y a un pommier (sans fruits) ici[otherwise]Il y a un pommier ici[end if]. »;
otherwise if the number of pommiers in the location of the player is less than 6;
say « Il y a un petit verger avec [number of pommiers in the location of the player] pommiers plantés ici. »;
otherwise if the number of pommiers in the location of the player is greater than 5;
say « Il y a un verger avec des pommiers plantés ici. »;
end if;
end if;
if player is in a room which contains an poirier
begin;
if the number of poiriers in the location of the player is less than 2
begin;
let P be a random poirier in the location of the player;
say « [if the number of fruits in P is less than 1]Il y a un poirier (sans fruits) ici[otherwise]Il y a un poirier ici[end if]. »;
otherwise if the number of poiriers in the location of the player is less than 6;
say « Il y a un petit verger avec [number of poiriers in the location of the player] poiriers plantés ici. »;
otherwise if the number of poiriers in the location of the player is greater than 5;
say « Il y a un verger avec des poiriers plantés ici. »;
end if;
end if;
if player is in a room which contains an cerisier
begin;
if the number of cerisiers in the location of the player is less than 2
begin;
let P be a random cerisier in the location of the player;
say « [if the number of fruits in P is less than 1]Il y a un cerisier (sans fruits) ici[otherwise]Il y a un cerisier ici[end if]. »;
otherwise if the number of cerisiers in the location of the player is less than 6;
say « Il y a un petit verger avec [number of cerisiers in the location of the player] cerisiers plantés ici. »;
otherwise if the number of cerisiers in the location of the player is greater than 5;
say « Il y a un verger avec des cerisiers plantés ici. »;
end if;
end if.
1 pommier is in Champs.
3 pommier are in Champs2.
15 pommier are in Champs3.
1 poirier is in Champs2.
4 poirier are in Champs3.
Cueilling is an action applying to one thing. Understand « cueillir [something] » as cueilling.
Instead of cueilling a fruit:
try taking.[/code]
ça fonctionne parfaitement, SAUF QUE … tindinnnn…
-
si je suis dans un room où il y a un pommier, je peux sans prendre X pommes, et en poser 1 , X ou n’importe quel nombre de pommes inférieur à X , sans soucis
-
par contre si je suis dans une room où il y a plusieurs pommiers, impossible de poser la moindre pomme, même une seule.
et là j’avoue, je ne comprends pas