├── scripts ├── formatCode.sh ├── tidyUp.sh ├── findInFiles.sh ├── compile_Windows.bat ├── debug_Windows.bat ├── compile_Linux.sh ├── debug_Linux.sh ├── README.md ├── fp.ini ├── fp.cfg └── ptop.cfg ├── Game Manual.pdf ├── docs ├── public.gif ├── automated.gif ├── private.gif ├── protected.gif ├── published.gif ├── ClassHierarchy.html ├── index.html ├── intro.html ├── crypt.coordinates.html ├── map.tile.html ├── items.Item.html ├── village.coordinates.html ├── entities.Creature.html ├── smallGrid.coordinates.html ├── globalUtils.coordinates.html ├── map.displayTile.html ├── scrTargeting.Equipment.html ├── island.locationTile.html ├── scrThrow.TthrowTargets.html ├── island.displayTile.html ├── island.overworldTile.html ├── player_inventory.Equipment.html ├── merchant_inventory.Equipment.html ├── scrTitle.html ├── scrIntro.html ├── legend.html ├── scrWinAlpha.html ├── arrow.html ├── rock.html ├── pixie_jar.html ├── Axes.html ├── wine_flask.html ├── ale_tankard.html ├── resolution.html ├── cloth_armour1.html ├── pixie_jar_dim.html ├── leather_armour1.html ├── lesser_bone_armour.html ├── gold_pieces.html ├── ai_villager.html ├── web.html ├── scrHelp.html ├── scrOverworld.html ├── merchant.html ├── smugglersMap.html ├── scrGame.html ├── scrCharacter.html ├── potion_curePoison.html ├── basic_club.html ├── short_bow.html ├── parchment.html ├── terbutje.html └── pointy_stick.html ├── source ├── Axes.ico ├── Axes.res ├── findInFiles.sh ├── player │ └── emptyslot.pp ├── entities │ ├── npc │ │ ├── merchant_inventoryemptyslot.pp │ │ ├── merchant.pas │ │ ├── pig.pas │ │ ├── villager.pas │ │ └── village_idiot.pas │ ├── nextto.pp │ └── bugs │ │ └── web.pas ├── logging.pas ├── items │ ├── arrow.pas │ ├── rock.pas │ ├── large_ale.pas │ ├── ale_tankard.pas │ ├── gold_pieces.pas │ ├── macguffins │ │ ├── smugglersmap.pas │ │ └── parchment.pas │ ├── pixie_jar_dim.pas │ ├── elven_wine.pas │ ├── pixie_jar.pas │ ├── wine_flask.pas │ ├── armour │ │ ├── cloth_armour1.pas │ │ ├── lesser_bone_armour.pas │ │ └── leather_armour1.pas │ ├── weapons │ │ ├── short_bow.pas │ │ ├── basic_club.pas │ │ ├── leather_whip.pas │ │ ├── terbutje.pas │ │ ├── pointy_stick.pas │ │ ├── gnomish_axe.pas │ │ └── necro_axe.pas │ └── traps │ │ └── poison_spore.pas ├── screens │ ├── resolution.pas │ ├── scrwinalpha.pas │ ├── scrtitle.pas │ ├── scrintro.pas │ ├── scrgame.pas │ ├── scrcharintro.pas │ └── scroverworld.pas ├── Axes.pas ├── globalutils.pas └── debuggingfunctions.pas ├── GITscreenshots ├── Logo.png ├── LinuxAAA.gif ├── Linux_RIP.png ├── NewLogo.png ├── Linux_dungeon.png ├── Linux_screenshot1.png ├── Linux_titlescreen.png └── Windows_screenshot.png ├── .gitignore ├── LICENSE └── README.md /scripts/formatCode.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ptop -c ptop.cfg $1 $1 3 | -------------------------------------------------------------------------------- /scripts/tidyUp.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | delp -r ./ 3 | ctags -R --languages=Pascal 4 | -------------------------------------------------------------------------------- /Game Manual.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberfilth/Axes-Armour-Ale/HEAD/Game Manual.pdf -------------------------------------------------------------------------------- /docs/public.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberfilth/Axes-Armour-Ale/HEAD/docs/public.gif -------------------------------------------------------------------------------- /scripts/findInFiles.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | grep --color=always --include=\*.pas -rnw . -e $1 3 | -------------------------------------------------------------------------------- /source/Axes.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberfilth/Axes-Armour-Ale/HEAD/source/Axes.ico -------------------------------------------------------------------------------- /source/Axes.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberfilth/Axes-Armour-Ale/HEAD/source/Axes.res -------------------------------------------------------------------------------- /source/findInFiles.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | grep --color=always --include=\*.pas -rnw . -e $1 3 | -------------------------------------------------------------------------------- /docs/automated.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberfilth/Axes-Armour-Ale/HEAD/docs/automated.gif -------------------------------------------------------------------------------- /docs/private.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberfilth/Axes-Armour-Ale/HEAD/docs/private.gif -------------------------------------------------------------------------------- /docs/protected.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberfilth/Axes-Armour-Ale/HEAD/docs/protected.gif -------------------------------------------------------------------------------- /docs/published.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberfilth/Axes-Armour-Ale/HEAD/docs/published.gif -------------------------------------------------------------------------------- /GITscreenshots/Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberfilth/Axes-Armour-Ale/HEAD/GITscreenshots/Logo.png -------------------------------------------------------------------------------- /GITscreenshots/LinuxAAA.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberfilth/Axes-Armour-Ale/HEAD/GITscreenshots/LinuxAAA.gif -------------------------------------------------------------------------------- /GITscreenshots/Linux_RIP.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberfilth/Axes-Armour-Ale/HEAD/GITscreenshots/Linux_RIP.png -------------------------------------------------------------------------------- /GITscreenshots/NewLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberfilth/Axes-Armour-Ale/HEAD/GITscreenshots/NewLogo.png -------------------------------------------------------------------------------- /GITscreenshots/Linux_dungeon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberfilth/Axes-Armour-Ale/HEAD/GITscreenshots/Linux_dungeon.png -------------------------------------------------------------------------------- /GITscreenshots/Linux_screenshot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberfilth/Axes-Armour-Ale/HEAD/GITscreenshots/Linux_screenshot1.png -------------------------------------------------------------------------------- /GITscreenshots/Linux_titlescreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberfilth/Axes-Armour-Ale/HEAD/GITscreenshots/Linux_titlescreen.png -------------------------------------------------------------------------------- /GITscreenshots/Windows_screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberfilth/Axes-Armour-Ale/HEAD/GITscreenshots/Windows_screenshot.png -------------------------------------------------------------------------------- /scripts/compile_Windows.bat: -------------------------------------------------------------------------------- 1 | if not exist "..\source\lib\i386-win32" ( 2 | mkdir "..\source\lib\i386-win32" 3 | ) 4 | cd ..\source 5 | fpc Axes.pas -MObjFPC -Scghi -CX -Os3 -Xs -XX -l -vewnhibq -Filib\i386-win32 -Fientities -Fidungeons -Fudungeons -Fuentities -Fuitems -Fuplayer -Fuscreens -Fuvision -Fuentities\animals -Fuentities\bugs -Fuentities\fungus -Fuentities\gnomes -Fuentities\hobs -Fuitems\armour -Fuitems\macguffins -Fuitems\weapons -Fuentities\bogles -Fuentities\undead -Fuentities\goblinkin -Fuentities\troglodytes -Fuentities\npc -Fuitems\traps -Fu. -FUlib\i386-win32 -FE. -oAxes.exe 6 | -------------------------------------------------------------------------------- /scripts/debug_Windows.bat: -------------------------------------------------------------------------------- 1 | if not exist "..\source\lib\i386-win32" ( 2 | mkdir "..\source\lib\i386-win32" 3 | ) 4 | cd ..\source 5 | fpc Axes.pas -Mfpc -Scaghi -CirotR -O1 -gw2 -godwarfsets -gl -gh -Xg -gt -l -vewnhibq -Filib\i386-win32 -Fientities -Fudungeons -Fuentities -Fuitems -Fuplayer -Fuscreens -Fuvision -Fuentities\animals -Fuentities\fungus -Fuentities\gnomes -Fuentities\hobs -Fuitems\armour -Fuitems\macguffins -Fuitems\weapons -Fuitems\traps -Fuentities\bugs -Fuentities\bogles -Fuentities\undead -Fuentities\goblinkin -Fuentities\troglodytes -Fuentities\npc -Fu. -FUlib\i386-win32 -FE. -oAxes.exe 6 | -------------------------------------------------------------------------------- /scripts/compile_Linux.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | echo "Compiling Axes, Armour & Ale..." 3 | mkdir -p ../source/lib/x86_64-linux 4 | cd ../source 5 | fpc Axes.pas -MObjFPC -Scghi -CX -Cg -Os3 -Xs -XX -l -vewnhibq -Filib/x86_64-linux -Fientities -Fidungeons -Fudungeons -Fuentities -Fuitems -Fuplayer -Fuscreens -Fuvision -Fuentities/animals -Fuentities/bugs -Fuentities/fungus -Fuentities/gnomes -Fuentities/hobs -Fuitems/armour -Fuitems/macguffins -Fuitems/weapons -Fuentities/bogles -Fuentities/undead -Fuentities/goblinkin -Fuentities/troglodytes -Fuentities/npc -Fuitems/traps -Fu. -FUlib/x86_64-linux -FE. -oAxes 6 | echo "Complete." -------------------------------------------------------------------------------- /source/player/emptyslot.pp: -------------------------------------------------------------------------------- 1 | (* Empty inventory slot *) 2 | begin 3 | itemID := itemNumber; 4 | itemName := 'empty'; 5 | itemDescription := ''; 6 | itemArticle := ''; 7 | itemType := itmEmptySlot; 8 | itemMaterial := matEmpty; 9 | useID := 1; 10 | glyph := 'x'; 11 | glyphColour := 'lightCyan'; 12 | inView := False; 13 | posX := 1; 14 | posY := 1; 15 | NumberOfUses := 0; 16 | value := 0; 17 | onMap := False; 18 | throwable := False; 19 | throwDamage := 0; 20 | dice := 0; 21 | adds := 0; 22 | discovered := False; 23 | end; 24 | -------------------------------------------------------------------------------- /source/entities/npc/merchant_inventoryemptyslot.pp: -------------------------------------------------------------------------------- 1 | (* Empty merchant inventory slot *) 2 | begin 3 | villageInv[i].id := i; 4 | villageInv[i].Name := 'Empty'; 5 | villageInv[i].description := 'x'; 6 | villageInv[i].article := 'x'; 7 | villageInv[i].itemType := itmEmptySlot; 8 | villageInv[i].itemMaterial := matEmpty; 9 | villageInv[i].glyph := 'x'; 10 | villageInv[i].glyphColour := 'x'; 11 | villageInv[i].numUses := 0; 12 | villageInv[i].value := 0; 13 | villageInv[i].throwable := False; 14 | villageInv[i].throwDamage := 0; 15 | villageInv[i].dice := 0; 16 | villageInv[i].adds := 0; 17 | villageInv[i].useID := 0; 18 | end; 19 | -------------------------------------------------------------------------------- /scripts/debug_Linux.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | echo "Compiling Axes, Armour & Ale - DEBUG VERSION" 3 | mkdir -p ../source/lib/x86_64-linux 4 | cd ../source 5 | fpc Axes.pas -Mfpc -Scaghi -Cg -CirotR -O1 -gw2 -godwarfsets -gl -gh -Xg -gt -l -vewnhibq -Filib/x86_64-linux -Fientities -Fudungeons -Fuentities -Fuitems -Fuplayer -Fuscreens -Fuvision -Fuentities/animals -Fuentities/fungus -Fuentities/gnomes -Fuentities/hobs -Fuitems/armour -Fuitems/macguffins -Fuitems/weapons -Fuitems/traps -Fuentities/bugs -Fuentities/bogles -Fuentities/undead -Fuentities/goblinkin -Fuentities/troglodytes -Fuentities/npc -Fu. -FUlib/x86_64-linux -FE. -oAxes 6 | echo "cleaning up files...." 7 | delp -r ./ 8 | echo "updating tags file..." 9 | ctags -R --languages=Pascal 10 | echo "Complete." -------------------------------------------------------------------------------- /source/entities/nextto.pp: -------------------------------------------------------------------------------- 1 | (* Check if entity is next to the player *) 2 | function isNextToPlayer(spx, spy: smallint): boolean; 3 | begin 4 | Result := False; 5 | if (map.hasPlayer(spx, spy - 1) = True) then { NORTH } 6 | Result := True; 7 | if (map.hasPlayer(spx + 1, spy - 1) = True) then { NORTH EAST } 8 | Result := True; 9 | if (map.hasPlayer(spx + 1, spy) = True) then { EAST } 10 | Result := True; 11 | if (map.hasPlayer(spx + 1, spy + 1) = True) then { SOUTH EAST } 12 | Result := True; 13 | if (map.hasPlayer(spx, spy + 1) = True) then { SOUTH } 14 | Result := True; 15 | if (map.hasPlayer(spx - 1, spy + 1) = True) then { SOUTH WEST } 16 | Result := True; 17 | if (map.hasPlayer(spx - 1, spy) = True) then { WEST } 18 | Result := True; 19 | if (map.hasPlayer(spx - 1, spy - 1) = True) then { NORTH WEST } 20 | Result := True; 21 | end; -------------------------------------------------------------------------------- /source/logging.pas: -------------------------------------------------------------------------------- 1 | (* Used for logging which procedures are called and in what order *) 2 | 3 | unit logging; 4 | 5 | {$mode objfpc}{$H+} 6 | 7 | interface 8 | 9 | uses 10 | SysUtils, globalUtils; 11 | 12 | var 13 | (* Text file used for logging *) 14 | tfOut: TextFile; 15 | (* Log file name *) 16 | C_FNAME : shortstring; 17 | 18 | procedure beginLogging; 19 | procedure logAction(textString: string); 20 | 21 | implementation 22 | 23 | procedure beginLogging; 24 | begin 25 | C_FNAME := (globalUtils.saveDirectory + PathDelim + 'LOGFILE.dat'); 26 | AssignFile(tfOut, C_FNAME); 27 | rewrite(tfOut); 28 | writeln(tfOut, 'Initialised. Random seed is ' + IntToStr(RandSeed)); 29 | closeFile(tfOut); 30 | end; 31 | 32 | procedure logAction(textString: string); 33 | begin 34 | AssignFile(tfOut, C_FNAME); 35 | append(tfOut); 36 | writeln(tfOut, textString); 37 | CloseFile(tfOut); 38 | end; 39 | 40 | end. 41 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Lazarus compiler-generated binaries (safe to delete) 2 | *.exe 3 | *.so 4 | *.dylib 5 | *.lrs 6 | *.compiled 7 | *.dbg 8 | *.ppu 9 | *.o 10 | *.or 11 | *.a 12 | Axes 13 | 14 | # Lazarus autogenerated files (duplicated info) 15 | *.rst 16 | *.rsj 17 | *.lrt 18 | 19 | # Lazarus local files (user-specific info) 20 | *.lps 21 | 22 | # FP IDE local files 23 | fp.dsk 24 | source/fp.cfg 25 | source/fp.ini 26 | 27 | # Free Pascal IDE error logs 28 | *.err 29 | *.out 30 | 31 | # Lazarus backups and unit output folders. 32 | # These can be changed by user in Lazarus/project options. 33 | backup/ 34 | *.bak 35 | lib/ 36 | 37 | axesData/ 38 | 39 | # compiler-generated binaries (safe to delete) 40 | *.dcu 41 | *.~*~ 42 | *.local 43 | *.identcache 44 | __history 45 | *.drc 46 | *.map 47 | bin/* 48 | *.*~ 49 | *.$$$ 50 | 51 | # ViM backup files 52 | *~ 53 | *.swp 54 | *.swo 55 | 56 | # Save game files 57 | axesData/ 58 | 59 | # Notes, scripts and logs 60 | *.txt 61 | -------------------------------------------------------------------------------- /scripts/README.md: -------------------------------------------------------------------------------- 1 | # Scripts 2 | 3 | Scripts used to develop / compile **Axes, Armour & Ale** 4 | 5 | Vim is used to develop this game, and a 'tags' file is located in the source directory, to quickly navigate through the files. 6 |
7 | The Free Pascal IDE can also be used, it is recommended that you place the *fp.cfg* & *fp.ini* files in the source folder if you want to edit the source code using FP IDE. 8 | 9 | * *compile_Linux.sh* - BASH script to compile the release version for Linux 64 bit 10 | * *debug_Linux.sh* - BASH script to compile the debug version for Linux 64 bit 11 | * *compile_Windows.bat* - Batch file to compile the release version for Windows 32 bit 12 | * *debug_Windows.bat* - Batch file to compile the debug version for Windows 32 bit 13 | * *findInFiles.sh* - BASH script to grep for a string in .pas files 14 | * *fp.cfg* - Free Pascal IDE config file, sets the different build modes 15 | * *fp.ini* - Free Pascal IDE user settings, includes custom theme and some tools 16 | * *formatCode.sh* drop this in the source directory, along with *ptop.cfg* and you can beautify your code from FP IDE tools menu 17 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Chris Hawkins 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /source/items/arrow.pas: -------------------------------------------------------------------------------- 1 | (* Arrow *) 2 | 3 | unit arrow; 4 | 5 | {$mode fpc}{$H+} 6 | 7 | interface 8 | 9 | (* Create an arrow *) 10 | procedure createArrow(itmx, itmy: smallint); 11 | (* Item cannot be equipped *) 12 | procedure useItem; 13 | 14 | implementation 15 | 16 | uses 17 | items, ui; 18 | 19 | procedure createArrow(itmx, itmy: smallint); 20 | begin 21 | SetLength(itemList, length(itemList) + 1); 22 | with itemList[High(itemList)] do 23 | begin 24 | itemID := indexID; 25 | itemName := 'arrow'; 26 | itemDescription := 'wooden flight arrow'; 27 | itemArticle := 'an'; 28 | itemType := itmAmmo; 29 | itemMaterial := matWood; 30 | useID := 12; 31 | glyph := '|'; 32 | glyphColour := 'brown'; 33 | inView := False; 34 | posX := itmx; 35 | posY := itmy; 36 | NumberOfUses := 1; 37 | value := 1; 38 | onMap := True; 39 | throwable := False; 40 | throwDamage := 5; 41 | dice := 0; 42 | adds := 0; 43 | discovered := False; 44 | Inc(indexID); 45 | end; 46 | end; 47 | 48 | procedure useItem; 49 | begin 50 | ui.displayMessage('You can''t find a use for an arrow.'); 51 | end; 52 | 53 | end. 54 | -------------------------------------------------------------------------------- /source/items/rock.pas: -------------------------------------------------------------------------------- 1 | (* A rock, causes base damage of 4 points *) 2 | 3 | unit rock; 4 | 5 | {$mode fpc}{$H+} 6 | 7 | interface 8 | 9 | (* Create a rock *) 10 | procedure createRock(itmx, itmy: smallint); 11 | (* Item cannot be equipped *) 12 | procedure useItem; 13 | 14 | implementation 15 | 16 | uses 17 | items, ui; 18 | 19 | procedure createRock(itmx, itmy: smallint); 20 | begin 21 | SetLength(itemList, length(itemList) + 1); 22 | with itemList[High(itemList)] do 23 | begin 24 | itemID := indexID; 25 | itemName := 'rock'; 26 | itemDescription := 'causes damage if thrown'; 27 | itemArticle := 'a'; 28 | itemType := itmProjectile; 29 | itemMaterial := matStone; 30 | useID := 9; 31 | glyph := chr(7); 32 | glyphColour := 'lightGrey'; 33 | inView := False; 34 | posX := itmx; 35 | posY := itmy; 36 | NumberOfUses := 5; 37 | value := 0; 38 | onMap := True; 39 | throwable := True; 40 | throwDamage := 3; 41 | dice := 0; 42 | adds := 0; 43 | discovered := False; 44 | Inc(indexID); 45 | end; 46 | end; 47 | 48 | procedure useItem; 49 | begin 50 | ui.displayMessage('You can''t find a use for a rock.'); 51 | end; 52 | 53 | end. 54 | 55 | -------------------------------------------------------------------------------- /source/screens/resolution.pas: -------------------------------------------------------------------------------- 1 | (* Determines the terminal size when the game is first opened and resizes 2 | the user interface accordingly. 3 | For a typical 80x24 terminal size, the camera size will be 57x19 4 | For a terminal size of 102x24 and greater, the camera size will be 80x19 5 | This is kept to 19 rather than the full 20 to allow for screenshake to 6 | be added in future versions.*) 7 | 8 | unit resolution; 9 | 10 | {$mode fpc}{$H+} 11 | 12 | interface 13 | 14 | uses 15 | crt, camera, scrGame, ui; 16 | 17 | procedure getSize; 18 | 19 | implementation 20 | 21 | procedure getSize; 22 | var 23 | terminalWidth: smallint; 24 | begin 25 | {$IFDEF Linux} 26 | terminalWidth := ScreenWidth; 27 | {$ENDIF} 28 | {$IFDEF Windows} 29 | terminalWidth := WindMaxX; 30 | {$ENDIF} 31 | {$IFDEF Darwin} 32 | terminalWidth := ScreenWidth; 33 | {$ENDIF} 34 | if (terminalWidth >= 103) then 35 | begin 36 | scrGame.minX := 81; 37 | camera.camWidth := 80; 38 | ui.displayCol := 103; 39 | ui.displayRow := 25; 40 | end 41 | else 42 | begin 43 | scrGame.minX := 58; 44 | camera.camWidth := 57; 45 | ui.displayCol := 80; 46 | ui.displayRow := 25; 47 | end; 48 | end; 49 | 50 | end. 51 | -------------------------------------------------------------------------------- /docs/ClassHierarchy.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Axes, Armour & Ale: Class Hierarchy 5 | 6 | 7 | 8 | 9 | 10 | 11 |
13 |

