plirof2

lantern-php-game-generator_v005f

Jun 23rd, 2022 (edited)
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 36.35 KB | None | 0 0
  1. <?php
  2. /*
  3.  
  4. 220623a - Generated version
  5. 220622 - initial version
  6.  
  7. ToDo:
  8. + ok: Connect rooms :Initially connect automatically rooms with Up and Down (by order) (Don)
  9. - Connect rooms : Then parse the connection string for n=XX,e,w,s,up,down
  10. -HTML form table :
  11. Room  |  villain | villain desc  |  item needed | item desc | item dropped |item dropped desc |
  12.  
  13. item , villain should be created as objects first and place inside room/inventory (or maybe dropped by villain)
  14.  
  15.  
  16. CSV import
  17.  
  18. */
  19. //Solution kill Conchita with ball attack,n,kill Luigi with pipe ,u,kill Jaws with dental floss  ,u,Kill Joker with Full House Attack ,u,Kill Zangief with Chun Li Attack ,u,Kill Sauron With Ring Attack ,u,kill thanos with infinity attack ,u,kill t 800 with emp attack ,u,Kill Van Damme with Blind Attack ,u,kill Chuck Norris with God Attack
  20. //Solution kill Conchita with ball attack,u,kill Luigi with pipe ,u,kill thanos with infinity attack ,u,kill Jaws with dental floss ,u,Kill Zangief with Chun Li Attack ,u,Kill Sauron With Ring Attack ,u,Kill Joker with Full House Attack ,u,kill t 800 with emp attack ,u,Kill Van Damne with Blind Attack ,u,kill Chuck Norris with God Attack
  21.  
  22.  
  23. // Videos attack : https://www.youtube.com/watch?v=BYLVxlLFuq0&list=PL8nDWbKG9fKbvgEJYp-nSPjX2c3L61rDw
  24. // NPC blocker https://www.youtube.com/watch?v=LOFsWgJuywo&list=PL8nDWbKG9fKbvgEJYp-nSPjX2c3L61rDw
  25. $debug1=false;
  26. $counter=0;
  27. $room_counter=2;
  28. $write_to_lant_xml=true;
  29.  
  30. //$file = fopen('class-worklog-lantern/worklog.txt', 'r');
  31. $file = fopen('worklog.txt', 'r');
  32. while (($line = fgetcsv($file,null,"|")) !== FALSE) {
  33.   //$line is an array of the csv elements
  34.   list($room[],$room_desc[],$villain[],$villain_desc[],$item[],$item_desc[],$item_reward[],$item_reward_desc[],$exits[]) = $line;
  35.   //print_r($line);echo "<hr size=10>";
  36. }
  37. fclose($file);
  38.  
  39. include "functions.php";
  40.  
  41. $rooms_total=sizeof($room);
  42.  
  43. //$a=["luigi","mantis","jaws","zangief","ivan_drago","joker","t_800_model_101","van_damne","chuck_norris"];
  44.  
  45. $objects_locations="";
  46. $objects_enemies="";
  47. $objects_items="";
  48. $sentences_text="";
  49. $usercheckblocks_text="";
  50. $checks_text="";
  51. $routines_text="";
  52. $event_text="";
  53. $objects_items_reward="";
  54.  
  55. // PARSE ALL THE ROOMS (= file/table rows)
  56. foreach ($room as $r) {
  57.  
  58.   $cur_room_name=$room[$counter];
  59.   $cur_villain_name_no_space=strtolower(str_replace(' ', '_', $villain[$counter]));  
  60.   $cur_item_name_no_space=strtolower(str_replace(' ', '_', $item[$counter]));  
  61.   $cur_item_reward_name_no_space=strtolower(str_replace(' ', '_', $item_reward[$counter]));
  62.  
  63.   ///$key = array_search('green', $array); // $key = 2;
  64.   $up_exit_id=$room_counter+1;
  65.   $down_exit_id=$room_counter-1;
  66.   if($up_exit_id>$rooms_total+1) {$up_exit_id=255;}
  67.   if($down_exit_id<2) {$down_exit_id=255;};
  68.  
  69.   //--------------------------//Locations--------------------------------------
  70.   //$directions_line ===<directions n="255" s="255" e="255" w="255" ne="255" se="255" sw="255" nw="255" up="$up_exit_id" down="$down_exit_id" in="255" out="255" mass="0" />
  71.   $directions_line=generate_room_direction_line($room_counter);
  72.   $loc1 = <<<LOC
  73.         <object id="$room_counter" holder="0" name="$cur_room_name" printedname="$cur_room_name">
  74.         <description>$room_desc[$counter]</description>
  75.         <initialdescription />
  76.         $directions_line
  77.         <flags scenery="0" portable="0" container="0" supporter="0" open="0" wearable="0" emittinglight="1" locked="0" lockable="0" beingworn="0" user1="0" door="0" user2="0" user3="0" user4="0" />
  78.         <synonyms names="" />
  79.         <nogo>
  80.           <e />
  81.           <in>You can't enter that.</in>
  82.           <out>I don't know which way that is.</out>
  83.         </nogo>
  84.         <ImageId />
  85.       </object>      
  86. LOC ;
  87.  
  88. //  echo '      <routine name="kill_'.$name.'">println("You kill '.$name.'");luigi.location= offscreen;</routine>';
  89.     //echo '<routine name="kill_'.$name.'">println("You kill '.$name.'"); luigi.location= offscreen;</routine> '."\n";
  90.   $objects_locations=$objects_locations."\n".$loc1 ."";
  91.  
  92. //-------------$objects_enemies---------------------------------------------------
  93. $id_villains=$room_counter+$rooms_total; // increments by one each loop
  94.  
  95.  
  96. $vil1 = <<<VILLAINS
  97.       <object id="$id_villains" holder="$room_counter" name="$cur_villain_name_no_space" printedname="$villain[$counter]">
  98.         <description>$villain_desc[$counter]</description>
  99.         <initialdescription />
  100.         <directions n="255" s="255" e="255" w="255" ne="255" se="255" sw="255" nw="255" up="255" down="255" in="255" out="255" mass="0" />
  101.         <flags scenery="1" portable="0" container="0" supporter="0" open="0" wearable="0" emittinglight="0" locked="0" lockable="0" beingworn="0" user1="0" door="0" user2="0" user3="0" user4="0" />
  102.         <synonyms names="" />
  103.         <nogo>
  104.           <w />
  105.           <e />
  106.           <n />
  107.           <in>You can't enter that.</in>
  108.           <out>I don't know which way that is.</out>
  109.         </nogo>
  110.         <ImageId />
  111.       </object>
  112. VILLAINS;
  113.  
  114. $objects_enemies=$objects_enemies."\n".$vil1 ."";
  115.  
  116. //---------$objects_items-------------------------------------------------------
  117. //$objects_items
  118. $id_item=$room_counter+$rooms_total*2;
  119.  
  120. $items1 = <<<ITEMS
  121.       <object id="$id_item" holder="1" name="$item[$counter]" printedname="$item[$counter]">
  122.         <description>$item_desc[$counter]</description>
  123.         <initialdescription />
  124.         <directions n="255" s="255" e="255" w="255" ne="255" se="255" sw="255" nw="255" up="255" down="255" in="255" out="255" mass="0" />
  125.         <flags scenery="0" portable="0" container="0" supporter="0" transparent="0" openable="0" open="0" wearable="1" emittinglight="0" locked="0" lockable="0" beingworn="0" user1="0" door="0" user2="0" user3="0" user4="0" />
  126.         <synonyms />
  127.         <nogo>
  128.           <s />
  129.           <w />
  130.           <ne />
  131.           <nw />
  132.           <e />
  133.           <se />
  134.           <sw />
  135.           <n />
  136.           <up />
  137.           <down />
  138.           <in>You can't enter that.</in>
  139.           <out>I don't know which way that is.</out>
  140.         </nogo>
  141.         <ImageId />
  142.       </object>
  143. ITEMS;
  144.  
  145.  
  146. $objects_items=$objects_items."\n".$items1 ."";
  147.  
  148.  
  149. //---------$objects_items_reward-------------------------------------------------------
  150. //$objects_items
  151. $id_item_reward=$room_counter+$rooms_total*3;
  152.  
  153. $items_reward1 = <<<ITEMS
  154.       <object id="$id_item_reward" holder="0" name="$item_reward[$counter]" printedname="$item_reward[$counter]">
  155.         <description>$item_reward_desc[$counter]</description>
  156.         <initialdescription />
  157.         <directions n="255" s="255" e="255" w="255" ne="255" se="255" sw="255" nw="255" up="255" down="255" in="255" out="255" mass="0" />
  158.         <flags scenery="0" portable="0" container="0" supporter="0" transparent="0" openable="0" open="0" wearable="1" emittinglight="0" locked="0" lockable="0" beingworn="0" user1="0" door="0" user2="0" user3="0" user4="0" />
  159.         <synonyms />
  160.         <nogo>
  161.           <s />
  162.           <w />
  163.           <ne />
  164.           <nw />
  165.           <e />
  166.           <se />
  167.           <sw />
  168.           <n />
  169.           <up />
  170.           <down />
  171.           <in>You can't enter that.</in>
  172.           <out>I don't know which way that is.</out>
  173.         </nogo>
  174.         <ImageId />
  175.       </object>
  176. ITEMS;
  177.  
  178.  
  179. $objects_items_reward=$objects_items_reward."\n".$items_reward1 ."";
  180.  
  181. //-------$checks_text---------------------------------------------------------
  182. //$checks_text=' <check verb="e" check="check1_mantis" />';
  183. //$checks_text=' <check verb="w" check="check1_mantis" />';
  184. //$checks_text=' <check verb="s" check="check1_mantis" />';
  185. //$checks_text=' <check verb="n" check="check1_mantis" />';
  186.  
  187.  
  188. $checks1 = '
  189. <check verb="up" check="check'.$counter.'_'.$cur_villain_name_no_space.'" /> \n
  190. <check verb="down" check="check'.$counter.'_'.$cur_villain_name_no_space.'" />  ;
  191. ';
  192.  
  193.  
  194. $checks_text=$checks_text."\n".$checks1 ."";
  195.  
  196. //--------$sentences_text--------------------------------------------------------  
  197. /*
  198. $sentence1=<<<SENT
  199.  
  200.       <sentence verb="kill" do="$villain[$counter]" prep="" io="" type="instead" sub="kill_$cur_villain_name_no_space" /> \n
  201.       <sentence verb="kill" do="$villain[$counter]" prep="with" io="$item[$counter]" type="instead" sub="kill_$cur_villain_name_no_space" />\n
  202.       <sentence verb="kill" do="$villain[$counter]" prep="with" io="fist" type="instead" sub="kill_$cur_villain_name_no_space" />\n
  203.       <sentence verb="kill" do="$villain[$counter]" prep="with" io="kick" type="instead" sub="kill_$cur_villain_name_no_space" />
  204. SENT;
  205. */
  206. $sentence1=<<<SENT
  207.  
  208.       <sentence verb="kill" do="$villain[$counter]" prep="with" io="$item[$counter]" type="instead" sub="kill_$cur_villain_name_no_space" />\n
  209. SENT;
  210.  
  211. $sentences_text=$sentences_text."\n".$sentence1."";
  212.  
  213.  
  214. //-----$usercheckblocks_text-----------------------------------------------------------
  215. $checkblock1='
  216.  <UserCheck name="check'.$counter.'_'.$cur_villain_name_no_space.'">if ( '.$cur_villain_name_no_space.'.location==player.location )
  217.  {
  218.       println("'.$villain[$counter].' blocks that exit! ");
  219.       stop();
  220.  }
  221.  </UserCheck>
  222. ';
  223.  
  224.  
  225. $usercheckblocks_text=$usercheckblocks_text."\n".$checkblock1."";
  226.  
  227.  
  228. //-----$routines_text-----------------------------------------------------------  
  229.  
  230. $routine1='<routine name="kill_'.$cur_villain_name_no_space.'">println("You kill '.$villain[$counter].' ");
  231.     '.$cur_villain_name_no_space.'.location= offscreen;
  232.     '.$cur_item_name_no_space.'.location= offscreen;
  233.     '.$cur_item_reward_name_no_space.'.location= player;
  234.  
  235.  
  236.    
  237.  
  238.     </routine>';
  239.  
  240. $routines_text=$routines_text."\n".$routine1."";
  241.  
  242.  
  243. //----EVENTS (show villain in room------------------------------------------------------------
  244.  
  245. $event1='      <event name="same_room_'.$cur_villain_name_no_space.'">if('.$cur_villain_name_no_space.'.location==player.location) println("You see '.$villain[$counter].' in the room! '.$villain_desc[$counter].' ") ;
  246. </event> ';
  247.  
  248. $event_text=$event_text."\n".$event1."";
  249.  
  250. //----------------------------------------------------------------  
  251.  
  252.     $room_counter++;
  253.   $counter++;
  254.  
  255.  
  256. }; // END of foreach ($room as $r) {
  257. // Last check
  258. $win_event='      <event name="win_condition_'.$cur_villain_name_no_space.'">if('.$cur_villain_name_no_space.'.location==offscreen) println("You killed '.$villain[$counter-1].'!!! You WON!") ;
  259. </event> ';
  260. $event_text=$event_text."\n".$win_event."";
  261.  
  262.  
  263.  
  264.  
  265. if($debug1) {
  266.   echo "$objects_locations";
  267.   echo "$objects_enemies";
  268.   echo "$objects_items";
  269.   echo $checks_text;
  270.   echo $sentences_text;
  271.   echo $usercheckblocks_text;
  272.   exit(0);
  273. }
  274. /*
  275.  
  276. NOTES:
  277. <directions n="11" s="255" e="6" w="4" ne="255" se="255" sw="255" nw="255" up="255" down="255" in="255" out="255" mass="0" />
  278. e ,w enter Location ID
  279.  
  280.  
  281.  
  282.  
  283. */
  284.  
  285.  
  286. //ob_start();                      // start capturing output
  287. //include('lantern.xml');   // execute the file
  288. //$content = ob_get_contents();    // get the contents from the buffer
  289. //ob_end_clean();                  // stop buffering and discard contents
  290. //echo "<hr>".$content ;
  291. //$text = <<<EOT
  292.  
  293.  
  294.  
  295. $objects_text=$objects_locations.$objects_enemies.$objects_items.$objects_items_reward;
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306. if (true) {
  307. $text = <<<EOT
  308. <?xml version="1.0" encoding="utf-8"?>
  309. <xml xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  310.   <project>
  311.     <projname>DeathTower</projname>
  312.     <welcome>Welcome To Tower Of Death!</welcome>
  313.     <author>Firelord Quality Games</author>
  314.     <language>English</language>
  315.     <version>Version 1.0</version>
  316.     <output>adventure</output>
  317.     <preps>
  318.       <prep>in</prep>
  319.       <prep>on</prep>
  320.       <prep>at</prep>
  321.       <prep>under</prep>
  322.       <prep>into</prep>
  323.       <prep>inside</prep>
  324.       <prep>through</prep>
  325.       <prep>out</prep>
  326.       <prep>behind</prep>
  327.       <prep>off</prep>
  328.       <prep>up</prep>
  329.       <prep>with</prep>
  330.       <prep>to</prep>
  331.       <prep>off</prep>
  332.       <prep>north</prep>
  333.       <prep>south</prep>
  334.       <prep>east</prep>
  335.       <prep>west</prep>
  336.       <prep>northeast</prep>
  337.       <prep>southeast</prep>
  338.       <prep>northwest</prep>
  339.       <prep>southwest</prep>
  340.       <prep>up</prep>
  341.       <prep>down</prep>
  342.       <prep>about</prep>
  343.       <prep>over</prep>
  344.       <prep>across</prep>
  345.       <prep>for</prep>
  346.     </preps>
  347.     <verbs>
  348.       <builtinverbs>
  349.         <verb>n,go north,north</verb>
  350.         <verb>s,go south,south</verb>
  351.         <verb>e,go east,east</verb>
  352.         <verb>w,go west,west</verb>
  353.         <verb>ne,go northeast,northeast</verb>
  354.         <verb>se,go southeast,southeast</verb>
  355.         <verb>sw,go southwest,southwest</verb>
  356.         <verb>nw,go northwest,northwest</verb>
  357.         <verb>up,go up,u</verb>
  358.         <verb>down,go down,d</verb>
  359.         <verb>enter,go in,go inside,get in</verb>
  360.         <verb>out</verb>
  361.         <verb>go</verb>
  362.         <verb>get,take,grab,pick up</verb>
  363.         <verb>give</verb>
  364.         <verb>inventory,i</verb>
  365.         <verb>kill,attack</verb>
  366.         <verb>drop</verb>
  367.         <verb>light</verb>
  368.         <verb>look,l</verb>
  369.         <verb>examine,x,look at</verb>
  370.         <verb>look in</verb>
  371.         <verb>search</verb>
  372.         <verb>open</verb>
  373.         <verb>lock</verb>
  374.         <verb>unlock</verb>
  375.         <verb>close,shut</verb>
  376.         <verb>eat</verb>
  377.         <verb>drink</verb>
  378.         <verb>put,place</verb>
  379.         <verb>quit</verb>
  380.         <verb>smell,sniff</verb>
  381.         <verb>listen</verb>
  382.         <verb>wait</verb>
  383.         <verb>climb</verb>
  384.         <verb>yell,scream,shout</verb>
  385.         <verb>jump</verb>
  386.         <verb>talk to</verb>
  387.         <verb>turn on</verb>
  388.         <verb>turn off</verb>
  389.         <verb>wear,put on</verb>
  390.         <verb>save</verb>
  391.         <verb>restore</verb>
  392.         <verb>push,press</verb>
  393.         <verb>read</verb>
  394.         <verb>use</verb>
  395.         <verb>again</verb>
  396.       </builtinverbs>
  397.       <userverbs />
  398.     </verbs>
  399.     <objects>
  400.       <object id="0" holder="0" name="Offscreen" printedname="Offscreen">
  401.         <description>Offscreen.  Move objects here to remove them from the world.</description>
  402.         <initialdescription />
  403.         <directions n="255" s="255" e="255" w="255" ne="255" se="255" sw="255" nw="255" up="255" down="255" in="255" out="255" mass="0" />
  404.         <flags scenery="0" portable="0" container="0" supporter="0" transparent="0" openable="0" open="0" wearable="0" emittinglight="0" locked="0" lockable="0" beingworn="0" user1="0" door="0" user2="0" user3="0" user4="0" />
  405.         <synonyms />
  406.         <nogo>
  407.           <s />
  408.           <w />
  409.           <ne />
  410.           <nw />
  411.           <e />
  412.           <se />
  413.           <sw />
  414.           <n />
  415.           <up />
  416.           <down />
  417.           <in />
  418.           <out />
  419.         </nogo>
  420.         <ImageId />
  421.       </object>
  422.       <object id="1" holder="2" name="player" printedname="player">
  423.         <description>You're a wonderful person. You shouldn't care what you look like.</description>
  424.         <initialdescription />
  425.         <directions n="255" s="255" e="255" w="255" ne="255" se="255" sw="255" nw="255" up="255" down="255" in="255" out="255" mass="0" />
  426.         <flags scenery="0" portable="0" container="0" supporter="0" transparent="0" openable="0" open="0" wearable="0" emittinglight="0" locked="0" lockable="0" beingworn="0" user1="0" door="0" user2="0" user3="0" user4="0" />
  427.         <synonyms names="me,self" />
  428.         <nogo>
  429.           <w />
  430.           <e />
  431.           <in>You can't enter that.</in>
  432.           <out>I don't know which way that is.</out>
  433.         </nogo>
  434.         <ImageId />
  435.       </object>
  436.       $objects_text
  437.     </objects>
  438.     <checks>
  439.       <check verb="n" check="check_move" />
  440.       <check verb="s" check="check_move" />
  441.       <check verb="e" check="check_move" />
  442.       <check verb="w" check="check_move" />
  443.       <check verb="u" check="check_move" />
  444.       <check verb="d" check="check_move" />
  445.       <check verb="ne" check="check_move" />
  446.       <check verb="nw" check="check_move" />
  447.       <check verb="se" check="check_move" />
  448.       <check verb="sw" check="check_move" />
  449.       <check verb="close" check="check_dobj_supplied" />
  450.       <check verb="close" check="check_dobj_opnable" />
  451.       <check verb="close" check="check_dobj_open" />
  452.       <check verb="drink" check="check_dobj_supplied" />
  453.       <check verb="drink" check="check_have_dobj" />
  454.       <check verb="drop" check="check_dobj_supplied" />
  455.       <check verb="drop" check="check_have_dobj" />
  456.       <check verb="eat" check="check_dobj_supplied" />
  457.       <check verb="eat" check="check_have_dobj" />
  458.       <check verb="enter" check="check_dobj_supplied" />
  459.       <check verb="enter" check="check_see_dobj" />
  460.       <check verb="enter" check="check_move" />
  461.       <check verb="out" check="check_move" />
  462.       <check verb="examine" check="check_dobj_supplied" />
  463.       <check verb="examine" check="check_see_dobj" />
  464.       <check verb="get" check="check_dobj_supplied" />
  465.       <check verb="get" check="check_see_dobj" />
  466.       <check verb="get" check="check_dont_have_dobj" />
  467.       <check verb="get" check="check_dobj_portable" />
  468.       <check verb="get" check="check_weight" />
  469.       <check verb="kill" check="check_dobj_supplied" />
  470.       <check verb="kill" check="check_see_dobj" />
  471.       <check verb="light" check="check_dobj_supplied" />
  472.       <check verb="light" check="check_have_dobj" />
  473.       <check verb="light" check="check_see_dobj" />
  474.       <check verb="open" check="check_dobj_supplied" />
  475.       <check verb="open" check="check_see_dobj" />
  476.       <check verb="open" check="check_dobj_opnable" />
  477.       <check verb="open" check="check_dobj_unlocked" />
  478.       <check verb="put" check="check_dobj_supplied" />
  479.       <check verb="put" check="check_prep_supplied" />
  480.       <check verb="put" check="check_iobj_supplied" />
  481.       <check verb="put" check="check_not_self_or_child" />
  482.       <check verb="put" check="check_have_dobj" />
  483.       <check verb="put" check="check_see_iobj" />
  484.       <check verb="put" check="check_put" />
  485.       <check verb="talk to" check="check_dobj_supplied" />
  486.       <check verb="talk to" check="check_see_dobj" />
  487.       <check verb="turn on" check="check_dobj_supplied" />
  488.       <check verb="turn on" check="check_see_dobj" />
  489.       <check verb="lock" check="check_dobj_supplied" />
  490.       <check verb="lock" check="check_see_dobj" />
  491.       <check verb="lock" check="check_dobj_lockable" />
  492.       <check verb="unlock" check="check_dobj_supplied" />
  493.       <check verb="unlock" check="check_see_dobj" />
  494.       <check verb="unlock" check="check_dobj_lockable" />
  495.       <check verb="look in" check="check_dobj_supplied" />
  496.       <check verb="look in" check="check_see_dobj" />
  497.       <check verb="wear" check="check_see_dobj" />
  498.       <check verb="use" check="check_have_dobj" />
  499.       <check verb="wear" check="check_have_dobj" />
  500.       <check verb="wear" check="check_dobj_wearable" />
  501.       <check verb="give" check="check_dobj_supplied" />
  502.       <check verb="give" check="check_have_dobj" />
  503.       <check verb="give" check="check_iobj_supplied" />
  504.       <check verb="give" check="check_see_iobj" />
  505.       <check verb="push" check="check_dobj_supplied" />
  506.       <check verb="push" check="check_see_dobj" />
  507.       <check verb="read" check="check_dobj_supplied" />
  508.       <check verb="read" check="check_see_dobj" />
  509.       $checks_text
  510.     </checks>
  511.     <sentences>
  512.       <sentence verb="wear" do="*" prep="" io="" type="before" sub="get_portable" />
  513.       <sentence verb="take" do="PLAYER" prep="" io="" type="instead" sub="not_possible" />
  514.       <sentence verb="kill" do="PLAYER" prep="" io="" type="instead" sub="kill_self" />
  515.       <sentence verb="kill" do="*" prep="" io="" type="instead" sub="default_kill" />
  516.       <sentence verb="talk to" do="PLAYER" prep="" io="" type="instead" sub="talk_to_self" />
  517.       <sentence verb="talk to" do="*" prep="" io="" type="instead" sub="default_talk" />
  518.       <sentence verb="listen" do="" prep="" io="" type="instead" sub="listen" />
  519.       <sentence verb="wait" do="" prep="" io="" type="instead" sub="wait" />
  520.       <sentence verb="yell" do="" prep="" io="" type="instead" sub="yell" />
  521.       <sentence verb="jump" do="" prep="" io="" type="instead" sub="jump" />
  522.       <sentence verb="eat" do="*" prep="" io="" type="instead" sub="default_eat" />
  523.       <sentence verb="drink" do="*" prep="" io="" type="instead" sub="default_drink" />
  524.       <sentence verb="smell" do="*" prep="" io="" type="instead" sub="smell" />
  525.       <sentence verb="take" do="*" prep="" io="" type="after" sub="report_take" />
  526.       <sentence verb="drop" do="*" prep="" io="" type="after" sub="report_drop" />
  527.       <sentence verb="close" do="*" prep="" io="" type="after" sub="report_closed" />
  528.       <sentence verb="wear" do="*" prep="" io="" type="after" sub="report_wear" />
  529.       $sentences_text
  530.     </sentences>
  531.     <routines>
  532.       <routine name="game_start">//put any startup code or messages here
  533. </routine>
  534.       <routine name="reset">//put reset code here
  535. </routine>
  536.       <routine name="not_possible">if (dobj == player) { println("Not physically possible.");  } </routine>
  537.       <routine name="get_portable">if (dobj.portable == 1) { if (dobj.holder != player) { println("(Taken)"); dobj.holder = player;}  } </routine>
  538.       <routine name="kill_self">println("If you are experiencing suicidal thoughts you should seek psychiatric help.");</routine>
  539.       <routine name="default_kill">println("Perhaps you should count to 3 and calm down.");</routine>
  540.       <routine name="kill_player">println("***YOU HAVE DIED***.");
  541. reset();
  542. </routine>
  543.       <routine name="talk_to_self">println("Talking to yourself is a sign of impending mental collapse.");</routine>
  544.       <routine name="default_talk">println("That fails to produce an exciting conversation.");</routine>
  545.       <routine name="listen">println("You hear nothing unexpected.");</routine>
  546.       <routine name="smell">println("You smell nothing unexpected.");</routine>
  547.       <routine name="wait">println("Time passes...");</routine>
  548.       <routine name="yell">println("AAAAAAAAAAAAARRRRGGGGGG!");</routine>
  549.       <routine name="jump">println("WHEEEEEE!");</routine>
  550.       <routine name="default_eat">println("That's not part of a healthy diet.");</routine>
  551.       <routine name="default_drink">println("You can't drink that.");</routine>
  552.       <routine name="quit_sub">println("[Note: you can't quit the test client]");</routine>
  553.       <routine name="report_take">println("Taken.");</routine>
  554.       <routine name="report_drop">println("Dropped.");</routine>
  555.       <routine name="report_closed">println("Closed.");</routine>
  556.       <routine name="report_wear">print("You put on the ");
  557. printname(dobj);
  558. println(".");</routine>
  559. $routines_text
  560.     </routines>
  561.     <CheckFunctions>
  562.     $usercheckblocks_text
  563.     </CheckFunctions>
  564.     <events>
  565. $event_text
  566.     </events>
  567.     <variables>
  568.       <builtin>
  569.         <var name="dobj" addr="dobjId" value="0" />
  570.         <var name="iobj" addr="iobjId" value="0" />
  571.         <var name="score" addr="score" value="0" />
  572.         <var name="moves" addr="moves" value="0" />
  573.         <var name="health" addr="health" value="100" />
  574.         <var name="turnsWithoutLight" addr="turnsWithoutLight" value="0" />
  575.         <var name="gameOver" addr="gameOver" value="0" />
  576.         <var name="answer" addr="answer" value="0" />
  577.         <var name="maxWeight" addr="maxWeight" value="10" />
  578.         <var name="invWeight" addr="invWeight" value="0" />
  579.       </builtin>
  580.       <user />
  581.     </variables>
  582.     <Arrays />
  583.     <walkthrough>kill Conchita with ball attack,n,kill Luigi with pipe ,u,kill Jaws with dental floss  ,u,Kill Joker with Full House Attack ,u,Kill Zangief with Chun Li Attack ,u,Kill Sauron With Ring Attack ,u,kill thanos with infinity attack ,u,kill t 800 with emp attack ,u,Kill Van Damme with Blind Attack ,u,kill Chuck Norris with God Attack</walkthrough>
  584.     <BuildSettings>
  585.       <SpectrumBorder>0</SpectrumBorder>
  586.       <SpectrumPen>7</SpectrumPen>
  587.       <SpectrumPaper>0</SpectrumPaper>
  588.       <SpectrumFont />
  589.       <BrightPalette>true</BrightPalette>
  590.       <EnableGraphics>true</EnableGraphics>
  591.       <C64LoadScreen />
  592.       <CPMPostBuildScript />
  593.       <C64Border>0</C64Border>
  594.       <C64BG>2</C64BG>
  595.       <C64FG>3</C64FG>
  596.       <StatusLine>true</StatusLine>
  597.     </BuildSettings>
  598.     <StringDefs>
  599.       <Strings>
  600.         <StringDef>
  601.           <StringName>LeadingA</StringName>
  602.           <Z80name>leadinga</Z80name>
  603.           <SF02Name>leadingA</SF02Name>
  604.           <Value>A </Value>
  605.         </StringDef>
  606.         <StringDef>
  607.           <StringName>The</StringName>
  608.           <Z80name>the</Z80name>
  609.           <SF02Name>the</SF02Name>
  610.           <Value>The </Value>
  611.         </StringDef>
  612.         <StringDef>
  613.           <StringName>Pardon</StringName>
  614.           <Z80name>pardonstr</Z80name>
  615.           <SF02Name>pardon</SF02Name>
  616.           <Value>Pardon?</Value>
  617.         </StringDef>
  618.         <StringDef>
  619.           <StringName>DontUnderstand</StringName>
  620.           <Z80name>confused</Z80name>
  621.           <SF02Name>confused</SF02Name>
  622.           <Value>I don't follow you.</Value>
  623.         </StringDef>
  624.         <StringDef>
  625.           <StringName>Done</StringName>
  626.           <Z80name>done</Z80name>
  627.           <SF02Name>done</SF02Name>
  628.           <Value>Done.</Value>
  629.         </StringDef>
  630.         <StringDef>
  631.           <StringName>Is</StringName>
  632.           <Z80name>is</Z80name>
  633.           <SF02Name>is</SF02Name>
  634.           <Value> is...</Value>
  635.         </StringDef>
  636.         <StringDef>
  637.           <StringName>InThe</StringName>
  638.           <Z80name>inthe </Z80name>
  639.           <SF02Name>inthe </SF02Name>
  640.           <Value>In the </Value>
  641.         </StringDef>
  642.         <StringDef>
  643.           <StringName>Onthe</StringName>
  644.           <Z80name>onthe</Z80name>
  645.           <SF02Name>onthe</SF02Name>
  646.           <Value>On the </Value>
  647.         </StringDef>
  648.         <StringDef>
  649.           <StringName>NotOpenable</StringName>
  650.           <Z80name>notopenable</Z80name>
  651.           <SF02Name>notOpenable</SF02Name>
  652.           <Value>That's not openable.</Value>
  653.         </StringDef>
  654.         <StringDef>
  655.           <StringName>NotCloseable</StringName>
  656.           <Z80name>notcloseable</Z80name>
  657.           <SF02Name>notcloseable</SF02Name>
  658.           <Value>That's not closeable.</Value>
  659.         </StringDef>
  660.         <StringDef>
  661.           <StringName>AlreadyOpen</StringName>
  662.           <Z80name>alreadyopen</Z80name>
  663.           <SF02Name>alreadyOpen</SF02Name>
  664.           <Value>It's already open.</Value>
  665.         </StringDef>
  666.         <StringDef>
  667.           <StringName>AlreadyClosed</StringName>
  668.           <Z80name>alreadyclosed</Z80name>
  669.           <SF02Name>alreadyClosed</SF02Name>
  670.           <Value>It's already closed.</Value>
  671.         </StringDef>
  672.         <StringDef>
  673.           <StringName>AlreadyHave</StringName>
  674.           <Z80name>alreadyhave</Z80name>
  675.           <SF02Name>alreadyHave</SF02Name>
  676.           <Value>You already have that.</Value>
  677.         </StringDef>
  678.         <StringDef>
  679.           <StringName>CantTake</StringName>
  680.           <Z80name>notportable</Z80name>
  681.           <SF02Name>notPortable</SF02Name>
  682.           <Value>You can't take that.</Value>
  683.         </StringDef>
  684.         <StringDef>
  685.           <StringName>CantDo</StringName>
  686.           <Z80name>cantDoThat</Z80name>
  687.           <SF02Name>cantDoThat</SF02Name>
  688.           <Value>You can't do that.</Value>
  689.         </StringDef>
  690.         <StringDef>
  691.           <StringName>Carrying</StringName>
  692.           <Z80name>carrying</Z80name>
  693.           <SF02Name>carrying</SF02Name>
  694.           <Value>You are carrying...</Value>
  695.         </StringDef>
  696.         <StringDef>
  697.           <StringName>TooHeavy</StringName>
  698.           <Z80name>tooheavystr</Z80name>
  699.           <SF02Name>tooHeavy</SF02Name>
  700.           <Value>You can't carry any more.</Value>
  701.         </StringDef>
  702.         <StringDef>
  703.           <StringName>HaveNothing</StringName>
  704.           <Z80name>noitems</Z80name>
  705.           <SF02Name>emptyhanded</SF02Name>
  706.           <Value>You are empty handed.</Value>
  707.         </StringDef>
  708.         <StringDef>
  709.           <StringName>CantSee</StringName>
  710.           <Z80name>pitchdark</Z80name>
  711.           <SF02Name>noLight</SF02Name>
  712.           <Value>It is pitch dark.</Value>
  713.         </StringDef>
  714.         <StringDef>
  715.           <StringName>DontHave</StringName>
  716.           <Z80name>donthave</Z80name>
  717.           <SF02Name>dontHave</SF02Name>
  718.           <Value>You don't have that.</Value>
  719.         </StringDef>
  720.         <StringDef>
  721.           <StringName>DontSee</StringName>
  722.           <Z80name>dontseestr</Z80name>
  723.           <SF02Name>dontsee</SF02Name>
  724.           <Value>You don't see that here.</Value>
  725.         </StringDef>
  726.         <StringDef>
  727.           <StringName>CantSeeIn</StringName>
  728.           <Z80name>cantlook</Z80name>
  729.           <SF02Name>noPeek</SF02Name>
  730.           <Value>You can't see inside that.</Value>
  731.         </StringDef>
  732.         <StringDef>
  733.           <StringName>FindNothing</StringName>
  734.           <Z80name>nothing</Z80name>
  735.           <SF02Name>itsEmpty</SF02Name>
  736.           <Value>You find nothing.</Value>
  737.         </StringDef>
  738.         <StringDef>
  739.           <StringName>CantOpen</StringName>
  740.           <Z80name>cantopen</Z80name>
  741.           <SF02Name>cantopen</SF02Name>
  742.           <Value>You can't open that.</Value>
  743.         </StringDef>
  744.         <StringDef>
  745.           <StringName>CantEnter</StringName>
  746.           <Z80name>noenter</Z80name>
  747.           <SF02Name>noenter</SF02Name>
  748.           <Value>You can't enter that.</Value>
  749.         </StringDef>
  750.         <StringDef>
  751.           <StringName>NotContainer</StringName>
  752.           <Z80name>notcontainer</Z80name>
  753.           <SF02Name>notContainer</SF02Name>
  754.           <Value>You can't put things in that.</Value>
  755.         </StringDef>
  756.         <StringDef>
  757.           <StringName>NotSupporter</StringName>
  758.           <Z80name>notsupporter</Z80name>
  759.           <SF02Name>nosurface</SF02Name>
  760.           <Value>You find no suitable surface.</Value>
  761.         </StringDef>
  762.         <StringDef>
  763.           <StringName>CantWear</StringName>
  764.           <Z80name>notwearable</Z80name>
  765.           <SF02Name>notwearable</SF02Name>
  766.           <Value>You can't wear that.</Value>
  767.         </StringDef>
  768.         <StringDef>
  769.           <StringName>AlreadyWearing</StringName>
  770.           <Z80name>alreadyworn</Z80name>
  771.           <SF02Name>alreadyWorn</SF02Name>
  772.           <Value>You're already wearing that.</Value>
  773.         </StringDef>
  774.         <StringDef>
  775.           <StringName>Opening</StringName>
  776.           <Z80name>openingThe</Z80name>
  777.           <SF02Name>openningThe</SF02Name>
  778.           <Value>Opening the </Value>
  779.         </StringDef>
  780.         <StringDef>
  781.           <StringName>Reveals</StringName>
  782.           <Z80name>reveals</Z80name>
  783.           <SF02Name>reveals</SF02Name>
  784.           <Value> reveals...</Value>
  785.         </StringDef>
  786.         <StringDef>
  787.           <StringName>ItsClosed</StringName>
  788.           <Z80name>closed</Z80name>
  789.           <SF02Name>itsClosed</SF02Name>
  790.           <Value>It's closed.</Value>
  791.         </StringDef>
  792.         <StringDef>
  793.           <StringName>IsClosed</StringName>
  794.           <Z80name>isclosed</Z80name>
  795.           <SF02Name>isclosed</SF02Name>
  796.           <Value> is closed.</Value>
  797.         </StringDef>
  798.         <StringDef>
  799.           <StringName>IsEmpty</StringName>
  800.           <Z80name>isempty</Z80name>
  801.           <SF02Name>isempty</SF02Name>
  802.           <Value> is empty.</Value>
  803.         </StringDef>
  804.         <StringDef>
  805.           <StringName>IsLocked</StringName>
  806.           <Z80name>isLocked</Z80name>
  807.           <SF02Name>isLocked</SF02Name>
  808.           <Value> is locked.</Value>
  809.         </StringDef>
  810.         <StringDef>
  811.           <StringName>ItsLocked</StringName>
  812.           <Z80name>itslocked</Z80name>
  813.           <SF02Name>itslocked</SF02Name>
  814.           <Value>It's locked.</Value>
  815.         </StringDef>
  816.         <StringDef>
  817.           <StringName>DoorClosed</StringName>
  818.           <Z80name>doorclosed</Z80name>
  819.           <SF02Name>doorclosed</SF02Name>
  820.           <Value>The door is closed.</Value>
  821.         </StringDef>
  822.         <StringDef>
  823.           <StringName>ThereIsA</StringName>
  824.           <Z80name>thereisa</Z80name>
  825.           <SF02Name>thereisa</SF02Name>
  826.           <Value>There is a </Value>
  827.         </StringDef>
  828.         <StringDef>
  829.           <StringName>Here</StringName>
  830.           <Z80name>here</Z80name>
  831.           <SF02Name>here</SF02Name>
  832.           <Value> here.</Value>
  833.         </StringDef>
  834.         <StringDef>
  835.           <StringName>Contains</StringName>
  836.           <Z80name>contains</Z80name>
  837.           <SF02Name>contains</SF02Name>
  838.           <Value> contains...</Value>
  839.         </StringDef>
  840.         <StringDef>
  841.           <StringName>ItsNotLocked</StringName>
  842.           <Z80name>notlocked</Z80name>
  843.           <SF02Name>notlocked</SF02Name>
  844.           <Value>It's not locked.</Value>
  845.         </StringDef>
  846.         <StringDef>
  847.           <StringName>NotLockable</StringName>
  848.           <Z80name>notLockable</Z80name>
  849.           <SF02Name>notLockable</SF02Name>
  850.           <Value>It's not locked.</Value>
  851.         </StringDef>
  852.         <StringDef>
  853.           <StringName>AlreadyLocked</StringName>
  854.           <Z80name>alreadyLocked</Z80name>
  855.           <SF02Name>alreadyLocked</SF02Name>
  856.           <Value>It's already locked.</Value>
  857.         </StringDef>
  858.         <StringDef>
  859.           <StringName>AlreadyUnlocked</StringName>
  860.           <Z80name>alreadyUnlocked</Z80name>
  861.           <SF02Name>alreadyUnlocked</SF02Name>
  862.           <Value>It's already unlocked.</Value>
  863.         </StringDef>
  864.         <StringDef>
  865.           <StringName>NotPossible</StringName>
  866.           <Z80name>impossible</Z80name>
  867.           <SF02Name>impossible</SF02Name>
  868.           <Value>That's not possible.</Value>
  869.         </StringDef>
  870.         <StringDef>
  871.           <StringName>WhichWay</StringName>
  872.           <Z80name />
  873.           <SF02Name />
  874.           <Value>I don't know which way that is.</Value>
  875.         </StringDef>
  876.         <StringDef>
  877.           <StringName>BadPut</StringName>
  878.           <Z80name>badput</Z80name>
  879.           <SF02Name>badput</SF02Name>
  880.           <Value>That would violate the laws of physics.</Value>
  881.         </StringDef>
  882.         <StringDef>
  883.           <StringName>ProvidingLight</StringName>
  884.           <Z80name>providingLight</Z80name>
  885.           <SF02Name>providingLight</SF02Name>
  886.           <Value> (providing light)</Value>
  887.         </StringDef>
  888.         <StringDef>
  889.           <StringName>BeingWorn</StringName>
  890.           <Z80name>beingworn</Z80name>
  891.           <SF02Name>beingWorn</SF02Name>
  892.           <Value> (being worn)</Value>
  893.         </StringDef>
  894.         <StringDef>
  895.           <StringName>MissingNoun</StringName>
  896.           <Z80name>missingnoun</Z80name>
  897.           <SF02Name>missingDobj</SF02Name>
  898.           <Value>Missing noun.</Value>
  899.         </StringDef>
  900.         <StringDef>
  901.           <StringName>MissingPrep</StringName>
  902.           <Z80name>missingprep</Z80name>
  903.           <SF02Name>missingPrep</SF02Name>
  904.           <Value>Missing preposition.</Value>
  905.         </StringDef>
  906.         <StringDef>
  907.           <StringName>MissingNoun2</StringName>
  908.           <Z80name>missing_io</Z80name>
  909.           <SF02Name>missing_io</SF02Name>
  910.           <Value>Missing second noun.</Value>
  911.         </StringDef>
  912.         <StringDef>
  913.           <StringName>BadWord</StringName>
  914.           <Z80name>dontknowstr</Z80name>
  915.           <SF02Name>badword</SF02Name>
  916.           <Value>I don't know the word '</Value>
  917.         </StringDef>
  918.         <StringDef>
  919.           <StringName>BadVerb</StringName>
  920.           <Z80name>badverbstr</Z80name>
  921.           <SF02Name>badverb</SF02Name>
  922.           <Value>I don't know the verb '</Value>
  923.         </StringDef>
  924.         <StringDef>
  925.           <StringName>Ambiguous</StringName>
  926.           <Z80name>ambigstr</Z80name>
  927.           <SF02Name>ambig</SF02Name>
  928.           <Value>I don't know which one you mean.</Value>
  929.         </StringDef>
  930.         <StringDef>
  931.           <StringName>Bye</StringName>
  932.           <Z80name>bye</Z80name>
  933.           <SF02Name>bye</SF02Name>
  934.           <Value>Bye.</Value>
  935.         </StringDef>
  936.       </Strings>
  937.     </StringDefs>
  938.     <YouCantGoThatWay>You can't go that way.</YouCantGoThatWay>
  939.     <DefaultDescription>You notice nothing unexpected.</DefaultDescription>
  940.   </project>
  941. </xml>
  942. EOT;
  943. }
  944.  
  945.  
  946.  
  947. echo $text;
  948. if($write_to_lant_xml) {
  949.   $myfile = fopen("lant.xml", "w") or die("Unable to open file!");
  950.   fwrite($myfile, $text);
  951.   fclose($myfile);
  952. }
  953.  
  954.  
  955. //echo $text;
  956.  
  957. ?>
  958.  
Add Comment
Please, Sign In to add comment