@program #2411 1 10000 d i $include $lib/alynna $include $lib/rp $include $muf/rp/boxutils $def RPSYSTEM "$RPSYSTEM" match $def SHIP me @ location "ship" getstat dbref $def MINGRID -7 $def MAXGRID 7 $def SKYROOM #7186 $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 @ "car?" getstatint me @ "wings" getstatint 2 >= or $def SKY me @ location "sky?" getstatint $def GRID RPSYSTEM { "/grid/" x @ "/" y @ }cat getpropstr atoi dbref dup room? not if pop #0 then $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 { " +" MINGRID MAXGRID 1 for pop "----+" repeat }cat tellme MINGRID MAXGRID 1 for sy ! { sy @ intostr 4 rj "|" MINGRID MAXGRID 1 for sx ! RPSYSTEM { "/grid/" sx @ "/" sy @ }cat getprop toint tmp ! tmp @ if tmp @ intostr 4 rj "|" tmp @ dbref dup "sky-x" sx @ setstat "sky-y" sy @ setstat else " |" then repeat }cat tellme repeat { "Y +" MINGRID MAXGRID 1 for pop "----+" repeat }cat tellme { " X" MINGRID MAXGRID 1 for intostr " " swap 3 rj " " 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 > if MINGRID x ! then y @ MAXGRID > if MINGRID y ! then x @ MINGRID < if MAXGRID x ! then y @ MINGRID < if MAXGRID y ! then { me @ " moves to (" x @ "," y @ ") on the grid, over " GRID name }cat "FF9" pretty tellhere GRID #-1 { 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 ! { me @ " cannot fly! This is really gonna hurt..." }cat "OOPS" pretty tellhere me @ GRID moveto { me @ " falls from high inside the sky, landing with a massive thud!" }cat "OOPS" pretty tellhere me @ "gear" "parachute" findboxitem if me @ "+use parachute" force else me @ { "+spend HP=" random 100 % 20 + }cat force then exit then { "^CYAN^[The sky (" x @ "," y @ ")]: Above " GRID name "^ ^" }cat tellme "You are flying high up in the sky!" tellme { "^YELLOW^Below you, you see:^ ^" }cat tellme GRID "_/de" getpropstr mpime tellme { "^YELLOW^Around you in the sky, you see:^ ^" }cat tellme me @ location contents_array foreach target ! { "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 @ GRID #0 dbcmp if "There is no airspace here! Perhaps you are inside." "FF9" pretty tellme exit then SKY not if { me @ " takes off into the sky above!" }cat "FF9" pretty tellme me @ SKYROOM moveto me @ "sky-x" x @ setstat me @ "sky-y" y @ setstat { 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 { me @ " descends to land on the ground below." }cat "FF9" pretty tellme me @ GRID moveto { me @ " descends from above and gracefully lands on the ground below." }cat "FF9" pretty tellhere else { me @ " cannot fly! This is really gonna hurt..." }cat "OOPS" pretty tellhere me @ GRID moveto { me @ " falls from high inside the sky, landing with a massive thud!" }cat "OOPS" pretty tellhere me @ "gear" "parachute" findboxitem if me @ "+use parachute" force else me @ { "+spend HP=" random 100 % 20 + }cat force then 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|dock|down|d}" smatch if land 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