Inform - Resources - Examples

Back to List

Inventory
Complete

Backward
Forward

Plain
Coloured
Gaudy

This code
in plain text

Browsing Advent.inf

35. Teleportation (uses also UnknownVerb entry point) (lines 3960-3986)

3960  [ TeleportScope
3961      obj;
3962      switch (scope_stage) {
3963        1:    rfalse;
3964        2:    objectloop (obj ofclass Room)
3965                  if (obj has visited) PlaceInScope(obj);
3966              rtrue;
3967        3:    return L__M(##Go, 2);
3968      }
3969  ];
3970   
3971  [ TeleportSub;
3972      if (noun == location) "But you're already here!";
3973      PlayerTo(noun);
3974  ];
3975   
3976  Extend 'go'
3977      * scope=TeleportScope       -> Teleport
3978      * 'to' scope=TeleportScope  -> Teleport;
3979   
3980  #Ifndef DEBUG;
3981   
3982  Verb 'goto'
3983      * scope=TeleportScope       -> Teleport;
3984   
3985  #Endif;
3986   


Last updated 23 June 2004. This site is no longer supported; information may be out of date.
Maintained as a historical archive by the Interactive Fiction Technology Foundation. Copyright 1993-2018 IFTF, CC-BY-SA unless otherwise noted.
This page was originally managed by Graham Nelson (graham@gnelson.demon.co.uk) assisted by C Knight.