moria-5.6.debian.1/ 0000755 0001750 0001750 00000000000 12234455730 012170 5 ustar pjb pjb moria-5.6.debian.1/ChangeLog.1989 0000644 0001750 0001750 00000154476 05613574240 014375 0 ustar pjb pjb :::::1987 Fixes:::::
87 fixes deleted, see the 4.85 or 4.87 sources
:::::1988 Fixes:::::
88 fixes deleted, see the 4.88 sources
:::::1989 Fixes:::::
--------------------- 2/26
all files: merged the umoria and PC-Moria sources
creature.c: get_moves(), 12 numbers were wrong for monster movement
wizard.c: a few more int to bigint_t changes needed in wizard mode commands
files.c: fix columns in monster dictionary so that everything lines up
misc2.c, moria2.c: line up columns for print_new_spells() and examine_book()
8 files: replace == with = in comments and strings
magic.c, misc1.c, misc2.c, moria2.c, signals.c: missing/misplaced breaks
monsters.c: 2 grey snakes, renamed one to green
misc1.c: compact_objects, stmt which decrements cur_dis in wrong place
spells.c: disarm_all should not set traps to zero, should just clear trap
bits
moria2.c: in jamdoor() i_ptr->p1 should be t_ptr->p1
moria2.c: in place_trap(), covered pits should transform to open pits
moria2.c: mon_take_hit(), int i should be bigint_t i
io.c: more prompt will now accept space/escape/return/linefeed
io.c: EOF code did not work on machine with unsigned characters
------------------------ 2/27
save.c: missing controlz calls on error returns
creature.c: don't let non-moving creature move if glyph prevented it
from attacking
creature.c: give monsters a chance to recover from Bash, depends on
square of monster level
moria2.c: give monsters a chance to ignore bash, function of hitpoints
and level
spells.c: fixed restore_level, needed while loop
moria2.c: monster_multiply(), i=18 statement in wrong place, would not
always multiply monster when it should
--------------------- 3/2
moria1.c: get_panel(), add one to y and x on lines 945/950, prevent scrolling
while inside rooms
--------------------- 3/9
wizard.c: tmp_val = -999; for gold changed to tmp_lval
signals.c: added SIGXCPU to list of signals that cause panic save
spells.c: call monster_name before mon_take_hit in fire_bolt()
moria2.c: move_char (), stop before attacking a creature
dungeon.c: added move_char (5) to see_infra and see_invis setting and clearing
--------------------- 3/10
creature.c: added take_hit (0, ddesc) line to every monster spell, ensure
that player leaves resting/find/search modes
potions.c: remove chp += mhp code from gain const potion, now chp = mhp
moria2.c: change monster_death(), summon_object 4d2 instead of 4d3
so that comments match code
creature.c: make_move(), prevent monster from moving again after opening
a door, also, make chance of opening locked door dependant on monster
level
monsters.c: giant red ant lion, not hurt by fire, move&attack normally
--------------------- 5/5
generate.c: fixed error in generation of type 3 (subtype 3) rooms
misc2.c, config.c: added alternate wizard code/definitions
treasur1.c: restore mana potion made more valuable (35 -> 350)
staff of speed value increased (800 -> 1000)
ring of sustain charisma level changed (7 -> 44)
ring of stupidity level decreased (20 -> 7)
potion of gain strength value increased (200 -> 300)
variable.c: halfling clan elder had 0% chance
gave warrior higher base to hit chance than paladin
store1.c: digging tools must be identified before price is adjusted
misc1.c: do not adjust cost of digging tools based on value of p1
change all mods to fields toac/todam/tohit to be += or -=
several items (mostly cursed items) needed %P1 added to name
for digging tools, inc p1 instead of replacing it, so that tools
will still have same minimum values as specified in treasur1.c
monsters.c: Forest Wight should be able to open doors.
Grey Wraith should not drain mana
moria1.c: fix stealth so that it uses the value of p1
treasur2.c: change 'a's to '&'s for doors
spells.c: word of destruction should not put wall over character
Could not use wand of drain life at a distance
moria2.c: when in find mode, attack if run into creature only if can't see it
-------------------------5/7
moria1.c,moria2.c: remove heavy weapon message from test_hit and put it in
py_attack instead
spells.c: teleport_away now calls unlite_spot if necessary, fixes bug that
I thought had been fixed 3/28/88
save.c: for MSDOS: when restore save file, must search object list for secret
doors/traps, and convert the '#/.' char to wallsym/floorsym, when save
file, must do the reverse translation
spells.c: unlight_area() was really messed up, is much shorter now, will
always print "darkness" message now if it should
misc1.c: cleaned up prt_map(), probably much faster now
moria1.c: cleaned up light_room(), draw_block(), sub2_move_light(),
they are probably much faster now
all: changed print(char *, int, int) to print(char, int, int) in io.c
misc1.c: crown of the magi, now has RL instead of see invisible
---------------------- 5/8
all: checked uses of fm/pl/tl for consistency,eliminate extra parens/tests/etc
death.c: changed call to exit(1) to exit_game instead,
io.c, dungeon.c: new function move_cursor_relative to position cursor on map
--------------------- 5/13
Moria.doc: added changes to bring it up-to-date, ran through Spell again
--------------------- 5/18
spells.c: polymorph monster spell incorrect, missing an else flag = TRUE line
moria2.c: fix setting of reset_flag in find mode in move_char() routine
Moria.doc: created MacWrite version for Macintosh, plus some more editing
corrections
--------------------- 5/29
death.c, externs.h, files.c, io.c, misc2.c, moria2.c: eliminated the function
pad, replaced most calls with printf %-30s formats
death.c: rewrote fill_str and renamed it to center_string, previously was
returning pointer to local variable
death.c: eliminated dprint, replaced it with calls to put_buffer
signals.c: suspend handler now saves/restore special local chars (^R, ^W, etc)
generate.c: rewrote blank_cave, should be a bit faster now
externs.h, io.c, misc1.c, variable.c: eliminate used_line array, no longer
call erase_line in prt_map in misc1.c
misc2.c, moria1.c, store2.c: make sure cursor is always in the right
place after an inkey call
create.c, misc2.c: rewrite put_character and associated routines, line up
columns, eliminate strcat/strcpy calls
files.c: rewrote file_character so that it matches put_character, etc.
io.c: fixed put_buffer so that it won't print past right edge of screen
files.c, misc1.c, moria1.c, ms_misc1.c: loc_symbol rewritten, now checks
values of pl/tl/fm, did not correctly handle monsters which were
visible, but were not in a lighted spot
moria1.c, io.c: rest() only erases MSG_LINE now if original 'hit ... to quit'
message displayed, new function in io.c erase_non_msg does this
misc1.c: magic_treasure(), fixed helms which had wrong else level of cursed
items, added cursed rings of searching, set p1 value for amulet of magi
---------------------- 5/30
treasure1.c, treasure2.c: three axes changed from type 21 to 22, this prevents
the Priest shop from buying these weapons
--------------------- 6/2
creature.c, moria1.c, moria2.c, spells.c, types.h: massive reorganization
of the way that visible monsters are handled, now ml is set if and
only if the creature is visible on screen
creature.c, externs.h, moria2.c: procedure check_mon_lite removed, calls to
it replaced by calls to update_mon ()
misc1.c: delete unused code
creature.c, moria2.c: two places needed to test fm in addition to pl and tl
spells.c: need to set fm/tl/pl before call to lite_spot/change_trap, eliminate
some unncessary calls to lite_spot, eliminate unneccsary clearing of fm
------------------------- 6/8
dungeon.c, moria1.c, moria2.c: allow searching while blind, decrease chance of
successs if blind or have no light
moria1.c, moria2.c, store2.c: change prt("", x, y) to erase_line (x, y)
misc2.c: replace all "\0" with just ""
io.c, moria2.c, scrolls.c, store2.c: add '.' to end of sentences
dungeon.c, misc2.c, moria2.c, scrolls.c, store2.c: add msg_flag = FALSE after
lots of msg_prints, to make sure never get " -more" message line
creature.c, dungeon.c, spells.c, staff.c: don't print 'light' message if blind
moria2.c: disarm_trap(), make no_light and blind same penalty, increase
blind/no_light and confused penalties
moria1.c: rewrote area_affect, delete redundant code, don't stop at doorway
if no_light and it is unlit
generate.c: fixed error in build_tunnel, stack points could overrun stack
------------------------ 6/9
moria1.c: change test_hit so that always miss 1/20, and always hit 1/20
moria1.c, moria2.c, spells.c: changed fval incorrectly when manipulating
doors, only change to corr_floor2 if next_to4 a room space
creature.c: in get_moves, change 1.732 to 2, makes it faster, also can no
longer circle monsters by moving in a diamond shape
death.c, io.c, files.c, main.c: for MSDOS, don't leave the highscore_fd file
open permanently
save.c: save value of total_winner, in case of a forced call to save_char()
all, types.h: deleted MSDOS ifdefs, the bytlint/byteint/wordint/worlint type
definitions were confusing, so changed all to int8/int8u/int16u/int16
generate.c: rewrote loops to try to speed up level generation
---------------- 6/12
misc1.c: for items with duplicates in treasure1.c, set level of all equal
to that of lowest
treasur2.c: several items did not match same item in treasure1.c
----------------- 6/13
treasur2.c: wands/staffs in store now have same level as those in dungeon
dungeon.c, misc2.c, moria1.c, ms_misc.c, store2.c: removed some ASCII
dependencies
------------------ 6/16
externs.h, constants.c, generate.c, misc1.c: fixes to make level generation
faster, rearrange order build_tunnel makes comparisons, call
correct_dir directly instead of through rand_dir, rewrite loops,
rewrite next_to4, rewrite next_to8
externs.h, files.c, misc1.c, moria1.c, ms_misc.c: loc_symbol returns char
== the following are due to CJS (Bruce Moria)
create.c: in get_money(), charisma was subtracted and added, now only add
desc.c: unquote() did not work at all, rewrote the whole thing
in identify, string[0] == 'T' should be string[1]
moria1.c: area_affect, for direction 1, the 3 should be a 2
misc2.c, moria2.c, scrolls.c, spells.c, store2.c: change msg_print(" ") to ""
store2.c: eliminate erase_line/display_commands at end of purchase_haggle
config.h: for defined(Pyramid), define ultrix
eat.c: py.stats.intel to s_ptr->intel
creature.c: in make_move(), set m_ptr at begining of function,
in mon_move(), set m_ptr at begining of function,
test cmove before calling randint in mon_move()
change if (randint(10) > py.misc.stl) to && (randint(...))
dungeon.c: move random teleport outside innermost loop, put with other checks
== end CJS fixes ==
creature.c: collapse a large number of if (...) if (...) constructions
to if (... && ...)
constant.h, desc.c, externs.h, generate.c, misc1.c, rnd.c, save.c,variables.c:
all versions now use rnd(), rnd does not use SYSV calling conventions
anymore BSD random() states eliminated
generate.c: added code to build_tunnel to prevent infinite loops
--------------- 6/19
*.c: collapse a large number of if (...) if (...) constructions
to if (... && ...), delete unneeded braces
---------------- 6/21
creature.c, spells.c: build_wall and earthquake, now kill monster if it can
not move through walls, and it can not move out of the way of the new
wall, also, does more damage to those that escape, in creature.c,
if in wall, must escape to empty space
----------------- 7/17
main.c: added a setbuf call, for buffered output
------------------ 8/4
merging changes due to Christopher J Stuart...zillions of changes
stat structure changed
externs.h: move functions definitions for lint to here
create.c: help functions sorta' added, money now more dependent on stats,
really good/bad characters eliminated, etc...
------------------ 8/8
creature.c: new function disturb used, stop attacks if player dead, add
message for two attacks which had no message, confuse-monster only
works if monster actually hits, door bashing different and noisy too!,
creatures only eat lower level creatures, monster drawing changed,
monster memory added, etc...
------------------ 8/9
desc.c: eliminate lots of unnecessary strcpy/strlen/etc calls, can inscribe
objects, store/dungeon objects will be merged in the inventory when
objects are identified, if curse a special object it loses its
special ability, %d code for damage, %a code for armor, etc...
eat.c: misc changes...
----------------- 8/11
help.c: moved help text into files, added monster recall info, etc...
----------------- 8/14
Moria.doc: editing changes, removed lots of unnecessary hyphens
io.c: rebuilt it (accidentally deleted current version)
death.c: scoring procedures moved elsewhere, print_tomb more efficient and
uses far less stack, final char display different, upon_death
changed to exit_game, etc...
generate.c: added STATIC and void
magic.c: reduce indentation, increase spell damage, 7 dam/mana for Magic
Missle, 4 d/m for balls, 5 d/m for bolts, etc...
misc1.c: crowns higher chance of magic, monster dist changed to increase
chance of higher level monsters, unnecessary uid/eid calls deleted,
m_level changed to include level[0] monsters, highlighting for ores,
disappear percentages for objects in compact_obj() modified, '!'
char added to magic descriptions, damage added to bows
------------------- 8/15
misc2.c: print message if gold/object created under player, stat handling
completely changed, new func title_strings, search/rest/paralysis/count
message print changed, new func prt_speed(), new stat functions, can
hide stat changes if unknown, get_name uses loginname if none entered,
change_name can print to file, inven drop/carry/etc changed to be
a little simpler, new func join_names, spell_chance/learn_spell/etc
chnaged to be a little simpler, get_spell with capital letter verifies
choice, etc...
---------------------- 8/16
monsters.c: no change
treasure1.c: %d added to weapons, %a added to armor, plus to dam added to
bows, mage's guide should be mages' guide?? appostrophe removed
---------------------- 8/17
treasure2.c: change & in traps to a/an, scroll/potion subvals changed to 200
plus value in treasure1.c, etc...
potions.c: every potion prints message, ident true only if something noticable
happens, greatly reduce indentation, stat handling different, etc...
prayer.c: reduce indentation greatly, use up mana if prayer fails, etc...
scrolls.c: reduce indentation, only ident if something noticable happens,
for identify must search for new location of scroll, etc...
sets.c: ifdef out unused functions
dungeon.c: add command counts, use new func disturb(), double regen if
searching, damage if really hungry, messages for protevil resist_heat
and resist_cold, new code for quiting rest mode, move teleport code
outside inner loop, add code to check strength/weight, find mode
done differently now, allow ^char for control characters, all
command chars translated to rogue_like chars, new commands = (options)
{ (inscribe) V (view scores) M deleted but W improved : (map area)
rogue-like summon ^S -> &, etc...
---------------------- 8/24
files.c: init_scorefile deleted, intro->read_times, don't modify argv,
new func helpfile, print_map deleted, print_monsters deleted,
file_character now takes filename as argument, etc...
io.c: lint defs, new suspend function, much better curses handling,
new func moriaterm and restore_term, inkey does refresh on ^R, flush
should work now, new funct get_check, save_screen, restore_screen,
etc...
constant.h: add defs for STATIC, ESCAPE, stats, increase treasure in
streamers, change store min and turnaround amount, MAX_MON_NATTACK,
MAX_EXP
wands.c: inscribe wand if empty, reduce indentation, etc...
staffs.c: inscribe staff if empty, reduce indentation, etc...
spells.c: identify- update stats if affected, allow ident of equip items;
better light_line messages; when set pl false, must set fm false also;
misc, etc...
------------------- 8/29
moria1.c: new function enchanted(), part of py_bonuses split into
calc_bonuses, cur_char1/2 deleted, complete rewrite of inven_command
routines, new functions check_weight/verify, can display weights,
get_item can show either inven or equip, options added, run code
completely rewritten, misc, etc...
--------------- 8/30
store1.c: item_value has *item->number removed, many routines changed to pass
item pointer, identify removed from store_carry, known1/2 put in
store_create, store_maint alg changed, etc...
store2.c: clean up handling of msg_flag, incremental haggling in get_haggle(),
display_command moved from purchase/sell_haggle to store_purchase/sell,
enter_store code cleaned up, etc...
config.h: misc...
externs.h: add new variables, delete old variables, rearrange stuff, etc...
types.h: added logging structure and recall structure, etc...
variables.c: add new variables, delete old variables, rearrange stuff,
remove learn from spell structure, change titles so none shared
between classes, etc...
-------------- 8/31
moria2.c: weight bug fixed, py_attack did not decrement inven_weight when
inven_wield was a missile, and the player was carrying more than one
of them
-------------- 9/1
moria2.c: carry has pickup option, new functions for inscribing objects,
summon_objects returns type/number of objects created, ditto
monster death, new function check_view, add todam for using bow/arrow,
bashing changes, new sub py_bash extracted from old bash code,
jamdoor p1 values changed successive spikes have smaller effect,
etc...
------------- 9/2
main.c: add bruce moria comment, new options, read environment variables, etc.
wizard.c: wizard can change weight and speed of character, etc...
unix.c: new file, contains UNIX specific code for user_name, check_input, and
system()
signals.c: completely rewritten to be much nicer, same functionality
recall.c: new file, for printing out monster memory info
save.c: completely rewritten, same functionality, I think
------------- 9/7
lint on mips machine
------------- 9/8
lint on AIX (SYS V)
------------- 9/9
lint on ultrix
------------- 9/11
fix anonymous errors in order to get the program to compile...
io.c, ms_misc.c: put screen_map in io.c, and made it a default feature
signals.c, main.c, io.c: on EOF, the program now returns ESCAPE char until
exits dungeon(), then saves with no penalty
------------ 9/12
externs.h, desc.c, variables.c, types.h: mushrooms/colors/rocks/etc changed to
char pointers instead of char arrays, saves space, make random init
faster, change player title to char pointers also
moria1.c, potions.c, misc2.c, eat.c, dungeon.c, creature.c: cleanup handling
of chp and cmana, call prt_c* only once every time they change
dungeon.c: set pointers only once at start of procedure
eat.c: reduce indentation
io.c, dungeon.c: remove msg_flag = FALSE line from inkey and put it in
dungeon.c where get command
------------ 9/14
creature.c: change put_qio calls to just setting screen_change to true
dungeon.c: remove superfluous erase_line and put_qio calls
many: make character numbers more clear, 'a' for 97, DELETE for 127, etc...
desc.c: objdes() bug with ins_buf handling, now clear ins_buf if none
many, moria1.c: made "Which dir?" default for get_dir()
-------------- 9/15
misc1.c, monsters.c, treasur[12].c, many others: changed all hit ponts from
strings to a char array of size two, changed damroll to take two
characters instead of a string, this eliminates most all scanf calls
-------------- 9/18
monsters.c, creature.c, types.h: replaced strings containing monster attacks
with 4 byte array containing index into a monster attack table,
this eliminates the rest of the scanf calls, and saves space
creature.c: many duplicate damroll calls in make_attack collapsed into
a single damroll call
moria2.c: in chest_trap(), moved exploding chest trap to end to avoid
dangling pointer problem; in twall, only light spot if c_ptr->tl
is true;
wizard.c, recall.c, desc.c, files.c: changes to fix handling of new damage
types for monsters and weapons
---------------- 9/19
many files: eliminated redundant trap_lista, fixed place_trap so that it
no longer takes a typ parameter, change_type no longer calls
place_trap, negative level values for traps all made positive
and diasrm_object() changed appropriately
externs.h, dungeon.c, misc2.c, moria1.c, variables.c: eliminated print_stat
variable since it was not used very much
---------------- 9/21
create.c, externs.h, variable.c: eliminated bit_array variable
variable.c: eliminated names of unused Rogue class spells
many files...: changed the floor/wall definitions from variables to constants,
changed the values to make tests easier, all fval comparisons now use
manifest constants, door type floors eliminated since new find/run
code made them unnecessary
constant.h, misc2.c, externs.h, variable.c: changed var stat_column to
constant, eliminated password variables
many files: changed moria_flag to new_level_flag, and reset_flag to
free_turn_flag
------------- 9/23
merged Xenix diffs and Atari ST diffs
treasure1.c: potion of sleep no longer cures blindness
wands.c: wand of wonder was wrong had 2 << randint() instead of 1 << randint()
eat.c, potions.c, scrolls.c, staffs.c, treasur2.c, wands.c: added store
bought flag 0x80000000 to all food/potion/scroll/staff/wand objects
in treasure2.c, modifed the code so that these objects do not give
experience when used
all files: removed all floating point code except for randnor() and los()
many files: hp_player(-damage,"") calls did not work, change them all to
direct calls to take_hit(damage), hp_player string parameter
removed since no longer used
------------- 9/25
constant.h, config.h, externs.h, variable.c, misc1.c, misc2.c, potions.c:
floating point randnor code replaced by integer on that uses a table,
definition of MAXINT removed so there are now no differences between
16 bit and 32 bit versions of moria, MAXSHORT and MAXLONG defined
Makefile, misc1.c, externs.h: calls to floor removed, math library no longer
used!!, DONT_DEFINE_CLASS def for SUN4 no longer needed
------------- 9/27
misc1.c: replaced los code with an integer arithmetic version by jnh (Joseph
Hall), moria now uses no floating point numbers
dungeon.c, files.c, moria1.c, store2.c, wizard.c: removed all sscanf calls
except for those in ms_misc.c, and one "%lx" in wizard.c
------------ 9/28
treasure1.c, treasure2.c, types.h: change subval and number to 8 bit integers,
move flags after name, move number before weight, save 12 bytes per
constants.h, etc: INVEN_MAX definition removed, INVEN_ARRAY_SIZE 1 smaller
variable.c: store_choice now array of 8 bit integers
monsters.c, treasure2.c: change t_level and m_level to array of 16 bit ints
many: interpretation of subval changed to fit it into byte, new range uses
p1 to decide whether stacking permitted, torches can now stack
create.c, types.h: changed size of history from 400 to 240 characters,
also print as lines of 60 instead of lines of 70
variable.c, misc2.c, types.h: changed definition of spell_type from 12 to 6
bytes, new array spell_names to prevent duplicate strings,
no longer have entry for warriors
variable.c, types.h: human female too light, made 150 from 120, also changed
every base/mod field from 16 bits to 8 bits
types.h, variable.c: in background_type, change next and bonus fields to
8 bit integers, added 50 to bonus to make it positive
----------------- 9/29
monsters.c: massive changes to monster file to fix inconsistencies
----------------- 9/30
set.c: make flasks of oil vulnerable to frost and fire, like potions
moria2.c: if set off a trap, temp set confused to zero to ensure that player
will move onto the trap instead of in random direction
io.c, externs.h: confirm() no longer used, deleted
treasur1.c, treasur2.c: give non overlapping subvals to potions/scrolls,
duplicate ones caused problems for giving random names
desc.c, treasur1.c: %M for mushrooms changed to %m
recall.c: fix printing of monster hit points, two numbers instead of a string
moria2.c: new look code from bruce moria, look in arcs so that can see
anything on the screen, allows access to monster memories
generate.c, misc2.c, moria1.c, moria2.c: various fixes to reduce code size,
increase speed, etc...
misc1.c, etc...: popm and popt no longer take a pointer, instead return int,
pusht takes an int8u now instead of an int as a parameter
---------------- 10/1
all: added copyright notice to every *.[ch] file
--------------- 10/3
config.h, creature.c, recall.c, save.c: fixed a few bugs picked up by the
ultrix compiler
dungeon.c: disabled the save command
-------------- 10/6
create.c, files.c, dungeon.c, main.c, save.c: wrote helpfile function,
changed calling sequence so that caller does not have to do anything
constant.h, desc.c, variables.c: eliminated lots of excess colors/rocks/etc.
eliminated all duplicates except between potions and mushrooms
types.h: fixed _frac problem with exp and chp, had to be unsigned shorts
misc1.c: made traps invisible again
moria1.c, moria2.c, store2.c: replaced strcpy(string, "constant") code with
p = "constant" where possible
treasure1.c, treasure2.c: changed subvals for wands/staffs/amulets so that
they start at zero, and don't have any missing numbers
spells.c: teleport_away() must clear m_ptr->ml before calling update_mon()
moria1.c, spells.c: check lite_spot() calls, eliminate unnecessary ones
death.c, misc2.c, wizard.c: eliminated lots of unnecessary blanks in string
constants
--------------- 10/7
misc1.c, moria2.c, treasure1.c, treasure2.c: fixed lamp/torch subvals, again
can not let torches have subval >= 64, the torch wield code will
not work
store1.c: don't let items with subval >= 192 stack in stores, they are
always handled as a group anyways
spells.c: fire_bolt and fire_ball fixed in regards creature lighting
variable.c: store_choice for temple wrong because broad aze renumbered
earlier, changed 13-15 to 12-14
constant.h, dungeon.c, moria1.c: added print ac flag to status field,
calc_bonus sets flag, prevent printing AC while in store
create.c: dis_ac must have dis_tac added to it
spells.c: detect_monster evil and insivible now set m_ptr->ml when
print monster on screen, then creature() will correctly erase them
--------------------- 10/8
types.h: fixed _frac problem with cmana, had to be unsigned short
moria1.c: in inven_command wear code, print 'too heavy' message after
print wielding message
store1.c: item_value, must multiply value by item->number before returning
store1.c: sell_price return zero if item should not be put into store
monsters.c: disenchanter bat sleep set from 0 to 1
all: eliminated all unnecessary elipses
constants.h, creature.c, dungeon.c, eat.c: new defines for the creature
move, spell, and defense fields, eliminated all hex constants from
the 3 c files
------------ 10/9
moria2.c: fixed falling rock trap in move_char(), step back so that
player is not under the rubble
variable.c: put copyright message in string, so that it appears in executable
spells.c: create_trap modified to light up trap, in case it is an open pit
all:replace prt calls with put_buffer where ever possible, because it's faster
externs.h, io.c, signals.c: put ignore/default/restore_signal code back in
wizard.c: rewrote the version info
dungeon.c, moria2.c, signals.c: modified to use get_check() for consistency
------------ 10/10
several spelling errors in CJS code
misc1.c: forgot to change magic_treasure code when changed subvals a couple
of days ago for wands/staffs/amulets/rings
externs.h, files.c, misc2.c, types.h: wrote new stat code, all stat bugs
fixed now, 6 stat values now, get_dis_stat() eliminated, new function
modify_stat(),
misc2.c: get_obj_num changed, to increase probability of getting higher
level objects
misc1.c, treasur1.c: had to change gain stat bits, the low 6 order bits of
treasure flags, because changed the order earlier
---------------- 10/11
all: changed all 4 or less case switch statements except for one large one
in generate.c to nested if statements, this is smaller and faster
---------------- 10/12
dungeon.c, generate.c, moria1.c: new_spot moved from dungeon to generate
because alloc_mon and place_win_mon use character position, fixed
minor new_spot bug
constants.c, misc2.c, dungeon.c: bst_stat() can not call prt_stat, changed
to set py.flags.status, new stat change flags defined, and stat
print code added to dungeon.c
creature.c: many duplicate disturb/strcat/msg_print brought outside the
switch statement in mon_cast_spell
all: changed all unlite_spot() calls to lite_spot() calls, changed
'if (test_light()) lite_spot()' code to just call lite_spot, this
fixes many subtle bugs, mostly dealing with mon vis to infravision,
unlite_spot code deleted
files.c, misc2.c: added stat_adj(A_INT) to srh which was wrong
misc2.c, spells.c, moria1.c, types.h: id_stat() and hid_stat[] eliminated
no more hidden stat values, display arg dropped from bst_stat()
files.c, misc2.c: hex values replaced with constants
----------------- 10/14
constants.h, store1.c: increased store turn around from 4 (avg 2.5)
to 9 (avg 5), changed store_main() to always call store create/destroy
regardless of bounds, lowered values of bounds MIN and MAX
--------------- 10/18
moria2.c: when open chest, clear TR_CURSED flag, which just also happens to be
monster win flag, to prevent easy wins
constants.h, misc1.c->wizard.c: replaced remaining hex magic numbers with
manifest constants
dungeon.c: added code that gives a player a chance of noticing that items
in inventory/equipment list are magical, the chance is much higher
for warriors than for magi
--------------- 10/19
dungeon.c: ^P^P did not clear the line with the pause_line message
misc2.c: prt_state() did not clear all 3 digits of repeat counts
all: moved lots of procedures around to increase number of static fuctions,
also made sure every C file less than 60K
create.c, extern.h, misc2.c, spells.c, variables.c: change way that mhp
are calculated, new function calc_hitpoints(), new array player_hp[]
which contains player mhp for each level
extern.h, main.c, misc2.c, potions.c, spells.c: change way that cmana are
calculated, new function calc_mana(), called whenever gain level,
lose level, or learn/forget spells
extern.h, main.c, misc2.c, spells.c: change the way that spells are learned
and lost, learn_spell/learn_prayer deleted, new function calc_spells,
new spell type state forgotten, new var spell_forgotten, etc.
-------------------- 10/20
monsters.c: made spirit troll into 'G', made invisible, pickup, carrys obj,
added drain wisdom attack, added drain intelligence attack to green
glutton ghost
all: moved all msg_print(NULL) calls into io.c, specifically, clear_screen(),
erase_line() and prt()
moria2.c, spells.c: two places that called test_light to see if monster or
moving object lit were wrong, changed to eliminate check of fm
creature.c: update_mon() failed when hallucinating, changed print(cchar,...)
to lite_spot() call
variables.c: adjusted call stat adjustments, mainly to make priest harder,
gave priest negative str adjust, inc expfact from 10% to 20%
misc2.c: new funcs prt_int() and prt_long(), same as prt_num/prt_lnum()
except no string argument, ": " moved into prt_num/prt_lnum string
spells.c: all wands now have limits on range
monsters.c: doubled Balrog eye sight from 20->40, evil iggy from 20->30
eat.c: increase hp gain for 22/23/24, increase hp loss for 27
constant.c, eat.c, potions.c, scrolls.c, staffs.c, treasur2.c wands.c:
eliminate store bought flag, only gain exp when use an item if the
use identifies the item
----------------- 10/23
magic.c, wands.c: spell/wand damage did not match
creature.c: monster stuck door bashing got sign of i_ptr->p1 wrong
recall.c: change corrosive gases to poison gases
externs.h, moria1.c: draw_block(), minmax(), maxmin() deleted, minmax and
maxmin calls were unnecessary, draw_block only called from one
place, sub2_move_light combined with sub1_move_light,
sub4_move_light combined with sub3_move_light,
creature.c: fix mon_move() so that creatures that never move increment their
r_attack[0] when standing next to the player, for Quylthulgs
spells.c: detect object and detect treasure set tl, which could also light up
monsters, they now set fm
----------------- 10/24
spells.c: can not gain exp by disarming traps created by a scroll
types.h, magic.c, prayer.c, variable.c, misc2.c, constant.h: removed sname
from spell_type since it was a trivial value, changed sexp from 16
bits to 8 by dividing value by 4, saves about 310 bytes
many files: eliminated long stretches of blanks in strings, remove repeated
chars from strings, typically " : ", saves over 1K of data size
--------------- 10/25
spells.c: aiming a ball type wand/spell at a 1-thick wall resulted in damage
to creatures on the other side of the wall, now it doesn't
misc2.c: inc_stat changed so that player gains 1/6 to 1/3 of the distance
from the max 18/100 stat, 0 to 100 takes 13 gain stat potions,
dec_stat changed so that player loses 1/4 to 1/2 of the distance
from the max 18/100 stat, 100 to 0 takes 13 lose stat potions
misc2.c: print_spells() modified so that spell are always listed with the
same letter, i.e. the letter does not depend on whether or not
you know the spells that precede it
--------------- 10/26
death.c: day string was size 11 should be 12
dungeon.c: make 'magik' detect same chance for each class, need to set
i_ptr = &inventory[INVEN_LIGHT] before testing player_light,
this could cause the light to go off permanently
misc2.c: calc_mana and calc_spells use p_prt->lev - class[].first_spell_lev-1
instead of just the player lev
types.h, variable.c: add new field to class info, first level in which the
player can learn a spell, used immediately above
variable.c: green glutton ghost no longer drains int
misc2.c: print 'welcome to level message' before learning spells
--------------- 10/28
config.h, externs.h, dungeon.c, wizard.c: version info put in a help file,
game_version() function deleted
files.c: removed obsolete print_map() and print_monster() code
treasur1.c: made ring of WOE decrease wisdom, to balance ring of stupidity,
removed trailing ^ secret symbols which made no sense, changed
constant values from known2 to known1, such as ring of lordly protect
armor class values
store1.c, store2.c, externs.h, types.h: add storenice feature by Dan Berstein,
if (good bargain > 3 * bad bagains + 20) then always get final price
in that store, two new functions, noneedtobargain() and updatebargain()
moria1.c: fixed wear command so that it prints inven letter of item removed,
and equip letter of item worn, added extra param to remove()
generate.c, moria1.c, moria2.c, types.h: added an 'lr' flag to cave_type,
this is set for every space in or next to a room, lr is true for
lit rooms, and false for dark rooms, find_light() function deleted
as it was no longer necessary, twall lights spots that have lr set
moria1.c, moria2.c: decrease search chances if hallucinating, decrease
disarm chances if hallucinating, look fails completely
eat.c: print message "You feel drugged." for mushroom of hallucination
moria1.c: eliminate unnecessary in_bounds() calls
io.c: check to make sure tabs are all 8 character apart
treasur2.c: made object_ident array bss
misc2.c, moria1.c: fix calc_bonuses() so that it when wielding heavy bonuses,
it subtracts the weight penalty from dis_th (display to hit),
check_strength() modified to call calc_bonuses()
misc1.c: fixed compact_objects() and compact_monster() so that they update
screen when deleting objects/monsters
creature.c, spells.c: put message in aggravate_monster(), took out redundant
mesasge in creature.c
moria2.c: modify py_attack(), inven_throw() and py_bash() to make it more
difficult to hit monsters which are not lit
---------------- 10/31
moria1.c: sub3_move_light() modified so that it does not print @ when in find
mode
recall.c: had an 'i == 11 | i == 18' which should have been a ||
printed out 11st,12nd,13rd levels incorrectly, now uses 'th'
moria1.c: fix see_wall, it assumed walls are # which is not true for PC/Atari
spells.c: breath() could do damage on the other side of walls, added an los()
call to prevent this
moria1.c: area_affect treated 'potential corner' and 'branching side corridor'
identically, which is wrong, added see_nothing() so that these could
be handled separately
---------------------- 11/1
moria1.c: when wearing object and must remove current object, fix code to
use inven_check_num to see it is possible; in wear code, when remove
old object check to see if inven_ctr increases before actually
increasing wear_high
constants.h, misc2.c, moria1.c, store1.c, store2.c, treasure1.c, treasure2.c:
change definition of subval 192 so it can be used for torches, it
only stacks with others if have same p1 value, but it is always
treated as a single object, change ITEM_* definitions in constant.h
to match new definition, fix all code fragments that test subvals
desc.c: change to use new ITEM_ definition
moria1.c: fixed the potential corner/corridor intersection bug in the find
code again, except this time it works better than the original code
------------------------------ 11/3
variables.c: decrease priestly HP bonus from 3 to 2
moria1.c: fixed wear code bug, called inven_check_num() with item not slot
----------------- 11/4
moria2.c: in tunnel(), print message if player tries to dig with hands
moria2.c: several places where object/treasure picked up did not clear
c_ptr->fm, this is necessary since it might be set by detect spell
--------------- 11/7
moria1.c: fixed find_init so that moves straight into a corner would
correctly run around the corner
moria1.c: changed the examine potential corner code in area_affect(), it
would run into rooms if corridor entrance next to a wall, at least
it doesn't do that for lighted rooms anymore
----------------- 11/8
prayer.c: in remove curse spell, only clear flag for items that are
wielded or worn
io.c: truncate strings at col 79 instead of 80 if BUGGY_CURSES defined
moria1.c: print weights in show_inven and show_equip at col 71 not 72
io.c, misc1.c, moria1.c: change highlight mode for walls to display '%'
instead, this is much more portable that original code that used
standout mode and the high character bit, changed print(),loc_symbol(),
and see_wall()
help.c: change help documentation for % character
wizard.c: modify wizard_create and change_character functions, add whitespace,
exit if get_string fails (i.e. typing ESCAPE exits), modify get_string
limits to more reasonable values, remove switch for setting tchar
moria_wiz_help, moria_owiz_help: correct errors in command list
death.c: add msg_print(NULL) after show_inven() in print_tomb() so that
inventory can't accidentally scroll of screen before exiting
creature.c, moria2.c, spells.c: can't call prt_experience() in mon_take_hit()
as this gives "new level" message before "killed monster", move prt_exp
calls to after msg_print at everyplace that calls mon_take_hit()
dungeon.c: modified repeat count code so that can edit the number entered
leave cursor on msg line while entering repeat count
moria2.c: change summon_object() so that it will only create objects within
los of point where monster dies
--------------- 11/9
store1.c: stacking code in store_check_num() and store_carry() did not
handle torches correctly, changed to be the same as inven_check_num
code in moria2.c
wizard.c: fixed mistake in change_character(), put *tmp_str != '\0' test
in inside if statement, not outside one
externs.h, misc2.c, moria2.c: fix printing of spell characters from get_spell,
print_spells changed consec TRUE to nonconsec == -1 for consecutive
case, otherwise spells start with nonconsec=='a', added new arg to
get_spells() first_spell which becomes nonconsec when call print_spell
wizard.c: move 'gold' from end of change_character to right after 'mana'
since it is more frequently used than the rest
misc2.c: alloc_object(), fix it so that objects are not created underneath
the player, this was a problem for rubble and traps
misc1.c: allow sling ammo to be enchanted in magic_treasure()
store1.c: fix search_list() call for ammo in item_value(), was passing 1 ?!?
instead of correct subval
treasur2.c: subval for spike wrong, change from 192 to 193
misc1.c: remove see invisible from slay monster arrows, since it doesn't make
sense
variable.c: change blows_table entry for STR/W .5-.7 and DEX 10-18 from one
to two, the value of one made things too difficult for low level mages
monsters.c: for all monsters which used to be sleep value of 1 (old style),
change their new style sleep values from 0 to 1
recall.c: stupid typo, change CM_CARRY_OBJ|CM_CARRY_OBJ to ..OBJ|CM_CARRY_GOLD
---------------- 11/10
moria2.c: disarm() had signs switched for trap chances, "tot - 100 + level"
changed to "tot + 100 - level"
variable.c: change "tin plated" to "tin-plated" and etc.
----------------- 11/13
save.c: changes to get the save code working again
moria2.c: when move onto a trap, instead of restoring confused count, should
increment it by the old value, since the trap may have set it
generate.c: for type 2 rooms, make them dark below level 25, not 30
moria2.c: when close a door, print "Something" instead of monster name if
the monster blocking the door is invisible
moria2.c: in tunnel(), make the digging chance for non digging weapons equal
to their max damage + tohit bonus instead of proportional to weight,
the old code made lances better for digging than shovels
moria2.c: change py_bash() chance, make it a function of monster hp +
monsters average max hp instead of level
--------------- 11/15
save.c, undef.c: restore_stats function eliminated, replaced by call to read
py.stats from file, other fixes to get restore code working
creature.c: if creature never moves, kill it if it happens to be in a wall
instead of moving it out of the wall
generate.c: everywhere that TMP1_WALL is used, must also set fopen FALSE
so that place_object(), vault_monster() etc will work correctly
prayer.c: removed cure_blindness() and cure_confusion() from Holy Word spell,
since could not pray while blind/confused
signals.c, io.c, externs.h: eliminate redundant definition of signal() in
signals.c, also eliminate suspend_handler and assignment to it from
signal(), make suspend() non-static
moria2.c: in look(), put blind and image tests before get_alldir()
moria2.c: in look() change [y to recall] to [(r)ecall]
creature.c, externs.h, generate.c, misc1.c, monsters.c, moria1.c, moria2.c,
save.c, spells.c, types.h, constant.h: change m_list from linked list
to a linear list, muptr deleted, monster_type nptr field deleted,
function pushm deleted, now all scans of m_list go from mfptr (which
always points at last element) to MON_MINIX == 2
misc1.c: compact_monster no longer calls prt_map(), which is unnecessary
--------------- 11/16
eat.c: fixed restore charisma mushroom, print 'stops' instead of 'starts'
moria2.c: fix calculation of avg_max_hp in py_bash(), didn't check CD_MAX_HP
monsters.c: spirit troll too hard to hit when can't be seen, lower AC 56->40
treasure2.c: fixed scare_monster trap, the subtype value was wrong 63->99,
and the level needed 100 added to it
misc2.: fix get_spells(), must add first_spell to *sn instead of subtracting
from spell[i]
creature.c: in mon_move, return immediately if creature is killed because it
is in rock
---------- 11/17
externs.h, spells.c, scrolls.c, prayer.c, staffs.c: change dispell_creature()
to dispel_creature()
spells.c: dispel_creature uses m_ptr->ml after calling mon_take_hit() which
is wrong, now save value before calling mon_take_hit()
moria2.c: turn find_flag into a counter, when it reaches 100, exit find mode
with message "You stop running to catch your breath.", prevents
infinite loop
generate.c: fixes to help prevent isolated rooms, in build_tunnel() make
sure tunnel has gone at least 10 spaces from start before stop it,
in cave_gen(), copy [yx]loc[0] to [yx]loc[k] so that can build tunnel
from last room to first
spells.c: light_line() called lower_monster_name() which is wrong, change
to monster_name() call
externs.h, creature.c, moria2.c, spells.c: removed seen argument from
mon_take_hit, as it was used inconsistently, only get credit for a
kill if monster is visible when killed
save.c, dungeon.c: call disturb in save_char() to turn off searching and
resting, remove search_off call in dungeon.c as is no longer needed
variable.c: remove initialized data for py and old_msg since were (mostly)
zero, set f_ptr->food and f_ptr->food_digested in main.c
constant.h: delete some unused constants, rearrange the order of a few others
------------ 11/18
variables.c, externs.h, monsters.c, treasure2.c, save.c: every variable
written to save file needs definate size, can not be just 'int',
also spell_forgotten now read/written
-------------- 11/20
spells.c: sleep_monsters1() did not set NO_SLEEP info for monster memory
externs.h, moria1.c: changed new_spot to accept short pointers since
char_row and char_col are now shorts
creatures.c, spells.c: multiply_monster(), removed slp parameter since it was
always FALSE, added monptr, to fix the m_list bug
creatures.c: new m_list code fails when call delete monster from within
creatures(), fixed it by changing some calls to delete_monster()
to call delete_monster() only if the dead monster is between the
current monster and mfptr, otherwise, call fix1_delete_monster()
externs.h, creatures.c, spells.c: breath() has new argument monptr, to fix
the m_list bug
externs.h, creatures.c, spells.c: two new functions, fix1_delete_monster()
and fix2_delete_monster() which together equal delete_monster,
these are called from within creatures() when a monster is killed
many: eliminate the fopen field since I had 5 bitfields in the cave structure,
and it is much easier to only save 4, added a BLOCKED_CORR case for
secret/closed/locked/stuck doors and rubble, all code that used
to test fopen now tests fval, most code that used to set fopen is
now gone since it was redundant with fval setting code
moria2.c: fixed disarm() so that if there is a valid trap to disarm, it will
print "Something/monster_name is in the way!" just like close door."
generate.c: place_stairs() could place them on the boundary, make sure
that x/y can never be 0 or cur_xx-1, also, in town_gen(), call place_
boundary() before place_stairs(), looks better, though not necessary
moria2.c: fixed openobject() so that if there is something to open, it will
print an message just like closeobject if there is a monster in the way
save.c: fix another save file problem, noscorefile defined as int in get_char,
just eliminated it and use noscore instead
--------------------------- 11/22
moria2.c: fix1_delete_monster() has to set m_ptr->hp to -1
creature.c: monster eating code checked monster exp wrong, was using cptr
to index into the c_list
creature.c: in creatures(), call fix2_delete_monster if hp < 0
moria2.c, spells.c: dragon breath, wand bolts, wand balls, and thrown objects
were visible even when blind, added checks, only print them if can see
moria2.c: tunnel(), print message "* is in the way" if there is a monster
in the spot where the player is trying to tunnel
-------------- 11/23
save.c: player_hp was not saved/restored, total_winner and panic_save were not
restored
------------- 11/27
moria2.c: in tunnel, add the weapon damage to its digging ability
create.c: get_history(), clear the history strings before writing them with
new values, to get rid of old strings
variable.c: for background strings, change "1st child" to "first child"
store2.c: add parameter to get_haggle() last_offer, in sell_haggle and
purchase_haggle must set new_offer to 0, in get_haggle only allow
incremental bid if new_offer == last_offer, i.e. at least one previous
bid has been made
dungeon.c: in main loop, call creatures(FALSE) to light/unlight creatures
when ever player_light value changes
---------- 11/28
save.c: new save code, to reduce size of save file, and to make the savefiles
portable
constant.h, desc.c, generate.c, misc1.c, misc2.c, moria2.c, save.c:
changed the t_list from a linked list into a linear array of entries,
just like the previous m_list change, new constant MIN_TRIX,
all pusht calls changed to delete_object where ever appropriate, etc.
---------- 11/29
misc1.c: increase p1 value for crowns of seeing by multiplying by 5
----------- 12/4
creatures.c: change stealth code, instead of randint(10) < stl, it now cubes
randint(64) and compares against 1 << (17 - stl), the result is that
a change of one in stl always decreases monster notice chance by 80%,
and perfect stealth is impossible
wizard.c: allow wizard to enter any stealth between -1 and 17
save.c: extensive changes to save code competed, save files are now xor
encrypted, and are supposedly portable, all savefile protection code
is gone
---------- 12/5
save.c, undef.c, misc1.c: fix a few lint errors
changed version number to 5.0.8 and release the sources
creature.c: changed stealth code, amount monster woken by from 100 to 125
(used to be 75 before 12/4)
-------- 12/6
spells.c, creature.c: changed the way wall building wands work again,
kill creature if it never moves, otherwise do a little damage,
if creature can not move out of rock in mon_move, then do more damage
and remove the wall ontop of the creature
various: check use of "?", especially in get_check() and verify() prompts,
verify changed to replace the period with a question mark
spells.c, creature.c, misc1.c: breath(), update_mon(), and loc_symbol()
changed to use blind status bit instead of blind counter, this
helps make the display look better, i.e. nothing disappears until
blindness takes affect in dungeon.c
monsters.c: more monster fixes from DJG
monsters.c, misc1.c, moria2.c, treasur1.c: change (SM) to (SA),
slay monster to slay animal
monsters.c: set the new 'animal' bit correctly for all monsters
recall.c: change 'unnatural creature' to 'natural creature', change a few
constants to defines
save.c: add error exits to every loop/array index in the get_char()
routine to prevent crashes due to bad save files
store1.c: in item_value, set value to zero if known cursed, this prevents
store from buying known cursed items
------------ 12/7
store2.c: remove switches in prt_comment*() functions, replace with table
look up to get proper string, saves much code space
creature.c: changed stealth code again, if resting/paralyzed monster has a
chance of noticing once every 50 turns instead of never like before,
change 64 to 1024, and 17 to 29 for a better distribution
constant.h, save.c: read noscore variable from savefile of dead character, now
only read/write noscore for live characters, changed patch_level to
9 so that old savefiles can still be read
save.c: in get_char(), the loop error prevention code was missing two gotos
store2.c: get_haggle(), when check for valid first use of incremental haggle,
ignore leading spaces in the string
moria2.c: add_food() should increment slow value, not just set it when bloated
save.c: when can't create savefile, test for from_savefile before giving
wizard message "Overwrite old?", when exit in wizard mode do the
"readable to all?" check after closing the file
save.c: from_savefile set wrong, should always be set if have read from a file
not just when a complete character is read
moria2.c: bash(), do not put character off balance if bash is successful
misc2.c: get_spell(), instead of beeping for unknown spell, print a message
recall.c: for monsters with sleep value of 0, could never learn that fact,
change it so that this will be known if have killed 10 of them
-----12/9
dungeon.c: call disturb when player takes poison damage, or starvation
damage
variable.c: change the three doors from 'a ...' to '& ...', needed because
of wall-to-mud wand
wizard.c: create_object wrong, was calling popt() then delete_object() then
setting c_ptr->tptr, this fails because the delete objects will move
the location (in t_list) of the just created object will change
treasur2.c: change 'nothing' item to be stackable, so that it can be safely
picked up
save.c: was calling store_maint before objects were reidentified, this caused
stores to end up with multple entries for stackable identified items
externs.h, misc2.c: new function inven_check_weight(), check toosee whether
picking up an object will change the players speed
moria2.c: carry(), if picking up an object would slow you down, prompt with
question "Exceed your weight limit?" to give player a choice
moria2.c, misc1.c: only show rock types in look() if highlight_seams option
is set, also change option text from "highlight" to "HL and notice"
spells.c: in fire_bolt() and fire_ball(), set recall info if monster takes
extra damage because of weakness or reduced damage because of breath,
in dispel_creature() set EVIL/UNDEAD flag if creature hurt,
in turn_undead() set UNDEAD if creature hurt, in drain_life() set
CD_UNDEAD if creature not hurt
recall.c: "may carry one or two treasures" needs the plural, but the others
remain singular/collective
------------- 12/11
creature.c: stealth value changed again from 125 to 100
wizard.c, variable.c: change rogue base stealth from 4 to 5, let wizard set
stealth to 18
monster.c: white worm mass sleep value from 10 to 1, crystal ooze 60 -> 1
creature.c: in drain mana spell, if r1 greater than cmana, then set r1
equal to cmana to limit creature's hp gain
recall.c: when print out creature attacks, exit loop if i >= 4, caused
problems for umber hulk, etc. which have 4 attacks
store1.c: instead of destroying all single stackable objects, only destroy
one half on average (randint(number)), makes store 1 and 5 inventories
look better, oil is much more common, identify a little more common
treasure2.c: accidentally change blank_treasure tval earlier, set tval
back to 0, and set subval to 64
store1.c: change store_carry(), for group items, must update scost; for any
stackable item, set ipos so that inventory will scroll to show it;
let group items (except torches) stack over 24 since each group is
created with a set number to begin with; ipos must be set to -1 at
start not 0;
store2.c: store_sell(), pass a pointer to cur_top instead of just its value,
if sold object not on the page shown, scroll to show the object
------------ 12/13
recall.c: only print out known attacks, i.e. check r_attack, change i to count
from 0 to 3, fixes bug with knowdamage(), add variable j to count
attacks actually printed out
save.c: put limit on number of times store inventory changed in get_char()
store2.c: rewrite incremental haggle code again, add new parameter 'num_offer'
to receive_offer, change get_offer parm last_offer to num_offer, only
allow inc haggle if num_offer != 0; must reset new_offer after
rejected offer in recieve_offer and sell/purchase_haggle
------------ 12/14
misc2.c, lots: change way spell learning works, new command 'G'ain magic
spells, new function gain_spells() in misc2.c formerly part of
calc_spells(), new status flag PY_STUDY controls printing of 'Study'
in status line, new field py.flags.new_spells number of spells can
learn
origcmds.hlp, roglcmds.hlp: document the 'M'ap and 'G'ain magic commands
variables.c, potions.c: remove potion of learning as it is no longer useful
moria-5.6.debian.1/vms/ 0000755 0001750 0001750 00000000000 11074757460 013003 5 ustar pjb pjb moria-5.6.debian.1/vms/getch.c 0000644 0001750 0001750 00000012522 11074756221 014235 0 ustar pjb pjb /* vms/getch.c: input routines for VMS, integrated with smcurses for VMS
Copyright (c) 1986-94 Joshua Delahunty, James E. Wilson
This file is part of Umoria.
Umoria is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Umoria is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Umoria. If not, see . */
#include
#include
#include
#include
#ifndef TRUE
# define TRUE 1
# define FALSE 0
#endif
/* the type of keyboard read we're doing */
#define FUNC IO$_TTYREADALL|IO$M_NOECHO|IO$M_TRMNOECHO
static $DESCRIPTOR(chan, "tt:");
static char ungotch;
static unsigned short int kb_chan = 0; /* channel # */
static unsigned short int charwaiting = FALSE,
crmode_status = TRUE,
echo_status = FALSE;
/* This code was tested and worked on a VAX 11/785 running VMS 5.2.
contributed by Ralph Waters, rwaters@jabba.ess.harris.com. */
/* Returns 1 is a character has been pressed, 0 otherwise. */
int kbhit()
{
/* sys$qiow ( [efn] ,chan ,func [,iosb] [,astadr] [,astprm]
[,p1] [,p2] [,p3] [,p4] [,p5] [,p6] ) */
/* The sys$qiow call with the IO$_SENSEMODE|IO$M_TYPEAHDCNT function
will return the following in p1:
31 24 23 16 15 0
------------|------------|------------------------
| reserved | first | number of characters |
| | character | in type-ahead buffer |
|-----------|------------|-----------------------|
| reserved |
| |
--------------------------------------------------
*/
struct qio_return_type {
unsigned short int type_ahead_count; /* type-ahead count */
unsigned char first_char; /* first character in buffer */
unsigned char b_reserved; /* reserved byte */
unsigned long int l_reserved; } /* reserved long word */
qio_return;
sys$qiow (0, kb_chan, (IO$_SENSEMODE | IO$M_TYPEAHDCNT), 0, 0, 0,
&qio_return, 0, 0, 0, 0, 0);
if (qio_return.type_ahead_count > 0)
return(1);
else
return(0);
}
/* Another useful function courtesy of Ralph Waters. */
#include
/* Stores the user's login name in the argument buf. */
void user_name(buf)
char *buf;
{
/* sys$getjpiw ( [efn], [pidadr], [prcnam], itmlst [,iosb]
[,astadr] [,astprm] */
long int return_length;
struct getjpi_itmlst_type {
unsigned short int buffer_length; /* length of return buffer */
unsigned short int item_code; /* item code to getjpi about */
unsigned long int buffer_address; /* address of return data */
unsigned long int return_length_addr; } /*actual size of return data */
getjpi_itmlst;
getjpi_itmlst.buffer_length = 12; /* VMS usernames are 12 chars */
getjpi_itmlst.item_code = JPI$_USERNAME;
getjpi_itmlst.buffer_address = buf;
getjpi_itmlst.return_length_addr = &return_length;
sys$getjpiw (0, 0, 0, &getjpi_itmlst, 0, 0, 0);
return;
}
/* After calling this, vms_getch() returns unbuffered single chars. */
void vms_crmode() /* Character-Return MODE */
{
if(kb_chan == 0)
opengetch();
crmode_status = TRUE;
}
/* After calling this, vms_getch() returns echoed, buffered characters. */
void vms_nocrmode() /* NO Character-Return MODE */
{
if(kb_chan != 0)
closegetch();
crmode_status = FALSE;
}
/* Sets up terminal for getch() calls, returns VMS status code. */
int opengetch() /* does the actual assignment work */
{
/* assign channel on keyboard */
return(sys$assign(&chan,&kb_chan,0,0));
}
/* Undoes affects of above, returns VMS status code for the operation. */
int closegetch() /* performs the actual deassignment work */
{
int rv;
if(kb_chan != 0) {
/* deassign keyboard channel */
rv = sys$dassgn(kb_chan);
kb_chan = 0;
return(rv);
}
}
/* Returns an [optionally] unbuffered [non-]echoed input character.
If crmode_status is not set, then the code returns one character from
the buffered input.
If crmode_status is set, then the code returns an `ungot' character if
one exists, otherwise it tries to read one unbuffered character from the
keyboard. If echo_status is set, then the character will be echoed
before returning. */
char vms_getch()
{
int rv;
char kb_buf; /* buffer for input char */
if(crmode_status) {
if(!charwaiting) {
/* open channel if it hasn't been done already */
if (kb_chan == 0)
opengetch();
/* que an i/o request for a character and wait */
rv = sys$qiow(0,kb_chan,FUNC,0,0,0,&kb_buf,1,0,0,0,0);
/* indicate if something is amiss */
if(rv != SS$_NORMAL) {
printf("?");
exit(rv);
}
} else { /* charwaiting */
kb_buf = ungotch;
charwaiting = FALSE;
}
/* massage for getchar() compatibility */
if (kb_buf == '\r') kb_buf='\n';
/* echo char if we're supposed to */
if (echo_status) putchar(kb_buf);
return(kb_buf);
} else /* nocrmode */
return(getchar());
}
moria-5.6.debian.1/vms/ERRORS 0000644 0001750 0001750 00000001740 05613574177 013750 0 ustar pjb pjb why does the VMS port need its own versions of the curses functions in
cbreak.c and getch.c?
files.c needs two restore_screen() calls to work properly?
clear_screen() in shell_out() after return from spawned process does
not clear screen properly?
if is only included in files.c, and errno is defined in externs.h,
then there is a 'psect' problem with errno?
ESCAPE is defined as Control-Z for compatibility with the VMS Moria versions,
but this is not documented anywhere, note the define for ESCAPE in constant.h
! and $ commands are aliases, but this is not documented
curses puts vtxxx keypad into application mode, inkey() has some code
to convert keypad escape sequences back into numbers, this code may
cause strange behaviour if someone types a real ESCAPE character,
why does curses put the keypad in application mode in the first place?
refresh() and clear() do not seem to work right, note the contorted code
in inkey() and clear_screen() to make these work right
moria-5.6.debian.1/vms/uexit.c 0000644 0001750 0001750 00000002402 11074756221 014275 0 ustar pjb pjb /* vms/uexit.c: special exit command, to exit cleanly from VMS program.
Copyright (c) 1990-94 Joshua Delahunty, James E. Wilson
This file is part of Umoria.
Umoria is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Umoria is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Umoria. If not, see . */
/* Unix programs usually return 0 for "good execution",
and 1 for "some problem occured." In VMS, we WANT the
program to return a 1, or else we get an ugly
"%NONAME-W-NOMSG, Message number 00000000"
message upon image exit (yeech!).
So, we convert 0 exit codes to 1's, leaving all others alone. */
void uexit(exitcode)
int exitcode;
{
if (exitcode == 0) /* On Unix, clean, on VMS, yeech! */
exit(1); /* converted... */
else
exit(exitcode); /* returned unscathed... */
}
moria-5.6.debian.1/vms/descrip.mms 0000644 0001750 0001750 00000005027 05613574200 015145 0 ustar pjb pjb MORIA.EXE : MAIN.OBJ, CREATE.OBJ, CREATURE.OBJ, DEATH.OBJ, -
DESC.OBJ, DUNGEON.OBJ, EAT.OBJ, FILES.OBJ, GENERATE.OBJ, -
GETCH.OBJ, HELP.OBJ, IO.OBJ, MAGIC.OBJ, MAIN.OBJ, MISC1.OBJ, -
MISC2.OBJ, MISC3.OBJ, MISC4.OBJ, MONSTERS.OBJ, MORIA1.OBJ, -
MORIA2.OBJ, MORIA3.OBJ, MORIA4.OBJ, PLAYER.OBJ, -
POTIONS.OBJ, PRAYER.OBJ, RECALL.OBJ, RND.OBJ, SAVE.OBJ, SCROLLS.OBJ, -
SETS.OBJ, SIGNALS.OBJ, SPELLS.OBJ, STAFFS.OBJ, STORE1.OBJ, -
STORE2.OBJ, TABLES.OBJ, TREASURE.OBJ, UEXIT.OBJ, -
VARIABLE.OBJ, WANDS.OBJ, WIZARD.OBJ
- $(link) $(linkflags) MORIA.OPT/opt
create.obj : constant.h, types.h, externs.h, config.h
creature.obj : constant.h, types.h, externs.h, config.h
death.obj : constant.h, types.h, externs.h, config.h
desc.obj : constant.h, types.h, externs.h, config.h
dungeon.obj : constant.h, types.h, externs.h, config.h
eat.obj : constant.h, types.h, externs.h, config.h
files.obj : constant.h, types.h, externs.h, config.h
generate.obj : constant.h, types.h, externs.h, config.h
help.obj : constant.h, types.h, externs.h, config.h
io.obj : constant.h, types.h, externs.h, config.h
magic.obj : constant.h, types.h, externs.h, config.h
main.obj : constant.h, types.h, externs.h, config.h
misc1.obj : constant.h, types.h, externs.h, config.h
misc2.obj : constant.h, types.h, externs.h, config.h
misc3.obj : constant.h, types.h, externs.h, config.h
misc4.obj : constant.h, types.h, externs.h, config.h
monsters.obj : constant.h, types.h, config.h
moria1.obj : constant.h, types.h, externs.h, config.h
moria2.obj : constant.h, types.h, externs.h, config.h
moria3.obj : constant.h, types.h, externs.h, config.h
moria4.obj : constant.h, types.h, externs.h, config.h
player.obj : constant.h, types.h, config.h
potions.obj : constant.h, types.h, externs.h, config.h
prayer.obj : constant.h, types.h, externs.h, config.h
recall.obj : constant.h, config.h, types.h, externs.h
rnd.obj : constant.h, types.h
save.obj : constant.h, types.h, externs.h, config.h
scrolls.obj : constant.h, types.h, externs.h, config.h
sets.obj : constant.h, config.h
signals.obj : constant.h, types.h, externs.h, config.h
spells.obj : constant.h, types.h, externs.h, config.h
staffs.obj : constant.h, types.h, externs.h, config.h
store1.obj : constant.h, types.h, externs.h, config.h
store2.obj : constant.h, types.h, externs.h, config.h
tables.obj : constant.h, types.h, config.h
treasure.obj : constant.h, types.h, config.h
variable.obj : constant.h, types.h, config.h
wands.obj : constant.h, types.h, externs.h, config.h
wizard.obj : constant.h, types.h, externs.h, config.h
moria-5.6.debian.1/vms/Makefile 0000644 0001750 0001750 00000010512 05613574176 014445 0 ustar pjb pjb # COPTS = /nowarning
COPTS =
OBJS1 = create.obj creature.obj death.obj desc.obj dungeon.obj eat.obj \
files.obj generate.obj getch.obj help.obj io.obj magic.obj main.obj \
misc1.obj misc2.obj misc3.obj misc4.obj monsters.obj
OBJS2 = moria1.obj moria2.obj moria3.obj moria4.obj player.obj potions.obj \
prayer.obj recall.obj rnd.obj save.obj scrolls.obj sets.obj \
signals.obj spells.obj staffs.obj store1.obj store2.obj tables.obj
OBJS3 = treasure.obj uexit.obj variable.obj wands.obj wizard.obj
moria : $(OBJS1) $(OBJS2) $(OBJS3)
link moria/opt
create.obj : create.c constant.h types.h externs.h config.h
cc $(COPTS) create.c /obj=create.obj
creature.obj : creature.c constant.h types.h externs.h config.h
cc $(COPTS) creature.c /obj=creature.obj
death.obj : death.c constant.h types.h externs.h config.h
cc $(COPTS) death.c /obj=death.obj
desc.obj : desc.c constant.h types.h externs.h config.h
cc $(COPTS) desc.c /obj=desc.obj
dungeon.obj : dungeon.c constant.h types.h externs.h config.h
cc $(COPTS) dungeon.c /obj=dungeon.obj
eat.obj : eat.c constant.h types.h externs.h config.h
cc $(COPTS) eat.c /obj=eat.obj
files.obj : files.c constant.h types.h externs.h config.h
cc $(COPTS) files.c /obj=files.obj
generate.obj : generate.c constant.h types.h externs.h config.h
cc $(COPTS) generate.c /obj=generate.obj
getch.obj : getch.c
cc $(COPTS) getch.c /obj=getch.obj
help.obj : help.c constant.h types.h externs.h config.h
cc $(COPTS) help.c /obj=help.obj
io.obj : io.c constant.h types.h externs.h config.h
cc $(COPTS) io.c /obj=io.obj
magic.obj : magic.c constant.h types.h externs.h config.h
cc $(COPTS) magic.c /obj=magic.obj
main.obj : main.c constant.h types.h externs.h config.h
cc $(COPTS) main.c /obj=main.obj
misc1.obj : misc1.c constant.h types.h externs.h config.h
cc $(COPTS) misc1.c /obj=misc1.obj
misc2.obj : misc2.c constant.h types.h externs.h config.h
cc $(COPTS) misc2.c /obj=misc2.obj
misc3.obj : misc3.c constant.h types.h externs.h config.h
cc $(COPTS) misc3.c /obj=misc3.obj
misc4.obj : misc4.c constant.h types.h externs.h config.h
cc $(COPTS) misc4.c /obj=misc4.obj
monsters.obj : monsters.c constant.h types.h config.h
cc $(COPTS) monsters.c /obj=monsters.obj
moria1.obj : moria1.c constant.h types.h externs.h config.h
cc $(COPTS) moria1.c /obj=moria1.obj
moria2.obj : moria2.c constant.h types.h externs.h config.h
cc $(COPTS) moria2.c /obj=moria2.obj
moria3.obj : moria3.c constant.h types.h externs.h config.h
cc $(COPTS) moria3.c /obj=moria3.obj
moria4.obj : moria4.c constant.h types.h externs.h config.h
cc $(COPTS) moria4.c /obj=moria4.obj
player.obj : player.c constant.h types.h config.h
cc $(COPTS) player.c /obj=player.obj
potions.obj : potions.c constant.h types.h externs.h config.h
cc $(COPTS) potions.c /obj=potions.obj
prayer.obj : prayer.c constant.h types.h externs.h config.h
cc $(COPTS) prayer.c /obj=prayer.obj
recall.obj : recall.c constant.h types.h externs.h config.h
cc $(COPTS) recall.c /obj=recall.obj
rnd.obj : rnd.c constant.h types.h
cc $(COPTS) rnd.c /obj=rnd.obj
save.obj : save.c constant.h types.h externs.h config.h
cc $(COPTS) save.c /obj=save.obj
scrolls.obj : scrolls.c constant.h types.h externs.h config.h
cc $(COPTS) scrolls.c /obj=scrolls.obj
sets.obj : sets.c constant.h config.h
cc $(COPTS) sets.c /obj=sets.obj
signals.obj : signals.c constant.h types.h externs.h config.h
cc $(COPTS) signals.c /obj=signals.obj
spells.obj : spells.c constant.h types.h externs.h config.h
cc $(COPTS) spells.c /obj=spells.obj
staffs.obj : staffs.c constant.h types.h externs.h config.h
cc $(COPTS) staffs.c /obj=staffs.obj
store1.obj : store1.c constant.h types.h externs.h config.h
cc $(COPTS) store1.c /obj=store1.obj
store2.obj : store2.c constant.h types.h externs.h config.h
cc $(COPTS) store2.c /obj=store2.obj
tables.obj : tables.c constant.h types.h config.h
cc $(COPTS) tables.c /obj=tables.obj
treasure.obj : treasure.c constant.h types.h config.h
cc $(COPTS) treasure.c /obj=treasure.obj
uexit.obj : uexit.c constant.h types.h config.h
cc $(COPTS) uexit.c /obj=uexit.obj
variable.obj : variable.c constant.h types.h externs.h config.h
cc $(COPTS) variable.c /obj=variable.obj
wands.obj : wands.c constant.h types.h externs.h config.h
cc $(COPTS) wands.c /obj=wands.obj
wizard.obj : wizard.c constant.h types.h externs.h config.h
cc $(COPTS) wizard.c /obj=wizard.obj
moria-5.6.debian.1/vms/README 0000644 0001750 0001750 00000003115 05613574177 013667 0 ustar pjb pjb NOTE: ESCAPE is defined as Control-Z in constant.h to be more like the
original VMS moria, this is not documented anyplace, so whenever the
doc/program says escape type control_Z instead. If you don't like this,
delete the define for escape in constant.h (but you will probably have to
hit escape twice for it to work).
If you're building Moria on a VAX/VMS system, you'll need a C compiler
that understands the 'defined()' macro.
Notes on VMS files:
getch.c - single character terminal input and related routines.
uexit.c - shell for the exit() call, to prevent -NOMSG messages
from appearing when exiting the Moria program.
makefile. - for use if you have a Make utility. I use Todd
Aven's VMSMAKE (with the unix options)
moria.opt - the options file for linking Moria. (You do a
'link moria/opt' command to link the program)
descrip.mms - builds moria if you have the mms utility. (You do a
'mms/description=descrip.mms' to build it.)
debug.mms - builds moria to run under debug if you have the mms
utility. (You do a 'mms/description=debug.mms' to build
the debugger version.)
make.com - for those without make or mms, does all the compiles
and the final link of the program.
scores.fdl - file intended for use with CONVERT/FDL; the score
file needs to be created empty, then converted using
scores.fdl. This is because moria expects it to be
stream/LF format.
In the config.h file, the files that moria uses are defined to be
on the logical device 'moria:'. This will need to be defined before
you can run Moria.
moria-5.6.debian.1/vms/debug.mms 0000644 0001750 0001750 00000005100 05613574177 014607 0 ustar pjb pjb cflags = /NOOPT/DEBUG
linkflags = /DEBUG
MORIA.EXE : MAIN.OBJ, CREATE.OBJ, CREATURE.OBJ, DEATH.OBJ, -
DESC.OBJ, DUNGEON.OBJ, EAT.OBJ, FILES.OBJ, GENERATE.OBJ, -
GETCH.OBJ, HELP.OBJ, IO.OBJ, MAGIC.OBJ, MAIN.OBJ, MISC1.OBJ, -
MISC2.OBJ, MISC3.OBJ, MISC4.OBJ, MONSTERS.OBJ, MORIA1.OBJ, -
MORIA2.OBJ, MORIA3.OBJ, MORIA4.OBJ, PLAYER.OBJ, -
POTIONS.OBJ, PRAYER.OBJ, RECALL.OBJ, RND.OBJ, SAVE.OBJ, SCROLLS.OBJ, -
SETS.OBJ, SIGNALS.OBJ, SPELLS.OBJ, STAFFS.OBJ, STORE1.OBJ, -
STORE2.OBJ, TABLES.OBJ, TREASURE.OBJ, UEXIT.OBJ, -
VARIABLE.OBJ, WANDS.OBJ, WIZARD.OBJ
- $(link) $(linkflags) MORIA.OPT/opt
create.obj : constant.h, types.h, externs.h, config.h
creature.obj : constant.h, types.h, externs.h, config.h
death.obj : constant.h, types.h, externs.h, config.h
desc.obj : constant.h, types.h, externs.h, config.h
dungeon.obj : constant.h, types.h, externs.h, config.h
eat.obj : constant.h, types.h, externs.h, config.h
files.obj : constant.h, types.h, externs.h, config.h
generate.obj : constant.h, types.h, externs.h, config.h
help.obj : constant.h, types.h, externs.h, config.h
io.obj : constant.h, types.h, externs.h, config.h
magic.obj : constant.h, types.h, externs.h, config.h
main.obj : constant.h, types.h, externs.h, config.h
misc1.obj : constant.h, types.h, externs.h, config.h
misc2.obj : constant.h, types.h, externs.h, config.h
misc3.obj : constant.h, types.h, externs.h, config.h
misc4.obj : constant.h, types.h, externs.h, config.h
monsters.obj : constant.h, types.h, config.h
moria1.obj : constant.h, types.h, externs.h, config.h
moria2.obj : constant.h, types.h, externs.h, config.h
moria3.obj : constant.h, types.h, externs.h, config.h
moria4.obj : constant.h, types.h, externs.h, config.h
player.obj : constant.h, types.h, config.h
potions.obj : constant.h, types.h, externs.h, config.h
prayer.obj : constant.h, types.h, externs.h, config.h
recall.obj : constant.h, config.h, types.h, externs.h
rnd.obj : constant.h, types.h
save.obj : constant.h, types.h, externs.h, config.h
scrolls.obj : constant.h, types.h, externs.h, config.h
sets.obj : constant.h, config.h
signals.obj : constant.h, types.h, externs.h, config.h
spells.obj : constant.h, types.h, externs.h, config.h
staffs.obj : constant.h, types.h, externs.h, config.h
store1.obj : constant.h, types.h, externs.h, config.h
store2.obj : constant.h, types.h, externs.h, config.h
tables.obj : constant.h, types.h, config.h
treasure.obj : constant.h, types.h, config.h
variable.obj : constant.h, types.h, config.h
wands.obj : constant.h, types.h, externs.h, config.h
wizard.obj : constant.h, types.h, externs.h, config.h
moria-5.6.debian.1/vms/make.com 0000644 0001750 0001750 00000002314 05613574177 014424 0 ustar pjb pjb $ set verify
$ cc create.c /obj=create.obj
$ cc creature.c /obj=creature.obj
$ cc death.c /obj=death.obj
$ cc desc.c /obj=desc.obj
$ cc dungeon.c /obj=dungeon.obj
$ cc eat.c /obj=eat.obj
$ cc files.c /obj=files.obj
$ cc generate.c /obj=generate.obj
$ cc help.c /obj=help.obj
$ cc io.c /obj=io.obj
$ cc magic.c /obj=magic.obj
$ cc main.c /obj=main.obj
$ cc misc1.c /obj=misc1.obj
$ cc misc2.c /obj=misc2.obj
$ cc misc3.c /obj=misc3.obj
$ cc misc4.c /obj=misc4.obj
$ cc monsters.c /obj=monsters.obj
$ cc moria1.c /obj=moria1.obj
$ cc moria2.c /obj=moria2.obj
$ cc moria3.c /obj=moria3.obj
$ cc moria4.c /obj=moria4.obj
$ cc potions.c /obj=potions.obj
$ cc player.c /obj=player.obj
$ cc prayer.c /obj=prayer.obj
$ cc recall.c /obj=recall.obj
$ cc rnd.c /obj=rnd.obj
$ cc save.c /obj=save.obj
$ cc scrolls.c /obj=scrolls.obj
$ cc sets.c /obj=sets.obj
$ cc signals.c /obj=signals.obj
$ cc spells.c /obj=spells.obj
$ cc staffs.c /obj=staffs.obj
$ cc store1.c /obj=store1.obj
$ cc store2.c /obj=store2.obj
$ cc tables.c /obj=tables.obj
$ cc treasure.c /obj=treasure.obj
$ cc variable.c /obj=variable.obj
$ cc wands.c /obj=wands.obj
$ cc wizard.c /obj=wizard.obj
$ cc getch.c /obj=getch.obj
$ cc uexit.c /obj=uexit.obj
$ link moria/opt
moria-5.6.debian.1/vms/scores.fdl 0000644 0001750 0001750 00000001067 05613574200 014763 0 ustar pjb pjb IDENT "12-JUL-1990 11:05:15 VAX-11 FDL Editor"
SYSTEM
SOURCE "VAX/VMS"
FILE
BEST_TRY_CONTIGUOUS no
CLUSTER_SIZE 3
CONTIGUOUS no
EXTENSION 0
FILE_MONITORING no
GLOBAL_BUFFER_COUNT 0
ORGANIZATION sequential
PROTECTION (system:RWED, owner:RWED, group:, world:RW)
RECORD
BLOCK_SPAN yes
CARRIAGE_CONTROL carriage_return
FORMAT stream_LF
moria-5.6.debian.1/vms/moria.opt 0000644 0001750 0001750 00000001362 05613574176 014643 0 ustar pjb pjb MAIN.OBJ, -
CREATE.OBJ, -
CREATURE.OBJ, -
DEATH.OBJ, -
DESC.OBJ, -
DUNGEON.OBJ, -
EAT.OBJ, -
FILES.OBJ, -
GENERATE.OBJ, -
GETCH.OBJ, -
HELP.OBJ, -
IO.OBJ, -
MAGIC.OBJ, -
MISC1.OBJ, -
MISC2.OBJ, -
MISC3.OBJ, -
MISC4.OBJ, -
MONSTERS.OBJ, -
MORIA1.OBJ, -
MORIA2.OBJ, -
MORIA3.OBJ, -
MORIA4.OBJ, -
PLAYER.OBJ, -
POTIONS.OBJ, -
PRAYER.OBJ, -
RECALL.OBJ, -
RND.OBJ, -
SAVE.OBJ, -
SCROLLS.OBJ, -
SETS.OBJ, -
SIGNALS.OBJ, -
SPELLS.OBJ, -
STAFFS.OBJ, -
STORE1.OBJ, -
STORE2.OBJ, -
TABLES.OBJ, -
TREASURE.OBJ, -
UEXIT.OBJ, -
VARIABLE.OBJ, -
WANDS.OBJ, -
WIZARD.OBJ, -
SYS$LIBRARY:VAXCRTl/share
! ^ char input
! ^ small stubs for cbreak(), nocbreak()
! ^ small stub for exit() call
! ^ links us with the RTLibrary
moria-5.6.debian.1/ERRORS 0000644 0001750 0001750 00000112107 05613574174 013140 0 ustar pjb pjb
black ooze should resist acid, but can't code this because it casts
spells and would breathe acid if it were given acid resistance
identifying items by one-digit inscriptions should work for items in
equipment list as well as for items in inventory
saving and restoring takes a turn, this can be fatal in combat
----JEW's old ERRORS list, excluding things fixed by DJG
stores probably should buy items which have been marked {damned} by being worn
and then cleared via remove curse, after all they buy unident damned items
creating traps can destroy staircases
chests should create treasure appropriate to the level they were found
on, or to the level of the chest, not the level that they are opened on
color MacMoria bugs: the colors dialog box says greed not green
the help dialog lists the wrong versions
my address is wrong
when wearing a ring of speed, light should not be used up as fast, the faster
you are moving, the more turns it should last
- by the same reasoning, store lockout are broken too, in fact just about
anything using time won't work `correctly' when character is sped up
calling put_qio() every turn during running significantly slows it down
on slow hosts which are using curses, I believe it was added only for
aesthetics, and it probably isn't strictly necessary, could at least
surround it with an #ifndef FAST_RUNNING or similar
when thief steals an object, say what was stolen in message
when item in backpack is destroyed, indicate what item was destroyed
inventory does not take a turn
display_scores(), at end of the game, should display top 15 or so scores, and
list the current player's score below that if not in the top 15 list, at least,
the value of show_player should be false at the end
- better, display_scores can put a message line at the bottom like this
( ESC : return to game space : toggle all scores/your scores)
and then the player can easily choose which scores to see
the 32767 limit in the recall code for number of monsters killed is too
easy to reach, making it unsigned will extend the range to 65535,
making it a long would increase program size by 2K, I don't think that this
change is worth the extra memory used
Mac: choosing `9 point' from the screen menu results in a 1" square window
which won't expand or grow, switching back to 12 point gives a huge window
with type that appears to be about 100 points or so
monsters should probably not be summoned on top of a rune of protection
could make scorefile code more efficient if I read/write more than one entry
at a time
for MSDOS: shouldn't the treasure.c file change '#' to wallsym, and '.'
to floorsym?, shouldn't the save.c file change '.' to floorsym and vice
versa, just like it already does for wallsym?
VMS curses apparently has a bug, during resting, the program continually
moves the cursor to the @ sign, which is a no-op and should result in no
output, but the VMS curses code outputs control commands to the terminal,
this makes resting run slow on bandwidth limited terminals
VMS has 32 bit user ids (UIC), should increase the size of uid's in the
scorefile to 32 bits, and then make the vms uic = getgid()<<16+getuid()
which is 32 bits
remove the hours support for all micros, or else give people the option
in the config.h file to remove it
when functions are not used, ifdef out the calls instead of providing
dummy functions, to save some space
save.c creates two files under VMS, because it first calls 'open' and
then later calls 'fopen', rewrite so that only one file will be created
in store.c, the comment "Your mother was a troll!" doesn't mean anything
if you are a half-troll, change to Ogre?
the ms_misc.c file maps the 'Ins' key, which is the '0' key to 'i',
this confuses the hell out of a lot of people, this IS documented, but
few people read the documentation
add a turns counter to the higscores entry, and check this when restoring
a character, don't score the character if this value is different
this prevents someone from playing a character, goofing, saving it while
alive, and then going back to the first savefile
haste self is a level 1 potion, and super heroism is level 3, both
seem far too low of a level for the potions considering how useful they
are, increasing the levels would make them more common deeper in the dungeon
restore potions are level 40 are too deep, they are available in the stores,
and just aren't that powerful of a potion
DJG: haste self is needed at level 1 for early encounters with nasty monsters
super heroism could be higher
the sorting code does not work with foodstuffs, problem is that when
restore a 5.2.1 character which has unsorted food, the new code may
put a food ration at the start instead of merging it with the other unsorted
food, thus overflowing the inventory size, there are few 5.2.1 characters
left anyways, so perhaps this isn't much of a problem anymore
wine/ale should be potions to be quaffed, not foodstuffs to be eaten
^M = ^J when digging, can't really solve well, because of bugs in some
version of curses which requires this to be true
perhaps add an option to control the Drop One/Drop All query for multiple
stacking items
the choice of whether or not duplicate characters should be scored should
really be an option in the config.h file, since there exist single-user
unix machines, and multi-user IBM-PCs (on a network)
- also, the decision of whether to limit each player to one entry per
character type should be an option (perhaps the same one)
give warriors a better chance of detecting that ego weapons are magik,
but only for ego weapons, not all items
an inscription is lost when two objects are merged, either choose longest,
or ask player, try to combine them, at least do something
Macintosh
- mac version does not clear screen after saving a character
restart variables are not reset as they should (maybe fixed?)
- mac moria crashes with the 384 size resource?, works fine with 512k size
- mac moria crashes when trying to write past the end of the screen,
specifically, if have a weapon with more than 80 characters, and put it last
in the equipment list, then mac version will crash
add code to put_buffer to truncate strings?
- the CRuntime.o and CLibraries.o ARE needed for the mac makefiles.
- the file type and creator are not set for the character stats file
- when save a game and hit the cancel button, it still says the
game is being saved even though it isn't
- when a character dies, the savefile is not marked as dead
- should be able to find config file in same directory as the program
- should get version number from constants, not hardwired into resources
- should have color menu enabled even on B&W monitor, so you can switch
black and white if desired
- does not work on 512K mac, seems to be enough memory, but it uses routines
which are not in the old ROMS, 512K macs are obsolete, so this is
probably not worth fixing
IBMPC
- received report that -w command gives 'file from wrong version' error
- when followed by monster, and reach edge of screen, sometimes the game
hangs and you must type a character for it to continue, either a Turbo C
bug or a PC-Moria bug
- tunneling does not work with the numeric keypad when using rogue-like mode,
i.e. ctrl-4
- on PC, only draw during traceback, perhaps make this an option, this is
a CGA specific problem (most people have VGA now a days), and only applies
to the Turbo C builtin screen code, tcio.c, PC-Curses does not have this
problem, in Turbo Pascal, there is a variable in the CRT unit that one
can set to enable this feature
- tcio.c file does not handle redraw ^R at all
run under Saber C to see if that turns up any bugs
- if you curse a special magic item (HA, RF, etc), it retains its very high
value, its cost should be reset to the value in object_list[index]
- if you curse a special cursed object (noise, irritation), it will lose its
special cursed ability (two wrongs make a right?!?), this should not happen,
instead of clearing ALL flag bits, should only clear the 'good' ones
if wield a torch, and a silver jelly immediately drains it to 1,
the program will be confused for one turn thinking that you still have
light even though you don't
scoring unfair to humans/warriors/etc, since they have a lower max exp than
other race/classes, should adjust exp downward by inflationary factors
when calculating score?
DJG: unnecessary
should reduce stack usage in generate.c
in the store, should have some way to determine how close one is to
getting perfect haggling
replace all of those heavy weapon messages with an automatic inscription,
how should this be maintainted, should it change only when wielded,
or should it change whenever the players strength changes?
throwing a lot of objects into a pile can cause problems?
make the printing of stuff under monsters an option for those who find
it bothersome
make monster movement more intelligent:
- for slow monsters, in movement_rate(), instead of using mod, use
(randint(2 - speed) == 1) to make monster movement a little more uncertain
for fast monsters, give a little variance to speed, i.e. 66% of time monster
moves at speed, 17% of time move at speed+1, 17% of time move at speed-1
- monsters which are about to die should flee if intelligent
- monsters should breathe at player if only separated by a single column
- better spell selection, don't cast teleport_to when standing next to
player, etc.
- have monsters with multiple attacks spread the attacks over each turn if
moving slower than player, instead of doing nothing one turn, and then
attacking multiple times on the next turn
- remember the previous two moves for each intelligent monster, so they can
tell which direction they are moving
in get_com(), get_dir(), etc, put -escape- on the msg line if escape
key pressed, useful if message doesn't get deleted, but doesn't this
always happen?, apparently not on the Atari ST MWC port
rubble can be generated underneath a monster, which should not happen
why call sigsetmask(0)?
delete signals() and nosignals() as unnecessary?
killing a shell -1 results in the game disappearing without leaving
a save file, what happened?
the save.c code that says "file exists, overwrite?", can this ever be
executed?, if so, does it do the right thing?, and also, what happens on
EOF? will it go into an infinite loop on EOF?
what exactly does the damned flag mean, should it be on for all except known2
items, or should it be on when an item is known to be cursed?
add ptodam to damage before calling critical_hits
- modify C command to print to dam bonuses modified by weapon, should
print both the unmodified bonus, and the modified bonus
- should take about 10 slay dragon arrows to kill AMHD, check this after
ptodam code is changed, may need to increase damages from +3?
- also check other ego weapons for play balance, maybe reduce ego multipliers
when rogues list Beginners Majik spell book, spells are listed 'a'-'e',
when cast from the spell book, spells are listed 'b'-'f', the spell casting
list should also go from 'a'-'e', but this looks hard to fix
allow SPACE to exit from inventory commands
no monster, except Balrog, can resist mass polymorph, should I make it more
like polymorph?
mass polymorph is much higher level than polymorph, and is useful for
dire emergencies, either don't give monsters a saving throw, or make is
something like level/(3*MAX_MONS_LEVEL/2) which will make it possible but not
certain that the staff will work on AMHD's
should mac port have a separate io.c file?
'headless' monsters should not glare when recovering from a bash
version.inf file should not contain version number/copyright, these should
be printed from the variable values
in misc1.c, the pusht code requires search of entire cave structure,
this needs to be written more efficiently, perhaps put x,y into inven_type for
every object located somewhere in the cave?
eliminate all #if 0 in the code
**************************
Changes that can wait...
only let warriors get *GREAT* hits?
in critical_hits(), change the threshholds to 400-600-800, which will make
all melee weapons eligible for great hits, and only let warriors get great
hits
since this makes Mage's much worse fighters, swap Sleep II for Lightning
Ball (giving a much needed intermediate Ball spell), and Recharge I for
Object Dectection (to compensate for Priest's sense surroundings)
DJG: object detection isn't very useful
increase the classes of weapons from 3 to 5, i.e. missile, blunt, assassin,
melee (two handed weapons, etc., only these can do *GREAT* hits), and normal.
Then modify fighting abilities as follows:
mis blu ass mel nor
a) b) c) d) e) -- := suck
Warrior + + + ++ + - := iffy
Rogue + 0 ++ - 0 0 := unchanged
Mage 0 0 0 -- 0 + := improved
Ranger ++ 0 0 0 0 ++ := hyperb
Priest 0 + - -- 0
Paladin 0 ++ 0 0 0
the monster memory always prints monster attack types and damage types
together, this can lead to strange situations, for example, if a grey
mushroom patch releases spores, but does not confuse the player, nothing
appears in the monster memory because the player does not know they were
confusion spores, but he/she does know that that spores are released
IBMPC COLOR
- the experimental color support for PC-Moria does not work well when
trying to display a monster which is the same color as the background
- the disenchanter w and b are not the same color
- CHP changes to the same color as ball/breath that lowered it
- all mushrooms are wrong, except the grey mushroom patch
- invisible monsters can easily be found by casting stinking cloud at the walls
which will color all spaces green, except the one with the invisible monster
show how many spells player can learn via the 'G' command
add max mana to display in addition to current mana
add inscriptions that apply to a class of objects, not just a single instance
shouldn't be able to genocide invalid letters; escape out of genocide
have alternative messages to 'dies in a fit of agony', that gets
a bit repetitive, and boring
a command to allow writing the monster memory to a file
get sources for nethack/omega, look for any really good ideas, also check
to see how the implement Mac compatibility, portability, protection,
and other general concepts
treasure.c has an arrow and a bolt out of order (arrow in the rings, and
bolt in the amulets)
secret doors are always granite, would be nice to have secrets doors
hidden in other types of rock, would make them less obvious when
hightlight seams is on, also current scheme gives an advantage while searching
since walls displayed as % obviously are not secret doors
MAX_SIGHT is 20, but rooms can be larger than twenty across, that gives
strange situation where moving one step away from a monster in a large room
can cause it to disappear, either increase MAX_SIGHT to be size of largest
possible room size, or else use different MAX_SIGHT values in rooms/corridors/
town level?
instead of printing 'it can hit to attack and hit to attack' print
'it can hit to attack twice' in monster descriptions?
- change haggling so that initial price depends on how many good bargains
you have had
- add key to accept price, instead of forcing player to type in price
- when reach perfect haggling, should just give object to player without
asking for any prompt, bad idea if someone mistypes a letter
- add an option so that player can play with or without haggling, without
haggling, give prices that are always, say, 30% above the minimum
- add store commands to buy/sell without haggling, with price say, 20%,
less/greater than asking price
improve map command (see nethack), define an array of special characters,
one for each type of composite wall, say, and then let end users specify
the necessary graphic characters, allow for multiple character graphic
sequences
combat in a room should have a chance of waking up sleeping monsters, except
that it would not be fair, since monsters can send breath weapons through
other monsters, but the player can only attack the nearest monsters
(high level?) monsters should slowly regenerate hit points, esp since the
doc states that the Balrog does
note, if leave level and come back, the Balrog is regenerated (sic) with
full hit points
every 128 turns, let monsters regenerate 1/64 of their total hit points?
have several different types of Balrog, i.e. a fire breathing one,
a cold breathing one, a lightning breathing one, etc.
should be a chance of weapons breaking when try to dig with them?
NO, it is too easy to dig with weapon by accident, shouldn't dull them unless
there is some way to sharpen them which there currently isn't
can get small groups of rooms which are connected to each other, but not
to the rest of the rooms on the level, perhaps check for cycles in
tunnel/room graph before trying to build tunnels?
can not use counted commands while bashing a door, because of the
paralyzation that sometimes occurs always stops a counted command
allow character building, by allocation of a limited number of stat points,
instead of random rerolling??
add another aux inventory slot, so that there is one for picks, and one for
bows
decrease mithril values, increase gem values, more expensive items in the
shops, should be greater difference between prices of low level objects
and high level objects, more gold/silver/copper on lower levels, selling
high enchanted objects should not be so profitable
(good idea here, favorite suggestion for fixing the money problem)
in object_offset(), give 70/71 and 75/76 different codes, shift by 5 (32)
everywhere instead of 6 (64), reduce size of object_ident[] from
7*64 to 9*32, objects 71 must all have 2 added to subval so that they
start at 96, objects 76 must all have 1 added to subval
all variables (including bss) should be initialized before they are used,
see the mac sources
add a macro capability
most case statements should use table or if/else instead, table are much
faster, both give much smaller code
if have one unidentified object, and sell it to a store, and it gets
identified, and you happen to have some similar store items, you will get
a 'combining' message, even though no combining is really taking place,
perhaps adding an extra parameter to identify which indicates whether
the item will remain in inventory after ident, if it does not remain,
then should not give combining message if there is only one of them
many of the constants in constant.h should really be enums instead, this
would make the game more maintainable
some fields of treasure_type are const and could be deleted
missile weapons should be made more useful, make them stackable after
identified if they are identical, increase the benefit of using proper
bow/arrow combo, increase +todam, +tohit more than now, perhaps give
an advantage here to fighters/paladins/rangers/rogues somehow, don't
decrease ptohit so much in inven_throw() (currently reduced by distance)
should recall info be set in breath() for other monsters?
finish monster compiler, write defs for all monsters
should be able to increase digging plusses for weapons??
should be able to increase ring plusses?? this would seriously unbalance
the game if allowed
in the store bargain code, separate the sell good bargains from the purchase
good bargains? this is important for owners with very high inflate values
as it is easy to reach sell final value, but very difficult to reach purchase
final value, change from 20 to 10 if do this
change move to take a char-number i.e. '0' instead of a number, i.e. 0
put all prt_ functions into a separate file, put all movement functions
in a separate file
define constants for all possible tchars, number-directions, attack-types,
last_line = 23, scroll flags, potion flags, etc
would be nice if 10-23 were all wielded objects, i.e. move light 15 outside
this range
use scroll bars on the Mac version for showing the rest of the level,
L/W, might be confusing since this won't scroll the whole window, only
the dungeon view
have multiple windows, one for inventory, one resizable/scrollable for
dungeon view, etc...
should eliminate need for 70/71 scrolls and 75/76 potions
replace hex flag fields in treasure with constants
should not get message "something rolls under feet" when step on a loose rock
/* Hid Obj*/ trap?, also should not get this message when cast create food
some people prefer to have these messages though
%%%%%%%%%%%%%
ideas from Bron Campbell Nelson bron%bronze.wpd.sgi.com@sgi.sgi.com
potion of boldness should have duration, i.e. should be safe from fear for
a little while after quaffing boldness potion (also heroism/super-heroism)
the current length values seem a little long, perhaps just improve the
characters resistance to fear?
warriors too hard, give them more hitpoints?, lower base-to-hit of other
classes?, fix warrior so can withstand one AMHD poison breath attack?
boots of speed are too hard to find, 1/7000 is ring of speed, 1/14000+ is
boots of speed, other evidence suggests that boots are about 10 times as
rare as rings
items needed for win: see invisible, free action, resist fire, speed, if
add black market, don't make it too easy to get these items
black market suggestions:
staff of teleportation 20000, staff of speed 100000, mushroom of restoring
20000, and perhaps some powerful archery items
heavy armor is useless, does not protect against spells/breate, and reduces
from to-hit, reduce penalty for characters with high STR?
new shop: enchantorium, where enchantments can be purchased for a high
price, price proportional to how many enchants already there (i.e. enchanting
a +9 item costs a fabulous amount, but enchanting a +0 item costs a little
more than one enchant armor/weapon scroll), allow enchant to any value, i.e.
AC/digging for HA/DF, digging for picks/shovels/etc, etc...
less reasonble suggestions follow...
too many weapon types, the variety is useless
have armor protect by subtracting ac/10 (sic) instead of reducing by %
speed is too important, need smaller time quanta
race/class adjustments should be more meaningful, give races/classes max
stat values which are not 18/100
add an autosave option
add more up stairways? currently there are only randint(2) per level,
perhaps guarantee that there will be at least 2
warriors should automatically recognize ego weapons
dispel evil/undead are nearly worthless since they do not do much damage for
their mana cost, change dispel_creature from mon_take_hit (i, randint(damage))
to mon_take_hit (i, damage)
rune of protection is too powerful, reduce OBJ_RUNE_PROT to 800, maybe 1000,
if make this change, should make the spell somewhat easier to cast, say
50% for a level 33 priest
DJG: this makes them much less useful against the Balrog
Balrog should not cast cause serious wounds as it does less damage than a
normal attack, should not cast slow/paralyze since the player almost
certainly will have some form of free action
%%%%%%%%%%%%%%%%%%%%%%%%%
reincarnate, and lose 1/2 exp?
give enchant scrolls (or perhaps just *enchant*) a small probability
of creating ego weapons
give enchant scrolls a small probability of destroying ego enchantments
if they fail to increase pluses
make the number of hits per round probabilistic, i.e. instead of getting
1/2/3/4 hits per round, gives weapons 2.4 hits per round etc, to smoothen
the curve
perhaps add option to order monsters differently?
give list of all monsters of that type, and then recall all if type 0,
else only recall the one indicated by the number typed in
change ident_char() in help.c
have all top level action functions (aim, move, throw, inven_command, etc.)
return true if took a turn, otherwise false
add command to show number of turns played, time spent playing, date character
started, perhaps even a calendar to give game date '1037 in the Third Age'
enter_store in store2.c calls draw_cave when exiting the store, it should
save the current screen contents away in memory and then restore from that
saved screen
if type control-C while resting, sometimes the counter is not cleared, happens
often when count less than 10, to fix, should move all I/O code out of signal
handler, it should just set a flag and return
should examine_book(), scrolls(), and spells/prayers work when hallucinating?
change player attributes to counters, things like sustain_stat, etc.
this would greatly simplify calc_bonuses()
should not be able to stun creates which do not move, and creatures
which have no brains
los code used to determine if monsters are visible but not for objects,
this leads to strange situations, when room lights up, one can see all objects
in the room, but must enter the room before can see then monsters
have the monster generator make a table of undead monster indexes, to simplify
summon_undead()
add some unique levels to make it more interesting, mazes, etc.
add a metric option
add diagonal corridors???
add a storage rental shop, so players can save objects until they need them,
but must pay for the priviledge, and have to go back to level 0 to
retrieve the objects
create a safe haven for the player, where hp regen faster, poison/disease
cure faster, and player must be in to win
add amulet of poison resistance, make it a high level item, people would
have to take off amulet of the magi to wear it
add another set of gain stat potions, at about 1550 feet, to encourage
people to go deeper in search of them
add a bank for saving/borrowing money (I don't like this), would rather
make money less plentiful, perhaps make magic items less profitable to
sell?
possible AD&D enhancements
mages can't wear armor and cast at the same time, stealth decreases
when wearing armor (for thieves), priests can't use edged weapons, spell
casting takes time (more than one turn for high level spells?), ranger
attack bonuses, paladin's laying on hands and wealth limits
give females better dexterity, and/or better spell casting ability, and/or
more stealth
Orcs should always appear in groups?
possible balancing enhancements
characters have max stat of 18/50+ initial race/class mod, for example,
human mage has max str of 18/50 - 5 = 18.
increase warrior HP so that a warrior can withstand one breath of any type
frlom any dragon
dex is very important, so everybody should have a chance of getting high
dex values
add option to find code so that it can optionally stop before lighting
up or entering a room
add otpion to find code so that will enter corridor intersections
Change key-dispatch table in dungeon.c back to ORIGINAL mode.
put shell_out code in OS dependent files, unix.c/msdos.c/etc.
save all levels, problems with the sheer size of doing this, 10K * 50 levels
is 500K total
change stats to straight 1-40 range
replace sets.c with an array ~110*16 with a flag for each type of damage
faster and smaller than current scheme
add option to loc_symbol so that it can optionally print char to screen,
most loc_symbol calls feed directly to print()
the look code uses a different algorithm from the los code, is recursive,
hard to understand, has 3 gotos, I would prefer code more like los
using the shading ideas of jnh
lose_dex is never called, well, we'd better fix that!
for characters with low dex, should have slight chance of dropping weapon,
maybe less for fighters, more for mages and priests, should also trip
occassionally when running
acid attacks should lower charisma?
the first nasty invisible monster is the Banshee at 1200 feet, so need to
have see invisible items start appearing at about this time, the current
balance seems OK to me though
black mold, and shimmering mold have 00000080 CMOVE flag set which has no
effect
boots of great mass can be identified by checking the weight display,
should eliminate them and replace with some other type of cursed boots
suggestion: boots of two left feet, (- to dexterity)
add another field to monster_type, treasurep, cloned/multiplyed monsters
should not have treasure, but if they pick up an object, then
again let them carry treasure
change randnor from table lookup to 8d99, save 512 bytes for table
remove ASCII dependencies
many places assume that a-z are consecutive, i.e. 'a'+25 = 'z'
the hallucination code assumes ascii - randint(95)+31 (misc1.c)
eliminate sscanf calls in ms_misc.c and wizard.c
allow numbers instead of letters in menus, i.e. spell lists, inventory/equip
lists
don't use num-lock for tunneling in PC version, this is a locking key
characters accumulate too much cash, perhaps do this:
change OBJ_TOWN_LEVEL from 7 to 17, and change place_gold() in misc2.c
293c293,294
< i = ((randint(dun_level+2)+2)/2.0) - 1;
---
> /* NF: Change randint multiplier from (r(d+2)+2)/2 to (r(d+2)+4)/3 */
> i = ((randint(dun_level+2)+4)/3.0) - 1;
the fixes above (decrease mithril values ...) are preferable
show time elapsed playing, date character started, and number of turns
elapsed
have option to put inventory/equipment list on one screen
set a timer, and if the game has been idle for 15 minutes, gracefully
save and exit?
new monster suggestions by berman-andrew@yale, because there are no
medium difficult mosnters before level 40...
{"Electric Golem", 0x00020002, 0x00080004, 0x1080, 100, 380,
12, 85, 0, 'g', "70d8", "8 1 1d24|8 1 1d24", 35}
{"Queen Harpy", 0x37120012, 0x00008208, 0x2036, 100, 1200,
20, 80, 2, 'h', "46d8", "1 3 2d6|1 3 2d6|1 2 2d12|3 7 0d0", 35}
new monster suggestions by Don Dodson
Nether Lich: invisible, phases through walls, similar to Emperor Lich in
other respects
Archer: fires arrows that do normal damage, or poison, or reduce stat
Wizard: Like a sorceror but more powerful. Casts fireballs, summons all sorts
of nasties, blindness, and hold person. Very high saving throw
and resistant for fire/frost.
balls should affect player if inside radius, unfortunately, this is not
really such a good idea, since the player is often forced to cast to the
next space, would be OK if the player can specify any point for the target
of the spell
when resting, a player should have a chance of not waking up when a monster
enters a room
add wizard command that would create new MORIA_HOU file, since there already
is a default def for it, otherwise, make days array bss
for HA weapons, p1 is used for both str increase, and sustain stat
rewrite my own sprintf routine that just takes strings %s and integers %d
and nothing else, may be faster/smaller than the library version, or perhaps
have a routine which cats 3 strings together, or 2 strings and an int
age characters before killing them of Ripe-Old-Age
these commands which take a dir should not work when confused,
closeobject, jamdoor, openobject
monsters need a 'not carry large object' flag in CMOVE, have all chests (type
2), polearms (type 22) and staffs (type 55) be large objects, these should
be rerolled if they occur when only small objects allowed, chests should have
this bit set, also small creatures should have it set: kobolds, mummified
kobolds, greedy little gnomes, scruffy-looking hobbits.
trap names are vague,
have two names for each trap, a simple search discloses current vague name,
setting it off, or a find/identify trap gives the long name
allow option of making aux files either hard coded paths, or paths relative
to the executables directory, could then make the aux files relative, put
exe file in same directory as aux files, and start up program with shell
script that cds to aux file direcotry, this makes it easy to keep multiply
moria versions around
allow rerolling after choose race/class
still too slow on i/o, perhaps rewrite to avoid refresh() calls?
perhaps use only motion optimization stuff?
should we call m_name if spell only applies to visible creatures?
when moving on objects, say what character moved onto (like rogue)
for throw command, ask for direction first (like rogue)
should be able to enchant to-hit to-dam of gauntlets of slaying?
likewise, enchant toac of HA swords, etc.
either should allow enchant of HA sword toac, or else disenchanter bats
should not be allowed to reduce it
fix save files to include obj desc, then only need one random number
generator which can use table program
give rogues detect treasure and detect objects, also give them a chance to
steal objects from monsters
modify 'x' command to show monster hitpoints
replace magic numbers with constants
name objects if use did not identify them
when creature steals and then dies, the stolen item should appear, unless
creature has teleported away in the meantime
always add exp to current and max, instead of just increasing max when current
exceeds it, this would make attacking undead creatures a little more profitable
since you are guaranteed a net gain of exp if you kill it, even if it drains
a lot of EXP from you
allow chests to hold items
have a global variable, savefile field to keep track of the number of times
a character has been resurrected
should not be able to use a two-handed weapon (two-handed sword, pole arm,
bow, crossbow, flail, etc.) at same time as wearing a shield
should be able to also choose to wield two weapons, but with a penalty of
some sort, probably lowered AC
can't cast in any direction, should be able to, should also be able to cast
down at feet (5), should be able to cast area affect spells (balls) at any
point, so that the burst will affect any desired area
Long term stuff, enhancement suggestions:
give player something to do with money, i.e. 1Million gp for HA +10 +10 sword
'flavor' the levels, dragons on one level, undead on another, etc.
what's been discovered list
commands not close enough to rogue style
fixed item lettering in inventory, in-line/cmd-line options?
command line option to print out times open
Y destroy command, allow destroy from equipment list
let o, c, D commands automatically pick direction when they can
give rogue's a chance to steal, e.g. let monsters carry items that they
pick up, if rogue fails, then monster gets a free hit, otherwise monster
stays asleep, with a small chance of monster waking up
give magic users a chance at pre identifying scrolls
could use a help system, like VMS version
have multiple character parties, note that almost everything character
dependent is stored in the py structure already
could reduce the size of the types.h file (and other source files too) if
eliminate reduce type specifiers, i.e. int32u cmove;\n int32u spells;
could be int32u cmove,\n spells;
add color, i.e. red dragons show up as a red 'D', etc
an inn on the town level, in which you must pay to stay, could be used
by those who need to wait to get back into a store, or who want to wait
until a store's inventory changes
when look at monsters, give monster state in addition to monster name, i.e.
"You see a sleeping ancient red dragon."
add code to the get_dir() function so that one can optionally specific a
hex instead of a direction, i.e. if you enter '.', then program goes
into a cursor positioning mode, allowing you to move the cursor to
the spot you want to specify
don't like the player_exp values, the increase is not very even, especially
in the upper levels
cloak of protection is misleading, it has no special features
need documentation on what each spell/prayer/staff/etc does, this is needed
for priestly spells in particular, since these are non obvious
also needed for special objects, such as crown of magi
eating elvish waybread for curing can cause a character to become bloated and
start moving slower, either decrease food value of ew to 5000, or
increase player food limit to 17500, or combination of both, or perhaps
change the you are full message, maybe have another message at 7500?,
or maybe make elvish waybread immune to the slowing effect
monsters should be more intelligent, should know about corridors so that they
don't get stuck in dead ends, or continually retrace their movement
RNG for Moria should have a table shuffle, see Knuth
don't update store inventories across save, unless the save file is at least,
say, an hour old
when monster appears, print its name, may need some work to work reasonably
with detect spells
Features:
hero/superhero do not subtract hit points when effect wears off
WOR scroll can save you with minus hit points!!
detect monster does not detect invisible monsters (normally)
can hit monsters in walls, but can not cast at them
can not enchant something with negative numbers (i.e. cursed items)
how does armor protect against breath/gas? it doesn't!!!
missing amulets: strength, constitution, intelligence, dexterity
missing rings: gain wisdom, gain charisma
note that missing rings/amulets are disjoint
missing detect monster potion (feature!)
missing blank scrolls (feature!)
missing staff genocide (feature!)
missing staff mass_genocide (feature!)
D&D Inconsistencies, most of these should not be fixed since that would
unbalance the game:
priests should not need light for prayers
magic missile should do 1d4+1 per level
detect invisible should last 5 rounds, instead of 1
stinking cloud should be renamed cloudkill
fireball does 1d6 per level, should destroy all paper/wood and melt metal
lightning does 1d6 per level
hold monster 1 round per level of caster
phase door by touching a wall, and end up on other side of the wall
light spells should be mobile
heroism should not work when over level 11, superheroism should not work when
over level 14
rings can not be used cummulatively, rings or prot have no effect if
wearing armor
Flame Tongue, +3 versus cold creatures and avian, +4 vs undead
Holy Avenger, +50% on all saving throws
moria-5.6.debian.1/unix/ 0000755 0001750 0001750 00000000000 11074760026 013151 5 ustar pjb pjb moria-5.6.debian.1/unix/Makefile.unix 0000644 0001750 0001750 00000010452 11074725455 015604 0 ustar pjb pjb # BINDIR is the directory where the moria binary while be put
# LIBDIR is where the other files (score, news, hours) will be put
# LIBDIR must be the same directory defined in config.h
# OWNER is who you want the game to be chown to.
# GROUP is who you wnat the game to be chgrp to.
BINDIR = /home/dgrabiner/moria-5.6
LIBDIR = /home/dgrabiner/moria-5.6/files
OWNER = dgrabiner
GROUP = dgrabiner
# For testing and debugging the program, it is best to use this line.
# CFLAGS = -g
# For playing the game, you may want to use this line
CFLAGS = -O
# For BSD Systems
CURSES = -lcurses -ltermcap
# For SYS V Systems
# CURSES = -lcurses
# For XENIX, some XENIX systems may need -ltinfo
# CURSES = -ltcap -ltermcap -lx
# For AIX systems, compiling in the BSD world; SYS_V must not be defined in
# config.h if you use this.
#LFLAGS = -lbsd
# Normal systems don't require anything here.
LFLAGS =
CC = cc
SRCS = main.c misc1.c misc2.c misc3.c misc4.c store1.c files.c io.c \
create.c desc.c generate.c sets.c dungeon.c creature.c death.c \
eat.c help.c magic.c potions.c prayer.c save.c staffs.c wands.c \
scrolls.c spells.c wizard.c store2.c signals.c moria1.c moria2.c \
moria3.c moria4.c monsters.c treasure.c variable.c rnd.c recall.c \
unix.c player.c tables.c
OBJS = main.o misc1.o misc2.o misc3.o misc4.o store1.o files.o io.o \
create.o desc.o generate.o sets.o dungeon.o creature.o death.o \
eat.o help.o magic.o potions.o prayer.o save.o staffs.o wands.o \
scrolls.o spells.o wizard.o store2.o signals.o moria1.o moria2.o \
moria3.o moria4.o monsters.o treasure.o variable.o rnd.o recall.o \
unix.o player.o tables.o
LIBFILES = hours news origcmds.hlp owizcmds.hlp roglcmds.hlp rwizcmds.hlp \
version.hlp welcome.hlp
moria : $(OBJS)
$(CC) -o moria $(CFLAGS) $(OBJS) $(CURSES) $(LFLAGS)
lintout : $(SRCS)
lint $(SRCS) $(CURSES) > lintout
lintout2 : $(SRCS)
lint -bach $(SRCS) $(CURSES) > lintout
TAGS : $(SRCS)
ctags -x $(SRCS) > TAGS
# you must define BINDIR and LIBDIR before installing
# assumes that BINDIR and LIBDIR exist
install:
chmod 755 $(BINDIR)
cp moria $(BINDIR)
chmod 4711 $(BINDIR)/moria
chmod 711 $(LIBDIR)
(cd files; cp $(LIBFILES) $(LIBDIR))
(cd $(LIBDIR); chmod 444 $(LIBFILES))
(cd $(LIBDIR); touch scores; chmod 644 scores)
chown $(OWNER) $(BINDIR)/moria
chgrp $(GROUP) $(BINDIR)/moria
(cd $(LIBDIR); chown $(OWNER) $(LIBFILES) scores)
(cd $(LIBDIR); chgrp $(GROUP) $(LIBFILES) scores)
# If you are short on disk space, or aren't interested in debugging moria.
# strip $(BINDIR)/moria
clean:
rm -r *.o
rm -i moria
create.o: constant.h types.h externs.h config.h
creature.o: constant.h types.h externs.h config.h
death.o: constant.h types.h externs.h config.h
desc.o: constant.h types.h externs.h config.h
dungeon.o: constant.h types.h externs.h config.h
eat.o: constant.h types.h externs.h config.h
files.o: constant.h types.h externs.h config.h
generate.o: constant.h types.h externs.h config.h
help.o: constant.h types.h externs.h config.h
io.o: constant.h types.h externs.h config.h
magic.o: constant.h types.h externs.h config.h
main.o: constant.h types.h externs.h config.h
misc1.o: constant.h types.h externs.h config.h
misc2.o: constant.h types.h externs.h config.h
misc3.o: constant.h types.h externs.h config.h
misc4.o: constant.h types.h externs.h config.h
monsters.o: constant.h types.h config.h
moria1.o: constant.h types.h externs.h config.h
moria2.o: constant.h types.h externs.h config.h
moria3.o: constant.h types.h externs.h config.h
moria4.o: constant.h types.h externs.h config.h
player.o: constant.h types.h config.h
potions.o: constant.h types.h externs.h config.h
prayer.o: constant.h types.h externs.h config.h
recall.o: constant.h config.h types.h externs.h
rnd.o: constant.h types.h
save.o: constant.h types.h externs.h config.h
scrolls.o: constant.h types.h externs.h config.h
sets.o: constant.h config.h
signals.o: constant.h types.h externs.h config.h
spells.o: constant.h types.h externs.h config.h
staffs.o: constant.h types.h externs.h config.h
store1.o: constant.h types.h externs.h config.h
store2.o: constant.h types.h externs.h config.h
tables.o: constant.h types.h config.h
treasure.o: constant.h types.h config.h
unix.o: constant.h config.h types.h externs.h
variable.o: constant.h types.h config.h
wands.o: constant.h types.h externs.h config.h
wizard.o: constant.h types.h externs.h config.h
moria-5.6.debian.1/unix/unix.c 0000644 0001750 0001750 00000021517 11074751155 014311 0 ustar pjb pjb /* unix/unix.c: UNIX dependent code. -CJS-
Copyright (c) 1989-91 James E. Wilson, Christopher J. Stuart
This file is part of Umoria.
Umoria is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Umoria is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Umoria. If not, see . */
/* defines NULL */
#include
/* defines CTRL */
#include
/* defines TRUE and FALSE */
#include
#include "config.h"
#include "constant.h"
#include "types.h"
#ifdef unix
#if defined(SYS_V) && defined(lint)
/* for AIX, prevent hundreds of unnecessary lint errors, must define before
signal.h is included */
#define _h_IEEETRAP
typedef struct { int stuff; } fpvmach;
#endif
#include
#ifdef M_XENIX
#include
#include
/* For various selects from TCP/IP. */
#define bzero(addr,n) memset((char *)addr, 0, n)
#endif
#ifndef USG
#include
#include
#include
#include
#endif
#ifdef __linux__
#include
#include
#include
#endif
#ifdef USG
#include
#if 0
/* Used to include termio.h here, but this is unnecessary because it is
included in curses.h, and some systems fail when it gets included
twice. */
#include
#endif
#include
#else
#include
#if defined(atarist) && defined(__GNUC__)
/* doesn't have */
#else
#include
#endif
#endif
/* This must be included after fcntl.h, which has a prototype for `open'
on some systems. Otherwise, the `open' prototype conflicts with the
`topen' declaration. */
#include "externs.h"
#include
#include
#ifdef USG
struct passwd *getpwuid();
struct passwd *getpwnam();
#endif
#if defined(SYS_V) && defined(lint)
struct screen { int dumb; };
#endif
/* Fooling lint. Unfortunately, c defines all the TIO constants to be long,
and lint expects them to be int. Also, ioctl is sometimes called with just
two arguments. The following definition keeps lint happy. It may need to be
reset for different systems. */
#ifdef lint
#ifdef Pyramid
/* Pyramid makes constants greater than 65535 into long! Gakk! -CJS- */
/*ARGSUSED*/
/*VARARGS2*/
static Ioctl(i, l, p) long l; char *p; { return 0; }
#else
/*ARGSUSED*/
/*VARARGS2*/
static Ioctl(i, l, p) char *p; { return 0; }
#endif
#define ioctl Ioctl
#endif
/* Provides for a timeout on input. Does a non-blocking read, consuming the
data if any, and then returns 1 if data was read, zero otherwise.
Porting:
In systems without the select call, but with a sleep for
fractional numbers of seconds, one could sleep for the time
and then check for input.
In systems which can only sleep for whole number of seconds,
you might sleep by writing a lot of nulls to the terminal, and
waiting for them to drain, or you might hack a static
accumulation of times to wait. When the accumulation reaches a
certain point, sleep for a second. There would need to be a
way of resetting the count, with a call made for commands like
run or rest. */
int check_input(microsec)
int microsec;
{
#if defined(USG) && !defined(M_XENIX) && !defined(__linux__)
int arg, result;
#else
struct timeval tbuf;
int ch;
#if defined(BSD4_3) || defined(M_XENIX) || defined(__linux__)
fd_set smask;
#else
int smask;
#endif
#endif
/* Return true if a read on descriptor 1 will not block. */
#if !defined(USG) || defined(M_XENIX) || defined(__linux__)
tbuf.tv_sec = 0;
tbuf.tv_usec = microsec;
#if defined(BSD4_3) || defined(M_XENIX) || defined(__linux__)
FD_ZERO(&smask);
FD_SET(fileno(stdin), &smask);
if (select(1, &smask, (fd_set *)0, (fd_set *)0, &tbuf) == 1)
#else
smask = 1; /* i.e. (1 << 0) */
if (select(1, &smask, (int *)0, (int *)0, &tbuf) == 1)
#endif
{
ch = getch();
/* check for EOF errors here, select sometimes works even when EOF */
if (ch == -1)
{
eof_flag++;
return 0;
}
return 1;
}
else
return 0;
#else /* SYS V code follows */
if (microsec != 0 && (turn & 0x7F) == 0)
(void) sleep (1); /* mod 128, sleep one sec every 128 turns */
/* Can't check for input, but can do non-blocking read, so... */
/* Ugh! */
arg = 0;
arg = fcntl(0, F_GETFL, arg);
arg |= O_NDELAY;
(void) fcntl(0, F_SETFL, arg);
result = getch();
arg = 0;
arg = fcntl(0, F_GETFL, arg);
arg &= ~O_NDELAY;
(void) fcntl(0, F_SETFL, arg);
if (result == -1)
return 0;
else
return 1;
#endif
}
#if 0
/* This is not used, however, this should be compared against shell_out
in io.c */
/* A command for the operating system. Standard library function
'system' is unsafe, as it leaves various file descriptors
open. This also is very careful with signals and interrupts,
and does rudimentary job control, and puts the terminal back
in a standard mode. */
int system_cmd(p)
char *p;
{
int pgrp, pid, i, mask;
union wait w;
extern char *getenv();
mask = sigsetmask(~0); /* No interrupts. */
restore_term(); /* Terminal in original state. */
/* Are we in the control terminal group? */
if (ioctl(0, TIOCGPGRP, (char *)&pgrp) < 0 || pgrp != getpgrp(0))
pgrp = -1;
pid = fork();
if (pid < 0)
{
(void) sigsetmask(mask);
moriaterm();
return -1;
}
if (pid == 0)
{
(void) sigsetmask(0); /* Interrupts on. */
/* Transfer control terminal. */
if (pgrp >= 0)
{
i = getpid();
(void) ioctl(0, TIOCSPGRP, (char *)&i);
(void) setpgrp(i, i);
}
for(i = 2; i < 30; i++)
(void) close(i); /* Close all but standard in and out.*/
(void) dup2(1, 2); /* Make standard error as standard out. */
if (p == 0 || *p == 0)
{
p = getenv("SHELL");
if (p)
execl(p, p, 0);
execl("/bin/sh", "sh", 0);
}
else
execl("/bin/sh", "sh", "-c", p, 0);
_exit(1);
}
/* Wait for child termination. */
for(;;)
{
i = wait3(&w, WUNTRACED, (struct rusage *)0);
if (i == pid)
{
if (WIFSTOPPED(w))
{
/* Stop outselves, if child stops. */
(void) kill(getpid(), SIGSTOP);
/* Restore the control terminal, and restart subprocess. */
if (pgrp >= 0)
(void) ioctl(0, TIOCSPGRP, (char *)&pid);
(void) killpg(pid, SIGCONT);
}
else
break;
}
}
/* Get the control terminal back. */
if (pgrp >= 0)
(void) ioctl(0, TIOCSPGRP, (char *)&pgrp);
(void) sigsetmask(mask); /* Interrupts on. */
moriaterm(); /* Terminal in moria mode. */
return 0;
}
#endif
#ifndef DEBIAN_LINUX
#ifdef USG
unsigned short getuid();
#else
#ifndef SECURE
#ifdef BSD4_3
uid_t getuid();
#else /* other BSD versions */
int getuid();
#endif
#endif
#endif
#endif
/* Find a default user name from the system. */
void user_name(buf)
char *buf;
{
extern char *getlogin();
struct passwd *pwline;
register char *p;
p = getlogin();
if (p && p[0])
(void) strcpy(buf, p);
else
{
pwline = getpwuid((int)getuid());
if (pwline)
(void) strcpy(buf, pwline->pw_name);
}
if (!buf[0])
(void) strcpy(buf, "X"); /* Gotta have some name */
}
/* expands a tilde at the beginning of a file name to a users home
directory */
int tilde(file, exp)
char *file, *exp;
{
*exp = '\0';
if (file)
{
if (*file == '~')
{
char user[128];
struct passwd *pw = NULL;
int i = 0;
user[0] = '\0';
file++;
while (*file != '/' && i < sizeof(user))
user[i++] = *file++;
user[i] = '\0';
if (i == 0)
{
char *login = (char *) getlogin();
if (login != NULL)
(void) strcpy (user, login);
else if ((pw = getpwuid(getuid())) == NULL)
return 0;
}
if (pw == NULL && (pw = getpwnam(user)) == NULL)
return 0;
(void) strcpy (exp, pw->pw_dir);
}
(void) strcat(exp, file);
return 1;
}
return 0;
}
/* undefine these so that tfopen and topen will work */
#undef fopen
#undef open
/* open a file just as does fopen, but allow a leading ~ to specify a home
directory */
FILE *tfopen(file, mode)
char *file;
char *mode;
{
char buf[1024];
extern int errno;
if (tilde(file, buf))
return (fopen(buf, mode));
errno = ENOENT;
return NULL;
}
/* open a file just as does open, but expand a leading ~ into a home directory
name */
int topen(file, flags, mode)
char *file;
int flags, mode;
{
char buf[1024];
extern int errno;
if (tilde(file, buf))
return (open(buf, flags, mode));
errno = ENOENT;
return -1;
}
#endif
moria-5.6.debian.1/unix/Makefile 0000644 0001750 0001750 00000012454 10757665645 014641 0 ustar pjb pjb # Edited for Debian GNU/Linux.
DESTDIR =
# DEBIAN NOTE: This file diverges significantly from the original Makefile
# for obvious reasons. The original Makefile is Makefile.unix and should
# be used on non-Linux systems.
# BINDIR is the directory where the moria binary while be put
# LIBDIR is where the other files (score, news, hours) will be put
# LIBDIR must be the same directory defined in config.h
# Edited for Debian GNU/Linux: Next 4 lines are for the FHS
# Edited for Debian GNU/Linux: LIBDIR is retired
# Edited for Debian GNU/Linux: ETCDIR is where the hours file is kept
# Edited for Debian GNU/Linux: LIBSTATICDIR is where help files are kept
# Edited for Debian GNU/Linux: LIBVARDIR is where the score file is kept
# OWNER is who you want the game to be chown to.
# GROUP is who you wnat the game to be chgrp to.
BINDIR = $(DESTDIR)/usr/games
ETCDIR = $(DESTDIR)/etc
LIBSTATICDIR = $(DESTDIR)/usr/lib/games/moria
LIBVARDIR = $(DESTDIR)/var/games/moria
OWNER = root
GROUP = games
# For testing and debugging the program, it is best to use this line.
# CFLAGS = -g
# For playing the game, you may want to use this line
CFLAGS = -O2
# Debian GNU/Linux addition
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
CFLAGS += -g
endif
# For BSD Systems
# CURSES = -lcurses -ltermcap
# For SYS V Systems
CURSES = -lcurses
# For XENIX, some XENIX systems may need -ltinfo
# CURSES = -ltcap -ltermcap -lx
# For AIX systems, compiling in the BSD world; SYS_V must not be defined in
# config.h if you use this.
#LFLAGS = -lbsd
# Normal systems don't require anything here.
LFLAGS =
CC = cc
SRCS = main.c misc1.c misc2.c misc3.c misc4.c store1.c files.c io.c \
create.c desc.c generate.c sets.c dungeon.c creature.c death.c \
eat.c help.c magic.c potions.c prayer.c save.c staffs.c wands.c \
scrolls.c spells.c wizard.c store2.c signals.c moria1.c moria2.c \
moria3.c moria4.c monsters.c treasure.c variable.c rnd.c recall.c \
unix.c player.c tables.c
OBJS = main.o misc1.o misc2.o misc3.o misc4.o store1.o files.o io.o \
create.o desc.o generate.o sets.o dungeon.o creature.o death.o \
eat.o help.o magic.o potions.o prayer.o save.o staffs.o wands.o \
scrolls.o spells.o wizard.o store2.o signals.o moria1.o moria2.o \
moria3.o moria4.o monsters.o treasure.o variable.o rnd.o recall.o \
unix.o player.o tables.o
LIBSTATICFILES = news origcmds.hlp owizcmds.hlp roglcmds.hlp rwizcmds.hlp \
version.hlp welcome.hlp
moria : $(OBJS)
$(CC) -o moria $(CFLAGS) $(OBJS) $(CURSES) $(LFLAGS)
lintout : $(SRCS)
lint $(SRCS) $(CURSES) > lintout
lintout2 : $(SRCS)
lint -bach $(SRCS) $(CURSES) > lintout
TAGS : $(SRCS)
ctags -x $(SRCS) > TAGS
# you must define BINDIR and LIBDIR before installing
# assumes that BINDIR and LIBDIR exist
install:
chmod 755 $(BINDIR)
cp moria $(BINDIR)
chown $(OWNER) $(BINDIR)/moria
chgrp $(GROUP) $(BINDIR)/moria
chmod 2755 $(BINDIR)/moria
chmod 755 $(LIBSTATICDIR)
# No longer chmod 755 $(LIBVARDIR)
(cd files; cp $(LIBSTATICFILES) $(LIBSTATICDIR))
(cd $(LIBSTATICDIR); chmod 444 $(LIBSTATICFILES))
# No longer (cd $(LIBVARDIR); touch scores; chmod 664 scores)
# No longer (cd $(LIBVARDIR); chown $(OWNER) . scores; chgrp $(GROUP) . scores)
(cd files; cp hours $(ETCDIR)/moria-hours)
chmod 644 $(ETCDIR)/moria-hours
(cd $(LIBSTATICDIR); chown $(OWNER) $(LIBSTATICFILES))
(cd $(LIBSTATICDIR); chgrp $(GROUP) $(LIBSTATICFILES))
# If you are short on disk space, or aren't interested in debugging moria.
# This is handled by dh_strip, so let's not override its' decision.
# strip $(BINDIR)/moria
clean:
rm -r *.o
rm -f moria
create.o: constant.h types.h externs.h config.h
creature.o: constant.h types.h externs.h config.h
death.o: constant.h types.h externs.h config.h
desc.o: constant.h types.h externs.h config.h
dungeon.o: constant.h types.h externs.h config.h
eat.o: constant.h types.h externs.h config.h
files.o: constant.h types.h externs.h config.h
generate.o: constant.h types.h externs.h config.h
help.o: constant.h types.h externs.h config.h
io.o: constant.h types.h externs.h config.h
magic.o: constant.h types.h externs.h config.h
main.o: constant.h types.h externs.h config.h
misc1.o: constant.h types.h externs.h config.h
misc2.o: constant.h types.h externs.h config.h
misc3.o: constant.h types.h externs.h config.h
misc4.o: constant.h types.h externs.h config.h
monsters.o: constant.h types.h config.h
moria1.o: constant.h types.h externs.h config.h
moria2.o: constant.h types.h externs.h config.h
moria3.o: constant.h types.h externs.h config.h
moria4.o: constant.h types.h externs.h config.h
player.o: constant.h types.h config.h
potions.o: constant.h types.h externs.h config.h
prayer.o: constant.h types.h externs.h config.h
recall.o: constant.h config.h types.h externs.h
rnd.o: constant.h types.h
save.o: constant.h types.h externs.h config.h
scrolls.o: constant.h types.h externs.h config.h
sets.o: constant.h config.h
signals.o: constant.h types.h externs.h config.h
spells.o: constant.h types.h externs.h config.h
staffs.o: constant.h types.h externs.h config.h
store1.o: constant.h types.h externs.h config.h
store2.o: constant.h types.h externs.h config.h
tables.o: constant.h types.h config.h
treasure.o: constant.h types.h config.h
unix.o: constant.h config.h types.h externs.h
variable.o: constant.h types.h config.h
wands.o: constant.h types.h externs.h config.h
wizard.o: constant.h types.h externs.h config.h
moria-5.6.debian.1/ibmpc/ 0000755 0001750 0001750 00000000000 11074757452 013271 5 ustar pjb pjb moria-5.6.debian.1/ibmpc/ms_ansi.h 0000644 0001750 0001750 00000005315 11074756221 015070 0 ustar pjb pjb /* ibmpc/ms_ansi.h: ANSI definitions for MSDOS
Copyright (c) 1989-94 James E. Wilson, Don Kneller
This file is part of Umoria.
Umoria is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Umoria is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Umoria. If not, see . */
/* To allow the choice between PCcurses (which may not work on all machines)
* and ANSI (which should work on all machines), indirect the output routines
* through pointers and adjust the pointers to the correct routines at
* initialization time.
*/
#ifdef LINT_ARGS
int (*output_addch)(int);
int (*output_mvaddstr)(int, int, char *);
int (*output_mvprintw)(int, int, char *, ...);
int (*output_move)(int, int);
int (*output_endwin)(void);
int (*output_clrtobot)(void);
int (*output_clrtoeol)(void);
int (*output_mvaddch)(int, int, char);
int (*output_initscr)(void);
int (*output_refresh)(void);
int (*output_clear)(void);
int (*output_nocrmode)(void);
int (*output_crmode)(void);
int (*output_nonl)(void);
int (*output_nl)(void);
int (*output_noecho)(void);
int (*output_echo)(void);
int ansi_prep (int, int, int);
#else
extern int (*output_addch)();
extern int (*output_mvaddstr)();
extern int (*output_mvprintw)();
extern int (*output_move)();
extern int (*output_endwin)();
extern int (*output_clrtobot)();
extern int (*output_clrtoeol)();
extern int (*output_mvaddch)();
extern int (*output_initscr)();
extern int (*output_refresh)();
extern int (*output_clear)();
extern int (*output_nocrmode)();
extern int (*output_crmode)();
extern int (*output_nonl)();
extern int (*output_nl)();
extern int (*output_noecho)();
extern int (*output_echo)();
extern int ansi_prep();
#endif
extern int ansi;
#define addch (*output_addch)
#define mvaddstr (*output_mvaddstr)
#define mvprintw (*output_mvprintw)
#undef move /* from curses.h */
#define move (*output_move)
#define endwin (*output_endwin)
#define clrtobot (*output_clrtobot)
#define clrtoeol (*output_clrtoeol)
#define mvaddch (*output_mvaddch)
#define initscr (*output_initscr)
#define refresh (*output_refresh)
#define clear (*output_clear)
#define nocrmode (*output_nocrmode)
#define crmode (*output_crmode)
#define nonl (*output_nonl)
#define nl (*output_nl)
#define noecho (*output_noecho)
#define echo (*output_echo)
moria-5.6.debian.1/ibmpc/make/ 0000755 0001750 0001750 00000000000 05603152201 014164 5 ustar pjb pjb moria-5.6.debian.1/ibmpc/make/makefile.src 0000644 0001750 0001750 00000002333 05603152201 016453 0 ustar pjb pjb CFLAG = $(FLAG)
INC = \
config.h\
constant.h\
externs.h\
types.h
.c.$(OBJ):
cl -c $(CFLAG) -Fo$*.$(OBJ) $*.c > $*.$(REDIR)
..\ccthru $* $(OBJ)
create.$(OBJ): create.c $(INC)
creature.$(OBJ): creature.c $(INC)
death.$(OBJ): death.c $(INC)
desc.$(OBJ): desc.c $(INC)
dungeon.$(OBJ): dungeon.c $(INC)
eat.$(OBJ): eat.c $(INC)
files.$(OBJ): files.c $(INC)
generate.$(OBJ): generate.c $(INC)
help.$(OBJ): help.c $(INC)
io.$(OBJ): io.c $(INC)
magic.$(OBJ): magic.c $(INC)
main.$(OBJ): main.c $(INC)
misc1.$(OBJ): misc1.c $(INC)
misc2.$(OBJ): misc2.c $(INC)
monsters.$(OBJ): monsters.c $(INC)
moria1.$(OBJ): moria1.c $(INC)
moria2.$(OBJ): moria2.c $(INC)
potions.$(OBJ): potions.c $(INC)
prayer.$(OBJ): prayer.c $(INC)
recall.$(OBJ): recall.c $(INC)
rnd.$(OBJ): rnd.c $(INC)
save.$(OBJ): save.c $(INC)
scrolls.$(OBJ): scrolls.c $(INC)
sets.$(OBJ): sets.c $(INC)
signals.$(OBJ): signals.c $(INC)
spells.$(OBJ): spells.c $(INC)
staffs.$(OBJ): staffs.c $(INC)
store1.$(OBJ): store1.c $(INC)
store2.$(OBJ): store2.c $(INC)
treasure.$(OBJ): treasure.c $(INC)
undef.$(OBJ): undef.c $(INC)
variable.$(OBJ): variable.c $(INC)
wands.$(OBJ): wands.c $(INC)
wizard.$(OBJ): wizard.c $(INC)
moria-5.6.debian.1/ibmpc/make/makefile.top 0000644 0001750 0001750 00000002614 05603152201 016470 0 ustar pjb pjb MODEL = L
OP = M
REDIR = w$(OP)
OPFLAG = -DMSDOS=1 -DPC_CURSES=1 -DANSI=1
OBJ = o$(OP)
FLAG = -A$(MODEL) -Zp -W3 -Os -Gs -Gt32 -I.. $(OPFLAG)
CFLAG = $(FLAG)
LFLAG = /STACK:16383 /E $(MODEL)curses
SRC1 = \
ibmpc\ms_ansi.c\
ibmpc\ms_misc.c\
misc\flock.c\
misc\funckeys.c\
misc\nomacio.c\
source\create.c\
source\creature.c\
source\death.c\
source\desc.c\
source\dungeon.c
SRC2 = \
source\eat.c\
source\files.c\
source\generate.c\
source\help.c\
source\io.c\
source\magic.c\
source\main.c\
source\misc1.c\
source\misc2.c\
source\monsters.c
SRC3 = \
source\moria1.c\
source\moria2.c\
source\potions.c\
source\prayer.c\
source\recall.c\
source\rnd.c\
source\save.c\
source\scrolls.c\
source\sets.c\
source\signals.c
SRC4 = \
source\spells.c\
source\staffs.c\
source\store1.c\
source\store2.c\
source\treasure.c\
source\undef.c\
source\variable.c\
source\wands.c\
source\wizard.c
tags: $(SRC1) $(SRC2) $(SRC3) $(SRC4)
ctags -o sgat ibmpc\*.c misc\*.c source\*.c
sort -u sgat > tags
rm -f sgat
all:
cd ibmpc
make MODEL=$(MODEL) OP=$(OP) OBJ=$(OBJ) REDIR=$(REDIR) \
FLAG="$(FLAG)" ibmpc.mak
cd ..\misc
make MODEL=$(MODEL) OP=$(OP) OBJ=$(OBJ) REDIR=$(REDIR) \
FLAG="$(FLAG)" misc.mak
cd ..\source
make MODEL=$(MODEL) OP=$(OP) OBJ=$(OBJ) REDIR=$(REDIR) \
FLAG="$(FLAG)" source.mak
cd ..\$(OBJ)
cl $(CFLAG) -Feumoria.exe *.$(OBJ) /link $(LFLAG);
cd ..
moria-5.6.debian.1/ibmpc/make/ccthru.bat 0000644 0001750 0001750 00000000116 05603152201 016142 0 ustar pjb pjb @echo off
touch %1.%2 > nul:
copy %1.%2 ..\%2 > nul:
touch ..\%2\%1.%2 > nul:
moria-5.6.debian.1/ibmpc/make/makefile.ibm 0000644 0001750 0001750 00000000271 05603152202 016433 0 ustar pjb pjb CFLAG = $(FLAG)
INC = ms_ansi.h
.c.$(OBJ):
cl -c $(CFLAG) -Fo$*.$(OBJ) $*.c > $*.$(REDIR)
..\ccthru $* $(OBJ)
ms_ansi.$(OBJ): ms_ansi.c $(INC)
ms_misc.$(OBJ): ms_misc.c $(INC)
moria-5.6.debian.1/ibmpc/ERRORS 0000644 0001750 0001750 00000000252 05603152200 014204 0 ustar pjb pjb the two files Makefile and Makefile.XNX are obsolete, and need to be
updated
document the -DLINT_ARGS option for prototypes someplace
fix up the new makefiles in make/
moria-5.6.debian.1/ibmpc/umoria.prj 0000644 0001750 0001750 00000000415 05603152201 015260 0 ustar pjb pjb CREATE
CREATURE
DEATH
DESC
DUNGEON
EAT
FILES
GENERATE
HELP
TCIO
MAGIC
MAIN
MISC1
MISC2
MISC3
MISC4
MONSTERS
MORIA1
MORIA2
MORIA3
MORIA4
MS_MISC
PLAYER
POTIONS
PRAYER
RECALL
RND
SAVE
SCROLLS
SETS
SIGNALS
SPELLS
STAFFS
STORE1
STORE2
TABLES
TREASURE
VARIABLE
WANDS
WIZARD
moria-5.6.debian.1/ibmpc/ms_ansi.c 0000644 0001750 0001750 00000015440 11074756221 015063 0 ustar pjb pjb /* ibmpc/ms_ansi.c: a set of routines to provide either PCcurses or ANSI output
Copyright (c) 1989-94 James E. Wilson, Don Kneller
This file is part of Umoria.
Umoria is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Umoria is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Umoria. If not, see . */
#include
#include
#if defined(MSDOS) && defined(ANSI)
#ifdef LINT_ARGS
static int curses_move(int, int);
static char *getent(char *,char * *,int );
static void initansistr(void);
static int ansi_initscr(void);
static int ansi_endwin(void);
static int ansi_addch(int );
static int ansi_mvaddstr(int ,int ,char *);
static int ansi_mvprintw(int ,int ,char *,int ,int ,int ,int );
static int ansi_move(int ,int );
static int ansi_move_tgoto(int ,int );
static int ansi_clrtobot(void);
static int ansi_clrtoeol(void);
static int ansi_mvaddch(int ,int ,char );
static int ansi_clear(void);
static int ansi_refresh(void);
static int ansi_noop(void);
int ansi_prep(int ,int, int);
#else
static int ansi_addch(), ansi_mvaddstr(), ansi_mvprintw(), ansi_move(),
ansi_move_tgoto(),
ansi_clrtobot(), ansi_clrtoeol(), ansi_mvaddch(), ansi_endwin(),
ansi_refresh(), ansi_clear(), ansi_noop(), ansi_initscr();
int ansi_prep();
#endif
extern char *tgetstr();
extern char *getenv();
extern char *tgoto();
/* Must supply a functional form of the PCcurses "move" routine */
static int
curses_move(y, x)
int y, x;
{
return wmove(stdscr, y, x);
}
/* Default is for curses to be used */
int (*output_addch)() = addch;
int (*output_mvaddstr)() = mvaddstr;
int (*output_mvprintw)() = mvprintw;
int (*output_move)() = curses_move;
int (*output_endwin)() = endwin;
int (*output_clrtobot)() = clrtobot;
int (*output_clrtoeol)() = clrtoeol;
int (*output_mvaddch)() = mvaddch;
int (*output_initscr)() = initscr;
int (*output_refresh)() = refresh;
int (*output_clear)() = clear;
int (*output_nocrmode)() = nocrmode;
int (*output_crmode)() = crmode;
int (*output_nonl)() = nonl;
int (*output_nl)() = nl;
int (*output_noecho)() = noecho;
int (*output_echo)() = echo;
int ansi;
int LI;
#define LEFTFIELD -10;
#define NEED 1
static int moveopt = 1;
static char *CE, *CL, *CM, *DO, *LE, *ND, *TE, *TI, *UP;
static int currow = 0;
static int curcol = LEFTFIELD;
static char *
getent(str, tbufp, need)
char *str, **tbufp;
int need;
{
char *value;
if ((value = tgetstr(str, tbufp)) == NULL && need == NEED)
error("termcap: Moria needs %s\n", str);
return value;
}
static void
initansistr()
{
static char tbuf[512];
char temp[1024], *tbufp, *term;
if ((term = getenv("TERM")) == NULL)
term = "ibmpc-mono";
if (tgetent(temp, term) < 1)
error("Unknown terminal type: %s.", term);
tbufp = tbuf;
LE = getent("le", &tbufp, NEED);
CE = getent("ce", &tbufp, NEED);
CL = getent("cl", &tbufp, NEED);
CM = getent("cm", &tbufp, NEED);
ND = getent("nd", &tbufp, NEED);
TE = getent("te", &tbufp, !NEED);
TI = getent("ti", &tbufp, !NEED);
UP = getent("up", &tbufp, NEED);
DO = getent("do", &tbufp, NEED);
LI = tgetnum("li");
if (LI <= 0)
LI = 24;
}
ansi_prep(check_ansi, domoveopt, truetgoto)
int check_ansi;
int domoveopt;
int truetgoto;
{
moveopt = domoveopt;
/* Check for ANSI.SYS */
if (check_ansi) {
/* Clear the input queue */
while (kbhit())
(void) getch();
/* Send out the DSR string */
fputs("\033[6n", stdout);
fflush(stdout);
/* Is there anything in the input? If so ANSI responded. */
if (kbhit()) {
while (kbhit())
(void) getch();
}
else {
putchar('\n');
error("ANSI.SYS not installed! See MORIA.DOC for details!\n");
}
}
/* get the ANSI strings */
initansistr();
/* change function pointers to ANSI versions */
output_addch = ansi_addch;
output_mvaddstr = ansi_mvaddstr;
output_mvprintw = ansi_mvprintw;
if (truetgoto)
output_move = ansi_move_tgoto;
else
output_move = ansi_move;
output_clrtobot = ansi_clrtobot;
output_clrtoeol = ansi_clrtoeol;
output_mvaddch = ansi_mvaddch;
output_refresh = ansi_refresh;
output_clear = ansi_clear;
output_initscr = ansi_initscr;
output_endwin = ansi_endwin;
output_nocrmode =
output_crmode =
output_nonl =
output_nl =
output_noecho =
output_echo = ansi_noop;
ansi = 1;
}
static int
ansi_initscr()
{
if (TI != NULL)
fputs(TI, stdout);
return OK;
}
static int
ansi_endwin()
{
if (TI != NULL)
fputs(TE, stdout);
return OK;
}
static int
ansi_addch(ch)
int ch;
{
putc(ch, stdout);
curcol++;
return OK;
}
static int
ansi_mvaddstr(row, col, str)
int row, col;
char *str;
{
(void) ansi_move(row, col);
fputs(str, stdout);
curcol = LEFTFIELD;
return OK;
}
static int
ansi_mvprintw(row, col, fmt, a1, a2, a3, a4)
int row, col;
char *fmt;
int a1, a2, a3, a4; /* large enough for %c%s%c of files.c ! */
{
(void) ansi_move(row, col);
fprintf(stdout, fmt, a1, a2, a3, a4);
curcol = LEFTFIELD;
return OK;
}
#define abs(x) ((x) < 0 ? -(x) : (x))
/* For a bit more speed, don't use tgoto() from termcap */
static int
ansi_move(row, col)
int row, col;
{
if (moveopt && abs(currow - row) < 3 && abs(curcol - col) < 3) {
while (row > currow)
fputs(DO, stdout), currow++;
while (row < currow)
fputs(UP, stdout), currow--;
while (col > curcol)
fputs(ND, stdout), curcol++;
while (col < curcol)
fputs(LE, stdout), curcol--;
}
else
fprintf(stdout, "\033[%d;%dH\0__cursor motion__", row+1,col+1);
currow = row;
curcol = col;
return OK;
}
/* Use tgoto (which is rather slow) */
static int
ansi_move_tgoto(row, col)
int row, col;
{
if (moveopt && abs(currow - row) < 3 && abs(curcol - col) < 3) {
while (row > currow)
fputs(DO, stdout), currow++;
while (row < currow)
fputs(UP, stdout), currow--;
while (col > curcol)
fputs(ND, stdout), curcol++;
while (col < curcol)
fputs(LE, stdout), curcol--;
}
else {
fputs(tgoto(CM, col, row), stdout);
}
currow = row;
curcol = col;
return OK;
}
static int
ansi_clrtobot()
{
ansi_clrtoeol();
ansi_move(++currow, 0);
ansi_clrtoeol();
for (; currow <= LI; currow++) {
fputs(DO, stdout);
ansi_clrtoeol();
}
curcol = LEFTFIELD;
return OK;
}
static int
ansi_clrtoeol()
{
fputs(CE, stdout);
return OK;
}
static int
ansi_mvaddch(row, col, ch)
int row, col;
char ch;
{
ansi_move(row, col);
putchar(ch);
curcol++;
return OK;
}
static int
ansi_clear()
{
fputs(CL, stdout);
return OK;
}
static int
ansi_refresh()
{
fflush(stdout);
return OK;
}
static int
ansi_noop()
{
return OK;
}
#endif
moria-5.6.debian.1/ibmpc/Makefile.tc 0000644 0001750 0001750 00000001226 05613576550 015337 0 ustar pjb pjb FLAGS = -1 -c -w-
DEFS = -DUSG -DMSDOS
CC = \tc\bin\tcc
PROGRAM = moria.exe
LINKER = \tc\bin\tlink
OBJS = create.obj creature.obj death.obj desc.obj dungeon.obj \
eat.obj files.obj generate.obj help.obj io.obj rnd.obj \
magic.obj main.obj misc1.obj misc2.obj misc3.obj misc4.obj \
monsters.obj moria1.obj moria2.obj moria3.obj moria4.obj \
ms_ansi.obj ms_misc.obj player.obj potions.obj \
prayer.obj save.obj scrolls.obj sets.obj signals.obj \
spells.obj staffs.obj store1.obj store2.obj treasure.obj \
variable.obj wands.obj wizard.obj
.c.obj:
$(CC) $(FLAGS) $(DEFS) $*.c
$(PROGRAM): $(OBJS)
$(LINKER) $(OBJS), $(PROGRAM),,
moria-5.6.debian.1/ibmpc/README 0000644 0001750 0001750 00000003364 05603152200 014134 0 ustar pjb pjb
To compile this program, you need a copy of PC-Curses, a screen management
package. Sources for this are distributed separately, since most people
who need it already have a copy.
Or, if you have Turbo C, you can use the tcio.c file instead of PC-Curses.
*************************
CONFIG.DOC
The MSDOS specific documentation file that came with PC-Moria 4.873.
Much of this is out-of-date, and needs to be updated. The section
describing the MORIA.CNF configuration file is still useful.
MAKE.BAT, MLINK.LNK
If you have MSC, you can compile the Umoria by executing this
MAKE.BAT commands files, which uses MLINK.LNK to specify all of the
files to be linked together to form the executable.
MORIA.CNF
A sample configuration file for the MSDOS version of umoria 5.x.
Makefile, Makefile.XNX
Obsolete Makefiles that were used for PC-Moria 4.873. May still be
useful as a reference though for those who want to write their own
Makefiles.
TERMCAP
A sample TERMCAP file which can be used by PC-Curses.
make
A directory containing 3 makefiles for MSC. Put the makefile.top
file in the top directory (which contains the CHANGES file), put
the makefile.src file in the source directory, and put the makefile.ibm
in this directory. Note that each file must be renamed to makefile
when it is moved. You can then build moria by running the MSC Make
program in the top directory.
ms_ansi.c, ms_ansi.h, ms_misc.c
MSDOS specific source files for umoria 5.x.
tcio.c
For TC, this is an alternative io.c file. If you use this file
instead of source/io.c, then you don't need PC-Curses. This should
result in a smaller, faster program.
turbo_c.inf
Some hints on compiling Umoria with TC.
umoria.prj
A project file to be used when compiling Umoria with TC.
moria-5.6.debian.1/ibmpc/tcio.c 0000644 0001750 0001750 00000021435 05613576551 014401 0 ustar pjb pjb /* ibmpc/tcio.c: terminal I/O code for Turbo C
Copyright (c) 1989-94 James E. Wilson, Eric Vaitl
This software may be copied and distributed for educational, research, and
not for profit purposes provided that this copyright and statement are
included in all such copies. */
/* This I/O module doesn't need PCcurses. You may also need to make some
changes to ms_misc.c; in particular, you need to comment out the #include
of curses.h. */
#include /* malloc() */
#include
#include
#include /* getenv() */
#include /* putch */
#include /* spawnl() */
#include /* window(), gotoxy() */
#ifdef __TURBOC__
#include
#endif /* __TURBOC__ */
#include "config.h"
#include "constant.h"
#include "types.h"
#include "externs.h"
#define MSG_LEN 73
#define LINES 25
#define COLS 80
static void *savescr; /* pointer to a saved screen */
void init_curses(void){
if((savescr=malloc(LINES*COLS*2))==NULL){
puts("Out of memory in init_curses()");
exit(1);
}
clrscr();
msdos_raw();
}
int get_string(char *in_str,int row,int column,int slen)
{
register int start_col, end_col, i;
char *p;
int flag, aborted;
aborted = FALSE;
flag = FALSE;
gotoxy(column+1,row+1);
for (i = slen; i > 0; i--)
putch(' ');
gotoxy(column+1,row+1);
start_col = column;
end_col = column + slen - 1;
if (end_col > 79)
{
slen = 80 - column;
end_col = 79;
}
p = in_str;
do
{
i = inkey();
switch(i)
{
case ESCAPE:
aborted = TRUE;
break;
case CTRL('J'): case CTRL('M'):
flag = TRUE;
break;
case DELETE: case CTRL('H'):
if (column > start_col)
{
column--;
put_buffer(" ", row, column);
move_cursor(row, column);
*--p = '\0';
}
break;
default:
if (!isprint(i) || column > end_col)
bell();
else
{
gotoxy(column+1,row+1);
putch((char) i);
*p++ = i;
column++;
}
break;
}
}
while ((!flag) && (!aborted));
if (aborted)
return(FALSE);
/* Remove trailing blanks */
while (p > in_str && p[-1] == ' ')
p--;
*p = '\0';
return(TRUE);
}
void put_buffer(char *out_str,int row,int col){
vtype tmp_str;
if (col>79) col=79;
strncpy(tmp_str,out_str,79-col);
tmp_str[79-col]='\0';
gotoxy(col+1,row+1);
cputs(tmp_str);
}
void put_qio(void){
/* nothing to do */
}
void restore_term(void){
fflush(stdout);
clear_screen();
msdos_noraw();
}
void shell_out(void){
char *comspec;
#ifndef __TURBOC__
char key;
int val;
char *str;
#endif /* __TURBOC__ */
save_screen();
clear_screen();
puts("[Entering DOS shell, type exit to return to game.]");
msdos_noraw();
ignore_signals();
if((comspec=getenv("COMSPEC")) ==NULL ||
spawnl(P_WAIT,comspec,comspec,(char *)NULL)<0){
puts("Sorry, there seems to be a problem with shell_out()");
printf("comspec = %s\n",comspec);
flush();
puts("Hit a key to continue");
while(!kbhit())
;
}
restore_signals();
restore_screen();
}
void save_screen(void){
gettext(1,1,COLS,LINES,savescr);
}
void restore_screen(void){
puttext(1,1,COLS,LINES,savescr);
}
void clear_screen(void){
window(1,1,COLS,LINES);
/*
I think later I might want to define seperate windows, so the above line
is definsive code.
*/
clrscr();
}
void clear_from(int row){
window(1,row+1,COLS,LINES);
clrscr();
window(1,1,COLS,LINES);
}
void flush(void){
while(kbhit())
getch();
}
void erase_line(int row, int col){
if(row==MSG_LINE&&msg_flag)
msg_print(NULL);
gotoxy(col+1,row+1);
clreol();
}
char inkey(void){
int i;
command_count=0;
while(TRUE){
i=msdos_getch();
if(i==EOF){
eof_flag++;
msg_flag=FALSE;
if(!character_generated||character_saved) exit_game();
disturb(1,0);
if(eof_flag>100){
panic_save=1;
strcpy(died_from,"(end of input: panic saved)");
if(!save_char()){
strcpy(died_from,"panic: unexpected eof");
death=TRUE;
}
exit_game();
}
return ESCAPE;
}
if(i!=CTRL('R'))
return (char) i;
msdos_raw();
break;
}
return (CTRL('R'));
}
void print(char ch, int row, int col){
row -= panel_row_prt;
col-=panel_col_prt;
gotoxy(col+1,row+1);
putchar((int)ch);
}
void move_cursor_relative(int row, int col){
row-=panel_row_prt;
col-=panel_col_prt;
gotoxy(col+1,row+1);
}
void count_msg_print(char *p){
int i;
i=command_count;
msg_print(p);
command_count=i;
}
void prt(char* str_buff,int row, int col){
if (row==MSG_LINE&&msg_flag)
msg_print(NULL);
gotoxy(col+1,row+1);
clreol();
put_buffer(str_buff,row,col);
}
void move_cursor(int row,int col){
gotoxy(col+1,row+1);
}
void msg_print(char* str_buff){
register int old_len;
char in_char;
if(msg_flag){
old_len=strlen(old_msg[last_msg])+1;
if (old_len>MSG_LEN)
old_len=MSG_LEN;
put_buffer("-more-",MSG_LINE, old_len);
wait_for_more=1;
do{
in_char=inkey();
}while((in_char!=' ')&&(in_char!=ESCAPE)&&(in_char!='\n')&&
(in_char!='\r'));
wait_for_more=0;
}
gotoxy(1,MSG_LINE+1);
clreol();
if(str_buff){
put_buffer(str_buff,MSG_LINE,0);
command_count=0;
if(++last_msg>=MAX_SAVE_MSG) last_msg=0;
strncpy(old_msg[last_msg],str_buff,VTYPESIZ);
old_msg[last_msg][VTYPESIZ-1]='\0';
msg_flag=TRUE;
}else
msg_flag=FALSE;
}
int get_check(char*prompt){
int res;
prt(prompt,0,0);
if(wherex()>MSG_LEN +1) gotoxy(74,1);
cputs(" [y/n]");
do{
res=inkey();
}while(res==' ');
erase_line(0,0);
if(res=='Y'||res=='y')
return(TRUE);
else
return(FALSE);
}
int get_com(char *prompt,char *command){
int res;
if(prompt)
prt(prompt,0,0);
*command=inkey();
if(*command==ESCAPE)
res=FALSE;
else
res=TRUE;
erase_line(MSG_LINE,0);
return(res);
}
void bell(void){
if (! sound_beep_flag)
return;
putchar('\007');
}
/* the rest is just modified -ev- */
/* definitions used by screen_map() */
/* index into border character array */
#define TL 0 /* top left */
#define TR 1
#define BL 2
#define BR 3
#define HE 4 /* horizontal edge */
#define VE 5
/* character set to use */
# define CH(x) (screen_border[1][x])
/* Display highest priority object in the RATIO by RATIO area */
#define RATIO 3
void screen_map()
{
register int i, j;
static int8u screen_border[2][6] = {
{'+', '+', '+', '+', '-', '|'}, /* normal chars */
{201, 187, 200, 188, 205, 186} /* graphics chars */
};
int8u map[MAX_WIDTH / RATIO + 1];
int8u tmp;
int priority[256];
int row, orow, col, myrow, mycol = 0;
char prntscrnbuf[80];
for (i = 0; i < 256; i++)
priority[i] = 0;
priority['<'] = 5;
priority['>'] = 5;
priority['@'] = 10;
priority[wallsym] = -5;
priority[floorsym] = -10;
priority['\''] = -3;
priority[' '] = -15;
save_screen();
clear_screen();
gotoxy(1,1);
putch(CH(TL));
for (i = 0; i < MAX_WIDTH / RATIO; i++)
putch(CH(HE));
putch(CH(TR));
orow = -1;
map[MAX_WIDTH / RATIO] = '\0';
for (i = 0; i < MAX_HEIGHT; i++)
{
row = i / RATIO;
if (row != orow)
{
if (orow >= 0)
{
sprintf(prntscrnbuf,"%c%s%c",CH(VE), map, CH(VE));
gotoxy(1,orow+2);
cputs(prntscrnbuf);
}
for (j = 0; j < MAX_WIDTH / RATIO; j++)
map[j] = ' ';
orow = row;
}
for (j = 0; j < MAX_WIDTH; j++)
{
col = j / RATIO;
tmp = loc_symbol(i, j);
if (priority[map[col]] < priority[tmp])
map[col] = tmp;
if (map[col] == '@')
{
mycol = col + 1; /* account for border */
myrow = row + 1;
}
}
}
if (orow >= 0)
{
sprintf(prntscrnbuf,"%c%s%c",CH(VE), map, CH(VE));
gotoxy(1,orow+2);
cputs(prntscrnbuf);
}
gotoxy(1,orow+3);
putch(CH(BL));
for (i = 0; i < MAX_WIDTH / RATIO; i++)
putch(CH(HE));
putch(CH(BR));
gotoxy(24,24);
cputs("Hit any key to continue");
if (mycol > 0)
gotoxy(mycol+1, myrow+1);
inkey();
restore_screen();
}
void pause_exit(int prt_line, int delay)
{
char dummy;
#ifdef __TURBOC__
/* Otherwise, TURBO C complains that delay is never used. */
dummy = (char) delay;
#endif
prt("[Press any key to continue, or Q to exit.]", prt_line, 10);
dummy = inkey();
if (dummy == 'Q')
{
erase_line(prt_line, 0);
exit_game();
}
erase_line(prt_line, 0);
}
void pause_line(int prt_line)
{
prt("[Press any key to continue.]", prt_line, 23);
(void) inkey();
erase_line(prt_line, 0);
}
moria-5.6.debian.1/ibmpc/turbo_c.inf 0000644 0001750 0001750 00000001647 05613605103 015417 0 ustar pjb pjb
Compiler Stats :
TurboC on Compaq 386sx w/ 1Meg memory & 20Meg HD
C calling convention
80286 code generation
HUGE model used
optimized for size
Compiler Defines : MSDOS;DEBUG
When compiling PC-Curses, make sure the .obj code is the same model as the
source code for Umoria. Also, a size modifier letter must start the name
of the .lib file (HCURSES.LIB for instance).
Note that reset_term() is commented out in death.c and io.c. This is
because calling this function causes moria to die horribly when moria is
compiled by Turbo C. I do know what the problem is, so, for now, reset_term()
is never called for the Turbo C version.
The file tcio.c is an untested file meant to replace the source/io.c file.
If you use tcio.c instead of source/io.c, you do not need PC-Curses.
The result is a program a bit smaller, and perhaps a bit faster. You
will also need to comment out the #include at the beginning
of ms_ansi.c.
moria-5.6.debian.1/ibmpc/TERMCAP 0000644 0001750 0001750 00000002471 05603152200 014270 0 ustar pjb pjb # Termcap file for PC MORIA. This file will only be necessary if you
# are using the "ANSI" option in MORIA.CNF (see README for details).
# For PCs, ATs and clones, there is no reason to use the "ANSI" option
# and this file can be safely discarded. For DEC Rainbow users, this
# file is required. It must be either in the current directory, in
# directory \ETC, or somewhere on the PATH for MORIA to find it
#
# Monochrome IBMPC.
# This is a termcap for the NANSI.SYS device driver.
# It is the same as the ANSI termcap, except NANSI supports
# line insert (al) and delete (dl) while ANSI does not.
#
ibmpc-mono:\
:co#80:\
:li#24:\
:cl=\E[2J:\
:bs:\
:ho=\E[H:\
:cm=\E[%i%2;%2H:\
:up=\E[A:\
:do=\E[B:\
:nd=\E[C:\
:le=\E[D:\
:ce=\E[K:\
:ti=\E[m:\
:te=\E[m:\
:so=\E[1m:\
:se=\E[m:\
:us=\E[1m:\
:ue=\E[m:\
:al=\E[L:\
:dl=\E[M:
#
# Color IBMPC.
# This is a termcap for the NANSI.SYS device driver.
# It is the same as the ANSI termcap, except NANSI supports
# line insert (al) and delete (dl) while ANSI does not.
#
# Gratiously supplied by Darren Friedlein.
#
ibmpc-color:\
:co#80:\
:li#24:\
:cl=\E[2J:\
:bs:\
:ho=\E[H:\
:cm=\E[%i%2;%2H:\
:up=\E[A:\
:do=\E[B:\
:nd=\E[C:\
:le=\E[D:\
:ce=\E[K:\
:ti=\E[44;37m\E1m:\
:te=\E[0m:\
:so=\E[31m:\
:se=\E[37m:\
:us=\E[33m:\
:ue=\E[37m:\
:al=\E[L:\
:dl=\E[M:
moria-5.6.debian.1/ibmpc/ms_misc.c 0000644 0001750 0001750 00000026775 11074756221 015101 0 ustar pjb pjb /* ibmpc/ms_misc.c: MSDOS support code
Copyright (c) 1989-94 James E. Wilson, Don Kneller
This file is part of Umoria.
Umoria is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Umoria is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Umoria. If not, see . */
#ifdef __TURBOC__
#include
#endif /* __TURBOC__ */
#include
#include
#include
#include
#include
#include "config.h"
#include "constant.h"
#include "types.h"
#include "externs.h"
#ifdef MSDOS
#ifndef USING_TCIO
/* We don't want to include curses.h when using the tcio.c file. */
#include
#endif
#ifdef ANSI
#include "ms_ansi.h"
#endif
#ifdef LINT_ARGS
void exit(int);
static FILE *fopenp(char *, char *, char *);
static unsigned int ioctl(int ,int ,unsigned int );
#else
void exit();
static unsigned int ioctl();
#endif
extern char *getenv();
#define PATHLEN 80
char moriatop[PATHLEN];
char moriasav[PATHLEN];
int saveprompt = TRUE;
int ibmbios;
static int rawio;
int8u floorsym = '.';
int8u wallsym = '#';
/* UNIX compatability routines */
void user_name(buf)
char *buf;
{
strcpy(buf, getlogin());
}
char *
getlogin()
{
char *cp;
if ((cp = getenv("USER")) == NULL)
cp = "player";
return cp;
}
#ifndef __TURBOC__
unsigned int
sleep(secs)
int secs;
{
time_t finish_time;
finish_time = time((long *) NULL) + secs;
while (time((long *) NULL) < finish_time)
/* nothing */;
return 0;
}
#endif
#ifdef OLD
/* This is the old code. It is not strictly correct; it is retained in
case the correct code below is not portable. You will also have to
change the declarations for these functions in externs.h. */
void
error(fmt, a1, a2, a3, a4)
char *fmt;
int a1, a2, a3, a4;
{
fprintf(stderr, "MORIA error: ");
fprintf(stderr, fmt, a1, a2, a3, a4);
(void) sleep(2);
exit(1);
}
void
warn(fmt, a1, a2, a3, a4)
char *fmt;
int a1, a2, a3, a4;
{
fprintf(stderr, "MORIA warning: ");
fprintf(stderr, fmt, a1, a2, a3, a4);
(void) sleep(2);
}
#else
#include
void
error (char *fmt, ...)
{
va_list p_arg;
va_start (p_arg, fmt);
fprintf (stderr, "Moria error: ");
vfprintf (stderr, fmt, p_arg);
sleep (2);
exit (1);
}
void
warn(char *fmt, ...)
{
va_list p_arg;
va_start(p_arg, fmt);
fprintf(stderr, "MORIA warning: ");
vfprintf(stderr, fmt, p_arg);
sleep(2);
}
#endif
/* Search the path for a file of name "name". The directory is
* filled in with the directory part of the path.
*/
static FILE *
fopenp(name, mode, directory)
char *name, *mode, directory[];
{
char *dp, *pathp, *getenv(), lastch;
FILE *fp;
/* Try the default directory first. If the file can't be opened,
* start looking along the path.
*/
fp = fopen (name, mode);
if (fp) {
directory[0] = '\0';
return fp;
}
pathp = getenv("PATH");
while (pathp && *pathp) {
dp = directory;
while (*pathp && *pathp != ';')
lastch = *dp++ = *pathp++;
if (lastch != '\\' && lastch != '/' && lastch != ':')
*dp++ = '\\';
(void) strcpy(dp, name);
fp = fopen (directory, mode);
if (fp) {
*dp = '\0';
return fp;
}
if (*pathp)
pathp++;
}
directory[0] = '\0';
return NULL;
}
/* Read the configuration.
*/
void
msdos_init()
{
char buf[BUFSIZ], *bp, opt[PATHLEN];
int arg1, arg2, cnt;
FILE *fp;
buf[0] = '\0';
bp = MORIA_CNF_NAME;
fp = fopenp(bp, "r", buf);
(void) strcpy(moriatop, buf);
(void) strcat(moriatop, MORIA_TOP_NAME);
(void) strcpy(moriasav, buf);
(void) strcat(moriasav, MORIA_SAV_NAME);
if (fp == NULL) {
warn("Can't find configuration file `%s'\n", bp);
return;
}
printf("Reading configuration from %s%s\n", buf, bp);
(void) sleep(1);
while (fgets(buf, sizeof buf, fp)) {
if (*buf == '#')
continue;
cnt = sscanf(buf, "%s", opt);
/* Turbo C will return EOF when reading an empty line,
MSC will correctly read a NULL character */
if (cnt == 0 ||
#ifdef __TURBOC__
cnt == EOF ||
#endif
opt[0] == '\0')
continue;
/* Go through possible variables
*/
if (strcmpi(opt, "GRAPHICS") == 0) {
cnt = sscanf(buf, "%*s%d %d\n", &arg1, &arg2);
if (cnt != 2)
warn("GRAPHICS did not contain 2 values\n");
else {
wallsym = (int8u) arg1;
floorsym = (int8u) arg2;
/* Adjust lists that depend on '#' and '.' */
object_list[OBJ_SECRET_DOOR].tchar = wallsym;
}
}
else if (strcmpi(opt, "SAVE") == 0) {
cnt = sscanf(buf, "%*s%s", opt);
if (cnt == 0)
warn("SAVE option requires a filename\n");
else {
bp = strchr (opt, ';');
if (bp) {
*bp++ = '\0';
if (*bp == 'n' || *bp == 'N')
saveprompt = FALSE;
}
if (opt[0])
(void) strcpy(moriasav, opt);
}
}
else if (strcmpi(opt, "SCORE") == 0) {
cnt = sscanf(buf, "%*s%s", opt);
if (cnt == 0)
warn("SCORE option requires a filename\n");
else
(void) strcpy(moriatop, opt);
}
else if (strcmpi(opt, "KEYBOARD") == 0) {
cnt = sscanf(buf, "%*s%s", opt);
if (cnt == 0)
warn("KEYBOARD option requires a value\n");
else if (strcmpi(opt, "ROGUE") == 0)
rogue_like_commands = TRUE;
else if (strcmpi(opt, "VMS") == 0)
rogue_like_commands = FALSE;
}
else if (strcmpi(opt, "IBMBIOS") == 0)
ibmbios = TRUE;
else if (strcmpi(opt, "RAWIO") == 0)
rawio = TRUE;
#ifdef ANSI
/* Usage: ANSI [ check_ansi [ domoveopt [ tgoto ] ] ]
* where check_ansi and domoveopt are "Y"es unless explicitly
* set to "N"o. Tgoto is "N"o unless set to "Y"es.
*/
else if (strcmpi(opt, "ANSI") == 0) {
cnt=sscanf(buf, "%*s%1s%1s%1s",&opt[0],&opt[1],&opt[2]);
ansi_prep(cnt < 1 || opt[0] == 'y' || opt[0] == 'Y',
cnt < 2 || opt[1] == 'y' || opt[1] == 'Y',
cnt >= 3 && (opt[2] == 'y' || opt[2] == 'Y'));
}
#endif
else
warn("Unknown configuration line: `%s'\n", buf);
}
fclose(fp);
/* The only text file has been read. Switch to binary mode */
}
#include
#define DEVICE 0x80
#define RAW 0x20
#define IOCTL 0x44
#define STDIN fileno(stdin)
#define STDOUT fileno(stdout)
#define GETBITS 0
#define SETBITS 1
static unsigned old_stdin, old_stdout, ioctl();
void
msdos_raw() {
if (!rawio)
return;
old_stdin = ioctl(STDIN, GETBITS, 0);
old_stdout = ioctl(STDOUT, GETBITS, 0);
if (old_stdin & DEVICE)
ioctl(STDIN, SETBITS, old_stdin | RAW);
if (old_stdout & DEVICE)
ioctl(STDOUT, SETBITS, old_stdout | RAW);
}
void
msdos_noraw() {
if (!rawio)
return;
if (old_stdin)
(void) ioctl(STDIN, SETBITS, old_stdin);
if (old_stdout)
(void) ioctl(STDOUT, SETBITS, old_stdout);
}
static unsigned int
ioctl(handle, mode, setvalue)
unsigned int setvalue;
{
union REGS regs;
regs.h.ah = IOCTL;
regs.h.al = (unsigned char) mode;
regs.x.bx = handle;
regs.h.dl = (unsigned char) setvalue;
regs.h.dh = 0; /* Zero out dh */
intdos(®s, ®s);
return (regs.x.dx);
}
/* Normal characters are output when the shift key is not pushed.
* Shift characters are output when either shift key is pushed.
*/
#define KEYPADHI 83
#define KEYPADLOW 71
#define ISKEYPAD(x) (KEYPADLOW <= (x) && (x) <= KEYPADHI)
#undef CTRL
#define CTRL(x) (x - '@')
typedef struct {
char normal, shift, numlock;
} KEY;
static KEY roguekeypad[KEYPADHI - KEYPADLOW + 1] = {
{'y', 'Y', CTRL('Y')}, /* 7 */
{'k', 'K', CTRL('K')}, /* 8 */
{'u', 'U', CTRL('U')}, /* 9 */
{'.', '.', '.'}, /* - */
{'h', 'H', CTRL('H')}, /* 4 */
{'.', '.', '.'}, /* 5 */
{'l', 'L', CTRL('L')}, /* 6 */
{CTRL('P'), CTRL('P'), CTRL('P')}, /* + */
{'b', 'B', CTRL('B')}, /* 1 */
{'j', 'J', CTRL('J')}, /* 2 */
{'n', 'N', CTRL('N')}, /* 3 */
{'i', 'i', 'i'}, /* Ins */
{'.', '.', '.'} /* Del */
};
static KEY originalkeypad[KEYPADHI - KEYPADLOW + 1] = {
{'7', '7', '7'}, /* 7 */
{'8', '8', '8'}, /* 8 */
{'9', '9', '9'}, /* 9 */
{'-', '-', '-'}, /* - */
{'4', '4', '4'}, /* 4 */
{'5', '5', '5'}, /* 5 - move */
{'6', '6', '6'}, /* 6 */
{CTRL('M'), CTRL('M'), CTRL('M')}, /* + */
{'1', '1', '1'}, /* 1 */
{'2', '2', '2'}, /* 2 */
{'3', '3', '3'}, /* 3 */
{'i', 'i', 'i'}, /* Ins */
{'.', '.', '.'} /* Del */
};
/* bios_getch gets keys directly with a BIOS call.
*/
#define SHIFT (0x1 | 0x2)
#define NUMLOCK 0x20
#define KEYBRD_BIOS 0x16
int
bios_getch()
{
unsigned char scan, shift;
int ch;
KEY *kp;
union REGS regs;
if (rogue_like_commands)
kp = roguekeypad;
else
kp = originalkeypad;
/* Get scan code.
*/
regs.h.ah = 0;
int86(KEYBRD_BIOS, ®s, ®s);
ch = regs.h.al;
scan = regs.h.ah;
/* Get shift status.
*/
regs.h.ah = 2;
int86(KEYBRD_BIOS, ®s, ®s);
shift = regs.h.al;
/* If scan code is for the keypad, translate it.
*/
if (ISKEYPAD(scan)) {
if (shift & NUMLOCK)
ch = kp[scan - KEYPADLOW].numlock;
else if (shift & SHIFT)
ch = kp[scan - KEYPADLOW].shift;
else
ch = kp[scan - KEYPADLOW].normal;
}
return ch;
}
int
msdos_getch()
{
int ch;
if (ibmbios)
ch = bios_getch();
else {
ch = getch();
if (ch == 0)
ch = getch();
}
return ch;
}
#if 0
/* This intro message deleted because it is obsolete. */
/* Hardcode the introductory message in */
void
msdos_intro()
{
char buf[80];
clear_screen();
wmove(stdscr,0,0);
waddstr(stdscr," *********************");
wmove(stdscr,1,0);
sprintf(buf," ** Moria %d.%d **",
CUR_VERSION_MAJ, CUR_VERSION_MIN);
waddstr(stdscr,buf);
wmove(stdscr,2,0);
waddstr(stdscr," *********************");
wmove(stdscr,3,0);
waddstr(stdscr," COPYRIGHT (c) Robert Alan Koeneke");
wmove(stdscr,5,0);
waddstr(stdscr,"Programmers : Robert Alan Koeneke / University of Oklahoma");
wmove(stdscr,6,0);
waddstr(stdscr," Jimmey Wayne Todd / University of Oklahoma");
wmove(stdscr,8,0);
waddstr(stdscr,"UNIX Port : James E. Wilson / Cygnus Support");
wmove(stdscr,10,0);
waddstr(stdscr,"MSDOS Port : Don Kneller / 1349 - 10th ave");
wmove(stdscr,11,0);
waddstr(stdscr,
" / San Francisco, CA 94122");
wmove(stdscr,12,0);
waddstr(stdscr," / Dec 12, 1988");
pause_line(23);
}
#endif
#ifdef PC_CURSES
/* Seems to be a bug in PCcurses whereby it won't really clear the screen
* if there are characters there it doesn't know about.
*/
#define VIDEOINT 0x10
void
bios_clear()
{
union REGS regs;
unsigned char nocols, activepage;
#ifdef ANSI
if (ansi)
return;
#endif
/* get video attributes */
regs.h.ah = 15;
int86(VIDEOINT, ®s, ®s);
nocols = regs.h.ah;
activepage = regs.h.bh;
/* Move to lower right corner */
regs.h.ah = 2;
regs.h.dh = (unsigned char) 24;
regs.h.dl = nocols - 1; /* lower right col */
regs.h.bh = activepage;
int86(VIDEOINT, ®s, ®s);
/* get current attribute into bh */
regs.h.ah = 8;
regs.h.bh = activepage;
int86(VIDEOINT, ®s, ®s);
regs.h.bh = regs.h.ah;
regs.h.cl = 0; /* upper left row */
regs.h.ch = 0; /* upper left col */
regs.h.dh = (unsigned char) 24; /* lower right row */
regs.h.dl = nocols - 1; /* lower right col */
regs.h.al = 0; /* clear window */
regs.h.ah = 7; /* scroll down */
int86(VIDEOINT, ®s, ®s);
}
#endif
#endif
moria-5.6.debian.1/ibmpc/TCCONFIG.TCU 0000644 0001750 0001750 00000004542 05603152202 015026 0 ustar pjb pjb A uuencoded copy of a TCCONFIG.TCU file.
begin 640 TCCONFIG.TC
M5'5R8F\@0R!#;VYF:6=U0 ! %Z $ 7L 0 ? ! %] $
M 7X 0 ?P ! & $ 8( 0 A ! "% $ <@ 0 !R0 ! #* $
M LL 0 S ! #- $ ,X 0 !SP ! #0 $ &=$ 0!DT@ ! "#5 $
M -< 0 V ! #9 $ =H 0 !VP ! #< $ -T 0 !W@ ! '? $
M . 0 X0 ! #B $ 2P!1 N
M "T!
M@ !$.EQ455)"3UQ#7$E.0TQ51$4
M
M "X!@ !$
M.EQ455)"3UQ#7$Q)0@
M
M "\!4 !534]2
M24$N4%)*
M # !! S,@ ,0$% #(U
M ,@$% #$P, ,P%_ $U31$]3
M
M
M T 1X *@ -0$>
M "H #8!'@ J
M W 1X *@
M . $> "H #D!
M'@ J Z 1X *@
M .P$> "H
M #P!'@ J ]
M 8
M
M ^ 00
M- #\!4 !40U!)0TLN5$,
M $ !
M1 !$.EQ455)"3UQ#7$))3@
M $$!4
M
9 /__ @ :
end
moria-5.6.debian.1/ibmpc/CONFIG.DOC 0000644 0001750 0001750 00000024655 11074753120 014565 0 ustar pjb pjb
The Dungeons of MORIA version 5.x
COPYRIGHT (c) Robert Alan Koeneke
MSDOS port, v4.873, by D. G. Kneller
Nov 1, 1988
Updated for Umoria 5.x by James E. Wilson
Mar 24, 1991
Table of contents
1. USAGE ............................................................. 1
2. REQUIREMENTS ...................................................... 1
3. INSTALLATION ...................................................... 1
3.1. Hard drive systems .............................................. 1
3.2. High-density floppy systems ..................................... 2
3.3. 2 - 360K floppy systems ......................................... 2
4. OPTIONS ........................................................... 2
4.1. SAVE ............................................................ 2
4.2. SCORE ........................................................... 3
4.3. KEYBOARD ........................................................ 3
4.4. GRAPHICS ........................................................ 3
4.5. RAWIO ........................................................... 3
4.6. IBMBIOS ......................................................... 3
4.7. ANSI ............................................................ 4
5. ENVIRONMENT VARIABLES ............................................. 5
6. BUGS .............................................................. 5
7. AUTHOR'S ADDRESS .................................................. 5
- i -
INTRODUCTION
This README file describes the requirements and setup necessary to get
MORIA running on your MSDOS computer. The actual game documentation is
in MORIA.DOC.
1. USAGE
Usage: moria [ -norsw ] [ savefile ]
Where: -n starts a new game, ignoring any existing save files.
-o selects the original (VMS) command set.
-r selects the Rogue-like command set.
-s prints the score file and exits.
-w will try to resurrect a dead character
2. REQUIREMENTS
640K ram (really!)
DOS 2.x or higher
2 - 360K floppy disk drives or 1 high density drive or 1 hard drive
A 24 (or 25) line by 80 column monitor. MORIA uses either BIOS calls
or ANSI for video output so should work properly on most monitors.
It must use ANSI to work on DEC Rainbows. It won't work in 43-line mode
of an EGA.
3. INSTALLATION
MORIA is very easy to configure. The biggest problem is that there is
not enough room on a single 360K floppy disk to hold the DOS system
files, MORIA.EXE (about 340K) and a MORIA save file (about 20K or so).
To install MORIA, some files must be copied and 2 options in MORIA.CNF
must be set. Options and the MORIA.CNF are described more fully in the
section entitled OPTIONS. Here are a few methods of configuration.
These methods are also described in the MORIA.CNF file.
3.1. Hard drive systems
Create a c:\games subdirectory on your hard disk and put c:\games on
your PATH (see the DOS manual if you need help with PATH). Copy
MORIA.EXE and MORIA.CNF to c:\games. Edit MORIA.CNF and put in the
options:
SAVE c:\games\moria.sav;n
SCORE c:\games\moria.scr
- 1 -
3.2. High-density floppy systems
This is about as easy as for a hard disk. Format a diskette and put the
DOS system files on it (use FORMAT A:/S). Copy MORIA.EXE and MORIA.CNF
to that diskette. Edit MORIA.CNF and put in the options:
SAVE a:\moria.sav
SCORE a:\moria.scr
3.3. 2 - 360K floppy systems
You will need to use 2 floppy diskettes. Format a diskette and put the
DOS system files on it (use FORMAT A:/S). Copy MORIA.CNF to this
diskette. This diskette will go in drive A when you want to play MORIA.
Format a second diskette (no /S) and copy MORIA.EXE to it. This
diskette will go in drive B. Edit MORIA.CNF and put in the options:
SAVE a:moria.sav
SCORE a:moria.scr
When you want to play MORIA, put both diskettes in and type "B:MORIA"
4. OPTIONS
When MORIA starts up it looks along your PATH for the file "MORIA.CNF".
MORIA.CNF contains configuration information for MORIA in the form of
options. Options have a name and perhaps a value. If the option
doesn't have a value, simply mentioning its name selects that option.
Here are the options.
4.1. SAVE
The SAVE option has 1 argument, the name of a file where saved games
will be stored. Normally, when you start MORIA by typing "MORIA file",
MORIA will try to use "file" as the name of a saved game. The SAVE
option allows you to give the name of the save file so you don't have to
type it in each time you save or restore a game. A sample SAVE option
is:
SAVE c:\games\moria.sav;n
The ";n" is optional. If given it means that MORIA should never prompt
you for the name of the save file. If the SAVE option isn't given,
MORIA defaults to the file MORIA.SAV in the same directory as MORIA.CNF.
Also, the SAVE option can be just ";n", which means use the default name
without prompting.
- 2 -
4.2. SCORE
The SCORE option has 1 argument, the name of the file where the top
scores are kept. A sample SCORE option is:
SCORE c:\games\moria.scr
If the SCORE option isn't given, MORIA defaults to the file MORIA.SCR in
the same directory as MORIA.CNF.
4.3. KEYBOARD
MORIA can be played with either of 2 styles of commands. There is the
original VMS-style commands and a Rogue-style set of commands. The
choice of command set affects the keyboard letters used for doing the
various game commands. The KEYBOARD value can be either "ROGUE" or
"VMS". The default is to use the original VMS-style commands.
4.4. GRAPHICS
The GRAPHICS option takes 2 arguments, the ASCII number for the
character to be used for displaying the walls and floors. For example,
to use '#' for the walls and '.' for the floors, the GRAPHICS option
would be:
GRAPHICS 35 46
Incidentally, these also are the default characters that are used if the
GRAPHICS option is not specified.
4.5. RAWIO
Normally DOS does some extra work whenever a character is input from the
keyboard. One of the tasks is to interpret the special characters ^S
(control-S, which does a scroll lock) ^C (control-C, which acts like
control-Break) and ^P (control-P, which acts like control-PrtSc,
toggling output to your printer or giving an error message if you don't
have one). The RAWIO option will be used to tell DOS to not do this
extra work by making the input (and output) operate in "raw" mode. This
is good because ^P (a MORIA command) will now work. As well, screen
output will be somewhat faster.
URGENT! RAWIO will not work on Dec Rainbows and will probably lock up
the computer.
4.6. IBMBIOS
IBMBIOS enables the use of a BIOS call to read input from the keyboard.
- 3 -
The advantage of this is that the numeric keypad will then be useable as
direction keys for moving around. With this option the keypad keys map
to the directions:
7 up & left 8 up 9 up & right
4 left 5 nothing 6 right
1 down & left 2 down 3 down & right
And other keypad keys map to:
- rest
+ previous message
Ins inventory Del rest
If you are using the Rogue-style command set, the shift key and NumLock
key modify these commands. With the shift key down, 7 will be "run up
and left", 8 will be "run up", etc. The NumLock key is used as a toggle
between moving and tunneling. With NumLock enabled, 7 will be "tunnel up
and left", etc.
4.7. ANSI
The ANSI option tells MORIA to use ANSI sequences rather than using BIOS
calls for doing output. You must use the ANSI option if you are playing
MORIA on a DEC Rainbow. On IBM PCs, ATs and clones there should be no
need to use this option and you can safely ignore the rest of this
section.
The ANSI option takes three optional arguments: check_ansi, move_opt and
use_tgoto. If no arguments are given, they are assumed to be Y (yes), Y,
and N (no), respectively. The usage is
ANSI [ check_ansi [ move_opt [ use_tgoto ] ] ]
An example is:
ANSI Y N
check_ansi tells MORIA to check for ANSI.SYS when starting up. You may have
to disable this check if MORIA insists you don't have ANSI installed, but you
know you do. move_opt tries to reduce the amount of output being sent to the
screen. use_tgoto tells MORIA to use the actual TERMCAP tgoto() routine. The
default is to use a faster routine which only works for ANSI-like terminals.
When the ANSI option is chosen, MORIA looks for ANSI control strings in
a file called TERMCAP, first in the current directory, then in directory
ETC. A sample TERMCAP file is supplied. Basically, this file maps
between logical cursor operations (eg. "cursor up") to ANSI sequences
(eg ESC [ A). In the file, ESC (escape) is represented as \E. MORIA
uses the following logical operations:
- 4 -
ce clear to end of line
cl clear screen
cm cursor motion (only if use_tgoto is chosen)
nd cursor forward (non-destructive space)
le cursor back (left)
up cursor up
do cursor down
li number of lines on the screen
MORIA can also use:
ti terminal initialization string
te terminal end string
5. ENVIRONMENT VARIABLES
MORIA uses the environment variable USER to determine your real name (as
opposed to your role playing name in the game). The USER environment
variable can be set from DOS with:
set USER = kneller
If the USER variable isn't set, MORIA just uses the name "player".
If the ANSI option is chosen, MORIA uses the variable TERM to determine
the terminal information to extract from the TERMCAP file. If the TERM
variable isn't set, MORIA assumes the value "ibmpc-mono".
6. BUGS
I have not played this game much so there may be bugs which I have not
seen yet. Please report them to me so I can fix them.
7. AUTHOR'S ADDRESS
If you have any questions or bug reports please contact the author of
the current version at:
David Grabiner
grabiner@alumni.princeton.edu
The original author can be reached at:
James E. Wilson
856 University Ave.
Palo Alto, CA 94301
USA
or by electronic mail: wilson@kithrup.com
- 5 -
moria-5.6.debian.1/ibmpc/MLINK.LNK 0000644 0001750 0001750 00000000414 05603152200 014465 0 ustar pjb pjb MAIN+CREATE+CREATURE+DEATH+DESC+DUNGEON+
EAT+FILES+GENERATE+HELP+MAGIC+
MISC1+MISC2+MONSTERS+MORIA1+MORIA2+
POTIONS+PRAYER+RND+SAVE+
SCROLLS+SETS+SIGNALS+SPELLS+STAFFS+
STORE1+STORE2+TREASURE+VARIABLE+
WANDS+WIZARD+IO+MS_MISC+RECALL+
PLAYER.C+TABLES.C,moria,,pccurses
moria-5.6.debian.1/ibmpc/TCPICK.TCU 0000644 0001750 0001750 00000003263 05603152202 014606 0 ustar pjb pjb A uuencoded copy of a TCPICK.TC file.
begin 640 TCPICK.TC
M5'5R8F\@0R!0:6-K($QI 0
M -,D %P- X <)
M-!-)$P"!- (]: ,!< ,!