Class Hierarchy

14 |

15 | The units do not contain any classes, interfaces or objects.

16 |
Generated by PasDoc 0.16.0. 17 | 18 |
19 | -------------------------------------------------------------------------------- /source/items/large_ale.pas: -------------------------------------------------------------------------------- 1 | (* A large tankard of ale - health top up *) 2 | unit large_ale; 3 | 4 | {$mode objfpc}{$H+} 5 | 6 | interface 7 | 8 | (* Create a large tankard of ale *) 9 | procedure createLargeAle(itmx, itmy: smallint); 10 | (* Drink Ale *) 11 | procedure useItem; 12 | 13 | implementation 14 | 15 | uses 16 | items, entities, ui, player; 17 | 18 | procedure createLargeAle(itmx, itmy: smallint); 19 | begin 20 | SetLength(itemList, length(itemList) + 1); 21 | with itemList[High(itemList)] do 22 | begin 23 | itemID := indexID; 24 | itemName := 'large ale'; 25 | itemDescription := 'restores 12 health points'; 26 | itemArticle := 'a'; 27 | itemType := itmDrink; 28 | itemMaterial := matFlammable; 29 | useID := 29; 30 | glyph := '!'; 31 | glyphColour := 'lightCyan'; 32 | inView := False; 33 | posX := itmx; 34 | posY := itmy; 35 | NumberOfUses := 5; 36 | value := 3; 37 | onMap := True; 38 | throwable := False; 39 | throwDamage := 0; 40 | dice := 0; 41 | adds := 0; 42 | discovered := False; 43 | Inc(indexID); 44 | end; 45 | end; 46 | 47 | procedure useItem; 48 | begin 49 | player.increaseHealth(12); 50 | entities.entityList[0].stsDrunk := True; 51 | Inc(entities.entityList[0].tmrDrunk, 12); 52 | ui.displayMessage('You quaff the ale. The alcohol slows your reactions.'); 53 | end; 54 | 55 | end. -------------------------------------------------------------------------------- /source/items/ale_tankard.pas: -------------------------------------------------------------------------------- 1 | (* A tankard of ale - health top up *) 2 | unit ale_tankard; 3 | 4 | {$mode objfpc}{$H+} 5 | 6 | interface 7 | 8 | (* Create a tankard of ale *) 9 | procedure createAleTankard(itmx, itmy: smallint); 10 | (* Drink Ale *) 11 | procedure useItem; 12 | 13 | implementation 14 | 15 | uses 16 | items, entities, ui, player; 17 | 18 | procedure createAleTankard(itmx, itmy: smallint); 19 | begin 20 | SetLength(itemList, length(itemList) + 1); 21 | with itemList[High(itemList)] do 22 | begin 23 | itemID := indexID; 24 | itemName := 'tankard of ale'; 25 | itemDescription := 'restores 5 health points'; 26 | itemArticle := 'a'; 27 | itemType := itmDrink; 28 | itemMaterial := matFlammable; 29 | useID := 1; 30 | glyph := '!'; 31 | glyphColour := 'lightCyan'; 32 | inView := False; 33 | posX := itmx; 34 | posY := itmy; 35 | NumberOfUses := 5; 36 | value := 2; 37 | onMap := True; 38 | throwable := False; 39 | throwDamage := 0; 40 | dice := 0; 41 | adds := 0; 42 | discovered := False; 43 | Inc(indexID); 44 | end; 45 | end; 46 | 47 | procedure useItem; 48 | begin 49 | player.increaseHealth(5); 50 | entities.entityList[0].stsDrunk := True; 51 | Inc(entities.entityList[0].tmrDrunk, 5); 52 | ui.displayMessage('You quaff the ale. The alcohol slows your reactions.'); 53 | end; 54 | 55 | end. 56 | -------------------------------------------------------------------------------- /source/Axes.pas: -------------------------------------------------------------------------------- 1 | (* 2 | Axes, Armour & Ale 3 | Copyright 2021-2023 Chris Hawkins 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, 6 | merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 9 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | *) 11 | 12 | program Axes; 13 | 14 | {$mode fpc}{$H+} 15 | {$IFDEF WINDOWS} 16 | {$APPTYPE CONSOLE} 17 | {$ENDIF} 18 | 19 | uses 20 | resolution, main; 21 | 22 | {$R *.res} 23 | 24 | begin 25 | resolution.getSize; 26 | (* Initialise the display, keyboard and game variables *) 27 | main.initialise; 28 | main.stateInputLoop; 29 | end. 30 | -------------------------------------------------------------------------------- /source/items/gold_pieces.pas: -------------------------------------------------------------------------------- 1 | (* Treasure *) 2 | 3 | unit gold_pieces; 4 | 5 | {$mode fpc}{$H+} 6 | 7 | interface 8 | 9 | uses 10 | sysutils; 11 | 12 | (* Create Gpld *) 13 | procedure createGP(itmx, itmy: smallint); 14 | (* Item cannot be equipped *) 15 | procedure useItem; 16 | 17 | implementation 18 | 19 | uses 20 | items, ui, globalUtils, player_stats; 21 | 22 | procedure createGP(itmx, itmy: smallint); 23 | var 24 | amount: smallint; 25 | begin 26 | amount := randomRange(0, 5) + player_stats.playerLevel; 27 | SetLength(itemList, length(itemList) + 1); 28 | with itemList[High(itemList)] do 29 | begin 30 | itemID := High(itemList); 31 | itemName := 'Gold'; 32 | if (amount = 1) then 33 | itemDescription := IntToStr(amount) + ' gold piece' 34 | else 35 | itemDescription := IntToStr(amount) + ' gold pieces'; 36 | itemArticle := 'some'; 37 | itemType := itmTreasure; 38 | itemMaterial := matGold; 39 | useID := 22; 40 | glyph := '$'; 41 | glyphColour := 'yellow'; 42 | inView := False; 43 | posX := itmx; 44 | posY := itmy; 45 | NumberOfUses := amount; 46 | value := 1; 47 | onMap := True; 48 | throwable := False; 49 | throwDamage := 0; 50 | dice := 0; 51 | adds := 0; 52 | discovered := False; 53 | Inc(indexID); 54 | end; 55 | end; 56 | 57 | procedure useItem; 58 | begin 59 | ui.displayMessage('You pick up the gold'); 60 | end; 61 | 62 | end. 63 | -------------------------------------------------------------------------------- /source/items/macguffins/smugglersmap.pas: -------------------------------------------------------------------------------- 1 | (* First quest MacGuffin, the smugglers map *) 2 | 3 | unit smugglersMap; 4 | 5 | {$mode fpc}{$H+} 6 | 7 | interface 8 | 9 | uses SysUtils, player_stats, dlgInfo, video; 10 | 11 | (* Create the map *) 12 | procedure createSmugglersMap(itmx, itmy: smallint); 13 | (* Collect quest item *) 14 | procedure obtainMap; 15 | 16 | implementation 17 | 18 | uses 19 | items, ui; 20 | 21 | procedure createSmugglersMap(itmx, itmy: smallint); 22 | begin 23 | SetLength(itemList, length(itemList) + 1); 24 | with itemList[High(itemList)] do 25 | begin 26 | itemID := indexID; 27 | itemName := 'Smugglers Map'; 28 | itemDescription := 'The map you''ve been searching for'; 29 | itemArticle := 'the'; 30 | itemType := itmQuest; 31 | itemMaterial := matPaper; 32 | useID := 7; 33 | glyph := '?'; 34 | glyphColour := 'white'; 35 | inView := False; 36 | posX := itmx; 37 | posY := itmy; 38 | NumberOfUses := 5; 39 | value := 0; 40 | onMap := True; 41 | throwable := False; 42 | throwDamage := 0; 43 | dice := 0; 44 | adds := 0; 45 | discovered := False; 46 | Inc(indexID); 47 | end; 48 | end; 49 | 50 | procedure obtainMap; 51 | begin 52 | dlgInfo.dialogType := dlgFoundSMap; 53 | ui.displayMessage('now you can leave the cave'); 54 | ui.displayMessage('You have found the map'); 55 | player_stats.canExitDungeon := True; 56 | end; 57 | 58 | end. 59 | 60 | -------------------------------------------------------------------------------- /source/screens/scrwinalpha.pas: -------------------------------------------------------------------------------- 1 | (* Shown when exiting the Smugglers cave and starting the larger adventure *) 2 | 3 | unit scrWinAlpha; 4 | 5 | {$mode fpc}{$H+} 6 | 7 | interface 8 | 9 | uses 10 | SysUtils, video, ui, universe; 11 | 12 | (* Show the Win screen *) 13 | procedure displayWinscreen; 14 | 15 | implementation 16 | 17 | procedure displayWinscreen; 18 | begin 19 | { Closing screen update as it is currently in the main game loop } 20 | UnlockScreenUpdate; 21 | UpdateScreen(False); 22 | (* prepare changes to the screen *) 23 | LockScreenUpdate; 24 | 25 | ui.screenBlank; 26 | TextOut(centreX('You exit the cave!'), 2, 'white', 'You exit the cave!'); 27 | TextOut(5, 5, 'cyan', 'Battered and bruised, you climb out of the cave and hand over'); 28 | TextOut(5, 6, 'cyan', 'the map. The smugglers grin, thank you for your trouble, and'); 29 | TextOut(5, 7, 'cyan', 'leave.'); 30 | TextOut(5, 9, 'cyan', 'You are once again alone, on the isle of Ellan Toll. The way'); 31 | TextOut(5, 10, 'cyan', 'ahead promises adventure, and more than a little danger.'); 32 | TextOut(5, 11, 'cyan', 'There are ruins to explore and treasure to plunder, you set out...'); 33 | 34 | UnlockScreenUpdate; 35 | UpdateScreen(False); 36 | (* Create overworld map *) 37 | universe.createEllanToll; 38 | LockScreenUpdate; 39 | TextOut(centreX('x - to continue'), 24, 'cyan', 'x - to continue'); 40 | UnlockScreenUpdate; 41 | UpdateScreen(False); 42 | end; 43 | 44 | end. 45 | -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Axes, Armour & Ale: Introduction 5 | 6 | 7 | 8 | 9 | 10 | 11 |
13 |

Introduction

14 | Axes, Armour & Ale 15 | 16 |

A low-fantasy, ASCII roguelike game. 17 | 18 |

Axes, Amour & Ale runs in the terminal in Windows, Linux & OSX. it is a standalone binary, and doesn't need to be installed. Currently at an incomplete 'alpha' stage of development, all bugfixes and suggestions are gratefully received.


Generated by PasDoc 0.16.0. 19 | 20 |
21 | -------------------------------------------------------------------------------- /docs/intro.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Axes, Armour & Ale: Introduction 5 | 6 | 7 | 8 | 9 | 10 | 11 |
13 |

Introduction

14 | Axes, Armour & Ale 15 | 16 |

A low-fantasy, ASCII roguelike game. 17 | 18 |

Axes, Amour & Ale runs in the terminal in Windows, Linux & OSX. it is a standalone binary, and doesn't need to be installed. Currently at an incomplete 'alpha' stage of development, all bugfixes and suggestions are gratefully received.


Generated by PasDoc 0.16.0. 19 | 20 |
21 | -------------------------------------------------------------------------------- /source/items/pixie_jar_dim.pas: -------------------------------------------------------------------------------- 1 | (* A dimly glowing pixie in a jar - Light source *) 2 | 3 | unit pixie_jar_dim; 4 | 5 | {$mode fpc}{$H+} 6 | 7 | interface 8 | 9 | (* Create a pixie jar *) 10 | procedure createPixieJarDim(itmx, itmy: smallint); 11 | (* Item cannot be equipped *) 12 | procedure useItem; 13 | 14 | implementation 15 | 16 | uses 17 | items, ui, globalUtils, map, player_stats, entities; 18 | 19 | procedure createPixieJarDim(itmx, itmy: smallint); 20 | var 21 | duration: smallint; 22 | begin 23 | 24 | duration := randomRange(50, 75); 25 | SetLength(itemList, length(itemList) + 1); 26 | with itemList[High(itemList)] do 27 | begin 28 | itemID := High(itemList); 29 | itemName := 'Pixie in a jar'; 30 | itemDescription := 'dimly glowing source of light'; 31 | itemArticle := 'a'; 32 | itemType := itmLightSource; 33 | itemMaterial := matGlass; 34 | useID := 13; 35 | glyph := chr(232); 36 | glyphColour := 'yellow'; 37 | inView := False; 38 | posX := itmx; 39 | posY := itmy; 40 | NumberOfUses := duration; 41 | value := 5; 42 | onMap := True; 43 | throwable := False; 44 | throwDamage := 0; 45 | dice := 0; 46 | adds := 0; 47 | discovered := False; 48 | Inc(indexID); 49 | end; 50 | end; 51 | 52 | procedure useItem; 53 | begin 54 | ui.displayMessage('You pick up the Pixie in the jar'); 55 | if (entityList[0].visionRange < player_stats.maxVisionRange) then 56 | entityList[0].visionRange := player_stats.maxVisionRange; 57 | lightEquipped := True; 58 | map.loadDisplayedMap; 59 | end; 60 | 61 | end. 62 | -------------------------------------------------------------------------------- /docs/crypt.coordinates.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Axes, Armour & Ale: crypt: Record coordinates 5 | 6 | 7 | 8 | 9 | 10 | 11 |
13 |

Record coordinates

14 |
15 |
Hierarchy
Fields
Methods
Properties
16 |

Unit

17 | 19 |

Declaration

20 |

21 | type coordinates = record

22 |

Description

23 |  
Generated by PasDoc 0.16.0. 24 | 25 |
26 | -------------------------------------------------------------------------------- /docs/map.tile.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Axes, Armour & Ale: map: Record tile 5 | 6 | 7 | 8 | 9 | 10 | 11 |
13 |

Record tile

14 |
15 |
Hierarchy
Fields
Methods
Properties
16 |

Unit

17 | 19 |

Declaration

20 |

21 | type tile = record

22 |

Description

23 |

24 | Tiles that make up the game world

25 |
Generated by PasDoc 0.16.0. 26 | 27 |
28 | -------------------------------------------------------------------------------- /source/items/elven_wine.pas: -------------------------------------------------------------------------------- 1 | (* Flask of wine - restores Magick *) 2 | 3 | unit elven_wine; 4 | 5 | {$mode objfpc}{$H+} 6 | 7 | interface 8 | 9 | (* Create a flask of wine *) 10 | procedure createWineFlask(itmx, itmy: smallint); 11 | (* Drink Potion *) 12 | procedure useItem; 13 | 14 | implementation 15 | 16 | uses 17 | items, entities, ui, player_stats; 18 | 19 | procedure createWineFlask(itmx, itmy: smallint); 20 | begin 21 | SetLength(itemList, length(itemList) + 1); 22 | with itemList[High(itemList)] do 23 | begin 24 | itemID := indexID; 25 | itemName := 'Elven wine'; 26 | itemDescription := 'restores Magick'; 27 | itemArticle := 'an'; 28 | itemType := itmDrink; 29 | itemMaterial := matFlammable; 30 | useID := 31; 31 | glyph := '!'; 32 | glyphColour := 'green'; 33 | inView := False; 34 | posX := itmx; 35 | posY := itmy; 36 | NumberOfUses := 5; 37 | value := 4; 38 | onMap := True; 39 | throwable := False; 40 | throwDamage := 0; 41 | dice := 0; 42 | adds := 0; 43 | discovered := False; 44 | Inc(indexID); 45 | end; 46 | end; 47 | 48 | procedure useItem; 49 | begin 50 | if (player_stats.currentMagick < player_stats.maxMagick) then 51 | begin 52 | player_stats.currentMagick := player_stats.maxMagick; 53 | Inc(entities.entityList[0].tmrDrunk, player_stats.maxMagick); 54 | (* Update UI *) 55 | ui.displayMessage('The alcohol slows your reactions.'); 56 | ui.displayMessage('You drink the wine. Your magick regenerates.'); 57 | end 58 | else 59 | begin 60 | Inc(entities.entityList[0].tmrDrunk, player_stats.maxMagick); 61 | ui.displayMessage('The alcohol slows your reactions.'); 62 | ui.displayMessage('You drink the wine. You don''t notice any effects'); 63 | end; 64 | end; 65 | 66 | end. -------------------------------------------------------------------------------- /docs/items.Item.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Axes, Armour & Ale: items: Record Item 5 | 6 | 7 | 8 | 9 | 10 | 11 |
13 |

Record Item

14 |
15 |
Hierarchy
Fields
Methods
Properties
16 |

Unit

17 | 19 |

Declaration

20 |

21 | type Item = record

22 |

Description

23 |

24 | Store information about items

25 |
Generated by PasDoc 0.16.0. 26 | 27 |
28 | -------------------------------------------------------------------------------- /docs/village.coordinates.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Axes, Armour & Ale: village: Record coordinates 5 | 6 | 7 | 8 | 9 | 10 | 11 |
13 |

Record coordinates

14 |
15 |
Hierarchy
Fields
Methods
Properties
16 |

Unit

17 | 19 |

Declaration

20 |

21 | type coordinates = record

22 |

Description

23 |  
Generated by PasDoc 0.16.0. 24 | 25 |
26 | -------------------------------------------------------------------------------- /docs/entities.Creature.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Axes, Armour & Ale: entities: Record Creature 5 | 6 | 7 | 8 | 9 | 10 | 11 |
13 |

Record Creature

14 |
15 |
Hierarchy
Fields
Methods
Properties
16 |

Unit

17 | 19 |

Declaration

20 |

21 | type Creature = record

22 |

Description

23 |

24 | Creature

25 |
Generated by PasDoc 0.16.0. 26 | 27 |
28 | -------------------------------------------------------------------------------- /docs/smallGrid.coordinates.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Axes, Armour & Ale: smallGrid: Record coordinates 5 | 6 | 7 | 8 | 9 | 10 | 11 |
13 |

Record coordinates

14 |
15 |
Hierarchy
Fields
Methods
Properties
16 |

Unit

17 | 19 |

Declaration

20 |

21 | type coordinates = record

22 |

Description

23 |  
Generated by PasDoc 0.16.0. 24 | 25 |
26 | -------------------------------------------------------------------------------- /docs/globalUtils.coordinates.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Axes, Armour & Ale: globalUtils: Record coordinates 5 | 6 | 7 | 8 | 9 | 10 | 11 |
13 |

Record coordinates

14 |
15 |
Hierarchy
Fields
Methods
Properties
16 |

Unit

17 | 19 |

Declaration

20 |

21 | type coordinates = record

22 |

Description

