$! ------------------ CUT HERE ----------------------- $ v='f$verify(f$trnlnm("SHARE_VERIFY"))' $! $! This archive created by VMS_SHARE Version 7.2-007 22-FEB-1990 $! On 21-MAY-1992 02:48:53.38 By user MASMUMMY $! $! This VMS_SHARE Written by: $! Andy Harper, Kings College London UK $! $! Acknowledgements to: $! James Gray - Original VMS_SHARE $! Michael Bednarek - Original Concept and implementation $! $!+ THIS PACKAGE DISTRIBUTED IN 47 PARTS, TO KEEP EACH PART $! BELOW 30 BLOCKS $! $! TO UNPACK THIS SHARE FILE, CONCATENATE ALL PARTS IN ORDER $! AND EXECUTE AS A COMMAND PROCEDURE ( @name ) $! $! THE FOLLOWING FILE(S) WILL BE CREATED AFTER UNPACKING: $! 1. ACTION.C;1 $! 2. BILL.C;1 $! 3. CONFIG.C;1 $! 4. CREATE.C;1 $! 5. DATA.C;1 $! 6. DESCRIP.MMS;1 $! 7. DIAG.C;1 $! 8. DISPLAY.C;1 $! 9. FGETLR.C;1 $! 10. FORTUNE.C;1 $! 11. GLOBAL.C;1 $! 12. HEADER.H;1 $! 13. HELP.C;1 $! 14. INVENTORY.C;1 $! 15. IO.C;1 $! 16. LARN.COM;1 $! 17. LARN.FTN;1 $! 18. LARN.HLP;1 $! 19. LARN.MAZ;1 $! 20. LARN.OPT;1 $! 21. LARN.PID;1 $! 22. LARN123.DOC;1 $! 23. LARN123.FIX;1 $! 24. LARNDEFS.H;1 $! 25. LARNHLP.TXT;1 $! 26. LARNHLP.UUE;1 $! 27. MAIN.C;1 $! 28. MAKEFILE.OS2;1 $! 29. MAKEFILE.PC;1 $! 30. MAKEFILE.UNIX;1 $! 31. MANIFEST.;1 $! 32. MONSTER.C;1 $! 33. MONSTERS.H;1 $! 34. MOREOBJ.C;1 $! 35. MOVEM.C;1 $! 36. MSDOS.C;1 $! 37. NANSI.DOC;1 $! 38. NANSISYS.UUE;1 $! 39. NAP.C;1 $! 40. OBJECT.C;1 $! 41. OBJECTS.H;1 $! 42. OS2LARN.DEF;1 $! 43. OS2LARN.LNK;1 $! 44. PATCHLEV.H;1 $! 45. PATCHLOG.;1 $! 46. PLAYER.H;1 $! 47. README.;1 $! 48. REGEN.C;1 $! 49. SAVELEV.C;1 $! 50. SCORES.C;1 $! 51. SIGNAL.C;1 $! 52. SPELLS.C;1 $! 53. SPHERES.C;1 $! 54. STORE.C;1 $! 55. TERMCAP.PC;1 $! 56. TERMCAP.VMS;1 $! 57. TGETENT.C;1 $! 58. TGETSTR.C;1 $! 59. TGOTO.C;1 $! 60. TLINK.RSP;1 $! 61. TOK.C;1 $! 62. TPUTS.C;1 $! 63. VAXCRTL.OPT;1 $! 64. VMS.C;1 $! 65. VMSREADME.TXT;1 $! $set="set" $set symbol/scope=(nolocal,noglobal) $f=f$parse("SHARE_TEMP","SYS$SCRATCH:.TMP_"+f$getjpi("","PID")) $e="write sys$error ""%UNPACK"", " $w="write sys$output ""%UNPACK"", " $ if f$trnlnm("SHARE_LOG") then $ w = "!" $ ve=f$getsyi("version") $ if ve-f$extract(0,1,ve) .ges. "4.4" then $ goto START $ e "-E-OLDVER, Must run at least VMS 4.4" $ v=f$verify(v) $ exit 44 $UNPACK: SUBROUTINE ! P1=filename, P2=checksum $ if f$search(P1) .eqs. "" then $ goto file_absent $ e "-W-EXISTS, File ''P1' exists. Skipped." $ delete 'f'* $ exit $file_absent: $ if f$parse(P1) .nes. "" then $ goto dirok $ dn=f$parse(P1,,,"DIRECTORY") $ w "-I-CREDIR, Creating directory ''dn'." $ create/dir 'dn' $ if $status then $ goto dirok $ e "-E-CREDIRFAIL, Unable to create ''dn'. File skipped." $ delete 'f'* $ exit $dirok: $ w "-I-PROCESS, Processing file ''P1'." $ if .not. f$verify() then $ define/user sys$output nl: $ EDIT/TPU/NOSEC/NODIS/COM=SYS$INPUT 'f'/OUT='P1' PROCEDURE Unpacker ON_ERROR ENDON_ERROR;SET(FACILITY_NAME,"UNPACK");SET( SUCCESS,OFF);SET(INFORMATIONAL,OFF);f:=GET_INFO(COMMAND_LINE,"file_name");b:= CREATE_BUFFER(f,f);p:=SPAN(" ")@r&LINE_END;POSITION(BEGINNING_OF(b)); LOOP EXITIF SEARCH(p,FORWARD)=0;POSITION(r);ERASE(r);ENDLOOP;POSITION( BEGINNING_OF(b));g:=0;LOOP EXITIF MARK(NONE)=END_OF(b);x:=ERASE_CHARACTER(1); IF g=0 THEN IF x="X" THEN MOVE_VERTICAL(1);ENDIF;IF x="V" THEN APPEND_LINE; MOVE_HORIZONTAL(-CURRENT_OFFSET);MOVE_VERTICAL(1);ENDIF;IF x="+" THEN g:=1; ERASE_LINE;ENDIF;ELSE IF x="-" THEN IF INDEX(CURRENT_LINE,"+-+-+-+-+-+-+-+")= 1 THEN g:=0;ENDIF;ENDIF;ERASE_LINE;ENDIF;ENDLOOP;t:="0123456789ABCDEF"; POSITION(BEGINNING_OF(b));LOOP r:=SEARCH("`",FORWARD);EXITIF r=0;POSITION(r); ERASE(r);x1:=INDEX(t,ERASE_CHARACTER(1))-1;x2:=INDEX(t,ERASE_CHARACTER(1))-1; COPY_TEXT(ASCII(16*x1+x2));ENDLOOP;WRITE_FILE(b,GET_INFO(COMMAND_LINE, "output_file"));ENDPROCEDURE;Unpacker;QUIT; $ delete/nolog 'f'* $ CHECKSUM 'P1' $ IF CHECKSUM$CHECKSUM .eqs. P2 THEN $ EXIT $ e "-E-CHKSMFAIL, Checksum of ''P1' failed." $ ENDSUBROUTINE $START: $ create 'f' X/* X action.c X X Routines to perform the actual actions associated with various X player entered commands. X X act_remove_gems remove gems from a throne X act_sit_throne sit on a throne X act_up_stairs go up stairs X act_down_stairs go down stairs X act_drink_fountain drink from a fountain X act_wash_fountain wash at a fountain X act_up_shaft up volcanic shaft X act_down_shaft down volcanic shaft X volshaft_climbed place player near volcanic shaft X act_desecrate_altar desecrate an altar X act_donation_pray pray, donating money X act_just_pray pray, not donating money X act_prayer_heard prayer was heard X act_ignore_altar ignore an altar X act_open_chest open a chest X act_open_door open a door X*/ X X#include "header.h" X#include "larndefs.h" X#include "monsters.h" X#include "objects.h" X#include "player.h" X X/* X act_remove_gems X X Remove gems from a throne. X X arg is zero if there is a gnome king associated with the throne X X Assumes that cursors() has been called previously, and that a check X has been made that the throne actually has gems. X*/ Xact_remove_gems( arg ) Xint arg ; X `7B X int i, k ; X X k=rnd(101); X if (k<25) X `7B X for (i=0; i= 2 && level != 11) X `7B X newcavelevel( level - 1 ) ; X draws( 0, MAXX, 0, MAXY ); X bot_linex() ; X `7D X else X lprcat("\nThe stairs lead to a dead end!") ; X return ; X `7D X X/* X assumes that cursors() has been called and that a check has been made th Vat X the user is actually standing at a set of down stairs. X*/ Xact_down_stairs() X `7B X if (level != 0 && level != 10 && level != 13) X `7B X newcavelevel( level + 1 ) ; X draws( 0, MAXX, 0, MAXY ); X bot_linex() ; X `7D X else X lprcat("\nThe stairs lead to a dead end!") ; X return ; X `7D X X/* X Code to perform the action of drinking at a fountian. Assumes that X cursors() has already been called, and that a check has been made that X the player is actually standing at a live fountain. X*/ Xact_drink_fountain() X `7B X int x ; X X if (rnd(1501)<2) X `7B X lprcat("\nOops! You seem to have caught the dreadful sleep!"); X beep();`20 X lflush(); `20 X sleep(3); `20 X died(280);`20 X return; X `7D X X x = rnd(100); X if (x<7) X `7B X c`5BHALFDAM`5D += 200 + rnd(200); X lprcat("\nYou feel a sickness coming on"); X `7D X X else if (x < 13) X quaffpotion(23, FALSE ); /* see invisible,but don't know the potion V */ X X else if (x < 45) X lprcat("\nnothing seems to have happened"); X X else if (rnd(3) != 2) X fntchange(1); /* change char levels upward */ X X else X fntchange(-1); /* change char levels downward */ X X if (rnd(12)<3) X `7B X lprcat("\nThe fountains bubbling slowly quiets"); X item`5Bplayerx`5D`5Bplayery`5D=ODEADFOUNTAIN; /* dead fountain */ X know`5Bplayerx`5D`5Bplayery`5D=0; X `7D X return; X `7D X X/* X Code to perform the action of washing at a fountain. Assumes that X cursors() has already been called and that a check has been made that X the player is actually standing at a live fountain. X*/ Xact_wash_fountain() X `7B X int x ; X X if (rnd(100) < 11) X `7B X x=rnd((level<<2)+2); X lprintf("\nOh no! The water was foul! You suffer %d hit points!",( Vlong)x); X lastnum=273; X losehp(x);`20 X bottomline(); `20 X cursors(); X `7D X X else if (rnd(100) < 29) X lprcat("\nYou got the dirt off!"); X X else if (rnd(100) < 31) X lprcat("\nThis water seems to be hard water! The dirt didn't come o Vff!"); X X else if (rnd(100) < 34) X createmonster(WATERLORD); /* make water lord */ X X else X lprcat("\nnothing seems to have happened"); X X return; X `7D X X/* X Perform the act of climbing down the volcanic shaft. Assumes X cursors() has been called and that a check has been made that X are actually at a down shaft. X*/ Xact_down_shaft() X `7B X if (level!=0) X `7B X lprcat("\nThe shaft only extends 5 feet downward!"); X return; X `7D X X if (packweight() > 45+3*(c`5BSTRENGTH`5D+c`5BSTREXTRA`5D)) X `7B X lprcat("\nYou slip and fall down the shaft"); X beep(); X lastnum=275; X losehp(30+rnd(20)); X bottomhp(); X `7D X else if (prompt_mode) X lprcat("climb down"); X X newcavelevel(MAXLEVEL); X draws(0,MAXX,0,MAXY); X bot_linex(); X return; X `7D X X/* X Perform the action of climbing up the volcanic shaft. Assumes X cursors() has been called and that a check has been made that X are actually at an up shaft. X X*/ Xact_up_shaft() X `7B X if (level!=11)`20 X `7B`20 X lprcat("\nThe shaft only extends 8 feet upwards before you find a bl Vockage!");`20 X return;`20 X `7D X X if (packweight() > 45+5*(c`5BSTRENGTH`5D+c`5BSTREXTRA`5D))`20 X `7B`20 X lprcat("\nYou slip and fall down the shaft");`20 X beep(); X lastnum=275;`20 X losehp(15+rnd(20));`20 X bottomhp();`20 X return;`20 X `7D X X if (prompt_mode) X lprcat("climb up");`20 X lflush();`20 X newcavelevel(0); X volshaft_climbed( OVOLDOWN ); X return; X `7D X X/* X Perform the action of placing the player near the volcanic shaft X after it has been climbed. X X Takes one parameter: the volcanic shaft object to be found. If have X climbed up, search for OVOLDOWN, otherwise search for OVOLUP. X*/ Xstatic volshaft_climbed(object) Xint object; X `7B X int i,j ; X X /* place player near the volcanic shaft */ X for (i=0; i= k) X `7B X temp = c`5BGOLD`5D / 10 ; X c`5BGOLD`5D -= k; X bottomline(); X X /* if player gave less than 10% of _original_ gold, make a monst Ver X */ X if (k < temp `7C`7C k < rnd(50)) X `7B X createmonster(makemonst(level+1)); X c`5BAGGRAVATE`5D += 200; X return; X `7D X if (rnd(101) > 50) X `7B X act_prayer_heard(); +-+-+-+-+-+-+-+- END OF PART 1 +-+-+-+-+-+-+-+-