├── changes.doc ├── changes.htm ├── hunger.bmp ├── script.doc ├── script.htm ├── daedalus.doc ├── daedalus.htm ├── daeicon1.ico ├── daeicon2.ico ├── daeicon3.ico ├── daeicon4.ico ├── daeicon5.ico ├── daeicon6.ico ├── daedalus.url ├── daedlus2.url ├── README.md ├── Daedalus.sln ├── Makefile ├── daedalus.def ├── scrnsave.ds ├── wordmaze.ds ├── maze4d.ds ├── mandy.ds ├── escher.d3 ├── Daedalus.vcxproj ├── virtual.ds ├── survmaz1.ds ├── threed.h ├── wdriver.h ├── pentris.ds ├── Daedalus.vcproj ├── draw.h ├── pacman.ds ├── survmaz4.ds ├── maze5d.ds ├── squared.ds ├── survmaz2.ds ├── color.h ├── gigamaze.ds ├── survmaz5.ds ├── survmaz9.ds ├── demos.ds ├── survmaz6.ds └── graphics.h /changes.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CruiserOne/Daedalus/HEAD/changes.doc -------------------------------------------------------------------------------- /changes.htm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CruiserOne/Daedalus/HEAD/changes.htm -------------------------------------------------------------------------------- /hunger.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CruiserOne/Daedalus/HEAD/hunger.bmp -------------------------------------------------------------------------------- /script.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CruiserOne/Daedalus/HEAD/script.doc -------------------------------------------------------------------------------- /script.htm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CruiserOne/Daedalus/HEAD/script.htm -------------------------------------------------------------------------------- /daedalus.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CruiserOne/Daedalus/HEAD/daedalus.doc -------------------------------------------------------------------------------- /daedalus.htm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CruiserOne/Daedalus/HEAD/daedalus.htm -------------------------------------------------------------------------------- /daeicon1.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CruiserOne/Daedalus/HEAD/daeicon1.ico -------------------------------------------------------------------------------- /daeicon2.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CruiserOne/Daedalus/HEAD/daeicon2.ico -------------------------------------------------------------------------------- /daeicon3.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CruiserOne/Daedalus/HEAD/daeicon3.ico -------------------------------------------------------------------------------- /daeicon4.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CruiserOne/Daedalus/HEAD/daeicon4.ico -------------------------------------------------------------------------------- /daeicon5.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CruiserOne/Daedalus/HEAD/daeicon5.ico -------------------------------------------------------------------------------- /daeicon6.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CruiserOne/Daedalus/HEAD/daeicon6.ico -------------------------------------------------------------------------------- /daedalus.url: -------------------------------------------------------------------------------- 1 | [InternetShortcut] 2 | URL=http://www.astrolog.org/labyrnth/daedalus.htm 3 | IconFile=http://www.astrolog.org/favicon.ico 4 | IconIndex=1 5 | IDList= 6 | [{000214A0-0000-0000-C000-000000000046}] 7 | Prop3=19,2 8 | [DEFAULT] 9 | BASEURL=http://www.astrolog.org/labyrnth/daedalus.htm 10 | -------------------------------------------------------------------------------- /daedlus2.url: -------------------------------------------------------------------------------- 1 | [InternetShortcut] 2 | URL=http://www.magitech.com/astrolog/labyrnth/daedalus.htm 3 | IconFile=http://www.magitech.com/astrolog/favicon.ico 4 | IconIndex=1 5 | IDList= 6 | [{000214A0-0000-0000-C000-000000000046}] 7 | Prop3=19,2 8 | [DEFAULT] 9 | BASEURL=http://www.magitech.com/astrolog/labyrnth/daedalus.htm 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Daedalus 3.5 2 | This is a copy of the "official" version of Daedalus 3.5 (released Oct 31, 2024) described at: http://www.astrolog.org/labyrnth/daedalus.htm 3 | 4 | The files here were copied from: http://www.astrolog.org/labyrnth/daedalus/dae35zip.zip 5 | 6 | No modifications have been made to any of these files, and the only addition is this GITHUB format README. 7 | -------------------------------------------------------------------------------- /Daedalus.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.29215.179 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Daedalus", "Daedalus.vcxproj", "{3F41CB08-9973-4856-ACC3-66ABE55D0E4D}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Win32 = Debug|Win32 11 | Release|Win32 = Release|Win32 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {3F41CB08-9973-4856-ACC3-66ABE55D0E4D}.Debug|Win32.ActiveCfg = Debug|Win32 15 | {3F41CB08-9973-4856-ACC3-66ABE55D0E4D}.Debug|Win32.Build.0 = Debug|Win32 16 | {3F41CB08-9973-4856-ACC3-66ABE55D0E4D}.Release|Win32.ActiveCfg = Release|Win32 17 | {3F41CB08-9973-4856-ACC3-66ABE55D0E4D}.Release|Win32.Build.0 = Release|Win32 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {EA36D49B-46A9-4EAF-BE0B-377A08A90A33} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # Daedalus (Version 3.5) File: Makefile 2 | # By Walter D. Pullen, Astara@msn.com, http://www.astrolog.org/labyrnth.htm 3 | # 4 | # IMPORTANT NOTICE: Daedalus and all Maze generation and general 5 | # graphics routines used in this program are Copyright (C) 1998-2024 by 6 | # Walter D. Pullen. Permission is granted to freely use, modify, and 7 | # distribute these routines provided these credits and notices remain 8 | # unmodified with any altered or distributed versions of the program. 9 | # The user does have all rights to Mazes and other graphic output 10 | # they make in Daedalus, like a novel created in a word processor. 11 | # 12 | # First created 12/7/2018. 13 | # 14 | # This Makefile is included only for convenience. One could easily compile 15 | # Daedalus on a Unix system by hand with the command: 16 | # % g++ -c -O *.cpp; g++ -o daedalus *.o -lm 17 | # Generally, all that needs to be done to compile once util.h has been 18 | # edited, is compile each source file, and link them together with the math 19 | # library. 20 | # 21 | NAME = daedalus 22 | OBJS = color.o command.o create.o create2.o create3.o daedalus.o\ 23 | draw.o draw2.o game.o graphics.o inside.o labyrnth.o maze.o solids.o\ 24 | solve.o threed.o util.o 25 | 26 | LIBS = -lm -s 27 | CPPFLAGS = -O -Wno-write-strings -Wno-narrowing -Wno-comment 28 | RM = rm -f 29 | 30 | daedalus:: $(OBJS) 31 | g++ -o $(NAME) $(OBJS) $(LIBS) 32 | 33 | clean: 34 | $(RM) $(OBJS) $(NAME) 35 | # -------------------------------------------------------------------------------- /daedalus.def: -------------------------------------------------------------------------------- 1 | ; Daedalus (Version 3.5) File: daedalus.def 2 | ; By Walter D. Pullen, Astara@msn.com, http://www.astrolog.org/labyrnth.htm 3 | ; 4 | ; IMPORTANT NOTICE: Daedalus and all Maze generation and general 5 | ; graphics routines used in this program are Copyright (C) 1998-2024 by 6 | ; Walter D. Pullen. Permission is granted to freely use, modify, and 7 | ; distribute these routines provided these credits and notices remain 8 | ; unmodified with any altered or distributed versions of the program. 9 | ; The user does have all rights to Mazes and other graphic output 10 | ; they make in Daedalus, like a novel created in a word processor. 11 | ; 12 | ; More formally: This program is free software; you can redistribute it 13 | ; and/or modify it under the terms of the GNU General Public License as 14 | ; published by the Free Software Foundation; either version 2 of the 15 | ; License, or (at your option) any later version. This program is 16 | ; distributed in the hope that it will be useful and inspiring, but 17 | ; WITHOUT ANY WARRANTY; without even the implied warranty of 18 | ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 | ; General Public License for more details, a copy of which is in the 20 | ; LICENSE.HTM included with Daedalus, and at http://www.gnu.org 21 | ; 22 | ; Last code change: 10/30/2024. 23 | 24 | NAME DAEDALUS 25 | DESCRIPTION "Daedalus 3.5 - By Walter D. Pullen" 26 | EXETYPE WINDOWS 27 | STUB 'WINSTUB.EXE' 28 | CODE PRELOAD MOVEABLE DISCARDABLE 29 | DATA PRELOAD MOVEABLE MULTIPLE 30 | HEAPSIZE 4096 31 | EXPORTS WndProc @1 32 | 33 | ; daedalus.def 34 | -------------------------------------------------------------------------------- /scrnsave.ds: -------------------------------------------------------------------------------- 1 | DS 2 | // Daedalus Screensaver - A script file for Daedalus 3.5 3 | // By Walter D. Pullen, Astara@msn.com, http://www.astrolog.org/labyrnth.htm 4 | 5 | // Variable usage: 6 | // r: Day/night mode slowdown rate 7 | // s: Day/night mode fraction/second 8 | // t: Day/night current time/total 9 | // u: Day/night time increment rate (constant) 10 | 11 | $1 "" // Password string 12 | DefineMacro 1 "@z fScreenSaver If Not @z {Break} $0 '' GetString 'Enter password' 0 If @z {Break} @z True IfElse EquStr $0 $1 '@z False' 'Message (Bad password!)'" "Exit Event" 13 | 14 | DefineMacro 25 "fRedrawWhenBitmapEdited False @t Add @t @u If Gte @t Mul 1536 @r {@t 0} @m Div @t Mul 256 @r @s Div Mod @t Mul 256 @r @r Macro Add 26 @m MoveCloud -1 18000 fRedrawWhenBitmapEdited True" "Inside Event" 15 | DefineMacro 26 "If Equ @s 0 {kSky Aqua kCloud White kCloud2 Light LtGray kMountain Brown kMountain2 Gray nFogDistance 0 kGround2 -1 nSunMoonY 333}" "Midday" 16 | DefineMacro 27 "kSky Rgb 0 Sub 255 @s 255 kCloud GrayN Sub 255 Div Mul @s 3 8 kCloud2 GrayN Sub 223 Div Mul @s 3 8 kMountain Rgb Sub 127 Div @s 8 Sub 63 Div @s 16 0 kMountain2 GrayN Sub 127 Div Mul @s 52 256 nFogDistance Sub 5290 Mul @s 20 kGround2 Rgb 0 Sub 128 Div @s 4 0 nSunMoonY Add 333 Div Mul @s 667 256" "Late Day" 17 | DefineMacro 28 "If Equ @s 0 {fStars True} kSky Rgb 0 0 Sub 255 @s kCloud GrayN Sub 159 Div Mul @s 3 8 kCloud2 GrayN Sub 127 Div Mul @s 3 8 kMountain Rgb Sub 95 Div @s 8 Sub 47 Div @s 16 0 kMountain2 GrayN Sub 75 Div Mul @s 52 256 nStarCount Mul @s 3 nFogDistance Sub 170 Div @s 2 kGround2 Rgb 0 Sub 64 Div @s 4 0 nSunMoonY Sub 1000 Div Mul @s 667 256" "Early Night" 18 | DefineMacro 29 "If Equ @s 0 {kSky Black kCloud DkGray kCloud2 Dark DkGray kMountain Dark Brown kMountain2 GrayN 23 nStarCount 768 nFogDistance 42 kGround2 Black nSunMoonY 333}" "Midnight" 19 | DefineMacro 30 "kSky Rgb 0 0 @s nStarCount Mul Sub 255 @s 3 kCloud GrayN Add 64 Div Mul @s 3 8 kCloud2 GrayN Add 32 Div Mul @s 3 8 kMountain Rgb Add 63 Div @s 8 Add 31 Div @s 16 0 kMountain2 GrayN Add 24 Div Mul @s 52 256 nFogDistance Add 42 Div @s 2 kGround2 Rgb 0 Div @s 4 0 nSunMoonY Add 333 Div Mul @s 667 256" "Late Night" 20 | DefineMacro 31 "If Equ @s 0 {fStars False} kSky Rgb 0 @s 255 kCloud GrayN Add 160 Div Mul @s 3 8 kCloud2 GrayN Add 128 Div Mul @s 3 8 kMountain Rgb Add 95 Div @s 8 Add 47 Div @s 16 0 kMountain2 GrayN Add 76 Div Mul @s 52 256 nFogDistance Add 170 Mul @s 20 kGround2 Rgb 0 Add 64 Div @s 4 0 nSunMoonY Sub 1000 Div Mul @s 667 256" "Early Day" 21 | 22 | fRedrawWhenBitmapEdited False ResetProgram Size 32 32 0 1 Turtle "BM0,0R15ND14RNR15D15R15D16L31U16R15DNL14R15" cDel Zoom 8 6 0 2 = cF TextureOverlay TempDelete 23 | kDot Orange kOverlay Purple kInsideWall Maroon kGround DkGreen fWallsImpassable True nEdgeBehavior 0 rLightFactor 30 nMotionFrames 90 nRotationFrames 90 nOnProgramExit 1 nOnRedrawInside 25 @r 3 @t 999999 @u 1 24 | : ] } an CollapseToSet c8 nY -1 fRedrawWhenBitmapEdited True 0 N 25 | -------------------------------------------------------------------------------- /wordmaze.ds: -------------------------------------------------------------------------------- 1 | DS 2 | // Word Mazes - A script file for Daedalus 3.5 3 | // By Walter D. Pullen, Astara@msn.com, http://www.astrolog.org/labyrnth.htm 4 | 5 | // Variable usage: 6 | // k: Whether color bitmap 7 | // q: Whether skipping messages 8 | // s: Scale of Maze 9 | // t: Type of Maze 10 | // x-z: Temporary variables 11 | 12 | If Gte Version 2200 {Break} Message 'This script requires Daedalus 2.2 or later to run.' Break 13 | 14 | DefineMacro 1 {Message 'Welcome to Word Mazes!\n\nF1: Display this help text.\nF2: Create new Maze.\nF3: Toggle size.\nF4: Set Maze text.\n\nF5: Have Maze in shape of word.\nF6: Have Maze with rooms forming word.\nF7: Have Maze with solution spelling word (obvious).\nF8: Have Maze with solution spelling word (hidden).\nF9: Show perspective version of word.\n\nPress "k" to toggle solution view.'} "Help Text" 15 | DefineMacro 2 "fRedrawWhenBitmapEdited False @k fShowColorBitmap fShowColorBitmap False @q fSkipMessageDisplay fSkipMessageDisplay True @x Len $1 Macro Add 13 @t fSkipMessageDisplay @q fShowColorBitmap @k fRedrawWhenBitmapEdited True n" "New Maze" 16 | DefineMacro 3 "@s Sub 3 @s Macro2" "Toggle Size" 17 | DefineMacro 4 "GetString 'Enter word to use to create Maze:' 1 If @z {Break} Macro2" "Set Text" 18 | DefineMacro 5 "@t 0 Macro2" "Boundary" 19 | DefineMacro 6 "@t 1 Macro2" "Room" 20 | DefineMacro 7 "@t 2 Macro2" "Solution" 21 | DefineMacro 8 "@t 3 Macro2" "Hidden Solution" 22 | DefineMacro 9 "@t 4 Macro2" "Perspective Text" 23 | 24 | DefineMacro 13 "Size Add 3 Mul Sub Mul @x 24 4 @s Add 3 Mul 36 @s 0 1 @z Mul 4 @s SetString 0 'C1S@zA0T1BM1,1TT$1' Turtle $0 DoCount Mul 4 @s {Thicken} NoIslands ExpandSet PartialKruskal AddEntrance AddExit NoIsolation = \ MarkBlindAlley cDel _ F TempOr - _ cDel _ CopyMask -1 0 NoPassage cDel TempOr _ CopyMask 0 -1 Macro18 Blend3 Replace Cyan Black 0 Replace Blue Red 0 Replace Green Blue 0 Macro19" "Create Boundary" 25 | DefineMacro 14 "Size Inc Mul Add Mul @x 24 8 @s Inc Mul 44 @s 0 1 @z Mul 4 @s @y Mul 6 @s SetString 0 'C1S@zA0T1BM@y,@yTT$1' Turtle $0 DoCount Mul 4 @s {Thicken} cDel ExpandSet ColorDelete PartialKruskal AddEntrance AddExit NoIsolation = \ nX 0 nY 0 MarkBlindAlley cDel _ F TempOr - = Shortest _ Macro18 Blend3 Replace Cyan Black 0 Replace Blue Red 0 Replace Green Blue 0 Macro19" "Create Room" 26 | DefineMacro 15 "Macro16" "Create Solution" 27 | DefineMacro 16 "Size Inc Mul Add Mul @x 44 Sub 27 @s @s Inc Mul Sub 75 @s @s 0 1 sDel Set 1 0 Off @z Mul 4 @s SetString 0 'C0S@zA0T2BM1,1D15R3TT$1' Turtle $0 Turtle 'R3D4' If Equ @t 3 {DoCount Mul @s 2 'H'} = nX 1 nY 1 cP \ Macro18 Blend2 Replace Black Red 0 Replace Cyan Black 0 Macro19" "Create Hidden Solution" 28 | DefineMacro 17 "@y Sub Mul @x 12 2 Size @y Add Div @y 2 18 0 1 Turtle 'C1S2A0T1' nXTurtle 0 nYTurtle Sub SizeY 18 SetString 0 'TT$1' Turtle $0 Thicken nHorizontalSize Mul @s 5 nVerticalSize nHorizontalSize nXVanishingPoint Div Mul @y nHorizontalSize 2 nYVanishingPoint 0 k Pyramid k Pyramid cDel" "Create Perspective Text" 29 | 30 | DefineMacro 18 "If fCreateMazesPolished {Bias 1 3 1 3 _ Bias 1 3 1 3 _ - Bias 1 3 1 3 -}" "Bias Maze" 31 | DefineMacro 19 "If fCreateMazesPolished {Replace Black White 1}" "Polish Maze" 32 | 33 | fRedrawWhenBitmapEdited False ResetProgram WindowTitle "- Word Mazes" True nHorizontalScroll 8 nVerticalScroll 8 fHideMenu False fHideScrollbars False fShowDot False fNoCornerHopping True nInside 0 fFindAPathFindsRandomPath True kSkyHigh Gray kSkyLow Gray kGroundHigh LtGray kGroundLow DkGray $1 "DAEDALUS" @s 1 @t 0 If Not fCreateMazesPolished {/} Macro2 Macro1 34 | -------------------------------------------------------------------------------- /maze4d.ds: -------------------------------------------------------------------------------- 1 | DS 2 | // 4D Mazes - A script file for Daedalus 3.5 3 | // By Walter D. Pullen, Astara@msn.com, http://www.astrolog.org/labyrnth.htm 4 | 5 | // Variable usage: 6 | // a: Past color (constant) 7 | // b: Future color (constant) 8 | // c: Past & future color (constant) 9 | // d: Current color 10 | // h: Virtual x dimension of 4D Maze 11 | // q: Whether Maze is only 3D 12 | // v: Dimensions of Maze 13 | // w-z: Temporary dimension variables 14 | 15 | If Gte Version 2400 {Break} Message 'This script requires Daedalus 2.4 or later to run.' Break 16 | 17 | DefineMacro 1 "@x Sub 4 @q @y Pow @v @x @w Add 2000 @v IfElse @q {SetString 0 'Welcome to 4D Mazes!\n\nYou are in a 3-dimensional Maze, existing as a stack of 2D Mazes\nconnected by up and down holes. Make your way to the exit of\nthis @vx@vx@v Maze (@y cells total). It is at the SouthEast\ncorner on level @v.\n\n'} {SetString 0 'Welcome to 4D Mazes!\n\nYou are in a 4-dimensional Maze, existing as a sequence of 3D\nMazes connected by portals through time. Make your way to\nthe exit of this @vx@vx@vx@v Maze (@y cells total). The exit is\nat the SouthEast corner on level @v in the year @w.\n\n'} Message '$0F1: Display this help text.\nF2: Create new @xD Maze.\nF3: Create smaller @xD Maze.\nF4: Create larger @xD Maze.\n\n$1'" "Help Text" 18 | DefineMacro 2 "fRedrawWhenBitmapEdited False Macro Add 14 @q Macro17" "New Maze" 19 | DefineMacro 3 "If Lte @v 1 {IfElse @q (SetString 0 '') (SetString 0 'x@v') Message 'Come on now! A @vx@vx@v$0 Maze is as easy as they come! ;-)' Break} @v Dec @v Macro2" "Smaller Maze" 20 | DefineMacro 4 "If Gte @v 39 {IfElse @q (SetString 0 '') (SetString 0 'x@v') Message 'I think a @vx@vx@v$0 Maze is large enough for now. ;-)' Break} @v Inc @v Macro2" "Larger Maze" 21 | DefineMacro 5 "@q Not @q Macro2" "Toggle Dimension" 22 | DefineMacro 6 "fRedrawWhenBitmapEdited False If Equ nInside 0 {i} IfElse fStars {fStars False nFogDistance 0 kSky Cyan kCloud White kCloud2 Light Light LtGray kGround2 -1 k3DCeiling2 -1} {fStars True nFogDistance 150 kSky Black kCloud DkGray kCloud2 Dark kCloud kGround2 DkGray k3DCeiling2 Gray} fRedrawWhenBitmapEdited True Spc" "Day And Night" 23 | DefineMacro 7 "@z False Macro13 If @z {Break} If And Neq @d @a Neq @d @c {Message 'This portal does not lead to the past.' Break} nX Sub nX << @h 1" "Past" 24 | DefineMacro 8 "@z False Macro13 If @z {Break} If And Neq @d @b Neq @d @c {Message 'This portal does not lead to the future.' Break} nX Add nX << @h 1" "Future" 25 | DefineMacro 9 "fRedrawWhenBitmapEdited False Macro17" "Restart" 26 | 27 | DefineMacro 10 "If Not fCellLocation {Break} @w Add 2001 >> Div nX @h 1 @x Inc >> Mod nX @h 1 @y Inc >> nY 1 @z Inc >> nZ 1 IfElse @q {MessageInside 'X=@x, Y=@y, Level=@z' -2} {MessageInside 'X=@x, Y=@y, Level=@z, Year=@w' -2}" "Inside Text" 28 | DefineMacro 11 "@z False If And Equ @x 1 Equ @y -1 {Message 'This is the entrance to the Maze.\nDon't give up, find your way to the exit!' @z True Break} If And Equ @x Sub Size3X 2 Equ @y Size3Y {Macro16 @z True}" "Before Move" 29 | DefineMacro 12 "@z Or Get3E nX nY nZ And And Equ nX Sub Size3X 2 Equ nY Sub Size3Y 2 Equ nZ Sub Dec Size3Z @q" "Follow Event" 30 | 31 | DefineMacro 13 "If @q {Message '3D Mazes don't contain portals.' @z True Break} @x nX @y Add nY Mul Size3Y nZ If Not GetE @x @y {Message 'There is no portal here.' @z True Break} @d GetC @x @y" "Portal" 32 | DefineMacro 14 "fShowColorBitmap False Size3X Dec << Inc @v 1 Size3Y Dec << Inc @v 1 Size3Z << @v 1 Size3W << @v 1 @z nRandomBias nRandomBias Add @z 10 R nRandomBias @z TempDelete @h Size3X @z kInsideWall kInsideWall Black 4D3D @a @b @c kInsideWall @z fShowColorBitmap True" "Create 4D Maze" 33 | DefineMacro 15 "fShowColorBitmap False Size3X Dec << Inc @v 1 Size3Y Dec << Inc @v 1 Size3Z << @v 1 Size3W 1 @z nRandomBias nRandomBias Add @z 10 Q nRandomBias @z TempDelete ExtraDelete Quo Replace White kInsideWall 0" "Create 3D Maze" 34 | DefineMacro 16 "fPauseTimer True @z Timer @x Div @z 60 @y Mod @z 60 Message 'You step out the exit to the Maze! :-)\nCongratulations, you solved it in @x minutes, @y seconds.'" "Solve Maze" 35 | DefineMacro 17 "nX 1 nY 1 nZ 0 nDir 2 g fRedrawWhenBitmapEdited True n Macro1 fPauseTimer False ct" "Start" 36 | 37 | fRedrawWhenBitmapEdited False ResetProgram nAfterRedrawInside 10 nOnMoveToNewCell 11 nOnFollowToNewCell 12 OnCommand (f) 8 OnCommand (b) 7 OnCommand (cg) 9 38 | WindowTitle "- 4D Mazes" True nHorizontalScroll 8 nVerticalScroll 8 fHideMenu True fHideScrollbars True 39 | @a Red @b Blue @c Purple @q 0 @v 3 40 | SetString 1 'F5: Toggle between 4D and 3D Maze.\nF6: Switch background between day and night.\nF7 or "b": Go through portal into past (red cloud).\nF8 or "f": Go through portal into future (blue cloud).\n\nPress "u" & "d" to go up or down to adjacent level.\nPress "Ctrl+g" to restart current Maze.' 41 | kBorder Black kDot White fShowDot True nDotSize 0 fDotIsCircle True fWallsImpassable True fMoveByTwo False fDoDragOnTemp True nEdgeBehavior 0 nInside 2 fSealedEntrances False fCellLocation True fMountains True nPeakHeight 20 fNarrowWalls True nCellSize 160 nNarrowCellSize 40 nWallHeight 100 nViewHeight 0 nEntrancePositioning 0 fNoLocation True 42 | Macro2 43 | -------------------------------------------------------------------------------- /mandy.ds: -------------------------------------------------------------------------------- 1 | DS 2 | // Mandelbrot set exploration - A script file for Daedalus 3.5 3 | // By Walter D. Pullen, Astra@msn.com, http://www.astrolog.org/labyrnth.htm 4 | 5 | // Variable usage: 6 | // h: Current color depth used 7 | // i: 3D mode (0=Overhead, 1=Overview, 2=Inside) 8 | // j: Whether color depth maximized 9 | // k: Non-maximized color depth 10 | // l: Zoom level 11 | // m-p: Upper left and lower right coordinates of window 12 | // q-r: Coordinates of click 13 | // s-v: Initial horizontal coordinates of window 14 | // w: Whether zooming randomly 15 | // x-z: Temporary variables 16 | 17 | If Gte Version 2400 {Break} Message 'This script requires Daedalus 2.4 or later to run.' Break 18 | 19 | DefineMacro 1 "Message 'Welcome to Mandelbrot Set Exploration!\n\nThis applet allows one to view and zoom\nin on portions of a Mandelbrot Set fractal.\n\nF1: Display this help text.\nF2: Restart program.\nF3: Toggle maximized color depth.\nF4: Size bitmap to window.\n\nF5: Print coordinates.\nF6: Enter coordinates.\nF7: Toggle 3D overview.\nF8: Toggle 1st person perspective.\n\nF9: Zoom in randomly.\nF10: Toggle day and night.\nF11: Toggle burning ship variation.\nF12: Size bitmap to default.\n\nLeft mouse button: Zoom in.\nRight mouse button: Zoom out.\nMiddle mouse button: Recenter.'" "Help Text" 20 | DefineMacro 2 "If @i {Macro20 Break} Macro22 Macro1" "Initialize" 21 | DefineMacro 3 "If @i {Macro20 Break} @j Not @j Macro16" "Toggle Color" 22 | DefineMacro 4 "fRedrawWhenBitmapEdited False SizeWindow Macro16 fRedrawWhenBitmapEdited True n" "Resize Bitmap" 23 | DefineMacro 5 "Macro21 SetStringReal 0 @m 9 SetStringReal 1 @n 9 SetStringReal 2 @o 9 SetStringReal 3 @p 9 SetStringReal 4 @x 9 SetStringReal 5 @y 9 Message 'Current viewport coordinates:\n\nUpper left: ($0, $1)\nLower Right: ($2, $3)\nCenter: ($4, $5)'" "Print Coordinates" 24 | DefineMacro 6 "Macro21 SetStringReal 0 @x 9 SetStringReal 1 @y 9 GetString2 'Enter Horizontal Coordinate:' 'Enter Vertical Coordinate:' 0 If @z {Break} @q Real $0 9 @r Real $1 9 Macro19" "Enter Coordinates" 25 | DefineMacro 7 "If @i {Macro20 Break} Macro24" "Show 3D" 26 | DefineMacro 8 "If @i {Macro20 Break} fRedrawWhenBitmapEdited False @i 2 = \ ColorPut ExtraDelete k fGraphNumber True Macro16 Brightness Div 409500 @h 2 CopyTexture -1 1 CopyMask -1 1 fGraphNumber False + g cg fShowDot True nInside 4 fRedrawWhenBitmapEdited True n" "Show Inside" 27 | DefineMacro 9 "If Equ @i 1 {fRedrawWhenBitmapEdited False | @w True MandelbrotGet Macro23 Macro24 Break} @w True MandelbrotGet Macro13 @w False" "Zoom Random" 28 | DefineMacro 10 "If Equ nInside 0 {Macro8 Break} fRedrawWhenBitmapEdited False If Equ nInside 0 {i} IfElse fStars {fStars False kSky Cyan kGround Gray kMountain Brown kCloud White kCloud2 Light LtGray} {fStars True kSky Black kGround DkGray kMountain Dark Brown kCloud DkGray kCloud2 Dark kCloud} fRedrawWhenBitmapEdited True Spc" "Day And Night" 29 | DefineMacro 11 "If @i {Macro20 Break} fMandelbrotShip Not fMandelbrotShip Macro16" "Sinking Ship" 30 | DefineMacro 12 "If @i {Macro20 Break} fRedrawWhenBitmapEdited False cZ Quo Macro16 fRedrawWhenBitmapEdited True n" "Resize Bitmap" 31 | 32 | DefineMacro 13 "If @i {@z Or Neq @i 2 Neq nInside 0 If @z 'Macro20' Break} Macro23" "Left Event" 33 | DefineMacro 14 "If @i {Macro20 @z True Break} If Lte @l 0 {Message 'Can't zoom out any farther!' Break} @l Dec @l @k Sub @k 18 Macro18 @x Sub @o @m @y Sub @p @n Macro17 @z True" "Right Event" 34 | DefineMacro 15 "If @i {Macro20 Break} Macro18 @x Sub Div @o 2 Div @m 2 @y Sub Div @p 2 Div @n 2 Macro17" "Center Event" 35 | 36 | DefineMacro 16 "@h ?: @j 1536 @k Mandelbrot @m @n @o @p @h" "Redraw" 37 | DefineMacro 17 "If Or Lt Sub @q @x @s Gte Sub @q @x @o {@q Add @s @x} If Or Gt Add @q @x @u Lte Add @q @x @m {@q Sub @u @x} If Lt Sub @r @y @t {@r Add @t @y} If Gt Add @r @y @v {@r Sub @v @y} @m Sub @q @x @o Add @q @x @n Sub @r @y @p Add @r @y Macro16" "Change Window" 38 | DefineMacro 18 "@z 0 @q Sub Div @o 2 Div @m 2 IfElse Lt @q 100000 {@q Div Mul @q @x Div SizeCX 2} {@q Mul Div @q Div SizeCX 2 @x} @q Add @m @q @r Sub Div @p 2 Div @n 2 IfElse Lt @r 100000 {@r Div Mul @r @y Div SizeCY 2} {@r Mul Div @r Div SizeCY 2 @y} @r Add @n @r" "Center" 39 | DefineMacro 19 "@x Sub Div @o 2 Div @m 2 @y Sub Div @p 2 Div @n 2 @m Sub @q @x @o Add Add @m @x @x @n Sub @r @y @p Add Add @n @y @y Macro16" "Entered Center" 40 | DefineMacro 20 "fRedrawWhenBitmapEdited False @i 0 fShowColorBitmap True | kBorder Gray fShowDot False nInside 0 fRedrawWhenBitmapEdited True n" "Leave 3D" 41 | DefineMacro 21 "@x Add @m Sub Div @o 2 Div @m 2 @y Add @n Sub Div @p 2 Div @n 2" "Get Center" 42 | DefineMacro 22 "@v Mul Div Sub Div @u 2 Div @s 2 SizeCX SizeCY @t Neg @v @m @s @o @u @n @t @p @v @j False @k 72 @l 0 Macro16" "Do Reset" 43 | DefineMacro 23 "If Gte @l 29 {IfElse And @w fAutorepeatLastCommand (Macro22) (Message 'Can't zoom in any farther!') Break} @l Inc @l @k Add @k 18 Macro18 @x Sub Div @o 4 Div @m 4 @y Sub Div @p 4 Div @n 4 Macro17" "Do Zoom" 44 | DefineMacro 24 "fRedrawWhenBitmapEdited False @i 1 \ Zoom -2 -2 0 0 Macro16 = fGraphNumber True Macro16 Altitude -1 nDepthSize fGraphNumber False kBorder White fRedrawWhenBitmapEdited True n" "Do 3D" 45 | 46 | fRedrawWhenBitmapEdited False ResetProgram WindowTitle "- Mandelbrot Set" True nHorizontalScroll 8 nVerticalScroll 8 fHideMenu True fHideScrollbars True 47 | nOnLeftClick 13 nOnRightClick 14 nOnMiddleClick 15 nOnPrevClick 15 nOnNextClick 15 48 | nHorizontalPixelValue 1 nVerticalPixelValue 1 kBorder Gray kCloud2 Light LtGray fShowDot False fWallsImpassable True nEdgeBehavior 0 nInside 0 fNarrowWalls False nCellSize 50 nStepHeight 50 nClippingPlane 1000 nRainbowDistance 7200 nHorizontalSize 3 nVerticalSize 2 nDepthSize 255 fShadeObjects True nXLightVector -20 nYLightVector 0 nZLightVector 20 kGroundLow White nWallVariable 1 @i 0 @s -2050000000 @u 1000000000 @w False 49 | Size 512 384 0 1 c5 Quo fRedrawWhenBitmapEdited True Macro2 50 | -------------------------------------------------------------------------------- /escher.d3: -------------------------------------------------------------------------------- 1 | D3C 2 | 30 30 30 3 | 4 | q 5 | A0o 6 | A@o 7 | A^Y!" 8 | BY]!" 9 | DQ?!" 10 | HA0!" 11 | P!(A" 12 | _!$Q" 13 | ]!"Y" 14 | ]a]" 15 | ]a?" 16 | ]a0" 17 | ]a(B 18 | ]a$R 19 | ]a"Z 20 | ]b^ 21 | ]b@ 22 | ]b0 23 | ]b( 24 | ]b$ 25 | ]b" 26 | |4 27 | Ab" 28 | |2 29 | q 30 | 31 | nY(` 32 | A(A 33 | A$Q 34 | A"Y 35 | A!] 36 | A!? 37 | A!0 38 | A!(A 39 | A!$Q 40 | A!"Y 41 | Aa] 42 | Aa? 43 | Aa0 44 | Aa(A 45 | Aa$Q 46 | Aa"Y 47 | Ab] 48 | Ab? 49 | Ab0 50 | Ab( 51 | Ab$ 52 | Gb" 53 | |4 54 | Ab" 55 | |2 56 | Ab@ 57 | 58 | nY(` 59 | A(A 60 | A$Q 61 | A"Y 62 | A!] 63 | A!? 64 | A!0 65 | A!(A 66 | A!$Q 67 | A!"Y 68 | Aa] 69 | Aa? 70 | Aa0 71 | Aa(A 72 | Aa$Q 73 | Aa"Y 74 | Ab] 75 | Ab? 76 | Ab0 77 | Ab( 78 | Ab$ 79 | Db" 80 | |4 81 | Ab" 82 | |2 83 | Ab@ 84 | 85 | nY($ 86 | A(A 87 | A$Q 88 | A"Y 89 | A!] 90 | A!? 91 | A!0 92 | A!(A 93 | A!$Q 94 | A!"Y 95 | Aa] 96 | Aa? 97 | Aa0 98 | Aa(A 99 | Aa$Q 100 | Aa"Y 101 | Ab] 102 | Ab? 103 | Ab0 104 | Ab( 105 | Ab$ 106 | BAa" 107 | |4 108 | Ab" 109 | |2 110 | Ab@ 111 | 112 | p$ 113 | A(A 114 | A$Q 115 | A"Y 116 | A!] 117 | A!? 118 | A!0 119 | A!(A 120 | A!$Q 121 | A!"Y 122 | Aa] 123 | Aa? 124 | Aa0 125 | Aa(A 126 | Aa$Q 127 | Aa"Y 128 | Ab] 129 | Ab? 130 | Ab0 131 | Ab( 132 | Ab$ 133 | AQa" 134 | |4 135 | Ab" 136 | |2 137 | Ab@ 138 | 139 | p$ 140 | A 141 | |19 142 | A9 143 | |4 144 | A 145 | |2 146 | Ab" 147 | 148 | A@n$ 149 | A 150 | |19 151 | A- 152 | |4 153 | A 154 | |2 155 | Ab" 156 | 157 | A@n$ 158 | A 159 | |19 160 | A' 161 | |4 162 | A 163 | |2 164 | Ab" 165 | 166 | A@n$ 167 | A 168 | |19 169 | A$ 170 | |4 171 | A 172 | |2 173 | Ab" 174 | 175 | q 176 | nQ!] 177 | nA 178 | A@ 179 | A? 180 | A= 181 | `Y 182 | `Q 183 | `A 184 | ` 185 | _ 186 | ] 187 | Y 188 | Q 189 | A 190 | |3 191 | 192 | |2 193 | !"A 194 | | 195 | A"A 196 | |2 197 | A 198 | |2 199 | Ab" 200 | 201 | q 202 | nQ!] 203 | nA!] 204 | A@ 205 | A? 206 | A= 207 | `Y 208 | `Q 209 | `A 210 | ` 211 | _ 212 | ] 213 | Y 214 | Q 215 | A 216 | |3 217 | 218 | |2 219 | aQ 220 | | 221 | A!Q 222 | |2 223 | A 224 | |2 225 | Ab" 226 | 227 | q 228 | nQ!] 229 | nA!] 230 | A@a] 231 | A? 232 | A= 233 | `Y 234 | `Q 235 | `A 236 | ` 237 | _ 238 | ] 239 | Y 240 | Q 241 | A 242 | |3 243 | 244 | |2 245 | a9 246 | | 247 | A!9 248 | |2 249 | A 250 | |2 251 | Ab" 252 | 253 | q 254 | nQ!] 255 | nA!] 256 | A@a] 257 | A?a] 258 | A= 259 | `Y 260 | `Q 261 | `A 262 | ` 263 | _ 264 | ] 265 | Y 266 | Q 267 | A 268 | |3 269 | 270 | |2 271 | a- 272 | | 273 | A!- 274 | |2 275 | A 276 | |2 277 | Ab" 278 | 279 | q 280 | nQ!] 281 | nA!] 282 | A@a] 283 | A?a] 284 | A=a] 285 | `Y 286 | `Q 287 | `A 288 | ` 289 | _ 290 | ] 291 | Y 292 | Q 293 | A 294 | |3 295 | 296 | |2 297 | a' 298 | | 299 | A!' 300 | |2 301 | A 302 | |2 303 | Ab" 304 | 305 | q 306 | nQ!] 307 | nA!] 308 | A@a] 309 | A?a] 310 | A=a] 311 | `Ya] 312 | `Q 313 | `A 314 | ` 315 | _ 316 | ] 317 | Y 318 | Q 319 | A 320 | |3 321 | 322 | |2 323 | a$ 324 | | 325 | A!$ 326 | |2 327 | A 328 | |2 329 | Ab" 330 | 331 | q 332 | _"o 333 | A"o 334 | |5 335 | A"`A 336 | |9 337 | oA 338 | |4 339 | A$`A 340 | |2 341 | A!) 342 | |2 343 | A!)!" 344 | 345 | q 346 | _a$] 347 | | 348 | Aa$ 349 | |2 350 | A!)!] 351 | |2 352 | A!) 353 | |7 354 | A!)Q 355 | |4 356 | `!)Q 357 | A')Q 358 | |2 359 | A!) 360 | |2 361 | A!)!" 362 | 363 | q 364 | Aa'] 365 | _a'] 366 | _a' 367 | Aa' 368 | | 369 | A!)!] 370 | |3 371 | A!) 372 | |6 373 | A!)Y 374 | |4 375 | `!)Y 376 | A-)Y 377 | |2 378 | A!) 379 | |2 380 | A!)!" 381 | 382 | q 383 | Aa-] 384 | | 385 | _a- 386 | | 387 | Aa- 388 | A!)!] 389 | |4 390 | A!) 391 | |5 392 | A!)] 393 | |4 394 | `!)] 395 | A9)] 396 | |2 397 | A!) 398 | |2 399 | A!)!" 400 | 401 | q 402 | Aa9] 403 | | 404 | Aa9 405 | _a9 406 | | 407 | A!)!] 408 | |5 409 | A!) 410 | |4 411 | A!)_ 412 | |4 413 | `!)_ 414 | AQ)_ 415 | |2 416 | A!) 417 | |2 418 | A!)!" 419 | 420 | q 421 | AaQ] 422 | | 423 | AaQ 424 | | 425 | _aQ 426 | _!)!] 427 | A!)!] 428 | |5 429 | A!) 430 | |3 431 | A!)` 432 | |4 433 | `!)` 434 | BA)` 435 | |2 436 | A!) 437 | |2 438 | A!)!" 439 | 440 | q 441 | A!"A` 442 | |4 443 | _!)!` 444 | | 445 | A!)!` 446 | |4 447 | A!0n 448 | |8 449 | `!0n 450 | D!0n 451 | |2 452 | A!0n 453 | |3 454 | 455 | p$ 456 | A!$ 457 | |4 458 | A!) 459 | _!) 460 | | 461 | A!) 462 | |3 463 | A!0`$ 464 | A!) 465 | |7 466 | `!) 467 | _!) 468 | |2 469 | ]!) 470 | ]!)!@ 471 | | 472 | ]!)!$ 473 | 474 | p$ 475 | A!' 476 | |4 477 | A!) 478 | | 479 | _!) 480 | | 481 | A!) 482 | |2 483 | A!0`$ 484 | A!) 485 | |7 486 | `!) 487 | A 488 | |2 489 | Ab@ 490 | G!)!@ 491 | G!) 492 | G!)!$ 493 | 494 | p$ 495 | A!- 496 | |4 497 | A!) 498 | |2 499 | _!) 500 | | 501 | A!) 502 | | 503 | A!0`$ 504 | A!) 505 | |7 506 | `!) 507 | A 508 | | 509 | Ab@ 510 | | 511 | D!) 512 | | 513 | D!)!$ 514 | 515 | p$ 516 | A!9 517 | |4 518 | A!) 519 | |3 520 | _!) 521 | | 522 | A!) 523 | A!0`$ 524 | A!) 525 | |7 526 | `!) 527 | A 528 | Ab@ 529 | | 530 | A 531 | BA) 532 | | 533 | BA)!$ 534 | 535 | p$ 536 | A!Q 537 | |4 538 | A!) 539 | |4 540 | _!) 541 | | 542 | A!0`$ 543 | A!) 544 | |7 545 | `!) 546 | Ab@ 547 | | 548 | A 549 | | 550 | AQ) 551 | | 552 | AQ)!$ 553 | 554 | p$ 555 | A"A 556 | |4 557 | A!) 558 | |5 559 | _!) 560 | _!0`$ 561 | A!) 562 | |7 563 | `!)!@ 564 | Ab@ 565 | A 566 | |2 567 | A9) 568 | | 569 | A9)!$ 570 | 571 | p$ 572 | A$ 573 | |4 574 | A!) 575 | |6 576 | _!0`$ 577 | _!) 578 | A!) 579 | |5 580 | A!)!@ 581 | `!)!@ 582 | A 583 | |3 584 | A-) 585 | | 586 | A-)!$ 587 | 588 | q 589 | |18 590 | o!` 591 | |5 592 | q 593 | |4 594 | 595 | -------------------------------------------------------------------------------- /Daedalus.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | 14 | {3F41CB08-9973-4856-ACC3-66ABE55D0E4D} 15 | Daedalus 16 | Win32Proj 17 | 18 | 19 | 20 | Application 21 | v142 22 | 23 | 24 | Application 25 | v142 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | <_ProjectFileVersion>16.0.29124.152 39 | 40 | 41 | ..\G\ 42 | ..\G\ 43 | true 44 | 45 | 46 | ..\G\ 47 | ..\G\ 48 | true 49 | 50 | 51 | 52 | Disabled 53 | WIN32;_DEBUG;_WINDOWS;SECURE;%(PreprocessorDefinitions) 54 | false 55 | EnableFastChecks 56 | MultiThreadedDebugDLL 57 | 58 | Level3 59 | EditAndContinue 60 | 61 | 62 | shlwapi.lib Winmm.lib %(AdditionalOptions) 63 | true 64 | Windows 65 | MachineX86 66 | 67 | 68 | 69 | 70 | Neither 71 | WIN32;NDEBUG;_WINDOWS;SECURE;%(PreprocessorDefinitions) 72 | MultiThreaded 73 | 74 | Level3 75 | ProgramDatabase 76 | 77 | 78 | shlwapi.lib Winmm.lib %(AdditionalOptions) 79 | true 80 | Windows 81 | true 82 | true 83 | MachineX86 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | -------------------------------------------------------------------------------- /virtual.ds: -------------------------------------------------------------------------------- 1 | DS 2 | // Daedalus Virtual Mazes - A script file for Daedalus 3.5 3 | // By Walter D. Pullen, Astara@msn.com, http://www.astrolog.org/labyrnth.htm 4 | 5 | // Variable usage: 6 | // a-b: Panel coordinates of upper left corner of 2x2 panel working area 7 | // c-d: Pixel coordinates of cursor within 2x2 panel working area 8 | // e: Read swaps 9 | // f: Write swaps 10 | // g: Stack location (current) 11 | // h: Stack location (in max segment) 12 | // i: Does Maze need initializing? 13 | // j: Stack swaps so far 14 | // k: Stack segment (current) 15 | // l: Stack segment (max) 16 | // m-n: Panel dimensions of entire Maze 17 | // o-p: Pixel size of entire Maze 18 | // q-r: Pixel size of working area 19 | // s-t: Pixel size of each panel 20 | // u: Stack segment size in coordinate pairs 21 | // v: Stack segment size in pixels 22 | // w: Does stack need adjusting? 23 | // x-z: Temporary variables 24 | 25 | If Gte Version 3300 {Break} Message 'This script requires Daedalus 3.3 or later to run.' Break 26 | 27 | EmbedMacro 1 "Help Text" 28 | @x Dec Div @o 2 @y Dec Div @p 2 29 | @w Div @s 2 @z Div @t 2 30 | SetString 0 'Daedalus Virtual Maze generator\n\nF1: Display this help text.\nF2: Start new Maze.\nF3: Create next portion.\nF4: Create next portions until key pressed.\n\nF5: Set number of panels. Current size: @m x @n\nF6: Set panel size. Current size: @w x @z cells, @s x @t pixels\nF7: Set stack size. Current size: @u coordinates, @v pixels\n\nMaze size: @x x @y cells, @o x @p pixels\n\nSwaps: @f write, @e read, @j stack\nStack: segment @k, offset @g current / segment @l, offset @h max' 31 | Message $0 32 | 33 | EmbedMacro 2 "Create New" 34 | fPauseTimer False ct 35 | @a 0 @b 0 @c 1 @d 1 36 | @e 0 @f 0 @g 0 @h 0 @i True @j 0 @k 0 @l 0 37 | Size @s @t 0 1 38 | For (y) 0 Dec @n { 39 | For (x) 0 Dec @m ( 40 | sDel 41 | If And Equ @x @a Equ @y @b 'Set @c Dec @d Off Set @c @d Off' 42 | If Gte @x Dec @m 'nX Dec @s nY 0 nX2 nX nY2 Dec @t c 2ndLine c' 43 | If Gte @y Dec @n 'nX 0 nY Dec @t nX2 Dec @s nY2 nY c 2ndLine c' 44 | If And Gte @x Dec @m Gte @y Dec @n 'Set Sub @s 3 Sub @t 2 Off' 45 | Macro14 46 | SaveBitmap $0 47 | ) 48 | } 49 | Size @q @r 0 1 = 50 | Macro3 51 | 52 | EmbedMacro 3 "Next Portion" 53 | fRedrawWhenBitmapEdited False 54 | If Not @i {Macro2 Return} 55 | If And Lt @d Div @t 2 Gt @b 0 {@b Dec @b @d Add @d @t} 56 | If And Lt @c Div @s 2 Gt @a 0 {@a Dec @a @c Add @c @s} 57 | If And Gt @d Div Mul @t 3 2 Lt @b Sub @n 2 {@b Inc @b @d Sub @d @t} 58 | If And Gt @c Div Mul @s 3 2 Lt @a Sub @m 2 {@a Inc @a @c Sub @c @s} 59 | _ @x @a @y @b Macro14 OpenBitmap $0 _ nX 0 nY 0 aG 60 | _ @x Inc @a Macro14 OpenBitmap $0 _ nX @s aG 61 | _ @x @a @y Inc @b Macro14 OpenBitmap $0 _ nX 0 nY @t aG 62 | _ @x Inc @a Macro14 OpenBitmap $0 _ nX @s aG 63 | @z 0 64 | If Lte @b 0 {@z Or @z 1} 65 | If Lte @a 0 {@z Or @z 2} 66 | If Gte @b Sub @n 2 {@z Or @z 4} 67 | If Gte @a Sub @m 2 {@z Or @z 8} 68 | nX @c nY @d 69 | @w 0 70 | SwapMask -2 -3 71 | VirtualRecurs @z @g 72 | @c nX @d nY 73 | @g @y 74 | If Gte @k @l {@h Max @h @g} 75 | If Or Lte @g 0 Gte @g @v { 76 | @w 1 77 | @j Inc @j 78 | - _ nX 0 nY 0 nX2 Dec @v nY2 0 ag 79 | _ @x @k Macro15 SaveBitmap $0 _ 80 | nX @v nX2 Add nX2 @v ag 81 | _ @x Inc @k Macro15 SaveBitmap $0 _ 82 | IfElse Lte @g 0 83 | (@k Dec @k @g Add @g @u) 84 | (@k Inc @k @g Sub @g @u) 85 | If Gte @k 0 ( 86 | _ @x @k Macro15 OpenBitmap $0 _ 87 | nX 0 aG 88 | ) 89 | If Lte @k @l ( 90 | _ @x Inc @k Macro15 OpenBitmap $0 _ 91 | nX @v aG 92 | ) 93 | _ - 94 | If Gt @k @l (@l @k @h @g) 95 | } 96 | nX @c nY @d 97 | SwapMask -2 -3 98 | If Not @w {@e Inc @e} 99 | If And Gt @z 0 Not @w {@f Inc @f} 100 | If Gt @z 0 { 101 | nX 0 nY 0 nX2 Dec @s nY2 Dec @t ag _ @x @a @y @b Macro14 SaveBitmap $0 _ 102 | nX @s nX2 Add nX Dec @s ag _ @x Inc @a Macro14 SaveBitmap $0 _ 103 | nX 0 nY @t nX2 Dec @s nY2 Add nY Dec @t ag _ @x @a @y Inc @b Macro14 SaveBitmap $0 _ 104 | nX @s nX2 Add nX Dec @s ag _ @x Inc @a Macro14 SaveBitmap $0 _ 105 | } 106 | nX @c nY @d 107 | fRedrawWhenBitmapEdited True n 108 | If Lt @k 0 { 109 | @i False fPauseTimer True t 110 | fAutorepeatLastCommand False 111 | } 112 | 113 | EmbedMacro 4 "Next Portions" 114 | If Not @i {Macro2} 115 | While (And @i Not Event 0) {Macro3} 116 | 117 | EmbedMacro 5 "Set Panel Count" 118 | SetString 0 '@m' SetString 1 '@n' 119 | GetString2 'Enter horizontal panel count of entire Maze (2-999):' 'Enter vertical panel count of entire Maze (2-999):' 0 120 | If @z {Return} 121 | @x Num $0 If Or Lt @x 2 Gt @x 999 {Message 'Bad horizontal size!\nNumber must be between 2-999.' Return} 122 | @y Num $1 If Or Lt @y 2 Gt @y 999 {Message 'Bad vertical size!\nNumber must be between 2-999.' Return} 123 | @m @x @n @y 124 | Macro13 125 | 126 | EmbedMacro 6 "Set Panel Size" 127 | @x Div @s 2 @y Div @t 2 128 | SetString 0 '@x' SetString 1 '@y' 129 | GetString2 'Enter horizontal cells per panel (2-20000):' 'Enter vertical cells per panel (2-20000):' 0 130 | If @z {Return} 131 | @x Num $0 If Or Lt @x 2 Gt @x 20000 {Message 'Bad horizontal size!\nNumber must be between 2-20000.' Return} 132 | @y Num $1 If Or Lt @y 2 Gt @y 20000 {Message 'Bad vertical size!\nNumber must be between 2-20000.' Return} 133 | @s Mul @x 2 @t Mul @y 2 134 | Macro13 135 | 136 | EmbedMacro 7 "Set Stack" 137 | SetString 0 '@u' 138 | GetString 'Enter coordinates per stack section (4-100000000):' 0 139 | If @z {Return} 140 | @x Num $0 If Or Lt @x 4 Gt @x 100000000 {Message 'Bad section size!\nNumber must be between 4-100000000.' Return} 141 | @u @x 142 | Macro13 143 | 144 | EmbedMacro 9 "Load Entire" 145 | Size @s @t 0 1 _ 146 | Size @o @p 0 1 147 | For (y) 0 Dec @n { 148 | For (x) 0 Dec @m ( 149 | _ Del 150 | Macro14 151 | OpenBitmap $0 152 | _ nX Mul @x @s nY Mul @y @t aG 153 | ) 154 | } 155 | 156 | EmbedMacro 13 "Initialize" 157 | @o Mul @m @s @p Mul @n @t 158 | @v Mul @u 2 159 | Size Mul @v 2 1 0 1 = \ 160 | @q Mul @s 2 @r Mul @t 2 161 | @a 0 @b 0 162 | @i False 163 | 164 | EmbedMacro 14 "Get Maze Filename" 165 | SetStringNum 0 @x 3 166 | SetStringNum 1 @y 3 167 | SetString 0 "mz$0$1.bmp" 168 | 169 | EmbedMacro 15 "Get Stack Filename" 170 | SetStringNum 0 @x 5 171 | SetString 0 "mzs$0.bmp" 172 | 173 | ResetProgram 174 | WindowTitle "- Virtual Mazes" True 175 | nHorizontalScroll 0 nVerticalScroll 0 176 | fHideMenu False fHideScrollbars False 177 | nRepeatDelayInMsec 10 178 | fDragIsErase False 179 | @s 64 @t 64 180 | @m 2 @n 2 181 | @u 65536 182 | Macro13 Macro1 183 | -------------------------------------------------------------------------------- /survmaz1.ds: -------------------------------------------------------------------------------- 1 | DS 2 | // Survivor Maze game #1 - A script file for Daedalus 3.5 3 | // By Walter D. Pullen, Astara@msn.com, http://www.astrolog.org/labyrnth.htm 4 | 5 | // Variable usage: 6 | // a-c: X and Y position and color of pole #1 7 | // d-f: X and Y position and color of pole #2 8 | // g-i: X and Y position and color of pole #3 9 | // j-l: X and Y position and color of pole #4 10 | // m-o: X and Y position and color of pole #5 11 | // p: Pole being hit 12 | // q: Next pole to visit 13 | // r-s: Temporary variables 14 | // x-y: X and Y coordinates of player during events 15 | // z: Event return value and temporary flag 16 | 17 | If Gte Version 2300 {Break} Message 'This script requires Daedalus 2.3 or later to run.' Break 18 | 19 | DefineMacro 1 "Message 'Welcome to Survivor!\n\nThis game simulates the Maze from the episode 5 immunity challenge in "Survivor II: The Australian Outback". Your goal is to navigate the Maze, find and touch five poles in order, and then reach the exit.\n\nF1: Display this help text.\nF2: Restart current Maze.\nF3: Start in same Maze the Survivors did.\nF4: Start in random Maze.\nF5: Switch background between day and night.\n\nA message will be displayed when you run into each pole.\nThe poles progress through the colors of the rainbow:\nPole #1: Red, #2: Yellow, #3: Green, #4: Blue, #5: Purple.\n\nJeff Probst says: "Survivors ready? Go!"'" "Help Text" 20 | DefineMacro 2 "Macro15 Macro19" "Restart Maze" 21 | DefineMacro 3 "Macro15 Macro16 Macro18 Macro19" "Start Survivor's Maze" 22 | DefineMacro 4 "Macro15 Macro17 Macro18 Macro19" "Start Random Maze" 23 | DefineMacro 5 "fRedrawWhenBitmapEdited False If Equ nInside 0 {i} IfElse fStars {fStars False nFogDistance 0 kSky Cyan kGround Light Yellow kMountain Brown kCloud White kCloud2 -1 Replace Dark Brown Light Brown 0} {fStars True nFogDistance 160 kSky Black kGround Blend Maize DkGray kMountain Dark Brown kCloud DkGray kCloud2 Dark kCloud Replace Light Brown Dark Brown 0} fRedrawWhenBitmapEdited True n" "Day And Night" 24 | 25 | DefineMacro 6 "@z Lte @q 6 If And Lt @y 0 @z {Macro9} If And Gte @y 0 @z {Macro10}" "Edge Event" 26 | DefineMacro 7 "@z False @r GetC @x @y For (p) 1 5 {If Equ @r Var Mul @p 3 'Break'} If Lte @p 5 {SwitchSgn Sub @p @q 'Macro12' 'Macro13' 'Macro14'}" "Wall Event" 27 | DefineMacro 8 "If Lt @q 6 {MessageInside 'Seeking: Pole #@q ($q)' -1 Break} If Equ @q 6 {MessageInside 'Seeking: Exit!' -1 Break}" "Inside Event" 28 | 29 | DefineMacro 9 "@r Sub 6 @q SwitchSgn Dec @r {Message 'This is the entrance.\n\nJeff Probst says: "You can't leave the Maze here! You have to find the exit. You're almost done!"'} {Message 'This is the entrance.\n\nJeff Probst says: "Hey, you can't leave the Maze here! You still have one more pole to find."'} {Message 'This is the entrance.\n\nJeff Probst says: "Hey, you can't leave the Maze here! You still have @r more poles to find."'}" "Leave Entrance" 30 | DefineMacro 10 "@r Sub 6 @q SwitchSgn Dec @r {@z False @q Inc @q fPauseTimer True Macro11} {Message 'This is the exit.\n\nJeff Probst says: "Hey, you can't leave the Maze yet! You still have one more pole to find."'} {Message 'This is the exit.\n\nJeff Probst says: "Hey, you can't leave the Maze yet! You still have @r more poles to find."'}" "Leave Exit" 31 | DefineMacro 11 "If Lte @q 6 {Break} @z Timer @x Div @z 60 @y Mod @z 60 Message 'Congratulations, you've found all poles and exited the Maze! :-) You solved it in @x minutes, @y seconds.\n\nYour tribe wins immunity, and Jeff Probst hands you the coveted immunity idol. You try to conceal a grin as Jeff tells the other tribe he'll see them that evening in Tribal Council. Your tribemates cheer you! With your new respect, you know you're safe from the vote until at least the merge.'" "Win Game" 32 | DefineMacro 12 "SwitchSgn Sub @q 6 {Message 'You've already been to this pole.\nThis is pole #@p ($p). You need to find pole #@q ($q).'} {Message 'You've already been to this pole.\nThis is pole #@p ($p). You need to find the exit.'} {Break}" "Pole Past" 33 | DefineMacro 13 "@q Inc @q IfElse Lte @q 5 {Message 'You find a pole!\nThis is pole #@p ($p). Now find pole #@q ($q).'} {Message 'You find a pole!\nThis is pole #@p ($p), the last pole! Now find the exit!'}" "Pole Present" 34 | DefineMacro 14 "IfElse Lte Sub @p @q 1 {Message 'You need to find another pole first before you can visit this one.\nThis is pole #@p ($p). You need to first find pole #@q ($q).'} {@r Dec @p Message 'You need to find other poles first before you can visit this one.\nThis is pole #@p ($p). You need to first find poles #@q ($q) though #@r ($r).'}" "Pole Future" 35 | 36 | DefineMacro 15 "fRedrawWhenBitmapEdited False fShowColorBitmap False Turtle '_'" "Draw Start" 37 | DefineMacro 16 "Size 53 69 0 1 Turtle 'S4R6BRR6BGL2BL4LBL2LBGRBGNLBR4R2BR2RBFLBL2L4BL2LBFRBR4RBR3RBDBL4L2BLL2BLLBDR5BRR2BR2R2BGLBL2LBLLBL2LBLLBDBR2R6BFL4BLLBLLBDNL2BR8RBFLBLLBL2L5BGR3BR3RBRR2BFL4BLL2BL3NL2BDRBR3R6BDBL3LBLL6BGR6BRR6' Turtle 'U17BGD5BD2D6BDDBGUBU6U2BUU2BUU2BHD2BDD3BDD2BDDBDDBDDBGUBU5UBUU7BUUBGD3BDDBD4D4BD3BLUBUUBU2UBU2UBU5U2BLDBD2D3BD3D2BDDBD2BLU2BUUBUUBUU2BUUBU2U2BHD2BDD2BD5D2BDD2BGU2BU3UBUUBU2UBUU3BGD2BD4D4BDDBGUBUUBU2U2BUU3BU2UBHD17' @a 42 @b 54 @d 2 @e 14 @g 6 @h 54 @j 42 @k 10 @m 26 @n 34" "Draw Survivor" 38 | DefineMacro 17 "MazeSize 13 17 1 @z nEntrancePositioning nEntrancePositioning 1 P nEntrancePositioning @z Bias 1 3 1 3 CollapseToSet @a 46 @b 54 @d 6 @e 14 @g 6 @h 54 @j 46 @k 14 @m 26 @n 34 @r 1 DoCount 5 {SetVar @r Add Var @r Mul Rnd -1 1 4 SetVar Inc @r Add Var Inc @r Mul Rnd -1 1 4 @r Add @r 3} For (r) 0 4 {@s Rnd 0 4 SwapVar Inc Mul @r 3 Inc Mul @s 3 SwapVar Add Mul @r 3 2 Add Mul @s 3 2}" "Draw Random" 39 | DefineMacro 18 "@r 1 DoCount 5 {Set Var @r Var Inc @r True @r Add @r 3} Quo Del CopyTexture -1 0 Quo Replace White Light Brown 0 Replace Black White 0 @r 1 @s 1 DoCount 5 {SetC Var @r Var Inc @r Var Add @r 2 SetX Var @r Var Inc @r -1 @s @r Add @r 3 @s Inc @s}" "Draw Middle" 40 | DefineMacro 19 "nX >> SizeX 1 nY 0 nZ 0 nDir 2 g cg @q 1 fRedrawWhenBitmapEdited True fShowColorBitmap True n Macro1 fPauseTimer False ct" "Draw End" 41 | 42 | Macro15 ResetProgram nOnMoveOffBitmap 6 nOnMoveIntoWall 7 nAfterRedrawInside 8 TempDelete ExtraDelete 43 | WindowTitle "- Survivor Maze Game 1" True nHorizontalScroll 8 nVerticalScroll 8 fHideMenu True fHideScrollbars True 44 | @c Red @f Yellow @i Green @l Blue @o Purple SetStrings 1 10 ",Red,Yellow,Green,Blue,Purple,T_1_,T_2_,T_3_,T_4_,T_5_" 45 | nRepeatDelayInMsec 25 kBorder White kWall White kDot Orange kSky Cyan kGround Light Yellow kMountain Brown kCloud White kMountain2 -1 46 | f3D False fShowDot True fWallsImpassable True fNoCornerHopping False fMoveByTwo False fDoDragOnTemp True nEdgeBehavior 0 nTextureWall 0 47 | nInside 4 fNarrowWalls True fCompass True fCellLocation False fSealedEntrances False fMountains True nPeakHeight 10 nCloudCount 4 fSunAndMoon True fStars False nMotionVelocity 25 nRotationVelocity 5 nUpDownVelocity 8 nCellSize 160 nNarrowCellSize 40 nWallHeight 300 nViewHeight 0 rLightFactor -50 nFogDistance 0 48 | Turtle "T1" For (r) 1 5 {Size 72 96 0 1 Turtle "S12BM11,11" @s Add 5 @r Turtle $s Thicken2 12 Zoom 1 5 0 2 cDel CopyMask -1 @r} 49 | Macro3 50 | -------------------------------------------------------------------------------- /threed.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Daedalus (Version 3.5) File: threed.h 3 | ** By Walter D. Pullen, Astara@msn.com, http://www.astrolog.org/labyrnth.htm 4 | ** 5 | ** IMPORTANT NOTICE: Daedalus and all Maze generation and general 6 | ** graphics routines used in this program are Copyright (C) 1998-2024 by 7 | ** Walter D. Pullen. Permission is granted to freely use, modify, and 8 | ** distribute these routines provided these credits and notices remain 9 | ** unmodified with any altered or distributed versions of the program. 10 | ** The user does have all rights to Mazes and other graphic output 11 | ** they make in Daedalus, like a novel created in a word processor. 12 | ** 13 | ** More formally: This program is free software; you can redistribute it 14 | ** and/or modify it under the terms of the GNU General Public License as 15 | ** published by the Free Software Foundation; either version 2 of the 16 | ** License, or (at your option) any later version. This program is 17 | ** distributed in the hope that it will be useful and inspiring, but 18 | ** WITHOUT ANY WARRANTY; without even the implied warranty of 19 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 20 | ** General Public License for more details, a copy of which is in the 21 | ** LICENSE.HTM included with Daedalus, and at http://www.gnu.org 22 | ** 23 | ** This file contains definitions for general graphics routines, that operate 24 | ** on a monochrome bitmap being treated as a 3D/4D bitmap, unrelated to Mazes. 25 | ** 26 | ** Created: 3/12/1990. 27 | ** Last code change: 10/30/2024. 28 | */ 29 | 30 | /* 31 | ****************************************************************************** 32 | ** Constants 33 | ****************************************************************************** 34 | */ 35 | 36 | #define xCubeMax xBitmap 37 | #define yCubeMax yBitmap 38 | #define zCubeMax xBitmap 39 | 40 | #define DIRS3 6 41 | #define DIRS4 8 42 | 43 | 44 | /* 45 | ****************************************************************************** 46 | ** Macros 47 | ****************************************************************************** 48 | */ 49 | 50 | class CMap3 : virtual public CMap // 3D bitmap 51 | { 52 | public: 53 | INLINE int X2(int x, int z) CONST // Map 3D coordinate to 2D X coordinate 54 | { return (z % m_w3) * m_x3 + x; } 55 | INLINE int Y2(int y, int z) CONST // Map 3D coordinate to 2D Y coordinate 56 | { return (z / m_w3) * m_y3 + y; } 57 | INLINE int X3(int x) CONST // Map 2D X coordinate to 3D X coordinate 58 | { return x % m_x3; } 59 | INLINE int Y3(int y) CONST // Map 2D Y coordinate to 3D Y coordinate 60 | { return y % m_y3; } 61 | INLINE int Z3(int x, int y) CONST // Map 2D coordinate to 3D Z coordinate 62 | { return (y / m_y3) * m_w3 + (x / m_x3); } 63 | INLINE KV _Get3(int x, int y, int z) CONST 64 | { return Get(X2(x, z), Y2(y, z)); } 65 | INLINE void Set3(int x, int y, int z, KV kv) 66 | { if (FLegalCube(x, y, z)) Set(X2(x, z), Y2(y, z), kv); } 67 | INLINE void Set30(int x, int y, int z) 68 | { if (FLegalCube(x, y, z)) Set0(X2(x, z), Y2(y, z)); } 69 | INLINE void Set31(int x, int y, int z) 70 | { if (FLegalCube(x, y, z)) Set1(X2(x, z), Y2(y, z)); } 71 | INLINE void Inv3(int x, int y, int z) 72 | { if (FLegalCube(x, y, z)) Inv(X2(x, z), Y2(y, z)); } 73 | INLINE KV GetF(int x, int y, int z, flag f3D) CONST 74 | { return f3D ? Get3(x, y, z) : Get(x, y); } 75 | 76 | INLINE int X4(int w, int x) CONST // Map 4D coordinate to 2D X coordinate 77 | { return w * m_x3 + x; } 78 | INLINE int Y4(int y, int z) CONST // Map 4D coordinate to 2D Y coordinate 79 | { return z * m_y3 + y; } 80 | INLINE int Get4(int w, int x, int y, int z) CONST 81 | { return Get(X4(w, x), Y4(y, z)); } 82 | INLINE void Set4(int w, int x, int y, int z, KV kv) 83 | { Set(X4(w, x), Y4(y, z), kv); } 84 | INLINE void Set40(int w, int x, int y, int z) 85 | { Set0(X4(w, x), Y4(y, z)); } 86 | INLINE void Set41(int w, int x, int y, int z) 87 | { Set1(X4(w, x), Y4(y, z)); } 88 | INLINE void Inv4(int w, int x, int y, int z) 89 | { Inv(X4(w, x), Y4(y, z)); } 90 | INLINE flag FZero3() CONST 91 | { return m_x3 < 1 || m_y3 < 1 || m_z3 < 1; } 92 | INLINE flag F64K3() CONST 93 | { return m_x3 > 0xFFFF || m_y3 > 0xFFFF || m_z3 > 0xFFFF; } 94 | INLINE flag FLegalCubeLevel(int x, int y) CONST 95 | { return x >= 0 && x < m_x3 && y >= 0 && y < m_y3; } 96 | INLINE flag FLegalCube(int x, int y, int z) CONST 97 | { return FLegalCubeLevel(x, y) && z >= 0 && z < m_z3; } 98 | INLINE flag FLegalLevel(int x, int y, flag f3D) 99 | { return f3D ? FLegalCubeLevel(x, y) : FLegal(x, y); } 100 | INLINE flag FLegalFillCube(int x, int y, int z, KV o) CONST 101 | { return FLegalCube(x, y, z) && Get3(x, y, z) != o; } 102 | 103 | KV Get3(int x, int y, int z) CONST 104 | { return !FLegalCube(x, y, z) ? fOff : _Get3(x, y, z); } 105 | KV Get3Safe(int x, int y, int z) CONST 106 | { return FNull() || !FLegalCube(x, y, z) ? fOff : _Get3(x, y, z); } 107 | 108 | virtual CMap3 *Create3() = 0; 109 | virtual void Destroy3() = 0; 110 | 111 | flag FAllocateCube(int, int, int, int); 112 | flag FCubeSizeSet(int, int, int, int); 113 | flag FTesseractSizeSet(int, int, int, int); 114 | void Legalize3(int *x, int *y, int *z) CONST; 115 | void CubeBlock(int, int, int, int, int, int, KV); 116 | void CubeMove(CONST CMap3 &, int, int, int, int, int, int, int, int, int); 117 | flag FCubeResizeTo(int, int, int); 118 | flag FCubeShiftBy(int, int, int); 119 | flag FCubeCollapse(); 120 | int CubeFlipCore(int, int, int, char) CONST; 121 | flag FCubeFlip(CONST char *); 122 | flag FCubeFlip2(int, int); 123 | flag FCubeFill(int, int, int, KV); 124 | }; 125 | 126 | class CMon3 : virtual public CMap3, virtual public CMon // 3D mono bitmap 127 | { 128 | public: 129 | virtual CMap3 *Create3() OVERRIDE 130 | { CMon3 *b; b = new CMon3; if (b == NULL) return NULL; 131 | return (CMap3 *)b; } 132 | virtual void Destroy3() OVERRIDE 133 | { delete this; }; 134 | 135 | flag FReadCube(FILE *, int); 136 | void WriteCube(FILE *, int, flag) CONST; 137 | }; 138 | 139 | class CCol3 : virtual public CMap3, virtual public CCol // 3D color bitmap 140 | { 141 | public: 142 | virtual CMap3 *Create3() OVERRIDE 143 | { CCol3 *c; c = new CCol3; if (c == NULL) return NULL; 144 | return (CMap3 *)c; } 145 | virtual void Destroy3() OVERRIDE 146 | { delete this; }; 147 | 148 | INLINE KV Get3R(int x, int y, int z, flag fRainbow) CONST 149 | { return fRainbow ? Hue(z * nHueMax / m_z3) : Get3(x, y, z); } 150 | 151 | int ColmapGraphDistance3(CONST CMon3 &, CONST CMon3 &, KV, KV, 152 | int, int, int); 153 | }; 154 | 155 | 156 | /* 157 | ****************************************************************************** 158 | ** 3D Bitmap Routines 159 | ****************************************************************************** 160 | */ 161 | 162 | extern CONST int woff3[DIRS4 + 4], xoff3[DIRS4 + 4], yoff3[DIRS4 + 4], 163 | zoff3[DIRS4 + 4]; 164 | 165 | /* threed.h */ 166 | -------------------------------------------------------------------------------- /wdriver.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Daedalus (Version 3.5) File: wdriver.h 3 | ** By Walter D. Pullen, Astara@msn.com, http://www.astrolog.org/labyrnth.htm 4 | ** 5 | ** IMPORTANT NOTICE: Daedalus and all Maze generation and general 6 | ** graphics routines used in this program are Copyright (C) 1998-2024 by 7 | ** Walter D. Pullen. Permission is granted to freely use, modify, and 8 | ** distribute these routines provided these credits and notices remain 9 | ** unmodified with any altered or distributed versions of the program. 10 | ** The user does have all rights to Mazes and other graphic output 11 | ** they make in Daedalus, like a novel created in a word processor. 12 | ** 13 | ** More formally: This program is free software; you can redistribute it 14 | ** and/or modify it under the terms of the GNU General Public License as 15 | ** published by the Free Software Foundation; either version 2 of the 16 | ** License, or (at your option) any later version. This program is 17 | ** distributed in the hope that it will be useful and inspiring, but 18 | ** WITHOUT ANY WARRANTY; without even the implied warranty of 19 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 20 | ** General Public License for more details, a copy of which is in the 21 | ** LICENSE.HTM included with Daedalus, and at http://www.gnu.org 22 | ** 23 | ** This file contains Windows specific definitions for Daedalus as a whole. 24 | ** 25 | ** Created: 4/8/2013. 26 | ** Last code change: 10/30/2024. 27 | */ 28 | 29 | 30 | /* 31 | ****************************************************************************** 32 | ** Macros 33 | ****************************************************************************** 34 | */ 35 | 36 | #ifdef _WIN64 37 | #define szArchCore "64 bit" 38 | #else 39 | #define szArchCore "32 bit" 40 | #endif 41 | 42 | #define nScrollDiv 16 43 | 44 | #define API PASCAL 45 | #ifndef WM_XBUTTONDOWN 46 | #define WM_XBUTTONDOWN 0x20B 47 | #endif 48 | #ifndef SC_MONITORPOWER 49 | #define SC_MONITORPOWER 0xF170 50 | #endif 51 | #define SetWindowOrg(hdc, x, y) SetWindowOrgEx(hdc, x, y, NULL) 52 | #define SetViewportOrg(hdc, x, y) SetViewportOrgEx(hdc, x, y, NULL) 53 | #define MoveTo(hdc, x, y) MoveToEx(hdc, x, y, NULL) 54 | #define InitDC(hdc) SetMapMode(hdc, MM_TEXT); \ 55 | SetWindowOrg(hdc, 0, 0); SetViewportOrg(hdc, 0, 0) 56 | #define SetWindowPosition(xo, yo, xs, ys) SetWindowPos(wi.hwnd, \ 57 | ws.fWindowTop ? GetTopWindow(NULL) : HWND_NOTOPMOST, xo, yo, xs, ys, 0) 58 | 59 | // Dialog Macros 60 | 61 | #define CheckMenu(cmd, f) \ 62 | CheckMenuItem(wi.hmenu, cmd, f ? MF_CHECKED : MF_UNCHECKED); 63 | #define SetCheck(id, f) CheckDlgButton(hdlg, id, f) 64 | #define SetRadio(id, idLo, idHi) CheckRadioButton(hdlg, idLo, idHi, id) 65 | #define SetEdit(id, sz) SetDlgItemText(hdlg, id, (LPCSTR)(sz)) 66 | #define SetEditN(id, n) SetDlgItemInt(hdlg, id, n, fTrue) 67 | #define SetEditL(id, l) SetDlgItemLong(hdlg, id, l) 68 | #define SetEditR(id, r) SetDlgItemReal(hdlg, id, r) 69 | #define SetCombo(id, sz) \ 70 | SendDlgItemMessage(hdlg, id, CB_ADDSTRING, 0, (LPARAM)(LPCSTR)(sz)) 71 | #define ClearCombo(id) SendDlgItemMessage(hdlg, id, CB_RESETCONTENT, 0, 0); 72 | #define GetCheck(id) IsDlgButtonChecked(hdlg, id) 73 | #define GetEdit(id, sz) GetEditCore(id, sz, cchSzDef) 74 | #define GetEditCore(id, sz, cch) GetDlgItemText(hdlg, id, sz, cch) 75 | #define GetEditN(id) GetDlgItemInt(hdlg, id, NULL, fTrue) 76 | #define GetEditL(id) GetDlgItemLong(hdlg, id) 77 | #define GetEditR(id) GetDlgItemReal(hdlg, id) 78 | #define GetRadio(idLo, idHi) GetDlgItemRadio(hdlg, idLo, idHi) 79 | #define EnsureBetweenN(n, n1, n2, szError) \ 80 | if (!FEnsureBetweenN(n, n1, n2, szError)) return fTrue; 81 | #define EnsureBetweenR(r, n1, n2, szError) \ 82 | if (!FEnsureBetweenR(r, n1, n2, szError)) return fTrue; 83 | #define EnsureLeastN(n, n1, szError) \ 84 | if (!FEnsureLeastN(n, n1, szError)) return fTrue; 85 | 86 | 87 | /* 88 | ****************************************************************************** 89 | ** Structures 90 | ****************************************************************************** 91 | */ 92 | 93 | typedef struct _windowinternal { 94 | // Window settings 95 | 96 | HINSTANCE hinst; 97 | HWND hwndMain; 98 | HWND hwnd; 99 | HWND hwndAbort; 100 | HMENU hmenu; 101 | HACCEL haccel; 102 | 103 | // Internal settings 104 | 105 | RECT rcFull; 106 | HDC hdcInside; 107 | HANDLE hMutex; 108 | ulong timeSound; 109 | 110 | // Bitmap fields 111 | 112 | HDC hdcBmp; 113 | HBITMAP hbmpPrev; 114 | HBITMAP hbmp; 115 | HBITMAP hbmpC; 116 | HBITMAP hbmpI; 117 | BITMAPINFOHEADER bi; 118 | RGBQUAD rgbq[2]; 119 | BITMAPINFOHEADER biC; 120 | BITMAPINFOHEADER biI; 121 | } WI; 122 | 123 | 124 | /* 125 | ****************************************************************************** 126 | ** Externs 127 | ****************************************************************************** 128 | */ 129 | 130 | // Global variables 131 | 132 | extern WI wi; 133 | extern OPENFILENAME ofn; 134 | extern PRINTDLG prd; 135 | 136 | // From wdriver.cpp 137 | 138 | LRESULT PASCAL WndProc(HWND, uint, WPARAM, LPARAM); 139 | void Redraw(HWND); 140 | 141 | // From wutil.cpp 142 | 143 | void CopyBitmapToDeviceBitmap(void); 144 | void DirtyView(void); 145 | void BitmapDot(int, int); 146 | flag FBootExternal(CONST char *, flag); 147 | void RedoMenu(HWND); 148 | void GetWindowPosition(int *, int *, int *, int *); 149 | void AdjustWindowPosition(int *, int *, int *, int *); 150 | void DrawTextLine(HDC, CONST char *, int, int); 151 | flag FCreateDesktopIcon(void); 152 | flag FCreateProgramGroup(flag); 153 | flag FRegisterExtensions(void); 154 | flag FUnregisterExtensions(void); 155 | 156 | // From wdialog.cpp 157 | 158 | void DoDialog(flag API (HWND, uint, WORD, LONG), WORD); 159 | flag FSzCopy(CONST char *); 160 | flag FFileCopy(int); 161 | flag FFilePaste(); 162 | flag DlgPrint(void); 163 | flag API DlgAbortProc(HDC, int); 164 | flag API DlgAbort(HWND, uint, WORD, LONG); 165 | flag API DlgFile(HWND, uint, WORD, LONG); 166 | flag API DlgAbout(HWND, uint, WORD, LONG); 167 | flag API DlgCommand(HWND, uint, WORD, LONG); 168 | flag API DlgEvent(HWND, uint, WORD, LONG); 169 | flag API DlgDisplay(HWND, uint, WORD, LONG); 170 | flag API DlgColor(HWND, uint, WORD, LONG); 171 | flag API DlgRandom(HWND, uint, WORD, LONG); 172 | flag API DlgDot(HWND, uint, WORD, LONG); 173 | flag API DlgInside(HWND, uint, WORD, LONG); 174 | flag API DlgSize(HWND, uint, WORD, LONG); 175 | flag API DlgZoom(HWND, uint, WORD, LONG); 176 | flag API DlgCubeFlip(HWND, uint, WORD, LONG); 177 | flag API DlgBright(HWND, uint, WORD, LONG); 178 | flag API DlgColorReplace(HWND, uint, WORD, LONG); 179 | flag API DlgSizeMaze(HWND, uint, WORD, LONG); 180 | flag API DlgBias(HWND, uint, WORD, LONG); 181 | flag API DlgMaze(HWND, uint, WORD, LONG); 182 | flag API DlgCreate(HWND, uint, WORD, LONG); 183 | flag API DlgLabyrinth(HWND, uint, WORD, LONG); 184 | flag API DlgDraw(HWND, uint, WORD, LONG); 185 | flag API DlgDraw2(HWND, uint, WORD, LONG); 186 | flag API DlgString(HWND, uint, WORD, LONG); 187 | flag API DlgString2(HWND, uint, WORD, LONG); 188 | flag API DlgString3(HWND, uint, WORD, LONG); 189 | 190 | /* wdriver.h */ 191 | -------------------------------------------------------------------------------- /pentris.ds: -------------------------------------------------------------------------------- 1 | DS 2 | // Pentris game - A script file for Daedalus 3.5 3 | // By Walter D. Pullen, Astara@msn.com, http://www.astrolog.org/labyrnth.htm 4 | 5 | // Variable usage: 6 | // a-b: Min and max piece sizes 7 | // c-d: Min and max piece offsets 8 | // e: Game state (0=playing, 1=game over) 9 | // f: Next piece 10 | // g: Next piece rotation 11 | // h: Horizontal color bitmap offset 12 | // i-j: Generic index 13 | // k: Pieces placed 14 | // l: Rows cleared 15 | // m-n: Coordinates of piece 16 | // o: Size of square in pixels 17 | // p: Current piece 18 | // q: Delay acceleration rate 19 | // r: Rotation of piece 20 | // s: Start delay 21 | // t: Total number of polyoninoes 22 | // u-v: Size of play area in squares 23 | // w-z: Temporary variables 24 | // 27-33: Offset of monomino through hexominos + end 25 | // 34-42: Colors of monomino through tetrominoes (constant) 26 | // 43+: Colors of pentonomies and hexominoes (computed) 27 | 28 | If Gte Version 3000 {Break} Message 'This script requires Daedalus 3.0 or later to run.' Break 29 | 30 | DefineMacro 1 {Message 'Welcome to Pentris!\n\nF1: Display this help text.\nF2: Start new game.\nF3: Specify polyomono sizes.\nF4: Specify board dimensions.\nF5: Specify animation speed.\nF6: Pause game.\n\nLeft arrow or 'a': Move piece left.\nRight arrow or 'd': Move piece right.\nShift+left arrow or 'q': Rotate piece left.\nShift+right arrow or up arrow or 'e': Rotate piece right.\nDown arrow or 's': Move piece down.\nShift+down arrow or Space or 'x': Drop piece down.\n\nLatest game: Pieces played = @k, Rows cleared = @l'} "Help Text" 31 | DefineMacro 2 "fRedrawWhenBitmapEdited False @e False @k 0 @l 0 Macro13 fRedrawWhenBitmapEdited True n Macro1 fPauseTimer False ct nRepeatDelayInMsec @s fAutoRepeatLastCommand False Macro24 If @s 'N'" "New Game" 32 | DefineMacro 3 "SetString 0 @a SetString 1 @b GetString2 'Enter minimum polyomono size (1-6):' 'Enter maximum polyomono size (1-6):' 0 If @z {Return} @x Num $0 If Or Lt @x 1 Gt @x 6 {Message 'Bad minimum size: @x' Return} @y Num $1 If Or Or Lt @y 1 Gt @y 6 Gt @x @y {Message 'Bad maximum size: @y'} @a @x @b @y @c Var Add 27 Dec @a @d Var Add 27 @b" "Set Pieces" 33 | DefineMacro 4 "SetString 0 @u SetString 1 @v GetString2 'Enter horizontal board size (6-20):' 'Enter vertical board size (22-50):' 0 If @z {Return} @x Num $0 If Or Lt @x 6 Gt @x 20 {Message 'Bad horizontal size: @x' Return} @y Num $1 If Or Lt @y 22 Gt @y 50 {Message 'Bad vertical size: @y'} @u @x @v @y @h Mul 8 @o Macro2" "Set Board" 34 | DefineMacro 5 "SetString 0 @s SetString 1 @q GetString2 'Enter start delay for new games (0-9999):' 'Enter delay acceleration rate for next pieces (0-1000):' 0 If @z {Return} @x Num $0 If Or Lt @x 0 Gt @x 9999 {Message 'Bad start speed: @x' Return} @y Num $1 If Or Lt @y 0 Gt @y 1000 {Message 'Bad speed acceleration: @y'} @s @x @q @y" "Set Speed" 35 | DefineMacro 6 "fPauseTimer True Message 'Game paused.\n\nCurrent game so far: Pieces played = @k, Rows cleared = @l' p @z True" "Pause Game" 36 | 37 | DefineMacro 13 "Size 5 67 0 1 Turtle '_T1' $0 'T___' $1 'PENTRIS' For (i) 0 6 {nXTurtle 0 nYTurtle Mul @i 10 SetChar 0 2 Char $1 @i Turtle $0} Quo = SizeC Mul Add @u 16 @o Mul Add @v 2 @o 0 1 ForStep (j) 1 0 -1 {nX Add @j Sub Div @h 2 3 nY Add @j 2 2ndOr If @j (Replace White Gray 0)} nX Dec @h nY Dec @o nX2 Add nX Inc Mul @u @o nY2 Add nY Inc Mul @v @o 2ndBox \ Size @u @v 0 1 \ Macro17 Macro15 k" "Draw Board" 38 | DefineMacro 14 "fRedrawWhenBitmapEdited False @j fShowColorBitmap fShowColorBitmap False | @x Pixels = nX @m nY @n CopyMask Add Mul @t Inc @r @p -2 _ @y Pixels _ 2ndOr @z Pixels @z Neq Add @x @y @z If Not @z {k | CopyTexture Add Mul @t Inc @r @p -2 nX Add @h Mul @m @o nY Mul Inc @n @o 2ndOr} fShowColorBitmap @j fRedrawWhenBitmapEdited True" "Draw Piece" 39 | DefineMacro 15 "@p @f @r @g Macro17 @m Sub Div @u 2 3 @n 0 Macro14 IfElse @z {| k | @e True Message 'Game over!\n\nPieces played = @k, Rows cleared = @l' fAutoRepeatLastCommand False k} {@k Inc @k}" "New Piece" 40 | DefineMacro 16 "fRedrawWhenBitmapEdited False k For (j) @n Add @n 5 {For (i) 0 Dec SizeX (If Not Get @i @j 'Break') If Gte @i SizeX (nY @j DelRow Size 0 1 1 0 @l Inc @l k nX @h nY Mul @o 2 nX2 Add nX Dec Mul @u @o nY2 Add nY Dec Mul Dec @j @o 2ndGet nY Add nY @o aG nY Sub nY @o nY2 Add nY Dec @o c 2ndBlock c k)} \ k \ k Macro15 k nRepeatDelayInMsec Max Sub nRepeatDelayInMsec @q 1 fRedrawWhenBitmapEdited True" "Place Piece" 41 | DefineMacro 17 "@f Rnd @c Dec @d @g Rnd 0 7 k nX Add @h Mul Inc @u @o nY @o CopyTexture Add Mul @t Inc @g @f -2 aG \ k" "Random Piece" 42 | 43 | DefineMacro 20 "If @e '@z True Return' @w @m @m Dec @m Macro14 If @z {@m @w Macro14} n @z True" "Move Left" 44 | DefineMacro 21 "If @e '@z True Return' @w @m @m Inc @m Macro14 If @z {@m @w Macro14} n @z True" "Move Right" 45 | DefineMacro 22 "If @e '@z True Return' @w @r @r Or And @r 4 And Dec @r 3 Macro14 If @z {@r @w Macro14} n @z True" "Rotate Left" 46 | DefineMacro 23 "If @e '@z True Return' @w @r @r Or And @r 4 And Inc @r 3 Macro14 If @z {@r @w Macro14} n @z True" "Rotate Right" 47 | DefineMacro 24 "If @e '@z True Return' @w @n @n Inc @n Macro14 If @z {@n @w Macro14 Macro16} n @z True" "Move Down" 48 | DefineMacro 25 "If @e '@z True Return' DoWhile (Not @z) {@w @n @n Inc @n Macro14} @n @w Macro14 Macro16 n @z True" "Drop Down" 49 | 50 | fRedrawWhenBitmapEdited False ResetProgram WindowTitle "- Pentris" True nHorizontalScroll 8 nVerticalScroll 8 fHideMenu True fHideScrollbars True 51 | OnCommand (MoveL) 20 OnCommand (MoveR) 21 OnCommand (JumpL) 22 OnCommand (JumpR) 23 OnCommand (MoveD) 24 OnCommand (JumpD) 25 OnCommand (Spc) 25 OnCommand (a) 20 OnCommand (d) 21 OnCommand (q) 22 OnCommand (e) 23 OnCommand (s) 24 OnCommand (x) 25 OnCommand (w) 23 OnCommand (MoveU) 23 OnCommand (p) 6 52 | nRepeatDelayInMsec 1000 fSkipMessageDisplay True kBorder Gray fShowDot False nInside 0 f3D False 53 | 54 | EmbedDB 55 | DB 56 | 74 47 1 57 | 58 | A 59 | 60 | Q 61 | 62 | Y 63 | 64 | Q 65 | A 66 | 67 | ] 68 | 69 | \M 70 | B' 71 | 72 | Q 73 | | 74 | 75 | _ 76 | 77 | ^\A 78 | AAQ 79 | 80 | \MT% 81 | B':/ 82 | B%*E 83 | 84 | \A 85 | SA 86 | 87 | ` 88 | 89 | ___]Y 90 | A1)'/ 91 | 92 | ^\H/9RD%)1AB 93 | AARC/=ZHP?^\Q 94 | AAAD)))U%%%AA 95 | 96 | ^\XO= 97 | R34,/ 98 | 99 | \O\-Q 100 | T+4O9 101 | B)R#Q 102 | 103 | Y 104 | | 105 | 106 | SetVars 27 7 "0 1 2 4 9 21 56" 107 | @a 1 @b 5 @c Var Add 27 Dec @a @d Var Add 27 @b @t Var Add 27 6 @u 10 @v 22 @o 3 @h Mul 8 @o @s 1000 @q 1 108 | SetVars 34 9 "White #cfcfcf #9f9f9f #6f6f6f Cyan Orange Purple Red Yellow" 109 | For (i) 5 6 {@x Var Add 27 Dec @i @y Var Add 27 @i @z Sub @y @x For (j) @x Dec @y (SetVar Add 34 @j Hue Add Div Mul Sub @j @x 360 @z Div 180 @z)} 110 | For (i) 0 Dec @t {CollapseToSet Size 1 0 1 0 = cDel c8 cDel ` _ TempXor CollapseToSet CopyMask -1 @i _} 111 | For (r) 0 7 {For (i) 0 Dec @t (@z Add Mul @t Inc @r @i CopyMask @i -1 If Gte @r 4 'FlipHorizontal' @j And @r 3 If Equ @j 1 'RotateRight' If Equ @j 2 'RotateAcross' If Equ @j 3 'RotateLeft' @w Sub 6 Or Odd SizeX And Odd SizeY Lt SizeX 6 Size Add Div Sub @w SizeX 2 And And Odd SizeY Not Odd SizeX Equ @r 3 Add Div Sub @w SizeY 2 And And Odd SizeX Not Odd SizeY Equ @r 0 1 0 Size Div Sub 6 SizeX 2 Div Sub 6 SizeY 2 1 0 Size 6 6 0 0 CopyMask -1 @z)} 112 | Size @o @o 0 1 sDel Set 1 1 Off Zoom 6 6 0 2 = k = 113 | For (r) 0 7 {For (i) 0 Dec @t (@z Add Mul @t Inc @r @i CopyMask @z -1 Quo @w Var Add 34 @i If And Equ @i 5 Gte @r 4 '@w Blue' If And Equ @i 7 Gte @r 4 '@w Green' Replace White @w 0 Zoom @o @o 0 0 \ k + ColorAnd _ | k cDel k ColorAnd k cDel k Brightness 90 2 TempOr CopyTexture -1 @z)} 114 | Macro2 115 | -------------------------------------------------------------------------------- /Daedalus.vcproj: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 14 | 15 | 16 | 17 | 18 | 24 | 27 | 30 | 33 | 36 | 39 | 51 | 54 | 57 | 60 | 69 | 72 | 75 | 78 | 81 | 84 | 87 | 90 | 93 | 94 | 100 | 103 | 106 | 109 | 112 | 115 | 125 | 128 | 131 | 134 | 144 | 147 | 150 | 153 | 156 | 159 | 162 | 165 | 168 | 169 | 170 | 171 | 172 | 173 | 178 | 181 | 182 | 185 | 186 | 189 | 190 | 193 | 194 | 197 | 198 | 201 | 202 | 205 | 206 | 209 | 210 | 211 | 216 | 219 | 220 | 223 | 224 | 227 | 228 | 231 | 232 | 235 | 236 | 239 | 240 | 241 | 246 | 249 | 250 | 253 | 254 | 257 | 258 | 261 | 262 | 265 | 266 | 269 | 270 | 273 | 274 | 277 | 278 | 281 | 282 | 285 | 286 | 289 | 290 | 293 | 294 | 297 | 298 | 301 | 302 | 305 | 306 | 309 | 310 | 313 | 314 | 317 | 318 | 321 | 322 | 325 | 326 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | -------------------------------------------------------------------------------- /draw.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Daedalus (Version 3.5) File: draw.h 3 | ** By Walter D. Pullen, Astara@msn.com, http://www.astrolog.org/labyrnth.htm 4 | ** 5 | ** IMPORTANT NOTICE: Daedalus and all Maze generation and general 6 | ** graphics routines used in this program are Copyright (C) 1998-2024 by 7 | ** Walter D. Pullen. Permission is granted to freely use, modify, and 8 | ** distribute these routines provided these credits and notices remain 9 | ** unmodified with any altered or distributed versions of the program. 10 | ** The user does have all rights to Mazes and other graphic output 11 | ** they make in Daedalus, like a novel created in a word processor. 12 | ** 13 | ** More formally: This program is free software; you can redistribute it 14 | ** and/or modify it under the terms of the GNU General Public License as 15 | ** published by the Free Software Foundation; either version 2 of the 16 | ** License, or (at your option) any later version. This program is 17 | ** distributed in the hope that it will be useful and inspiring, but 18 | ** WITHOUT ANY WARRANTY; without even the implied warranty of 19 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 20 | ** General Public License for more details, a copy of which is in the 21 | ** LICENSE.HTM included with Daedalus, and at http://www.gnu.org 22 | ** 23 | ** This file contains definitions for advanced non-perspective and perspective 24 | ** graphics routines, unrelated to Mazes. 25 | ** 26 | ** Created: 6/15/1990. 27 | ** Last code change: 10/30/2024. 28 | */ 29 | 30 | /* 31 | ****************************************************************************** 32 | ** Macros 33 | ****************************************************************************** 34 | */ 35 | 36 | #define istarMax 8000 37 | 38 | #define GetT3(c, x, y, z, d) \ 39 | ((int)(((c).Get3(x, y, z) >> ((d) * 6)) & (cTexture-1))) 40 | #define SetT3(c, x, y, z, d, t) ((c).Get3(x, y, z) & \ 41 | ~((KV)(cTexture-1) << ((d) * 6)) | ((KV)(t) << ((d) * 6))) 42 | #define SetU3(c, x, y, z, f, t) ((c).Get3(x, y, z) & \ 43 | ~((KV)4095 << ((f) * 12)) | ((KV)(t) << ((f) * 12))) 44 | 45 | 46 | /* 47 | ****************************************************************************** 48 | ** Types 49 | ****************************************************************************** 50 | */ 51 | 52 | typedef struct _starlocation { 53 | short x; // Horizontal location of star 54 | short y; // Vertical location of star 55 | KV kv; // Color of star 56 | } STAR; 57 | 58 | typedef struct _drawsettings { 59 | // Draw settings 60 | 61 | int horsiz; 62 | int versiz; 63 | int depsiz; 64 | int horbias; 65 | int verbias; 66 | int hormin; 67 | int vermin; 68 | int depmin; 69 | flag fArrow; 70 | int horv; 71 | int verv; 72 | int theta; 73 | int phi; 74 | int speedm; 75 | int speedr; 76 | flag fRight; 77 | flag fMerge; 78 | 79 | // Obscure draw settings 80 | 81 | flag fReflect; 82 | flag fSkyShade; 83 | flag fGroundShade; 84 | flag fEdges; 85 | flag fShading; 86 | flag fTouch; 87 | int nBorder; 88 | int nHoriz; 89 | real rScale; 90 | real rxScale; 91 | real ryScale; 92 | real rzScale; 93 | KV kvTrim; 94 | KV kvSkyHi; 95 | KV kvSkyLo; 96 | KV kvGroundHi; 97 | KV kvGroundLo; 98 | KV kvObject; 99 | CVector vLight; 100 | 101 | // Inside settings 102 | 103 | flag fStar; // Used by Inside view too 104 | int cStar; // Used by Inside view too 105 | int nStereo; // Used by Inside view too 106 | 107 | // Macro accessible only settings 108 | 109 | long lStarColor; // Used by Inside view too 110 | int nStarSize; // Used by Inside view too 111 | flag fSkyAll; // Used by Inside view too 112 | flag fArrowFree; 113 | int nTrans; 114 | int nFog; 115 | int nWireWidth; 116 | int nWireDistance; 117 | flag fWireSort; 118 | int nFaceOrigin; 119 | flag fStereo3D; // Used by Inside view too 120 | 121 | // Internal settings 122 | 123 | flag fDidPatch; 124 | int xmax; 125 | real rHoriz; 126 | long cCoorPatch; 127 | STAR *rgstar; 128 | } DS; 129 | 130 | typedef struct _coordinates { 131 | real x1, y1, z1; 132 | real x2, y2, z2; 133 | KV kv; 134 | } COOR; 135 | 136 | typedef struct _patn { 137 | int x, y, z; 138 | flag fLine; 139 | } PATN; 140 | 141 | typedef struct _patr { 142 | real x, y, z; 143 | flag fLine; 144 | } PATR; 145 | 146 | #define cPatch 4 147 | 148 | typedef struct _patch { 149 | PATR p[cPatch]; 150 | real rDistance; 151 | KV kv; 152 | short cpt; 153 | short nTrans; 154 | } PATCH; 155 | 156 | extern DS ds; 157 | 158 | 159 | /* 160 | ****************************************************************************** 161 | ** Render Overview and Pyramid 162 | ****************************************************************************** 163 | */ 164 | 165 | extern flag DrawOverview(CMap &, CONST CMon &); 166 | extern flag DrawOverviewCube(CMap &, CONST CMon3 &); 167 | extern flag DrawOverview2(CMon &); 168 | extern flag DrawOverviewCube2(CMon3 &); 169 | extern flag DrawOverviewAltitude(CMap &, CONST CCol &, int, int); 170 | extern flag DrawPyramid(CMon &, CCol *); 171 | 172 | 173 | /* 174 | ****************************************************************************** 175 | ** File Reading and Writing Routines 176 | ****************************************************************************** 177 | */ 178 | 179 | #define ReadCoordinates(file, x1, y1, z1, x2, y2, z2) \ 180 | fscanf(file, "%lf%lf%lf%lf%lf%lf", x1, y1, z1, x2, y2, z2) 181 | extern long ReadWirelist(COOR **, FILE *); 182 | #define ReadPatch1(file, stat) fscanf(file, "%d", stat) 183 | #define ReadPatch2(file, x1, y1, z1, x2, y2, z2, x3, y3, z3) \ 184 | fscanf(file, "%lf%lf%lf%lf%lf%lf%lf%lf%lf", \ 185 | x1, y1, z1, x2, y2, z2, x3, y3, z3) 186 | #define ReadPatch3(file, x1, y1, z1) fscanf(file, "%lf%lf%lf", x1, y1, z1) 187 | extern long ReadPatchlist(PATCH **, FILE *); 188 | 189 | extern void WriteWireframe(FILE *, CONST COOR *, long); 190 | extern void WritePatches(FILE *, CONST PATCH *, long); 191 | extern void WriteWireframeMetafile(FILE *, CONST COOR *, long); 192 | extern void WriteWireframeVector(FILE *, CONST COOR *, long); 193 | 194 | 195 | /* 196 | ****************************************************************************** 197 | ** Create Wireframe and Patches 198 | ****************************************************************************** 199 | */ 200 | 201 | extern void WriteCoordinates(COOR *, int, int, int, int, int, int, KV); 202 | extern void WritePatch(PATCH *, PATN[cPatch], flag, KV); 203 | extern long CreateWireframe(CONST CMon3 &, COOR **, flag, CONST CCol *); 204 | extern long CreatePatches(CONST CMon3 &, PATCH **, flag, CONST CCol *); 205 | extern flag FSetWireSize(COOR **, int, int); 206 | extern flag FSetPatchSize(PATCH **, int, int); 207 | extern flag CreateSolids(CONST char *); 208 | 209 | 210 | /* 211 | ****************************************************************************** 212 | ** Render Perspective 213 | ****************************************************************************** 214 | */ 215 | 216 | extern KV KvStarRandom(void); 217 | extern void CalculateCoordinate(int *, int *, real, real, real); 218 | extern flag FRenderPerspectiveWireCore(CMap &, COOR *, long); 219 | extern flag FRenderPerspectiveWire(CMap &, COOR *, long); 220 | extern flag FRenderPerspectivePatchCore(CMap &, PATCH *, long); 221 | extern flag FRenderPerspectivePatch(CMap &, PATCH *, long); 222 | extern flag FRenderAerial(CMap &, CONST COOR *, long); 223 | extern long ConvertPatchToWire(COOR **, CONST PATCH *, long); 224 | 225 | /* draw.h */ 226 | -------------------------------------------------------------------------------- /pacman.ds: -------------------------------------------------------------------------------- 1 | DS 2 | // Pac-Man game - A script file for Daedalus 3.5 3 | // By Walter D. Pullen, Astara@msn.com, http://www.astrolog.org/labyrnth.htm 4 | 5 | // Variable usage: 6 | // a-d: 1st through 4th choices of direction to move for current monster 7 | // e-f: X and Y position differences between current monster and player 8 | // g-h: X and Y absolute distances between current monster and player 9 | // i-l: Coordinates and direction of the four monsters 10 | // m: X coordinate of current monster 11 | // n: Y coordinate of current monster 12 | // o: Direction current monster is moving 13 | // p: Current monster index 14 | // q: Score to add when player eats monster 15 | // r: Previous score when score changes 16 | // s: Score 17 | // t: Dots left 18 | // u: Energizer time left 19 | // v: Lives left 20 | // w: Board number 21 | // x-y: X and Y coordinates of player during events 22 | // z: Event return value and temporary flag 23 | 24 | If Gte Version 2000 {Break} Message 'This script requires Daedalus 2.0 or later to run.' Break 25 | 26 | DefineMacro 1 {Message 'Welcome to 3D Pac-Man!\n\nThis simulates the old arcade video game Pac-Man, but with a first person view. :-) Your goal is to eat all the dots in the Maze, avoiding the red monsters which chase you. If caught, you lose a life. If you eat a green energizer dot, the monsters turn blue for a short while and you can eat them instead.\n\nF1: Display this help text.\nF2: Restart game.\nF3: Pause and give monsters an extra move.\nF4: Switch background between night and day.\n\nEating a dot: 10 points.\nEating a green energizer dot: 50 points.\nEating the purple fruit: 100 points per level.\nEating a monster: 200, 400, 800, or 1600 points.\n\nPress "i" to toggle to overhead view (much easier :-)'} "Help Text" 27 | DefineMacro 2 "fRedrawWhenBitmapEdited False Macro28 Macro16 Macro29 Macro31 Macro26 Macro18 fRedrawWhenBitmapEdited True n Macro1" "Restart Game" 28 | DefineMacro 3 "fRedrawWhenBitmapEdited False Macro15 fRedrawWhenBitmapEdited True n Macro12" "Empty Move" 29 | DefineMacro 4 "fRedrawWhenBitmapEdited False If Equ nInside 0 {i} IfElse fStars {fStars False nFogDistance 0 kSky Cyan kGround Gray kCloud White kCloud2 Light Light LtGray} {fStars True nFogDistance 600 kSky Black kGround DkGray kCloud DkGray kCloud2 Dark kCloud} fRedrawWhenBitmapEdited True Spc" "Day And Night" 30 | DefineMacro 5 "@z False fRedrawWhenBitmapEdited False" "Before Move" 31 | DefineMacro 6 "fRedrawWhenBitmapEdited True Macro12 fRedrawWhenBitmapEdited False If GetT @x @y {SetT @x @y Off SetCT @x @y Black SetC @x @y Black Macro9} Macro15 fRedrawWhenBitmapEdited True n Macro12" "After Move" 32 | DefineMacro 7 "@z False IfElse Lt @x 0 {nX 55} {nX 1}" "Edge Event" 33 | DefineMacro 8 "MessageInside 'Score: @s, Lives: @v, Dots left: @t, Board #@w' -1" "Inside Event" 34 | 35 | DefineMacro 9 "@r @s If Equ GetCE @x @y Green {@t Dec @t @s Add @s 50 @u Max Sub 25 @w 0 @q 200 Macro19 Spc Message 'You eat a power pellet. :-)\nNow you can get the monsters, if you're quick!' Macro16 Macro18} If Equ GetCE @x @y Magenta {@s Add @s Mul 100 @w Spc Message 'You eat the fruit!'} If Equ GetCE @x @y Light Orange {@t Dec @t @s Add @s 10} Macro11 If Lte @t 0 {Spc Message 'You clear the board! :-)' @w Inc @w Macro28 Macro16 Macro29 Macro31 Macro18 n}" "Eat Dot" 36 | DefineMacro 10 "@r @s @s Add @s @q n Message 'You eat a monster for @q points!' Macro17 Macro30 n Macro11 If Lt @q 1600 {@q Mul @q 2}" "Player Eat Monster" 37 | DefineMacro 11 "If And Lt @r 10000 Gte @s 10000 {@v Inc @v n Message 'You've reached 10,000 points, so get an extra life! :-)'}" "Extra Life" 38 | DefineMacro 12 "@z False For (p) 0 3 (Macro24 If And Equ nX @m Equ nY @n {IfElse @u 'Macro10' '@z True'}) If @z 'Macro13'" "Kill Check" 39 | DefineMacro 13 "@v Dec @v n Message 'You've been eaten by a monster! :-(\nLives left: @v' If Lte @v 0 {Message 'You have no lives left! Game over! :-('} Macro28 Macro16 Macro29 Macro18 n" "Monster Eat Player" 40 | DefineMacro 14 "If @u {@u Dec @u If Lte @u 0 'Macro19'}" "Energizer Timer" 41 | 42 | DefineMacro 15 "Macro16 For (p) 0 3 'Macro24 @e Sub nX @m @f Sub nY @n @g Abs @e @h Abs @f IfElse Gte @g @h {@a ?: Lt @e 0 1 3 @b ?: Lt @f 0 0 2} {@a ?: Lt @f 0 0 2 @b ?: Lt @e 0 1 3} @z And @p 1 @c Xor ?: @z @a @b 2 @d Xor ?: @z @b @a 2 If @u {@a Xor @a 2 @b Xor @b 2 @c Xor @c 2 @d Xor @d 2} @z Not And @u 1 If @z {Macro Add 20 @a} If @z {Macro Add 20 @b} If @z {Macro Add 20 @c} If @z {Macro Add 20 @d} If Lt @m 1 {@m 55} If Gt @m 55 {@m 1} Macro25' Macro14 Macro18" "Monsters Move" 43 | DefineMacro 16 "For (p) 0 3 {Macro17}" "Monsters Erase" 44 | DefineMacro 17 "Macro24 SetE @m @n False SetC @m @n GetCT @m @n" "Monster Erase" 45 | DefineMacro 18 "For (p) 0 3 {Macro24 SetE @m @n True SetC @m @n ?: @u ?: And Lt @u 6 And @u 1 Purple DkBlue Red}" "Monsters Draw" 46 | DefineMacro 19 "For (p) 0 3 {Macro24 @o 4 Macro25}" "Allow Reverse" 47 | DefineMacro 20 "If And Neq @o 2 Not Get @m Sub @n 2 {@n Sub @n 2 @o 0 @z False}" "Monster Move Up" 48 | DefineMacro 21 "If And Neq @o 3 Not Get Sub @m 2 @n {@m Sub @m 2 @o 1 @z False}" "Monster Move Left" 49 | DefineMacro 22 "If And Neq @o 0 Not Get @m Add @n 2 {@n Add @n 2 @o 2 @z False}" "Monster Move Down" 50 | DefineMacro 23 "If And Neq @o 1 Not Get Add @m 2 @n {@m Add @m 2 @o 3 @z False}" "Monster Move Right" 51 | DefineMacro 24 "@a Var Add 9 @p @m And @a 255 @n And >> @a 8 255 @o >> @a 16" "Get Monster Variable" 52 | DefineMacro 25 "SetVar Add 9 @p Or Or @m << @n 8 << @o 16" "Set Monster Variable" 53 | 54 | DefineMacro 26 "@s 0 @v 3 @w 1" "Init Game Variables" 55 | DefineMacro 27 "@u 0 @t 244" "Init Board Variables" 56 | DefineMacro 28 "nX 29 nY 47 nDir 3 g" "Init Player Variables" 57 | DefineMacro 29 "For (p) 0 3 {Macro30}" "Init Monster Variables" 58 | DefineMacro 30 "If Equ @p 0 {@m 27 @n 23 @o 1} If Equ @p 1 {@m 29 @n 23 @o 3} If Equ @p 2 {@m 25 @n 21 @o 0} If Equ @p 3 {@m 31 @n 21 @o 0} Macro25" "Init Monster Variable" 59 | DefineMacro 31 "Macro27 | = fShowColorBitmap False _ ColorPut TempXor Turtle 'C0BM0,28D2BR56U2' _ fShowColorBitmap True" "Reset Board" 60 | 61 | fRedrawWhenBitmapEdited False ResetProgram WindowTitle "- Pac-Man" True nHorizontalScroll 8 nVerticalScroll 8 fHideMenu True fHideScrollbars True 62 | kBorder Black kPassage Black kWall White kDot Yellow kSky Black kGround DkGray kCloud DkGray kCloud2 Dark kCloud 63 | fShowColorBitmap False fWallsImpassable False fDoDragOnTemp False nInside 0 EmbedDB 64 | DB 65 | 32 63 1 66 | 67 | 68 | |3 69 | c0Q 70 | b$`Q 71 | b0Q 72 | b] 73 | a$Q 74 | a0 75 | a= 76 | aY 77 | !"Q 78 | !$A 79 | !( 80 | !' 81 | !- 82 | | 83 | !9 84 | | 85 | !Q!Y 86 | !Q"% 87 | "A## 88 | "A#3 89 | "A## 90 | "A"% 91 | $aY 92 | $ 93 | |8 94 | $!$nQ 95 | $!#331 96 | | 97 | $!$nQ 98 | $!#331 99 | | 100 | $!$nQ 101 | $ 102 | |4 103 | $!1a1 104 | $!YaQ 105 | $"M!"A 106 | $$'!$ 107 | $'$!' 108 | $-"A- 109 | $9!Q9 110 | $Q!9Q 111 | $A!.A 112 | $a( 113 | #a# 114 | 115 | |3 116 | 117 | nX 0 nY 0 = FlipHorizontal Size 31 0 1 0 2ndOr cDel CopyMask -1 1 Size 30 63 0 1 118 | Turtle "BM29,9C1A0S2LU4L13D9R5D4L5BD2R5D4L5D5R2DL2D5R14BU2LU3L3UR4BU2LU3L3UR4BU2L4U4R4BU2LU3L3UR4BL12R3DL3UBU4R3D2L3U2BR5R4D2L4U2BD4RD3R3DL3D3LU7BD9RD4LU4BD6R4DL4UBL5R3D4LU3L2UBD6R5U3RD3R3DL9UBM28,0S1L28D27BD4D31R28" 119 | nX 0 nY 0 = FlipHorizontal Size 27 0 1 0 2ndOr 120 | \ _ AllClear nX 25 nY 17 fShowDot False fMoveByTwo True fDragMoveDot True fDragIsErase False 121 | 4 4 4 8 8 8 4 4 6 6 6 6 6 6 4 8 8 8 8 DoCount 11 {4} 2 2 2 2 2 2 2 6 6 6 6 a 8 8 8 a 4 4 4 122 | nX 13 nY 5 DoCount 24 {2} 4 4 4 4 4 2 2 2 DoCount 12 {6} 4 8 8 8 4 4 4 8 8 8 4 4 6 6 6 6 6 8 8 8 DoCount 11 {4} 2 2 2 6 6 2 2 123 | nX 0 nY 0 = FlipHorizontal Size 27 0 1 0 2ndOr Set 29 35 On _ | 124 | Turtle "BM0,28D2BR56U2" cDel Quo Replace White NWSE 1 1 1 1 0 CopyTexture -1 0 125 | fShowColorBitmap False AllClear Turtle "BM0,28D2BR56U2BM27,25R2" - 126 | Blend3 Replace Blue Pink 0 Replace Red Blue 0 Replace Green Light Orange 0 Replace Magenta Pink 0 SetC 29 35 Magenta SetC 3 7 Green SetC 53 7 Green SetC 3 47 Green SetC 53 47 Green = \ fShowColorBitmap False 127 | nOnMoveOffBitmap 7 nOnMoveToNewCell 5 nAfterMoveToNewCell 6 nAfterRedrawInside 8 fRedrawAfter True 128 | f3D False fShowDot True fWallsImpassable True nMoveCount 0 fDragMoveDot False nEdgeBehavior 0 129 | nInside 2 fNarrowWalls True fCompass True fCellLocation False fSealedEntrances False fMountains False fSunAndMoon True fStars True nMotionFrames 15 nRotationFrames 15 nSemitransparentWalls 3 nCellSize 160 nNarrowCellSize 40 nWallHeight 150 rLightFactor 40 nFogDistance 600 fMarkColor True 130 | Macro28 Macro29 Macro27 Macro18 Macro26 fShowColorBitmap True fRedrawWhenBitmapEdited True n Macro1 131 | -------------------------------------------------------------------------------- /survmaz4.ds: -------------------------------------------------------------------------------- 1 | DS 2 | // Survivor Maze game #4 - A script file for Daedalus 3.5 3 | // By Walter D. Pullen, Astara@msn.com, http://www.astrolog.org/labyrnth.htm 4 | 5 | // Variable usage: 6 | // a-h: Whether poles #1 through #8 have been hit. 7 | // i-l: Colors for players #1 through #4 (constant) 8 | // p: Player color index 9 | // q: Next thing for player to find (ranges from 1-17) 10 | // r: Pole being hit 11 | // v-w: Temporary variables 12 | // x-y: X and Y coordinates of player during events 13 | // z: Event return value 14 | 15 | If Gte Version 2400 {Break} Message 'This script requires Daedalus 2.4 or later to run.' Break 16 | 17 | DefineMacro 1 {@x Inc @p @y Add @x 4 Message 'Welcome to Survivor!\n\nThis game simulates the Maze from the immunity challenge for the final four in "Survivor VIII: All Stars". Your goal is to navigate the Maze, finding and touching eight poles in any order, and also touching the center after each pole. Note some passages are clogged with obstacles you have to weave through.\n\nF1: Display this help text.\nF2: Restart Maze.\nF3: Switch background between day and night.\n\nWhen you touch the center, it must be on the side of the color you're playing as. In this game you're the $x player. That was the position $y had on Survivor.\n\nJeff Probst says: "Survivors ready? Go!"'} "Help Text" 18 | DefineMacro 2 "fRedrawWhenBitmapEdited False SetVars 1 8 '0 0 0 0 0 0 0 0' @p Rnd 0 3 @q 1 fShowColorBitmap False = Del _ ExtraDelete k c5 IfElse Odd @p {nX Add nX Mul 7 Sgn Sub @p 2} {nY Add nY Mul 7 Sgn Dec @p} nDir @p g cg nDirectionOffset -20 fRedrawWhenBitmapEdited True Spc Macro1 fPauseTimer False ct" "Restart Maze" 19 | DefineMacro 3 "fRedrawWhenBitmapEdited False If Equ nInside 0 {i} IfElse fStars {Macro8} {fStars True nFogDistance 800 kSky Black kGround Rgb 95 119 0 kMountain Dark DkGreen kCloud DkGray kCloud2 Dark kCloud} fRedrawWhenBitmapEdited True Spc" "Day And Night" 20 | 21 | DefineMacro 4 "@w GetC @x @y If Neq @w Blend Gray Brown {If Lte Add Abs Sub @x 194 Abs Sub @y 194 10 'Macro6' Break} If Gt @q 16 {nViewHeight nWallHeight @z True Break} If Not Odd @q {Message 'You don't need to find a pole now.\nYou need to return to the center.' Break} @x Div @x 130 @y Div @y 130 @r Add Mul @y 3 @x @r Add @r Lt @r 5 IfElse Var @r {Message 'You've already been to this pole.\nYou need to find a pole you haven't visited yet.'} {SetVar @r True @q Inc @q @w Div @q 2 Message 'You find a pole!\nThis is pole #@w. Now return to the center!'}" "Wall Event" 22 | DefineMacro 5 "If Gt @q 16 {Break} IfElse Odd @q {@w Div Inc @q 2 MessageInside 'Seeking: Pole #@w' -1} {MessageInside 'Seeking: Center' -1}" "Inside Event" 23 | 24 | DefineMacro 6 "If Gt @q 16 {nViewHeight nWallHeight @z True Break} If Odd @q {@w Div Inc @q 2 Message 'You don't need to be at the center now. You need to go find pole #@w.' Break} For (v) 1 3 {If Equ @w Var Add 8 @v 'Break'} IfElse Equ Var Add 9 @p Var Add 8 @v {@q Inc @q If Gt @q 16 'Macro7 Break' @w Div Inc @q 2 Message 'You've reached the center! Now go find pole #@w.'} {@w Inc @p Message 'You don't want to be at the $v color wall of the center.\nRather you want to touch the $w wall.'}" "Hit Center" 25 | DefineMacro 7 "fPauseTimer True @w Timer @x Div @w 60 @y Mod @w 60 Message 'Congratulations, you've found all the poles and returned to the center! :-) You solved it in @x minutes, @y seconds.\n\nWith the immunity necklace around your neck, you can't be voted off the island in Tribal Council. Having made it from the final four to the final three, you now have a 1 in 3 chance of winning the million dollar prize!' nViewHeight nWallHeight @z True" "Win Game" 26 | DefineMacro 8 "fStars False nFogDistance 0 kSky Cyan kGround Rgb 191 239 0 kMountain DkGreen kCloud White kCloud2 -1" "Day Settings" 27 | 28 | fRedrawWhenBitmapEdited False ResetProgram EmbedDB 29 | DB 30 | 275 195 1 31 | 32 | mg" 33 | mg#A 34 | mg%1 35 | mg)) 36 | mg1% 37 | mgA# 38 | mf"!" 39 | mf#aA 40 | mf%a1 41 | mf)a) 42 | mf1a% 43 | mfAa# 44 | me"b" 45 | me#cA 46 | me%c1 47 | me)c) 48 | me1c% 49 | meAc# 50 | md"d" 51 | md#eA 52 | md%e1 53 | md)e) 54 | md1e% 55 | |2 56 | md)a$Aa) 57 | |2 58 | md)e) 59 | |4 60 | md%e1 61 | |7 62 | md#eA 63 | |7 64 | md"!9a-" 65 | md"$Ia$B 66 | md"-)b: 67 | md"Q)b( 68 | md(!)b"Q 69 | md9!)c- 70 | mc$A!)c$A 71 | mc-a)d9 72 | QmbQa)d'mb' 73 | 0ma(b%d"Qm!"Y 74 | !]m!9b%e-m!? 75 | !$Ql"Ab%$Ac$m(A 76 | a0l/c%-9c#Yk"Y 77 | b]kQc%Q'c#'k? 78 | b$Qi(d(!"Qb#"Qi(A 79 | c0i9d9a-b#!-h"Y 80 | d]g"Ac"Aa$b%!$h? 81 | d$Qf/d/cYa%aYf(A 82 | e0fQd1c%a%a'e"Y 83 | f]d(1d1f)a"Qd? 84 | f$Qc91d1f)b-c(A 85 | g0b"A)d1f)b$b"Y 86 | h]a/!)d1f)cYa? 87 | h$Q!Q!%d)f1c'!(A 88 | a$Ae0(a%a%a)f1c"RYe$A 89 | a"AfYa%a%a)f1d/f$ 90 | bAe"Aa#a%a)!"Ac1d$f# 91 | i/b#a#a)!"9cAeY 92 | iQb"a#a)!"(cAe' 93 | h$c"a#a)!"!QbAe"A 94 | h=dA!#a)!"!-bAf= 95 | g"AdA!"a%!"!$A!"a$d$ 96 | g/eA!"a%!"a9!"a#QdY 97 | gQe1!"a%"6a(!"a%-d7 98 | f$f1aA!%!"bQ#a%$AcBA 99 | f=f)aA!%KJb-#a)!9b"!= 100 | e"Af)aA!%!"b$Ca)!'b#!$ 101 | k%a)aA!&66c;a)!"Aa# 102 | k9a%a1!%!"c'a1a1a% 103 | j"Aa%a1!#KJf1d) 104 | j/b#a1!#!"fAd1 105 | jQb#a1!#66fAd1 106 | i(c#a)!#!"fAdA 107 | i9c"a)!#KJe"d" 108 | h"Ac(a)!#!"e"d$ 109 | h/d9A!)!#66e#eY 110 | hQc$AA!%!#!"!"Ab#e' 111 | g$d-!1!%!"+J!"Yb%e"A 112 | g=c"Q!1!%!"!"!"'b%f= 113 | f"Ac'a1!#!"665""Qa%aQc$ 114 | f'd?a)!#!"!"!"!-a)a]dQ 115 | f9c$`a)!#!"+J+J!$a)!"`Ac- 116 | k0`a%!#!"!"!"aY!1!"`Y 117 | j"nA!%!"!"6666a'!1!$n 118 | j(nQ!%!"!"!"!"a"A1!(nQ 119 | j@nQ!#!"aKJ+Kb=A!(n] 120 | i$oY!#!"aA"!#b$A!0oA 121 | i0oY!"aA!F663b"a0oY 122 | h"p]!"aA!A"!#b"a@p 123 | h(p_!"aA!KJ+Kb"aqQ 124 | h@p_aA!A!A"!#b#aq] 125 | g"raA!1!F663b#!"r 126 | hra1!1!A"!#b%!"q_ 127 | h@qA!1!1!3J+Eb%!$q] 128 | h0qA!)!1!1"!%b)!$qY 129 | h(qQ!)!)!6665!/!)!(qQ 130 | h$qY!)b1"!%!"A)!0qA 131 | h"qY!%b3B+Ea91!0q 132 | iq]!%b1"!%a(1!@p_ 133 | i@p]!#b1"65bQ!@p] 134 | i0p_d1"!%bO!qY 135 | i(p_d)"+IbBAqQ 136 | i$qd)"!)a"!:qA 137 | i"qAc)"6)a"!(q 138 | jqAc)"!)a#!$p_ 139 | j@pQc)"+Ia#!(p] 140 | j0pQd"!)a%!(pY 141 | j(pYd"6)a%!0pQ 142 | j$pYd"!)a%!0pA 143 | j"p]d"+1a)!@p 144 | kp_d"!1a)!p_ 145 | k@o_d""1a1!p] 146 | k0p!%b"!1a1"pY 147 | k(p!%b"!1a1"pQ 148 | k$pA#b"!1aA$pA 149 | k"pA#b"!1aA$p 150 | lpQ"b$!A!"!(o_ 151 | l@n_!"b-!A!"ao] 152 | l0nQ!"bQ!A!"a(nY 153 | l(nbA!$aA!#a"nQ 154 | l$`]bA!=aA!#b@`A 155 | l"`Ab1"AaA!%b$` 156 | m_c1'bA!%c_ 157 | m9c)YbA!)c- 158 | md,b"a) 159 | md-b"a9 160 | mh"a' 161 | mh"a"Q 162 | mh"b- 163 | mh"b$ 164 | mh"cY 165 | mbQc$Bc' 166 | ma$d0[c"A 167 | ma-d`_d9 168 | maQc(`_d' 169 | mf@`_ 170 | me$n_ 171 | me0n_!) 172 | men]?!/ 173 | md(nQ'!0Q 174 | md@`_b@] 175 | mc$nYb@`A 176 | mc0ncnY 177 | mcn]c@`_ 178 | mb$nQc(nA 179 | mb"`_en 180 | mc`Ye0_ 181 | mc@f"] 182 | mc-g9 183 | 184 | |19 185 | mg= 186 | mg@Q 187 | mg@] 188 | mg0Y 189 | mg(Q 190 | mg$A 191 | mg" 192 | 193 | WindowTitle "- Survivor Maze Game 4" True nHorizontalScroll 8 nVerticalScroll 8 fHideMenu True fHideScrollbars True nOnMoveIntoWall 4 nAfterRedrawInside 5 194 | SetVars 9 4 "Blue Yellow #00BF00 Red" SetStrings 1 8 ",Blue,Yellow,Green,Red,Amber,Rupert,Boston Rob,Jenna" 195 | nRepeatDelayInMsec 25 kBorder White kInsideWall Blue k3DWall White fShowDot True fWallsImpassable True fNoCornerHopping True fDoDragOnTemp True nEdgeBehavior 0 Macro8 fSealedEntrances False fMountains True nPeakHeight 33 nCloudCount 6 fSunAndMoon True fNarrowWalls False nInside 4 nCellSize 160 nWallHeight 2000 nStepHeight 999 nClippingPlane 600 nMotionVelocity 100 nRotationVelocity 5 nUpDownVelocity 100 fMarkColor True 196 | 197 | Size 275 389 0 0 = RotateAcross TempOr Size 332 389 0 0 Size 57 0 1 0 = RotateRight TempOr = 198 | Quo Replace White DkBlue 0 k Turtle "C0" For (y) 0 3 {SetString 0 "A@yBM194,194BU42BR5D0BD`BL77U0BU`" Turtle $0} TempXor ColorOr Replace White Blend Cyan DkCyan 0 k + 199 | For (y) 0 3 {SetString 0 "A@yBM194,194BU168`BL120BD48`" Turtle $0} TempXor \ ColorOr Replace White Blend Brown Gray 0 k + 200 | For (y) 0 3 {SetString 0 "A@yBM194,194BU80BL21~" Turtle $0} Turtle "BM194,154~" _ - TempXor ColorOr Replace White Gray 0 k 201 | Turtle "C1" For (y) 0 3 {Del c5 nXTurtle nX nYTurtle nY SetString 0 "A@yBELHR4BRBEL6HR8BL4BUL4UL" Turtle $0 ColorOr Replace White Var Add 9 And Sub 4 @y 3 0 k} 202 | Del For (y) 0 3 {SetString 0 "A@yBM194,194BU41BR6R2BR2BDL4DR7FL8DR8DL8FR6DGUL3" Turtle $0} = ColorOr Replace White Blend Cyan DkCyan 0 = kDot Gray ColorDotXor ColorPut cDel Set nX nY Off Quo Replace White (??) 0 kDot 127 ColorDotAnd kDot 128 ColorDotOr k _ ColorOr Replace White UD 256 240 0 CopyTexture -1 1 _ TempDelete k TempOr CopyMask -1 1 nWallVariable 1 _ - TempOr 203 | Turtle "A0" kDot Orange k TempDelete ExtraDelete Replace Black White 0 fRedrawWhenBitmapEdited True n Macro2 204 | -------------------------------------------------------------------------------- /maze5d.ds: -------------------------------------------------------------------------------- 1 | DS 2 | // N-Dimensional Mazes - A script file for Daedalus 3.5 3 | // By Walter D. Pullen, Astara@msn.com, http://www.astrolog.org/labyrnth.htm 4 | 5 | // Variable usage: 6 | // b: Cell size of Maze 7 | // c: 0 = ND-Maze, 1 = Solved ND-Maze, 2 = ND-cube 8 | // d: Dimensions of Maze 9 | // e: Whether tracing corner path 10 | // f: Default rotation rate (constant) 11 | // k: Whether drawing on color bitmap 12 | // r: Rainbow timing 13 | // m-n: Coordinates of center 14 | // p: Current dimension axis to edit 15 | // v-z: Temporary variables 16 | 17 | // 27-58: Current X and Y pixel offsets for each axis 18 | // 59-74: Coordinates of dot 19 | // 75-90: Maximum cell size in each dimension (constant) 20 | // 101+: X-axis size 21 | // 102+: Y-axis size 22 | // 103+: Rotation max angle 23 | // 104+: Current rotation angle 24 | // 105+: Rotation increment 25 | 26 | If Gte Version 2300 {Break} Message 'This script requires Daedalus 2.3 or later to run.' Break 27 | 28 | DefineMacro 1 "@w 1 @x 0 @y 0 @z 0 For (v) 1 @d {@z Add << @z 1 @y @y Add << @y 1 @x @x Add << @x 1 @w @w << @w 1} @u Pow @b @d Macro37" "Show Help" 29 | DefineMacro 2 "If And Equ @c 2 Not fShowDot {Macro15} @c 0 fRedrawWhenBitmapEdited False Macro22 fRedrawWhenBitmapEdited True n" "New Maze" 30 | DefineMacro 3 "fRedrawWhenBitmapEdited False Macro18 Macro19 Macro20 fRedrawWhenBitmapEdited True n" "New View" 31 | DefineMacro 4 "IfElse fAutorepeatLastCommand {N} {Macro12 N}" "Toggle Animate View" 32 | DefineMacro 5 "If Lte @d 2 {Break} fRedrawWhenBitmapEdited False @k fShowColorBitmap fShowColorBitmap False @d Dec @d _ Size3W @d _ fShowColorBitmap @k Macro18 Macro19 Macro22 fRedrawWhenBitmapEdited True" "Decrease Dimension" 33 | DefineMacro 6 "If Gte @d 18 {Break} fRedrawWhenBitmapEdited False @k fShowColorBitmap fShowColorBitmap False @d Inc @d @z Var Add 74 @d If Gt @b @z {@b @z Macro21} _ Size3W @d _ fShowColorBitmap @k Macro18 Macro19 Macro22 fRedrawWhenBitmapEdited True" "Increase Dimension" 34 | DefineMacro 7 "If Lte @b 2 {Break} fRedrawWhenBitmapEdited False @b Dec @b Macro21 Macro22 fRedrawWhenBitmapEdited True" "Decrease Cells" 35 | DefineMacro 8 "If Gte @b Var Add 74 @d {Break} fRedrawWhenBitmapEdited False @b Inc @b Macro21 Macro22 fRedrawWhenBitmapEdited True" "Increase Cells" 36 | DefineMacro 9 "fRedrawWhenBitmapEdited False @k fShowColorBitmap fShowColorBitmap False _ CopyMask 0 -1 IfElse Neq @c 1 {If And Equ @c 2 Not fShowDot 'Macro15' @c 1 DeadEndND} {@c 0} _ fShowColorBitmap @k Macro20 fRedrawWhenBitmapEdited True If Neq @c 1 {Break} Message 'This @d dimensional Maze contains @z dead ends.'" "Toggle Solution" 37 | DefineMacro 10 "fRedrawWhenBitmapEdited False @k fShowColorBitmap fShowColorBitmap False _ IfElse Equ @c 2 {@c 0 CopyMask 0 -1} {@c 2 Del} _ fShowColorBitmap @k Macro20 fRedrawWhenBitmapEdited True If Equ Equ @c 2 fShowDot {Macro15}" "Toggle Cube" 38 | DefineMacro 11 "fRedrawWhenBitmapEdited False @e Not @e fShowDot2 And Not @e fShowDot Macro20 fRedrawWhenBitmapEdited True If And @e Not fAutorepeatLastCommand {Macro4}" "Toggle Vertex Tracking" 39 | DefineMacro 12 "fRedrawWhenBitmapEdited False Macro19 Macro20 fRedrawWhenBitmapEdited True" "Single Rotate View" 40 | 41 | DefineMacro 13 "fRedrawWhenBitmapEdited False Macro23 Macro20 fRedrawWhenBitmapEdited True n" "Teleport To Start" 42 | DefineMacro 14 "For (x) 0 Dec @d {@y Mul @x 5 SetVar Add 105 @y Neg Var Add 105 @y} Macro12" "Reverse Direction" 43 | DefineMacro 15 "fRedrawWhenBitmapEdited False fShowDot Not fShowDot If Not @e {fShowDot2 fShowDot} fRedrawWhenBitmapEdited True Spc @z True" ". Hook" 44 | DefineMacro 16 "fRedrawWhenBitmapEdited False @z kPassage kPassage kWall kWall @z kBorder kPassage If fShowColorBitmap {Macro20} fRedrawWhenBitmapEdited True Spc @z True" "/ Hook" 45 | DefineMacro 17 "If Not fShowDot {Macro15 Break} MoveND 59 27 Sub @x @m Sub @y @n fRedrawWhenBitmapEdited False nX Add nX @m nY Add nY @n fRedrawWhenBitmapEdited True Spc If And @z Not fPauseTimer {fPauseTimer True @z Timer @x Div @z 60 @y Mod @z 60 Message 'You reach the finish vertex! :-)\nCongratulations, you solved it in @x minutes, @y seconds.'} @z True" "Left Event" 46 | 47 | DefineMacro 18 "SizeWindow Del \ k SizeWindow Del \ k @m Div SizeX 2 @n Div SizeY 2 @v Dec Min SizeX SizeY @w @v For (x) 0 Dec @d {@y Mul @x 5 IfElse Lt @x Dec @d '@z Rnd 1 Div @v Dec Sub @d @x @v Sub @v @z' '@z @v' SetVar Add 101 @y @z IfElse Lt @x Dec @d '@z Rnd 1 Div @w Dec Sub @d @x @w Sub @w @z' '@z @w' SetVar Add 102 @y @z @z Add @f Rnd 0 2000 SetVar Add 103 @y @z SetVar Add 104 @y Rnd 0 Dec @z @z Rnd 1 40 If Rnd 0 1 '@z Neg @z' SetVar Add 105 @y @z}" "New Sizes" 48 | DefineMacro 19 "For (x) 0 Dec @d {@y Mul @x 5 @w Var Add 103 @y @z Var Add 104 @y @z Add @z Var Add 105 @y If Gte @z @w '@z Sub @z @w' If Lt @z 0 '@z Add @z @w' SetVar Add 104 @y @z SetVar Add 27 Mul @x 2 Cos2 Var Add 101 @y Var Add 104 @y @w SetVar Add 28 Mul @x 2 Sin2 Var Add 102 @y Var Add 104 @y @w}" "Animate Sizes" 49 | DefineMacro 20 "Del DrawND @m @n 59 27 ?: fShowColorBitmap kWall White - IfElse fShowColorBitmap {SetC nX nY Hue @r @r Inc @r} {h} If @e {n} - If Not @e {n}" "Draw Maze" 50 | DefineMacro 21 "@k fShowColorBitmap fShowColorBitmap False _ Size3X Inc Mul @b 2 Size3Y Size3X Size3Z Dec Mul @b 2 _ fShowColorBitmap @k" "Resize Maze" 51 | DefineMacro 22 "@k fShowColorBitmap fShowColorBitmap False _ ND CopyMask -1 0 If Equ @c 2 {Del} _ fShowColorBitmap @k Macro23 Macro20" "Create Maze" 52 | DefineMacro 23 "Del \ For (z) 59 74 {SetVar @z 0} @p 0 ct fPauseTimer False" "Reset Dot" 53 | DefineMacro 24 "fRedrawWhenBitmapEdited False k Del \ Macro20 fRedrawWhenBitmapEdited True @z True" "k Hook" 54 | 55 | DefineMacro 25 "fRedrawWhenBitmapEdited False @k fShowColorBitmap fShowColorBitmap False @c 2 _ Size3W @d _ fShowColorBitmap @k Macro18 Macro19 Macro22 fRedrawWhenBitmapEdited True If fShowDot {Macro15}" "Show Cube" 56 | DefineMacro 26 "@d 2 Macro25" "2D Cube" 57 | DefineMacro 27 "@d 3 Macro25" "3D Cube" 58 | DefineMacro 28 "@d 4 Macro25" "4D Cube" 59 | DefineMacro 29 "@d 5 Macro25" "5D Cube" 60 | DefineMacro 30 "@d 6 Macro25" "6D Cube" 61 | DefineMacro 31 "@d 7 Macro25" "7D Cube" 62 | DefineMacro 32 "@d 8 Macro25" "8D Cube" 63 | DefineMacro 33 "@d 9 Macro25" "9D Cube" 64 | DefineMacro 34 "@d 10 Macro25" "10D Cube" 65 | DefineMacro 35 "@d 11 Macro25" "11D Cube" 66 | DefineMacro 36 "@d 12 Macro25" "12D Cube" 67 | 68 | DefineMacro 37 {Message 'Welcome to N-Dimensional Mazes!\n\nSolve the Maze by moving the red dot to the finish (green dot) along the lines (i.e. passages) by clicking on vertices adjacent to the red dot. This is a @d dimensional Maze with @b cells per side, containing @u vertices. A @d dimensional cube contains: @w points, @x edges, @y faces, @z solids.\n\nF1: Display this help text.\nF2: Create new @d dimensional Maze.\nF3: View current Maze from different angle.\nF4: Toggle animation of Maze rotating.\n\nF5: Create Maze in lower dimension.\nF6: Create Maze in higher dimension.\nF7: Create easier Maze with fewer cells.\nF8: Create harder Maze with more cells.\n\nF9: Show solution.\nF10: Draw a @d dimensional cube instead of Maze.\nF11: Toggle vertex tracking.\nF12: Rotate Maze slightly.\n\nPress "Ctrl+g" to teleport to start.\nPress "/" to toggle colors.\nPress "a" to toggle axis vs. nearness coloring.\nPress "b" to toggle vertex highlighting.'} "Help Text" 69 | DefineMacro 38 "nRandomSeed Inc nRandomSeed Macro3" "Random View" 70 | 71 | DefineMacro 39 "@p Dec @p If Lt @p 0 {@p Dec @d}" "Decrease axis" 72 | DefineMacro 40 "@p Inc @p If Gte @p @d {@p 0}" "Increase axis" 73 | DefineMacro 41 "@z Add 27 Mul @p 2 SetVar @z Dec Var @z fRedrawWhenBitmapEdited False Macro20 fRedrawWhenBitmapEdited True n" "Decrease X" 74 | DefineMacro 42 "@z Add 27 Mul @p 2 SetVar @z Inc Var @z fRedrawWhenBitmapEdited False Macro20 fRedrawWhenBitmapEdited True n" "Increase X" 75 | DefineMacro 43 "@z Add 28 Mul @p 2 SetVar @z Dec Var @z fRedrawWhenBitmapEdited False Macro20 fRedrawWhenBitmapEdited True n" "Decrease Y" 76 | DefineMacro 44 "@z Add 28 Mul @p 2 SetVar @z Inc Var @z fRedrawWhenBitmapEdited False Macro20 fRedrawWhenBitmapEdited True n" "Increase Y" 77 | 78 | DefineMacro 45 "@w Mul 420 2 For (x) 0 Dec @d {@y Mul @x 5 SetVar Add 103 @y @w SetVar Add 104 @y Rnd 0 Dec @w @z Inc @x If Rnd 0 1 '@z Neg @z' SetVar Add 105 @y @z}" "Repeatable Sizes" 79 | // DefineMacro 46 "@a 0 For (g) 1 Mul 420 2 {SetStringNum 0 @a 5 SetString 0 'Dae$0.bmp' SaveBitmap $0 @a Inc @a Macro12}" "Save Sequence" 80 | 81 | fRedrawWhenBitmapEdited False ResetProgram WindowTitle "- N-Dimensional Mazes" True 82 | nHorizontalScroll 8 nVerticalScroll 8 fHideMenu True fHideScrollbars True 83 | nOnLeftClick 17 nOnRightClick 15 84 | SetVars 75 18 "0 10 10 10 10 10 6 5 4 3 3 2 2 2 2 2 2 2" 85 | OnCommand (cg) 13 OnCommand (r) 14 OnCommand (.) 15 OnCommand (/) 16 OnCommand (k) 24 OnCommand (JumpL) 39 OnCommand (JumpU) 39 OnCommand (JumpR) 40 OnCommand (JumpD) 40 OnCommand (MoveU) 41 OnCommand (MoveL) 42 OnCommand (MoveD) 43 OnCommand (MoveR) 44 86 | fShowColorBitmap False nHorizontalPixelValue 1 nVerticalPixelValue 1 nRepeatDelayInMsec 50 fShowDot True fDotIsCircle True fDotShowsArrow False nDotSize 5 fChaseMousePoint False fDragIsErase False fDoDragOnTemp False fShowDot2 fShowDot fNoMouseDrag True kBorder kPassage kDot Red kDot2 Green nInside 0 87 | @b 2 @c 0 @d 5 @e False @f 10000 @p 0 88 | Del SizeWindow = \ Size3W @d _ Macro21 _ ND _ Quo = \ 89 | Macro18 Macro19 Macro20 Macro22 90 | fRedrawWhenBitmapEdited True Macro4 Macro1 91 | -------------------------------------------------------------------------------- /squared.ds: -------------------------------------------------------------------------------- 1 | DS 2 | // Survivor Squared Off game - A script file for Daedalus 3.5 3 | // By Walter D. Pullen, Astara@msn.com, http://www.astrolog.org/labyrnth.htm 4 | 5 | // Variable usage: 6 | // a: Difficulty (0-10) 7 | // b-c: Saved X and Y coordinates 8 | // d: Board directions can move 9 | // e: Board extent 10 | // f: Max moves reachable 11 | // g: Players total in game 12 | // i-p: X and Y position of the eight players 13 | // q: User player index (0-7) 14 | // r: Current player (0-7) 15 | // s: Players left in game 16 | // t: Number of moves available 17 | // u: Current direction 18 | // v: Which move to take 19 | // w: Temporary variable 20 | // x-y: X and Y coordinates of player 21 | // z: Event return value 22 | // 27-34: Colors for the eight players (constant) 23 | // 35-42: Moves reachable down the eight directions 24 | 25 | If Gte Version 3300 {Break} Message 'This script requires Daedalus 3.3 or later to run.' Break 26 | DefineConst "1 FHelp FNew FWait FSize FHard VEdge VBefore VAfter VInside GoAll GoComp EasyAI HardAI GoUser Death End Count Check GetDir GetXY SetXY Texture Reset Build" 27 | If @z {Message 'Initialization failed!' Halt} 28 | 29 | EmbedMacro %FHelp "Help Text" 30 | @w Inc @q @z Dec @g 31 | IfElse Lte @g 1 {$0 'player'} {SetString 0 '@g players'} 32 | Message 'Welcome to Survivor!\n\nThis simulates the Squared Off game from the episode 9 immunity challenge in the original "Survivor" series. Your goal is to be the last player standing, by running the other $0 out of room. On your turns, move to an adjacent square that hasn't yet been visited, for as long as you're able.\n\nF1: Display this help text.\nF2: Start new game.\nF3: Let other players continue (if you've lost).\n\nF4: Set game board dimensions, and number of players.\nF5: Set game difficulty, and number of move directions.\n\nIn this game you are player #@w ($w).\nJeff Probst says: "Survivors ready? Go!"' 33 | 34 | EmbedMacro %FNew "Restart Game" 35 | fRedrawWhenBitmapEdited False 36 | fShowColorBitmap True 37 | _ AllClear _ | k \ k 38 | *Reset 39 | fRedrawWhenBitmapEdited True n 40 | *FHelp *GoAll 41 | 42 | EmbedMacro %FWait "User Wait" 43 | If Lte @s 1 {Message 'The game has finished.' Break} 44 | If Neq Var Add 9 @q -1 {Message 'You are still in the game.' Break} 45 | @r Mod Inc @r @g 46 | *GoAll 47 | 48 | EmbedMacro %FSize "Set Size" 49 | SetString 0 @e SetString 1 @g 50 | GetString2 'Enter board size to restart game with (8-50):' 'Enter number of players to restart game with (2,4,8):' 0 51 | If @z {Return} 52 | @w Num $0 53 | If Or Lt @w 8 Gt @w 50 {Message 'Bad size: @w' Return} 54 | @z Num $1 55 | If And And Neq @z 2 Neq @z 4 Neq @z 8 {Message 'Bad player count: @z' Return} 56 | @e @w @g @z 57 | *Build *FNew 58 | 59 | EmbedMacro %FHard "Set Difficulty" 60 | SetString 0 @a 61 | @z Sub 12 Mul @d 4 SetString 1 @z 62 | GetString2 'Enter game difficulty (0=easy, 10=hard):' 'Number of options for move (4=orthogonal, 8=diagonal):' 0 63 | If @z {Return} 64 | @w Num $0 65 | If Or Lt @w 0 Gt @w 10 {Message 'Bad difficulty: @w' Return} 66 | @z Num $1 67 | If And Neq @z 4 Neq @z 8 {Message 'Bad number of moves: @z' Return} 68 | @a @w @d Sub 3 Div @z 4 69 | nInside Sub 4 @d 70 | If Gt @d 1 {nDirectionOffset 0} 71 | 72 | EmbedMacro %VEdge "Edge Event" 73 | Message 'Jeff Probst says: "Hey, you can't step off the playing field!"' 74 | @z True 75 | 76 | EmbedMacro %VBefore "Before Move" 77 | If Gte @x @e {*VEdge Break} 78 | If GetE @x @y {Message 'You bump into another player!' @z True Break} 79 | @w GetCT @x @y 80 | If Neq @w Black {Message 'That square has already been visited!' @z True Break} 81 | fRedrawWhenBitmapEdited False 82 | SetC @x @y Var Add 27 @q 83 | SetCT @x @y White 84 | *SetXY 85 | @r Mod Inc @r @g 86 | fRedrawWhenBitmapEdited True 87 | @z False 88 | 89 | EmbedMacro %VAfter "After Move" 90 | fRedrawWhenBitmapEdited False 91 | nHorizontalOffset 0 nVerticalOffset 0 92 | fRedrawWhenBitmapEdited True n 93 | *GoAll 94 | 95 | EmbedMacro %VInside "Inside Event" 96 | @x Inc @q 97 | IfElse Neq @r @q 98 | {@y Inc @r MessageInside 'You: Player #@x ($x). Current turn: Player #@y ($y)' -1} 99 | {MessageInside 'You: Player #@x ($x). It's your turn!' -1} 100 | 101 | EmbedMacro %GoAll "Move All" 102 | If Lte @s 1 {Break} 103 | If Equ @r @q {*GoUser Spc Break} 104 | *GoComp 105 | @r Mod Inc @r @g 106 | Restart 107 | 108 | EmbedMacro %GoComp "Move Computer" 109 | If Equ Var Add 9 @r -1 {Break} 110 | fRedrawWhenBitmapEdited False 111 | *GetXY 112 | SetE @x @y False 113 | *Count 114 | If Lte @t 0 {*Death fRedrawWhenBitmapEdited True n Break} 115 | IfElse Lt @a Rnd 1 10 {*EasyAI} {*HardAI} 116 | SetC @x @y Var Add 27 @r 117 | SetCT @x @y White 118 | SetE @x @y True 119 | *SetXY 120 | If nInside {Delay nRepeatDelayInMsec} 121 | fRedrawWhenBitmapEdited True n 122 | 123 | EmbedMacro %EasyAI "Easy Difficulty" 124 | @v Rnd 1 @t 125 | ForStep (u) 0 7 @d { 126 | *GetXY *GetDir *Check 127 | If @z '@v Dec @v' 128 | If Lte @v 0 'Break' 129 | } 130 | 131 | EmbedMacro %HardAI "Hard Difficulty" 132 | @b nX @c nY 133 | fHourglassCursorOnRedraw False fSkipMessageDisplay True 134 | @f -1 135 | ForStep (u) 0 7 @d { 136 | fShowColorBitmap True _ ColorPut k _ k 137 | *GetXY *GetDir *Check 138 | If Not @z (SetVar Add 35 @u -1 Continue) 139 | nX @x nY @y ~ @z Pixels SetVar Add 35 @u @z 140 | If Equ @z @f (@v Inc @v) 141 | If Gt @z @f (@f @z @v 1) 142 | } 143 | @v Rnd 1 @v 144 | ForStep (u) 0 7 @d { 145 | If Neq Var Add 35 @u @f 'Continue' 146 | @v Dec @v 147 | If Lte @v 0 'Break' 148 | } 149 | *GetXY *GetDir 150 | nX @b nY @c fHourglassCursorOnRedraw True ? 151 | + Del k 152 | 153 | EmbedMacro %GoUser "Check User" 154 | If Equ Var Add 9 @q -1 {Break} 155 | *Count If Gt @t 0 {Break} 156 | @w Dec @s 157 | Message 'You can't move and are out of the game! :-(\nNumber of players finishing better: @w\nYou get sent over to the "loser bench" to watch the rest of the players still in this game.\n\nF1: Display help text.\nF2: Start new game.\nF3: Let the other players still in the game take a turn.' 158 | fRedrawWhenBitmapEdited False 159 | *Death 160 | kSky Black kCloud DkGray kCloud2 Dark kCloud fStars True 161 | *End 162 | fRedrawWhenBitmapEdited True n 163 | 164 | EmbedMacro %Death "Die" 165 | @x Inc @e @y Add Div Sub @e @g 2 @r 166 | SetC @x @y Var Add 27 @r 167 | *Texture 168 | @s Dec @s 169 | IfElse Neq @r @q 170 | {@w Inc @r Message 'Player #@w ($w) can't move and is out of the game!\nNumber of players left: @s' SetE @x @y True} 171 | {nX @x nY @y nDir 1 nDirectionOffset 0} 172 | SetVar Add 9 @r -1 173 | If Gt @s 1 {Break} 174 | IfElse Equ Var Add 9 @q -1 175 | {Message 'One player left, we have a winner!\n\nUnfortunately the winner wasn't you. You overhear the other\nplayers plotting to vote you off the island this Tribal Council. :-('} 176 | {fRainbow True Message 'You win! You are the sole surviving player left standing! :-)\n\nJeff congratulates you, and hands you the coveted immunity necklace. You try to keep from laughing as the other tribemates frantically try to form an alliance with you.'} 177 | *End 178 | 179 | DefineMacro %End "ClearEvents nMotionVelocity 50" "Disengage User" 180 | DefineMacro %Count "@t 0 ForStep (u) 0 7 @d {*GetXY *GetDir *Check @t Add @t @z}" "Count Square" 181 | DefineMacro %Check "If Or Or Or Lt @x 0 Lt @y 0 Gte @x @e Gte @y @e {@z 0 Break} @w GetC @x @y If And Neq @w LtGray Neq @w Light LtGray {@z 0 Break} @z 1" "Check Square" 182 | DefineMacro %GetDir "If And Gte @u 1 Lte @u 3 {@x Dec @x} If Gte @u 5 {@x Inc @x} If Or Lte @u 1 Gte @u 7 {@y Dec @y} If And Gte @u 3 Lte @u 5 {@y Inc @y}" "Get Dir" 183 | DefineMacro %GetXY "@x Div Var Add 9 @r 100 @y Mod Var Add 9 @r 100" "Get XY" 184 | DefineMacro %SetXY "SetVar Add 9 @r Add Mul @x 100 @y *Texture" "Set XY" 185 | DefineMacro %Texture "SetX @x @y -1 Inc @r" "Set Texture" 186 | 187 | EmbedMacro %Reset "Reset Variables" 188 | nOnMoveOffBitmap %VEdge nOnMoveToNewCell %VBefore nAfterMoveToNewCell %VAfter nAfterRedrawInside %VInside 189 | kSky Cyan kCloud White kCloud2 Light Light LtGray fStars False nMotionVelocity 140 190 | nHorizontalOffset 0 nVerticalOffset 0 nDirectionOffset 0 fRainbow False 191 | IfElse Gte @g 8 { 192 | @w Add 2 Div Sub @e @g 4 193 | @i @w 194 | @j Mul @w 100 195 | @k Sub Dec @e @w 196 | @l Mul @k 100 197 | @m Add Mul @w 100 Dec @e 198 | @n Add Mul Dec @e 100 @w 199 | @o Add Mul @k 100 Dec @e 200 | @p Add Mul Dec @e 100 @k 201 | } { 202 | @w Dec @e 203 | @i 0 204 | @j Add Mul @w 100 @w 205 | @k @w 206 | @l Mul @w 100 207 | } 208 | For (r) 0 Dec @g 209 | {@w Rnd 0 Dec @g SwapVar Add 9 @r Add 9 @w} 210 | @q Rnd 0 Dec @g 211 | kDot Light Var Add 27 @q 212 | For (r) 0 Dec @g { 213 | *GetXY 214 | SetC @x @y Var Add 27 @r 215 | SetCT @x @y White 216 | IfElse Neq @r @q (SetE @x @y True) (nX @x nY @y) 217 | *Texture 218 | } 219 | nDir Add << Or Lte nY 0 Lte nX 0 1 Or Lte nX 0 Gte nX Dec @e 220 | g @r 0 @s @g 221 | 222 | EmbedMacro %Build "Build Board" 223 | fRedrawWhenBitmapEdited False 224 | Size @e @e 0 1 225 | Quo = k AllSet 226 | Size Add @e 2 @e 0 0 227 | @x Inc @e @y Div Sub @e @g 2 @z Dec @g 228 | SetString 0 "BM@x,@yS1D@z" Turtle $0 229 | = Quo 230 | Replace White LtGray 0 231 | k AllClear Blend ColorOr 232 | Replace White Light LtGray 0 233 | \ AllClear CopyTexture -1 0 | k AllClear \ k 234 | 235 | fRedrawWhenBitmapEdited False ResetProgram 236 | WindowTitle "- Survivor Squares" True 237 | nHorizontalScroll 8 nVerticalScroll 8 238 | fHideMenu True fHideScrollbars True 239 | nTextureWall 0 240 | kGround Light Brown 241 | kMountain2 Brown 242 | kMountain kGround 243 | f3D False 244 | fShowDot True 245 | fDotIsCircle True 246 | nDotSize 0 247 | fNoCornerHopping False 248 | fMoveByTwo False 249 | nEdgeBehavior 0 250 | nInside 3 251 | fNarrowWalls False 252 | fCellLocation True 253 | fSealedEntrances False 254 | fMountains True 255 | nPeakHeight 20 256 | nRotationVelocity 15 257 | nSemitransparentWalls 3 258 | nCellSize 100 259 | nWallHeight 100 260 | rViewingSpan 6000 261 | SetVars 27 8 "Red Orange Yellow Green Cyan Blue Purple Magenta" 262 | SetStrings 0 9 ",T_0_,Red,Orange,Yellow,Green,Cyan,Blue,Purple,Magenta" 263 | Size 72 96 0 1 Turtle "T1" 264 | For (r) 1 8 {Del SetChar 0 2 Add 48 @r Turtle "BM11,11S12" Turtle $0 Thicken2 8 cDel CopyMask -1 @r} 265 | @d 1 @e 10 @g 8 266 | *Build *Reset 267 | fRedrawWhenBitmapEdited True n 268 | *FHelp *GoAll 269 | -------------------------------------------------------------------------------- /survmaz2.ds: -------------------------------------------------------------------------------- 1 | DS 2 | // Survivor Maze game #2 - A script file for Daedalus 3.5 3 | // By Walter D. Pullen, Astara@msn.com, http://www.astrolog.org/labyrnth.htm 4 | 5 | // Variable usage: 6 | // a-c: X and Y position and color of pole #1 7 | // d-f: X and Y position and color of pole #2 8 | // g-i: X and Y position and color of pole #3 9 | // j-l: X and Y position and color of pole #4 10 | // m-o: X and Y position and color of pole #5 11 | // p: Pole being hit 12 | // q: Next thing for player to find (ranges from 1-11) 13 | // r: Temporary variable 14 | // s: Next pole for player to find 15 | // v: Day/Night wall color 16 | // w: Wall color 17 | // x-y: X and Y coordinates of player during events 18 | // z: Event return value and temporary flag 19 | 20 | If Gte Version 2300 {Break} Message 'This script requires Daedalus 2.3 or later to run.' Break 21 | 22 | DefineMacro 1 "Message 'Welcome to Survivor!\n\nThis game sumulates the Maze from the episode 6 immunity challenge in "Survivor IV: Marquesas". Your goal is to navigate the Maze, finding and touching five poles in order, and also touching the center after each pole.\n\nF1: Display this help text.\nF2: Restart current Maze.\nF3: Start in same Maze the Survivors did.\nF4: Start in Maze with random pole positions.\nF5: Switch background between day and night.\n\nA message will be displayed when you run into each pole.\nThe poles progress through the colors of the rainbow:\nPole #1: Red, #2: Yellow, #3: Green, #4: Blue, #5: Purple.\n\nJeff Probst says: "Survivors ready? Go!"'" "Help Text" 23 | DefineMacro 2 "fRedrawWhenBitmapEdited False fShowColorBitmap False TempDelete k Macro19" "Restart Maze" 24 | DefineMacro 3 "Macro16 Macro18 Macro19" "Start Survivor's Maze" 25 | DefineMacro 4 "Macro16 Macro17 Macro18 Macro19" "Start Random Pole Maze" 26 | DefineMacro 5 "fRedrawWhenBitmapEdited False If Equ nInside 0 {i} IfElse fStars {fStars False nFogDistance 0 kSky Cyan kGround Light Brown kMountain DkGreen kCloud White kCloud2 -1 Replace @w @v 0 SwapVar (v) (w)} {fStars True nFogDistance 800 kSky Black kGround Blend Brown DkGray kMountain Dark DkGreen kCloud DkGray kCloud2 Dark kCloud Replace @w @v 0 SwapVar (v) (w)} fRedrawWhenBitmapEdited True n" "Day And Night" 27 | 28 | DefineMacro 6 "@z False @r GetC @x @y If And Equ @r @w GetE @x @y {Macro14 Break} @s Div Inc @q 2 If Lte Add Abs Sub 89 @x Abs Sub 89 @y 6 {Macro13 Break} If Gt @q 10 {Break} If Equ @r DkGray {Macro11 Break} For (p) 1 5 {If Equ @r Var Mul @p 3 'Break'} If Gt @p 5 {Break} If Not And @q 1 {Macro12 Break} SwitchSgn Sub @p @s {Macro8} {Macro9} {Macro10}" "Wall Event" 29 | DefineMacro 7 "If Gt @q 10 {Break} IfElse Odd @q {@s Div Inc @q 2 MessageInside 'Seeking: Pole #@s ($s)' -1} {MessageInside 'Seeking: Center' -1}" "Inside Event" 30 | 31 | DefineMacro 8 "SwitchSgn Sub @s 6 {Message 'You've already been to this pole.\nThis is pole #@p ($p). You need to find pole #@s ($s).'} {Message 'You've already been to this pole.\nThis is pole #@p ($p). You need to return to the center.'} {Break}" "Pole Past" 32 | DefineMacro 9 "@q Inc @q IfElse Lt @s 5 {Message 'You find a pole!\nThis is pole #@p ($p). Now return to the center!'} {Message 'You find a pole!\nThis is pole #@p ($p), the last pole! Now return to the center once more to win!'}" "Pole Present" 33 | DefineMacro 10 "IfElse Lte Sub @p @s 1 {Message 'You need to find another pole first before you can visit this one.\nThis is pole #@p ($p). You need to first find pole #@s ($s).'} {@r Dec @p Message 'You need to find other poles first before you can visit this one.\nThis is pole #@p ($p). You need to first find poles #@s ($s) though #@r ($r).'}" "Pole Future" 34 | DefineMacro 11 "@r GetC Sub 178 @x @y For (p) 1 5 {If Equ @r Var Mul @p 3 'Break'} IfElse And @q 1 {@s Div Inc @q 2 Message 'This is pole #@p for the other tribe.\nYou need to find pole #@s ($s) for your tribe.'} {Message 'You don't need to find a pole now.\nThis is pole #@p for the other tribe. You need to return to the center.'}" "Pole Other" 35 | DefineMacro 12 "IfElse Neq @p @s {Message 'You don't need to find a pole now.\nThis is pole #@p ($p). You need to return to the center after having reached pole #@s ($s).'} {Message 'You don't need to find a pole now.\nThis is pole #@p ($p). You need to return to the center after having reached this pole.'}" "Pole No" 36 | DefineMacro 13 "If Gt @q 10 {nViewHeight nWallHeight @z True Break} If And @q 1 {Message 'You don't need to be at the center now. You need to go find pole #@s ($s).' Break} @q Inc @q If Gt @q 10 {Macro15 Break} @s Inc @s Message 'You've reached the center! Now go find pole #@s ($s).'" "Center" 37 | DefineMacro 14 "If Gt @q 10 {@z True Break} Message 'Jeff Probst says: "Hey, you can't leave the Maze! You haven't finished it yet."'" "Exit" 38 | DefineMacro 15 "If Lte @q 10 {Break} fPauseTimer True @z Timer @x Div @z 60 @y Mod @z 60 Message 'Congratulations, you've found all the poles and returned to the center! :-) You solved it in @x minutes, @y seconds.\n\nYour tribe wins immunity, and Jeff Probst hands you the coveted immunity idol. You can't help but feel sorry for the other tribe as they try to decide who to vote off the island in Tribal Council. With your new leadership position, you're able to form an alliance that has a good chance of making it to the final four!' nViewHeight nWallHeight @z True" "Win Game" 39 | 40 | DefineMacro 16 "fRedrawWhenBitmapEdited False @a 30 @b 93 @d 111 @e 167 @g 117 @h 53 @j 133 @k 128 @m 57 @n 27" "Draw Start" 41 | DefineMacro 17 "For (r) 0 4 {@s Rnd 0 4 SwapVar Inc Mul @r 3 Inc Mul @s 3 SwapVar Add Mul @r 3 2 Add Mul @s 3 2} For (r) 0 4 {If Rnd 0 1 'SetVar Inc Mul @r 3 Sub 177 Var Inc Mul @r 3'}" "Random Poles" 42 | DefineMacro 18 "fShowColorBitmap False TempDelete \ Del Turtle 'S1BM82,0R14' k @r 1 @s 1 DoCount 5 {@x Var @r @y Var Inc @r kWall Var Add @r 2 nX @x nY @y nX2 Inc @x nY2 Inc @y 2ndBlock SwapTexture -1 0 @z Add 5 @s Macro20 SwapTexture -1 0 @x Sub 177 @x nX @x nX2 Inc @x kWall DkGray 2ndBlock SwapTexture -1 0 Macro20 SwapTexture -1 0 @r Add @r 3 @s Inc @s} k - k kWall White" "Draw Poles" 43 | DefineMacro 19 "nX 89 nY 69 nZ 0 nDir 0 g cg @q 1 fRedrawWhenBitmapEdited True fShowColorBitmap True n Macro1 fPauseTimer False ct" "Draw End" 44 | DefineMacro 20 "SetC @x @y NWSE @z @s @z @s SetC Inc @x @y NWSE @s @z @s @z SetC @x Inc @y NWSE @s @z @s @z SetC Inc @x Inc @y NWSE @z @s @z @s" "Texture Pole" 45 | 46 | fRedrawWhenBitmapEdited False EmbedDB 47 | DB 48 | 90 180 1 49 | 50 | `_ 51 | !"Y 52 | a(Q 53 | b0 54 | cY 55 | c( 56 | dQ 57 | d/ 58 | d"A 59 | e9 60 | e' 61 | e"A 62 | f9 63 | !0Yc' 64 | !)(Ab"A 65 | !)!=c1 66 | !)!$Ab- 67 | !)a=b# 68 | !)a$b" 69 | !)bQbQ 70 | !)b-b) 71 | !)b$b% 72 | !)cQa# 73 | !)c-a"A 74 | !)c$b1 75 | !)a1aAa) 76 | !)a1!"b% 77 | !)aA9"b# 78 | !)aA9#b" 79 | !)aQ!#cA 80 | !)a-!%cA 81 | !)a$!)c1 82 | !)bQ)c) 83 | !)b-1c% 84 | !)b$1c# 85 | !)cAaA!# 86 | !)e"1!" 87 | !0e#)aA 88 | !)]d%%a1 89 | !)$Ac)%a1 90 | !)!9c1#a) 91 | !)!'cA"a% 92 | !)!"Aa"aA!% 93 | !)a9a#a1!# 94 | !)a'a%a)!# 95 | !)a"a)a)!" 96 | !)bA!1a%!" 97 | !)b1!Aa#aA 98 | !)b-"eA 99 | !)b##e1 100 | !)b"%e1 101 | !)!"aIe) 102 | !)!#a1e) 103 | !)!#$!AaAb% 104 | !)!%$"a$1b% 105 | !)!%!#a%1b# 106 | !)!$!%a))b' 107 | !)aQ)aQ)b[ 108 | !)a)1!"!%a$" 109 | !)a'A!'!%a=" 110 | !)a"a)!#!"A!A 111 | !)dQ!#!'aA 112 | !/c"a"!YaA 113 | !"Ab'a"$b1 114 | a1b)bMb1 115 | a-bQbQb1 116 | a#a"g) 117 | a"a#g) 118 | bQ!#g) 119 | b)!"a1d) 120 | b%aA!1d% 121 | b%aA!)d% 122 | b#a1!)d% 123 | b"a1!)d% 124 | cA!)!%d% 125 | cAb%b/!# 126 | c1b%a0S!# 127 | c)b%!0Q#!# 128 | c)b#0Q!#!# 129 | c%b0Qa#!" 130 | c%a(Qb#!" 131 | c%!(Yc#!" 132 | c#$_d"!" 133 | c$]#d"!" 134 | c#!#d"!" 135 | | 136 | ]b#!#d"!" 137 | ]b"!"d"!" 138 | | 139 | ]b"!"!"n!"!" 140 | ]b"!"!"!"!"!" 141 | | 142 | ]b#!#!"!"!"!" 143 | c#!#!"$"!"!" 144 | | 145 | c#!#!#b"!" 146 | c#"S!#b"!" 147 | c#!/!#b#!" 148 | c%b#b#!" 149 | | 150 | c'b$Qa#!" 151 | c*Ab0Q!#!# 152 | c)9c0Q#!# 153 | c1'd0S!# 154 | cA"Ad/!# 155 | cA!9f% 156 | b"a1f% 157 | b#a1f% 158 | b%aAf% 159 | b%!"g) 160 | b)!"a9d) 161 | bQ!#a(d) 162 | a"a%bQc) 163 | a#e/c1 164 | a/e"Ab1 165 | a2f=b1 166 | !"Bf$b1 167 | !/!AfQaA 168 | !Q!1f/aA 169 | !A!1"a)b"A" 170 | !A!)!A!7c=" 171 | !A!%!1!Bc$" 172 | !A!%!)"!Qc[ 173 | !A!#!%#!)c' 174 | !1!"!##!'c% 175 | !1!"!"%!"c% 176 | !1aA!IaQb) 177 | !1%!A!1a-b) 178 | !1%!1!)-!#b1 179 | !)#!)!%-!"Aa1 180 | !)#!)!#b1aA 181 | A)#!%!"b-aA 182 | A)"!#aA1!#!" 183 | A)"!#a1A!%!" 184 | A%!A"a)A!)!# 185 | A%!A!A!&a1!# 186 | A%!1!A!#a1!% 187 | A%!1!1cA!% 188 | A%!1!)b"a) 189 | A#!)!)b#a) 190 | A#!)!%b%a1 191 | A#!%!#b)a1 192 | A#!%!#b)aA 193 | Aa#!"b1!" 194 | Aa#aAaA!# 195 | Aa#aA!"a# 196 | Aa"a1!#a% 197 | Aa"a)!-a) 198 | AbA!)!1a1 199 | AbA!%!AaA 200 | Aa"Q!#"bA 201 | Aa/a##a" 202 | A!"Qa"-a# 203 | A!/b"1a% 204 | A@QcAa) 205 | `Ag1 206 | h"A 207 | h# 208 | h% 209 | h) 210 | hQ 211 | c$b" 212 | c>b# 213 | b$AAa- 214 | b=!Aa1 215 | a$A!A!"A 216 | a-a1!' 217 | A!)$!1!9 218 | A!)$!)"A 219 | A!%a)' 220 | A!%a)9 221 | Ac&A 222 | Ac/ 223 | AcQ 224 | Ab( 225 | AbY 226 | Aa0 227 | A!(Q 228 | A"Y 229 | `_ 230 | 231 | = Size 89 0 1 0 _ FlipHorizontal _ TempOr 232 | ResetProgram nOnMoveIntoWall 6 nAfterRedrawInside 7 233 | WindowTitle "- Survivor Maze Game 2" True nHorizontalScroll 8 nVerticalScroll 8 fHideMenu True fHideScrollbars True 234 | nRepeatDelayInMsec 25 kBorder Black kWall White kDot White kSky Cyan kGround Light Brown kMountain DkGreen kCloud White 235 | f3D False fShowDot True fWallsImpassable True fNoCornerHopping False fMoveByTwo False fDoDragOnTemp True nEdgeBehavior 0 nTextureWall 0 236 | nInside 4 fNarrowWalls False fCompass True fCellLocation False fSealedEntrances False fMountains True nPeakHeight 25 nCloudCount 8 fSunAndMoon True fStars False nMotionVelocity 100 nRotationVelocity 5 nUpDownVelocity 32 nUpDownOffset 0 nSemitransparentWalls 3 nCellSize 160 nWallHeight 1500 nStepHeight 750 rLightFactor 30 nClippingPlane 200 nFogDistance 0 237 | Quo Del CopyTexture -1 0 Quo @w Light Blend Brown LtGray @v Dark Blend Brown LtGray Replace White @w 0 @a Red @b Orange @c Yellow @d Green @e Cyan @f Blue @g Purple For (z) 0 48 {@x Mod @z 7 @y Div @z 7 SetC Add 86 @x Add 86 @y Var Inc Abs Sub 6 Add @x @y 7} 238 | @c Red @f Yellow @i Green @l Blue @o Purple SetStrings 1 10 ",Red,Yellow,Green,Blue,Purple,T_1_,T_2_,T_3_,T_4_,T_5_" 239 | k = Turtle "T1" For (r) 1 5 {Size 72 96 0 1 Del Turtle "S12BM11,11" @z Add 5 @r Turtle $z Thicken2 12 Zoom 1 3 0 2 cDel \ Size 36 288 0 0 CopyMask -1 @r | Size -36 0 1 0 CopyMask -1 Add 5 @r} fNoCornerHopping True + 240 | Macro3 241 | -------------------------------------------------------------------------------- /color.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Daedalus (Version 3.5) File: color.h 3 | ** By Walter D. Pullen, Astara@msn.com, http://www.astrolog.org/labyrnth.htm 4 | ** 5 | ** IMPORTANT NOTICE: Daedalus and all Maze generation and general 6 | ** graphics routines used in this program are Copyright (C) 1998-2024 by 7 | ** Walter D. Pullen. Permission is granted to freely use, modify, and 8 | ** distribute these routines provided these credits and notices remain 9 | ** unmodified with any altered or distributed versions of the program. 10 | ** The user does have all rights to Mazes and other graphic output 11 | ** they make in Daedalus, like a novel created in a word processor. 12 | ** 13 | ** More formally: This program is free software; you can redistribute it 14 | ** and/or modify it under the terms of the GNU General Public License as 15 | ** published by the Free Software Foundation; either version 2 of the 16 | ** License, or (at your option) any later version. This program is 17 | ** distributed in the hope that it will be useful and inspiring, but 18 | ** WITHOUT ANY WARRANTY; without even the implied warranty of 19 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 20 | ** General Public License for more details, a copy of which is in the 21 | ** LICENSE.HTM included with Daedalus, and at http://www.gnu.org 22 | ** 23 | ** This file contains definitions for general graphics routines, that operate 24 | ** on a color bitmap, unrelated to Mazes. 25 | ** 26 | ** Old last code change: 6/29/1990. 27 | ** Last code change: 10/30/2024. 28 | */ 29 | 30 | /* 31 | ****************************************************************************** 32 | ** Constants 33 | ****************************************************************************** 34 | */ 35 | 36 | #define xColmap ((lHighest - 3) / 3) 37 | #define yColmap lHighest 38 | #define cColorMain 16 39 | #define cColor 29 40 | 41 | #define kvBlack Rgb( 0, 0, 0) 42 | #define kvMaroon Rgb(127, 0, 0) 43 | #define kvDkGreen Rgb( 0, 127, 0) 44 | #define kvMaize Rgb(127, 127, 0) 45 | #define kvDkBlue Rgb( 0, 0, 127) 46 | #define kvPurple Rgb(127, 0, 127) 47 | #define kvDkCyan Rgb( 0, 127, 127) 48 | #define kvLtGray Rgb(191, 191, 191) 49 | #define kvGray Rgb(127, 127, 127) 50 | #define kvRed Rgb(255, 0, 0) 51 | #define kvGreen Rgb( 0, 255, 0) 52 | #define kvYellow Rgb(255, 255, 0) 53 | #define kvBlue Rgb( 0, 0, 255) 54 | #define kvMagenta Rgb(255, 0, 255) 55 | #define kvCyan Rgb( 0, 255, 255) 56 | #define kvWhite Rgb(255, 255, 255) 57 | #define kvDkGray Rgb( 63, 63, 63) 58 | #define kvOrange Rgb(255, 127, 0) 59 | #define kvPink Rgb(255, 127, 127) 60 | #define kvBrown Rgb(127, 63, 0) 61 | 62 | #define nHueMax 3600 63 | #define nHueHalf 1800 64 | #define nHue13 1200 65 | #define nHue23 2400 66 | #define nHue16 600 67 | #define rHueMax 3600.0 68 | 69 | enum _colorreplace { 70 | crpRing = 1, 71 | crpSpoke = 2, 72 | crpFade = 3, 73 | crpY = 4, 74 | crpX = 5, 75 | crpDiagUL = 6, 76 | crpDiagUR = 7, 77 | crpSquare = 8, 78 | crpDiamond = 9, 79 | crpSpiral = 10, 80 | crpRing2 = 11, 81 | crpRings = 12, 82 | crpSpoke2 = 13, 83 | crpRainbow = 14, 84 | crpRandom = 15, 85 | crpRandom2 = 16, 86 | crpUnknown = 17, 87 | }; 88 | 89 | 90 | /* 91 | ****************************************************************************** 92 | ** Macros 93 | ****************************************************************************** 94 | */ 95 | 96 | #define cbPixelC 3 97 | #define CbColmapRow(x) ((x)*cbPixelC + 3 & ~3) 98 | #define CbColmap(x, y) LMul(y, CbColmapRow(x)) 99 | 100 | #define cTexture 64 101 | #define NWSE(n, w, s, e) ((n) | (w) << 6 | (long)(s) << 12 | (long)(e) << 18) 102 | #define UD(u, d) ((u) | (d) << 12) 103 | #define UdU(l) ((int)((dword)(l) & 4095)) 104 | #define UdD(l) ((int)((dword)(l) >> 12)) 105 | #define ITextureWall(kv, d) ((int)(((kv) >> ((d) * 6)) & (cTexture-1))) 106 | #define ITextureWall2(kv, d) ((int)(((kv) >> (FOdd(d) * 12)) & 4095)) 107 | #define ITextureWall3(kv, d) ((int)(((kv) >> (((d) > 1) * 12)) & 4095)) 108 | #define GetT(c, x, y, d) ITextureWall((c).Get(x, y), d) 109 | #define SetT(c, x, y, d, t) ((c).Get(x, y) & \ 110 | ~((KV)(cTexture-1) << ((d) * 6)) | ((KV)(t) << ((d) * 6))) 111 | #define SetU(c, x, y, f, t) ((c).Get(x, y) & \ 112 | ~((KV)4095 << ((f) * 12)) | ((KV)(t) << ((f) * 12))) 113 | 114 | 115 | /* 116 | ****************************************************************************** 117 | ** Types 118 | ****************************************************************************** 119 | */ 120 | 121 | typedef struct _colorsettings { 122 | // Color replace settings 123 | 124 | flag fRainbowBlend; 125 | int nRainbowStart; 126 | int nRainbowDistance; 127 | KV kvBlend1; 128 | KV kvBlend2; 129 | int nReplacePattern; 130 | 131 | // Macro accessible only settings 132 | 133 | flag fGraphNumber; 134 | long lGrayscale; 135 | flag fMandelbrot; 136 | } CS; 137 | 138 | extern CONST KV rgkv[cColor]; 139 | extern CONST char *rgszColor[cColor]; 140 | extern CS cs; 141 | 142 | class CCol : virtual public CMap // Color bitmap 143 | { 144 | public: 145 | INLINE long _Ib(int x, int y) CONST 146 | { return y*(m_clRow << 2) + (x * cbPixelC); } 147 | INLINE byte *_Pb(long i) CONST 148 | { return &m_rgb[i]; } 149 | INLINE byte *_Pb(int x, int y) CONST 150 | { return &m_rgb[_Ib(x, y)]; } 151 | INLINE KV _Get(CONST byte *pb) CONST 152 | { return (*pb << 16) | (*(pb+1) << 8) | *(pb+2); } 153 | INLINE KV _Get(int x, int y) CONST 154 | { return _Get(_Pb(x, y)); } 155 | INLINE void _Get(CONST byte *pb, int *r, int *g, int *b) CONST 156 | { *b = *pb; *g = *(pb+1); *r = *(pb+2); } 157 | INLINE void _Set(byte *pb, int r, int g, int b) 158 | { *pb = b; *(pb+1) = g; *(pb+2) = r; } 159 | 160 | INLINE flag FLegalFill(int x, int y, KV kv) CONST 161 | { return FLegal(x, y) && Get(x, y) == kv; } 162 | INLINE void BlockPut(CCol &c1, int x, int y, int nOp) 163 | { BlockMove(c1, 0, 0, c1.m_x-1, c1.m_y-1, x, y, nOp); } 164 | INLINE void ColmapReplaceSimple(KV kvFrom, KV kvTo) 165 | { ColmapReplace(kvFrom, kvTo, 0, 0, 0, 0); } 166 | INLINE void ColmapReplacePatternSimple(KV kvFrom, int nMode) 167 | { ColmapReplacePattern(kvFrom, nMode, 0, 0, 0, 0); } 168 | 169 | // Core methods each bitmap type implements 170 | virtual CMap *Create() OVERRIDE 171 | { CCol *c; c = new CCol; if (c == NULL) return NULL; return (CMap *)c; } 172 | virtual void Destroy() OVERRIDE 173 | { delete this; }; 174 | virtual void Set0(int x, int y) OVERRIDE 175 | { Set(x, y, kvBlack); } 176 | virtual void Set1(int x, int y) OVERRIDE 177 | { Set(x, y, kvWhite); } 178 | 179 | virtual flag FAllocate(int, int, CONST CMap *) OVERRIDE; 180 | 181 | virtual KV Get(int, int) CONST OVERRIDE; 182 | virtual void Set(int, int, KV) OVERRIDE; 183 | virtual void Inv(int, int) OVERRIDE; 184 | virtual void LineX(int, int, int, KV) OVERRIDE; 185 | virtual void LineY(int, int, int, KV) OVERRIDE; 186 | virtual void Line(int, int, int, int, KV) OVERRIDE; 187 | virtual flag FTriangle(int, int, int, int, int, int, KV, int) OVERRIDE; 188 | virtual flag FQuadrilateral(int, int, int, int, int, int, int, int, 189 | KV, int) OVERRIDE; 190 | virtual void Block(int, int, int, int, KV) OVERRIDE; 191 | virtual void BlockMove(CONST CMap &, int, int, int, int, int, int) OVERRIDE; 192 | 193 | virtual void BitmapSet(KV) OVERRIDE; 194 | virtual long BitmapCount() CONST OVERRIDE; 195 | virtual void BitmapFlipX() OVERRIDE; 196 | virtual flag FBitmapSizeSet(int, int) OVERRIDE; 197 | virtual flag FBitmapZoomTo(int xnew, int ynew, flag fPreserve) OVERRIDE; 198 | virtual flag FBitmapBias(int, int, int, int) OVERRIDE; 199 | virtual flag FBitmapAccentBoundary() OVERRIDE; 200 | 201 | // Extra methods specific to color bitmaps 202 | flag FColmapGetFromBitmap(CONST CMon &b, KV kv0, KV kv1); 203 | flag FColmapAntialias(CONST CMon &, KV, KV, int); 204 | void ColmapPalette(CONST CCol &); 205 | int ColmapGraphDistance(CONST CMon &, CONST CMon &, KV, KV, int, int, flag); 206 | long ColmapGraphDistance2(CONST CMon &, KV, KV, flag); 207 | 208 | void ColmapGrayscale(); 209 | void ColmapBrightness(int, real, int); 210 | void ColmapReplace(KV, KV, int, int, int, int); 211 | void ColmapReplacePattern(KV, int, int, int, int, int); 212 | void ColmapExchange(KV, KV); 213 | void ColmapOrAndKv(KV, int); 214 | void ColmapOrAnd(CONST CCol &, int); 215 | void ColmapAlpha(CONST CCol &, CONST CCol &); 216 | void BlockMove(CONST CCol &, int, int, int, int, int, int, int); 217 | flag FColmapPutToBitmap(CMon &, int) CONST; 218 | void ColmapOrAndFromBitmap(CONST CMon &, KV, KV, int); 219 | flag FColmapBlendFromBitmap(CONST CMon *, CONST CMon *, CONST CMon *); 220 | void ColmapBlendBitmaps(CONST CCol &); 221 | 222 | flag FColmapBlur(flag); 223 | void ColmapContrast(flag); 224 | flag FColmapTransform(int, int); 225 | 226 | long ColmapFind(int) CONST; 227 | flag FColmapAccentContrast(flag); 228 | void DrawSeen(CONST CMon &, CONST CCol &, int, int, int, flag); 229 | flag FColmapStereogram(CONST CMon &, CONST CCol &, int, int); 230 | long ColmapLifeGenerate(CCol &, flag); 231 | long Evolution(CCol &, int, flag, flag, flag); 232 | void Mandelbrot(real, real, real, real, int, flag); 233 | 234 | flag FReadColmapCore(FILE *, int, int, int, int); 235 | void WriteColmap(FILE *) CONST; 236 | flag FReadColmapTarga(FILE *); 237 | void WriteColmapTarga(FILE *) CONST; 238 | flag FReadColmapPaint(FILE *); 239 | flag FReadDaedalusBitmapCore(FILE *, int, int); 240 | void WriteDaedalusBitmap(FILE *, flag) CONST; 241 | void WriteTextColmap(FILE *, flag) CONST; 242 | 243 | flag FFill(int, int, KV, KV, flag); 244 | void ColmapStretchToEdge(CONST CCol &, int, int, int, int, int, int, 245 | int, int); 246 | }; 247 | 248 | 249 | /* 250 | ****************************************************************************** 251 | ** Color Primitives 252 | ****************************************************************************** 253 | */ 254 | 255 | // Function hooks implemented by client of module 256 | extern long ParseExpression(char *); 257 | extern KV KvDialog(void); 258 | 259 | // Functions implemented locally 260 | extern KV KvShade(KV, real); 261 | extern KV KvBlend(KV, KV); 262 | extern KV KvBlendR(KV, KV, real); 263 | extern KV KvBlendN(KV, KV, int, int); 264 | extern KV KvDiff(KV, KV); 265 | extern KV Hue(int); 266 | #define HueD(d) Hue((int)((d) * (nHueMax / nDegMax))) 267 | #define HueR(r) Hue((int)((r) * (rHueMax / rDegMax))) 268 | #define kvRandom Rgb(Rnd(0, 255), Rnd(0, 255), Rnd(0, 255)) 269 | #define kvRandomRainbow Hue(Rnd(0, nHueMax-1)) 270 | extern KV Hsl(int, int, int); 271 | 272 | 273 | /* 274 | ****************************************************************************** 275 | ** Color Bitmap IO Routines 276 | ****************************************************************************** 277 | */ 278 | 279 | extern int GetEditColor(char *); 280 | extern void ConvertKvToSz(KV, char *, int); 281 | extern KV ParseColor(char *, flag); 282 | extern KV ReadColor(FILE *); 283 | 284 | /* color.h */ 285 | -------------------------------------------------------------------------------- /gigamaze.ds: -------------------------------------------------------------------------------- 1 | DS 2 | // Giga Mazes - A script file for Daedalus 3.5 3 | // By Walter D. Pullen, Astara@msn.com, http://www.astrolog.org/labyrnth.htm 4 | 5 | // Variable usage: 6 | // a-b,v: Coordinates of display upper left corner in whole Maze 7 | // c-d,w: Sector position of dot in display 8 | // e: Horizontal position of entrance in whole Maze 9 | // f: Passages per lowest level submaze 10 | // g: Horizontal position of goal/exit in whole Maze 11 | // h-j: Saved coordinates of dot in whole Maze 12 | // k: Nesting level of each sector 13 | // l: Nesting level of whole Maze 14 | // m-o: Coordinates of dot in whole Maze 15 | // p: Passages per sector 16 | // q: Passages in whole Maze 17 | // r: Random seed of Maze 18 | // s-u: Sector position of display middle in whole Maze 19 | // v-w: See above 20 | // x-z: Temporary coordinates and event return values 21 | 22 | If Gte Version 3300 {Break} Message 'This script requires Daedalus 3.3 or later to run.' Break 23 | DefineConst "1 FHelp FNew FNew1 FNew2 FNew3 FNew4 FNew5 FNew6 FSky FType FLoc F3D VMoved VFollow VInside Update Tele Jump2 Jump4 Jump6 Jump8 Jump1 Jump3 Jump7 Jump9 Tele1 Tele3 Tele7 Tele9 Tele2 Tele4 Tele6 Tele8 Tele5 Tele0 TeleG SetG" 24 | If @z {Message 'Initialization failed!' Halt} 25 | 26 | EmbedMacro %FHelp "Help Text" 27 | $0 '' 28 | If And Equ nFractalType 4 Not f3D 29 | {@z Div @q 2 SetString 0 ', @z circuits'} 30 | IfElse f3D 31 | {@x Div Mul Pow Div @q 100000000 3 3266 1} 32 | {@x Div Mul Pow Div @q 10000000 2 4553 10000} 33 | @z Add 3 f3D Message $z 34 | 35 | EmbedMacro %FNew "New Maze" 36 | fRedrawWhenBitmapEdited False 37 | nFractalX @f nFractalY @f nNestingLevel @l @r Rnd 0 1999999999 38 | kInsideWall Hue Rnd 0 359 39 | @p Pow @f @k @q Pow @f @l 40 | If Or And f3D Or Equ nFractalType 3 Equ nFractalType 4 41 | And Equ nFractalType 5 Neq And @f Dec @f 0 {nFractalType 2} 42 | If Equ nFractalType 3 {@q Or Dec @q 1} 43 | If Equ nFractalType 4 {@q Dec And @q Inv 7} 44 | IfElse f3D 45 | {FractalPart3 -2 -2 -2 @k @r} 46 | {FractalPart -4 -4 @k @r} 47 | @e @x @g @y *Tele8 48 | *FHelp ct 49 | 50 | DefineMacro %FNew1 "@k 2 @f 10 @l 9 *FNew" "Size #1" 51 | DefineMacro %FNew2 "@k 6 @f 2 @l 30 *FNew" "Size #2" 52 | DefineMacro %FNew3 "@k 4 @f 3 @l 19 *FNew" "Size #3" 53 | DefineMacro %FNew4 "@k 2 @f 7 @l 11 *FNew" "Size #4" 54 | DefineMacro %FNew5 "@k 1 @f 73 @l 5 *FNew" "Size #5" 55 | DefineMacro %FNew6 "@k 1 @f 215 @l 4 *FNew" "Size #6" 56 | 57 | EmbedMacro %FSky "Change ceiling/sky" 58 | fRedrawWhenBitmapEdited False 59 | If Equ nInside 0 {i} 60 | SwitchSgn Dec Add fSunAndMoon fStars 61 | {fSunAndMoon True fStars True kSky Black kCloud DkGray kCloud2 Dark kCloud kGround2 Black k3DCeiling2 kSky} 62 | {fMountains False fSunAndMoon False fStars False kSky LtGray kCloud kSky kCloud2 -1 kGround2 kGround k3DCeiling kSky k3DCeiling2 -1} 63 | {fMountains True fStars False kSky Cyan kCloud White kCloud2 Light Light LtGray kGround2 ?: f3D White Blend kGround kMountain k3DCeiling kGround k3DCeiling2 White} 64 | kFog kGround2 65 | fRedrawWhenBitmapEdited True Spc 66 | @z True 67 | 68 | EmbedMacro %FType "Set Algorithm" 69 | @z nFractalType SetString 0 '@z' 70 | GetString '0:Nest 1:Binary 2:Division 3:Unicursal 4:Classic 5:Hilbert' 0 71 | If @z {Return} 72 | @z Num $0 If Or Lt @z 0 Gt @z 5 {Message 'Bad algorithm!\nNumber must be between 0-5.' Return} 73 | nFractalType @z 74 | If And f3D Or Equ @z 3 Equ @z 4 {f3D False} 75 | IfElse Equ @z 5 {*FNew2} {*FNew} 76 | 77 | EmbedMacro %FLoc "Set Coordinates" 78 | SetString 0 '@m' SetString 1 '@n' SetString 2 '@o' 79 | IfElse f3D { 80 | GetString3 'Enter X Coordinate:' 'Enter Y Coordinate:' 'Enter Z Coordinate:' 0 81 | } { 82 | GetString2 'Enter Horizontal X Coordinate:' 'Enter Vertical Y Coordinate:' 0 83 | } 84 | If @z {Break} 85 | @m Num $0 @n Num $1 @o Num $2 86 | *Tele 87 | 88 | EmbedMacro %F3D "Toggle Dimension" 89 | fRedrawWhenBitmapEdited False 90 | f3D Not f3D 91 | If f3D {nViewHeight 0} 92 | *FNew 93 | 94 | EmbedMacro %VMoved "After Move" 95 | @z False 96 | IfElse f3D { 97 | @w False 98 | If Lt nX Div Mul @p 2 3 (fRedrawWhenBitmapEdited False @s Dec @s nX Add nX << @p 1 @w True) 99 | If Gt nX Div Mul @p 10 3 (fRedrawWhenBitmapEdited False @s Inc @s nX Sub nX << @p 1 @w True) 100 | If Lt nY Div Mul @p 2 3 (fRedrawWhenBitmapEdited False @t Dec @t nY Add nY << @p 1 @w True) 101 | If Gt nY Div Mul @p 10 3 (fRedrawWhenBitmapEdited False @t Inc @t nY Sub nY << @p 1 @w True) 102 | If Lt nZ Div Mul @p 2 3 (fRedrawWhenBitmapEdited False @u Dec @u nZ Add nZ << @p 1 @w True) 103 | If Gt nZ Div Mul @p 10 3 (fRedrawWhenBitmapEdited False @u Inc @u nZ Sub nZ << @p 1 @w True) 104 | If @w (*Update) 105 | } { 106 | @c Div nX @p @d Div nY @p @w Div nZ @p 107 | If Or Or Or Lt @c 2 Gte @c 6 Or Lt @d 2 Gte @d 6 Or Lt @w 2 Gte @w 6 ( 108 | fRedrawWhenBitmapEdited False 109 | @c Sub Dec >> @c 1 Not Odd @c 110 | @d Sub Dec >> @d 1 Not Odd @d 111 | @w Sub Dec >> @w 1 Not Odd @w 112 | nX Sub nX Mul @c << @p 1 113 | nY Sub nY Mul @d << @p 1 114 | nZ Sub nZ Mul @w << @p 1 115 | @s Add @s @c 116 | @t Add @t @d 117 | @u Add @u @w 118 | *Update 119 | ) 120 | } 121 | 122 | EmbedMacro %VFollow "On Follow" 123 | *VMoved If @z {Return} 124 | IfElse f3D { 125 | @z Add Add Add Add Add Get3 nX Dec nY nZ Get3 Dec nX nY nZ Get3 nX Inc nY nZ Get3 Inc nX nY nZ Get3 nX nY Dec nZ Get3 nX nY Inc nZ 126 | @z Lt @z 4 127 | } { 128 | @z Add Add Add Get nX Dec nY Get Dec nX nY Get nX Inc nY Get Inc nX nY 129 | @z Lt @z 2 130 | } 131 | 132 | EmbedMacro %VInside "Inside Text" 133 | If Not fCellLocation {Return} 134 | @m Add @a >> nX 1 135 | @n Add @b >> nY 1 136 | @o Add @v >> nZ 1 137 | IfElse f3D { 138 | MessageInside 'x=@m, y=@n, z=@o' -2 139 | } { 140 | MessageInside 'x=@m, y=@n' -2 141 | } 142 | 143 | EmbedMacro %Update "Update Maze" 144 | ColorDelete TempDelete ExtraDelete 145 | IfElse f3D { 146 | FractalPart3 @s @t @u @k @r 147 | @a Mul Dec @s @p 148 | @b Mul Dec @t @p 149 | @v Mul Dec @u @p 150 | } { 151 | FractalPart @s @t @k @r 152 | @a Mul Dec @s @p 153 | @b Mul Dec @t @p 154 | @v Mul Dec @u @p 155 | } 156 | fRedrawWhenBitmapEdited True n 157 | @z True 158 | 159 | EmbedMacro %Tele "Teleport" 160 | fRedrawWhenBitmapEdited False 161 | nDir @z 162 | @s Div @m @p @t Div @n @p @u Div @o @p 163 | @x Mod @m @p @y Mod @n @p @z Mod @o @p 164 | IfElse f3D { 165 | If Gt @x >> @p 1 (@s Inc @s @x Sub @x @p) 166 | If Gt @y >> @p 1 (@t Inc @t @y Sub @y @p) 167 | If Gt @z >> @p 1 (@u Inc @u @z Sub @z @p) 168 | } { 169 | If Lt @x >> @p 1 (@s Dec @s @x Add @x @p) 170 | If Lt @y >> @p 1 (@t Dec @t @y Add @y @p) 171 | If Lt @z >> @p 1 (@u Dec @u @z Add @z @p) 172 | } 173 | nX Inc << Add @x @p 1 nY Inc << Add @y @p 1 nZ << Add @z @p 1 174 | nHorizontalOffset 0 nVerticalOffset 0 nDirectionOffset 0 175 | *Update 176 | 177 | DefineMacro %Jump2 "If nInside {@z 0 Break} @t Inc @t *Update" "Jump Down" 178 | DefineMacro %Jump4 "If nInside {@z 0 Break} @s Dec @s *Update" "Jump Left" 179 | DefineMacro %Jump6 "If nInside {@z 0 Break} @s Inc @s *Update" "Jump Right" 180 | DefineMacro %Jump8 "If nInside {@z 0 Break} @t Dec @t *Update" "Jump Up" 181 | DefineMacro %Jump1 "@s Dec @s @t Inc @t *Update" "Jump Down Left" 182 | DefineMacro %Jump3 "@s Inc @s @t Inc @t *Update" "Jump Down Right" 183 | DefineMacro %Jump7 "@s Dec @s @t Dec @t *Update" "Jump Up Left" 184 | DefineMacro %Jump9 "@s Inc @s @t Dec @t *Update" "Jump Up Right" 185 | DefineMacro %Tele1 "@m -1 @n @q @o Mul f3D Dec @q @z 0 *Tele" "Teleport LL Corner" 186 | DefineMacro %Tele3 "@m @q @n @q @o Mul f3D Dec @q @z 0 *Tele" "Teleport LR Corner" 187 | DefineMacro %Tele7 "@m -1 @n -1 @o 0 @z 2 *Tele" "Teleport UL Corner" 188 | DefineMacro %Tele9 "@m @q @n -1 @o 0 @z 2 *Tele" "Teleport UR Corner" 189 | DefineMacro %Tele2 "@m @g @n ?: Neq nFractalType 5 @q -1 @o Mul And f3D Neq nFractalType 5 Dec @q @z Mul 2 Equ nFractalType 5 *Tele" "Teleport Down" 190 | DefineMacro %Tele4 "@m -1 @z 3 *Tele" "Teleport Left" 191 | DefineMacro %Tele6 "@m @q @z 1 *Tele" "Teleport Right" 192 | DefineMacro %Tele8 "@m @e @n -1 @o 0 @z 2 *Tele" "Teleport Up" 193 | DefineMacro %Tele5 "@m >> @q 1 @n @m @o @m @z nDir *Tele" "Teleport Middle" 194 | DefineMacro %Tele0 "@m Rnd 0 Dec @q @n Rnd 0 Dec @q @o Rnd 0 Dec @q @z Rnd 0 3 *Tele" "Teleport Random" 195 | DefineMacro %TeleG "@m @h @n @i @o @j @z nDir *Tele" "Teleport 2nd" 196 | DefineMacro %SetG "@h @m @i @n @j @o @z True" "Set 2nd" 197 | 198 | $3 {Welcome to Giga Mazes!\n\nYou are in the largest Maze ever, measuring a billion passages on each side, containing over one quintillion cells! A life size version of this Maze (with 5 feet between cells) would cover the Earth's surface, @x times! This Maze is @q x @q passages (@f to the @lth power on a side$0).\n\nF1: Display this help text.\nF2: Create new Maze.\n\nF3: Create 1.00 billion x 1.00 billion passage Maze (10^9).\nF4: Create 1.07 billion x 1.07 billion passage Maze (2^30).\nF5: Create 1.16 billion x 1.16 billion passage Maze (3^19).\nF6: Create 1.98 billion x 1.98 billion passage Maze (7^11).\nF7: Create 2.07 billion x 2.07 billion passage Maze (73^5).\nF8: Create 2.14 billion x 2.14 billion passage Maze (215^4).\n\nF9: Switch sky/ceiling background.\nF10: Set Maze algorithm.\nF11: Change viewer coordinates.\nF12: Toggle between 2D and 3D Maze.\n\nPress "i" to toggle between inside and overhead views. Use commands on the Dot/Teleport submenu to visit different parts of the Maze.} 199 | 200 | $4 {Welcome to Giga Mazes!\n\nYou are in the largest 3D Maze ever, measuring a billion passages on each side, containing over one octillion cells! A life size version of this Maze (with 5 feet between cells) would fill the Earth's volume, @x times! This Maze is @q x @q x @q passages (@f to the @lth power on a side$0).\n\nF1: Display this help text.\nF2: Create new Maze.\n\nF3: Create 1.00 x 1.00 x 1.00 billion passage Maze (10^9).\nF4: Create 1.07 x 1.07 x 1.07 billion passage Maze (2^30).\nF5: Create 1.16 x 1.16 x 1.16 billion passage Maze (3^19).\nF6: Create 1.98 x 1.98 x 1.98 billion passage Maze (7^11).\nF7: Create 2.07 x 2.07 x 2.07 billion passage Maze (73^5).\nF8: Create 2.14 x 2.14 x 2.14 billion passage Maze (215^4).\n\nF9: Switch sky/ceiling background.\nF10: Set Maze algorithm.\nF11: Change viewer coordinates.\nF12: Toggle between 3D and 2D Maze.\n\nPress "i" to toggle between inside and overhead views. Use commands on the Dot/Teleport submenu to visit different parts of the Maze.} 201 | 202 | fRedrawWhenBitmapEdited False ResetProgram 203 | nAfterMoveToNewCell %VMoved 204 | nOnFollowToNewCell %VFollow 205 | nAfterRedrawInside %VInside 206 | OnCommand (F1) %FHelp 207 | OnCommand (F2) %FNew 208 | OnCommand (F3) %FNew1 209 | OnCommand (F4) %FNew2 210 | OnCommand (F5) %FNew3 211 | OnCommand (F6) %FNew4 212 | OnCommand (F7) %FNew5 213 | OnCommand (F8) %FNew6 214 | OnCommand (F9) %FSky 215 | OnCommand (F10) %FType 216 | OnCommand (F11) %FLoc 217 | OnCommand (F12) %F3D 218 | OnCommand (@) %Jump2 219 | OnCommand ($) %Jump4 220 | OnCommand (^) %Jump6 221 | OnCommand (*) %Jump8 222 | OnCommand (!) %Jump1 223 | OnCommand (#) %Jump3 224 | OnCommand (&) %Jump7 225 | OnCommand (() %Jump9 226 | OnCommand (c1) %Tele1 227 | OnCommand (c3) %Tele3 228 | OnCommand (c7) %Tele7 229 | OnCommand (c9) %Tele9 230 | OnCommand (c2) %Tele2 231 | OnCommand (c4) %Tele4 232 | OnCommand (c6) %Tele6 233 | OnCommand (c8) %Tele8 234 | OnCommand (c5) %Tele5 235 | OnCommand (c0) %Tele0 236 | OnCommand (cg) %TeleG 237 | OnCommand (g) %SetG 238 | WindowTitle "- Giga Mazes" True 239 | nHorizontalScroll 8 nVerticalScroll 8 240 | fHideMenu False fHideScrollbars True 241 | nRepeatDelayInMsec 25 242 | @h 0 @i 0 243 | kBorder Gray 244 | kPassage Black 245 | kWall White 246 | kDot Red 247 | kSky Black 248 | kCloud DkGray kCloud2 Dark kCloud 249 | kGround2 Black 250 | k3DCeiling2 Black 251 | fShowDot True 252 | fWallsImpassable True 253 | fMoveByTwo False 254 | fDoDragOnTemp True 255 | nEdgeBehavior 0 256 | nEntrancePositioning 1 257 | nInside 4 258 | fCompass True 259 | fCellLocation True 260 | fSealedEntrances False 261 | fMountains False 262 | fSunAndMoon True 263 | fStars True 264 | nMotionVelocity 10 nRotationVelocity 5 265 | fNarrowWalls True 266 | nCellSize 160 nNarrowCellSize 32 267 | nWallHeight 100 268 | nClippingPlane 200 269 | nFogDistance 1000 270 | fFogGround True 271 | fNoLocation True 272 | *FNew2 273 | -------------------------------------------------------------------------------- /survmaz5.ds: -------------------------------------------------------------------------------- 1 | DS 2 | // Survivor Maze game #5 - A script file for Daedalus 3.5 3 | // By Walter D. Pullen, Astara@msn.com, http://www.astrolog.org/labyrnth.htm 4 | 5 | // Variable usage: 6 | // a-j: Whether blocks #1 through #10 have been hit. 7 | // k-n: Player colors #1 through #4 (constant) 8 | // o: Color of back wall (constant) 9 | // p: Player color index 10 | // q: Next thing for player to find (ranges from 1-21) 11 | // u-w: Temporary variables 12 | // x-y: X and Y coordinates of player during events 13 | // z: Event return value 14 | 15 | // Bitmap usage: 16 | // -1: Mono = Where walls are, Color = Color of walls 17 | // -2: Mono = Where floor markings are, Color = Color of floor markings 18 | // -3: Color = Where blocks are 19 | // 0: Color = Texture mapping 20 | // 1: Mono = Where ceiling markings are, Color = Ceiling marking colors 21 | // 2: Mono = Where variable height walls are, Color = Wall heights 22 | // 3: Mono = Alternate Maze walls 23 | // 4: Mono = Alternate Maze floor markings 24 | // 5: Mono = Alternate Maze variable height walls 25 | // 6: Color = Alternate Maze texture mapping 26 | // 7: Mono = Initial texture for start (left), Color = Initial texture mapping 27 | // 8: Mono = Initial texture for start (right) 28 | // 9: Mono = Current texture for start (left) 29 | // 10: Mono = Current texture for start (right) 30 | // 11: Mono = Texture for blocks (unhit) 31 | // 12: Mono = Texture for blocks (hit) 32 | // 13-27: Mono = Textures for inner back walls (15 total) 33 | // 28-58: Mono = Textures for outer front walls (31 total) 34 | // 59-61: Mono = Textures for outer back walls (3 total) 35 | 36 | If Gte Version 2400 {Break} Message 'This script requires Daedalus 2.4 or later to run.' Break 37 | 38 | DefineMacro 1 {@x Inc @p @y Add @x 4 Message 'Welcome to Survivor!\n\nThis game simulates the Maze from the immunity challenge for the final four in "Survivor IX: Vanuatu". Your goal is to navigate the eight floor vertical Maze, finding and touching ten $x blocks in any order, and also touching the start outside the Maze after each block. $x was the color $y had. When outside the Maze a map of it, and the position of each found and unfound block, can be seen.\n\nF1: Display this help text.\nF2: Restart Maze.\nF3: Switch background between day and night.\n\nPress "u" or "d" to climb up or down to next level.\n\nJeff Probst says: "Survivors ready? Go!"'} "Help Text" 39 | DefineMacro 2 "fRedrawWhenBitmapEdited False CopyMask 7 9 CopyMask 8 10 CopyTexture 7 ?: f3D 0 6 SetVars 1 10 '0 0 0 0 0 0 0 0 0 0' @p Rnd 0 3 @q 1 nX 21 nY 7 nZ 16 nDir 0 g cg fShowColorBitmap True For (x) 0 31 {@y Sub Char $10 @x 48 If @y 'SetCA Add 28 @x 1 Sub Mul @y 3 2 Var Add 11 @p'} For (z) 9 12 {CopyTexture @z -1 Del Replace Black Var Add 11 @p 0 CopyTexture -1 @z} ColorDelete fRedrawWhenBitmapEdited True IfElse f3D {Macro12} {Spc} Macro1 fPauseTimer False ct" "Restart Maze" 40 | DefineMacro 3 "fRedrawWhenBitmapEdited False If Equ nInside 0 {i} IfElse fStars {Macro11} {fStars True nFogDistance 100 kSky Black k3DCeiling kSky kGround Dark kGround kMountain Dark DkGreen kMountain2 Dark Brown kCloud DkGray kCloud2 Dark kCloud} fRedrawWhenBitmapEdited True Spc" "Day And Night" 41 | 42 | DefineMacro 4 "If Not f3D {Macro9 @z False Break} @w Get3CE @x Dec @y @z If Or Gt @q 20 Not @w {@z False Break} If Not Odd @q {Message 'You don't need to find a block now.\nYou need to return to the start.' @z False Break} IfElse Var @w {Message 'You've already been to this block.\nYou need to find a block you haven't visited yet.'} {SetVar @w True @q Inc @q Set3X @x Dec @y @z 0 12 @w Div @q 2 Spc Message 'You find a block!\nThis is block #@w. Now return to the start!' @x Sub nX 7 @y Sub Char $10 @x 48 SetCA Add 28 @x 1 Sub Mul @y 3 2 Gray} @z False" "Wall Event" 43 | DefineMacro 5 "If Gt @q 20 {Break} IfElse Odd @q {@v Div Inc @q 2 MessageInside 'Seeking: Block #@v' -1} {MessageInside 'Seeking: Start' -1} If Not fCellLocation {Break} IfElse f3D {@v Sub 9 Div nZ 2} {@v 1} MessageInside 'Floor: @v' -2" "Inside Event" 44 | DefineMacro 6 "@u f3D If @u {If Not Get3T @x @y @z 'Macro12' @z False Break} If And Lte @q 20 Or Or Lt @x 1 Gt @x 43 Gt @y 17 {Message 'Jeff Probst says: "Hey, you can't leave the challenge area! You haven't finished the Maze yet."' @z True Break} @z False" "Before Move Event" 45 | DefineMacro 7 "If Not @u {If GetT @x @y 'Macro12'}" "After Move Event" 46 | DefineMacro 8 "@z Gt Add Add Add Get3 nX nY Dec nZ Get3 Dec nX nY nZ Get3 nX nY Inc nZ Get3 Inc nX nY nZ 2" "Follow Event" 47 | 48 | DefineMacro 9 "If Or Lt @y 7 Gt @q 20 {Break} If Odd @q {@w Div Inc @q 2 Message 'You don't need to be at the start now. You need to go find block #@w.' Break} fRedrawWhenBitmapEdited False @w Add 9 Gt @q 11 @z Div Mod Dec @q 10 2 SwapMask -1 @w @x nX @y nY nX Add 4 Mul @z 8 nY 4 ` nX @x nY @y SwapMask -1 @w fRedrawWhenBitmapEdited True @q Inc @q If Gt @q 20 'Spc Macro10 Break' @w Div Inc @q 2 Spc Message 'You've reached the start! Now go find block #@w.'" "Hit Start" 49 | DefineMacro 10 "fPauseTimer True @w Timer @x Div @w 60 @y Mod @w 60 Message 'Congratulations, you've found all the blocks and returned to the start! :-) You solved it in @x minutes, @y seconds.\n\nJeff gives you the immunity necklace, meaning you can't be voted off the island in Tribal Council. This win guarantees you a spot in the final three, and is a good lift to hopefully finish at the height of Survivor: Winning the million dollar prize!'" "Win Game" 50 | DefineMacro 11 "fStars False nFogDistance 0 kSky Cyan k3DCeiling kSky kGround Rgb 191 175 127 kMountain DkGreen kMountain2 Brown kCloud White kCloud2 -1" "Day Settings" 51 | DefineMacro 12 "fRedrawWhenBitmapEdited False IfElse f3D {nSkyMark -1 nWallVariable 5} {nSkyMark 1 nWallVariable 2} f3D Not f3D @z kInsideWall kInsideWall k3DWall k3DWall @z SwapMask -1 3 SwapMask -2 4 SwapTexture 0 6 fRedrawWhenBitmapEdited True n" "Swap World" 52 | 53 | fRedrawWhenBitmapEdited False ResetProgram WindowTitle "- Survivor Maze Game 5" True nHorizontalScroll 8 nVerticalScroll 8 fHideMenu True fHideScrollbars True nOnMoveIntoWall 4 nAfterRedrawInside 5 nOnMoveToNewCell 6 nAfterMoveToNewCell 7 nOnFollowToNewCell 8 54 | kPassage Black kWall White kInsideWall Blend Gray Brown k3DWall Gray fShowDot True fWallsImpassable True fNoCornerHopping True fDragIsErase False fDoDragOnTemp False nEdgeBehavior 0 Macro11 fCellLocation True fSealedEntrances False fMountains True nPeakHeight 30 nCloudCount 6 fSunAndMoon True fNarrowWalls True nInside 2 nCellSize 150 nNarrowCellSize 10 nWallHeight 100 nStepHeight 0 fSky3D True fNoLocation True nTextureWall 0 nWallVariable 5 55 | SetVars 11 4 "#0F0F0F Orange Yellow Red" SetStrings 1 8 ",Black,Orange,Yellow,Red,Scout,Twila,Chris,Eliza" @o Blend Red Maroon @p Var Add 11 Rnd 0 3 56 | 57 | // Block textures 58 | Size 41 12 0 1 nY 3 nY2 8 For (z) 0 4 {nX Add 3 Mul @z 8 nX2 Add nX 5 2ndBox} cDel CopyMask -1 7 FlipHorizontal CopyMask -1 8 Quo CopyTexture -1 9 CopyTexture -1 10 59 | Size 39 12 0 1 For (z) 0 3 {nX Add 3 Mul @z 9 nX2 Add nX 5 2ndBlock} cDel CopyMask -1 11 Del For (z) 0 3 {nX Add 3 Mul @z 9 nX2 Add nX 5 2ndBox} cDel CopyMask -1 12 Quo CopyTexture -1 11 CopyTexture -1 12 60 | 61 | // Wall textures 62 | EmbedDB 63 | DB 64 | 45 3 1 65 | 66 | 11111111 67 | 7S7T@\@Y 68 | !#31!#31 69 | 70 | cDel nY 0 nY2 2 SizeC 3 3 0 1 Replace Black @o 0 k For (z) 0 14 {nX Mul @z 3 nX2 Add nX 2 ag CopyMask -2 Add 13 @z CopyTexture -1 Add 13 @z} 71 | Size 3 30 0 1 sDel Turtle "C0BM0,28R2" CopyMask -1 60 sDel Turtle "BM0,28RU7" CopyMask -1 61 FlipHorizontal CopyMask -1 59 SizeC 3 30 0 1 Replace Black @o 0 For (z) 59 61 {CopyTexture -1 @z} 72 | 73 | // Maze data (inner) 74 | EmbedDB 75 | DB 76 | 45 162 24 77 | 78 | 79 | z{q{ 80 | 81 | z{q{ 82 | 83 | z{q{ 84 | 85 | z{q{ 86 | 87 | z{q{ 88 | 89 | z{q{ 90 | 91 | z{q{ 92 | 93 | z{q{ 94 | tab{ 95 | z{q{ 96 | 97 | z{q{ 98 | 99 | z{q{ 100 | 101 | z{q{ 102 | 103 | z{q{ 104 | 105 | z{q{ 106 | 107 | z{q{ 108 | 109 | z{q{ 110 | 111 | z{q{ 112 | 113 | z{q{ 114 | 115 | z{q{ 116 | 117 | z{q{ 118 | 119 | z{q{ 120 | 121 | z{q{ 122 | 123 | z{q{ 124 | 125 | z{q{ 126 | 127 | z{q{ 128 | 129 | z{q{ 130 | 131 | z{q{ 132 | 133 | z{q{ 134 | 135 | z{q{ 136 | 137 | z{q{ 138 | 139 | z{q{ 140 | 141 | z{q{ 142 | 143 | z{q{ 144 | 145 | z{q{ 146 | 147 | z{q{ 148 | 149 | z{q{ 150 | 151 | z{q{ 152 | 153 | z{q{ 154 | 155 | z{q{ 156 | 157 | z{q{ 158 | 159 | z{q{ 160 | 161 | z{q{ 162 | 163 | z{q{ 164 | 165 | z{q{ 166 | sa{{ba{{ 167 | z{q{ 168 | 169 | z{q{ 170 | 171 | z{q{ 172 | 173 | z{q{ 174 | 175 | z{q{ 176 | 177 | z{q{ 178 | 179 | z{q{ 180 | 181 | z{q{ 182 | 183 | z{q{ 184 | sa{{ba{{ 185 | z{q{ 186 | 187 | z{q{ 188 | qah{ 189 | z{q{ 190 | kat{ 191 | z{q{ 192 | iax{ 193 | z{q{ 194 | gaz{a{ 195 | z{q{ 196 | eaz{c{ 197 | z{q{ 198 | eaz{e{ 199 | z{q{ 200 | eaz{e{ 201 | z{q{ 202 | ean{ban{ 203 | z{q{ 204 | 205 | z{q{ 206 | qa{{{a{{da{{ 207 | r{{a{{{ab{{ar{ 208 | ka{{fa{{{a{{da{{ba{{ 209 | l{{ad{{ab{{ad{{an{ 210 | ia{{fa{{ba{{fa{{ba{{ 211 | p{{ab{{a{{{a{{{ab{{a{{{al{ 212 | ga{{{a{{da{{{a{{da{{{a{{da{{ba{{ 213 | h{{a{{{ab{{ab{{ad{{ah{{ah{ 214 | ea{{ba{{{a{{{a{{ta{{ 215 | f{{ad{{ad{{ab{{ad{{ab{{aj{ 216 | ea{{{a{{da{{fa{{da{{ba{{ba{{{a{{ 217 | f{{a{{{ad{{a{{{ab{{ab{{ab{{a{{{ad{{af{ 218 | ea{{ba{{da{{ba{{{a{{fa{{{a{{ba{{{a{{ 219 | h{{a{{{ab{{ad{{a{{{ab{{ab{{a{{{a{{{a{{{af{ 220 | ea{{da{{fa{{ba{{ba{{da{{ba{{ 221 | z{q{ 222 | 223 | z{q{ 224 | qa{{{e{{{ybg{m{{ 225 | r{{s{{{sb{{sr{ 226 | ka{{{ydg{j{{{v{{{y{g{c{g{t{{{y{g{t{{ 227 | l{{sd{{sb{{sd{{sn{ 228 | ia{{{k{g{cbg{m{{{i{g{m{{{b{g{dbg{j{{{y{g{t{{ 229 | p{{sb{{s{{{s{{{sb{{s{{{sl{ 230 | ga{{{e{{{ybg{m{{{v{{{y{g{c{g{u{{{s{{{k{g{c{g{u{{{k{g{m{{ 231 | h{{s{{{sb{{sb{{sd{{sh{{sh{ 232 | ea{{{y{g{u{{{v{{{e{{{ibg{nbg{d{g{cbg{dbg{d{g{u{{ 233 | f{{sd{{sd{{sb{{sd{{sb{{sj{ 234 | ea{{{s{{{ybg{u{{{y{g{d{g{c{g{m{{{i{g{d{g{t{{{b{g{m{{{i{g{t{{{e{{ 235 | f{{s{{{sd{{s{{{sb{{sb{{sb{{s{{{sd{{sf{ 236 | ea{{{i{g{j{{{ybg{j{{{i{g{t{{{s{{{y{g{c{g{d{g{u{{{s{{{y{g{m{{{s{{ 237 | h{{s{{{sb{{sd{{s{{{sb{{sb{{s{{{s{{{s{{{sf{ 238 | ea{{{k{g{c{g{u{{{k{g{cbg{t{{{i{g{u{{{k{g{u{{{k{g{c{g{u{{{i{g{u{{ 239 | z{q{ 240 | 241 | Size3X 45 Size3Y 18 Size3Z 9 Size3W 1 Flip3D 0 2 Replace Orange 13 0 Replace Rgb 255 0 127 14 0 Replace Magenta 15 0 Replace DkCyan 16 0 Replace Red 17 0 Replace Maize 18 0 Replace Maroon 19 0 Replace Purple 20 0 Replace Cyan 21 0 Replace Green 22 0 Replace Blue 23 0 Replace Yellow 24 0 Replace DkBlue 25 0 Replace DkGreen 26 0 Replace Gray 27 0 For (z) 13 27 {Replace @z NWSE 0 0 @z 0 0} ColorPut k Replace White Black 0 = k \ 242 | SetStrings 9 2 ",4556677777788888888877777766553,4010004000308020000000701020001" Flip3D 0 1 For (x) 0 30 {nX Add 7 @x nX2 nX If Not Odd @x 'nX Dec nX nX2 Inc nX2' nY2 143 nY Sub nY2 Mul Sub Char $9 @x 48 2 If Lt Abs Sub @x 15 2 'nY2 Sub nY2 2' ag _ Bias 1 1 2 1 Size SizeX Dec SizeY 0 0 Size 0 -1 1 0 CopyMask -1 Add 28 @x Quo Del Replace Black @o 0 CopyTexture -1 Add 28 @x k _} | = 243 | Size 2 9 0 1 Set 1 2 On Zoom 22 18 0 2 Size 45 162 0 0 Turtle "C1BM20,147DBR4UBM21,152R2" CopyMask -1 2 244 | Size 45 3 0 1 sDel Size 45 9 0 0 Zoom 1 18 0 2 CopyMask -1 1 Quo Replace White Gray 0 @z Shade Blend Brown Gray Div Abs rLightFactor -2 SetC 22 145 @z SetC 21 146 @z SetC 22 146 @z SetC 23 146 @z CopyTexture -1 1 k _ 245 | Quo Del Replace Black UD #60 #50 0 SetC 20 148 #60 SetC 24 148 #60 For (z) 21 23 {SetC @z 152 109} \ Del SetC 7 146 1 SetC 19 146 2 SetC 29 146 3 SetC 37 110 4 SetC 13 92 5 SetC 9 74 6 SetC 17 74 7 SetC 33 74 8 SetC 21 38 9 SetC 31 38 10 k - ColorPut k - k ColorOr Replace White #60 0 CopyTexture -1 2 Del ColorOr k - ExtraDelete Replace White 11 0 TempOr CopyTexture -1 0 SetX 23 152 0 9 SetX 21 152 0 10 CopyTexture 0 7 246 | 247 | // Maze data (outer) 248 | EmbedDB 249 | DB 250 | 45 9 24 251 | 252 | adamajacaiageyhseyagaiacajamad 253 | eaajauaceibg{{{n{{bgeiacauam 254 | eaajauaceibgbnbgeiacauam 255 | sa{eba{e 256 | sa{bba{b 257 | 258 | |2 259 | tabk 260 | 261 | CopyMask -1 3 CopyMask -2 4 ColorPut = Del Turtle "BM21,1R2DL2" _ CopyMask -1 5 Replace Red #A00 0 Replace Yellow #900 0 Replace Green #800 0 Replace Cyan #700 0 Replace Blue #600 0 Replace Magenta #500 0 Replace Maroon #400 0 Replace Maize #300 0 Replace DkGreen #200 0 Replace DkCyan UD #60 #50 0 Replace DkBlue #60 0 Replace Purple 109 0 Replace Gray UD #800 #100 0 Replace White UD #800 #300 0 CopyTexture -1 5 262 | Del CopyTexture -1 0 SetX 23 8 0 9 SetX 21 8 0 10 For (z) 0 30 {SetX Add 7 @z 2 2 Add 28 @z} For (z) 0 2 {SetX Add 21 @z 0 2 Add 59 @z} 263 | f3D False Macro2 264 | -------------------------------------------------------------------------------- /survmaz9.ds: -------------------------------------------------------------------------------- 1 | DS 2 | // Survivor Maze game #9 - A script file for Daedalus 3.5 3 | // By Walter D. Pullen, Astara@msn.com, http://www.astrolog.org/labyrnth.htm 4 | // For actual Maze see http://www.youtube.com/watch?v=_x6HVvdOq5g 5 | 6 | // Variable usage: 7 | // a-d: Player colors (constant) 8 | // e-h: Whether checkpoint visited 9 | // l: Whether blindfolded 10 | // k: Whether animating clouds 11 | // p: Player color index 12 | // q: Next thing for player to find (0-5) 13 | // r: Cloud movement rate (constant) 14 | // w: Temporary variable 15 | // x-y: X and Y coordinates of player during events 16 | // z: Event return value 17 | 18 | // Bitmap usage: 19 | // -1: Mono = Where walls are, Color = Color of walls 20 | // -2: Mono = Where floor markings are, Color = Color of floor markings 21 | // -3: Color = Trigger indicators 22 | // 0: Color = Wall texture mapping 23 | // 1: Mono = Where variable height walls are, Color = Wall heights 24 | // 2: Mono = Survivor Maze template, Color = Color backup 25 | // 3: Mono = Random Maze template, Color = Wall height backup 26 | 27 | If Gte Version 2400 {Break} Message 'This script requires Daedalus 2.4 or later to run.' Break 28 | 29 | DefineMacro 1 {@x Inc @p @y Add @x 4 Message 'Welcome to Survivor!\n\nThis game simulates the Maze from the immunity challenge for the final four in "Survivor XXII: Redemption Island". Your goal is to visit the four checkpoints in the Maze in any order, then go to the $x station in the raised finish area. $x was the color $y had.\n\nF1: Display this help text.\nF2: Restart current Maze.\nF3: Start in same Maze the Survivors did.\nF4: Start in random Maze.\n\nF5: Put on or remove blindfold.\nF6: Switch background between day and night.\nF7: Toggle cloud movement.\n\nJeff Probst says: "Survivors ready? Go!"'} "Help Text" 30 | DefineMacro 2 "fRedrawWhenBitmapEdited False CopyTexture 2 -1 ColorAnd CopyTexture 3 1 k = Del _ k Macro13 SetVars 5 4 '0 0 0 0' @p Rnd 0 3 @q 0 nX 1 nY 21 nZ 0 nDir 3 g cg @z Var Inc @p SetC 29 3 @z SetC 55 3 @z SetC 29 39 @z SetC 55 39 @z k3DWall @z fShowColorBitmap True fRedrawWhenBitmapEdited True n Macro1 fPauseTimer False ct" "Restart Maze" 31 | DefineMacro 3 "fRedrawWhenBitmapEdited False CopyMask 2 -1 Macro2" "Restart Survivor" 32 | DefineMacro 4 "fRedrawWhenBitmapEdited False Macro14 Macro2" "Restart Random" 33 | DefineMacro 5 "fRedrawWhenBitmapEdited False @l Not @l IfElse @l {kSky Black kGround Black kGround2 -1 kCloud Black kCloud2 -1 fMapOverlay False fMountains False fSunAndMoon False fStars False nFogDistance 15 fRedrawWhenBitmapEdited True Spc Message 'You put on a blindfold.'} {Macro13 fRedrawWhenBitmapEdited True Spc Message 'You remove your blindfold.'}" "Blindfold" 34 | DefineMacro 6 "If @l {Macro5 Break} fRedrawWhenBitmapEdited False If Equ nInside 0 {i} IfElse fStars {Macro13} {fStars True nFogDistance 200 kSky Black k3DCeiling kSky kGround Dark Dark kGround kGround2 Dark kGround kMountain kGround2 kMountain2 Dark Dark DkGreen kCloud DkGray kCloud2 Dark kCloud} fRedrawWhenBitmapEdited True Spc" "Day And Night" 35 | DefineMacro 7 "If @l {Macro5} @k Not @k If @k {Spc} fAutorepeatLastCommand @k" "Cloud Movement" 36 | 37 | DefineMacro 8 "If Or Gt @q 4 Not fWallsImpassable {Break} Message 'Jeff Probst says: "Hey, you can't exit the Maze! You haven't completed it yet."' @z True" "Boundary Event" 38 | DefineMacro 9 "@z False If Gt @q 4 {Break} @w GetCE @x @y If Not @w {Break} If Equ @w White {IfElse Neq GetC @x @y Var Inc @p (@w Inc @p Message 'This center station is not yours.\nYou want to touch the $w station.') (@q 5 Macro12) Break} @w And @w 255 If Gt @w 4 {Break} If Var Add 4 @w {Message 'You've already been to this checkpoint.' Break} Message 'You visit a checkpoint!' SetVar Add 4 @w 1 @q Inc @q @w GetCA 1 @x @y SetCA 1 @x @y UD Add @w 400 Sub @w 10 Spc" "Wall Event" 39 | DefineMacro 10 "@z False If Gte @q 4 {Break} @w GetCE @x @y If Or Or Neq @w Gray Gte nX @x Gt nViewHeight 48 {Break} Message 'Jeff Probst says: "Hey, you can't go up there yet! You need to visit all the checkpoints first."' @z True" "Move Event" 40 | DefineMacro 11 "If @k {MoveCloud -1 @r} If Gt @q 4 {Break} IfElse Lt @q 4 {@z Sub 4 @q MessageInside 'Checkpoints needed: @z' -1} {MessageInside 'Checkpoints needed: None - Go to finish!' -1}" "Inside Event" 41 | 42 | DefineMacro 12 "fPauseTimer True @w Timer @x Div @w 60 @y Mod @w 60 Message 'Congratulations, you found all checkpoints and made it to the end of the Maze! :-) You solved it in @x minutes, @y seconds.\n\nJeff Probst gives you the immunity necklace, meaning you can't be voted off the island at Tribal Council. Only you are safe! With this win you find yourself in the final three, and in good position to do the most a-Maze-ing thing in Survivor: Win the million dollar prize!'" "Win Game" 43 | DefineMacro 13 "@l False fStars False fMountains True fSunAndMoon True nFogDistance 900 kSky Cyan k3DCeiling kSky kGround Rgb 202 177 147 kGround2 -1 kMountain kGround kMountain2 DkGreen kCloud White kCloud2 Light LtGray" "Day Settings" 44 | DefineMacro 14 "CopyMask 3 -1 DoWhile (Not Get nX nY) {nX Or Rnd 0 Sub SizeX 2 1 nY Or Rnd 0 Dec Sub SizeY 2 1} PartialRecursive If Not Or Or Or Or Or Get 49 20 Get 53 20 Get 57 20 Get 49 22 Get 53 22 Get 57 22 {Turtle 'C0BM23,18D0BM30,19D0BM23,24D0BM30,23D0C1BM29,3`BM55,3`BM29,39`BM55,39`BM3,3`BM3,39`' nX 30 nY 20 nX2 58 nY2 22 2ndBlock nX 59 nY 10 nX2 74 nY2 32 2ndBlock Break} Restart" "Create Random" 45 | 46 | fRedrawWhenBitmapEdited False ResetProgram WindowTitle "- Survivor Maze Game 9" True nHorizontalScroll 8 nVerticalScroll 8 fHideMenu True fHideScrollbars True 47 | nRepeatDelayInMsec 25 nRandomRun 10 kBorder Black kPassage Black fShowDot True fWallsImpassable True fNoCornerHopping False fDragIsErase False fDoDragOnTemp True nEdgeBehavior 0 Macro13 fSealedEntrances False fMountains True nPeakHeight 30 nCloudCount 24 fSunAndMoon True fNarrowWalls True nInside 4 nCellSize 160 nNarrowCellSize 20 nWallHeight 300 nViewHeight 0 nStepHeight 60 nClippingPlane 200 nMotionVelocity 13 nRotationVelocity 5 nUpDownVelocity 57 fFogGround True fMarkColor True fRedrawAfter True nOnMoveOffBitmap 8 nOnMoveIntoWall 9 nOnMoveToNewCell 10 nAfterRedrawInside 11 nWallVariable 1 48 | @r 18000 SetVars 1 4 "Purple Blue Orange Red" SetStrings 1 8 ",Purple,Blue,Orange,Red,Ashley,Boston Rob,Natalie,Phillip" 49 | 50 | Size 10 3 0 1 Turtle "T1BM2,0DNDR5NUD" Zoom 1 3 0 2 cDel CopyMask -1 7 51 | Turtle "S4" SetString 0 "T_ _" Size 28 292 0 1 For (y) 0 Dec Len $11 {SetChar 0 2 Char $11 @y nXTurtle 4 nYTurtle Add 4 Mul @y 32 Turtle $0} DoCount 3 {Thicken} cDel CopyMask -1 4 52 | Size 32 388 0 1 For (y) 0 Dec Len $12 {SetChar 0 2 Char $12 @y nXTurtle 6 nYTurtle Add 4 Mul @y 32 Turtle $0} DoCount 3 {Thicken} cDel CopyMask -1 5 53 | Size 180 148 0 1 Turtle "BM56,8T_KEY_BM8,40T_STATION_BM8,80T_GET KEY_BM44,112T_HERE_" DoCount 3 {Thicken} cDel CopyMask -1 6 54 | Size 50 500 0 1 Turtle "S1O1BM49,100OF25UOD25BU`BM49,399OG25DOA25BD`" cDel CopyMask -1 8 55 | Size 200 200 0 1 Turtle "BM100,20OC80OE80OG80OA80BD40OC40OE40OG40OA40BU`" cDel CopyMask -1 9 56 | Size 8 8 0 1 Turtle "BM1,2R5DL2D3LU3L2" FlipVertical cDel CopyMask -1 10 57 | Size 7 7 0 1 Turtle "BM3,3NU2NL2ND2R2" cDel CopyMask -1 11 58 | Size 7 7 0 1 Turtle "BM1,2R4D2L4U2" cDel CopyMask -1 12 59 | Size 200 200 0 1 SetString 0 "OC30OE30OG30OA30BD`" SetString 0 "BM100,23$0BM50,107$0BM150,107$0" Turtle $0 FlipVertical cDel CopyMask -1 13 60 | For (z) 0 4 {CopyMask Add 9 @z -1 Quo Del Replace Black Blend Var Inc @z Dark Var Inc @z 0 CopyTexture -1 Add 15 @z} 61 | 62 | EmbedDB 63 | DB 64 | 75 43 24 65 | 66 | fsr{fvr{fy 67 | {sdj{s{a{l{a{l{a{l{a{l{a{{{a{l{a{l{a{l{a{l{a{vd!$^`{v{a{{{a{l{a{l{a{l{a{l{a{l{a{l{a{l{a{l{a{ydm{y 68 | {sdj{s{lf{{l{{{l{{{le{{vd!$^`{v{l{{{ld{{li{{ydm{y 69 | {sdj{s{a{{{a{l{a{l{a{{{a{{{a{{{a{l{a{l{a{l{a{ba!$^`{va!$^`{v{a{{{a{{{a{l{a{{{a{l{a{l{a{l{a{l{a{l{a{cam{yam{y 70 | {sdj{s{ld{{l{{{l{{{lg{{vd!$^`{v{l{{{l{{{l{{{lk{{ydm{y 71 | {sdj{s{a{l{a{l{a{l{a{{{a{{{a{{{a{l{a{l{a{l{a{vd!$^`{v{a{{{a{{{a{{{a{l{a{l{a{l{a{l{a{l{a{{{a{ydm{y 72 | fsg{{l{{{ld{{la{fv{l{{{l{{{ll{{lfy 73 | {{{a{l{a{l{a{l{a{l{a{l{a{l{a{l{a{{{a{l{a{l{a{l{a{l{a{l{a{l{a{l{a{l{a{{{a{{{a{l{a{l{a{l{a{{{a{l{a{l{a{l{a{l{a{l{a{l{a{{ 74 | {{{l{{{ld{{lv{{l{{{lf{{ll{{l{{ 75 | {{{a{{{a{{{a{l{a{{{a{l{a{l{a{l{a{l{a{l{a{l{a{l{a{l{a{l{a{l{a{l{a{{{a{{{a{l{a{l{a{l{a{{{a{l{a{l{a{l{a{l{a{l{a{l{a{{{a{{ 76 | {{{l{{{l{{{l{{{l{{{lv{{lf{{lf{{lb{{l{{{l{{{l{uog 77 | {{{a{{{a{{{a{{{a{{{a{l{a{l{a{l{a{l{a{l{a{l{a{l{a{l{a{l{a{l{a{l{a{l{a{{{a{l{a{l{a{{{a{{{a{l{a{l{a{l{a{l{a{{{a{{{a{l{a{und{g 78 | {{{l{{{lb{{l{{{lz{a{{l{{{l{{{ld{{l{{{l{{{lc{{u{dli{d{g 79 | {{{a{{{a{l{a{l{a{l{a{{{a{l{a{{{a{l{a{l{a{l{a{l{a{{{a{l{a{l{a{l{a{l{a{l{a{l{a{l{a{{{a{{{a{{{a{l{a{l{a{{{a{{{a{l{a{l{a{u{d{ije{i{d{g 80 | {{{lf{{l{{{l{{{l{{{lf{{l{{{ld{{lh{{l{{{l{{{lj{{l{u{d{i{ehn{e{i{d{g 81 | {{{a{l{a{l{a{l{a{{{a{{{a{{{a{{{a{{{a{l{a{l{a{{{a{{{a{{{a{l{a{{{a{l{a{l{a{l{a{l{a{{{a{{{a{{{a{{{a{l{a{l{a{l{a{l{a{{{a{u{d{i{e{nc0T]`P\_`a0T]`{n{e{i{d{g 82 | f{{l{{{lb{{l{{{ld{{l{{{l{{{lb{{l{{{l{{{ld{{l{{{lb{{l{{{lb{{l{{{l{{{l{{{l{u{d{i{e{nf0T]`{n{e{i{d{g 83 | {{{a{l{a{l{a{l{a{{{a{l{a{l{a{l{a{l{a{l{a{l{a{{{a{{{a{l{a{l{a{{{a{{{a{l{a{{{a{l{a{{{a{l{a{l{a{{{a{l{a{{{a{{{a{{{a{{{a{u{d{i{e{nf0T]`{n{e{i{d{g 84 | {{{lt{{lf{{ld{{lh{{l{{{l{{{l{{{l{{{l{{{l{u{d{i{e{nf0T]`{n{e{i{d{g 85 | {{{a{l{a{l{a{l{a{l{a{l{a{l{a{l{a{l{a{{ja{l{a{l{a{l{a{{{a{l{a{l{a{l{a{l{a{l{a{{{a{{{a{{{a{{{a{{{a{u{d{i{e{nc0T]`P\_`a0T]`{n{e{i{d{g 86 | {wq{jaru{kbu{kbu{kbuakf0T]`{n{e{i{d{g 87 | zabaqk{u{k{u{k{u{k{u{k{u{k{u{k{uakf0T]`{n{e{i{d{g 88 | {wq{jaru{kbu{kbu{kbuakf0T]`{n{e{i{d{g 89 | {{{a{l{a{l{a{{{a{l{a{{{a{l{a{l{a{l{a{{ja{l{a{l{a{l{a{{{a{l{a{l{a{l{a{l{a{l{a{{{a{{{a{{{a{{{a{{{a{u{d{i{e{nc0T]`P\_`a0T]`{n{e{i{d{g 90 | {{{lb{{l{{{lb{{ld{{ld{{lf{{ld{{lh{{l{{{l{{{l{{{l{{{l{{{l{u{d{i{e{nf0T]`{n{e{i{d{g 91 | {{{a{{{a{{{a{{{a{l{a{l{a{{{a{l{a{l{a{l{a{l{a{{{a{{{a{l{a{l{a{{{a{l{a{l{a{{{a{l{a{l{a{l{a{l{a{{{a{{{a{{{a{{{a{{{a{{{a{u{d{i{e{nf0T]`{n{e{i{d{g 92 | {{{l{{{l{{{l{{{lh{{ld{{l{{{lb{{l{{{ld{{lh{{l{{{l{{{l{{{l{{{l{{{l{u{d{i{e{nf0T]`{n{e{i{d{g 93 | {{{a{{{a{{{a{l{a{{{a{l{a{l{a{l{a{{{a{{{a{l{a{l{a{{{a{{{a{{{a{{{a{l{a{l{a{l{a{{{a{l{a{l{a{l{a{l{a{{{a{{{a{l{a{l{a{{{a{u{d{i{e{nc0T]`P\_`a0T]`{n{e{i{d{g 94 | {{{l{{{ld{{l{{{lb{{l{{{l{{{l{{{l{{{l{{{l{{{l{{{lh{{lh{{lf{{l{u{d{i{ehn{e{i{d{g 95 | {{{a{{{a{{{a{l{a{{{a{{{a{{{a{{{a{{{a{{{a{{{a{{{a{{{a{l{a{{{a{{{a{l{a{l{a{l{a{{{a{l{a{l{a{l{a{l{a{l{a{{{a{l{a{l{a{l{a{u{d{ije{i{d{g 96 | {{{l{{{lb{{l{{{l{{{l{{{l{{{l{{{l{{{l{{{l{{{ld{{l{{{ld{{ll{{le{{u{dli{d{g 97 | {{{a{{{a{l{a{l{a{{{a{{{a{{{a{{{a{l{a{l{a{{{a{{{a{l{a{l{a{l{a{{{a{{{a{l{a{{{a{l{a{l{a{l{a{l{a{l{a{l{a{l{a{l{a{{{a{l{a{und{g 98 | {{{l{{{ld{{l{{{l{{{lf{{lh{{l{{{l{{{lr{{l{{{l{uog 99 | {{{a{{{a{l{a{l{a{l{a{{{a{{{a{l{a{l{a{l{a{l{a{l{a{l{a{l{a{l{a{l{a{{{a{{{a{l{a{l{a{l{a{l{a{l{a{l{a{l{a{l{a{l{a{l{a{{{a{{ 100 | {{{lf{{l{{{lt{{lv{{l{{ 101 | {{{a{l{a{l{a{l{a{{{a{{{a{l{a{l{a{l{a{l{a{l{a{l{a{l{a{l{a{l{a{l{a{l{a{{{a{l{a{l{a{l{a{l{a{l{a{l{a{l{a{l{a{l{a{l{a{l{a{{ 102 | fs{l{{{lo{fv{l{{{ld{{li{fy 103 | {sdj{s{a{{{a{l{a{l{a{l{a{l{a{l{a{l{a{l{a{l{a{vd!$^`{v{a{{{a{{{a{l{a{{{a{l{a{l{a{l{a{l{a{l{a{ydm{y 104 | {sdj{s{l{{{lo{{vd!$^`{va{{l{{{l{{{l{{{li{{ydm{y 105 | {sdj{s{a{{{a{l{a{l{a{l{a{l{a{l{a{l{a{l{a{l{a{ba!$^`{va!$^`{v{a{{{a{{{a{{{a{{{a{l{a{l{a{l{a{l{a{l{a{cam{yam{y 106 | {sdj{s{lq{{vd!$^`{v{l{{{l{{{lm{{ydm{y 107 | {sdj{s{a{l{a{l{a{l{a{l{a{l{a{l{a{l{a{l{a{l{a{vd!$^`{v{a{l{a{l{a{l{a{l{a{l{a{l{a{l{a{l{a{l{a{ydm{y 108 | fsr{fvr{fy 109 | 110 | = Replace Rgb 127 0 255 Black 0 ColorPut TempDelete ExtraDelete CopyMask -1 2 sDel CopyMask -1 1 111 | Replace LtGray Gray 0 kDot Rgb 128 0 0 ColorDotAnd kDot Green ColorPut Turtle "C0BM29,3D0BM55,3D0BM29,39D0BM55,39D0C1BM26,3D0BM52,3D0BM26,39D0BM52,39D0BM23,18D0BM30,19D0BM23,24D0BM30,23D0BM31,19`BM23,17`BM23,25`" CopyMask -1 3 CopyMask 2 -1 k + 112 | @z Blend Brown Light Brown Replace White @z 0 Replace Rgb 127 0 255 @z 0 Replace Pink @z 0 @z Gray Replace Red @z 0 Replace Maroon @z 0 Replace Orange @z 0 Replace Brown @z 0 Replace Yellow @z 0 Replace Maize @z 0 Replace Blue @z 0 Replace DkBlue @z 0 Replace Magenta @z 0 Replace Purple @z 0 Replace Green @z 0 Replace DkGreen @z 0 Replace Cyan @z 0 Replace DkCyan @z 0 Replace Gray @z 0 Replace DkGray @z 0 For (z) 0 3 {SetC 67 Add 15 Mul @z 4 Var Add 1 @z} 113 | _ Replace White 100 0 Replace Rgb 127 0 255 100 0 Replace Pink 150 0 Replace Red 300 0 Replace Maroon UD 300 290 0 Replace Orange 400 0 Replace Brown UD 400 390 0 Replace Yellow 500 0 Replace Maize UD 500 490 0 Replace Blue UD 500 300 0 Replace DkBlue UD 400 300 0 Replace Magenta 266 0 Replace Green 266 0 Replace DkGreen UD 266 256 0 Replace Cyan UD 533 256 0 Replace DkCyan UD 533 523 0 Replace Gray UD 800 523 0 Replace DkGray UD 700 690 0 Replace LtGray UD 780 690 0 114 | For (x) 0 32 {@y Div Mul 700 Inc Div @x 2 17 @z ?: Equ GetC Add 30 @x 20 Purple 300 0 SetC Add 30 @x 20 UD Add @y 100 @z SetC Add 30 @x 21 UD @y @z SetC Add 30 @x 22 UD Add @y 100 @z} CopyTexture -1 3 115 | Del @z Rgb 0 255 255 SetC 29 3 Add @z 1 SetC 55 3 Add @z 2 SetC 29 39 Add @z 3 SetC 55 39 Add @z 4 SetC 31 21 Gray For (z) 0 3 {SetC 67 Add 15 Mul @z 4 White} \ + TempDelete CopyTexture -1 2 116 | @k True fAutoRepeatLastCommand True nAutoRepeat Command "Spc" Macro3 117 | -------------------------------------------------------------------------------- /demos.ds: -------------------------------------------------------------------------------- 1 | DS 2 | // Daedalus Demonstrations - A script file for Daedalus 3.5 3 | // By Walter D. Pullen, Astara@msn.com, http://www.astrolog.org/labyrnth.htm 4 | 5 | // Variable usage: 6 | // b: Border color 7 | // c: Object color 8 | // d: Rotation angle 9 | // l: Evolution/Life last number of cells changed 10 | // m: Day/night mode/minute 11 | // n: Evolution/Life number of cells 12 | // o: Evolution/Life number of generations near end 13 | // p: Spree pixels per cell (constant) 14 | // q: Whether solids.dp has been loaded yet 15 | // r: Day/night mode slowdown rate 16 | // s: Day/night mode fraction/second 17 | // t: Day/night current time/total 18 | // u: Day/night time increment rate (constant) 19 | // v: Evolution number of cell colors (constant) 20 | // w: Evolution/Life pixels per cell (constant) 21 | // x-z: Return values and temporary variables 22 | 23 | If Gte Version 3300 {Break} Message 'This script requires Daedalus 3.3 or later to run.' Break 24 | 25 | DefineMacro 1 "Message 'Daedalus Feature Demonstrations\n\nF1: Display this help menu.\tShift+F1: Stop any animation.\nF2: Random Maze walk.\tShift+F2: Random 3D Maze walk.\nF3: Maze creation spree.\tShift+F3: Spree (see generation).\nF4: Draw Maze overview.\tShift+F4: Aerial Maze overview.\nF5: Draw cubes Maze.\tShift+F5: Draw cubes Maze #2.\nF6: View Chartres Labyrinth.\tShift+F6: View classical Labyrinth.\nF7: Animate over Maze.\tShift+F7: Animate flat Maze.\nF8: Display Escher room.\tShift+F8: Display castle.\nF9: Evolution patterns.\tShift+F9: Life patterns.\nF10: Geometrical shapes.\tShift+F10: Animate shapes.'" "Help Text" 26 | DefineMacro 13 "Macro48 If fWindowAlwaysOnTop {sTab} Macro1" "Stop" 27 | DefineMacro 2 "Macro48 fRedrawWhenBitmapEdited False fShowColorBitmap False TempDelete ExtraDelete cF an CollapseToSet Quo Replace White '\' 0 c8 nY -1 nDir 0 fShowDot True fWallsImpassable True fNarrowWalls True fStars False nWallHeight 100 fRedrawWhenBitmapEdited True nInside 2 @t Mul 1536 @r nAfterRedrawInside 25 n If Not fWindowAlwaysOnTop {sTab} 0 fAutorepeatLastCommand True" "Maze Walk" 28 | DefineMacro 14 "Macro48 fRedrawWhenBitmapEdited False ColorDelete TempDelete ExtraDelete Size3X 15 Size3Y 15 Size3Z 15 Size3W 4 Q c8 nY -1 nDir 0 fShowDot True fWallsImpassable True kSky Black kCloud DkGray kCloud2 Dark DkGray fNarrowWalls True fStars True nWallHeight 100 nStarCount 768 fRedrawWhenBitmapEdited True nInside 2 n If Not fWindowAlwaysOnTop {sTab} 0 fAutorepeatLastCommand True" "3D Maze Walk" 29 | DefineMacro 3 "Macro32 fShowIndividualPixelEdits False" "Spree" 30 | DefineMacro 15 "Macro32 fShowIndividualPixelEdits True" "Spree Process" 31 | DefineMacro 4 "Macro48 fRedrawWhenBitmapEdited False Size 48 48 0 1 an CollapseToSet nHorizontalSize 10 nVerticalSize 7 nDepthSize 12 @c Hue Rnd 0 359 @b White Macro34 fRedrawWhenBitmapEdited True n" "Overview" 32 | DefineMacro 16 "Macro48 fRedrawWhenBitmapEdited False Size 48 48 0 1 an CollapseToSet nHorizontalSize 10 nVerticalSize 10 nXVanishingPoint 235 nYVanishingPoint 235 fShowDot False nInside 0 @c Hue Rnd 0 359 @z Light @c kObject Light @z kSkyHigh Blend @z Light @z kSkyLow Blend @c @z kGroundHigh @z kGroundLow @c k Pyramid k Pyramid k kBorder White fRedrawWhenBitmapEdited True n" "Perspective" 33 | DefineMacro 5 "Macro48 fRedrawWhenBitmapEdited False fShowColorBitmap False sPlanair 'c2t3f0b1 c7a3i5s1 c0c1a0b4 f2w3l0e1 f7d3o5g1 a2t6d0e4 i2e3o0h1 i7g3r5v1 s2b6g0h4 l2j1j2k1 l7j3u5m1 d2w6j0k4 o2k3u0n1 o7m3x5p1 g2e6m0n4 r2n3x0q1 r7p3q2q3 v2h6p0q4 s0b3i0s3 t0t1f5a1 m2k6u2u3 v0h3r0v3 w0w1l5d1 p2n6x2x3' SetVars 27 48 '02 01 12 01 03 00 01 12 11 12 02 11 12 11 22 11 13 10 00 23 10 23 01 22 11 22 21 22 12 21 22 21 32 21 23 20 13 00 01 02 11 32 23 10 00 13 22 31' Macro38 Macro40" "Cube #1" 34 | DefineMacro 17 "Macro48 fRedrawWhenBitmapEdited False fShowColorBitmap False sPlanair 'c1a1a2b1 c2a3l0d1 c0a0b0c3 f1b3l3e1 f2d3o0g1 f0d0e0f3 i1e3o3h1 i2g3h2h3 i0g0h0i3 l1j1r3k1 l2j3u0m1 b2j0k0d2 o1k3u3n1 o2m3x0n3 e2m0n0g2 r1p1p2q1 r2p3q2s1 r0p0q0j2 u1q3s2t1 u2s3t2v1 k2s0t0m2 x1t3v2w1 x2v3w2w3 n2v0w0x3' SetVars 27 48 '0 01 1 02 0 01 2 01 3 02 2 01 4 01 5 02 4 01 1 12 2 13 1 12 3 12 4 13 3 12 0 23 1 24 0 23 2 23 3 24 2 23 4 23 5 24 4 23' Macro39 Macro40" "Cube #2" 35 | DefineMacro 6 "Macro48 fRedrawWhenBitmapEdited False Size 512 512 0 1 fTeleportToEntranceOnMazeCreation True ChartresReplica g = nX 0 nY 0 Fill cg TempXor cDel TempDelete ExtraDelete Quo nRainbowStart Rnd 0 359 Replace White 'X' 0 kBorder Black kSky Black kCloud DkGray fWallsImpassable True fNarrowWalls False fStars True nMotionVelocity 225 nWallHeight 1500 nClippingPlane 400 nInside 4 i fRedrawWhenBitmapEdited True n" "Chartres" 36 | DefineMacro 18 "Macro48 fRedrawWhenBitmapEdited False Size 256 230 0 1 fTeleportToEntranceOnMazeCreation True Classical nY Add nY 5 g Thicken TempDelete ExtraDelete Quo nX Div SizeX 2 nY nX nRainbowStart Rnd 0 359 Replace White 'x' 0 cg kBorder Black kSky Black kCloud DkGray fWallsImpassable True fNarrowWalls False fStars True nMotionVelocity 300 nWallHeight 1500 nClippingPlane 300 nInside 4 i fRedrawWhenBitmapEdited True n" "Classical" 37 | DefineMacro 7 "Macro48 @d 0 @q False fRedrawWhenBitmapEdited False fHourglassCursorOnRedraw False fSkipMessageDisplay True fShowDot False nInside 0 nHorizontalSize 20 nVerticalSize 20 nDepthSize 30 nHorizontalSizeBias 10 nVerticalSizeBias 10 nXStartingLocation 0 nYStartingLocation 0 nZStartingLocation 0 fMoveWithArrowKeys True nVerticalPitchPhi 30 fDrawEdges False fShadeObjects True fShowColorBitmap False cB an Quo Replace White '\' 0 MakePatch nZStartingLocation 200 cZ ColorPut k Macro43 fRedrawWhenBitmapEdited True n Macro43 fAutorepeatLastCommand True" "Patch Maze" 38 | DefineMacro 19 "Macro48 @d 0 fRedrawWhenBitmapEdited False fHourglassCursorOnRedraw False fSkipMessageDisplay True fShowDot False nInside 0 nHorizontalSize 10 nVerticalSize 10 nDepthSize 0 nHorizontalSizeBias 4 nVerticalSizeBias 4 nXStartingLocation 0 nYStartingLocation 0 nZStartingLocation 0 fMoveWithArrowKeys True nVerticalPitchPhi 30 fShowColorBitmap False cF an MakeWire nZStartingLocation 200 cZ Quo k Macro44 fRedrawWhenBitmapEdited True n Macro44 fAutorepeatLastCommand True" "Wireframe Maze" 39 | DefineMacro 8 "Macro48 fRedrawWhenBitmapEdited False Open3D 'escher.d3' nHorizontalSize 8 nVerticalSize 5 nDepthSize 8 @c Hue Rnd 0 359 @b White Macro34 fRedrawWhenBitmapEdited True n" "Escher" 40 | DefineMacro 20 "Macro48 fRedrawWhenBitmapEdited False Open3D 'castle.d3' If Gt Rnd 1 4 1 {Flip3D 2 Rnd 1 3} nHorizontalSize 6 nVerticalSize 3 nDepthSize 5 @c Gray @b Hue Rnd 0 359 Macro34 fRedrawWhenBitmapEdited True n" "Castle" 41 | DefineMacro 9 "Macro47 Evolution @v 0 Macro35 fAutorepeatLastCommand True" "Evolution" 42 | DefineMacro 21 "Macro47 Macro36 Macro37 fAutorepeatLastCommand True" "Life" 43 | DefineMacro 10 "Macro48 fShowColorBitmap True fSkipMessageDisplay True If Not @q {@q True OpenPatch 'solids.dp'} If Or Lt SizeCX 256 Lt SizeCY 192 {fShowColorBitmap False cZ Quo} fShowDot False nInside 0 fMoveWithArrowKeys True fDrawEdges False fShadeObjects True nXStartingLocation 0 nYStartingLocation 680 nZStartingLocation 290 nViewingAngleTheta 180 nVerticalPitchPhi 20 PatchPerspective Macro41" "Shapes" 44 | DefineMacro 22 "Macro48 @d 90 fHourglassCursorOnRedraw False fShowColorBitmap True fSkipMessageDisplay True If Not @q {@q True OpenPatch 'solids.dp'} If Or Lt SizeCX 256 Lt SizeCY 192 {fShowColorBitmap False cZ Quo} fShowDot False nInside 0 fMoveWithArrowKeys True fDrawEdges False fShadeObjects True nZStartingLocation 290 nVerticalPitchPhi 20 Macro42 Macro41 Macro42 fAutorepeatLastCommand True" "Animate Shapes" 45 | DefineMacro 11 "Macro10" "Shapes" 46 | DefineMacro 23 "Macro22" "Animate Shapes" 47 | 48 | DefineMacro 25 "fRedrawWhenBitmapEdited False @t Add @t @u If Gte @t Mul 1536 @r {@t 0} @m Div @t Mul 256 @r @s Div Mod @t Mul 256 @r @r Macro Add 26 @m fRedrawWhenBitmapEdited True" "Inside Event" 49 | DefineMacro 26 "If Equ @s 0 {kSky Aqua kCloud White kCloud2 Light LtGray kMountain Brown kMountain2 Gray nFogDistance 0 kGround2 -1 nSunMoonY 333}" "Midday" 50 | DefineMacro 27 "kSky Rgb 0 Sub 255 @s 255 kCloud GrayN Sub 255 Div Mul @s 3 8 kCloud2 GrayN Sub 223 Div Mul @s 3 8 kMountain Rgb Sub 127 Div @s 8 Sub 63 Div @s 16 0 kMountain2 GrayN Sub 127 Div Mul @s 52 256 nFogDistance Sub 5290 Mul @s 20 kGround2 GrayN Sub 128 Div @s 4 nSunMoonY Add 333 Div Mul @s 667 256" "Late Day" 51 | DefineMacro 28 "If Equ @s 0 {fStars True} kSky Rgb 0 0 Sub 255 @s kCloud GrayN Sub 159 Div Mul @s 3 8 kCloud2 GrayN Sub 127 Div Mul @s 3 8 kMountain Rgb Sub 95 Div @s 8 Sub 47 Div @s 16 0 kMountain2 GrayN Sub 75 Div Mul @s 52 256 nStarCount Mul @s 3 nFogDistance Sub 170 Div @s 2 kGround2 GrayN Sub 64 Div @s 4 nSunMoonY Sub 1000 Div Mul @s 667 256" "Early Night" 52 | DefineMacro 29 "If Equ @s 0 {kSky Black kCloud DkGray kCloud2 Dark DkGray kMountain Dark Brown kMountain2 GrayN 23 nStarCount 768 nFogDistance 42 kGround2 Black nSunMoonY 333}" "Midnight" 53 | DefineMacro 30 "kSky Rgb 0 0 @s nStarCount Mul Sub 255 @s 3 kCloud GrayN Add 64 Div Mul @s 3 8 kCloud2 GrayN Add 32 Div Mul @s 3 8 kMountain Rgb Add 63 Div @s 8 Add 31 Div @s 16 0 kMountain2 GrayN Add 24 Div Mul @s 52 256 nFogDistance Add 42 Div @s 2 kGround2 GrayN Div @s 4 nSunMoonY Add 333 Div Mul @s 667 256" "Late Night" 54 | DefineMacro 31 "If Equ @s 0 {fStars False} kSky Rgb 0 @s 255 kCloud GrayN Add 160 Div Mul @s 3 8 kCloud2 GrayN Add 128 Div Mul @s 3 8 kMountain Rgb Add 95 Div @s 8 Add 47 Div @s 16 0 kMountain2 GrayN Add 76 Div Mul @s 52 256 nFogDistance Add 170 Mul @s 20 kGround2 GrayN Add 64 Div @s 4 nSunMoonY Sub 1000 Div Mul @s 667 256" "Early Day" 55 | 56 | DefineMacro 32 "Macro48 If Not fWindowAlwaysOnTop {sTab} Size Div nWindowHorizontalSize @p Div nWindowVerticalSize @p 0 1 fHourglassCursorOnRedraw False fSkipMessageDisplay True fAutorepeatRandomizesWallColor True kBorder Black fShowDot False nInside 0 Macro33 fAutorepeatLastCommand True" "Spree Initialize" 57 | DefineMacro 33 "fCreateWithWallAdding Rnd 0 1 @z Rnd 0 16 If Lte @z 8 {an Return} If Equ @z 9 {aj Return} If Equ @z 10 {as Return} If Equ @z 11 {S Return} If Equ @z 12 {av Return} If Equ @z 13 {K Return} nBraidMethod Sub @z 14 B" "Random Maze" 58 | DefineMacro 34 "fShowDot False nInside 0 = \ fShadeSky True fShadeObjects False Overview _ fShadeSky False fShadeGround True Overview - fShadeGround False fShadeObjects True Overview - Blend3 Replace Yellow @c 0 Replace Magenta Light @c 0 Replace White Dark @c 0 Replace Cyan @b 0 kBorder @b" "Draw Overview" 59 | DefineMacro 35 "@l @z Evolution @v 1 If Or Lte @z 0 Gte @z @n {Evolution @v 0 Break} IfElse Or Gte @z Div Mul @n 4 5 Equ @z @l {@o Inc @o If Gte @o 128 'Evolution @v 0'} {@o 0}" "Next Evolution" 60 | DefineMacro 36 "fRedrawWhenBitmapEdited False fShowColorBitmap False AllRandom Quo TempDelete fRedrawWhenBitmapEdited True aL" "Life Start" 61 | DefineMacro 37 "@l @z aL If Lte @z 0 {Macro36 Break} IfElse Lte Abs Sub @z @l Div @n 1000 {@o Inc @o If Gte @o 64 'Macro36'} {@o 0}" "Next Life" 62 | DefineMacro 38 "@c 11 @d 8 @e 4 Size3X Add << @c 1 2 Size3Y Size3X Size3Z 24 Size3W 4 J Set Inc Mul Size3X 2 0 Off Set Sub SizeX 3 Sub SizeY 2 Off = @z Inc Mul Mul Add @d @e 3 @c Size @z @z 0 1 CopyMask -1 1 CopyMask -1 2 CopyMask -1 3 For (b) 0 23 {@z Var Add 27 << @b 1 @x Add Mul Mul @d @c Div @z 10 Mul Mul @e @c Mod @z 10 @z Var Add 28 << @b 1 @y Add Mul Mul @d @c Div @z 10 Mul Mul @e @c Mod @z 10 SwapMask -1 Inc Mod @b 3 SwitchSgn Dec Mod @b 3 'DrawLevel @b @x @y @d 0 0 @d' 'DrawLevel @b @x @y @e Neg @e 0 @d' 'DrawLevel @b @x @y @d 0 Neg @e @e' SwapMask -1 Inc Mod @b 3}" "Cube Start #1" 63 | DefineMacro 39 "@c 12 @d 8 @e 6 @f 2 Size3X Add << @c 1 2 Size3Y Size3X Size3Z 24 Size3W 4 J Set Sub Mul Size3X 3 3 0 Off Set Inc Sub SizeX << Size3X 1 Sub SizeY 2 Off = @x Inc Mul Mul @e 6 @c @y Inc Mul Add Mul @d 3 Mul @f 4 @c Size @x @y 0 1 CopyMask -1 1 CopyMask -1 2 CopyMask -1 3 For (b) 0 23 {@z Var Add 27 << @b 1 @x Mul Mul @e @c @z @z Var Add 28 << @b 1 @y Add Mul Mul @d @c Div @z 10 Mul Mul @f @c Mod @z 10 SwapMask -1 Inc Mod @b 3 SwitchSgn Dec Mod @b 3 'DrawLevel @b @x @y @e @f 0 @d' 'DrawLevel @b @x @y @e Neg @f 0 @d' 'DrawLevel @b @x @y @e Neg @f @e @f' SwapMask -1 Inc Mod @b 3}" "Cube Start #2" 64 | DefineMacro 40 "kBorder Black @c Hue Rnd 0 359 SwapMask 1 -1 SwapMask 2 -2 SwapMask 3 -3 Blend3 @c Blend @c Blend @c White Replace Red @c 0 Replace Green Dark @c 0 Replace Blue Light @c 0 Replace Yellow Blend @c Dark @c 0 Replace Magenta Blend @c Light @c 0 Replace Cyan Blend Light @c Dark @c 0 Replace White @c 0 k TempOr _ - TempOr TempDelete ExtraDelete TextureDelete k fRedrawWhenBitmapEdited True n" "Cube End" 65 | DefineMacro 41 "Message 'Front Row: Dodecahedron (12 sides), Sphere (1 surface), Icosahedron (20 sides)\nMiddle Row: Tetrahedron (4 sides), Octahedron (8 sides)\nBack: Cube (6 sides), Ring (4 surfaces), Crystal (18 sides), Torus (1 surface)'" "Shapes" 66 | DefineMacro 42 "nXStartingLocation Cos 440 @d nYStartingLocation Add 240 Sin 440 @d nViewingAngleTheta Mod Sub 270 @d 360 PatchPerspective @d Add @d @u If Gte @d 360 {@d Sub @d 360}" "Next Shape" 67 | DefineMacro 43 "nXStartingLocation Add 305 Cos 380 @d nYStartingLocation Add 305 Sin 380 @d nViewingAngleTheta Mod Sub 270 @d 360 PatchPerspective @d Add @d @u If Gte @d 360 {@d Sub @d 360}" "Next Patch" 68 | DefineMacro 44 "nXStartingLocation Add 311 Cos 385 @d nYStartingLocation Add 312 Sin 385 @d nViewingAngleTheta Mod Sub 270 @d 360 WirePerspective @d Add @d @u If Gte @d 360 {@d Sub @d 360}" "Next Wireframe" 69 | 70 | DefineMacro 47 "Macro48 fRedrawWhenBitmapEdited False fHourglassCursorOnRedraw False fSkipMessageDisplay True fShowDot False nEdgeBehavior 2 nInside 0 If Not fWindowAlwaysOnTop {sTab} fShowColorBitmap False Size Div nWindowHorizontalSize @w Div nWindowVerticalSize @w 0 1 kBorder Black @n Mul SizeX SizeY Quo fRedrawWhenBitmapEdited True" "Initialize #2" 71 | DefineMacro 48 "fShowIndividualPixelEdits False fAutoRepeatLastCommand False fHourglassCursorOnRedraw True fSkipMessageDisplay False nAfterRedrawInside 0 kPassage Black kWall White fAutorepeatRandomizesWallColor False fMoveByTwo False fDoDragOnTemp True nEdgeBehavior 0 fMoveWithArrowKeys False nXVanishingPoint 0 nYVanishingPoint 0 fShadeSky False fShadeGround False" "Initialize" 72 | 73 | WindowTitle "- Demos" True fRedrawWhenBitmapEdited False 74 | ResetProgram fShowColorBitmap False nHorizontalScroll 8 nVerticalScroll 8 75 | fTiltLinesMakeNoDiamonds True 76 | kGround Gray fSealedEntrances False fMountains True nPeakHeight 20 fSunAndMoon True nCellSize 160 nNarrowCellSize 40 rLightFactor 50 nMotionFrames 90 nRotationFrames 90 nUpDownFrames 45 fShadeObjects True fSkyAll False 77 | TempDelete ExtraDelete 78 | @p 2 @q False @r 3 @u 1 @v 17 @w 8 79 | fRedrawWhenBitmapEdited True n Macro13 80 | -------------------------------------------------------------------------------- /survmaz6.ds: -------------------------------------------------------------------------------- 1 | DS 2 | // Survivor Maze game #6 - A script file for Daedalus 3.5 3 | // By Walter D. Pullen, Astara@msn.com, http://www.astrolog.org/labyrnth.htm 4 | 5 | // Variable usage: 6 | // a-f: Whether poles #1 through #6 have been hit. 7 | // g-j: Player colors #1 through #4 (constant) 8 | // p: Player color index 9 | // q: Next thing for player to find (ranges from 1-13) 10 | // v-w: Temporary variables 11 | // x-y: X and Y coordinates of player during events 12 | // z: Event return value 13 | 14 | // Bitmap usage: 15 | // -1: Mono = Where walls are, Color = Color of walls 16 | // -2: Mono = Where floor markings are, Color = Color of floor markings 17 | // -3: Mono = Where semitransparent are, Color = Trigger indicators 18 | // 0: Color = Texture mapping 19 | // 1: Mono = Where variable height walls are, Color = Wall heights 20 | // 2-10: Mono = Textures for ladders, Color = Color of ladders 21 | // 11-12: Mono = Textures for pole letters 22 | // 13-14: Mono = Textures for arrows 23 | // 15: Mono = Temporary swap storage 24 | 25 | If Gte Version 2400 {Break} Message 'This script requires Daedalus 2.4 or later to run.' Break 26 | 27 | DefineMacro 1 {@x Inc @p @y Add @x 4 Message 'Welcome to Survivor!\n\nThis game simulates the Maze from the immunity challenge for the final four in "Survivor XI: Guatemala". The Maze is in the shape of the Seven Macaw, an ancient Maya deity that ruled the land at one time. Your goal is to navigate the bird shaped Maze, finding and touching six $x poles in any order, and also touching the $x station in the center atop the pyramid after each pole. $x was the color $y had in Survivor. Note the pyramid can only be reached by crossing the water in front of it.\n\nF1: Display this help text.\nF2: Restart Maze.\nF3: Switch background between day and night.\n\nJeff Probst says: "Survivors ready? Go!"'} "Help Text" 28 | DefineMacro 2 "fRedrawWhenBitmapEdited False SetVars 1 6 '0 0 0 0 0 0' @p Rnd 0 3 For (z) 0 5 {@x Var Add 27 Mul @z 2 @y Var Add 28 Mul @z 2 SetC @x @y Var Add 7 @p} @q 1 nX 140 nY 194 nZ 0 nDir 0 g cg fShowColorBitmap True fRedrawWhenBitmapEdited True n Macro1 fPauseTimer False ct" "Restart Maze" 29 | DefineMacro 3 "fRedrawWhenBitmapEdited False If Equ nInside 0 {i} IfElse fStars {Macro12} {fStars True nFogDistance 200 kSky Black k3DCeiling kSky kGround Dark Dark kGround kMountain Dark Dark DkGreen kMountain2 Dark DkGreen kCloud DkGray kCloud2 Dark kCloud} fRedrawWhenBitmapEdited True Spc" "Day And Night" 30 | 31 | DefineMacro 4 "If Gt nViewHeight 0 {Message 'You can't mark the ground from up here!' Break} SetCT nX nY Shade GetCT nX nY -20" "Mark Path" 32 | DefineMacro 5 "@w GetCE @x @y If Not @w {Break} If And Equ @w Yellow Neq GetCE nX nY Maize {Macro11 Break} If Gt @q 12 {Break} If Equ @w Green {Macro8 Break} If Gt @w 6 {Break} If Not Odd @q {Message 'You don't need to find a pole now.\nYou need to go to the center.' Break} IfElse Var @w {Message 'You've already been to this pole.\nYou need to find a pole you haven't visited yet.'} {SetVar @w True @q Inc @q @w Div @q 2 SetC @x @y LtGray Spc Message 'You find a pole!\nThis is pole #@w. Now go to the center!'}" "Wall Event" 33 | DefineMacro 6 "If Gt @q 12 {Break} If Neq nViewHeight 0 {Macro10 Break} @v GetCE nX nY If Neq @v Black {Break} @w GetCE @x @y If Equ @w DkBlue {Message 'Jeff Probst says: "Hey, you can only cross the water from the south end."' @z True Break} If And Odd @q Equ @w Blue {Message 'You don't want to cross the water to the pyramid yet.\nYou want to find and touch a pole first.' @z True Break} If Equ @w Purple {Message 'Jeff Probst says: "Hey, you can't leave the Maze! You haven't finished it yet."' @z True}" "Move Event" 34 | DefineMacro 7 "If Gt @q 12 {Break} IfElse Odd @q {@v Div Inc @q 2 MessageInside 'Seeking: Pole #@v' -1} {MessageInside 'Seeking: Center' -1}" "Inside Event" 35 | 36 | DefineMacro 8 "If Odd @q {@w Div Inc @q 2 Message 'You don't need to be at the center now. You need to go find pole #@w.' Break} @w GetC @x @y If Neq @w Var Add 7 @p {@w Inc @p Message 'This center station is not yours.\nYou want to touch the $w station.' Break} @q Inc @q If Gt @q 12 {Macro9 Break} @w Div Inc @q 2 Spc Message 'You've reached the center!\nNow cross one of the bridges to get back in the Maze, and go find pole #@w.'" "Hit Center" 37 | DefineMacro 9 "fPauseTimer True @w Timer @x Div @w 60 @y Mod @w 60 Message 'Congratulations, you've found all the poles and returned to the center! :-) You solved it in @x minutes, @y seconds.\n\nJeff gives you the immunity necklace, meaning you can't be voted out in Tribal Council. With this win you find yourself in the final three, and in a good position to hopefully do the most amazing thing in Survivor: Win the million dollar prize!'" "Win Game" 38 | DefineMacro 10 "If Neq nViewHeight GetH nX nY {Break} @v GetCE nX nY @w GetCE @x @y If And Equ @v Red Equ @w Black {@z True Break} If And Equ @v Yellow Equ @w Maize {@z True}" "Check Bridge" 39 | DefineMacro 11 "If And Equ GetCE nX nY Orange Lte @q 12 {Message 'Jeff Probst says: "Hey, you can't climb this ladder.\nYou can only get to the pyramid by crossing the water."' Break} nViewHeight GetH @x @y @z True" "Check Ladder" 40 | DefineMacro 12 "fStars False nFogDistance 0 kSky Cyan k3DCeiling kSky kGround DkGreen kGround2 -1 kMountain DkGreen kMountain2 Light DkGreen kCloud White kCloud2 -1" "Day Settings" 41 | DefineMacro 13 "For (z) 0 2 {@w Add 2 Mul @z 3 @y Add @y @z SetX Dec @x @y 2 @w SetX @x @y 2 Inc @w SetX Inc @x @y 2 Add @w 2}" "Make Ladder" 42 | DefineMacro 14 "Size 48 52 1 0 Size 281 269 0 0" "Shift Monochrome" 43 | DefineMacro 15 "SizeC 48 52 1 0 SizeC 281 269 0 0" "Shift Color" 44 | 45 | fRedrawWhenBitmapEdited False ResetProgram WindowTitle "- Survivor Maze Game 6" True nHorizontalScroll 8 nVerticalScroll 8 fHideMenu True fHideScrollbars True nOnMoveIntoWall 5 nOnMoveToNewCell 6 nAfterRedrawInside 7 46 | nRepeatDelayInMsec 25 kPassage Black kWall White kInsideWall Blend Gray Brown k3DWall Gray fShowDot True fWallsImpassable True fNoCornerHopping False fDragIsErase False fDoDragOnTemp True nEdgeBehavior 0 Macro12 fSealedEntrances False fMountains True nPeakHeight 30 nCloudCount 10 fSunAndMoon True fNarrowWalls True nInside 4 nCellSize 160 nNarrowCellSize 20 nWallHeight 500 nStepHeight 125 nClippingPlane 300 nMotionVelocity 25 nRotationVelocity 5 nUpDownVelocity 15 fFogGround True fMarkColor True nTextureWall 0 nWallVariable 1 fSolveFillersCheckEveryPixel True 47 | SetVars 7 4 "#FFBF00 #00FFFF #0000FF #3F3F3F" SetStrings 1 8 ",Blue,Yellow,Red,Black,Lydia,Stephenie,Rafe,Danni" SetVars 27 12 "34 22 150 22 38 42 146 42 46 78 138 78" @p Rnd 0 3 48 | 49 | Size 5 3 0 1 Turtle "T1BM2,0DNR2D" Zoom 1 5 0 2 = For (x) 0 2 {+ Size 5 Mul 15 Sub 3 @x 0 0 cDel @y Add 2 Mul @x 3 CopyMask -1 @y FlipHorizontal CopyMask -1 Add @y 2 Size 1 Mul Sub 3 @x 15 0 0 CopyMask -1 Inc @y SizeC 5 Mul 15 Sub 3 @x 0 1 Replace Black Maize 0 CopyTexture -1 @y CopyTexture -1 Add @y 2 SizeC -4 0 1 0 CopyTexture -1 Inc @y k} 50 | Size 24 69 0 1 Turtle "S4BM5,5T_P_BM5,37T_L_" Thicken Thicken cDel CopyMask -1 11 Del Turtle "BM0,5T_O_BM0,37T_E_S1" Thicken Thicken cDel CopyMask -1 12 51 | Size 34 29 0 1 Turtle "BM5,13R25NH8G8" Thicken Thicken Set 33 14 On Zoom 1 2 0 2 cDel CopyMask -1 13 FlipHorizontal CopyMask -1 14 52 | 53 | EmbedDB 54 | DB 55 | 47 73 24 56 | 57 | sa{{{c{{{c{{{c{{{c{{{c{{{c{{{c{{{c{{{c{{{c{{{c{{{c{{{c{{ 58 | sa{cfa{cpa{c 59 | sa{{{a{{{c{{{c{{{a{{{a{{{c{{{c{{{a{{{c{{{c{{{c{{{c{{{a{{ 60 | sa{c{a{cda{cda{c{a{yha{c 61 | oa{{{c{{{c{{{a{{{c{{{c{{{c{{{c{{{c{{{c{{{a{{{a{{{c{{{c{{{c{{{c{{ 62 | oa{cra{y{a{n 63 | oa{{{c{{{c{{{c{{{c{{{a{{{s{{{s{{{s{{{s{{{a{{{a{{ 64 | oa{cfa{c{a{sfa{y{a{y{a{n 65 | {{{c{{{c{{{c{{{c{{ba{{{c{{{c{{{a{{{c{{{c{{{a{{{a{{{a{{{s{{{s{{{a{{{a{{{n{{ 66 | gd{cba{cda{cba{c{a{c{a{s{a{sba{y{a{y{a{n 67 | {u{k{u{k{u{k{u{d{{ba{{{a{{{c{{{c{{{a{{{a{{{a{{{a{{{a{{{a{{{a{{{a{{{a{{ 68 | eg{k{d{cba{cfa{c{a{c{a{c{a{s{a{s{a{s{a{y{a{y{a{n 69 | eg{u{d{{{c{{{c{{{a{{{a{i{e{i{e{i{c{{{a{{{a{{{a{{{s{{{a{{{a{{{n{{ 70 | egaw{bdm{b{m{bbg{eba{c{a{sda{y{a{n 71 | eg{u{d{{{a{{{c{{{c{{{a{ibg{i{c{{{c{{{a{{{y{{{y{{{y{{{a{{ 72 | eg{k{d{cda{c{a{ebg{ela{n 73 | eg{u{d{{{n{{{n{{{a{{{a{i{w{i{e{i{s{{{a{{{y{{{y{{{y{{{y{{{n{{ 74 | eg{k{d{cba{n{a{c{a{c{j{cba{s{a{sfa{n 75 | eg{u{d{{{a{{{a{{{a{{{a{{{a{{{a{{{a{{{a{{{a{{{y{{{y{{{a{{ 76 | {g{v{g{vag{k{d{c{a{n{a{n{a{c{a{c{a{c{a{c{a{s{a{s{a{yba{y{a{n 77 | eg{u{d{{{a{{{a{{{a{{{a{{{a{{{a{{{a{{{a{{{a{{{a{{{a{{{a{{ 78 | eg{k{d{c{a{n{a{n{a{c{a{c{a{c{a{c{a{s{a{s{a{y{a{y{a{y{a{n 79 | aw{u{k{u{k{u{d{{{a{{{n{{{a{{{a{{{a{{{a{{{a{{{a{{{a{{{y{{{a{{{a{{ 80 | ajed{cda{c{a{cba{c{a{s{a{sda{y{a{n 81 | aa{{{c{{{c{{{c{{{c{{{n{{{n{{{a{{{c{{{c{{{a{{{a{{{y{{{y{{{y{{{a{{ 82 | ea{sxa{n 83 | ca{{{s{{{a{{{s{{{n{{{n{{{a{{{s{{{s{{{a{{{y{{{y{{{y{{{y{{{n{{ 84 | ca{sba{sda{n{a{cba{s{ahy 85 | ca{{ba{{{a{{{n{{{a{{{a{{{a{{{a{{{a{{fy{{ 86 | ga{s{a{s{a{n{a{n{a{c{a{s{a{s{ahy 87 | ga{{{a{{{a{{{a{{{a{{{a{{{a{{{a{{fy{{ 88 | ga{s{a{s{a{n{a{n{a{c{a{s{a{s{ahy 89 | ga{{{a{{{a{{{a{{{a{{{s{{{a{{{a{{fy{{ 90 | ga{sba{n{a{nda{s{ahy 91 | ga{{{s{{{s{{{a{{{s{{{s{{{s{{{a{{{y{{{y{{{y{{{y{{ 92 | ua{yba{n 93 | ga{{{s{{{s{{{a{{{s{{{s{{{s{{{a{{{a{{{a{{ 94 | ga{sba{n{a{nda{y{a{y{a{y{a{n 95 | ga{{{a{{{a{{{a{{{a{{{y{{{a{{{a{{{a{{{a{{ 96 | ga{s{a{s{a{n{a{n{a{y{a{y{a{y{a{y{a{y{a{n 97 | ga{{{a{{{a{{{a{{{a{{{a{{{a{{{a{{{y{{{a{{ 98 | ga{s{a{s{a{n{a{n{a{y{a{y{a{yda{n 99 | ca{{{y{{{a{{{a{{{n{{{a{{{a{{{a{{{a{{{n{{{n{{{n{{ 100 | ca{yba{sda{n{a{yba{n 101 | ca{{{y{{{a{{{s{{{n{{{n{{{a{{{y{{{n{{ 102 | ea{y{a{sha{n 103 | aa{{{y{{{y{{{a{{{s{{{n{{{n{{{y{{{a{{ 104 | aa{yfa{nda{y{a{n 105 | aa{{{a{{{y{{{y{{{a{{{a{{{y{{{y{{{a{{ 106 | aa{yda{y{a{nfa{n 107 | aa{{{y{{{y{{{y{{{a{{{a{{{n{{{n{{{n{{ 108 | ia{n{a{c 109 | aa{{{y{{{y{{{y{{{a{{{a{{ 110 | aa{yda{y{a{n{a{c 111 | aa{{{a{{{y{{{a{{{a{{{a{{ 112 | aa{y{a{yba{y{a{n{a{c 113 | aa{{{a{{{y{{{y{{{a{{{a{{ 114 | aa{yha{c 115 | aa{{{y{{{a{{{c{{{c{{{c{{ 116 | ca{c{a{c{a{c 117 | ca{{{a{{{a{{ 118 | ca{c{a{c{a{c 119 | ca{{{a{{{a{{ 120 | ca{cba{c 121 | ca{{{c{{{a{{ 122 | ea{c{a{c 123 | ea{{{a{{ 124 | ea{c{a{c 125 | ea{{{a{{ 126 | ea{c{a{c 127 | ea{{{a{{ 128 | ea{c{a{c 129 | ea{{{c{{ 130 | 131 | EmbedDB 132 | DB 133 | 70 134 1 134 | 135 | Q 136 | _ 137 | `A 138 | `Q 139 | `Y 140 | `] 141 | | 142 | `_ 143 | |5 144 | n 145 | nd(Y 146 | nAc`_ 147 | nQb(nA 148 | nYb@nQ 149 | n_a$oY 150 | oY!p] 151 | u_ 152 | vA 153 | vY 154 | w 155 | w] 156 | wY 157 | wQ 158 | wA 159 | v_ 160 | vY 161 | vA 162 | u] 163 | u 164 | | 165 | uA 166 | | 167 | uQ 168 | uY 169 | u_ 170 | vA 171 | v] 172 | w 173 | w] 174 | wY 175 | wA 176 | w 177 | v] 178 | t](Q 179 | t_ 180 | | 181 | u 182 | uA 183 | uQ 184 | u] 185 | v 186 | vQ 187 | v] 188 | w 189 | t$nQ 190 | tA0_ 191 | tQ 192 | tY 193 | t] 194 | t_ 195 | u 196 | uQ 197 | u] 198 | v 199 | s"nQ 200 | sA(_ 201 | sQ 202 | sY 203 | s] 204 | s_ 205 | t 206 | tA 207 | tY 208 | r(`] 209 | rBn 210 | rA0Q 211 | rQ 212 | rY 213 | | 214 | r] 215 | r_ 216 | p]n 217 | p]0`A 218 | p_$`Q 219 | p_!`Y 220 | q!( 221 | qA 222 | | 223 | qQ 224 | qY 225 | q] 226 | q_ 227 | oQn 228 | oY$Y 229 | oY 230 | o] 231 | | 232 | o_ 233 | | 234 | p 235 | pA 236 | pQ 237 | n^`Y 238 | n](A 239 | n] 240 | n_ 241 | |2 242 | o 243 | | 244 | oA 245 | | 246 | n(A 247 | n!Q 248 | n 249 | |4 250 | nA 251 | |2 252 | `PA 253 | `(A 254 | _$Q 255 | ]"Q 256 | Y!Q 257 | Y!1 258 | Q 259 | A 260 | 261 | Zoom 2 2 0 0 Size 141 269 0 0 Thicken = FlipHorizontal _ Size 140 0 1 0 TempOr Turtle "C0BM129,15R2D2L2U2C1BM120,12S2L4DL3DL2D2LD2LD2RUR5DR3BH`S1" CopyMask -1 15 262 | k = FlipHorizontal _ SizeC 46 0 1 0 TempOr = For (z) 0 3 {SetC Add 43 Mul @z 2 19 Var Add 7 @z} Bias 1 3 1 3 _ Bias 1 3 1 3 _ 263 | Replace Gray DkGray 0 @z GrayN 239 Replace White LtGray 0 Replace Cyan LtGray 0 Replace DkCyan Var 7 0 Replace Magenta @z 0 Replace Purple @z 0 Replace DkBlue Blue 0 Replace Blue Var 7 0 Replace Pink @z 0 Replace DkGreen @z 0 Replace Maroon @z 0 Replace Green Pink 0 nX 144 nY 60 kDot Blend Green Cyan ` kDot Green 264 | _ Replace White 232 0 @z UD 200 22 0 Replace Blue @z 0 Replace Red @z 0 Replace Yellow @z 0 Replace Gray @z 0 Replace Maroon 200 0 Replace DkGreen 200 0 Replace Green UD 600 590 0 Replace Pink 600 0 Replace Orange UD 680 590 0 @z 700 Replace Magenta @z 0 Replace Cyan @z 0 @z 675 Replace Purple @z 0 Replace DkCyan UD @z 22 0 Replace DkBlue UD 600 22 0 Replace Maize UD 600 590 0 265 | _ SetC 83 53 Red SetC 101 53 Red @z UD 200 190 SetCT 83 53 @z SetCT 101 53 @z 266 | For (z) 0 5 {nX 91 nX2 93 nY Add 55 Mul @z 6 nY2 Add nY 2 kWall Maroon 2ndBlock _ kWall 25 2ndBlock _} kWall White 267 | ColorPut Del Turtle "BM57,33R2BM125,33R2BM79,28D17R26U17BU4U5L26D5" k _ ColorOr Replace White 400 0 _ 268 | \ Del CopyTexture -1 0 @x 58 @y 32 Macro13 @x 126 @y 32 Macro13 @x 90 @y 44 Macro13 @x 94 @y 44 Macro13 - 269 | For (z) 0 5 {@x Var Add 27 Mul @z 2 @y Var Add 28 Mul @z 2 SetC @x @y White SetCT @x @y 125 SetX Sub @x 2 Dec @y 3 12 SetX Sub @x 2 Inc @y 3 11 SetX Add @x 2 Dec @y 1 11 SetX Add @x 2 Inc @y 1 12 SetX Dec @x Add @y 2 0 12 SetX Inc @x Add @y 2 0 11 SetCE @x @y Inc @z} For (z) 0 1 {@x Add 56 Mul @z 68 SetX @x 37 3 14 SetX Add @x 4 37 1 13} SetX 84 55 3 13 SetX 100 55 1 14 CopyTexture -2 1 270 | - kWall Green nY 37 nY2 39 For (z) 0 3 {nX Add 85 Mul @z 4 nX2 Add nX 2 2ndBlock} - 271 | ColorPut = sDel CopyMask -1 1 Size 93 73 0 1 Turtle "BM31,13R0BR2R4BR18R4BR2R0" \ _ - Bias 1 3 1 3 - 272 | = Del nX 85 nY 53 nX2 99 nY2 89 2ndBlock k _ Del kWall Rgb 0 0 191 2ndBlock _ - kWall DkBlue 2ndBlock nY Sub nY2 3 kWall Blue 2ndBlock - k _ k 273 | - For (z) 0 1 {kWall Maroon nY2 29 nY 25 nX Add 57 Mul @z 68 nX2 Add nX 2 2ndBlock nY 23 nX Add 81 Mul @z 20 nX2 Add nX 2 2ndBlock kWall Red nY 25 nY2 27 nX Add 59 Mul @z 44 nX2 Add nX 22 2ndBlock kWall Orange nX Add 57 Mul @z 68 nX2 Add nX 2 nY 36 nY2 Inc nY 2ndBlock kWall Yellow nY 31 nY2 Add nY 4 2ndBlock nX Add 89 Mul @z 4 nX2 Add nX 2 nY 43 nY2 Add nY 4 2ndBlock kWall Maize nY 33 nY2 Add nY 4 For (x) 0 1 (nX Add Add 55 Mul @z 68 Mul @x 5 nX2 Inc nX 2ndBlock) nX Add 87 Mul @z 9 nX2 Inc nX nY 45 nY2 Add nY 3 2ndBlock} kWall Purple nX 81 nY 143 nX2 103 nY2 Inc nY 2ndBlock - 274 | k Macro14 _ Macro14 _ - Macro14 - SwapMask -1 1 Macro14 SwapMask -1 1 k Macro15 _ Macro15 _ - Macro15 - SwapTexture -1 0 Macro15 SwapTexture -1 0 SwapTexture -1 1 Macro15 SwapTexture -1 1 For (z) 0 5 {@x Var Add 27 Mul @z 2 @y Var Add 28 Mul @z 2 @x Add @x 48 @y Add @y 52 SetVar Add 27 Mul @z 2 @x SetVar Add 28 Mul @z 2 @y} _ k SwapMask -1 15 = kWall Rgb 0 0 1 ColorOr Replace Rgb 0 0 1 Rgb 183 167 151 0 fSkipMessageDisplay True NoBoundary ? TempXor kWall White ColorOr _ SwapMask -1 15 275 | Macro2 276 | -------------------------------------------------------------------------------- /graphics.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Daedalus (Version 3.5) File: graphics.h 3 | ** By Walter D. Pullen, Astara@msn.com, http://www.astrolog.org/labyrnth.htm 4 | ** 5 | ** IMPORTANT NOTICE: Daedalus and all Maze generation and general 6 | ** graphics routines used in this program are Copyright (C) 1998-2024 by 7 | ** Walter D. Pullen. Permission is granted to freely use, modify, and 8 | ** distribute these routines provided these credits and notices remain 9 | ** unmodified with any altered or distributed versions of the program. 10 | ** The user does have all rights to Mazes and other graphic output 11 | ** they make in Daedalus, like a novel created in a word processor. 12 | ** 13 | ** More formally: This program is free software; you can redistribute it 14 | ** and/or modify it under the terms of the GNU General Public License as 15 | ** published by the Free Software Foundation; either version 2 of the 16 | ** License, or (at your option) any later version. This program is 17 | ** distributed in the hope that it will be useful and inspiring, but 18 | ** WITHOUT ANY WARRANTY; without even the implied warranty of 19 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 20 | ** General Public License for more details, a copy of which is in the 21 | ** LICENSE.HTM included with Daedalus, and at http://www.gnu.org 22 | ** 23 | ** This file contains definitions for general graphics routines, that operate 24 | ** on a monochrome bitmap, unrelated to Mazes. 25 | ** 26 | ** Created: 7/1/1993. 27 | ** Last code change: 10/30/2024. 28 | */ 29 | 30 | /* 31 | ****************************************************************************** 32 | ** Constants 33 | ****************************************************************************** 34 | */ 35 | 36 | #define xBitmap (lHighest - 31) 37 | #define yBitmap lHighest 38 | #define xStart 63 39 | #define yStart 63 40 | #define zBitmapStack 1024 41 | #define wClient1Def 16 42 | #define wClient2Def 16 43 | #define wClient3Def 16 44 | #define wClient4Def 4 45 | 46 | #define fOff 0 47 | #define fOn 1 48 | 49 | #define DIRS 4 50 | #define DIRS1 (DIRS-1) 51 | #define DIRS2 8 52 | 53 | 54 | /* 55 | ****************************************************************************** 56 | ** Macros 57 | ****************************************************************************** 58 | */ 59 | 60 | #define CbBitmapRow(x) ((((x) + 31) >> 5) << 2) 61 | #define CbBitmap(x, y) LMul(y, CbBitmapRow(x)) 62 | #define Lf(x) (1L << ((x)&31 ^ 7)) 63 | 64 | #define GetP(b, x, y) ((b) != NULL && !(b)->FNull() && (b)->Get(x, y)) 65 | #define DirInc(d) d = ((d) + 1) & DIRS1 66 | #define DirDec(d) d = ((d) - 1) & DIRS1 67 | #define FDitherCore(col, x, y) ((col) >= rgnDitherPoint[((y) << 2) + (x)]) 68 | #define FDither(col, x, y) FDitherCore(col, (x) & 3, (y) & 3) 69 | #define NBinary(f0, f1, f2, f3, f4, f5, f6, f7) \ 70 | ((f0 << 4) | (f1 << 1) | (f2 << 5) | (f3 << 2) | \ 71 | (f4 << 6) | (f5 << 3) | (f6 << 7) | (f7 << 0)) 72 | 73 | 74 | /* 75 | ****************************************************************************** 76 | ** Types 77 | ****************************************************************************** 78 | */ 79 | 80 | class CMap; // Forward 81 | typedef flag bit; 82 | typedef long KV; 83 | 84 | typedef struct _graphicssettings { 85 | // Display settings 86 | 87 | flag fTraceDot; 88 | flag fErrorCheck; 89 | CMap *bFocus; 90 | 91 | // Macro accessible only settings 92 | 93 | int turtlex; 94 | int turtley; 95 | int turtles; 96 | int turtlea; 97 | KV turtlec; 98 | flag turtleo; 99 | int turtlet; 100 | int grfLifeDie; 101 | int grfLifeBorn; 102 | } GS; 103 | 104 | extern CONST int xoff[DIRS2], yoff[DIRS2], xoff2[DIRS2], yoff2[DIRS2]; 105 | extern CONST int rgfOr[3], rgfAnd[3], rgfXor[3]; 106 | extern CONST int rgnDitherPoint[16]; 107 | extern CONST int rggrfNeighbor[25]; 108 | extern GS gs; 109 | 110 | class CMap // Base bitmap independent of pixel type 111 | { 112 | public: 113 | int m_x; // Horizontal pixel size of bitmap 114 | int m_y; // Vertical pixel size of bitmap 115 | int m_clRow; // Longs per row in bitmap 116 | int m_cfPix; // Bits in each pixel 117 | int m_w3; // 3D bitmap W size 118 | int m_x3; // 3D bitmap X size 119 | int m_y3; // 3D bitmap Y size 120 | int m_z3; // 3D bitmap Z size 121 | byte *m_rgb; // Bytes of bitmap bits 122 | 123 | INLINE CMap() 124 | { Init(); } 125 | INLINE ~CMap() 126 | { Free(); } 127 | INLINE void Init() 128 | { m_x = m_y = 0; m_rgb = NULL; } 129 | INLINE void Free() 130 | { if (m_rgb != NULL) { DeallocateP(m_rgb); m_rgb = NULL; } } 131 | INLINE dword *_Rgl(long i) CONST 132 | { return (dword *)&m_rgb[i << 2]; } 133 | INLINE flag FVisible() CONST 134 | { return this == gs.bFocus; } 135 | INLINE void Copy3(CONST CMap &b) 136 | { m_w3 = b.m_w3; m_x3 = b.m_x3; m_y3 = b.m_y3; m_z3 = b.m_z3; } 137 | INLINE void CopyFrom(CMap &b) 138 | { m_x = b.m_x; m_y = b.m_y; m_clRow = b.m_clRow; m_cfPix = b.m_cfPix; 139 | Copy3(b); Free(); m_rgb = b.m_rgb; b.m_rgb = NULL; } 140 | INLINE void SwapWith(CMap &b) 141 | { SwapN(m_x, b.m_x); SwapN(m_y, b.m_y); SwapN(m_clRow, b.m_clRow); 142 | SwapN(m_cfPix, b.m_cfPix); SwapN(m_w3, b.m_w3); SwapN(m_x3, b.m_x3); 143 | SwapN(m_y3, b.m_y3); SwapN(m_z3, b.m_z3); 144 | byte *pT; pT = m_rgb; m_rgb = b.m_rgb; b.m_rgb = pT; } 145 | 146 | INLINE flag FNull() CONST 147 | { return m_rgb == NULL; } 148 | INLINE flag FZero() CONST 149 | { return m_x < 1 || m_y < 1; } 150 | INLINE flag F64K() CONST 151 | { return m_x > 0xFFFF || m_y > 0xFFFF; } 152 | INLINE flag FLegal(int x, int y) CONST 153 | { return (uint)x < (uint)m_x && (uint)y < (uint)m_y; } 154 | INLINE flag FLegalOff(int x, int y) CONST 155 | { return FLegal(x, y) && !Get(x, y); } 156 | INLINE flag FColor() CONST 157 | { return m_cfPix > 1; } 158 | INLINE KV GetSafe(int x, int y) 159 | { return FNull() ? fOff : Get(x, y); } 160 | INLINE void BitmapOff() 161 | { BitmapSet(0); } 162 | INLINE void BitmapOn() 163 | { BitmapSet(dwSet); } 164 | INLINE void Edge(int x1, int y1, int x2, int y2, KV kv) 165 | { Box(x1, y1, x2, y2, 1, 1, kv); } 166 | INLINE void BoxAll(int xsiz, int ysiz, KV kv) 167 | { Box(0, 0, m_x-1, m_y-1, xsiz, ysiz, kv); } 168 | INLINE void BitmapRotateR() 169 | { FBitmapTranspose(); BitmapFlipX(); } 170 | INLINE void BitmapRotateL() 171 | { FBitmapTranspose(); BitmapFlipY(); } 172 | INLINE void BitmapRotateA() 173 | { BitmapFlipX(); BitmapFlipY(); } 174 | INLINE flag FBitmapZoomBy(real x, real y, flag f) 175 | { return FBitmapZoomTo((int)((real)m_x*x + rMinute), 176 | (int)((real)m_y*y + rMinute), f); } 177 | INLINE flag FBitmapTessellateBy(real x, real y) 178 | { return FBitmapTessellateTo((int)((real)m_x*x + rMinute), 179 | (int)((real)m_y*y + rMinute)); } 180 | 181 | // Core methods each bitmap type implements 182 | virtual CMap *Create() = 0; 183 | virtual void Destroy() = 0; 184 | virtual flag FAllocate(int, int, CONST CMap *) = 0; 185 | 186 | virtual KV Get(int, int) CONST = 0; 187 | virtual void Set(int, int, KV) = 0; 188 | virtual void Set0(int, int) = 0; 189 | virtual void Set1(int, int) = 0; 190 | virtual void Inv(int, int) = 0; 191 | virtual void LineX(int, int, int, KV) = 0; 192 | virtual void LineY(int, int, int, KV) = 0; 193 | virtual void Line(int, int, int, int, KV) = 0; 194 | virtual flag FTriangle(int, int, int, int, int, int, KV, int) = 0; 195 | virtual flag FQuadrilateral(int, int, int, int, int, int, int, int, 196 | KV, int) = 0; 197 | virtual void Block(int, int, int, int, KV) = 0; 198 | virtual void BlockMove(CONST CMap &, int, int, int, int, int, int) = 0; 199 | 200 | virtual void BitmapSet(KV) = 0; 201 | virtual long BitmapCount() CONST = 0; 202 | virtual void BitmapFlipX() = 0; 203 | virtual flag FBitmapSizeSet(int, int) = 0; 204 | virtual flag FBitmapZoomTo(int, int, flag) = 0; 205 | virtual flag FBitmapBias(int, int, int, int) = 0; 206 | virtual flag FBitmapAccentBoundary() = 0; 207 | 208 | // Shared methods covering all bitmap implementations 209 | void Legalize(int *, int *) CONST; 210 | void Legalize2(int *, int *) CONST; 211 | 212 | void LineZ(int, int, int, int, KV); 213 | void LineSetup(MM *, int, int, int, int) CONST; 214 | void BlockReverse(int, int, int, int); 215 | void Box(int, int, int, int, int, int, KV); 216 | void Disk(int, int, int, int, KV); 217 | void Circle(int, int, int, int, KV); 218 | void ArcQuadrant(int, int, int, int, KV); 219 | void ArcQuadrantSub(int, int, int, int, int, int, int *, int *, KV); 220 | void ArcPolygon(int, int, int, int, int, int, int, int, KV); 221 | void ArcReal(real, real, real, real, real, KV); 222 | 223 | flag FBitmapCopy(CONST CMap &); 224 | flag FBitmapResizeTo(int, int); 225 | flag FBitmapShiftBy(int, int); 226 | void BitmapFlipY(); 227 | flag FBitmapTranspose(); 228 | void BitmapTessellate(CONST CMap &); 229 | flag FBitmapTessellateTo(int x, int y); 230 | flag FBitmapCollapse(); 231 | flag FBitmapSlide(int, int); 232 | flag FBitmapEditRowColumn(int, int, flag, flag); 233 | 234 | flag FZoomSprite(CMap *bMaz, CONST CMap &bPic); 235 | }; 236 | 237 | class CMon : virtual public CMap // Monochrome bitmap 238 | { 239 | public: 240 | INLINE long _Il(int x, int y) CONST 241 | { return y*m_clRow + (x >> 5); } 242 | INLINE dword *_Pl(long i) CONST 243 | { return (dword *)&m_rgb[i << 2]; } 244 | INLINE dword *_Pl(int x, int y) CONST 245 | { return _Pl(_Il(x, y)); } 246 | INLINE dword _L(int x, int y) CONST 247 | { return *_Pl(x, y); } 248 | INLINE flag _Get(int x, int y) CONST 249 | { return (_L(x, y) & Lf(x)) != 0; } 250 | INLINE KV GetFast(int x, int y) CONST 251 | { return FLegal(x, y) ? _Get(x, y) : fOff; } 252 | 253 | INLINE flag FLegalFill(int x, int y, KV kv) CONST 254 | { return FLegal(x, y) && Get(x, y) != kv; } 255 | INLINE flag FFill(int x, int y, KV kv) 256 | { return FFillCore(x, y, kv, fFalse); } 257 | INLINE flag FFlood(int x, int y, KV kv) 258 | { return FFillCore(x, y, kv, fTrue); } 259 | INLINE flag FFillReverse(int x, int y) 260 | { return FFill(x, y, !Get(x, y)); } 261 | INLINE flag FFloodReverse(int x, int y) 262 | { return FFlood(x, y, !Get(x, y)); } 263 | INLINE void BlockPutOrAnd(CONST CMon &b, int x, int y, CONST int *rgf) 264 | { BlockMoveOrAnd(b, 0, 0, b.m_x-1, b.m_y-1, x, y, rgf); } 265 | 266 | // Core methods each bitmap type implements 267 | virtual CMap *Create() OVERRIDE 268 | { CMon *b; b = new CMon; if (b == NULL) return NULL; return (CMap *)b; } 269 | virtual void Destroy() OVERRIDE 270 | { delete this; } 271 | virtual flag FTriangle(int x1, int y1, int x2, int y2, int x3, int y3, 272 | KV kv, int nTrans) OVERRIDE 273 | { return FTriangle(x1, y1, x2, y2, x3, y3, kv); } 274 | virtual flag FQuadrilateral(int x1, int y1, int x2, int y2, int x3, int y3, 275 | int x4, int y4, KV kv, int nTrans) OVERRIDE 276 | { return FQuadrilateral(x1, y1, x2, y2, x3, y3, x4, y4, kv); } 277 | 278 | virtual flag FAllocate(int, int, CONST CMap *) OVERRIDE; 279 | 280 | virtual KV Get(int, int) CONST OVERRIDE; 281 | virtual void Set(int, int, KV) OVERRIDE; 282 | virtual void Set0(int, int) OVERRIDE; 283 | virtual void Set1(int, int) OVERRIDE; 284 | virtual void Inv(int, int) OVERRIDE; 285 | virtual void LineX(int, int, int, KV) OVERRIDE; 286 | virtual void LineY(int, int, int, KV) OVERRIDE; 287 | virtual void Line(int, int, int, int, KV) OVERRIDE; 288 | virtual void Block(int, int, int, int, KV) OVERRIDE; 289 | virtual void BlockMove(CONST CMap &, int, int, int, int, int, int) OVERRIDE; 290 | 291 | virtual void BitmapSet(KV) OVERRIDE; 292 | virtual long BitmapCount() CONST OVERRIDE; 293 | virtual void BitmapFlipX() OVERRIDE; 294 | virtual flag FBitmapSizeSet(int, int) OVERRIDE; 295 | virtual flag FBitmapZoomTo(int, int, flag) OVERRIDE; 296 | virtual flag FBitmapBias(int, int, int, int) OVERRIDE; 297 | virtual flag FBitmapAccentBoundary() OVERRIDE; 298 | 299 | // Extra methods specific to monochrome bitmaps 300 | flag FLineUntil(int, int, int, int, int *, int *, KV, flag, flag); 301 | flag FTriangle(int, int, int, int, int, int, int); 302 | flag FQuadrilateral(int, int, int, int, int, int, int, int, int); 303 | void BlockMoveOrAnd(CONST CMon &, int, int, int, int, int, int, 304 | CONST int *); 305 | flag Turtle(CONST char *); 306 | flag FFillCore(int, int, KV, flag); 307 | long AnalyzePerimeter(int, int, flag) CONST; 308 | 309 | flag FBitmapFind(int *, int *, bit) CONST; 310 | flag FBitmapSubset(CONST CMon &) CONST; 311 | void BitmapReverse(); 312 | void BitmapRandom(int, int); 313 | void BitmapMoire(); 314 | void BitmapMoveOrAnd(CONST CMon &, CONST int *); 315 | void BitmapOr(CONST CMon &); 316 | void BitmapAnd(CONST CMon &); 317 | void BitmapXor(CONST CMon &); 318 | void BitmapBlend(CONST CMon &); 319 | 320 | long BitmapSmooth(flag); 321 | long BitmapSmoothCorner(bit); 322 | long BitmapThicken(); 323 | long BitmapThicken2(int, flag); 324 | flag FBitmapThinCore(int, int, flag); 325 | long BitmapThinner(flag); 326 | flag FBitmapConvex(int, int, int, int); 327 | flag FBitmapAccentContrast(flag); 328 | void BitmapSeen(int, int, int); 329 | flag FStereogram(CONST CMon &, int, int); 330 | long LifeGenerate(flag); 331 | 332 | flag FReadBitmapCore(FILE *, int, int); 333 | void WriteBitmap(FILE *, KV, KV) CONST; 334 | flag FReadText(FILE *); 335 | void WriteText(FILE *, flag, flag, flag) CONST; 336 | flag FReadXbm(FILE *); 337 | void WriteXbm(FILE *, CONST char *, char) CONST; 338 | flag FReadDaedalusBitmapCore(FILE *, int, int); 339 | void WriteDaedalusBitmap(FILE *, flag) CONST; 340 | }; 341 | 342 | 343 | /* 344 | ****************************************************************************** 345 | ** Bitmap Primitives 346 | ****************************************************************************** 347 | */ 348 | 349 | extern void UpdateDisplay(void); 350 | extern void ScreenDot(int, int, bit, KV); 351 | 352 | 353 | /* 354 | ****************************************************************************** 355 | ** Bitmap Flooding 356 | ****************************************************************************** 357 | */ 358 | 359 | #define FillPush(xnew, ynew) rgpt[ipt].x = (xnew); rgpt[ipt].y = (ynew); ipt++ 360 | #define FillPop(xnew, ynew) ipt--; xnew = rgpt[ipt].x; ynew = rgpt[ipt].y 361 | 362 | 363 | /* 364 | ****************************************************************************** 365 | ** Bitmap Transformations 366 | ****************************************************************************** 367 | */ 368 | 369 | extern flag FSetLife(CONST char *, int); 370 | 371 | 372 | /* 373 | ****************************************************************************** 374 | ** Bitmap File Routines 375 | ****************************************************************************** 376 | */ 377 | 378 | extern flag FReadBitmapHeader(FILE *, flag, int *, int *, int *, int *); 379 | 380 | /* graphics.h */ 381 | --------------------------------------------------------------------------------