home *** CD-ROM | disk | FTP | other *** search
/ Amiga Special: Spiele Hits / Hits-CD.iso / aminet / spiele / ammud1_1.lha / AmigaMUD / Src / Proving / chasm.m < prev    next >
Text File  |  1997-06-22  |  22KB  |  631 lines

  1. /*
  2.  * Amiga MUD
  3.  *
  4.  * Copyright (c) 1997 by Chris Gray
  5.  */
  6.  
  7. /*
  8.  * chasm.m - the chasm rooms area.
  9.  */
  10.  
  11. /* the vertical chimney */
  12.  
  13. define tp_proving tp_chasm CreateTable()$
  14. use tp_chasm
  15.  
  16. define tp_chasm r_chimneyTop CreateThing(r_provingCave)$
  17. SetupRoomP(r_chimneyTop, "at the top of a circular ramp",
  18.     "The ramp slopes steeply but negotiably around a 20 foot diameter "
  19.     "vertical chimney in the stone. The chimney ends not far overhead, but "
  20.     "extends downward out of sight. A narrow passage heads east.")$
  21. Connect(r_sewerCaveA2, r_chimneyTop, D_WEST)$
  22. Scenery(r_chimneyTop, "chimney;20,foot,diameter,vertical.ramp.passage")$
  23. define tp_chasm proc chimneyDrop(thing th)status:
  24.     thing me, here;
  25.     string name;
  26.  
  27.     me := Me();
  28.     name := FormatName(th@p_oName);
  29.     if th@p_oCarryer ~= nil and th@p_oCreator = me then
  30.     here := Here();
  31.     Print("You drop the " + name + " which slides off the ramp and "
  32.         "disappears down the chimney.\n");
  33.     if not me@p_pHidden and CanSee(here, me) then
  34.         OPrint(Capitalize(CharacterNameG(me)) +
  35.         AAn(" drops", name) +
  36.         " which slides off the ramp and disappears down the "
  37.         "chimney.\n");
  38.     fi;
  39.     ZapObject(th);
  40.     DelElement(me@p_pCarrying, th);
  41.     succeed
  42.     else
  43.     Print("You'd better not drop the " + name + " here!\n");
  44.     fail
  45.     fi
  46. corp;
  47. AddRoomDropChecker(r_chimneyTop, chimneyDrop, false)$
  48. r_chimneyTop@p_oListenString :=
  49.     "It is very quiet here, and no sound can be heard from the chimney."$
  50. r_chimneyTop@p_oSmellString :=
  51.     "The air is perhaps a bit less stale than normal here - there might be "
  52.     "a very slight breeze coming up out of the chimney."$
  53.  
  54. define tp_chasm r_chimneyMiddle CreateThing(r_provingCave)$
  55. SetupRoomP(r_chimneyMiddle, "on a ramp in a vertical chimney",
  56.     "The chimney ends just within sight overhead, but extends downward out of "
  57.     "sight. A tunnel heads west.")$
  58. Connect(r_chimneyTop, r_chimneyMiddle, D_DOWN)$
  59. Scenery(r_chimneyMiddle, "chimney;vertical.ramp.tunnel")$
  60. AddRoomDropChecker(r_chimneyMiddle, chimneyDrop, false)$
  61. r_chimneyMiddle@p_oSmellString :=
  62.     "The slight breeze seems to be coming from the tunnel."$
  63.  
  64. define tp_chasm r_chimneyBottom CreateThing(r_provingCave)$
  65. SetupRoomP(r_chimneyBottom, "on a ramp in a vertical chimney",
  66.     "The chimney extends up and down out of sight.")$
  67. Scenery(r_chimneyBottom, "chimney;vertical.ramp")$
  68. AddRoomDropChecker(r_chimneyBottom, chimneyDrop, false)$
  69. Connect(r_chimneyMiddle, r_chimneyBottom, D_DOWN)$
  70.  
  71. define tp_chasm p_pChimneyDepth CreateIntProp()$
  72.  
  73. define tp_chasm r_chimney CreateThing(r_tunnel)$
  74. SetupRoomDP(r_chimney, "on a ramp in a vertical chimney",
  75.     "The chimney extends up and down out of sight.")$
  76. Scenery(r_chimney, "chimney;vertical.ramp")$
  77. AddRoomDropChecker(r_chimney, chimneyDrop, false)$
  78. Connect(r_chimneyBottom, r_chimney, D_DOWN)$
  79. UniConnect(r_chimney, r_chimney, D_DOWN)$
  80. r_chimney@p_rNoMachines := true$
  81.  
  82. define tp_chasm proc chimneyDown()status:
  83.     thing me;
  84.  
  85.     me := Me();
  86.     me@p_pChimneyDepth := me@p_pChimneyDepth + 1;
  87.     LeaveRoomStuff(r_chimney, D_DOWN, MOVE_SPECIAL);
  88.     EnterRoomStuff(r_chimney, D_UP, MOVE_SPECIAL);
  89.     fail
  90. corp;
  91.  
  92. AddDownChecker(r_chimneyBottom, chimneyDown, false)$
  93. AddDownChecker(r_chimney, chimneyDown, false)$
  94.  
  95. define tp_chasm proc chimneyUp()status:
  96.     thing me;
  97.     int depth;
  98.  
  99.     me := Me();
  100.     depth := me@p_pChimneyDepth - 1;
  101.     if depth = 0 then
  102.     me -- p_pChimneyDepth;
  103.     LeaveRoomStuff(r_chimneyBottom, D_UP, MOVE_SPECIAL);
  104.     EnterRoomStuff(r_chimneyBottom, D_DOWN, MOVE_SPECIAL);
  105.     continue
  106.     else
  107.     me@p_pChimneyDepth := depth;
  108.     LeaveRoomStuff(r_chimney, D_UP, MOVE_SPECIAL);
  109.     EnterRoomStuff(r_chimney, D_DOWN, MOVE_SPECIAL);
  110.     fail
  111.     fi
  112. corp;
  113.  
  114. AddUpChecker(r_chimney, chimneyUp, false)$
  115.  
  116. define tp_chasm r_tunnelX1 CreateThing(r_provingCave)$
  117. SetupRoomP(r_tunnelX1, "in an east-west tunnel", "")$
  118. Connect(r_chimneyMiddle, r_tunnelX1, D_WEST)$
  119.  
  120. define tp_chasm r_tunnelX2 CreateThing(r_provingCave)$
  121. SetupRoomP(r_tunnelX2, "in an east-west tunnel",
  122.     "There is a faint greenish light coming from the west.")$
  123. Connect(r_tunnelX1, r_tunnelX2, D_WEST)$
  124.  
  125. define tp_chasm r_tunnelX3 CreateThing(r_provingCave)$
  126. SetupRoomP(r_tunnelX3, "in an east-west tunnel",
  127.     "There is a steady greenish light coming from the west.")$
  128. Connect(r_tunnelX2, r_tunnelX3, D_WEST)$
  129.  
  130. /* the chasm area */
  131.  
  132. define tp_chasm o_chasm CreateThing(nil)$
  133. FakeObject(o_chasm, nil, "chasm;deep",
  134.     "The chasm is a deep crack in the earth. It is so deep that you cannot "
  135.     "see the bottom, only blackness. The chasm is far too wide to jump "
  136.     "across.")$
  137.  
  138. define tp_chasm PR_CHASM1_ID NextEffectId()$
  139. define tp_chasm proc drawChasm1()void:
  140.  
  141.     if not KnowsEffect(nil, PR_CHASM1_ID) then
  142.     DefineEffect(nil, PR_CHASM1_ID);
  143.     GSetImage(nil, "Proving/chasm1");
  144.     IfFound(nil);
  145.         ShowCurrentImage();
  146.     Else(nil);
  147.         GSetPen(nil, C_DARK_GREY);
  148.         GAMove(nil, 0.0, 0.0);
  149.         GRectangle(nil, 0.5, 1.0, true);
  150.  
  151.         GSetPen(nil, C_LIGHT_GREY);
  152.         GPolygonStart(nil);
  153.         GAMove(nil, 0.499, 0.65);
  154.         GADraw(nil, 0.25, 0.65);
  155.         GADraw(nil, 0.0, 0.75);
  156.         GADraw(nil, 0.0, 0.45);
  157.         GADraw(nil, 0.219, 0.35);
  158.         GADraw(nil, 0.234, 0.0);
  159.         GADraw(nil, 0.266, 0.0);
  160.         GADraw(nil, 0.281, 0.35);
  161.         GADraw(nil, 0.484, 0.35);
  162.         GADraw(nil, 0.484, 0.555);
  163.         GADraw(nil, 0.499, 0.555);
  164.         GPolygonEnd(nil);
  165.  
  166.         GSetPen(nil, C_BLACK);
  167.         GPolygonStart(nil);
  168.         GAMove(nil, 0.484, 0.55);
  169.         GADraw(nil, 0.25, 0.55);
  170.         GADraw(nil, 0.0, 0.65);
  171.         GADraw(nil, 0.0, 0.55);
  172.         GADraw(nil, 0.25, 0.45);
  173.         GADraw(nil, 0.484, 0.45);
  174.         GPolygonEnd(nil);
  175.     Fi(nil);
  176.     EndEffect();
  177.     fi;
  178.     CallEffect(nil, PR_CHASM1_ID);
  179. corp;
  180.  
  181. define tp_chasm CHASM1_MAP_GROUP NextMapGroup()$
  182.  
  183. define tp_chasm r_chasmModel1 CreateThing(r_tunnel)$
  184. r_chasmModel1@p_rName := "on a ledge overlooking a chasm"$
  185. r_chasmModel1@p_rName1 := "Chasm"$
  186. r_chasmModel1@p_MapGroup := CHASM1_MAP_GROUP$
  187. r_chasmModel1@p_rDrawAction := drawChasm1$
  188. r_chasmModel1@p_rEnterRoomDraw := EnterRoomDraw$
  189. r_chasmModel1@p_rLeaveRoomDraw := LeaveRoomDraw$
  190. r_chasmModel1@p_oListenString :=
  191.     "You can hear water sounds coming up from the depths of the chasm, "
  192.     "but there is no way to tell what they are."$
  193. r_chasmModel1@p_oSmellString :=
  194.     "The large size of this chamber, in combination with the slight "
  195.     "airflow through it, combine to make it reasonably fresh."$
  196. Scenery(r_chasmModel1, "minerals;glowing.ledge.glow;green")$
  197. monsterSet4(r_chasmModel1)$
  198. SetThingStatus(r_chasmModel1, ts_readonly)$
  199.  
  200. define tp_chasm proc makeChasm1(string desc; fixed x, y)thing:
  201.     thing chasm;
  202.  
  203.     chasm := CreateThing(r_chasmModel1);
  204.     if desc ~= "" then
  205.     chasm@p_rDesc := desc;
  206.     fi;
  207.     chasm@p_rContents := CreateThingList();
  208.     chasm@p_rExits := CreateIntList();
  209.     chasm@p_rCursorX := x;
  210.     chasm@p_rCursorY := y;
  211.     AddTail(chasm@p_rContents, o_chasm);
  212.     SetThingStatus(chasm, ts_wizard);
  213.     chasm
  214. corp;
  215.  
  216. define tp_chasm r_chasm1 makeChasm1(
  217.     "You are at the east end of a large, narrow cave which is dominated by a "
  218.     "deep chasm running down the center. Glowing minerals in the ceiling of "
  219.     "the cave provide ample light. Narrow ledges on both sides of the chasm "
  220.     "give room for passage. You are on the south side of the chasm and there "
  221.     "is no visible way to get to the north side. The ledge continues to the "
  222.     "west, and a tunnel heads east.", 0.478, 0.6)$
  223. Connect(r_tunnelX3, r_chasm1, D_WEST)$
  224. Connect(r_tunnelX3, r_chasm1, D_EXIT)$
  225. Scenery(r_chasm1, "tunnel")$
  226.  
  227. define tp_chasm r_chasm2 makeChasm1(
  228.     "The cave bends slightly here, with the west end angling slightly to the "
  229.     "south. Across the chasm, you can see a deep crack leading north from the "
  230.     "ledge on that side.", 0.259, 0.6)$
  231. Connect(r_chasm1, r_chasm2, D_WEST)$
  232. Scenery(r_chasm2, "crack;deep")$
  233.  
  234. define tp_chasm r_chasm3 makeChasm1("", 0.019, 0.7)$
  235. Connect(r_chasm2, r_chasm3, D_WEST)$
  236.  
  237. define tp_chasm r_chasm4 makeChasm1(
  238.     "The ledge on this side of the chasm comes to an end here.", 0.471, 0.4)$
  239.  
  240. define tp_chasm r_chasm5 makeChasm1(
  241.     "A deep crack heads north from here.", 0.25, 0.4)$
  242. Connect(r_chasm4, r_chasm5, D_WEST)$
  243. Scenery(r_chasm5, "crack;deep")$
  244.  
  245. define tp_provi