-+-+-+-+-+-+-+-+ START OF PART 35 -+-+-+-+-+-+-+-+ X lprcat("\nThe diagnosis is confirmed as dianthroritis. He guesses t Vhat\n"); X lprintf("your daughter has only %d mobuls left in this world. It's V up to you,\n", (long) ((TIMELIMIT - gtime + 99) / 100)); X lprintf("%s, to find the only hope for your daughter, the very rare\ Vn", logname); X lprcat("potion of cure dianthroritis. It is rumored that only deep V in the\n"); X lprcat("depths of the caves can this potion be found.\n\n\n"); X lprcat("\n ----- press "); X standout("return"); X lprcat(" to continue, "); X standout("escape"); X lprcat(" to leave ----- "); X i = ttgetch(); X while (i != '\33' && i != '\n') X i = ttgetch(); X if (i == '\33') X `7B X drawscreen(); X nosignal = 0; /* enable signals */ X return; X `7D X `7D X`7D X X/* routine to save program space */ Xiopts() X`7B X lprcat(", or (i) ignore it? "); X`7D Xignore() X`7B X lprcat("ignore\n"); X`7D X X/* X * For prompt mode, prompt for entering a building. X */ Xstatic prompt_enter() X`7B X char i; X X lprcat("\nDo you (g) go inside, or (i) stay here? "); X i = 0; X while ((i != 'g') && (i != 'i') && (i != '\33')) X i = ttgetch(); X if (i == 'g') X enter(); X else X lprcat(" stay here"); X`7D X X/* X * For prompt mode, prompt for climbing up/down the volcanic shaft.`20 X * X * Takes one parameter: if it is negative, going down the shaft, otherwise, X * going up the shaft.`20 X */ Xstatic prompt_volshaft(dir) X int dir; X`7B X char i; X X lprcat("\nDo you (c) climb "); X if (dir > 0) X lprcat("up"); X else X lprcat("down"); X iopts(); X X i = 0; X while ((i != 'c') && (i != 'i') && (i != '\33')) X i = ttgetch(); X X if ((i == '\33') `7C`7C (i == 'i')) X `7B X ignore(); X return; X `7D X if (dir > 0) X act_up_shaft(); X else X act_down_shaft(); X`7D X Xstatic o_open_door() X`7B X char i; X lprcat("\nDo you (c) close it"); X iopts(); X i = 0; X while ((i != 'c') && (i != 'i') && (i != '\33')) X i = ttgetch(); X if ((i == '\33') `7C`7C (i == 'i')) X `7B X ignore(); X return; X `7D X lprcat("close"); X forget(); X item`5Bplayerx`5D`5Bplayery`5D = OCLOSEDDOOR; X iarg`5Bplayerx`5D`5Bplayery`5D = 0; X playerx = lastpx; X playery = lastpy; X`7D X Xstatic o_closed_door() X`7B X char i; X lprcat("\nDo you (o) try to open it"); X iopts(); X i = 0; X while ((i != 'o') && (i != 'i') && (i != '\33')) X i = ttgetch(); X if ((i == '\33') `7C`7C (i == 'i')) X `7B X ignore(); X playerx = lastpx; X playery = lastpy; X return; X `7D else X `7B X lprcat("open"); X /* X * if he failed to open the door ...`20 X */ X if (!act_open_door(playerx, playery)) X `7B X playerx = lastpx; X playery = lastpy; X `7D X `7D X`7D $ CALL UNPACK OBJECT.C;1 157536261 $ create 'f' X/* X Object definitions X*/ X#define MAXSCROLL 28 /* maximum number of scrolls that are possible */ X#define MAXPOTION 35 /* maximum number of potions that are possible */ X X#define MAXOBJ 93 /* the maximum number of objects n < MAXOBJ */ X X/* this is the structure definition for the items in the dnd store */ Xstruct _itm X `7B X short price; X char **mem; X char obj; X char arg; X char qty; X `7D; X Xextern struct _itm itm`5B`5D; X X/* defines for the objects in the game */ X#define MAXOBJECT 92 X X#define OALTAR 1 X#define OTHRONE 2 X#define OORB 3 X#define OPIT 4 X#define OSTAIRSUP 5 X#define OELEVATORUP 6 X#define OFOUNTAIN 7 X#define OSTATUE 8 X#define OTELEPORTER 9 X#define OSCHOOL 10 X#define OMIRROR 11 X#define ODNDSTORE 12 X#define OSTAIRSDOWN 13 X#define OELEVATORDOWN 14 X#define OBANK2 15 X#define OBANK 16 X#define ODEADFOUNTAIN 17 X#define OMAXGOLD 70 X#define OGOLDPILE 18 X#define OOPENDOOR 19 X#define OCLOSEDDOOR 20 X#define OWALL 21 X#define OTRAPARROW 66 X#define OTRAPARROWIV 67 X X#define OLARNEYE 22 X X#define OPLATE 23 X#define OCHAIN 24 X#define OLEATHER 25 X#define ORING 60 X#define OSTUDLEATHER 61 X#define OSPLINT 62 X#define OPLATEARMOR 63 X#define OSSPLATE 64 X#define OSHIELD 68 X#define OELVENCHAIN 92 X X#define OSWORDofSLASHING 26 X#define OHAMMER 27 X#define OSWORD 28 X#define O2SWORD 29 X#define OSPEAR 30 X#define ODAGGER 31 X#define OBATTLEAXE 57 X#define OLONGSWORD 58 X#define OFLAIL 59 X#define OLANCE 65 X#define OVORPAL 90 X#define OSLAYER 91 X X#define ORINGOFEXTRA 32 X#define OREGENRING 33 X#define OPROTRING 34 X#define OENERGYRING 35 X#define ODEXRING 36 X#define OSTRRING 37 X#define OCLEVERRING 38 X#define ODAMRING 39 X X#define OBELT 40 X X#define OSCROLL 41 X#define OPOTION 42 X#define OBOOK 43 X#define OCHEST 44 `20 X#define OAMULET 45 X X#define OORBOFDRAGON 46 X#define OSPIRITSCARAB 47 X#define OCUBEofUNDEAD 48 X#define ONOTHEFT 49 X X#define ODIAMOND 50 X#define ORUBY 51 X#define OEMERALD 52 X#define OSAPPHIRE 53 X X#define OENTRANCE 54 X#define OVOLDOWN 55 X#define OVOLUP 56 X#define OHOME 69 X X#define OKGOLD 71 X#define ODGOLD 72 X#define OIVDARTRAP 73 X#define ODARTRAP 74 X#define OTRAPDOOR 75 X#define OIVTRAPDOOR 76 X#define OTRADEPOST 77 X#define OIVTELETRAP 78 X#define ODEADTHRONE 79 X#define OANNIHILATION 80 /* sphere of annihilation */ X#define OTHRONE2 81 X#define OLRS 82 /* Larn Revenue Service */ X#define OCOOKIE 83 X#define OURN 84 X#define OBRASSLAMP 85 X#define OHANDofFEAR 86 /* hand of fear */ X#define OSPHTAILSMAN 87 /* tailsman of the sphere */ X#define OWWAND 88 /* wand of wonder */ X#define OPSTAFF 89 /* staff of power */ X/* used up to 92 */ $ CALL UNPACK OBJECTS.H;1 471167135 $ create 'f' XNAME LARN WINDOWCOMPAT LONGNAMES X XDESCRIPTION 'LARN for OS/2 V12.3.0' $ CALL UNPACK OS2LARN.DEF;1 877690557 $ create 'f' Xobj\action.obj+ Xobj\bill.obj+ Xobj\config.obj+ Xobj\create.obj+ Xobj\data.obj+ Xobj\diag.obj+ Xobj\display.obj+ Xobj\fgetlr.obj+ Xobj\fortune.obj+ Xobj\global.obj+ Xobj\help.obj+ Xobj\io.obj+ Xobj\iventory.obj+ Xobj\main.obj+ Xobj\monster.obj+ Xobj\moreobj.obj+ Xobj\movem.obj+ Xobj\msdos.obj+ Xobj\nap.obj+ Xobj\object.obj+ Xobj\regen.obj+ Xobj\savelev.obj+ Xobj\scores.obj+ Xobj\signal.obj+ Xobj\spells.obj+ Xobj\spheres.obj+ Xobj\store.obj+ Xobj\tgetent.obj+ Xobj\tgetstr.obj+ Xobj\tgoto.obj+ Xobj\tputs.obj+ Xobj\tok.obj+ Xobj\vms.obj Xlarn123.exe Xlarn123.map/map /line Xdoscalls.lib Xos2larn.def $ CALL UNPACK OS2LARN.LNK;1 576467769 $ create 'f' X/* indicate which patches have been applied to Larn. X*/ X#define PATCHLEVEL 1 $ CALL UNPACK PATCHLEV.H;1 571503256 $ create 'f' XPatch 1 X======= XPrompted by Pat Ryan, fix a bug in the dropobj() code in main.c that Xallowed the player to drop a negative amount of gold. In the process, fix Xthe backwards carriage return logic when printing the error response. XDocument the new SIG_RETURNS_INT #define introduced by Bill Randle when the Xsoftware was posted. XPrompted by Lasse Oestergaard, guard against out-of-bound array references Xin movem.c when on the Home level. Also fixed a bug where a 'smart' monster Xwould fail to move towards the player when the player was on the boundary. XPrompted by Mitch Gorman, make the EXTRA #define compile and work under XMS-DOS. $ CALL UNPACK PATCHLOG.;1 1478517264 $ create 'f' X/* defines for the character attribute array c`5B`5D`20 X*/ X#define STRENGTH 0 /* characters physical strength not due to objects * V/ X#define INTELLIGENCE 1 X#define WISDOM 2 X#define CONSTITUTION 3 X#define DEXTERITY 4 X#define CHARISMA 5 X#define HPMAX 6 X#define HP 7 X#define GOLD 8 X#define EXPERIENCE 9 X#define LEVEL 10 X#define REGEN 11 X#define WCLASS 12 X#define AC 13 X#define BANKACCOUNT 14 X#define SPELLMAX 15 X#define SPELLS 16 X#define ENERGY 17 X#define ECOUNTER 18 X#define MOREDEFENSES 19 X#define WEAR 20 X#define PROTECTIONTIME 21 X#define WIELD 22 X#define AMULET 23 X#define REGENCOUNTER 24 X#define MOREDAM 25 X#define DEXCOUNT 26 X#define STRCOUNT 27 X#define BLINDCOUNT 28 X#define CAVELEVEL 29 X#define CONFUSE 30 X#define ALTPRO 31 X#define HERO 32 X#define CHARMCOUNT 33 X#define INVISIBILITY 34 X#define CANCELLATION 35 X#define HASTESELF 36 X#define EYEOFLARN 37 X#define AGGRAVATE 38 X#define GLOBE 39 X#define TELEFLAG 40 X#define SLAYING 41 X#define NEGATESPIRIT 42 X#define SCAREMONST 43 X#define AWARENESS 44 X#define HOLDMONST 45 X#define TIMESTOP 46 X#define HASTEMONST 47 X#define CUBEofUNDEAD 48 X#define GIANTSTR 49 X#define FIRERESISTANCE 50 X#define BESSMANN 51 X#define NOTHEFT 52 X#define HARDGAME 53 X#define CPUTIME 54 X#define BYTESIN 55 X#define BYTESOUT 56 X#define MOVESMADE 57 X#define MONSTKILLED 58 X#define SPELLSCAST 59 X#define LANCEDEATH 60 X#define SPIRITPRO 61 X#define UNDEADPRO 62 X#define SHIELD 63 X#define STEALTH 64 X#define ITCHING 65 X#define LAUGHING 66 X#define DRAINSTRENGTH 67 X#define CLUMSINESS 68 X#define INFEEBLEMENT 69 X#define HALFDAM 70 X#define SEEINVISIBLE 71 X#define FILLROOM 72 X#define RANDOMWALK 73 X#define SPHCAST 74 /* nz if an active sphere of annihilation */ X#define WTW 75 /* walk through walls */ X#define STREXTRA 76 /* character strength due to objects or enchantments */ X#define TMP 77 /* misc scratch space */ X#define LIFEPROT 78 /* life protection counter */ $ CALL UNPACK PLAYER.H;1 69994238 $ create 'f' X XHere is the source to Larn V12.3. I had made a number of changes without Xchanging the save file format, so I decided to make another distribution Xbefore making the big leap to V14.0. X XThis distribution incorporates all the changes distributed as Patches to V12 V.2, Xa few others that were suggested but not sent out as patches, plus my own Xdevelopment. See LARN123.FIX for a partial list. X XThe source correctly compiles and executes under DEC Ultrix (BSD), using the V cc Xcompiler. The enclosed makefile.unix is for U*ix systems (rename to Makefil Ve). XI've endevoured to make Larn buildable under SYSV, and it builds/runs correc Vtly Xwith Ultrix V3.1's SYSTEM_FIVE environment, so I expect its fairly close to Xbeing usable under SYSV as well. X XThe source correctly compiles and executes under VAX/VMS, using the VAX C V3 V.x Xcompiler. The enclosed descrip.mms is a MMS file for building under VAX/VMS V. XSee the VMSREADME.TXT for some more VMS-related information. X XThe source correctly compiles and executes under MS-DOS, using Turbo C++ V1. V0. XI am no longer able to verify that it compiles using Turbo C V2.0. The Xmakefile.pc and tlink.rsp are for building the MS-DOS Larn. `20 X XThe source correctly compiles and executes under OS/2, using Microsoft C. XThe makefile.os2, os2larn.def and os2larn.lnk are for building the OS/2 Larn V. `20 X XI am interested in receiving source changes that allow Larn to be ported or Xbuilt correctly on other architectures or operating systems. I am also`20 Xinterested in constructive changes or additions to improve the game. `20 X XBug fixes, bug reports, and requests welcome. X XI am reachable at tle.enet.dec.com!routley or routley@tle.enet.dec.com. XBecause I cannot provide a stable mail address, all USmail should be sent to V: X XKevin Routley XDigital Equipment Corporation XZKO2-3/N30 X110 Spitbrook Road XNashua, NH 03060 X $ CALL UNPACK README.;1 1481054810 $ create 'f' X/* regen.c */ X#include "header.h" X#include "larndefs.h" X#include "monsters.h" X#include "player.h" X X/* X regen() X X subroutine to regenerate player hp and spells X */ Xregen() X `7B X register int i,flag; X register long *d; X d = c; X#ifdef EXTRA X d`5BMOVESMADE`5D++; X#endif X if (d`5BTIMESTOP`5D) `7B if(--d`5BTIMESTOP`5D<=0) bottomline(); return V; `7D /* for stop time spell */ X flag=0; X X if (d`5BSTRENGTH`5D<3) `7B d`5BSTRENGTH`5D=3; flag=1; `7D X if (d`5BHP`5D != d`5BHPMAX`5D) X if (d`5BREGENCOUNTER`5D-- <= 0) /* regenerate hit points */ X `7B X d`5BREGENCOUNTER`5D = 22 + (d`5BHARDGAME`5D<<1) - d`5BLEVEL`5D; X if ((d`5BHP`5D += d`5BREGEN`5D) > d`5BHPMAX`5D) d`5BHP`5D = d`5 VBHPMAX`5D; X bottomhp(); X `7D X X if (d`5BSPELLS`5D < d`5BSPELLMAX`5D) /* regenerate spells */ X if (d`5BECOUNTER`5D-- <= 0) X `7B X d`5BECOUNTER`5D = 100+4*(d`5BHARDGAME`5D-d`5BLEVEL`5D-d`5BENERGY V`5D); X d`5BSPELLS`5D++; bottomspell(); X `7D X X if (d`5BHERO`5D) if (--d`5BHERO`5D<=0) `7B for (i=0; i<6; i++ V) d`5Bi`5D -= 10; flag=1; `7D X if (d`5BALTPRO`5D) if (--d`5BALTPRO`5D<=0) `7B d`5BMORE VDEFENSES`5D-=3; flag=1; `7D X if (d`5BPROTECTIONTIME`5D) if (--d`5BPROTECTIONTIME`5D<=0) `7B d`5BMORE VDEFENSES`5D-=2; flag=1; `7D X if (d`5BDEXCOUNT`5D) if (--d`5BDEXCOUNT`5D<=0) `7B d`5BDEXT VERITY`5D-=3; flag=1; `7D X if (d`5BSTRCOUNT`5D) if (--d`5BSTRCOUNT`5D<=0) `7B d`5BSTRE VXTRA`5D-=3; flag=1; `7D X if (d`5BBLINDCOUNT`5D) if (--d`5BBLINDCOUNT`5D<=0) `7B cursors( V); lprcat("\nThe blindness lifts "); beep(); `7D X if (d`5BCONFUSE`5D) if (--d`5BCONFUSE`5D<=0) `7B cursors(); lpr Vcat("\nYou regain your senses"); beep(); `7D X if (d`5BGIANTSTR`5D) if (--d`5BGIANTSTR`5D<=0) `7B d`5BSTREXTRA`5 VD -= 20; flag=1; `7D X if (d`5BCHARMCOUNT`5D) if ((--d`5BCHARMCOUNT`5D) <= 0) flag=1; X if (d`5BINVISIBILITY`5D) if ((--d`5BINVISIBILITY`5D) <= 0) flag=1; X if (d`5BCANCELLATION`5D) if ((--d`5BCANCELLATION`5D) <= 0) flag=1; X if (d`5BWTW`5D) if ((--d`5BWTW`5D) <= 0) flag=1; X if (d`5BHASTESELF`5D) if ((--d`5BHASTESELF`5D) <= 0) flag=1; X if (d`5BAGGRAVATE`5D) --d`5BAGGRAVATE`5D;`20 X if (d`5BSCAREMONST`5D) if ((--d`5BSCAREMONST`5D) <= 0) flag=1;`20 +-+-+-+-+-+-+-+- END OF PART 35 +-+-+-+-+-+-+-+-