@program #2411 1 1000 d i $include $lib/alynna $include $lib/rp $def RPSYSTEM "$RPSYSTEM" match $def SHIP me @ location "ship" getstat dbref $def MAXGRID 32 $def SKYROOM #2414 $def GETXY me @ "sky-x" getstatint x ! me @ "sky-y" getstatint y ! $def SETXY me @ "sky-x" x @ setstat me @ "sky-y" y @ setstat $def SKY_OK me @ "air?" getstatint me @ "special/fly" getstatint or $def SKY me @ location "sky?" getstatint $def GRID RPSYSTEM str "/grid/" x @ "/" y @ cat getpropstr atoi dbref $def GRIDPOINT "/" swap intostr strcat swap intostr swap strcat RPSYSTEM "/grid/" rot strcat getpropstr atoi dbref $def GRID2SKY dup location "sky-x" getstatint swap location "sky-y" getstatint lvar param lvar x lvar y : skygridupdate background var tmp var sx var sy 0 sy ! str " +" 0 MAXGRID 1 - 1 for pop "----+" repeat cat tellme begin sy @ MAXGRID % 0 = if sx @ intostr tellme then 0 sx ! sy @ intostr 3 rj " |" strcat tmp ! begin RPSYSTEM str "/grid/" sx @ "/" sy @ cat getpropstr atoi dup 0 > if dup intostr "|" strcat tmp @ swap strcat tmp ! dbref dup dup "sky-x" sx @ setstat "sky-y" sy @ setstat else pop tmp @ " |" strcat tmp ! then sx @ 1 + sx ! sx @ MAXGRID 1 - > until tmp @ tellme sy @ 1 + sy ! sy @ MAXGRID 1 - > until str " " 0 MAXGRID 1 - 1 for intostr " " swap 3 rj " " repeat cat tellme str " +" 0 MAXGRID 1 - 1 for pop "----+" repeat cat tellme "Done." tellme ; : moveit SKY_OK not if "You cannot fly!" "FF9" pretty tellme exit then SKY not if "You are not in the sky! Its odd that you even get this message!" "FF9" pretty tellme exit then GETXY command @ "{north|n}" smatch if y @ 1 - y ! then command @ "{northeast|ne}" smatch if x @ 1 + x ! y @ 1 - y ! then command @ "{east|e}" smatch if x @ 1 + x ! then command @ "{southeast|se}" smatch if x @ 1 + x ! y @ 1 + y ! then command @ "{south|s}" smatch if y @ 1 + y ! then command @ "{southwest|sw}" smatch if x @ 1 - x ! y @ 1 + y ! then command @ "{west|w}" smatch if x @ 1 - x ! then command @ "{northwest|nw}" smatch if x @ 1 - x ! y @ 1 - y ! then x @ MAXGRID % x ! y @ MAXGRID % y ! x @ 0 < if MAXGRID 1 - x ! then y @ 0 < if MAXGRID 1 - y ! then str me @ " moves to (" x @ "," y @ ") on the grid, over " GRID name cat "FF9" pretty tellhere GRID #-1 str me @ " is seen flying overhead." cat "Fly" pretty notify_except SETXY ; : skylook param @ "" stringcmp if param @ #271 call exit then GETXY var target SKY not if "You arent even in the sky, mon." "FF9" pretty tellme exit then SKY_OK not if me @ "lastloc" getstat "sky-x" getstatint x ! me @ "lastloc" getstat "sky-y" getstatint y ! str me @ " cannot fly! This is really gonna hurt..." cat "OOPS" pretty tellhere me @ GRID moveto str me @ " falls from high inside the sky, landing with a massive thud!" cat "OOPS" pretty tellhere me @ str "+spend HP=" random 100 % 20 + cat force exit then str "^CYAN^[The sky (" x @ "," y @ ")]: Above " GRID name "^ ^" cat tellme "You are flying high up in the sky!" tellme str "^YELLOW^Below you, you see:^ ^" cat tellme GRID "_/de" getpropstr mpime tellme str "^YELLOW^Around you in the sky, you see:^ ^" cat tellme me @ location contents_array foreach target ! str "At (" target @ "sky-x" getstatint "," target @ "sky-y" getstatint "): " target @ name target @ "doing" getstatstr "0" stringcmp if " (" target @ "doing" getstatstr ")" then cat tellme repeat ; : fly SKY_OK not if "You cannot fly!" "FF9" pretty tellme exit then me @ GRID2SKY y ! x ! x @ y @ + 0 = if "There is no airspace here! Perhaps you are inside." "FF9" pretty tellme exit then SKY not if str me @ " takes off into the sky above!" cat "FF9" pretty tellme me @ SKYROOM moveto me @ "sky-x" x @ setstat me @ "sky-y" y @ setstat str me @ " ascends from " GRID name ", joining you in the sky!" cat "FF9" pretty tellhere else "You are already flying!" "FF9" pretty tellme then ; : land GETXY SKY not if "You are already on the ground." "FF9" pretty tellme exit then GRID #0 dbcmp if "You can't land there. That looks like ocean but its really icky limbo!" "FF9" pretty tellme exit then SKY_OK if str me @ " descends to land on the ground below." cat "FF9" pretty tellme me @ GRID moveto str me @ " descends from above and gracefully lands on the ground below." cat "FF9" pretty tellhere else str me @ " cannot fly! This is really gonna hurt..." cat "OOPS" pretty tellhere me @ GRID moveto str me @ " falls from high inside the sky, landing with a massive thud!" cat "OOPS" pretty tellhere me @ str "+spend HP=" random 100 % 20 + cat force then ; : main param ! command @ "{north|n|east|e|west|w|south|s|southeast|se|southwest|sw|northeast|ne|northwest|nw}" smatch if moveit exit then command @ "{land|down|d}" smatch if land exit then ( command @ "{dock|undock}" smatch if dock exit then ) command @ "{fly|up|takeoff|take off|f|u}" smatch if fly exit then command @ "+sky/gridupdate" smatch if skygridupdate exit then skylook ; . c q