23 |  
Generated by PasDoc 0.16.0. 24 | 25 |
26 | -------------------------------------------------------------------------------- /source/screens/scrtitle.pas: -------------------------------------------------------------------------------- 1 | (* Title screen *) 2 | 3 | unit scrTitle; 4 | 5 | {$mode fpc}{$H+} 6 | 7 | interface 8 | 9 | procedure displayTitleScreen(yn: byte); 10 | 11 | implementation 12 | 13 | uses 14 | ui; 15 | 16 | procedure displayTitleScreen(yn: byte); 17 | begin 18 | screenBlank; 19 | TextOut(18, 4, 'cyan', ' ___'); 20 | TextOut(18, 5, 'cyan', ' / _ \'); 21 | TextOut(18, 6, 'cyan', ' / /_\ \_ _____ ___'); 22 | TextOut(18, 7, 'cyan', ' , /\ . | _ \ \/ / _ \/ __|'); 23 | TextOut(18, 8, 'cyan', ' //`-||-''\\ | | | |> < __/\__ \_'); 24 | TextOut(18, 9, 'cyan', '(| -=||=- |) \_|_|_/_/\_\___||___( )'); 25 | TextOut(18, 10, 'cyan', ' \\,-||-.// / _ \ |/'); 26 | TextOut(18, 11, 'cyan', ' ` || '' / /_\ \_ __ _ __ ___ ___ _ _ _ __'); 27 | TextOut(18, 12, 'cyan', ' || | _ | ''__| ''_ ` _ \ / _ \| | | | ''__|'); 28 | TextOut(18, 13, 'cyan', ' || | | | | | | | | | | | (_) | |_| | |'); 29 | TextOut(18, 14, 'cyan', ' || \_| |_/_| |_| |_| |_|\___/ \__,_|_|'); 30 | TextOut(18, 15, 'cyan', ' || ___ / _ \| |'); 31 | TextOut(18, 16, 'cyan', ' || ( _ ) / /_\ \ | ___'); 32 | TextOut(18, 17, 'cyan', ' () / _ \/\ | _ | |/ _ \'); 33 | TextOut(18, 18, 'cyan', ' | (_> < | | | | | __/'); 34 | TextOut(18, 19, 'cyan', ' \___/\/ \_| |_/_|\___|'); 35 | 36 | (* Check if a save file exists and display menu *) 37 | if (yn = 0) then 38 | begin 39 | TextOut(18, 22, 'cyan', 'n - New Game'); 40 | TextOut(18, 23, 'cyan', 'q - Quit'); 41 | end 42 | else 43 | begin 44 | TextOut(18, 22, 'cyan', 'l - Load Last Game n - New Game'); 45 | TextOut(18, 23, 'cyan', 'q - Quit'); 46 | end; 47 | end; 48 | 49 | end. 50 | 51 | -------------------------------------------------------------------------------- /docs/map.displayTile.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Axes, Armour & Ale: map: Record displayTile 5 | 6 | 7 | 8 | 9 | 10 | 11 |
13 |

Record displayTile

14 |
15 |
Hierarchy
Fields
Methods
Properties
16 |

Unit

17 | 19 |

Declaration

20 |

21 | type displayTile = record

22 |

Description

23 |

24 | Tiles that make up the game world

25 |
Generated by PasDoc 0.16.0. 26 | 27 |
28 | -------------------------------------------------------------------------------- /docs/scrTargeting.Equipment.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Axes, Armour & Ale: scrTargeting: Record Equipment 5 | 6 | 7 | 8 | 9 | 10 | 11 |
13 |

Record Equipment

14 |
15 |
Hierarchy
Fields
Methods
Properties
16 |

Unit

17 | 19 |

Declaration

20 |

21 | type Equipment = record

22 |

Description

23 |

24 | Weapons

25 |
Generated by PasDoc 0.16.0. 26 | 27 |
28 | -------------------------------------------------------------------------------- /docs/island.locationTile.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Axes, Armour & Ale: island: Record locationTile 5 | 6 | 7 | 8 | 9 | 10 | 11 |
13 |

Record locationTile

14 |
15 |
Hierarchy
Fields
Methods
Properties
16 |

Unit

17 | 19 |

Declaration

20 |

21 | type locationTile = record

22 |

Description

23 |

24 | Location on the island

25 |
Generated by PasDoc 0.16.0. 26 | 27 |
28 | -------------------------------------------------------------------------------- /docs/scrThrow.TthrowTargets.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Axes, Armour & Ale: scrThrow: Record TthrowTargets 5 | 6 | 7 | 8 | 9 | 10 | 11 |
13 |

Record TthrowTargets

14 |
15 |
Hierarchy
Fields
Methods
Properties
16 |

Unit

17 | 19 |

Declaration

20 |

21 | type TthrowTargets = record

22 |

Description

23 |

24 | Enemies

25 |
Generated by PasDoc 0.16.0. 26 | 27 |
28 | -------------------------------------------------------------------------------- /docs/island.displayTile.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Axes, Armour & Ale: island: Record displayTile 5 | 6 | 7 | 8 | 9 | 10 | 11 |
13 |

Record displayTile

14 |
15 |
Hierarchy
Fields
Methods
Properties
16 |

Unit

17 | 19 |

Declaration

20 |

21 | type displayTile = record

22 |

Description

23 |

24 | Visible tiles that display the overworld

25 |
Generated by PasDoc 0.16.0. 26 | 27 |
28 | -------------------------------------------------------------------------------- /docs/island.overworldTile.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Axes, Armour & Ale: island: Record overworldTile 5 | 6 | 7 | 8 | 9 | 10 | 11 |
13 |

Record overworldTile

14 |
15 |
Hierarchy
Fields
Methods
Properties
16 |

Unit

17 | 19 |

Declaration

20 |

21 | type overworldTile = record

22 |

Description

23 |

24 | Tiles that make up the overworld

25 |
Generated by PasDoc 0.16.0. 26 | 27 |
28 | -------------------------------------------------------------------------------- /source/items/pixie_jar.pas: -------------------------------------------------------------------------------- 1 | (* A glowing pixie in a jar - Light source *) 2 | 3 | unit pixie_jar; 4 | 5 | {$mode fpc}{$H+} 6 | 7 | interface 8 | 9 | (* Create a pixie jar *) 10 | procedure createPixieJar; 11 | (* Item cannot be equipped *) 12 | procedure useItem; 13 | 14 | implementation 15 | 16 | uses 17 | items, ui, globalUtils, map, player_stats, entities; 18 | 19 | procedure createPixieJar; 20 | var 21 | duration, r, c: smallint; 22 | begin 23 | (* Choose random location on the map *) 24 | repeat 25 | r := globalutils.randomRange(3, (MAXROWS - 3)); 26 | c := globalutils.randomRange(3, (MAXCOLUMNS - 3)); 27 | (* choose a location that is not a wall or occupied *) 28 | until (maparea[r][c].Blocks = False) and (maparea[r][c].Occupied = False); 29 | 30 | duration := randomRange(150, 160); 31 | SetLength(itemList, length(itemList) + 1); 32 | with itemList[High(itemList)] do 33 | begin 34 | itemID := High(itemList); 35 | itemName := 'Pixie in a jar'; 36 | itemDescription := 'glowing source of light'; 37 | itemArticle := 'a'; 38 | itemType := itmLightSource; 39 | itemMaterial := matGlass; 40 | useID := 13; 41 | glyph := chr(232); 42 | glyphColour := 'yellow'; 43 | inView := False; 44 | posX := c; 45 | posY := r; 46 | NumberOfUses := duration; 47 | value := 10; 48 | onMap := True; 49 | throwable := False; 50 | throwDamage := 0; 51 | dice := 0; 52 | adds := 0; 53 | discovered := False; 54 | Inc(indexID); 55 | end; 56 | end; 57 | 58 | procedure useItem; 59 | begin 60 | ui.displayMessage('You pick up the Pixie in the jar'); 61 | if (entityList[0].visionRange < player_stats.maxVisionRange) then 62 | entityList[0].visionRange := player_stats.maxVisionRange; 63 | lightEquipped := True; 64 | map.loadDisplayedMap; 65 | end; 66 | 67 | end. 68 | 69 | -------------------------------------------------------------------------------- /docs/player_inventory.Equipment.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Axes, Armour & Ale: player_inventory: Record Equipment 5 | 6 | 7 | 8 | 9 | 10 | 11 |
13 |

Record Equipment

14 |
15 |
Hierarchy
Fields
Methods
Properties
16 |

Unit

17 | 19 |

Declaration

20 |

21 | type Equipment = record

22 |

Description

23 |

24 | Items in inventory

25 |
Generated by PasDoc 0.16.0. 26 | 27 |
28 | -------------------------------------------------------------------------------- /docs/merchant_inventory.Equipment.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Axes, Armour & Ale: merchant_inventory: Record Equipment 5 | 6 | 7 | 8 | 9 | 10 | 11 |
13 |

Record Equipment

14 |
15 |
Hierarchy
Fields
Methods
Properties
16 |

Unit

17 | 19 |

Declaration

20 |

21 | type Equipment = record

22 |

Description

23 |

24 | Items in inventory

25 |
Generated by PasDoc 0.16.0. 26 | 27 |
28 | -------------------------------------------------------------------------------- /source/items/wine_flask.pas: -------------------------------------------------------------------------------- 1 | (* Flask of wine - cures poison *) 2 | 3 | unit wine_flask; 4 | 5 | {$mode objfpc}{$H+} 6 | 7 | interface 8 | 9 | (* Create a Potion of Cure Poison *) 10 | procedure createWineFlask(itmx, itmy: smallint); 11 | (* Drink Potion *) 12 | procedure useItem; 13 | 14 | implementation 15 | 16 | uses 17 | items, entities, ui; 18 | 19 | procedure createWineFlask(itmx, itmy: smallint); 20 | begin 21 | SetLength(itemList, length(itemList) + 1); 22 | with itemList[High(itemList)] do 23 | begin 24 | itemID := indexID; 25 | itemName := 'flask of wine'; 26 | itemDescription := 'cures poison'; 27 | itemArticle := 'a'; 28 | itemType := itmDrink; 29 | itemMaterial := matFlammable; 30 | useID := 6; 31 | glyph := '!'; 32 | glyphColour := 'green'; 33 | inView := False; 34 | posX := itmx; 35 | posY := itmy; 36 | NumberOfUses := 5; 37 | value := 2; 38 | onMap := True; 39 | throwable := False; 40 | throwDamage := 0; 41 | dice := 0; 42 | adds := 0; 43 | discovered := False; 44 | Inc(indexID); 45 | end; 46 | end; 47 | 48 | procedure useItem; 49 | begin 50 | if (entityList[0].stsPoison = True) then 51 | begin 52 | entities.entityList[0].tmrPoison := 0; 53 | entities.entityList[0].stsPoison := False; 54 | Inc(entities.entityList[0].tmrDrunk, 5); 55 | (* Update UI *) 56 | ui.displayStatusEffect(0, 'poison'); 57 | ui.poisonStatusSet := False; 58 | entityList[0].glyphColour := 'yellow'; 59 | ui.displayMessage('The alcohol slows your reactions.'); 60 | ui.displayMessage('You drink the wine. The poison leaves your system.'); 61 | end 62 | else 63 | begin 64 | Inc(entities.entityList[0].tmrDrunk, 5); 65 | ui.displayMessage('The alcohol slows your reactions.'); 66 | ui.displayMessage('You drink the wine. You don''t notice any effects'); 67 | end; 68 | end; 69 | 70 | end. 71 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

Axes, Armour & Ale

2 |

3 | 4 |

5 | 6 | ### A terminal-based, dungeon crawl game 7 | 8 | Alpha version, most features aren't implemented yet and what there is may change frequently. Currently there are the following features: 9 | - Procedurally generated caves and dungeons 10 | - Game runs natively on GNU/Linux and Windows (also compiles for OSX) 11 | - Small, self-contained binary with no external dependencies. 12 | - Can be run without needing to be installed 13 | 14 | The latest release can be downloaded from the [Releases page](https://github.com/cyberfilth/Axes-Armour-Ale/releases/tag/Alpha59) 15 | 16 | ![Ubuntu screenshot1](GITscreenshots/Linux_dungeon.png) 17 | 18 | 19 | 20 | ![Ubuntu animated GIF](GITscreenshots/LinuxAAA.gif) 21 | 22 | 23 | 24 | ### Controls 25 | Your character is controlled using either the numberpad or Vi keys. 26 |
27 |   y  k  u      7  8  9
28 |    \ | /        \ | /
29 |   h-   -l      4- 5 -6
30 |    / | \        / | \
31 |   b  j  n      1  2  3
32 |   vi-keys      numpad
33 | 
34 | You can also move in cardinal directions using the arrow keys.
35 | Pick up an item from the ground with either 'g' or ','
36 | View inventory with 'i'
37 | Drop an item with 'd'
38 | Quaff / drink with 'q'
39 | Wear armour or Wield a weapon with 'w'
40 | Zap magic with 'z'
41 | To exit a menu / quit the game press ESCAPE (on Linux you will need to double-tap the ESCAPE key)
42 | 
43 |
44 | 45 | 46 | 47 | Code documentation can be found at https://cyberfilth.github.io/Axes-Armour-Ale/intro.html 48 | -------------------------------------------------------------------------------- /source/items/armour/cloth_armour1.pas: -------------------------------------------------------------------------------- 1 | (* Low quality cloth armour *) 2 | 3 | unit cloth_armour1; 4 | 5 | {$mode fpc}{$H+} 6 | 7 | interface 8 | 9 | (* Create armour *) 10 | procedure createClothArmour(itmx, itmy: smallint); 11 | (* Wear armour *) 12 | procedure useItem(equipped: boolean); 13 | 14 | implementation 15 | 16 | uses 17 | items, entities, ui, player_stats; 18 | 19 | procedure createClothArmour(itmx, itmy: smallint); 20 | begin 21 | SetLength(itemList, length(itemList) + 1); 22 | with itemList[High(itemList)] do 23 | begin 24 | itemID := indexID; 25 | itemName := 'Cloth armour'; 26 | itemDescription := 'adds 1 to defence'; 27 | itemArticle := 'some'; 28 | itemType := itmArmour; 29 | itemMaterial := matWool; 30 | useID := 5; 31 | glyph := '['; 32 | glyphColour := 'magenta'; 33 | inView := False; 34 | posX := itmx; 35 | posY := itmy; 36 | NumberOfUses := 5; 37 | value := 4; 38 | onMap := True; 39 | throwable := False; 40 | throwDamage := 0; 41 | dice := 0; 42 | adds := 0; 43 | discovered := False; 44 | Inc(indexID); 45 | end; 46 | end; 47 | 48 | procedure useItem(equipped: boolean); 49 | begin 50 | if (equipped = False) then 51 | (* To wear the armour *) 52 | begin 53 | entityList[0].armourEquipped := True; 54 | Inc(entityList[0].defence); 55 | Inc(player_stats.armourPoints); 56 | ui.displayMessage('You don the cloth armour. The armour adds 1 point to your defence'); 57 | ui.equippedArmour:='Cloth armour'; 58 | ui.writeBufferedMessages; 59 | end 60 | else 61 | (* To remove the armour *) 62 | begin 63 | entityList[0].armourEquipped := False; 64 | Dec(entityList[0].defence); 65 | Dec(player_stats.armourPoints); 66 | ui.displayMessage('You remove the cloth armour.'); 67 | ui.equippedArmour:='No armour worn'; 68 | ui.writeBufferedMessages; 69 | end; 70 | end; 71 | 72 | end. 73 | -------------------------------------------------------------------------------- /source/items/armour/lesser_bone_armour.pas: -------------------------------------------------------------------------------- 1 | (* Cuirass made from a ribcage *) 2 | 3 | unit lesser_bone_armour; 4 | 5 | {$mode fpc}{$H+} 6 | 7 | interface 8 | (* Create armour *) 9 | procedure createBoneArmour(itmx, itmy: smallint); 10 | (* Wear armour *) 11 | procedure useItem(equipped: boolean); 12 | 13 | implementation 14 | 15 | uses 16 | items, entities, ui, player_stats; 17 | 18 | procedure createBoneArmour(itmx, itmy: smallint); 19 | begin 20 | SetLength(itemList, length(itemList) + 1); 21 | with itemList[High(itemList)] do 22 | begin 23 | itemID := indexID; 24 | itemName := 'Bone armour'; 25 | itemDescription := 'adds 3 to defence'; 26 | itemArticle := 'some'; 27 | itemType := itmArmour; 28 | itemMaterial := matBone; 29 | useID := 21; 30 | glyph := '['; 31 | glyphColour := 'white'; 32 | inView := False; 33 | posX := itmx; 34 | posY := itmy; 35 | NumberOfUses := 5; 36 | value := 6; 37 | onMap := True; 38 | throwable := False; 39 | throwDamage := 0; 40 | dice := 0; 41 | adds := 0; 42 | discovered := False; 43 | Inc(indexID); 44 | end; 45 | end; 46 | 47 | procedure useItem(equipped: boolean); 48 | begin 49 | if (equipped = False) then 50 | (* To wear the armour *) 51 | begin 52 | entityList[0].armourEquipped := True; 53 | Inc(entityList[0].defence, 3); 54 | Inc(player_stats.armourPoints, 3); 55 | ui.displayMessage('You don the bone armour. The armour adds 3 points to your defence'); 56 | ui.equippedArmour:='Bone armour'; 57 | ui.writeBufferedMessages; 58 | end 59 | else 60 | (* To remove the armour *) 61 | begin 62 | entityList[0].armourEquipped := False; 63 | Dec(entityList[0].defence, 3); 64 | Dec(player_stats.armourPoints, 3); 65 | ui.displayMessage('You remove the bone armour.'); 66 | ui.equippedArmour:='No armour worn'; 67 | ui.writeBufferedMessages; 68 | end; 69 | end; 70 | 71 | end. 72 | -------------------------------------------------------------------------------- /source/items/armour/leather_armour1.pas: -------------------------------------------------------------------------------- 1 | (* Low quality leather armour *) 2 | 3 | unit leather_armour1; 4 | 5 | {$mode fpc}{$H+} 6 | 7 | interface 8 | 9 | (* Create armour *) 10 | procedure createLeatherArmour(itmx, itmy: smallint); 11 | (* Wear armour *) 12 | procedure useItem(equipped: boolean); 13 | 14 | implementation 15 | 16 | uses 17 | items, entities, ui, player_stats; 18 | 19 | procedure createLeatherArmour(itmx, itmy: smallint); 20 | begin 21 | SetLength(itemList, length(itemList) + 1); 22 | with itemList[High(itemList)] do 23 | begin 24 | itemID := indexID; 25 | itemName := 'Leather armour'; 26 | itemDescription := 'adds 2 to defence'; 27 | itemArticle := 'some'; 28 | itemType := itmArmour; 29 | itemMaterial := matLeather; 30 | useID := 3; 31 | glyph := '['; 32 | glyphColour := 'lightMagenta'; 33 | inView := False; 34 | posX := itmx; 35 | posY := itmy; 36 | NumberOfUses := 5; 37 | value := 5; 38 | onMap := True; 39 | throwable := False; 40 | throwDamage := 0; 41 | dice := 0; 42 | adds := 0; 43 | discovered := False; 44 | Inc(indexID); 45 | end; 46 | end; 47 | 48 | procedure useItem(equipped: boolean); 49 | begin 50 | if (equipped = False) then 51 | (* To wear the armour *) 52 | begin 53 | entityList[0].armourEquipped := True; 54 | Inc(entityList[0].defence, 2); 55 | Inc(player_stats.armourPoints, 2); 56 | ui.displayMessage('You don the leather armour. The armour adds 2 points to your defence'); 57 | ui.equippedArmour:='Leather armour'; 58 | ui.writeBufferedMessages; 59 | end 60 | else 61 | (* To remove the armour *) 62 | begin 63 | entityList[0].armourEquipped := False; 64 | Dec(entityList[0].defence, 2); 65 | Dec(player_stats.armourPoints, 2); 66 | ui.displayMessage('You remove the leather armour.'); 67 | ui.equippedArmour:='No armour worn'; 68 | ui.writeBufferedMessages; 69 | end; 70 | end; 71 | 72 | end. 73 | 74 | -------------------------------------------------------------------------------- /source/items/weapons/short_bow.pas: -------------------------------------------------------------------------------- 1 | (* A short bow *) 2 | 3 | unit short_bow; 4 | 5 | {$mode fpc}{$H+} 6 | 7 | interface 8 | 9 | (* Create a bow *) 10 | procedure createShortBow(itmx, itmy: smallint); 11 | (* Equip weapon *) 12 | procedure useItem(equipped: boolean); 13 | (* Remove weapon from inventory when thrown *) 14 | procedure throw; 15 | 16 | implementation 17 | 18 | uses 19 | items, entities, ui, player_stats; 20 | 21 | procedure createShortBow(itmx, itmy: smallint); 22 | begin 23 | SetLength(itemList, length(itemList) + 1); 24 | with itemList[High(itemList)] do 25 | begin 26 | itemID := indexID; 27 | itemName := 'short bow'; 28 | itemDescription := 'small hunting bow'; 29 | itemArticle := 'a'; 30 | itemType := itmProjectileWeapon; 31 | itemMaterial := matWood; 32 | useID := 10; 33 | glyph := '}'; 34 | glyphColour := 'brown'; 35 | inView := False; 36 | posX := itmx; 37 | posY := itmy; 38 | NumberOfUses := 1; 39 | value := 3; 40 | onMap := True; 41 | throwable := True; 42 | throwDamage := 1; 43 | dice := 0; 44 | adds := 0; 45 | discovered := False; 46 | Inc(indexID); 47 | end; 48 | end; 49 | 50 | procedure useItem(equipped: boolean); 51 | begin 52 | if (equipped = False) then 53 | (* To equip the weapon *) 54 | begin 55 | entityList[0].weaponEquipped := True; 56 | ui.displayMessage('You equip the short bow.'); 57 | ui.equippedWeapon := 'Short bow'; 58 | player_stats.projectileWeaponEquipped := True; 59 | ui.writeBufferedMessages; 60 | end 61 | else 62 | (* To unequip the weapon *) 63 | begin 64 | entityList[0].weaponEquipped := False; 65 | ui.displayMessage('You unequip the short bow.'); 66 | ui.equippedWeapon := 'No weapon equipped'; 67 | player_stats.projectileWeaponEquipped := False; 68 | ui.writeBufferedMessages; 69 | end; 70 | end; 71 | 72 | procedure throw; 73 | begin 74 | entityList[0].weaponEquipped := False; 75 | ui.equippedWeapon := 'No weapon equipped'; 76 | ui.writeBufferedMessages; 77 | end; 78 | 79 | end. 80 | -------------------------------------------------------------------------------- /source/globalutils.pas: -------------------------------------------------------------------------------- 1 | (* Common functions / utilities *) 2 | 3 | unit globalUtils; 4 | 5 | {$mode objfpc}{$H+} 6 | 7 | interface 8 | 9 | uses 10 | Classes; 11 | 12 | type 13 | coordinates = record 14 | x, y: smallint; 15 | end; 16 | 17 | (* Types of locations that can be explored. See 'architect' unit for explanation *) 18 | type 19 | dungeonTerrain = (tCave, tStoneCavern, tDungeon, tCrypt, tVillage); 20 | 21 | type (* Pathfinding - Path to player *) 22 | path = array[1..30] of TPoint; 23 | 24 | const 25 | (* Version info - a = Alpha, d = Debug, r = Release *) 26 | VERSION = '59a'; 27 | (* Columns of the game map *) 28 | MAXCOLUMNS = 80; 29 | (* Rows of the game map *) 30 | MAXROWS = 20; 31 | (* Save game file *) 32 | saveFile = 'saveGame.dat'; 33 | 34 | var 35 | dungeonArray: array[1..MAXROWS, 1..MAXCOLUMNS] of shortstring; 36 | (* Number of rooms in the current dungeon *) 37 | currentDgnTotalRooms: smallint; 38 | (* Save game directory *) 39 | saveDirectory: string; 40 | (* Name of entity or item that killed the player *) 41 | killer: shortstring; 42 | (* Stores whether the player is underground or overground ;-) *) 43 | womblingFree: shortstring; 44 | (* Last overworld coordinates the player was at *) 45 | OWx, OWy: smallint; 46 | 47 | (* Select random number from a range *) 48 | function randomRange(fromNumber, toNumber: smallint): smallint; 49 | (* Simulate dice rolls *) 50 | function rollDice(numberOfDice: byte): smallint; 51 | 52 | implementation 53 | 54 | function randomRange(fromNumber, toNumber: smallint): smallint; 55 | var 56 | p: smallint; 57 | begin 58 | p := toNumber - fromNumber; 59 | Result := random(p + 1) + fromNumber; 60 | end; 61 | 62 | function rollDice(numberOfDice: byte): smallint; 63 | var 64 | i: byte; 65 | x: smallint; 66 | begin 67 | x := 0; { initialise variable } 68 | if (numberOfDice = 0) then 69 | Result := 0 70 | else 71 | begin 72 | for i := 0 to numberOfDice do 73 | begin 74 | x := Random(6) + 1; 75 | end; 76 | Result := x; 77 | end; 78 | end; 79 | 80 | end. 81 | -------------------------------------------------------------------------------- /scripts/fp.ini: -------------------------------------------------------------------------------- 1 | [Compile] 2 | CompileMode=DEBUG 3 | PrimaryFile=Axes.pas 4 | 5 | [Editor] 6 | DefaultTabSize=8 7 | DefaultIndentSize=1 8 | DefaultFlags=20599 9 | DefaultSaveExt=.pas 10 | 11 | [Highlight] 12 | Exts="*.pas;*.pp;*.inc;*.dpr;*.lpr" 13 | NeedsTabs="make*;make*.*;fpcmake.loc" 14 | 15 | [SourcePath] 16 | SourceList="" 17 | 18 | [Colors] 19 | Palette_1_40=#$03#$03#$08#$0B#$30#$28#$30#$17#$1F#$1A#$31#$31#$1E#$71#$1F#$37#$3F#$3A#$13#$13#$3E#$21#$3F#$0B#$03#$7A#$13#$13#$70#$7F#$7E#$70#$70#$78#$78#$70#$70#$70#$7F#$7E 20 | Palette_41_80=#$20#$2B#$2F#$78#$2E#$70#$30#$3F#$3E#$3F#$2F#$1A#$20#$72#$31#$31#$30#$2F#$3E#$31#$13#$38#$00#$17#$1F#$1A#$71#$71#$1E#$17#$1F#$1E#$20#$2B#$2F#$78#$2E#$10#$30#$3F 21 | Palette_81_120=#$3E#$70#$2F#$7A#$20#$12#$31#$31#$30#$2F#$3E#$31#$13#$38#$00#$37#$3F#$3A#$13#$13#$3E#$30#$3F#$3E#$20#$2B#$2F#$78#$2E#$30#$70#$7F#$7E#$1F#$2F#$1A#$20#$32#$31#$71 22 | Palette_121_160=#$70#$2F#$7E#$71#$13#$38#$00#$70#$7F#$7A#$13#$13#$70#$70#$7F#$7E#$20#$2B#$2F#$78#$2E#$70#$30#$3F#$3E#$1F#$2F#$1A#$20#$72#$31#$31#$30#$2F#$3E#$31#$13#$38#$00#$30 23 | Palette_161_200=#$3E#$1E#$70#$30#$3F#$3A#$08#$03#$03#$03#$03#$03#$71#$1F#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$88#$88 24 | Palette_201_240=#$06#$03#$0B#$0E#$0A#$07#$07#$70#$0B#$20#$02#$0A#$04#$4E#$31#$02#$0A#$02#$0A#$0A#$31#$3F#$0A#$20#$3E#$3F#$70#$20#$FF#$3A#$37#$FF#$FF#$FF 25 | 26 | [Mouse] 27 | DoubleDelay=8 28 | ReverseButtons=0 29 | AltClickAction=6 30 | CtrlClickAction=1 31 | 32 | [Keyboard] 33 | EditKeys=microsoft 34 | 35 | [Search] 36 | FindFlags=4 37 | 38 | [Breakpoints] 39 | Count=0 40 | 41 | [Watches] 42 | Count=0 43 | 44 | [Preferences] 45 | DesktopFileFlags=209 46 | CenterCurrentLineWhileDebugging=1 47 | AutoSaveFlags=6 48 | MiscOptions=6 49 | DesktopLocation=1 50 | 51 | [Misc] 52 | ShowReadme=0 53 | 54 | [Files] 55 | OpenExts="*.pas;*.pp;*.inc;*.dpr;*.lpr" 56 | RecentFile1=Axes.pas,0,0 57 | PrinterDevice=prn 58 | 59 | [Tools] 60 | Title1="Cleanup directory" 61 | Params1="delp -r ./" 62 | HotKey1=0 63 | Title2="Format code" 64 | Params2="./formatCode.sh $EDNAME" 65 | HotKey2=0 66 | -------------------------------------------------------------------------------- /source/items/weapons/basic_club.pas: -------------------------------------------------------------------------------- 1 | (* A wooden club *) 2 | 3 | unit basic_club; 4 | 5 | {$mode fpc}{$H+} 6 | 7 | interface 8 | 9 | (* Create a club *) 10 | procedure createClub(itmx, itmy: smallint); 11 | (* Equip weapon *) 12 | procedure useItem(equipped: boolean); 13 | (* Remove weapon from inventory when thrown *) 14 | procedure throw; 15 | 16 | implementation 17 | 18 | uses 19 | items, entities, ui; 20 | 21 | procedure createClub(itmx, itmy: smallint); 22 | begin 23 | SetLength(itemList, length(itemList) + 1); 24 | with itemList[High(itemList)] do 25 | begin 26 | itemID := indexID; 27 | itemName := 'wooden club'; 28 | itemDescription := 'adds 1D6 to attack'; 29 | itemArticle := 'a'; 30 | itemType := itmWeapon; 31 | itemMaterial := matWood; 32 | useID := 4; 33 | glyph := chr(24); 34 | glyphColour := 'brown'; 35 | inView := False; 36 | posX := itmx; 37 | posY := itmy; 38 | NumberOfUses := 5; 39 | value := 0; 40 | onMap := True; 41 | throwable := True; 42 | throwDamage := 4; 43 | dice := 1; 44 | adds := 0; 45 | discovered := False; 46 | Inc(indexID); 47 | end; 48 | end; 49 | 50 | procedure useItem(equipped: boolean); 51 | begin 52 | if (equipped = False) then 53 | (* To equip the weapon *) 54 | begin 55 | entityList[0].weaponEquipped := True; 56 | Inc(entityList[0].weaponDice); 57 | ui.displayMessage('You equip the wooden club. The club adds 1D6 to your attack'); 58 | ui.equippedWeapon := 'Wooden club'; 59 | ui.writeBufferedMessages; 60 | end 61 | else 62 | (* To unequip the weapon *) 63 | begin 64 | entityList[0].weaponEquipped := False; 65 | Dec(entityList[0].weaponDice); 66 | ui.displayMessage('You unequip the wooden club.'); 67 | ui.equippedWeapon := 'No weapon equipped'; 68 | ui.writeBufferedMessages; 69 | end; 70 | end; 71 | 72 | procedure throw; 73 | begin 74 | entityList[0].weaponEquipped := False; 75 | Dec(entityList[0].weaponDice); 76 | ui.equippedWeapon := 'No weapon equipped'; 77 | ui.writeBufferedMessages; 78 | end; 79 | 80 | end. 81 | 82 | -------------------------------------------------------------------------------- /source/entities/npc/merchant.pas: -------------------------------------------------------------------------------- 1 | (* Merchant - Buys and sells items *) 2 | 3 | unit merchant; 4 | 5 | {$mode objfpc}{$H+} 6 | 7 | interface 8 | 9 | uses 10 | SysUtils, merchant_inventory; 11 | 12 | (* Create a merchant *) 13 | procedure createMerchant(uniqueid, npcx, npcy: smallint); 14 | (* The NPC takes their turn in the game loop *) 15 | procedure takeTurn(id: smallint); 16 | 17 | implementation 18 | 19 | uses 20 | entities, map; 21 | 22 | procedure createMerchant(uniqueid, npcx, npcy: smallint); 23 | begin 24 | (* Add a merchant to the list of creatures *) 25 | entities.listLength := length(entities.entityList); 26 | SetLength(entities.entityList, entities.listLength + 1); 27 | with entities.entityList[entities.listLength] do 28 | begin 29 | npcID := uniqueid; 30 | race := 'merchant'; 31 | intName := 'Merchant'; 32 | article := True; 33 | description := 'a merchant'; 34 | glyph := '@'; 35 | glyphColour := 'white'; 36 | maxHP := 4000; 37 | currentHP := maxHP; 38 | attack := 1; 39 | defence := 1; 40 | weaponDice := 0; 41 | weaponAdds := 0; 42 | xpReward := 0; 43 | visionRange := 4; 44 | moveCount := 0; 45 | targetX := 0; 46 | targetY := 0; 47 | inView := False; 48 | blocks := False; 49 | faction := npcFaction; 50 | state := stateNeutral; 51 | discovered := False; 52 | weaponEquipped := False; 53 | armourEquipped := False; 54 | isDead := False; 55 | stsDrunk := False; 56 | stsPoison := False; 57 | stsBewild := False; 58 | stsFrozen := False; 59 | tmrDrunk := 0; 60 | tmrPoison := 0; 61 | tmrBewild := 0; 62 | tmrFrozen := 0; 63 | hasPath := False; 64 | destinationReached := False; 65 | entities.initPath(uniqueid); 66 | posX := npcx; 67 | posY := npcy; 68 | end; 69 | (* Generate list of wares in inventory *) 70 | merchant_inventory.populateVillageInventory; 71 | (* Occupy tile *) 72 | map.occupy(npcx, npcy); 73 | end; 74 | 75 | procedure takeTurn(id: smallint); 76 | begin 77 | entities.moveNPC(id, entityList[id].posX, entityList[id].posY); 78 | end; 79 | 80 | end. 81 | -------------------------------------------------------------------------------- /source/items/weapons/leather_whip.pas: -------------------------------------------------------------------------------- 1 | (* A leather bullwhip *) 2 | 3 | unit leather_whip; 4 | 5 | {$mode fpc}{$H+} 6 | 7 | interface 8 | 9 | (* Create a whip *) 10 | procedure createWhip(itmx, itmy: smallint); 11 | (* Equip weapon *) 12 | procedure useItem(equipped: boolean); 13 | (* Remove weapon from inventory when thrown *) 14 | procedure throw; 15 | 16 | implementation 17 | 18 | uses 19 | items, entities, ui; 20 | 21 | procedure createWhip(itmx, itmy: smallint); 22 | begin 23 | SetLength(itemList, length(itemList) + 1); 24 | with itemList[High(itemList)] do 25 | begin 26 | itemID := indexID; 27 | itemName := 'Bullwhip'; 28 | itemDescription := 'Leather whip, 1D6+9 to attack'; 29 | itemArticle := 'a'; 30 | itemType := itmWeapon; 31 | itemMaterial := matLeather; 32 | useID := 28; 33 | glyph := chr(24); 34 | glyphColour := 'brown'; 35 | inView := False; 36 | posX := itmx; 37 | posY := itmy; 38 | NumberOfUses := 5; 39 | value := 5; 40 | onMap := True; 41 | throwable := True; 42 | throwDamage := 2; 43 | dice := 1; 44 | adds := 9; 45 | discovered := False; 46 | Inc(indexID); 47 | end; 48 | end; 49 | 50 | procedure useItem(equipped: boolean); 51 | begin 52 | if (equipped = False) then 53 | (* To equip the weapon *) 54 | begin 55 | entityList[0].weaponEquipped := True; 56 | Inc(entityList[0].weaponDice); 57 | Inc(entityList[0].weaponAdds,9); 58 | ui.displayMessage('You equip the bullwhip. The whip adds 1D6+9 to your attack'); 59 | ui.equippedWeapon := 'Bullwhip'; 60 | ui.writeBufferedMessages; 61 | end 62 | else 63 | (* To unequip the weapon *) 64 | begin 65 | entityList[0].weaponEquipped := False; 66 | Dec(entityList[0].weaponDice); 67 | Dec(entityList[0].weaponAdds,9); 68 | ui.displayMessage('You unequip the bullwhip.'); 69 | ui.equippedWeapon := 'No weapon equipped'; 70 | ui.writeBufferedMessages; 71 | end; 72 | end; 73 | 74 | procedure throw; 75 | begin 76 | entityList[0].weaponEquipped := False; 77 | Dec(entityList[0].weaponDice); 78 | ui.equippedWeapon := 'No weapon equipped'; 79 | ui.writeBufferedMessages; 80 | end; 81 | 82 | end. -------------------------------------------------------------------------------- /source/items/macguffins/parchment.pas: -------------------------------------------------------------------------------- 1 | (* Parchment scroll that can increase a player stat *) 2 | 3 | unit parchment; 4 | 5 | {$mode fpc}{$H+} 6 | 7 | interface 8 | 9 | uses 10 | SysUtils, player_stats, dlgInfo, video, plot_gen, globalUtils, ui, entities; 11 | 12 | (* Create the parchment *) 13 | procedure createParchment(itmx, itmy: smallint); 14 | (* Collect parchment *) 15 | procedure collectParchment; 16 | 17 | implementation 18 | 19 | uses 20 | items; 21 | 22 | procedure createParchment(itmx, itmy: smallint); 23 | begin 24 | SetLength(itemList, length(itemList) + 1); 25 | with itemList[High(itemList)] do 26 | begin 27 | itemID := indexID; 28 | itemName := 'Parchment scroll'; 29 | itemDescription := 'A scroll with an enchanted aura'; 30 | itemArticle := 'a'; 31 | itemType := itmQuest; 32 | itemMaterial := matPaper; 33 | useID := 19; 34 | glyph := ')'; 35 | glyphColour := 'white'; 36 | inView := False; 37 | posX := itmx; 38 | posY := itmy; 39 | NumberOfUses := 5; 40 | value := 10; 41 | onMap := True; 42 | throwable := False; 43 | throwDamage := 0; 44 | dice := 0; 45 | adds := 0; 46 | discovered := False; 47 | Inc(indexID); 48 | end; 49 | end; 50 | 51 | procedure collectParchment; 52 | var 53 | attribute: smallint; 54 | begin 55 | (* choose the type of parchment found *) 56 | attribute := randomRange(0, 2); 57 | case attribute of 58 | 0: dlgInfo.parchmentType := 'DEX'; 59 | 1: dlgInfo.parchmentType := 'ATT'; 60 | 2: dlgInfo.parchmentType := 'DEF'; 61 | end; 62 | dlgInfo.dialogType := dlgParchment; 63 | case parchmentType of 64 | 'DEX': 65 | begin 66 | Inc(player_stats.dexterity); 67 | ui.updateDexterity; 68 | ui.displayMessage('Your Dexterity increases.'); 69 | end; 70 | 'ATT': 71 | begin 72 | Inc(entityList[0].attack); 73 | ui.updateAttack; 74 | ui.displayMessage('Your Attack strength increases.'); 75 | end; 76 | 'DEF': 77 | begin 78 | Inc(entityList[0].defence); 79 | ui.updateDefence; 80 | ui.displayMessage('Your Defence ability increases.'); 81 | end; 82 | end; 83 | end; 84 | 85 | end. 86 | 87 | -------------------------------------------------------------------------------- /source/items/weapons/terbutje.pas: -------------------------------------------------------------------------------- 1 | (* A wooden club studded with spikes made of obsidian *) 2 | 3 | unit terbutje; 4 | 5 | {$mode fpc}{$H+} 6 | 7 | interface 8 | 9 | (* Create a terbutje *) 10 | procedure createTerbutje(itmx, itmy: smallint); 11 | (* Equip weapon *) 12 | procedure useItem(equipped: boolean); 13 | (* Remove weapon from inventory when thrown *) 14 | procedure throw; 15 | 16 | implementation 17 | 18 | uses 19 | items, entities, ui; 20 | 21 | procedure createTerbutje(itmx, itmy: smallint); 22 | begin 23 | SetLength(itemList, length(itemList) + 1); 24 | with itemList[High(itemList)] do 25 | begin 26 | itemID := indexID; 27 | itemName := 'Terbutje'; 28 | itemDescription := 'Club covered in obsidian spikes, 1D6+9 to attack'; 29 | itemArticle := 'a'; 30 | itemType := itmWeapon; 31 | itemMaterial := matWood; 32 | useID := 27; 33 | glyph := chr(24); 34 | glyphColour := 'brown'; 35 | inView := False; 36 | posX := itmx; 37 | posY := itmy; 38 | NumberOfUses := 5; 39 | value := 5; 40 | onMap := True; 41 | throwable := True; 42 | throwDamage := 8; 43 | dice := 1; 44 | adds := 9; 45 | discovered := False; 46 | Inc(indexID); 47 | end; 48 | end; 49 | 50 | procedure useItem(equipped: boolean); 51 | begin 52 | if (equipped = False) then 53 | (* To equip the weapon *) 54 | begin 55 | entityList[0].weaponEquipped := True; 56 | Inc(entityList[0].weaponDice); 57 | Inc(entityList[0].weaponAdds,9); 58 | ui.displayMessage('You equip the terbutje. The terbutje adds 1D6+9 to your attack'); 59 | ui.equippedWeapon := 'Terbutje'; 60 | ui.writeBufferedMessages; 61 | end 62 | else 63 | (* To unequip the weapon *) 64 | begin 65 | entityList[0].weaponEquipped := False; 66 | Dec(entityList[0].weaponDice); 67 | Dec(entityList[0].weaponAdds,9); 68 | ui.displayMessage('You unequip the terbutje.'); 69 | ui.equippedWeapon := 'No weapon equipped'; 70 | ui.writeBufferedMessages; 71 | end; 72 | end; 73 | 74 | procedure throw; 75 | begin 76 | entityList[0].weaponEquipped := False; 77 | Dec(entityList[0].weaponDice); 78 | ui.equippedWeapon := 'No weapon equipped'; 79 | ui.writeBufferedMessages; 80 | end; 81 | 82 | end. -------------------------------------------------------------------------------- /source/items/weapons/pointy_stick.pas: -------------------------------------------------------------------------------- 1 | (* A pointy stick *) 2 | 3 | unit pointy_stick; 4 | 5 | {$mode fpc}{$H+} 6 | 7 | interface 8 | 9 | (* Create a pointy stick *) 10 | procedure createPointyStick(itmx, itmy: smallint); 11 | (* Equip weapon *) 12 | procedure useItem(equipped: boolean); 13 | (* Remove weapon from inventory when thrown *) 14 | procedure throw; 15 | 16 | implementation 17 | 18 | uses 19 | items, entities, ui; 20 | 21 | procedure createPointyStick(itmx, itmy: smallint); 22 | begin 23 | SetLength(itemList, length(itemList) + 1); 24 | with itemList[High(itemList)] do 25 | begin 26 | itemID := indexID; 27 | itemName := 'pointy stick'; 28 | itemDescription := 'adds 1D6+1 to attack'; 29 | itemArticle := 'a'; 30 | itemType := itmWeapon; 31 | itemMaterial := matWood; 32 | useID := 11; 33 | glyph := chr(173); 34 | glyphColour := 'brown'; 35 | inView := False; 36 | posX := itmx; 37 | posY := itmy; 38 | NumberOfUses := 5; 39 | value := 0; 40 | onMap := True; 41 | throwable := True; 42 | throwDamage := 4; 43 | dice := 1; 44 | adds := 1; 45 | discovered := False; 46 | Inc(indexID); 47 | end; 48 | end; 49 | 50 | procedure useItem(equipped: boolean); 51 | begin 52 | if (equipped = False) then 53 | (* To equip the weapon *) 54 | begin 55 | entityList[0].weaponEquipped := True; 56 | Inc(entityList[0].weaponDice); 57 | Inc(entityList[0].weaponAdds); 58 | ui.displayMessage('You equip the pointy stick. The stick adds 1D6+1 to your attack'); 59 | ui.equippedWeapon := 'Pointy stick'; 60 | ui.writeBufferedMessages; 61 | end 62 | else 63 | (* To unequip the weapon *) 64 | begin 65 | entityList[0].weaponEquipped := False; 66 | Dec(entityList[0].weaponDice); 67 | Dec(entityList[0].weaponAdds); 68 | ui.displayMessage('You unequip the pointy stick.'); 69 | ui.equippedWeapon := 'No weapon equipped'; 70 | ui.writeBufferedMessages; 71 | end; 72 | end; 73 | 74 | procedure throw; 75 | begin 76 | entityList[0].weaponEquipped := False; 77 | Dec(entityList[0].weaponDice); 78 | Dec(entityList[0].weaponAdds); 79 | ui.equippedWeapon := 'No weapon equipped'; 80 | ui.writeBufferedMessages; 81 | end; 82 | 83 | end. 84 | -------------------------------------------------------------------------------- /source/entities/bugs/web.pas: -------------------------------------------------------------------------------- 1 | (* Environmental hazard - blocks entities *) 2 | 3 | unit web; 4 | 5 | {$mode fpc}{$H+} 6 | 7 | interface 8 | 9 | uses 10 | SysUtils; 11 | 12 | (* Create web *) 13 | procedure createWeb(uniqueid, npcx, npcy: smallint); 14 | (* Take a turn *) 15 | procedure takeTurn(id: smallint); 16 | 17 | implementation 18 | 19 | uses 20 | entities, globalUtils, map; 21 | 22 | procedure createWeb(uniqueid, npcx, npcy: smallint); 23 | var 24 | i: smallint; 25 | begin 26 | (* Add a web to the list of entities *) 27 | entities.listLength := length(entities.entityList); 28 | SetLength(entities.entityList, entities.listLength + 1); 29 | with entities.entityList[entities.listLength] do 30 | begin 31 | npcID := uniqueid; 32 | race := 'web'; 33 | intName := 'stickyWeb'; 34 | article := True; 35 | description := 'a sticky web'; 36 | glyph := '/'; 37 | glyphColour := 'lightGrey'; 38 | maxHP := randomRange(5, 8); 39 | currentHP := maxHP; 40 | attack := 0; 41 | defence := randomRange(5, 12); 42 | weaponDice := 0; 43 | weaponAdds := 0; 44 | xpReward := 0; 45 | visionRange := 4; 46 | (* Number of turns before web dissolves *) 47 | i := randomRange(5, 10); 48 | moveCount := i; 49 | targetX := 0; 50 | targetY := 0; 51 | inView := False; 52 | blocks := False; 53 | faction := trapFaction; 54 | state := stateHostile; 55 | discovered := False; 56 | weaponEquipped := False; 57 | armourEquipped := False; 58 | isDead := False; 59 | stsDrunk := False; 60 | stsPoison := False; 61 | stsBewild := False; 62 | stsFrozen := False; 63 | tmrDrunk := 0; 64 | tmrPoison := 0; 65 | tmrBewild := 0; 66 | tmrFrozen := 0; 67 | hasPath := False; 68 | destinationReached := False; 69 | entities.initPath(uniqueid); 70 | posX := npcx; 71 | posY := npcy; 72 | end; 73 | (* Occupy tile *) 74 | map.occupy(npcx, npcy); 75 | end; 76 | 77 | procedure takeTurn(id: smallint); 78 | begin 79 | Dec(entityList[id].moveCount); 80 | if (entityList[id].moveCount <= 0) then 81 | begin 82 | entityList[id].currentHP := 0; 83 | killEntity(id); 84 | end 85 | else 86 | entities.moveNPC(id, entityList[id].posX, entityList[id].posY); 87 | end; 88 | 89 | end. 90 | -------------------------------------------------------------------------------- /source/screens/scrintro.pas: -------------------------------------------------------------------------------- 1 | (* Introduction screen *) 2 | 3 | unit scrIntro; 4 | 5 | {$mode fpc}{$H+} 6 | 7 | interface 8 | 9 | uses 10 | ui, video, globalUtils; 11 | 12 | procedure displayIntroScreen; 13 | 14 | implementation 15 | 16 | procedure displayIntroScreen; 17 | var 18 | header, insult, sounds: string; 19 | prefix: smallint; 20 | begin 21 | (* Randomly select header text *) 22 | prefix := randomRange(1, 4); 23 | if (prefix = 1) then 24 | header := 'Thrown into the smugglers cave' 25 | else if (prefix = 2) then 26 | header := 'Kidnap! Waylaid in the night' 27 | else 28 | header := 'Every adventure begins with a single... fall'; 29 | 30 | (* Randomly select insult *) 31 | prefix := randomRange(1, 5); 32 | if (prefix = 1) then 33 | insult := 'toad puke' 34 | else if (prefix = 2) then 35 | insult := 'pond scum' 36 | else if (prefix = 3) then 37 | insult := 'dung smear' 38 | else if (prefix = 4) then 39 | insult := 'slug' 40 | else 41 | insult := 'fish breath'; 42 | 43 | (* Randomly select sounds *) 44 | prefix := randomRange(1, 4); 45 | if (prefix = 1) then 46 | sounds := 'scratching' 47 | else if (prefix = 2) then 48 | sounds := 'chittering' 49 | else 50 | sounds := 'squealing'; 51 | 52 | (* prepare changes to the screen *) 53 | LockScreenUpdate; 54 | screenBlank; 55 | TextOut(ui.centreX(header), 2, 'cyan', header); 56 | { Flavour text } 57 | TextOut(3, 6, 'cyan', 'The smugglers roughly grab you and throw you down the crudely carved'); 58 | TextOut(3, 7, 'cyan', 'stairs, into the cavern. You gaze around, struggling to penetrate the'); 59 | TextOut(3, 8, 'cyan', 'darkness by your feeble torchlight.'); 60 | TextOut(3, 9, 'cyan', '"Somewhere down there is the map, stolen by those thieving imps.'); 61 | TextOut(4, 10, 'cyan', 'Find it and bring it back, you little ' + insult + '"'); 62 | TextOut(3, 12, 'cyan', 'The door slams firmly closed behind you. Ignoring the sound of'); 63 | TextOut(3, 13, 'cyan', sounds + ' coming from the darkness, you step forward...'); 64 | 65 | TextOut(ui.centreX('[SPACE] to continue'), 24, 'cyan', '[SPACE] to continue'); 66 | (* Write those changes to the screen *) 67 | UnlockScreenUpdate; 68 | (* only redraws the parts that have been updated *) 69 | UpdateScreen(False); 70 | end; 71 | 72 | end. 73 | -------------------------------------------------------------------------------- /source/debuggingfunctions.pas: -------------------------------------------------------------------------------- 1 | (* Helper functions when debugging, printing out maps, topping up HP, etc *) 2 | 3 | unit debuggingFunctions; 4 | 5 | {$mode objfpc}{$H+} 6 | 7 | interface 8 | 9 | uses 10 | SysUtils, entities, player_stats, map, items, globalUtils, logging; 11 | 12 | (* Increases HP and light timer, to aid exploration *) 13 | procedure topUpStats; 14 | (* Show all entities on the screen *) 15 | procedure showEntitiesItems; 16 | (* Prints the map to a text file *) 17 | procedure dumpMap; 18 | 19 | implementation 20 | 21 | uses 22 | main; 23 | 24 | procedure topUpStats; 25 | begin 26 | Inc(entityList[0].maxHP, 100); 27 | entityList[0].currentHP := entityList[0].maxHP; 28 | Inc(player_stats.lightCounter, 500); 29 | showEntitiesItems 30 | end; 31 | 32 | procedure showEntitiesItems; 33 | var 34 | i: smallint; 35 | stateValue: shortstring; 36 | begin 37 | logAction(''); 38 | logAction('-- showEntitiesItems --'); 39 | (* Highlight entities *) 40 | for i := 0 to High(entityList) do 41 | begin 42 | logAction(IntToStr(i) + ': ' + entityList[i].race + ' is at ' + IntToStr(entityList[i].posX) + ', ' + IntToStr(entityList[i].posY)); 43 | map.mapDisplay[entityList[i].posY, entityList[i].posX].GlyphColour := 'white'; 44 | map.mapDisplay[entityList[i].posY, entityList[i].posX].Glyph := entityList[i].glyph; 45 | end; 46 | (* Highlight items *) 47 | for i := 0 to High(itemList) do 48 | begin 49 | logAction(IntToStr(i) + ': ' + itemList[i].itemName + ' is at ' + IntToStr(itemList[i].posX) + ', ' + IntToStr(itemList[i].posY)); 50 | map.mapDisplay[itemList[i].posY, itemList[i].posX].GlyphColour := 'yellow'; 51 | map.mapDisplay[itemList[i].posY, itemList[i].posX].Glyph := 'X'; 52 | end; 53 | logAction(''); 54 | dumpMap; 55 | (* Write out the game state *) 56 | WriteStr(stateValue, main.gameState); 57 | logAction('gameState: ' + stateValue); 58 | end; 59 | 60 | procedure dumpMap; 61 | var 62 | filename: shortstring; 63 | myfile: Text; 64 | begin 65 | filename := globalUtils.saveDirectory + PathDelim + 'map.txt'; 66 | AssignFile(myfile, filename); 67 | rewrite(myfile); 68 | for r := 1 to MAXROWS do 69 | begin 70 | for c := 1 to MAXCOLUMNS do 71 | begin 72 | Write(myfile, map.maparea[r][c].Glyph); 73 | end; 74 | Write(myfile, sLineBreak); 75 | end; 76 | closeFile(myfile); 77 | end; 78 | 79 | end. 80 | -------------------------------------------------------------------------------- /docs/scrTitle.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Axes, Armour & Ale: scrTitle 5 | 6 | 7 | 8 | 9 | 10 | 11 |
13 |

Unit scrTitle

14 |
15 |
Uses
Classes, Interfaces, Objects and Records
Types
Constants
Variables
16 |

Description

17 |

18 | Title screen

19 |

Overview

20 |

Functions and Procedures

21 | 22 | 23 | 24 | 25 |
procedure displayTitleScreen(yn: byte);
26 |

Description

27 |

Functions and Procedures

28 | 29 | 30 | 31 | 32 | 34 |
procedure displayTitleScreen(yn: byte);
33 |  
35 |
Generated by PasDoc 0.16.0. 36 | 37 |
38 | -------------------------------------------------------------------------------- /source/items/traps/poison_spore.pas: -------------------------------------------------------------------------------- 1 | (* A spore that poisons the player when triggered *) 2 | 3 | unit poison_spore; 4 | 5 | {$mode objfpc}{$H+} 6 | 7 | interface 8 | 9 | uses 10 | SysUtils, video; 11 | 12 | (* Create a spore *) 13 | procedure createSpore(itmx, itmy: smallint); 14 | (* Item cannot be equipped *) 15 | procedure useItem; 16 | (* Triggered when the spore has been stepped on *) 17 | procedure triggered(id: smallint); 18 | 19 | implementation 20 | 21 | uses 22 | items, ui, map, entities, globalUtils; 23 | 24 | procedure createSpore(itmx, itmy: smallint); 25 | begin 26 | SetLength(itemList, length(itemList) + 1); 27 | with itemList[High(itemList)] do 28 | begin 29 | itemID := indexID; 30 | itemName := 'spore'; 31 | itemDescription := 'poisonous spore'; 32 | itemArticle := 'a'; 33 | itemType := itmTrap; 34 | itemMaterial := matFlammable; 35 | useID := 16; 36 | glyph := '*'; 37 | glyphColour := 'green'; 38 | inView := False; 39 | posX := itmx; 40 | posY := itmy; 41 | NumberOfUses := 5; 42 | value := 0; 43 | onMap := True; 44 | throwable := True; 45 | throwDamage := 3; 46 | dice := 0; 47 | adds := 0; 48 | discovered := True; 49 | Inc(indexID); 50 | end; 51 | end; 52 | 53 | procedure useItem; 54 | begin 55 | ui.displayMessage('You can''t pick up a spore'); 56 | end; 57 | 58 | procedure triggered(id: smallint); 59 | var 60 | target: smallint; 61 | begin 62 | (* Check if the spore has been stepped on *) 63 | if (map.isOccupied(itemList[id].posX, itemList[id].posY) = True) then 64 | begin 65 | target := entities.getCreatureID(itemList[id].posX, itemList[id].posY); 66 | (* Check if it's the Player *) 67 | if (target = 0) then 68 | begin 69 | (* Inflict poison damage *) 70 | entityList[0].stsPoison := True; 71 | entityList[0].tmrPoison := 2; 72 | if (killer = 'empty') then 73 | killer := 'poisoned fungus spore'; 74 | LockScreenUpdate; 75 | ui.displayMessage('You step on a poisoned spore'); 76 | (* Update UI *) 77 | ui.displayStatusEffect(1, 'poison'); 78 | ui.poisonStatusSet := True; 79 | entityList[0].glyphColour := 'green'; 80 | UnlockScreenUpdate; 81 | UpdateScreen(False); 82 | end 83 | (* If an NPC steps on the spore *) 84 | else 85 | begin 86 | entityList[id].stsPoison := True; 87 | entityList[id].tmrPoison := 2; 88 | end; 89 | end; 90 | end; 91 | 92 | end. 93 | -------------------------------------------------------------------------------- /scripts/fp.cfg: -------------------------------------------------------------------------------- 1 | # Automatically created file, don't edit. 2 | #IFDEF NORMAL 3 | -TLinux 4 | -Mfpc 5 | -Sg 6 | -Si 7 | -Os 8 | -CpATHLON64 9 | -OpCOREI 10 | -Fu./ 11 | -Fuscreens 12 | -Fudungeons/ 13 | -Fuplayer/ 14 | -Fuvision/ 15 | -Fuentities/ 16 | -Fuentities/hobs/ 17 | -Fuentities/animals/ 18 | -Fuentities/fungus/ 19 | -Fuentities/bugs/ 20 | -Fuentities/gnomes/ 21 | -Fuentities/bogles/ 22 | -Fuentities/goblinkin/ 23 | -Fuentities/troglodytes/ 24 | -Fuentities/undead/ 25 | -Fuitems/ 26 | -Fuitems/weapons/ 27 | -Fuitems/armour/ 28 | -Fuitems/macguffins/ 29 | -Fuitems/traps 30 | -Fu/usr/lib/fpc/$fpcversion/units/$fpctarget 31 | -Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/* 32 | -Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/rtl 33 | -Fientities/ 34 | -g- 35 | -p- 36 | -b- 37 | #ENDIF 38 | 39 | #IFDEF DEBUG 40 | -TLinux 41 | -Mfpc 42 | -vw 43 | -vh 44 | -Sg 45 | -Si 46 | -Sa 47 | -Cr 48 | -Ct 49 | -Ci 50 | -Co 51 | -CR 52 | -CpATHLON64 53 | -OpCOREI 54 | -Fu./ 55 | -Fuscreens 56 | -Fudungeons/ 57 | -Fuplayer/ 58 | -Fuvision/ 59 | -Fuentities/ 60 | -Fuentities/hobs/ 61 | -Fuentities/animals/ 62 | -Fuentities/fungus/ 63 | -Fuentities/bugs/ 64 | -Fuentities/gnomes/ 65 | -Fuentities/bogles/ 66 | -Fuentities/goblinkin/ 67 | -Fuentities/troglodytes/ 68 | -Fuentities/undead/ 69 | -Fuitems/ 70 | -Fuitems/weapons/ 71 | -Fuitems/armour/ 72 | -Fuitems/macguffins/ 73 | -Fuitems/traps 74 | -Fu/usr/lib/fpc/$fpcversion/units/$fpctarget 75 | -Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/* 76 | -Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/rtl 77 | -Fientities/ 78 | -gl 79 | -p- 80 | -b- 81 | #ENDIF 82 | 83 | #IFDEF RELEASE 84 | -TLinux 85 | -Mfpc 86 | -Si 87 | -Sh 88 | -Sc 89 | -CX 90 | -Os 91 | -CpATHLON64 92 | -OpCOREI 93 | -Fu./ 94 | -Fuscreens 95 | -Fudungeons/ 96 | -Fuplayer/ 97 | -Fuvision/ 98 | -Fuentities/ 99 | -Fuentities/hobs/ 100 | -Fuentities/animals/ 101 | -Fuentities/fungus/ 102 | -Fuentities/bugs/ 103 | -Fuentities/gnomes/ 104 | -Fuentities/bogles/ 105 | -Fuentities/goblinkin/ 106 | -Fuentities/troglodytes/ 107 | -Fuentities/undead/ 108 | -Fuitems/ 109 | -Fuitems/weapons/ 110 | -Fuitems/armour/ 111 | -Fuitems/macguffins/ 112 | -Fuitems/traps 113 | -Fu/usr/lib/fpc/$fpcversion/units/$fpctarget 114 | -Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/* 115 | -Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/rtl 116 | -Fientities/ 117 | -XS 118 | -g- 119 | -p- 120 | -b- 121 | #ENDIF 122 | 123 | -------------------------------------------------------------------------------- /source/entities/npc/pig.pas: -------------------------------------------------------------------------------- 1 | (* Wandering village pig *) 2 | 3 | unit pig; 4 | 5 | {$mode objfpc}{$H+} 6 | 7 | interface 8 | 9 | uses 10 | SysUtils, ai_villager; 11 | 12 | (* Create a pig *) 13 | procedure createPig(uniqueid, npcx, npcy: smallint); 14 | (* Pig takes their turn in the game loop *) 15 | procedure takeTurn(id: smallint); 16 | (* Decision tree for Neutral state *) 17 | procedure decisionNeutral(id: smallint); 18 | (* Check if player is next to pig *) 19 | function isNextToPlayer(spx, spy: smallint): boolean; 20 | 21 | implementation 22 | 23 | uses 24 | entities, globalutils, map; 25 | 26 | procedure createPig(uniqueid, npcx, npcy: smallint); 27 | begin 28 | (* Add createPig to the list of creatures *) 29 | entities.listLength := length(entities.entityList); 30 | SetLength(entities.entityList, entities.listLength + 1); 31 | with entities.entityList[entities.listLength] do 32 | begin 33 | npcID := uniqueid; 34 | race := 'pig'; 35 | intName := 'pig'; 36 | article := True; 37 | description := 'a large pig'; 38 | glyph := 'p'; 39 | glyphColour := 'pink'; 40 | maxHP := 4; 41 | currentHP := maxHP; 42 | attack := 1; 43 | defence := 1; 44 | weaponDice := 0; 45 | weaponAdds := 0; 46 | xpReward := maxHP; 47 | visionRange := 4; 48 | moveCount := 0; 49 | targetX := 0; 50 | targetY := 0; 51 | inView := False; 52 | blocks := False; 53 | faction := npcFaction; 54 | state := stateNeutral; 55 | discovered := False; 56 | weaponEquipped := False; 57 | armourEquipped := False; 58 | isDead := False; 59 | stsDrunk := False; 60 | stsPoison := False; 61 | stsBewild := False; 62 | stsFrozen := False; 63 | tmrDrunk := 0; 64 | tmrPoison := 0; 65 | tmrBewild := 0; 66 | tmrFrozen := 0; 67 | hasPath := False; 68 | destinationReached := False; 69 | entities.initPath(uniqueid); 70 | posX := npcx; 71 | posY := npcy; 72 | end; 73 | (* Occupy tile *) 74 | map.occupy(npcx, npcy); 75 | end; 76 | 77 | 78 | procedure takeTurn(id: smallint); 79 | begin 80 | decisionNeutral(id); 81 | end; 82 | 83 | procedure decisionNeutral(id: smallint); 84 | var 85 | stopAndSmellFlowers: byte; 86 | begin 87 | stopAndSmellFlowers := globalutils.randomRange(1, 3); 88 | if (stopAndSmellFlowers = 1) then 89 | { Either wander randomly } 90 | ai_villager.wander(id, entityList[id].posX, entityList[id].posY) 91 | else 92 | { or stay in place } 93 | entities.moveNPC(id, entityList[id].posX, entityList[id].posY); 94 | end; 95 | 96 | {$I nextto} 97 | 98 | end. 99 | -------------------------------------------------------------------------------- /source/items/weapons/gnomish_axe.pas: -------------------------------------------------------------------------------- 1 | (* Steel axe *) 2 | 3 | unit gnomish_axe; 4 | 5 | {$mode fpc}{$H+} 6 | {$WARN 5024 off : Parameter "$1" not used} 7 | interface 8 | 9 | uses 10 | SysUtils; 11 | 12 | (* Create an axe *) 13 | procedure createGnomishAxe(itmx, itmy: smallint); 14 | (* Equip weapon *) 15 | procedure useItem(equipped: boolean; ident: smallint); 16 | (* Remove weapon from inventory when thrown *) 17 | procedure throw(itemID: smallint); 18 | (* Check if weapon is damaged when thrown *) 19 | procedure thrownDamaged(itmID: smallint; inventory: boolean); 20 | 21 | implementation 22 | 23 | uses 24 | items, entities, ui, player_inventory; 25 | 26 | procedure createGnomishAxe(itmx, itmy: smallint); 27 | begin 28 | SetLength(itemList, length(itemList) + 1); 29 | with itemList[High(itemList)] do 30 | begin 31 | itemID := indexID; 32 | itemName := 'Gnomish axe'; 33 | itemDescription := 'adds 2D6 to attack'; 34 | itemArticle := 'a'; 35 | itemType := itmWeapon; 36 | itemMaterial := matSteel; 37 | useID := 18; 38 | glyph := chr(194); 39 | glyphColour := 'lightGrey'; 40 | inView := False; 41 | posX := itmx; 42 | posY := itmy; 43 | NumberOfUses := 10; 44 | value := 4; 45 | onMap := True; 46 | throwable := True; 47 | throwDamage := 7; 48 | dice := 2; 49 | adds := 0; 50 | discovered := False; 51 | Inc(indexID); 52 | end; 53 | end; 54 | 55 | procedure useItem(equipped: boolean; ident: smallint); 56 | var 57 | info: shortstring; 58 | begin 59 | info := 'You unequip the Gnomish axe.'; 60 | if (equipped = False) then 61 | (* To equip the weapon *) 62 | begin 63 | info := 'You equip the Gnomish axe. The axe adds 2D6 to your attack'; 64 | entityList[0].weaponEquipped := True; 65 | Inc(entityList[0].weaponDice, 2); 66 | ui.displayMessage(info); 67 | ui.equippedWeapon := 'Gnomish axe'; 68 | ui.writeBufferedMessages; 69 | end 70 | else 71 | (* To unequip the weapon *) 72 | begin 73 | entityList[0].weaponEquipped := False; 74 | Dec(entityList[0].weaponDice, 2); 75 | ui.displayMessage(info); 76 | ui.equippedWeapon := 'No weapon equipped'; 77 | ui.writeBufferedMessages; 78 | end; 79 | end; 80 | 81 | procedure throw(itemID: smallint); 82 | begin 83 | entityList[0].weaponEquipped := False; 84 | Dec(entityList[0].weaponDice, 2); 85 | ui.equippedWeapon := 'No weapon equipped'; 86 | end; 87 | 88 | procedure thrownDamaged(itmID: smallint; inventory: boolean); 89 | begin 90 | if (inventory = True) then 91 | player_inventory.inventory[itmID].throwDamage := 6; 92 | end; 93 | 94 | end. 95 | -------------------------------------------------------------------------------- /source/entities/npc/villager.pas: -------------------------------------------------------------------------------- 1 | (* Simple wandering NPC *) 2 | 3 | unit villager; 4 | 5 | {$mode objfpc}{$H+} 6 | 7 | interface 8 | 9 | uses 10 | SysUtils, ai_villager; 11 | 12 | (* Create a villager *) 13 | procedure createVillager(uniqueid, npcx, npcy: smallint); 14 | (* The NPC takes their turn in the game loop *) 15 | procedure takeTurn(id: smallint); 16 | (* Decision tree for Neutral state *) 17 | procedure decisionNeutral(id: smallint); 18 | (* Check if player is next to NPC *) 19 | function isNextToPlayer(spx, spy: smallint): boolean; 20 | 21 | implementation 22 | 23 | uses 24 | entities, globalutils, map; 25 | 26 | procedure createVillager(uniqueid, npcx, npcy: smallint); 27 | begin 28 | (* Add a villager to the list of creatures *) 29 | entities.listLength := length(entities.entityList); 30 | SetLength(entities.entityList, entities.listLength + 1); 31 | with entities.entityList[entities.listLength] do 32 | begin 33 | npcID := uniqueid; 34 | race := 'villager'; 35 | intName := 'villager'; 36 | article := True; 37 | description := 'a villager'; 38 | glyph := '@'; 39 | glyphColour := 'lightGrey'; 40 | maxHP := 4; 41 | currentHP := maxHP; 42 | attack := 1; 43 | defence := 1; 44 | weaponDice := 0; 45 | weaponAdds := 0; 46 | xpReward := maxHP; 47 | visionRange := 4; 48 | moveCount := 0; 49 | targetX := 0; 50 | targetY := 0; 51 | inView := False; 52 | blocks := False; 53 | faction := npcFaction; 54 | state := stateNeutral; 55 | discovered := False; 56 | weaponEquipped := False; 57 | armourEquipped := False; 58 | isDead := False; 59 | stsDrunk := False; 60 | stsPoison := False; 61 | stsBewild := False; 62 | stsFrozen := False; 63 | tmrDrunk := 0; 64 | tmrPoison := 0; 65 | tmrBewild := 0; 66 | tmrFrozen := 0; 67 | hasPath := False; 68 | destinationReached := False; 69 | entities.initPath(uniqueid); 70 | posX := npcx; 71 | posY := npcy; 72 | end; 73 | (* Occupy tile *) 74 | map.occupy(npcx, npcy); 75 | end; 76 | 77 | 78 | procedure takeTurn(id: smallint); 79 | begin 80 | decisionNeutral(id); 81 | end; 82 | 83 | procedure decisionNeutral(id: smallint); 84 | var 85 | stopAndSmellFlowers: byte; 86 | begin 87 | stopAndSmellFlowers := globalutils.randomRange(1, 10); 88 | if (stopAndSmellFlowers = 1) then 89 | { Either wander randomly } 90 | ai_villager.wander(id, entityList[id].posX, entityList[id].posY) 91 | else 92 | { or stay in place } 93 | entities.moveNPC(id, entityList[id].posX, entityList[id].posY); 94 | end; 95 | 96 | {$I nextto} 97 | 98 | end. -------------------------------------------------------------------------------- /docs/scrIntro.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Axes, Armour & Ale: scrIntro 5 | 6 | 7 | 8 | 9 | 10 | 11 |
13 |

Unit scrIntro

14 |
15 |
Classes, Interfaces, Objects and Records
Types
Constants
Variables
16 |

Description

17 |

18 | Introduction screen

19 |

Uses

20 |

Overview

21 |

Functions and Procedures

22 | 23 | 24 | 25 | 26 |
procedure displayIntroScreen;
27 |

Description

28 |

Functions and Procedures

29 | 30 | 31 | 32 | 33 | 35 |
procedure displayIntroScreen;
34 |  
36 |
Generated by PasDoc 0.16.0. 37 | 38 |
39 | -------------------------------------------------------------------------------- /source/entities/npc/village_idiot.pas: -------------------------------------------------------------------------------- 1 | (* Simple wandering NPC *) 2 | 3 | unit village_idiot; 4 | 5 | {$mode objfpc}{$H+} 6 | 7 | interface 8 | 9 | uses 10 | SysUtils, ai_villager; 11 | 12 | (* Create a villager *) 13 | procedure createVillager(uniqueid, npcx, npcy: smallint); 14 | (* The NPC takes their turn in the game loop *) 15 | procedure takeTurn(id: smallint); 16 | (* Decision tree for Neutral state *) 17 | procedure decisionNeutral(id: smallint); 18 | (* Check if player is next to NPC *) 19 | function isNextToPlayer(spx, spy: smallint): boolean; 20 | 21 | implementation 22 | 23 | uses 24 | entities, globalutils, map; 25 | 26 | procedure createVillager(uniqueid, npcx, npcy: smallint); 27 | begin 28 | (* Add a villager to the list of creatures *) 29 | entities.listLength := length(entities.entityList); 30 | SetLength(entities.entityList, entities.listLength + 1); 31 | with entities.entityList[entities.listLength] do 32 | begin 33 | npcID := uniqueid; 34 | race := 'villager'; 35 | intName := 'villageIdiot'; 36 | article := True; 37 | description := 'a villager'; 38 | glyph := '@'; 39 | glyphColour := 'lightCyan'; 40 | maxHP := 4; 41 | currentHP := maxHP; 42 | attack := 1; 43 | defence := 1; 44 | weaponDice := 0; 45 | weaponAdds := 0; 46 | xpReward := maxHP; 47 | visionRange := 4; 48 | moveCount := 0; 49 | targetX := 0; 50 | targetY := 0; 51 | inView := False; 52 | blocks := False; 53 | faction := npcFaction; 54 | state := stateNeutral; 55 | discovered := False; 56 | weaponEquipped := False; 57 | armourEquipped := False; 58 | isDead := False; 59 | stsDrunk := False; 60 | stsPoison := False; 61 | stsBewild := False; 62 | stsFrozen := False; 63 | tmrDrunk := 0; 64 | tmrPoison := 0; 65 | tmrBewild := 0; 66 | tmrFrozen := 0; 67 | hasPath := False; 68 | destinationReached := False; 69 | entities.initPath(uniqueid); 70 | posX := npcx; 71 | posY := npcy; 72 | end; 73 | (* Occupy tile *) 74 | map.occupy(npcx, npcy); 75 | end; 76 | 77 | 78 | procedure takeTurn(id: smallint); 79 | begin 80 | decisionNeutral(id); 81 | end; 82 | 83 | procedure decisionNeutral(id: smallint); 84 | var 85 | stopAndSmellFlowers: byte; 86 | begin 87 | stopAndSmellFlowers := globalutils.randomRange(1, 8); 88 | if (stopAndSmellFlowers = 1) then 89 | { Either wander randomly } 90 | ai_villager.wander(id, entityList[id].posX, entityList[id].posY) 91 | else 92 | { or stay in place } 93 | entities.moveNPC(id, entityList[id].posX, entityList[id].posY); 94 | end; 95 | 96 | {$I nextto} 97 | 98 | end. -------------------------------------------------------------------------------- /docs/legend.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Axes, Armour & Ale: Legend 5 | 6 | 7 | 8 | 9 | 10 | 11 |
13 |

Legend

14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 |
MarkerVisibility
Strict PrivateStrict Private
PrivatePrivate
Strict ProtectedStrict Protected
ProtectedProtected
PublicPublic
PublishedPublished
AutomatedAutomated
ImplicitImplicit
52 |
Generated by PasDoc 0.16.0. 53 | 54 |
55 | -------------------------------------------------------------------------------- /docs/scrWinAlpha.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Axes, Armour & Ale: scrWinAlpha 5 | 6 | 7 | 8 | 9 | 10 | 11 |
13 |

Unit scrWinAlpha

14 |
15 |
Classes, Interfaces, Objects and Records
Types
Constants
Variables
16 |

Description

17 |

18 | Shown when exiting the Smugglers cave and starting the larger adventure

19 |

Uses

20 |

Overview

21 |

Functions and Procedures

22 | 23 | 24 | 25 | 26 |
procedure displayWinscreen;
27 |

Description

28 |

Functions and Procedures

29 | 30 | 31 | 32 | 33 | 37 |
procedure displayWinscreen;
34 |

35 | Show the Win screen

36 |
38 |
Generated by PasDoc 0.16.0. 39 | 40 |
41 | -------------------------------------------------------------------------------- /docs/arrow.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Axes, Armour & Ale: arrow 5 | 6 | 7 | 8 | 9 | 10 | 11 |
13 |

Unit arrow

14 |
15 |
Uses
Classes, Interfaces, Objects and Records
Types
Constants
Variables
16 |

Description

17 |

18 | Arrow

19 |

Overview

20 |

Functions and Procedures

21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |
procedure createArrow(itmx, itmy: smallint);
procedure useItem;
29 |

Description

30 |

Functions and Procedures

31 | 32 | 33 | 34 | 35 | 39 |
procedure createArrow(itmx, itmy: smallint);
36 |

37 | Create an arrow

38 |
40 | 41 | 42 | 43 | 44 | 48 |
procedure useItem;
45 |

46 | Item cannot be equipped

47 |
49 |
Generated by PasDoc 0.16.0. 50 | 51 |
52 | -------------------------------------------------------------------------------- /docs/rock.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Axes, Armour & Ale: rock 5 | 6 | 7 | 8 | 9 | 10 | 11 |
13 |

Unit rock

14 |
15 |
Uses
Classes, Interfaces, Objects and Records
Types
Constants
Variables
16 |

Description

17 |

18 | A rock, causes base damage of 4 points

19 |

Overview

20 |

Functions and Procedures

21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |
procedure createRock(itmx, itmy: smallint);
procedure useItem;
29 |

Description

30 |

Functions and Procedures

31 | 32 | 33 | 34 | 35 | 39 |
procedure createRock(itmx, itmy: smallint);
36 |

37 | Create a rock

38 |
40 | 41 | 42 | 43 | 44 | 48 |
procedure useItem;
45 |

46 | Item cannot be equipped

47 |
49 |
Generated by PasDoc 0.16.0. 50 | 51 |
52 | -------------------------------------------------------------------------------- /docs/pixie_jar.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Axes, Armour & Ale: pixie_jar 5 | 6 | 7 | 8 | 9 | 10 | 11 |
13 |

Unit pixie_jar

14 |
15 |
Uses
Classes, Interfaces, Objects and Records
Types
Constants
Variables
16 |

Description

17 |

18 | A glowing pixie in a jar - Light source

19 |

Overview

20 |

Functions and Procedures

21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |
procedure createPixieJar;
procedure useItem;
29 |

Description

30 |

Functions and Procedures

31 | 32 | 33 | 34 | 35 | 39 |
procedure createPixieJar;
36 |

37 | Create a pixie jar

38 |
40 | 41 | 42 | 43 | 44 | 48 |
procedure useItem;
45 |

46 | Item cannot be equipped

47 |
49 |
Generated by PasDoc 0.16.0. 50 | 51 |
52 | -------------------------------------------------------------------------------- /docs/Axes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Axes, Armour & Ale: Axes 5 | 6 | 7 | 8 | 9 | 10 | 11 |
13 |

Program Axes

14 |
15 |
Classes, Interfaces, Objects and Records
Functions and Procedures
Types
Constants
Variables
16 |

Description

17 |

18 | Axes, Armour & Ale Copyright 2021-2023 Chris Hawkins 19 | 20 |

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

21 |

Uses

22 |
Generated by PasDoc 0.16.0. 23 | 24 |
25 | -------------------------------------------------------------------------------- /docs/wine_flask.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Axes, Armour & Ale: wine_flask 5 | 6 | 7 | 8 | 9 | 10 | 11 |
13 |

Unit wine_flask

14 |
15 |
Uses
Classes, Interfaces, Objects and Records
Types
Constants
Variables
16 |

Description

17 |

18 | Flask of wine - cures poison

19 |

Overview

20 |

Functions and Procedures

21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |
procedure createWineFlask(itmx, itmy: smallint);
procedure useItem;
29 |

Description

30 |

Functions and Procedures

31 | 32 | 33 | 34 | 35 | 39 |
procedure createWineFlask(itmx, itmy: smallint);
36 |

37 | Create a Potion of Cure Poison

38 |
40 | 41 | 42 | 43 | 44 | 48 |
procedure useItem;
45 |

46 | Drink Potion

47 |
49 |
Generated by PasDoc 0.16.0. 50 | 51 |
52 | -------------------------------------------------------------------------------- /docs/ale_tankard.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Axes, Armour & Ale: ale_tankard 5 | 6 | 7 | 8 | 9 | 10 | 11 |
13 |

Unit ale_tankard

14 |
15 |
Uses
Classes, Interfaces, Objects and Records
Types
Constants
Variables
16 |

Description

17 |

18 | A tankard of ale - health top up

19 |

Overview

20 |

Functions and Procedures

21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |
procedure createAleTankard(itmx, itmy: smallint);
procedure useItem;
29 |

Description

30 |

Functions and Procedures

31 | 32 | 33 | 34 | 35 | 39 |
procedure createAleTankard(itmx, itmy: smallint);
36 |

37 | Create a tankard of ale

38 |
40 | 41 | 42 | 43 | 44 | 48 |
procedure useItem;
45 |

46 | Drink Ale

47 |
49 |
Generated by PasDoc 0.16.0. 50 | 51 |
52 | -------------------------------------------------------------------------------- /docs/resolution.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Axes, Armour & Ale: resolution 5 | 6 | 7 | 8 | 9 | 10 | 11 |
13 |

Unit resolution

14 |
15 |
Classes, Interfaces, Objects and Records
Types
Constants
Variables
16 |

Description

17 |

18 | Determines the terminal size when the game is first opened and resizes the user interface accordingly. For a typical 80x24 terminal size, the camera size will be 57x19 For a terminal size of 102x24 and greater, the camera size will be 80x19 This is kept to 19 rather than the full 20 to allow for screenshake to be added in future versions.

19 |

Uses

20 |

Overview

21 |

Functions and Procedures

22 | 23 | 24 | 25 | 26 |
procedure getSize;
27 |

Description

28 |

Functions and Procedures

29 | 30 | 31 | 32 | 33 | 35 |
procedure getSize;
34 |  
36 |
Generated by PasDoc 0.16.0. 37 | 38 |
39 | -------------------------------------------------------------------------------- /source/screens/scrgame.pas: -------------------------------------------------------------------------------- 1 | (* Main game user interface *) 2 | 3 | unit scrGame; 4 | 5 | {$mode fpc}{$H+} 6 | 7 | interface 8 | 9 | uses 10 | player_stats; 11 | 12 | var 13 | minX: smallint; 14 | 15 | (* Clear screen and load various panels for game *) 16 | procedure displayGameScreen; 17 | 18 | implementation 19 | 20 | uses 21 | ui, entities; 22 | 23 | procedure displayGameScreen; 24 | var 25 | i: smallint; 26 | begin 27 | (* Stats window *) 28 | { top line } 29 | TextOut(minX, 1, 'cyan', Chr(218)); 30 | for i := minX + 1 to minX + 21 do 31 | begin 32 | TextOut(i, 1, 'cyan', Chr(196)); 33 | end; 34 | TextOut(minX + 22, 1, 'cyan', Chr(191)); 35 | { edges } 36 | for i := 2 to 13 do 37 | begin 38 | TextOut(minX, i, 'cyan', Chr(179) + ' ' + Chr(179)); 39 | end; 40 | { bottom } 41 | TextOut(minX, 14, 'cyan', Chr(192)); 42 | for i := minX + 1 to minX + 21 do 43 | begin 44 | TextOut(i, 14, 'cyan', Chr(196)); 45 | end; 46 | TextOut(minX + 22, 14, 'cyan', Chr(217)); 47 | 48 | (* Equipment window *) 49 | { top line } 50 | TextOut(minX, 15, 'cyan', Chr(218)); 51 | for i := minX + 1 to minX + 21 do 52 | begin 53 | TextOut(i, 15, 'cyan', Chr(196)); 54 | end; 55 | TextOut(minX + 22, 15, 'cyan', Chr(191)); 56 | TextOut(minX + 2, 15, 'cyan', 'Equipment'); 57 | { edges } 58 | for i := 16 to 20 do 59 | begin 60 | TextOut(minX, i, 'cyan', Chr(179) + ' ' + Chr(179)); 61 | end; 62 | { bottom } 63 | TextOut(minX, 20, 'cyan', Chr(192)); 64 | for i := minX + 1 to minX + 21 do 65 | begin 66 | TextOut(i, 20, 'cyan', Chr(196)); 67 | end; 68 | TextOut(minX + 22, 20, 'cyan', Chr(217)); 69 | 70 | (* Write stat titles *) 71 | TextOut(minX + 2, 2, 'cyan', entities.entityList[0].race); 72 | TextOut(minX + 2, 3, 'cyan', 'The ' + entities.entityList[0].description); 73 | TextOut(minX + 2, 4, 'cyan', 'Level:'); 74 | TextOut(minX + 2, 6, 'cyan', 'Experience:'); 75 | TextOut(minX + 2, 7, 'cyan', 'Health:'); 76 | (* Dwarf doesn't display magic in the sidebar *) 77 | if (player_stats.playerRace = 'Dwarf') then 78 | begin 79 | TextOut(minX + 2, 9, 'cyan', 'Attack:'); 80 | TextOut(minX + 2, 10, 'cyan', 'Defence:'); 81 | TextOut(minX + 2, 11, 'cyan', 'Dexterity:'); 82 | end 83 | else 84 | begin 85 | TextOut(minX + 2, 9, 'cyan', 'Magick:'); 86 | TextOut(minX + 2, 11, 'cyan', 'Attack:'); 87 | TextOut(minX + 2, 12, 'cyan', 'Defence:'); 88 | TextOut(minX + 2, 13, 'cyan', 'Dexterity:'); 89 | end; 90 | 91 | (* Write stats *) 92 | ui.updateLevel; 93 | ui.updateXP; 94 | ui.updateHealth; 95 | if (player_stats.playerRace <> 'Dwarf') then 96 | ui.updateMagick; 97 | ui.updateAttack; 98 | ui.updateDefence; 99 | ui.updateDexterity; 100 | ui.updateWeapon; 101 | ui.updateArmour; 102 | end; 103 | 104 | end. 105 | -------------------------------------------------------------------------------- /docs/cloth_armour1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Axes, Armour & Ale: cloth_armour1 5 | 6 | 7 | 8 | 9 | 10 | 11 |
13 |

Unit cloth_armour1

14 |
15 |
Uses
Classes, Interfaces, Objects and Records
Types
Constants
Variables
16 |

Description

17 |

18 | Low quality cloth armour

19 |

Overview

20 |

Functions and Procedures

21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |
procedure createClothArmour(itmx, itmy: smallint);
procedure useItem(equipped: boolean);
29 |

Description

30 |

Functions and Procedures

31 | 32 | 33 | 34 | 35 | 39 |
procedure createClothArmour(itmx, itmy: smallint);
36 |

37 | Create armour

38 |
40 | 41 | 42 | 43 | 44 | 48 |
procedure useItem(equipped: boolean);
45 |

46 | Wear armour

47 |
49 |
Generated by PasDoc 0.16.0. 50 | 51 |
52 | -------------------------------------------------------------------------------- /docs/pixie_jar_dim.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Axes, Armour & Ale: pixie_jar_dim 5 | 6 | 7 | 8 | 9 | 10 | 11 |
13 |

Unit pixie_jar_dim

14 |
15 |
Uses
Classes, Interfaces, Objects and Records
Types
Constants
Variables
16 |

Description

17 |

18 | A dimly glowing pixie in a jar - Light source

19 |

Overview

20 |

Functions and Procedures

21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |
procedure createPixieJarDim(itmx, itmy: smallint);
procedure useItem;
29 |

Description

30 |

Functions and Procedures

31 | 32 | 33 | 34 | 35 | 39 |
procedure createPixieJarDim(itmx, itmy: smallint);
36 |

37 | Create a pixie jar

38 |
40 | 41 | 42 | 43 | 44 | 48 |
procedure useItem;
45 |

46 | Item cannot be equipped

47 |
49 |
Generated by PasDoc 0.16.0. 50 | 51 |
52 | -------------------------------------------------------------------------------- /docs/leather_armour1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Axes, Armour & Ale: leather_armour1 5 | 6 | 7 | 8 | 9 | 10 | 11 |
13 |

Unit leather_armour1

14 |
15 |
Uses
Classes, Interfaces, Objects and Records
Types
Constants
Variables
16 |

Description

17 |

18 | Low quality leather armour

19 |

Overview

20 |

Functions and Procedures

21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |
procedure createLeatherArmour(itmx, itmy: smallint);
procedure useItem(equipped: boolean);
29 |

Description

30 |

Functions and Procedures

31 | 32 | 33 | 34 | 35 | 39 |
procedure createLeatherArmour(itmx, itmy: smallint);
36 |

37 | Create armour

38 |
40 | 41 | 42 | 43 | 44 | 48 |
procedure useItem(equipped: boolean);
45 |

46 | Wear armour

47 |
49 |
Generated by PasDoc 0.16.0. 50 | 51 |
52 | -------------------------------------------------------------------------------- /docs/lesser_bone_armour.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Axes, Armour & Ale: lesser_bone_armour 5 | 6 | 7 | 8 | 9 | 10 | 11 |
13 |

Unit lesser_bone_armour

14 |
15 |
Uses
Classes, Interfaces, Objects and Records
Types
Constants
Variables
16 |

Description

17 |

18 | Cuirass made from a ribcage

19 |

Overview

20 |

Functions and Procedures

21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |
procedure createBoneArmour(itmx, itmy: smallint);
procedure useItem(equipped: boolean);
29 |

Description

30 |

Functions and Procedures

31 | 32 | 33 | 34 | 35 | 39 |
procedure createBoneArmour(itmx, itmy: smallint);
36 |

37 | Create armour

38 |
40 | 41 | 42 | 43 | 44 | 48 |
procedure useItem(equipped: boolean);
45 |

46 | Wear armour

47 |
49 |
Generated by PasDoc 0.16.0. 50 | 51 |
52 | -------------------------------------------------------------------------------- /docs/gold_pieces.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Axes, Armour & Ale: gold_pieces 5 | 6 | 7 | 8 | 9 | 10 | 11 |
13 |

Unit gold_pieces

14 |
15 |
Classes, Interfaces, Objects and Records
Types
Constants
Variables
16 |

Description

17 |

18 | Treasure

19 |

Uses

20 |

Overview

21 |

Functions and Procedures

22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 |
procedure createGP(itmx, itmy: smallint);
procedure useItem;
30 |

Description

31 |

Functions and Procedures

32 | 33 | 34 | 35 | 36 | 40 |
procedure createGP(itmx, itmy: smallint);
37 |

38 | Create Gpld

39 |
41 | 42 | 43 | 44 | 45 | 49 |
procedure useItem;
46 |

47 | Item cannot be equipped

48 |
50 |
Generated by PasDoc 0.16.0. 51 | 52 |
53 | -------------------------------------------------------------------------------- /docs/ai_villager.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Axes, Armour & Ale: ai_villager 5 | 6 | 7 | 8 | 9 | 10 | 11 |
13 |

Unit ai_villager

14 |
15 |
Classes, Interfaces, Objects and Records
Types
Constants
Variables
16 |

Description

17 |

18 | Shared Artificial Stupidity unit for villager AI

19 |

Uses

20 |

Overview

21 |

Functions and Procedures

22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 |
procedure wander(id, spx, spy: smallint);
procedure chat;
30 |

Description

31 |

Functions and Procedures

32 | 33 | 34 | 35 | 36 | 40 |
procedure wander(id, spx, spy: smallint);
37 |

38 | Move in a random direction

39 |
41 | 42 | 43 | 44 | 45 | 49 |
procedure chat;
46 |

47 | Villager talks

48 |
50 |
Generated by PasDoc 0.16.0. 51 | 52 |
53 | -------------------------------------------------------------------------------- /docs/web.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Axes, Armour & Ale: web 5 | 6 | 7 | 8 | 9 | 10 | 11 |
13 |

Unit web

14 |
15 |
Classes, Interfaces, Objects and Records
Types
Constants
Variables
16 |

Description

17 |

18 | Environmental hazard - blocks entities

19 |

Uses

20 |

Overview

21 |

Functions and Procedures

22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 |
procedure createWeb(uniqueid, npcx, npcy: smallint);
procedure takeTurn(id: smallint);
30 |

Description

31 |

Functions and Procedures

32 | 33 | 34 | 35 | 36 | 40 |
procedure createWeb(uniqueid, npcx, npcy: smallint);
37 |

38 | Create web

39 |
41 | 42 | 43 | 44 | 45 | 49 |
procedure takeTurn(id: smallint);
46 |

47 | Take a turn

48 |
50 |
Generated by PasDoc 0.16.0. 51 | 52 |
53 | -------------------------------------------------------------------------------- /source/items/weapons/necro_axe.pas: -------------------------------------------------------------------------------- 1 | (* Necrotic axe *) 2 | 3 | unit necro_axe; 4 | 5 | {$mode fpc}{$H+} 6 | {$WARN 5024 off : Parameter "$1" not used} 7 | interface 8 | 9 | uses 10 | SysUtils; 11 | 12 | (* Create an axe *) 13 | procedure createNecroAxe(itmx, itmy: smallint); 14 | (* Equip weapon *) 15 | procedure useItem(equipped: boolean; ident: smallint); 16 | (* Remove weapon from inventory when thrown *) 17 | procedure throw(itemID: smallint); 18 | (* Check if weapon is damaged when thrown *) 19 | procedure thrownDamaged(itmID: smallint; inventory: boolean); 20 | 21 | implementation 22 | 23 | uses 24 | items, entities, ui, player_inventory; 25 | 26 | procedure createNecroAxe(itmx, itmy: smallint); 27 | begin 28 | SetLength(itemList, length(itemList) + 1); 29 | with itemList[High(itemList)] do 30 | begin 31 | itemID := indexID; 32 | itemName := 'Necro axe'; 33 | itemDescription := 'adds 2D6+1 to attack'; 34 | itemArticle := 'a'; 35 | itemType := itmWeapon; 36 | itemMaterial := matSteel; 37 | useID := 24; 38 | glyph := chr(194); 39 | glyphColour := 'lightMagenta'; 40 | inView := False; 41 | posX := itmx; 42 | posY := itmy; 43 | NumberOfUses := 10; 44 | value := 4; 45 | onMap := True; 46 | throwable := True; 47 | throwDamage := 7; 48 | dice := 2; 49 | adds := 1; 50 | discovered := False; 51 | Inc(indexID); 52 | end; 53 | end; 54 | 55 | procedure useItem(equipped: boolean; ident: smallint); 56 | var 57 | info: shortstring; 58 | begin 59 | info := 'You unequip the Necro axe.'; 60 | if (equipped = False) then 61 | (* To equip the weapon *) 62 | begin 63 | info := 'You equip the Necro axe.'; 64 | if (player_inventory.inventory[ident].adds > 0) then 65 | info := info + ' The axe adds 2D6+' + IntToStr(player_inventory.inventory[ident].adds) + ' to your attack' 66 | else 67 | info := info + ' The axe adds 2D6 to your attack'; 68 | entityList[0].weaponEquipped := True; 69 | Inc(entityList[0].weaponDice); 70 | Inc(entityList[0].weaponAdds, player_inventory.inventory[ident].adds); 71 | ui.displayMessage(info); 72 | ui.equippedWeapon := 'Necro axe'; 73 | ui.writeBufferedMessages; 74 | end 75 | else 76 | (* To unequip the weapon *) 77 | begin 78 | entityList[0].weaponEquipped := False; 79 | Dec(entityList[0].weaponDice); 80 | Dec(entityList[0].weaponAdds, player_inventory.inventory[ident].adds); 81 | ui.displayMessage(info); 82 | ui.equippedWeapon := 'No weapon equipped'; 83 | ui.writeBufferedMessages; 84 | end; 85 | end; 86 | 87 | procedure throw(itemID: smallint); 88 | begin 89 | entityList[0].weaponEquipped := False; 90 | Dec(entityList[0].weaponDice, 2); 91 | ui.equippedWeapon := 'No weapon equipped'; 92 | end; 93 | 94 | procedure thrownDamaged(itmID: smallint; inventory: boolean); 95 | begin 96 | if (inventory = True) then 97 | player_inventory.inventory[itmID].throwDamage := 6; 98 | end; 99 | 100 | end. 101 | -------------------------------------------------------------------------------- /docs/scrHelp.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Axes, Armour & Ale: scrHelp 5 | 6 | 7 | 8 | 9 | 10 | 11 |
13 |

Unit scrHelp

14 |
15 |
Classes, Interfaces, Objects and Records
Types
Constants
Variables
16 |

Description

17 |

18 | Help screen - accessed from main game screen

19 |

Uses

20 |

Overview

21 |

Functions and Procedures

22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 |
procedure drawOutline;
procedure displayHelpScreen;
30 |

Description

31 |

Functions and Procedures

32 | 33 | 34 | 35 | 36 | 40 |
procedure drawOutline;
37 |

38 | Draw a box around the title

39 |
41 | 42 | 43 | 44 | 45 | 49 |
procedure displayHelpScreen;
46 |

47 | Display controls and keyboard shortcuts

48 |
50 |
Generated by PasDoc 0.16.0. 51 | 52 |
53 | -------------------------------------------------------------------------------- /docs/scrOverworld.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Axes, Armour & Ale: scrOverworld 5 | 6 | 7 | 8 | 9 | 10 | 11 |
13 |

Unit scrOverworld

14 |
15 |
Classes, Interfaces, Objects and Records
Types
Constants
Variables
16 |

Description

17 |

18 | Overworld screen user interface

19 |

Uses

20 |

Overview

21 |

Functions and Procedures

22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 |
procedure drawSidepanel;
procedure eraseTerrain;
30 |

Description

31 |

Functions and Procedures

32 | 33 | 34 | 35 | 36 | 40 |
procedure drawSidepanel;
37 |

38 | Draws the panel on side of screen

39 |
41 | 42 | 43 | 44 | 45 | 49 |
procedure eraseTerrain;
46 |

47 | Erase the previous 'terrain' message

48 |
50 |
Generated by PasDoc 0.16.0. 51 | 52 |
53 | -------------------------------------------------------------------------------- /docs/merchant.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Axes, Armour & Ale: merchant 5 | 6 | 7 | 8 | 9 | 10 | 11 |
13 |

Unit merchant

14 |
15 |
Classes, Interfaces, Objects and Records
Types
Constants
Variables
16 |

Description

17 |

18 | Merchant - Buys and sells items

19 |

Uses

20 |

Overview

21 |

Functions and Procedures

22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 |
procedure createMerchant(uniqueid, npcx, npcy: smallint);
procedure takeTurn(id: smallint);
30 |

Description

31 |

Functions and Procedures

32 | 33 | 34 | 35 | 36 | 40 |
procedure createMerchant(uniqueid, npcx, npcy: smallint);
37 |

38 | Create a merchant

39 |
41 | 42 | 43 | 44 | 45 | 49 |
procedure takeTurn(id: smallint);
46 |

47 | The NPC takes their turn in the game loop

48 |
50 |
Generated by PasDoc 0.16.0. 51 | 52 |
53 | -------------------------------------------------------------------------------- /docs/smugglersMap.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Axes, Armour & Ale: smugglersMap 5 | 6 | 7 | 8 | 9 | 10 | 11 |
13 |

Unit smugglersMap

14 |
15 |
Classes, Interfaces, Objects and Records
Types
Constants
Variables
16 |

Description

17 |

18 | First quest MacGuffin, the smugglers map

19 |

Uses

20 |

Overview

21 |

Functions and Procedures

22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 |
procedure createSmugglersMap(itmx, itmy: smallint);
procedure obtainMap;
30 |

Description

31 |

Functions and Procedures

32 | 33 | 34 | 35 | 36 | 40 |
procedure createSmugglersMap(itmx, itmy: smallint);
37 |

38 | Create the map

39 |
41 | 42 | 43 | 44 | 45 | 49 |
procedure obtainMap;
46 |

47 | Collect quest item

48 |
50 |
Generated by PasDoc 0.16.0. 51 | 52 |
53 | -------------------------------------------------------------------------------- /docs/scrGame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Axes, Armour & Ale: scrGame 5 | 6 | 7 | 8 | 9 | 10 | 11 |
13 |

Unit scrGame

14 |
15 |
Classes, Interfaces, Objects and Records
Types
Constants
16 |

Description

17 |

18 | Main game user interface

19 |

Uses

20 |

Overview

21 |

Functions and Procedures

22 | 23 | 24 | 25 | 26 |
procedure displayGameScreen;
27 |

Variables

28 | 29 | 30 | 31 | 32 |
minX: smallint;
33 |

Description

34 |

Functions and Procedures

35 | 36 | 37 | 38 | 39 | 43 |
procedure displayGameScreen;
40 |

41 | Clear screen and load various panels for game

42 |
44 |

Variables

45 | 46 | 47 | 48 | 49 | 51 |
minX: smallint;
50 |  
52 |
Generated by PasDoc 0.16.0. 53 | 54 |
55 | -------------------------------------------------------------------------------- /docs/scrCharacter.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Axes, Armour & Ale: scrCharacter 5 | 6 | 7 | 8 | 9 | 10 | 11 |
13 |

Unit scrCharacter

14 |
15 |
Classes, Interfaces, Objects and Records
Types
Constants
Variables
16 |

Description

17 |

18 | Character sheet - Shows player stats

19 |

Uses

20 |

Overview

21 |

Functions and Procedures

22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 |
procedure drawOutline;
procedure displayCharacterSheet;
30 |

Description

31 |

Functions and Procedures

32 | 33 | 34 | 35 | 36 | 40 |
procedure drawOutline;
37 |

38 | Draw a box around the title

39 |
41 | 42 | 43 | 44 | 45 | 49 |
procedure displayCharacterSheet;
46 |

47 | Display information about player character

48 |
50 |
Generated by PasDoc 0.16.0. 51 | 52 |
53 | -------------------------------------------------------------------------------- /docs/potion_curePoison.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Axes, Armour & Ale: potion_curePoison 5 | 6 | 7 | 8 | 9 | 10 | 11 |
13 |

Unit potion_curePoison

14 |
15 |
Uses
Classes, Interfaces, Objects and Records
Types
Constants
Variables
16 |

Description

17 |

18 | Potion that cures poison

19 |

Overview

20 |

Functions and Procedures

21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |
procedure createCurePotion(uniqueid, itmx, itmy: smallint);
procedure useItem;
29 |

Description

30 |

Functions and Procedures

31 | 32 | 33 | 34 | 35 | 39 |
procedure createCurePotion(uniqueid, itmx, itmy: smallint);
36 |

37 | Create a Potion of Cure Poison

38 |
40 | 41 | 42 | 43 | 44 | 48 |
procedure useItem;
45 |

46 | Drink Potion

47 |
49 |
Generated by PasDoc 0.15.0. 50 | 51 |
52 | -------------------------------------------------------------------------------- /docs/basic_club.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Axes, Armour & Ale: basic_club 5 | 6 | 7 | 8 | 9 | 10 | 11 |
13 |

Unit basic_club

14 |
15 |
Uses
Classes, Interfaces, Objects and Records
Types
Constants
Variables
16 |

Description

17 |

18 | A wooden club

19 |

Overview

20 |

Functions and Procedures

21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 |
procedure createClub(itmx, itmy: smallint);
procedure useItem(equipped: boolean);
procedure throw;
32 |

Description

33 |

Functions and Procedures

34 | 35 | 36 | 37 | 38 | 42 |
procedure createClub(itmx, itmy: smallint);
39 |

40 | Create a club

41 |
43 | 44 | 45 | 46 | 47 | 51 |
procedure useItem(equipped: boolean);
48 |

49 | Equip weapon

50 |
52 | 53 | 54 | 55 | 56 | 60 |
procedure throw;
57 |

58 | Remove weapon from inventory when thrown

59 |
61 |
Generated by PasDoc 0.16.0. 62 | 63 |
64 | -------------------------------------------------------------------------------- /docs/short_bow.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Axes, Armour & Ale: short_bow 5 | 6 | 7 | 8 | 9 | 10 | 11 |
13 |

Unit short_bow

14 |
15 |
Uses
Classes, Interfaces, Objects and Records
Types
Constants
Variables
16 |

Description

17 |

18 | A short bow

19 |

Overview

20 |

Functions and Procedures

21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 |
procedure createShortBow(itmx, itmy: smallint);
procedure useItem(equipped: boolean);
procedure throw;
32 |

Description

33 |

Functions and Procedures

34 | 35 | 36 | 37 | 38 | 42 |
procedure createShortBow(itmx, itmy: smallint);
39 |

40 | Create a bow

41 |
43 | 44 | 45 | 46 | 47 | 51 |
procedure useItem(equipped: boolean);
48 |

49 | Equip weapon

50 |
52 | 53 | 54 | 55 | 56 | 60 |
procedure throw;
57 |

58 | Remove weapon from inventory when thrown

59 |
61 |
Generated by PasDoc 0.16.0. 62 | 63 |
64 | -------------------------------------------------------------------------------- /docs/parchment.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Axes, Armour & Ale: parchment 5 | 6 | 7 | 8 | 9 | 10 | 11 |
13 |

Unit parchment

14 |
15 |
Classes, Interfaces, Objects and Records
Types
Constants
Variables
16 |

Description

17 |

18 | Parchment scroll that can increase a player stat

19 |

Uses

20 |

Overview

21 |

Functions and Procedures

22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 |
procedure createParchment(itmx, itmy: smallint);
procedure collectParchment;
30 |

Description

31 |

Functions and Procedures

32 | 33 | 34 | 35 | 36 | 40 |
procedure createParchment(itmx, itmy: smallint);
37 |

38 | Create the parchment

39 |
41 | 42 | 43 | 44 | 45 | 49 |
procedure collectParchment;
46 |

47 | Collect parchment

48 |
50 |
Generated by PasDoc 0.16.0. 51 | 52 |
53 | -------------------------------------------------------------------------------- /source/screens/scrcharintro.pas: -------------------------------------------------------------------------------- 1 | (* Character introduction and scene setting *) 2 | 3 | unit scrCharIntro; 4 | 5 | {$mode fpc}{$H+} 6 | 7 | interface 8 | 9 | uses 10 | ui, video, globalUtils, plot_gen, player_stats, universe; 11 | 12 | procedure setTheScene; 13 | procedure humanText; 14 | procedure elfText; 15 | procedure dwarfText; 16 | 17 | implementation 18 | 19 | procedure setTheScene; 20 | var 21 | header, footer: string; 22 | begin 23 | header := 'Welcome ' + plot_gen.playerName + ', the ' + player_stats.playerRace; 24 | footer := '[SPACE] to continue | s - Skip intro'; 25 | LockScreenUpdate; 26 | screenBlank; 27 | TextOut(ui.centreX(header), 2, 'cyan', header); 28 | 29 | (* Add the backstory *) 30 | if (player_stats.playerRace = 'Human') then 31 | humanText 32 | else if (player_stats.playerRace = 'Elf') then 33 | elfText 34 | else 35 | dwarfText; 36 | 37 | TextOut(ui.centreX(footer), 24, 'cyan', footer); 38 | UnlockScreenUpdate; 39 | UpdateScreen(False); 40 | end; 41 | 42 | procedure humanText; 43 | var 44 | home: string; 45 | begin 46 | home := plot_gen.smallVillage; 47 | universe.homeland := UTF8Decode(home); 48 | TextOut(3, 6, 'cyan', 'In the years following the Great Wizard War, the large cities of'); 49 | TextOut(3, 7, 'cyan', 'The Fallen Isles, where the different kindreds would live together'); 50 | TextOut(3, 8, 'cyan', 'have crumbled. Now the Isles have reverted to scattered settlements'); 51 | TextOut(3, 9, 'cyan', 'where you have wandered as an adventurer.'); 52 | TextOut(3, 11, 'cyan', 'You are a young human, originally from the small, poor village'); 53 | TextOut(3, 12, 'cyan', 'of ' + home + '. You have set out to find adventure, but this '); 54 | TextOut(3, 13, 'cyan', 'rainy night finds you out of coin and alone on the road...'); 55 | end; 56 | 57 | procedure elfText; 58 | var 59 | home: string; 60 | begin 61 | home := plot_gen.elvenTown; 62 | universe.homeland := UTF8Decode(home); 63 | TextOut(3, 6, 'cyan', 'In the years following the Great Wizard War, the large cities of'); 64 | TextOut(3, 7, 'cyan', 'The Fallen Isles, where the different kindreds would live together'); 65 | TextOut(3, 8, 'cyan', 'have crumbled. Now the Isles have reverted to scattered settlements'); 66 | TextOut(3, 9, 'cyan', 'where you have wandered as an adventurer.'); 67 | TextOut(3, 11, 'cyan', 'You are a young Elf from ' + home + '.'); 68 | TextOut(3, 12, 'cyan', 'You have set out to find adventure, but this rainy night finds you'); 69 | TextOut(3, 13, 'cyan', 'out of coin and alone on the road...'); 70 | end; 71 | 72 | procedure dwarfText; 73 | var 74 | home: string; 75 | begin 76 | home := player_stats.clanName; 77 | universe.homeland := UTF8Decode(home); 78 | TextOut(3, 6, 'cyan', 'In the years following the Great Wizard War, the large cities of'); 79 | TextOut(3, 7, 'cyan', 'The Fallen Isles, where the different kindreds would live together'); 80 | TextOut(3, 8, 'cyan', 'have crumbled. Now the Isles have reverted to scattered settlements'); 81 | TextOut(3, 9, 'cyan', 'where you have wandered as an adventurer.'); 82 | TextOut(3, 11, 'cyan', 'You are a young dwarf, originally from the once proud'); 83 | TextOut(3, 12, 'cyan', home + ' clan. You have set out to find adventure, but this '); 84 | TextOut(3, 13, 'cyan', 'rainy night finds you out of coin and alone on the road...'); 85 | end; 86 | 87 | end. 88 | -------------------------------------------------------------------------------- /docs/terbutje.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Axes, Armour & Ale: terbutje 5 | 6 | 7 | 8 | 9 | 10 | 11 |
13 |

Unit terbutje

14 |
15 |
Uses
Classes, Interfaces, Objects and Records
Types
Constants
Variables
16 |

Description

17 |

18 | A wooden club studded with spikes made of obsidian

19 |

Overview

20 |

Functions and Procedures

21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 |
procedure createTerbutje(itmx, itmy: smallint);
procedure useItem(equipped: boolean);
procedure throw;
32 |

Description

33 |

Functions and Procedures

34 | 35 | 36 | 37 | 38 | 42 |
procedure createTerbutje(itmx, itmy: smallint);
39 |

40 | Create a terbutje

41 |
43 | 44 | 45 | 46 | 47 | 51 |
procedure useItem(equipped: boolean);
48 |

49 | Equip weapon

50 |
52 | 53 | 54 | 55 | 56 | 60 |
procedure throw;
57 |

58 | Remove weapon from inventory when thrown

59 |
61 |
Generated by PasDoc 0.16.0. 62 | 63 |
64 | -------------------------------------------------------------------------------- /docs/pointy_stick.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Axes, Armour & Ale: pointy_stick 5 | 6 | 7 | 8 | 9 | 10 | 11 |
13 |

Unit pointy_stick

14 |
15 |
Uses
Classes, Interfaces, Objects and Records
Types
Constants
Variables
16 |

Description

17 |

18 | A pointy stick

19 |

Overview

20 |

Functions and Procedures

21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 |
procedure createPointyStick(itmx, itmy: smallint);
procedure useItem(equipped: boolean);
procedure throw;
32 |

Description

33 |

Functions and Procedures

34 | 35 | 36 | 37 | 38 | 42 |
procedure createPointyStick(itmx, itmy: smallint);
39 |

40 | Create a pointy stick

41 |
43 | 44 | 45 | 46 | 47 | 51 |
procedure useItem(equipped: boolean);
48 |

49 | Equip weapon

50 |
52 | 53 | 54 | 55 | 56 | 60 |
procedure throw;
57 |

58 | Remove weapon from inventory when thrown

59 |
61 |
Generated by PasDoc 0.16.0. 62 | 63 |
64 | -------------------------------------------------------------------------------- /scripts/ptop.cfg: -------------------------------------------------------------------------------- 1 | end=crbefore,dindonkey,dindent,crafter,lower 2 | [end]=if,then,else,while,with,for,record,try,finally,except,class,object,private,public,protected,published,casevar,colon,equals 3 | begin=crbefore,dindonkey,inbytab,crafter,lower 4 | [begin]=var,label,const,type 5 | if=spaft,gobsym,inbytab,lower 6 | then=lower 7 | else=crbefore,dindonkey,inbytab,lower 8 | [else]=if,then,else 9 | proc=dindonkey,spaft,lower 10 | [proc]=var,label,const,type 11 | var=blinbefore,dindonkey,spaft,inbytab,lower 12 | [var]=var,label,const,type 13 | of=crsupp,spbef,spaft,lower 14 | while=spaft,gobsym,inbytab,crafter,lower 15 | do=crsupp,spbef,lower 16 | case=spaft,gobsym,inbytab,crafter,lower 17 | with=spaft,gobsym,inbytab,crafter,lower 18 | for=spaft,gobsym,inbytab,crafter,lower 19 | repeat=inbytab,crafter,lower 20 | until=crbefore,dindonkey,dindent,spaft,gobsym,crafter,lower 21 | [until]=if,then,else,while,with,for,colon,equals 22 | func=dindonkey,spaft,lower 23 | [func]=var,label,const,type 24 | label=blinbefore,spaft,inbytab,lower 25 | const=blinbefore,dindonkey,spaft,inbytab,lower 26 | [const]=var,label,const,type 27 | type=blinbefore,dindonkey,spaft,inbytab,lower 28 | [type]=var,label,const,type 29 | record=inbyindent,crafter,lower 30 | [record]=end 31 | string=lower 32 | prog=blinbefore,spaft,lower 33 | asm=,lower 34 | try=crbefore,inbytab,crafter,lower 35 | finally=crbefore,dindent,inbytab,crafter,lower 36 | [finally]=try 37 | except=crbefore,dindent,inbytab,crafter,lower 38 | [except]=try 39 | raise=lower 40 | class=inbyindent,lower 41 | object=inbyindent,lower 42 | constructor=lower 43 | destructor=lower 44 | inherited=lower 45 | property=lower 46 | private=crbefore,dindonkey,spaft,inbytab,lower 47 | [private]=end,private,public,protected,published 48 | public=crbefore,dindonkey,spaft,inbytab,lower 49 | [public]=end,private,public,protected,published 50 | protected=crbefore,dindonkey,spaft,inbytab,lower 51 | [protected]=end,private,public,protected,published 52 | published=crbefore,dindonkey,spaft,inbytab,lower 53 | [published]=end,private,public,protected,published 54 | initialization=lower 55 | finalization=lower 56 | inline=lower 57 | new=lower 58 | array=lower 59 | out=lower 60 | false=lower 61 | true=lower 62 | library=blinbefore,spaft,lower 63 | interface=blinbefore,crafter,lower 64 | implementation=blinbefore,dindonkey,crafter,lower 65 | [implementation]=end,var,label,const,type,property 66 | read=lower 67 | write=lower 68 | unit=blinbefore,spaft 69 | and=lower 70 | arr=lower 71 | div=lower 72 | down=lower 73 | file=lower 74 | goto=lower 75 | in=lower 76 | mod=lower 77 | not=lower 78 | nil=lower 79 | or=lower 80 | set=lower 81 | to=lower 82 | virtual=lower 83 | uses=blinbefore,spaft,lower 84 | casevar=spaft,gobsym,inbytab,crafter,lower 85 | ofobject=lower 86 | becomes=spbef,spaft,gobsym,lower 87 | delphicomment=crafter 88 | dopencomment= 89 | dclosecomment= 90 | opencomment=crsupp,lower 91 | closecomment=crsupp,lower 92 | semicolon=crsupp,dindonkey,crafter,lower 93 | [semicolon]=if,then,else,while,with,for,colon,equals 94 | colon=inbytab,lower 95 | comma=spaft 96 | [comma]=if,then,else,while,with,for,record,try,finally,except,class,object,private,public,protected,published,casevar,colon,equals 97 | equals=spbef,spaft,inbytab,lower 98 | openparen=gobsym,lower 99 | closeparen= 100 | period=crsupp,lower 101 | endoffile= 102 | other=lower 103 | 104 | -------------------------------------------------------------------------------- /source/screens/scroverworld.pas: -------------------------------------------------------------------------------- 1 | (* Overworld screen user interface *) 2 | 3 | unit scrOverworld; 4 | 5 | {$mode fpc}{$H+} 6 | 7 | interface 8 | 9 | uses 10 | player_stats, scrGame; 11 | 12 | (* Draws the panel on side of screen *) 13 | procedure drawSidepanel; 14 | (* Erase the previous 'terrain' message *) 15 | procedure eraseTerrain; 16 | 17 | implementation 18 | 19 | uses 20 | ui, entities; 21 | 22 | procedure drawSidepanel; 23 | var 24 | i: smallint; 25 | begin 26 | (* Stats window *) 27 | { top line } 28 | TextOut(scrGame.minX, 1, 'cyan', Chr(218)); 29 | for i := scrGame.minX + 1 to scrGame.minX + 21 do 30 | begin 31 | TextOut(i, 1, 'cyan', Chr(196)); 32 | end; 33 | TextOut(scrGame.minX + 22, 1, 'cyan', Chr(191)); 34 | { edges } 35 | for i := 2 to 13 do 36 | begin 37 | TextOut(scrGame.minX, i, 'cyan', Chr(179) + ' ' + Chr(179)); 38 | end; 39 | { bottom } 40 | TextOut(scrGame.minX, 14, 'cyan', Chr(192)); 41 | for i := scrGame.minX + 1 to scrGame.minX + 21 do 42 | begin 43 | TextOut(i, 14, 'cyan', Chr(196)); 44 | end; 45 | TextOut(scrGame.minX + 22, 14, 'cyan', Chr(217)); 46 | 47 | (* Equipment window *) 48 | { top line } 49 | TextOut(scrGame.minX, 15, 'cyan', Chr(218)); 50 | for i := scrGame.minX + 1 to scrGame.minX + 21 do 51 | begin 52 | TextOut(i, 15, 'cyan', Chr(196)); 53 | end; 54 | TextOut(scrGame.minX + 22, 15, 'cyan', Chr(191)); 55 | TextOut(scrGame.minX + 2, 15, 'cyan', 'Equipment'); 56 | { edges } 57 | for i := 16 to 20 do 58 | begin 59 | TextOut(scrGame.minX, i, 'cyan', Chr(179) + ' ' + Chr(179)); 60 | end; 61 | { bottom } 62 | TextOut(scrGame.minX, 20, 'cyan', Chr(192)); 63 | for i := scrGame.minX + 1 to scrGame.minX + 21 do 64 | begin 65 | TextOut(i, 20, 'cyan', Chr(196)); 66 | end; 67 | TextOut(scrGame.minX + 22, 20, 'cyan', Chr(217)); 68 | 69 | (* Write stat titles *) 70 | TextOut(scrGame.minX + 2, 2, 'cyan', entities.entityList[0].race); 71 | TextOut(scrGame.minX + 2, 3, 'cyan', 'The ' + entities.entityList[0].description); 72 | TextOut(scrGame.minX + 2, 4, 'cyan', 'Level:'); 73 | TextOut(scrGame.minX + 2, 6, 'cyan', 'Experience:'); 74 | TextOut(scrGame.minX + 2, 7, 'cyan', 'Health:'); 75 | (* Dwarf doesn't display magic in the sidebar *) 76 | if (player_stats.playerRace = 'Dwarf') then 77 | begin 78 | TextOut(scrGame.minX + 2, 9, 'cyan', 'Attack:'); 79 | TextOut(scrGame.minX + 2, 10, 'cyan', 'Defence:'); 80 | TextOut(scrGame.minX + 2, 11, 'cyan', 'Dexterity:'); 81 | end 82 | else 83 | begin 84 | TextOut(scrGame.minX + 2, 9, 'cyan', 'Magick:'); 85 | TextOut(scrGame.minX + 2, 11, 'cyan', 'Attack:'); 86 | TextOut(scrGame.minX + 2, 12, 'cyan', 'Defence:'); 87 | TextOut(scrGame.minX + 2, 13, 'cyan', 'Dexterity:'); 88 | end; 89 | 90 | (* Write stats *) 91 | ui.updateLevel; 92 | ui.updateXP; 93 | ui.updateHealth; 94 | if (player_stats.playerRace <> 'Dwarf') then 95 | ui.updateMagick; 96 | ui.updateAttack; 97 | ui.updateDefence; 98 | ui.updateDexterity; 99 | ui.updateWeapon; 100 | ui.updateArmour; 101 | 102 | (* Write name of island *) 103 | TextOut(centreX('~ The isle of Ellan Toll ~'), 21, 'cyan', '~ The isle of Ellan Toll ~'); 104 | end; 105 | 106 | procedure eraseTerrain; 107 | var 108 | i: smallint; 109 | begin 110 | for i := 1 to displayCol do 111 | TextOut(i, 22, 'black', ' '); 112 | end; 113 | 114 | end. 115 | --------------------------------------------------------------------------------