ROOM ID 600 NOCYBORGS NAME "miniature golf" PICT "club.gif" ARTIST "lion hisself" PICTURE ID 1 NAME "arrowll.gif" TRANSCOLOR 0 ENDPICTURE PICTURE ID 2 NAME "arrowrr.gif" TRANSCOLOR 0 ENDPICTURE DOOR ID 1 NAME "to the course" DONTMOVEHERE DEST 601 OUTLINE 406,349 466,349 467,361 406,361 LOC 436,355 SCRIPT ON ENTER { { currentX oldcurX - tvar0 = Xeshort tvar0 - tvar1 = { tvar1 Xeshort = } { -tvar1 Xeshort = } tvar0 tvar1 * 0 >= IFELSE currentY oldcurY - tvar0 = Yeshort tvar0 - tvar1 = { tvar1 Yeshort = } { -tvar0 Yeshort = } tvar0 tvar1 * 0 >= IFELSE } upeshort DEF;___________________________________________________________________ { ; inputs- shorts, xhit, yhit outputs verb 0,1,2,3,4,5,6 = ; horz bounce, vert bounce, corner, hole, endputt, at X wall, at Y wall ; trap if x,y=0,0 or all=0 or x,y sum > 26000 ; shorts Xx,Xy,Yx,Yy,holeX,holeY,lenX,lenY, currentX, currentY ; 8 ARRAY shorts0 = 8 ARRAY shorts1 = ; Xxshort shorts0 0 PUT Yxshort shorts0 1 PUT Xyshort shorts0 2 PUT Yyshort shorts0 3 PUT currentX Xeshort + shorts0 4 PUT currentY Yeshort + shorts0 5 PUT Xhshort shorts0 6 PUT Yhshort shorts0 7 PUT ; -1 len = " " tvar1 = ; put absolute value of currentX - Xshorts in shorts 1 -1 len = { len ++ shorts0 len GET tvar0 = tvar0 tvar2 = currentX tvar0 - tvar0 = { 2 tvar0 * tvar1 = tvar0 tvar1 - tvar0 = } tvar0 0 < IF { 0 tvar0 = } tvar2 0 == IF tvar0 shorts1 len PUT len ++ } { len 7 <> } WHILE ; put absolute value of currentY - Yshorts in shorts 1 0 len = { len ++ shorts0 len GET tvar0 = tvar0 tvar2 = currentY tvar0 - tvar0 = { 2 tvar0 * tvar1 = tvar0 tvar1 - tvar0 = } tvar0 0 < IF { 0 tvar0 = } tvar2 0 == IF tvar0 shorts1 len PUT len ++ } { len 8 <> } WHILE -1 len = " " tvar1 = ; put absolute value of sums in shorts1 -1 len = 0 tvar = { len ++ shorts1 len GET tvar0 = shorts1 1 len + GET tvar1 = tvar0 tvar1 + tvar0 = tvar0 shorts1 tvar PUT len ++ tvar ++} { len 7 < } WHILE -1 len = " " tvar1 = ; find closest point (tvar) -1 len = 30000 tvar0 = 4 tvar = { len ++ shorts1 len GET tvar1 = { ; corner { 2 verb = } tvar1 tvar0 == 1 len == AND 0 tvar== AND IF len tvar = { tvar1 tvar0 = tvar tvar3 = } tvar1 0 <> tvar 3 <> OR IF } tvar1 tvar0 <= tvar1 3 tvar0 + <= 3 verb == AND OR IF } { len 3 < } WHILE { "error...no hitz" LOGMSG print EXEC 6 teed = EXIT } shorts1 0 GET tvar0 = shorts1 1 GET tvar0 + 21000 > 3 verb <> AND IF ; update currentX,Y { 1000 Xaction /= } { 1000 Xaction %= } tvar3 3 == IFELSE { 1000 Yaction /= } { 1000 Yaction %= } tvar3 3 == IFELSE ; against wall(s) to start putt { 0 verb = } 5 verb == IF { 1 verb = } 6 verb == IF ; corner kick { Xxshort currentX = Yxshort currentY = upeshort EXEC } { 0 Xaction = } Verb 2 == IF verb 2 == xhit 1 == AND yhit 1 == AND IF ; currentX oldcurX = currentY oldcurY = ; xhit { Xxshort currentX = Yxshort currentY = 0 verb = upeshort EXEC } { 0 Xaction = } 1 tvar3 == 2 tvar3 == OR IF tvar3 0 == xhit 1 == AND verb 2 <> AND IF ; yhit { Xyshort currentX = Yyshort currentY = 1 verb = upeshort EXEC { Yaction Xaction = } Xaction 0 == IF } { 0 Yaction = } 0 tvar3 == 2 tvar3 == OR IF tvar3 1 == yhit 1 == AND verb 2 <> AND IF ; end { currentX Xeshort + currentX = currentY Yeshort + currentY = 4 verb = 0 Xaction = 0 Yaction = } tvar3 2 == IF ; hole { Xhshort currentX = Yhshort currentY = 3 verb = { Yaction Xaction = } Xaction 0 == IF } tvar3 3 == IF ; } findevent DEF ;___________________________________________________________________ ; bounce ball { ; hole 2 go to second fairway { 209 currentX = 223 currentY = paintball EXEC 9 deltaX = 100 deltaY = 30 Xeshort = 500 Yeshort = } Xaction 20 == IF { 257 currentX = 223 currentY = paintball EXEC 30 deltaX = 30 deltaY = 200 Xeshort = 200 Yeshort = } Xaction 21 == IF { 223 currentX = 223 currentY = paintball EXEC -10 deltaX = 100 deltaY = -40 Xeshort = 400 Yeshort = } Xaction 22 == IF ; hole 7, the clown 0 tvar2 = { 2 RANDOM tvar2 = } Xaction 71 == IF { paintball EXEC currentY 35 + currentY = paintball EXEC } Xaction 70 == IF { paintball EXEC currentY 35 - currentY = paintball EXEC } Xaction 71 == tvar2 0 == AND IF ; pahtooie { 1 90 SETSPOTSTATE 1 verb = 0 Xaction = "@235,163 pahhhtooieee..." ROOMMSG 90 RANDOM tvar2 = 200 tvar2 += 20 RANDOM tvar3 = 240 tvar3 += tvar2 currentX = tvar3 currentY = } tvar2 0 > Xaction 71 == AND IF ; hole 9 loop the loop { paintball EXEC currentY 55 - currentY = paintball EXEC } Xaction 90 == IF { paintball EXEC currentY 55 + currentY = paintball EXEC } Xaction 91 == IF ; hole 13 the windmill 0 tvar2 = { 3 RANDOM tvar2 = } Xaction 133 == IF { paintball EXEC currentX 55 + currentX = paintball EXEC } Xaction 130 == IF { paintball EXEC currentX 55 - currentX = paintball EXEC } Xaction 131 == IF { paintball EXEC currentX 85 + currentX = paintball EXEC } Xaction 132 == IF { paintball EXEC currentX 75 - currentX = paintball EXEC } Xaction 133 == tvar2 0 == AND IF ; hit the blade, reverse putt and end of putt { 0 verb = 0 Xaction = "@230,159 bonk...gotcha..." ROOMMSG } tvar2 0 > Xaction 133 == AND IF ; wall or corner { { 2 deltaX * tvar0 = deltaX tvar0 - deltaX = } 0 verb == 2 verb == OR IF { 2 deltaY * tvar0 = deltaY tvar0 - deltaY = } 1 verb == 2 verb == OR IF ; switch end of putt { 2 Xeshort * tvar0 = Xeshort tvar0 - Xeshort = } 0 verb == 2 verb == OR IF { 2 Yeshort * tvar0 = Yeshort tvar0 - Yeshort = } 1 verb == 2 verb == OR IF } Xaction 1 <= IF ; done with putt....in the hole!..... { 6 teed = stroke ++ { { "@190,10 ! a hole in one!!!" SAY } stroke 1 == IF update EXEC ROOMID playd = } { "sorry...no mulligans...." STATUSMSG } ROOMID 1 - playd == IFELSE EXIT } 3 verb == Xaction 1 <= AND IF { 5 teed = stroke ++ } 4 verb == IF { "what happened now ?" SAY EXIT } 0 verb <> 1 verb <> AND 2 verb <> AND 3 verb <> AND 4 verb <> AND IF } bounce DEF ;___________________________________________________________________ { ; GLOBALS: ; putt control teed GLOBAL ; update score update GLOBAL ; stroke number and total stroke GLOBAL tstroke GLOBAL score GLOBAL tscore GLOBAL ; current side,x,y coordinates of ball currentX GLOBAL currentY GLOBAL oldYside GLOBAL oldXside GLOBAL curYside GLOBAL curXside GLOBAL ; old current x,y oldcurX GLOBAL oldcurY GLOBAL ; x,y cursor coordinates cursX GLOBAL cursY GLOBAL ; stroke length deltaX GLOBAL deltaY GLOBAL Xeshort GLOBAL Yeshort GLOBAL oldDeltaX GLOBAL oldDeltaY GLOBAL ; distance to collision Xdelta GLOBAL Ydelta GLOBAL ; was there a collision yhit GLOBAL xhit GLOBAL ; shortest vert event coord's Xxshort GLOBAL Yxshort GLOBAL ; shortest horiz event coord's Xyshort GLOBAL Yyshort GLOBAL ; hole coords Xhshort GLOBAL Yhshort GLOBAL ; action to take verb GLOBAL ; av positioning tvar2s tvar0 GLOBAL tvar1 GLOBAL ; update scoreboard? playd GLOBAL ; action to take Xaction GLOBAL Yaction GLOBAL ;___________________________________________________________________ ;ATOMLISTS: ; ; intializations inits GLOBAL ; print parameters print GLOBAL ; paint ball paintball GLOBAL ; line up putt lineup GLOBAL ; draw line to event point paintflite GLOBAL ; find event point findevent GLOBAL ; find closest event findclose GLOBAL ; bounce ball bounce GLOBAL ; check for collisions impact GLOBAL ; putt direction and speed setputt GLOBAL ; update end of putt upeshort GLOBAL } globes DEF ;___________________________________________________________________ ;INITIALIZATIONS: { 2 curXside = 2 curYside = 0 Xxshort = 0 Xyshort = 0 Yxshort = 0 Yyshort = 0 xhit = 0 yhit = 2 verb = 0 currentX = 0 currentY = 0 teed = 0 stroke = } inits DEF ;___________________________________________________________________ globes GLOBAL globes EXEC ; ; position avs { tvar0 tvar1 SETPOS } 0 tvar0 <> 0 tvar1 <> AND IF } ;___________________________________________________________________ ON LEAVE { globes GLOBAL globes EXEC POSX tvar0 = POSY tvar1 = "" tstroke = "" score = 0 tscore = ROOMID playd = } ENDSCRIPT ENDDOOR DOOR ID 2 OUTLINE 23,340 43,340 43,358 23,358 LOC 33,349 SCRIPT ON ENTER { "________________________________________________ " STATUSMSG " Palace Miniature Golf by lion....... " STATUSMSG "Distribute and modify to your heart's content....." STATUSMSG "________________________________________________ " STATUSMSG "For instructions on how to play type 'help'" STATUSMSG "________________________________________________ " STATUSMSG " " STATUSMSG } ON OUTCHAT { { "" CHATSTR = "___________________________________________________________" LOGMSG " 1. Start by clicking on the tee (dark green) to place your ball" LOGMSG " 2. Then click anywhere inside the black outline to line up your putt." LOGMSG " 3. Moving your cursor draws a red line between the club (your cursor) and the ball." LOGMSG " The red line points through the ball in the direction the putt will go." LOGMSG " The length of the red line indicates how hard you will hit the putt." LOGMSG " 4. The next click will start the putt. After the ball comes to rest," LOGMSG " clicking inside the black line will line up your next putt." LOGMSG " Keep this up until you make the putt or your mouse dies." LOGMSG " 5. Multiple players can play. Their log will indicate their own running score." LOGMSG " 6. Players may alternate playing the entire hole or alternate shots." LOGMSG " 7. You should play each hole in order." LOGMSG " 8. Ocasionally (mea culpa) the ball goes berserk. In those cases," LOGMSG " reentering the room should allow you to replay the hole." LOGMSG " 9. Feel free to pass this script and the pictures along to anyone." LOGMSG "10. Also any modifications, improvements, or fixes are welcome." LOGMSG "___________________________________________________________" LOGMSG "Enjoy.....lion...." LOGMSG } CHATSTR "help" == CHATSTR "'help'" == OR IF { "version beta 2p0" logmsg "" CHATSTR = } CHATSTR "vers" == IF } ENDSCRIPT ENDDOOR DOOR ID 3 DONTMOVEHERE DEST 12441 OUTLINE 7,6 63,6 63,28 7,28 LOC 33,17 PICTS 1,0,0 ENDPICTS ENDDOOR DOOR ID 4 DONTMOVEHERE DEST 309 OUTLINE 450,4 505,4 505,24 450,24 LOC 479,14 PICTS 2,0,0 ENDPICTS SCRIPT ON INCHAT { nDoIt GLOBAL nDoIt EXEC } ON ENTER { { CLEARLOOSEPROPS PAINTCLEAR } NBRROOMUSERS 2 < IF } ENDSCRIPT ENDDOOR ENDROOM