Inform - Resources - Examples

Back to List

Inventory
Complete

Backward
Forward

Plain
Coloured
Gaudy

This code
in plain text

Browsing Advent.inf

13. Possible heights for the plant: (lines 1374-1577)

1374  Constant TINY_P = 0;
1375  Constant TALL_P = 1;
1376  Constant HUGE_P = 2;
1377   
1378  Room    At_West_End_Of_Twopit_Room "At West End of Twopit Room"
1379    with  name 'west' 'w//' 'end' 'of' 'twopit' 'room',
1380          description
1381              "You are at the west end of the twopit room.
1382               There is a large hole in the wall above the pit at this end of the room.",
1383          e_to At_East_End_Of_Twopit_Room,
1384          w_to In_Slab_Room,
1385          d_to In_West_Pit,
1386          u_to "It is too far up for you to reach.",
1387          before [;
1388            Enter:
1389              if (noun == HoleAbovePit_1) "It is too far up for you to reach.";
1390          ];
1391   
1392  Object  PlantStickingUp "beanstalk"
1393    with  name 'plant' 'beanstalk' 'stalk' 'bean' 'giant' 'tiny' 'little'
1394               'murmuring' 'twelve' 'foot' 'tall' 'bellowing',
1395          describe [;
1396              if (Plant.height == TALL_P)
1397                  "The top of a 12-foot-tall beanstalk is poking out of the west pit.";
1398              "There is a huge beanstalk growing out of the west pit up to the hole.";
1399          ],
1400          before [;
1401            Examine:
1402              RunRoutines(self, describe);
1403              rtrue;
1404            Climb:
1405              if (Plant.height == HUGE_P) <<Climb Plant>>;
1406          ],
1407          found_in At_West_End_Of_Twopit_Room At_East_End_Of_Twopit_Room,
1408    has   absent static;
1409   
1410  Scenic  HoleAbovePit_1 "hole above pit"
1411    with  name 'hole' 'large' 'above' 'pit',
1412          description
1413              "The hole is in the wall above the pit at this end of the room.",
1414          found_in In_West_Pit At_West_End_Of_Twopit_Room;
1415   
1416  ! ------------------------------------------------------------------------------
1417   
1418  Room    In_West_Pit "In West Pit"
1419    with  name 'in' 'west' 'pit',
1420          description
1421              "You are at the bottom of the western pit in the twopit room.
1422               There is a large hole in the wall about 25 feet above you.",
1423          before [;
1424            Climb:
1425              if (noun == Plant) rfalse;
1426              if (Plant.height == TINY_P)
1427                  "There is nothing here to climb.
1428                   Use ~up~ or ~out~ to leave the pit.";
1429          ],
1430          u_to At_West_End_Of_Twopit_Room,
1431    has   nodwarf;
1432   
1433  Object  -> Plant "plant"
1434    with  name 'plant' 'beanstalk' 'stalk' 'bean' 'giant' 'tiny' 'little'
1435               'murmuring' 'twelve' 'foot' 'tall' 'bellowing',
1436          describe [;
1437              switch (self.height) {
1438                TINY_P:
1439                  "There is a tiny little plant in the pit, murmuring ~Water, water, ...~";
1440                TALL_P:
1441                  "There is a 12-foot-tall beanstalk stretching up out of the pit, bellowing ~Water!! Water!!~";
1442                HUGE_P:
1443                  "There is a gigantic beanstalk stretching all the way up to the hole.";
1444              }
1445          ],
1446          before [;
1447            Climb:
1448              switch (self.height) {
1449                TINY_P:
1450                  "It's just a little plant!";
1451                TALL_P:
1452                  print
1453                      "You have climbed up the plant and out of the pit.^";
1454                  PlayerTo(At_West_End_Of_Twopit_Room);
1455                  rtrue;
1456                HUGE_P:
1457                  print
1458                      "You clamber up the plant and scurry through the hole at the top.^";
1459                  PlayerTo(In_Narrow_Corridor);
1460                  rtrue;
1461              }
1462            Take:
1463              "The plant has exceptionally deep roots and cannot be pulled free.";
1464            Water:
1465              if (bottle notin player)
1466                  "You have nothing to water the plant with.";
1467              switch (child(bottle)) {
1468                nothing:
1469                  "The bottle is empty.";
1470                oil_in_the_bottle:
1471                  remove oil_in_the_bottle;
1472                  "The plant indignantly shakes the oil off its leaves and asks, ~Water?~";
1473              }
1474              remove water_in_the_bottle;
1475              switch ((self.height)++) {
1476                TINY_P:
1477                  print
1478                      "The plant spurts into furious growth for a few seconds.^^";
1479                  give PlantStickingUp ~absent;
1480                TALL_P:
1481                  print
1482                      "The plant grows explosively, almost filling the bottom of the pit.^^";
1483                HUGE_P:
1484                  print
1485                      "You've over-watered the plant! It's shriveling up! It's, it's...^^";
1486                  give PlantStickingUp absent;
1487                  remove PlantStickingUp;
1488                  self.height = TINY_P;
1489              }
1490              <<Examine self>>;
1491            Oil:
1492              <<Water self>>;
1493            Examine:
1494              self.describe();
1495              rtrue;
1496          ],
1497          height TINY_P;
1498   
1499  ! ------------------------------------------------------------------------------
1500   
1501  Room    At_East_End_Of_Twopit_Room "At East End of Twopit Room"
1502    with  name 'east' 'e//' 'end' 'of' 'twopit' 'room',
1503          description
1504              "You are at the east end of the twopit room.
1505               The floor here is littered with thin rock slabs, which make it easy to descend the pits.
1506               There is a path here bypassing the pits to connect passages from east and west.
1507               There are holes all over,
1508               but the only big one is on the wall directly over the west pit where you can't get to it.",
1509          e_to In_Swiss_Cheese_Room,
1510          w_to At_West_End_Of_Twopit_Room,
1511          d_to In_East_Pit;
1512   
1513  Scenic  -> "thin rock slabs"
1514    with  name 'slabs' 'slab' 'rocks' 'stairs' 'thin' 'rock',
1515          description "They almost form natural stairs down into the pit.",
1516          before [;
1517            LookUnder, Push, Pull, Take:
1518              "Surely you're joking. You'd have to blast them aside.";
1519          ],
1520    has   multitude;
1521   
1522  ! ------------------------------------------------------------------------------
1523   
1524  Room    In_East_Pit "In East Pit"
1525    with  name 'in' 'east' 'e//' 'pit',
1526          description
1527              "You are at the bottom of the eastern pit in the twopit room.
1528               There is a small pool of oil in one corner of the pit.",
1529          u_to At_East_End_Of_Twopit_Room,
1530    has   nodwarf;
1531   
1532  Scenic  -> Oil "pool of oil"
1533    with  name 'pool' 'oil' 'small',
1534          description "It looks like ordinary oil.",
1535          before [;
1536            Drink:
1537              "Absolutely not.";
1538            Take:
1539              if (bottle notin player)
1540                  "You have nothing in which to carry the oil.";
1541              <<Fill bottle>>;
1542            Insert:
1543              if (second == bottle) <<Fill bottle>>;
1544              "You have nothing in which to carry the oil.";
1545          ];
1546   
1547  Scenic  "hole above pit"
1548    with  name 'hole' 'large' 'above' 'pit',
1549          description "The hole is in the wall above you.",
1550          found_in In_East_Pit At_East_End_Of_Twopit_Room;
1551   
1552  ! ------------------------------------------------------------------------------
1553   
1554  Room    In_Slab_Room "Slab Room"
1555    with  name 'slab' 'room',
1556          description
1557              "You are in a large low circular chamber
1558               whose floor is an immense slab fallen from the ceiling (slab room).
1559               East and west there once were large passages, but they are now filled with boulders.
1560               Low small passages go north and south, and the south one quickly bends west around the boulders.",
1561          s_to At_West_End_Of_Twopit_Room,
1562          u_to In_Secret_N_S_Canyon_0,
1563          n_to In_Bedquilt;
1564   
1565  Scenic  -> "slab"
1566    with  name 'slab' 'immense',
1567          description "It is now the floor here.",
1568          before [;
1569            LookUnder, Push, Pull, Take:
1570              "Surely you're joking.";
1571          ];
1572   
1573  Scenic  -> "boulders"
1574    with  name 'boulder' 'boulders' 'rocks' 'stones',
1575          description "They're just ordinary boulders.",
1576    has   multitude;
1577   


Last updated 23 June 2004. This web site has not been fully supported since April 2008. Information may be out of date. This page was originally managed by Graham Nelson (graham@gnelson.demon.co.uk) assisted by C Knight.