home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!zephyr.ens.tek.com!master!saab!billr
- From: billr@saab.CNA.TEK.COM (Bill Randle)
- Newsgroups: comp.sources.games
- Subject: v14i044: umoria4 - single player dungeon simulation (ver. 5.5), Part12/39
- Message-ID: <3402@master.CNA.TEK.COM>
- Date: 20 Aug 92 18:04:07 GMT
- Sender: news@master.CNA.TEK.COM
- Lines: 1489
- Approved: billr@saab.CNA.TEK.COM
-
- Submitted-by: grabiner@math.harvard.edu (David Grabiner)
- Posting-number: Volume 14, Issue 44
- Archive-name: umoria4/Part12
- Supersedes: umoria3: Volume 9, Issue 55-97; Volume 10, Issue 15-17
- Environment: Curses, Unix, Mac, MS-DOS, Atari-ST, Amiga, VMS
-
-
-
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then unpack
- # it by saving it into a file and typing "sh file". To overwrite existing
- # files, type "sh file -c". You can also feed this as standard input via
- # unshar, or by typing "sh <file", e.g.. If this archive is complete, you
- # will see the following message at the end:
- # "End of archive 12 (of 39)."
- # Contents: ERRORS source/files.c
- # Wrapped by billr@saab on Thu Aug 20 09:11:29 1992
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- if test -f 'ERRORS' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'ERRORS'\"
- else
- echo shar: Extracting \"'ERRORS'\" \(37776 characters\)
- sed "s/^X//" >'ERRORS' <<'END_OF_FILE'
- Xstores probably should buy items which have been marked {damned} by being worn
- Xand then cleared via remove curse, after all they buy unident damned items
- X
- Xcreating traps can destroy staircases
- X
- Xchests should create treasure appropriate to the level they were found on,
- Xnot the level that they are opened on
- X
- Xcolor MacMoria bugs: the colors dialog box says greed not green
- X the help dialog lists the wrong versions
- X my address is wrong
- X
- Xwhen wearing a ring of speed, light should not be used up as fast, the faster
- Xyou are moving, the more turns it should last
- X- by the same reasoning, store lockout are broken too, in fact just about
- X anything using time won't work `correctly' when character is sped up
- X
- Xcalling put_qio() every turn during running significantly slows it down
- Xon slow hosts which are using curses, I believe it was added only for
- Xaesthetics, and it probably isn't strictly necessary, could at least
- Xsurround it with an #ifndef FAST_RUNNING or similar
- X
- Xwhen thief steals an object, say what was stolen in message
- Xwhen item in backpack is destroyed, indicate what item was destroyed
- Xinventory does not take a turn
- X
- Xdisplay_scores(), at end of the game, should display top 15 or so scores, and
- Xlist the current player's score below that if not in the top 15 list, at least,
- Xthe value of show_player should be false at the end
- X- better, display_scores can put a message line at the bottom like this
- X ( ESC : return to game space : toggle all scores/your scores)
- Xand then the player can easily choose which scores to see
- X
- Xthe 32767 limit in the recall code for number of monsters killed is too
- Xeasy to reach, making it unsigned will extend the range to 65535,
- Xmaking it a long would increase program size by 2K, I don't think that this
- Xchange is worth the extra memory used
- X
- XMac: choosing `9 point' from the screen menu results in a 1" square window
- Xwhich won't expand or grow, switching back to 12 point gives a huge window
- Xwith type that appears to be about 100 points or so
- X
- Xmonsters should probably not be summoned on top of a rune of protection
- X
- Xcould make scorefile code more efficient if I read/write more than one entry
- Xat a time
- X
- Xfor MSDOS: shouldn't the treasure.c file change '#' to wallsym, and '.'
- X to floorsym?, shouldn't the save.c file change '.' to floorsym and vice
- X versa, just like it already does for wallsym?
- X
- XVMS curses apparently has a bug, during resting, the program continually
- Xmoves the cursor to the @ sign, which is a no-op and should result in no
- Xoutput, but the VMS curses code outputs control commands to the terminal,
- Xthis makes resting run slow on bandwidth limited terminals
- X
- XVMS has 32 bit user ids (UIC), should increase the size of uid's in the
- Xscorefile to 32 bits, and then make the vms uic = getgid()<<16+getuid()
- Xwhich is 32 bits
- X
- Xremove the hours support for all micros, or else give people the option
- Xin the config.h file to remove it
- X
- Xwhen functions are not used, ifdef out the calls instead of providing
- Xdummy functions, to save some space
- X
- Xsave.c creates two files under VMS, because it first calls 'open' and
- Xthen later calls 'fopen', rewrite so that only one file will be created
- X
- Xin store.c, the comment "Your mother was a troll!" doesn't mean anything
- Xif you are a half-troll, change to Ogre?
- X
- Xthe ms_misc.c file maps the 'Ins' key, which is the '0' key to 'i',
- Xthis confuses the hell out of a lot of people, this IS documented, but
- Xfew people read the documentation
- X
- Xadd a turns counter to the higscores entry, and check this when restoring
- Xa character, don't score the character if this value is different
- Xthis prevents someone from playing a character, goofing, saving it while
- Xalive, and then going back to the first savefile
- X
- Xhaste self is a level 1 potion, and super heroism is level 3, both
- Xseem far too low of a level for the potions considering how useful they
- Xare, increasing the levels would make them more common deeper in the dungeon
- Xrestore potions are level 40 are too deep, they are available in the stores,
- Xand just aren't that powerful of a potion
- XDJG: haste self is needed at level 1 for early encounters with nasty monsters
- Xsuper heroism could be higher
- X
- Xthe sorting code does not work with foodstuffs, problem is that when
- Xrestore a 5.2.1 character which has unsorted food, the new code may
- Xput a food ration at the start instead of merging it with the other unsorted
- Xfood, thus overflowing the inventory size, there are few 5.2.1 characters
- Xleft anyways, so perhaps this isn't much of a problem anymore
- X
- Xwine/ale should be potions to be quaffed, not foodstuffs to be eaten
- X
- X^M = ^J when digging, can't really solve well, because of bugs in some
- Xversion of curses which requires this to be true
- X
- Xperhaps add an option to control the Drop One/Drop All query for multiple
- Xstacking items
- X
- Xthe choice of whether or not duplicate characters should be scored should
- Xreally be an option in the config.h file, since there exist single-user
- Xunix machines, and multi-user IBM-PCs (on a network)
- X- also, the decision of whether to limit each player to one entry per
- Xcharacter type should be an option (perhaps the same one)
- X
- Xgive warriors a better chance of detecting that ego weapons are magik,
- Xbut only for ego weapons, not all items
- X
- Xan inscription is lost when two objects are merged, either choose longest,
- Xor ask player, try to combine them, at least do something
- X
- XMacintosh
- X- mac version does not clear screen after saving a character
- X restart variables are not reset as they should (maybe fixed?)
- X- mac moria crashes with the 384 size resource?, works fine with 512k size
- X- mac moria crashes when trying to write past the end of the screen,
- X specifically, if have a weapon with more than 80 characters, and put it last
- X in the equipment list, then mac version will crash
- X add code to put_buffer to truncate strings?
- X- the CRuntime.o and CLibraries.o ARE needed for the mac makefiles.
- X- the file type and creator are not set for the character stats file
- X- when save a game and hit the cancel button, it still says the
- X game is being saved even though it isn't
- X- when a character dies, the savefile is not marked as dead
- X- should be able to find config file in same directory as the program
- X- should get version number from constants, not hardwired into resources
- X- should have color menu enabled even on B&W monitor, so you can switch
- X black and white if desired
- X- does not work on 512K mac, seems to be enough memory, but it uses routines
- X which are not in the old ROMS, 512K macs are obsolete, so this is
- X probably not worth fixing
- X
- XIBMPC
- X- received report that -w command gives 'file from wrong version' error
- X- when followed by monster, and reach edge of screen, sometimes the game
- X hangs and you must type a character for it to continue, either a Turbo C
- X bug or a PC-Moria bug
- X- tunneling does not work with the numeric keypad when using rogue-like mode,
- X i.e. ctrl-4
- X- on PC, only draw during traceback, perhaps make this an option, this is
- X a CGA specific problem (most people have VGA now a days), and only applies
- X to the Turbo C builtin screen code, tcio.c, PC-Curses does not have this
- X problem, in Turbo Pascal, there is a variable in the CRT unit that one
- X can set to enable this feature
- X- tcio.c file does not handle redraw ^R at all
- X
- Xrun under Saber C to see if that turns up any bugs
- X
- X- when read curse weapon on a HA/DF weapon, the code does not clear the AC
- X bonus of the weapon, cursed gauntlets of slaying don't lose +tohit/+todam,
- X and other cases should be fixed also
- X- if you curse a special magic item (HA, RF, etc), it retains its very high
- X value, its cost should be reset to the value in object_list[index]
- X- if you curse a special cursed object (noise, irritation), it will lose its
- X special cursed ability (two wrongs make a right?!?), this should not happen,
- X instead of clearing ALL flag bits, should only clear the 'good' ones
- X
- Xif wield a torch, and a silver jelly immediately drains it to 1,
- Xthe program will be confused for one turn thinking that you still have
- Xlight even though you don't
- X
- Xscoring unfair to humans/warriors/etc, since they have a lower max exp than
- Xother race/classes, should adjust exp downward by inflationary factors
- Xwhen calculating score?
- XDJG: unnecessary
- X
- Xshould reduce stack usage in generate.c
- X
- Xin the store, should have some way to determine how close one is to
- Xgetting perfect haggling
- X
- Xreplace all of those heavy weapon messages with an automatic inscription,
- Xhow should this be maintainted, should it change only when wielded,
- Xor should it change whenever the players strength changes?
- X
- Xthrowing a lot of objects into a pile can cause problems?
- X
- Xmake the printing of stuff under monsters an option for those who find
- Xit bothersome
- X
- Xmake monster movement more intelligent:
- X- for slow monsters, in movement_rate(), instead of using mod, use
- X (randint(2 - speed) == 1) to make monster movement a little more uncertain
- X for fast monsters, give a little variance to speed, i.e. 66% of time monster
- X moves at speed, 17% of time move at speed+1, 17% of time move at speed-1
- X- monsters which are about to die should flee if intelligent
- X- monsters should breathe at player if only separated by a single column
- X- better spell selection, don't cast teleport_to when standing next to
- X player, etc.
- X- have monsters with multiple attacks spread the attacks over each turn if
- X moving slower than player, instead of doing nothing one turn, and then
- X attacking multiple times on the next turn
- X- remember the previous two moves for each intelligent monster, so they can
- X tell which direction they are moving
- X
- Xin get_com(), get_dir(), etc, put -escape- on the msg line if escape
- Xkey pressed, useful if message doesn't get deleted, but doesn't this
- Xalways happen?, apparently not on the Atari ST MWC port
- X
- Xrubble can be generated underneath a monster, which should not happen
- X
- Xwhy call sigsetmask(0)?
- Xdelete signals() and nosignals() as unnecessary?
- X
- Xkilling a shell -1 results in the game disappearing without leaving
- Xa save file, what happened?
- X
- Xthe save.c code that says "file exists, overwrite?", can this ever be
- Xexecuted?, if so, does it do the right thing?, and also, what happens on
- XEOF? will it go into an infinite loop on EOF?
- X
- Xwhat exactly does the damned flag mean, should it be on for all except known2
- Xitems, or should it be on when an item is known to be cursed?
- X
- Xadd ptodam to damage before calling critical_hits
- X- modify C command to print to dam bonuses modified by weapon, should
- X print both the unmodified bonus, and the modified bonus
- X- should take about 10 slay dragon arrows to kill AMHD, check this after
- X ptodam code is changed, may need to increase damages from +3?
- X- also check other ego weapons for play balance, maybe reduce ego multipliers
- X
- Xwhen rogues list Beginners Majik spell book, spells are listed 'a'-'e',
- Xwhen cast from the spell book, spells are listed 'b'-'f', the spell casting
- Xlist should also go from 'a'-'e', but this looks hard to fix
- X
- Xallow SPACE to exit from inventory commands
- X
- Xno monster, except Balrog, can resist mass polymorph, should I make it more
- Xlike polymorph?
- Xmass polymorph is much higher level than polymorph, and is useful for
- Xdire emergencies, either don't give monsters a saving throw, or make is
- Xsomething like level/(3*MAX_MONS_LEVEL/2) which will make it possible but not
- Xcertain that the staff will work on AMHD's
- X
- Xshould mac port have a separate io.c file?
- X
- Xinvisible monsters, and 'headless' monsters should not glare when recovering
- Xfrom a bash
- X
- Xversion.inf file should not contain version number/copyright, these should
- Xbe printed from the variable values
- X
- Xin misc1.c, the pusht code requires search of entire cave structure,
- Xthis needs to be written more efficiently, perhaps put x,y into inven_type for
- Xevery object located somewhere in the cave?
- X
- Xeliminate all #if 0 in the code
- X
- X**************************
- XChanges that can wait...
- X
- Xonly let warriors get *GREAT* hits?
- Xin critical_hits(), change the threshholds to 400-600-800, which will make
- Xall melee weapons eligible for great hits, and only let warriors get great
- Xhits
- Xsince this makes Mage's much worse fighters, swap Sleep II for Lightning
- XBall (giving a much needed intermediate Ball spell), and Recharge I for
- XObject Dectection (to compensate for Priest's sense surroundings)
- XDJG: object detection isn't very useful
- X
- Xincrease the classes of weapons from 3 to 5, i.e. missile, blunt, assassin,
- Xmelee (two handed weapons, etc., only these can do *GREAT* hits), and normal.
- XThen modify fighting abilities as follows:
- X mis blu ass mel nor
- X a) b) c) d) e) -- := suck
- XWarrior + + + ++ + - := iffy
- XRogue + 0 ++ - 0 0 := unchanged
- XMage 0 0 0 -- 0 + := improved
- XRanger ++ 0 0 0 0 ++ := hyperb
- XPriest 0 + - -- 0
- XPaladin 0 ++ 0 0 0
- X
- Xthe monster memory always prints monster attack types and damage types
- Xtogether, this can lead to strange situations, for example, if a grey
- Xmushroom patch releases spores, but does not confuse the player, nothing
- Xappears in the monster memory because the player does not know they were
- Xconfusion spores, but he/she does know that that spores are released
- X
- XIBMPC COLOR
- X- the experimental color support for PC-Moria does not work well when
- X trying to display a monster which is the same color as the background
- X- the disenchanter w and b are not the same color
- X- CHP changes to the same color as ball/breath that lowered it
- X- all mushrooms are wrong, except the grey mushroom patch
- X- invisible monsters can easily be found by casting stinking cloud at the walls
- X which will color all spaces green, except the one with the invisible monster
- X
- Xshow how many spells player can learn via the 'G' command
- X
- Xadd max mana to display in addition to current mana
- X
- Xadd inscriptions that apply to a class of objects, not just a single instance
- X
- Xshouldn't be able to genocide invalid letters; escape out of genocide
- X
- Xhave alternative messages to 'dies in a fit of agony', that gets
- Xa bit repetitive, and boring
- X
- Xa command to allow writing the monster memory to a file
- X
- Xget sources for nethack/omega, look for any really good ideas, also check
- Xto see how the implement Mac compatibility, portability, protection,
- Xand other general concepts
- X
- Xtreasure.c has an arrow and a bolt out of order (arrow in the rings, and
- Xbolt in the amulets)
- X
- Xsecret doors are always granite, would be nice to have secrets doors
- Xhidden in other types of rock, would make them less obvious when
- Xhightlight seams is on, also current scheme gives an advantage while searching
- Xsince walls displayed as % obviously are not secret doors
- X
- XMAX_SIGHT is 20, but rooms can be larger than twenty across, that gives
- Xstrange situation where moving one step away from a monster in a large room
- Xcan cause it to disappear, either increase MAX_SIGHT to be size of largest
- Xpossible room size, or else use different MAX_SIGHT values in rooms/corridors/
- Xtown level?
- X
- Xinstead of printing 'it can hit to attack and hit to attack' print
- X'it can hit to attack twice' in monster descriptions?
- X
- X- change haggling so that initial price depends on how many good bargains
- Xyou have had
- X- add key to accept price, instead of forcing player to type in price
- X- when reach perfect haggling, should just give object to player without
- Xasking for any prompt, bad idea if someone mistypes a letter
- X- add an option so that player can play with or without haggling, without
- Xhaggling, give prices that are always, say, 30% above the minimum
- X- add store commands to buy/sell without haggling, with price say, 20%,
- Xless/greater than asking price
- X
- Ximprove map command (see nethack), define an array of special characters,
- Xone for each type of composite wall, say, and then let end users specify
- Xthe necessary graphic characters, allow for multiple character graphic
- Xsequences
- X
- Xcombat in a room should have a chance of waking up sleeping monsters, except
- Xthat it would not be fair, since monsters can send breath weapons through
- Xother monsters, but the player can only attack the nearest monsters
- X
- X(high level?) monsters should slowly regenerate hit points, esp since the
- Xdoc states that the Balrog does
- Xnote, if leave level and come back, the Balrog is regenerated (sic) with
- Xfull hit points
- Xevery 128 turns, let monsters regenerate 1/64 of their total hit points?
- X
- Xhave several different types of Balrog, i.e. a fire breathing one,
- Xa cold breathing one, a lightning breathing one, etc.
- X
- Xshould be a chance of weapons breaking when try to dig with them?
- XNO, it is too easy to dig with weapon by accident, shouldn't dull them unless
- Xthere is some way to sharpen them which there currently isn't
- X
- Xcan get small groups of rooms which are connected to each other, but not
- Xto the rest of the rooms on the level, perhaps check for cycles in
- Xtunnel/room graph before trying to build tunnels?
- X
- Xcan not use counted commands while bashing a door, because of the
- Xparalyzation that sometimes occurs always stops a counted command
- X
- Xallow character building, by allocation of a limited number of stat points,
- Xinstead of random rerolling??
- X
- Xadd another aux inventory slot, so that there is one for picks, and one for
- Xbows
- X
- Xdecrease mithril values, increase gem values, more expensive items in the
- Xshops, should be greater difference between prices of low level objects
- Xand high level objects, more gold/silver/copper on lower levels, selling
- Xhigh enchanted objects should not be so profitable
- X(good idea here, favorite suggestion for fixing the money problem)
- X
- Xin object_offset(), give 70/71 and 75/76 different codes, shift by 5 (32)
- Xeverywhere instead of 6 (64), reduce size of object_ident[] from
- X7*64 to 9*32, objects 71 must all have 2 added to subval so that they
- Xstart at 96, objects 76 must all have 1 added to subval
- X
- Xall variables (including bss) should be initialized before they are used,
- Xsee the mac sources
- X
- Xadd a macro capability
- X
- Xmost case statements should use table or if/else instead, table are much
- Xfaster, both give much smaller code
- X
- Xif have one unidentified object, and sell it to a store, and it gets
- Xidentified, and you happen to have some similar store items, you will get
- Xa 'combining' message, even though no combining is really taking place,
- Xperhaps adding an extra parameter to identify which indicates whether
- Xthe item will remain in inventory after ident, if it does not remain,
- Xthen should not give combining message if there is only one of them
- X
- Xmany of the constants in constant.h should really be enums instead, this
- Xwould make the game more maintainable
- X
- Xsome fields of treasure_type are const and could be deleted
- X
- Xmissile weapons should be made more useful, make them stackable after
- Xidentified if they are identical, increase the benefit of using proper
- Xbow/arrow combo, increase +todam, +tohit more than now, perhaps give
- Xan advantage here to fighters/paladins/rangers/rogues somehow, don't
- Xdecrease ptohit so much in inven_throw() (currently reduced by distance)
- X
- Xshould recall info be set in breath() for other monsters?
- X
- Xfinish monster compiler, write defs for all monsters
- X
- Xshould be able to increase digging plusses for weapons??
- X
- Xshould be able to increase ring plusses?? this would seriously unbalance
- Xthe game if allowed
- X
- Xin the store bargain code, separate the sell good bargains from the purchase
- Xgood bargains? this is important for owners with very high inflate values
- Xas it is easy to reach sell final value, but very difficult to reach purchase
- Xfinal value, change from 20 to 10 if do this
- X
- Xchange move to take a char-number i.e. '0' instead of a number, i.e. 0
- X
- Xput all prt_ functions into a separate file, put all movement functions
- Xin a separate file
- X
- Xdefine constants for all possible tchars, number-directions, attack-types,
- Xlast_line = 23, scroll flags, potion flags, etc
- X
- Xwould be nice if 10-23 were all wielded objects, i.e. move light 15 outside
- Xthis range
- X
- Xuse scroll bars on the Mac version for showing the rest of the level,
- XL/W, might be confusing since this won't scroll the whole window, only
- Xthe dungeon view
- Xhave multiple windows, one for inventory, one resizable/scrollable for
- Xdungeon view, etc...
- X
- Xshould eliminate need for 70/71 scrolls and 75/76 potions
- X
- Xreplace hex flag fields in treasure with constants
- X
- Xshould not get message "something rolls under feet" when step on a loose rock
- X/* Hid Obj*/ trap?, also should not get this message when cast create food
- Xsome people prefer to have these messages though
- X
- X%%%%%%%%%%%%%
- Xideas from Bron Campbell Nelson bron%bronze.wpd.sgi.com@sgi.sgi.com
- X
- Xpotion of boldness should have duration, i.e. should be safe from fear for
- Xa little while after quaffing boldness potion (also heroism/super-heroism)
- Xthe current length values seem a little long, perhaps just improve the
- Xcharacters resistance to fear?
- X
- Xwarriors too hard, give them more hitpoints?, lower base-to-hit of other
- Xclasses?, fix warrior so can withstand one AMHD poison breath attack?
- X
- Xboots of speed are too hard to find, 1/7000 is ring of speed, 1/14000+ is
- Xboots of speed, other evidence suggests that boots are about 10 times as
- Xrare as rings
- X
- Xitems needed for win: see invisible, free action, resist fire, speed, if
- Xadd black market, don't make it too easy to get these items
- X
- Xblack market suggestions:
- Xstaff of teleportation 20000, staff of speed 100000, mushroom of restoring
- X20000, and perhaps some powerful archery items
- X
- Xheavy armor is useless, does not protect against spells/breate, and reduces
- Xfrom to-hit, reduce penalty for characters with high STR?
- X
- Xnew shop: enchantorium, where enchantments can be purchased for a high
- Xprice, price proportional to how many enchants already there (i.e. enchanting
- Xa +9 item costs a fabulous amount, but enchanting a +0 item costs a little
- Xmore than one enchant armor/weapon scroll), allow enchant to any value, i.e.
- XAC/digging for HA/DF, digging for picks/shovels/etc, etc...
- X
- Xless reasonble suggestions follow...
- X
- Xtoo many weapon types, the variety is useless
- X
- Xhave armor protect by subtracting ac/10 (sic) instead of reducing by %
- X
- Xspeed is too important, need smaller time quanta
- X
- Xrace/class adjustments should be more meaningful, give races/classes max
- Xstat values which are not 18/100
- X
- Xadd an autosave option
- X
- Xadd more up stairways? currently there are only randint(2) per level,
- Xperhaps guarantee that there will be at least 2
- X
- Xwarriors should automatically recognize ego weapons
- X
- Xdispel evil/undead are nearly worthless since they do not do much damage for
- Xtheir mana cost, change dispel_creature from mon_take_hit (i, randint(damage))
- Xto mon_take_hit (i, damage)
- X
- Xrune of protection is too powerful, reduce OBJ_RUNE_PROT to 800, maybe 1000,
- Xif make this change, should make the spell somewhat easier to cast, say
- X50% for a level 33 priest
- XDJG: this makes them much less useful against the Balrog
- X
- XBalrog should not cast cause serious wounds as it does less damage than a
- Xnormal attack, should not cast slow/paralyze since the player almost
- Xcertainly will have some form of free action
- X
- X%%%%%%%%%%%%%%%%%%%%%%%%%
- X
- Xreincarnate, and lose 1/2 exp?
- X
- Xgive enchant scrolls (or perhaps just *enchant*) a small probability
- Xof creating ego weapons
- Xgive enchant scrolls a small probability of destroying ego enchantments
- Xif they fail to increase pluses
- X
- Xmake the number of hits per round probabilistic, i.e. instead of getting
- X1/2/3/4 hits per round, gives weapons 2.4 hits per round etc, to smoothen
- Xthe curve
- X
- Xperhaps add option to order monsters differently?
- Xgive list of all monsters of that type, and then recall all if type 0,
- Xelse only recall the one indicated by the number typed in
- Xchange ident_char() in help.c
- X
- Xhave all top level action functions (aim, move, throw, inven_command, etc.)
- Xreturn true if took a turn, otherwise false
- X
- Xadd command to show number of turns played, time spent playing, date character
- Xstarted, perhaps even a calendar to give game date '1037 in the Third Age'
- X
- Xenter_store in store2.c calls draw_cave when exiting the store, it should
- Xsave the current screen contents away in memory and then restore from that
- Xsaved screen
- X
- Xif type control-C while resting, sometimes the counter is not cleared, happens
- Xoften when count less than 10, to fix, should move all I/O code out of signal
- Xhandler, it should just set a flag and return
- X
- Xshould examine_book(), scrolls(), and spells/prayers work when hallucinating?
- X
- Xchange player attributes to counters, things like sustain_stat, etc.
- Xthis would greatly simplify calc_bonuses()
- X
- Xshould not be able to stun creates which do not move, and creatures
- Xwhich have no brains
- X
- Xlos code used to determine if monsters are visible but not for objects,
- Xthis leads to strange situations, when room lights up, one can see all objects
- Xin the room, but must enter the room before can see then monsters
- X
- Xhave the monster generator make a table of undead monster indexes, to simplify
- Xsummon_undead()
- X
- Xadd some unique levels to make it more interesting, mazes, etc.
- X
- Xadd a metric option
- X
- Xadd diagonal corridors???
- X
- Xadd a storage rental shop, so players can save objects until they need them,
- Xbut must pay for the priviledge, and have to go back to level 0 to
- Xretrieve the objects
- X
- Xcreate a safe haven for the player, where hp regen faster, poison/disease
- Xcure faster, and player must be in to win
- X
- Xadd amulet of poison resistance, make it a high level item, people would
- Xhave to take off amulet of the magi to wear it
- X
- Xadd another set of gain stat potions, at about 1550 feet, to encourage
- Xpeople to go deeper in search of them
- X
- Xadd a bank for saving/borrowing money (I don't like this), would rather
- Xmake money less plentiful, perhaps make magic items less profitable to
- Xsell?
- X
- Xpossible AD&D enhancements
- Xmages can't wear armor and cast at the same time, stealth decreases
- Xwhen wearing armor (for thieves), priests can't use edged weapons, spell
- Xcasting takes time (more than one turn for high level spells?), ranger
- Xattack bonuses, paladin's laying on hands and wealth limits
- X
- Xgive females better dexterity, and/or better spell casting ability, and/or
- Xmore stealth
- X
- XOrcs should always appear in groups?
- X
- Xpossible balancing enhancements
- Xcharacters have max stat of 18/50+ initial race/class mod, for example,
- Xhuman mage has max str of 18/50 - 5 = 18.
- Xincrease warrior HP so that a warrior can withstand one breath of any type
- Xfrlom any dragon
- Xdex is very important, so everybody should have a chance of getting high
- Xdex values
- X
- Xadd option to find code so that it can optionally stop before lighting
- X up or entering a room
- Xadd otpion to find code so that will enter corridor intersections
- X
- XChange key-dispatch table in dungeon.c back to ORIGINAL mode.
- X
- Xput shell_out code in OS dependent files, unix.c/msdos.c/etc.
- X
- Xsave all levels, problems with the sheer size of doing this, 10K * 50 levels
- Xis 500K total
- X
- Xchange stats to straight 1-40 range
- X
- Xreplace sets.c with an array ~110*16 with a flag for each type of damage
- X faster and smaller than current scheme
- X
- Xadd option to loc_symbol so that it can optionally print char to screen,
- X most loc_symbol calls feed directly to print()
- X
- Xthe look code uses a different algorithm from the los code, is recursive,
- X hard to understand, has 3 gotos, I would prefer code more like los
- X using the shading ideas of jnh
- X
- Xlose_dex is never called, well, we'd better fix that!
- X
- Xfor characters with low dex, should have slight chance of dropping weapon,
- Xmaybe less for fighters, more for mages and priests, should also trip
- Xoccassionally when running
- Xacid attacks should lower charisma?
- X
- Xthe first nasty invisible monster is the Banshee at 1200 feet, so need to
- Xhave see invisible items start appearing at about this time, the current
- Xbalance seems OK to me though
- X
- Xblack mold, and shimmering mold have 00000080 CMOVE flag set which has no
- X effect
- X
- Xboots of great mass can be identified by checking the weight display,
- Xshould eliminate them and replace with some other type of cursed boots
- Xsuggestion: boots of two left feet, (- to dexterity)
- X
- Xadd another field to monster_type, treasurep, cloned/multiplyed monsters
- X should not have treasure, but if they pick up an object, then
- X again let them carry treasure
- X
- Xchange randnor from table lookup to 8d99, save 512 bytes for table
- X
- Xremove ASCII dependencies
- X many places assume that a-z are consecutive, i.e. 'a'+25 = 'z'
- X the hallucination code assumes ascii - randint(95)+31 (misc1.c)
- X
- Xeliminate sscanf calls in ms_misc.c and wizard.c
- X
- Xallow numbers instead of letters in menus, i.e. spell lists, inventory/equip
- X lists
- X
- Xdon't use num-lock for tunneling in PC version, this is a locking key
- X
- Xcharacters accumulate too much cash, perhaps do this:
- X change OBJ_TOWN_LEVEL from 7 to 17, and change place_gold() in misc2.c
- X 293c293,294
- X < i = ((randint(dun_level+2)+2)/2.0) - 1;
- X ---
- X > /* NF: Change randint multiplier from (r(d+2)+2)/2 to (r(d+2)+4)/3 */
- X > i = ((randint(dun_level+2)+4)/3.0) - 1;
- Xthe fixes above (decrease mithril values ...) are preferable
- X
- Xshow time elapsed playing, date character started, and number of turns
- Xelapsed
- X
- Xhave option to put inventory/equipment list on one screen
- X
- Xset a timer, and if the game has been idle for 15 minutes, gracefully
- Xsave and exit?
- X
- Xnew monster suggestions by berman-andrew@yale, because there are no
- Xmedium difficult mosnters before level 40...
- X{"Electric Golem", 0x00020002, 0x00080004, 0x1080, 100, 380,
- X 12, 85, 0, 'g', "70d8", "8 1 1d24|8 1 1d24", 35}
- X{"Queen Harpy", 0x37120012, 0x00008208, 0x2036, 100, 1200,
- X 20, 80, 2, 'h', "46d8", "1 3 2d6|1 3 2d6|1 2 2d12|3 7 0d0", 35}
- X
- Xnew monster suggestions by Don Dodson
- XNether Lich: invisible, phases through walls, similar to Emperor Lich in
- X other respects
- XArcher: fires arrows that do normal damage, or poison, or reduce stat
- XWizard: Like a sorceror but more powerful. Casts fireballs, summons all sorts
- X of nasties, blindness, and hold person. Very high saving throw
- X and resistant for fire/frost.
- X
- Xballs should affect player if inside radius, unfortunately, this is not
- Xreally such a good idea, since the player is often forced to cast to the
- Xnext space, would be OK if the player can specify any point for the target
- Xof the spell
- X
- Xwhen resting, a player should have a chance of not waking up when a monster
- Xenters a room
- X
- Xadd wizard command that would create new MORIA_HOU file, since there already
- X is a default def for it, otherwise, make days array bss
- X
- Xfor HA weapons, p1 is used for both str increase, and sustain stat
- X
- Xrewrite my own sprintf routine that just takes strings %s and integers %d
- Xand nothing else, may be faster/smaller than the library version, or perhaps
- Xhave a routine which cats 3 strings together, or 2 strings and an int
- X
- Xage characters before killing them of Ripe-Old-Age
- X
- Xthese commands which take a dir should not work when confused,
- X bash, closeobject, jamdoor, openobject
- X
- Xmonsters need a 'not carry large object' flag in CMOVE, have all chests (type
- X2), polearms (type 22) and staffs (type 55) be large objects, these should
- Xbe rerolled if they occur when only small objects allowed, chests should have
- Xthis bit set, also small creatures should have it set: kobolds, mummified
- Xkobolds, greedy little gnomes, scruffy-looking hobbits.
- X
- Xtrap names are vague,
- X have two names for each trap, a simple search discloses current vague name,
- X setting it off, or a find/identify trap gives the long name
- X
- Xallow option of making aux files either hard coded paths, or paths relative
- Xto the executables directory, could then make the aux files relative, put
- Xexe file in same directory as aux files, and start up program with shell
- Xscript that cds to aux file direcotry, this makes it easy to keep multiply
- Xmoria versions around
- X
- Xallow rerolling after choose race/class
- X
- Xstill too slow on i/o, perhaps rewrite to avoid refresh() calls?
- X perhaps use only motion optimization stuff?
- X
- Xshould we call m_name if spell only applies to visible creatures?
- X
- Xwhen moving on objects, say what character moved onto (like rogue)
- X
- Xfor throw command, ask for direction first (like rogue)
- X
- Xshould be able to enchant to-hit to-dam of gauntlets of slaying?
- X likewise, enchant toac of HA swords, etc.
- Xeither should allow enchant of HA sword toac, or else disenchanter bats
- X should not be allowed to reduce it
- X
- Xfix save files to include obj desc, then only need one random number
- X generator which can use table program
- X
- Xgive rogues detect treasure and detect objects, also give them a chance to
- Xsteal objects from monsters
- X
- Xmodify 'x' command to show monster hitpoints
- X
- Xreplace magic numbers with constants
- X
- Xname objects if use did not identify them
- X
- Xwhen creature steals and then dies, the stolen item should appear, unless
- Xcreature has teleported away in the meantime
- X
- Xalways add exp to current and max, instead of just increasing max when current
- Xexceeds it, this would make attacking undead creatures a little more profitable
- Xsince you are guaranteed a net gain of exp if you kill it, even if it drains
- Xa lot of EXP from you
- X
- Xallow chests to hold items
- X
- Xhave a global variable, savefile field to keep track of the number of times
- Xa character has been resurrected
- X
- Xshould not be able to use a two-handed weapon (two-handed sword, pole arm,
- Xbow, crossbow, flail, etc.) at same time as wearing a shield
- Xshould be able to also choose to wield two weapons, but with a penalty of
- Xsome sort, probably lowered AC
- X
- Xcan't cast in any direction, should be able to, should also be able to cast
- Xdown at feet (5), should be able to cast area affect spells (balls) at any
- Xpoint, so that the burst will affect any desired area
- X
- XLong term stuff, enhancement suggestions:
- Xgive player something to do with money, i.e. 1Million gp for HA +10 +10 sword
- X'flavor' the levels, dragons on one level, undead on another, etc.
- Xwhat's been discovered list
- Xcommands not close enough to rogue style
- Xfixed item lettering in inventory, in-line/cmd-line options?
- Xcommand line option to print out times open
- XY destroy command, allow destroy from equipment list
- Xlet o, c, D commands automatically pick direction when they can
- Xgive rogue's a chance to steal, e.g. let monsters carry items that they
- X pick up, if rogue fails, then monster gets a free hit, otherwise monster
- X stays asleep, with a small chance of monster waking up
- Xgive magic users a chance at pre identifying scrolls
- Xcould use a help system, like VMS version
- Xhave multiple character parties, note that almost everything character
- X dependent is stored in the py structure already
- X
- X
- Xcould reduce the size of the types.h file (and other source files too) if
- X eliminate reduce type specifiers, i.e. int32u cmove;\n int32u spells;
- X could be int32u cmove,\n spells;
- X
- Xadd color, i.e. red dragons show up as a red 'D', etc
- X
- Xan inn on the town level, in which you must pay to stay, could be used
- Xby those who need to wait to get back into a store, or who want to wait
- Xuntil a store's inventory changes
- X
- Xwhen look at monsters, give monster state in addition to monster name, i.e.
- X"You see a sleeping ancient red dragon."
- X
- Xadd code to the get_dir() function so that one can optionally specific a
- X hex instead of a direction, i.e. if you enter '.', then program goes
- X into a cursor positioning mode, allowing you to move the cursor to
- X the spot you want to specify
- X
- Xdon't like the player_exp values, the increase is not very even, especially
- Xin the upper levels
- X
- Xcloak of protection is misleading, it has no special features
- X
- Xneed documentation on what each spell/prayer/staff/etc does, this is needed
- X for priestly spells in particular, since these are non obvious
- X also needed for special objects, such as crown of magi
- X
- Xeating elvish waybread for curing can cause a character to become bloated and
- X start moving slower, either decrease food value of ew to 5000, or
- X increase player food limit to 17500, or combination of both, or perhaps
- X change the you are full message, maybe have another message at 7500?,
- X or maybe make elvish waybread immune to the slowing effect
- X
- Xmonsters should be more intelligent, should know about corridors so that they
- Xdon't get stuck in dead ends, or continually retrace their movement
- X
- XRNG for Moria should have a table shuffle, see Knuth
- X
- Xdon't update store inventories across save, unless the save file is at least,
- Xsay, an hour old
- X
- Xwhen monster appears, print its name, may need some work to work reasonably
- X with detect spells
- X
- XFeatures:
- Xhero/superhero do not subtract hit points when effect wears off
- XWOR scroll can save you with minus hit points!!
- Xdetect monster does not detect invisible monsters (normally)
- Xcan hit monsters in walls, but can not cast at them
- Xcan not enchant something with negative numbers (i.e. cursed items)
- Xhow does armor protect against breath/gas? it doesn't!!!
- X
- Xmissing amulets: strength, constitution, intelligence, dexterity
- Xmissing rings: gain wisdom, gain charisma
- X note that missing rings/amulets are disjoint
- Xmissing detect monster potion (feature!)
- Xmissing blank scrolls (feature!)
- Xmissing staff genocide (feature!)
- Xmissing staff mass_genocide (feature!)
- X
- XD&D Inconsistencies, most of these should not be fixed since that would
- X unbalance the game:
- Xpriests should not need light for prayers
- Xmagic missile should do 1d4+1 per level
- Xdetect invisible should last 5 rounds, instead of 1
- Xstinking cloud should be renamed cloudkill
- Xfireball does 1d6 per level, should destroy all paper/wood and melt metal
- Xlightning does 1d6 per level
- Xhold monster 1 round per level of caster
- Xphase door by touching a wall, and end up on other side of the wall
- Xlight spells should be mobile
- Xheroism should not work when over level 11, superheroism should not work when
- X over level 14
- Xrings can not be used cummulatively, rings or prot have no effect if
- X wearing armor
- XFlame Tongue, +3 versus cold creatures and avian, +4 vs undead
- XHoly Avenger, +50% on all saving throws
- X
- END_OF_FILE
- if test 37776 -ne `wc -c <'ERRORS'`; then
- echo shar: \"'ERRORS'\" unpacked with wrong size!
- fi
- # end of 'ERRORS'
- fi
- if test -f 'source/files.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'source/files.c'\"
- else
- echo shar: Extracting \"'source/files.c'\" \(16041 characters\)
- sed "s/^X//" >'source/files.c' <<'END_OF_FILE'
- X/* source/files.c: misc code to access files used by Moria
- X
- X Copyright (c) 1989-92 James E. Wilson, Robert A. Koeneke
- X
- X This software may be copied and distributed for educational, research, and
- X not for profit purposes provided that this copyright and statement are
- X included in all such copies. */
- X
- X#include <stdio.h>
- X
- X#ifndef STDIO_LOADED
- X#define STDIO_LOADED
- X#endif
- X
- X#if 0
- X/* moved to externs.h to avoid VMS 'psect' problem */
- X#include <errno.h>
- X#endif
- X
- X#ifdef __TURBOC__
- X#include <io.h>
- X#include <stdlib.h>
- X#endif /* __TURBOC__ */
- X
- X#include "config.h"
- X#include "constant.h"
- X#include "types.h"
- X
- X#if defined(GEMDOS) && (__STDC__ == 0) && !defined(ATARIST_TC)
- X#include <access.h>
- Xchar *strcat();
- X#endif
- X
- X#ifdef VMS
- X#include <string.h>
- X#include <file.h>
- X#else
- X#ifdef USG
- X#ifndef ATARIST_MWC
- X#include <string.h>
- X#ifndef ATARIST_TC
- X#include <fcntl.h>
- X#endif
- X#endif
- X#else
- X#include <strings.h>
- X#include <sys/file.h>
- X#endif
- X#if defined(ultrix) || defined(USG)
- Xvoid exit();
- X#endif
- X#endif
- X
- X/* This must be included after fcntl.h, which has a prototype for `open'
- X on some systems. Otherwise, the `open' prototype conflicts with the
- X `topen' declaration. */
- X#include "externs.h"
- X
- X#ifdef ATARIST_TC
- X/* Include this to get prototypes for standard library functions. */
- X#include <stdlib.h>
- X#endif
- X
- X#ifdef MAC
- X#include "ScrnMgr.h"
- X#define GNRL_ALRT 1024
- X#endif
- X
- X/*
- X * init_scorefile
- X * Open the score file while we still have the setuid privileges. Later
- X * when the score is being written out, you must be sure to flock the file
- X * so we don't have multiple people trying to write to it at the same time.
- X * Craig Norborg (doc) Mon Aug 10 16:41:59 EST 1987
- X */
- Xvoid init_scorefile()
- X{
- X#ifdef MAC
- X appldirectory ();
- X#endif
- X
- X#if defined(atarist) || defined(ATARI_ST) || defined(MAC)
- X highscore_fp = fopen(MORIA_TOP, "rb+");
- X#else
- X highscore_fp = fopen(MORIA_TOP, "r+");
- X#endif
- X
- X if (highscore_fp == NULL)
- X {
- X#ifdef MAC
- X highscore_fp = fopen (MORIA_TOP, "wb"); /* Create it if not there. */
- X if (highscore_fp == NULL)
- X {
- X ParamText ("\pCan't create score file!", NULL, NULL, NULL);
- X DoScreenALRT (GNRL_ALRT, akStop, fixHalf, fixThird);
- X ExitToShell ();
- X }
- X setfileinfo (MORIA_TOP, currentdirectory (), SCORE_FTYPE);
- X#else
- X (void) fprintf (stderr, "Can't open score file \"%s\"\n", MORIA_TOP);
- X exit(1);
- X#endif
- X }
- X#if defined(MSDOS) || defined(VMS) || defined(MAC)
- X /* can't leave it open, since this causes problems on networked PCs and VMS,
- X we DO want to check to make sure we can open the file, though */
- X fclose (highscore_fp);
- X#endif
- X
- X#ifdef MAC
- X restoredirectory ();
- X#endif
- X}
- X
- X#ifndef MAC
- X/* Attempt to open the intro file -RAK- */
- X/* This routine also checks the hours file vs. what time it is -Doc */
- Xvoid read_times()
- X{
- X vtype in_line;
- X register int i;
- X FILE *file1;
- X
- X#ifdef MORIA_HOU
- X /* Attempt to read hours.dat. If it does not exist, */
- X /* inform the user so he can tell the wizard about it */
- X if ((file1 = fopen(MORIA_HOU, "r")) != NULL)
- X {
- X while (fgets(in_line, 80, file1) != CNIL)
- X if (strlen(in_line) > 3)
- X {
- X if (!strncmp(in_line, "SUN:", 4))
- X (void) strcpy(days[0], in_line);
- X else if (!strncmp(in_line, "MON:", 4))
- X (void) strcpy(days[1], in_line);
- X else if (!strncmp(in_line, "TUE:", 4))
- X (void) strcpy(days[2], in_line);
- X else if (!strncmp(in_line, "WED:", 4))
- X (void) strcpy(days[3], in_line);
- X else if (!strncmp(in_line, "THU:", 4))
- X (void) strcpy(days[4], in_line);
- X else if (!strncmp(in_line, "FRI:", 4))
- X (void) strcpy(days[5], in_line);
- X else if (!strncmp(in_line, "SAT:", 4))
- X (void) strcpy(days[6], in_line);
- X }
- X (void) fclose(file1);
- X }
- X else
- X {
- X restore_term();
- X (void) fprintf(stderr, "There is no hours file \"%s\".\n", MORIA_HOU);
- X (void) fprintf(stderr, "Please inform the wizard, %s, so he ", WIZARD);
- X (void) fprintf(stderr, "can correct this!\n");
- X exit(1);
- X }
- X
- X /* Check the hours, if closed then exit. */
- X if (!check_time())
- X {
- X if ((file1 = fopen(MORIA_HOU, "r")) != NULL)
- X {
- X clear_screen();
- X#ifdef VMS
- X restore_screen();
- X#endif
- X for (i = 0; fgets(in_line, 80, file1) != CNIL; i++)
- X put_buffer(in_line, i, 0);
- X pause_line (23);
- X (void) fclose(file1);
- X }
- X exit_game();
- X }
- X#endif
- X
- X /* Print the introduction message, news, etc. */
- X if ((file1 = fopen(MORIA_MOR, "r")) != NULL)
- X {
- X clear_screen();
- X#ifdef VMS
- X restore_screen();
- X#endif
- X for (i = 0; fgets(in_line, 80, file1) != CNIL; i++)
- X put_buffer(in_line, i, 0);
- X pause_line(23);
- X (void) fclose(file1);
- X }
- X}
- X#endif
- X
- X/* File perusal. -CJS-
- X primitive, but portable */
- Xvoid helpfile(filename)
- Xchar *filename;
- X#ifdef MAC
- X{
- X mac_helpfile(filename, TRUE);
- X}
- X#else
- X{
- X bigvtype tmp_str;
- X FILE *file;
- X char input;
- X int i;
- X
- X file = fopen(filename, "r");
- X if (file == NULL)
- X {
- X (void) sprintf (tmp_str, "Can not find help file \"%s\".\n", filename);
- X prt (tmp_str, 0, 0);
- X return;
- X }
- X
- X save_screen();
- X
- X while (!feof(file))
- X {
- X clear_screen();
- X for (i = 0; i < 23; i++)
- X if (fgets (tmp_str, BIGVTYPESIZ-1, file) != CNIL)
- X put_buffer (tmp_str, i, 0);
- X prt("[Press any key to continue.]", 23, 23);
- X input = inkey();
- X if (input == ESCAPE)
- X break;
- X }
- X
- X (void) fclose(file);
- X restore_screen();
- X}
- X#endif
- X
- X/* Prints a list of random objects to a file. Note that -RAK- */
- X/* the objects produced is a sampling of objects which */
- X/* be expected to appear on that level. */
- Xvoid print_objects()
- X{
- X register int i;
- X int nobj, j, level;
- X vtype filename1; bigvtype tmp_str;
- X register FILE *file1;
- X register inven_type *i_ptr;
- X#ifdef MAC
- X short vrefnum;
- X#endif
- X#ifdef ATARIST_MWC
- X int32u holder;
- X#endif
- X
- X prt("Produce objects on what level?: ", 0, 0);
- X level = 0;
- X if (!get_string(tmp_str, 0, 32, 10))
- X return;
- X level = atoi(tmp_str);
- X prt("Produce how many objects?: ", 0, 0);
- X nobj = 0;
- X if (!get_string(tmp_str, 0, 27, 10))
- X return;
- X nobj = atoi(tmp_str);
- X if ((nobj > 0) && (level > -1) && (level < 1201))
- X {
- X if (nobj > 10000)
- X nobj = 10000;
- X#ifdef MAC
- X (void) strcpy(filename1, "Objects");
- X if (doputfile("Save objects in:", filename1, &vrefnum))
- X#else
- X prt("File name: ", 0, 0);
- X if (get_string(filename1, 0, 11, 64))
- X#endif
- X {
- X if (strlen(filename1) == 0)
- X return;
- X#ifdef MAC
- X changedirectory(vrefnum);
- X#endif
- X if ((file1 = fopen(filename1, "w")) != NULL)
- X {
- X#ifdef MAC
- X macbeginwait ();
- X#endif
- X
- X (void) sprintf(tmp_str, "%d", nobj);
- X prt(strcat(tmp_str, " random objects being produced..."), 0, 0);
- X put_qio();
- X (void) fprintf(file1, "*** Random Object Sampling:\n");
- X (void) fprintf(file1, "*** %d objects\n", nobj);
- X (void) fprintf(file1, "*** For Level %d\n", level);
- X (void) fprintf(file1, "\n");
- X (void) fprintf(file1, "\n");
- X j = popt();
- X for (i = 0; i < nobj; i++)
- X {
- X invcopy(&t_list[j], sorted_objects[get_obj_num(level)]);
- X magic_treasure(j, level);
- X i_ptr = &t_list[j];
- X store_bought(i_ptr);
- X#ifdef ATARIST_MWC
- X if (i_ptr->flags & (holder = TR_CURSED))
- X#else
- X if (i_ptr->flags & TR_CURSED)
- X#endif
- X add_inscribe(i_ptr, ID_DAMD);
- X objdes(tmp_str, i_ptr, TRUE);
- X (void) fprintf(file1, "%d %s\n", i_ptr->level, tmp_str);
- X }
- X pusht((int8u)j);
- X (void) fclose(file1);
- X#ifdef MAC
- X setfileinfo(filename1, vrefnum, INFO_FTYPE);
- X macendwait ();
- X#endif
- X prt("Completed.", 0, 0);
- X }
- X else
- X prt("File could not be opened.", 0, 0);
- X#ifdef MAC
- X restoredirectory();
- X#endif
- X }
- X }
- X else
- X prt ("Parameters no good.", 0, 0);
- X}
- X
- X
- X/* Print the character to a file or device -RAK- */
- X#ifdef MAC
- Xint file_character()
- X#else
- Xint file_character(filename1)
- Xchar *filename1;
- X#endif
- X{
- X register int i;
- X int j, xbth, xbthb, xfos, xsrh, xstl, xdis, xsave, xdev;
- X vtype xinfra;
- X int fd;
- X register FILE *file1;
- X bigvtype prt2;
- X register struct misc *p_ptr;
- X register inven_type *i_ptr;
- X vtype out_val, prt1;
- X char *p, *colon, *blank;
- X#ifdef MAC
- X vtype filename1;
- X short vrefnum;
- X#endif
- X
- X#ifdef MAC
- X (void) makefilename(filename1, "Stats", TRUE);
- X if (!doputfile("Save character description in:", filename1, &vrefnum))
- X return (FALSE);
- X#endif
- X
- X#ifndef VMS
- X /* VMS creates a new version of a file, so no need to check for rewrite. */
- X#ifdef MAC
- X changedirectory(vrefnum);
- X fd = open (filename1, O_WRONLY|O_CREAT|O_TRUNC);
- X restoredirectory();
- X macbeginwait ();
- X#else
- X#if defined(GEMDOS) && (__STDC__ == 0) && !defined(ATARIST_TC)
- X if (!access(filename1, AREAD))
- X {
- X (void) sprintf(out_val, "Replace existing file %s?", filename1);
- X if (get_check(out_val))
- X fd = creat(filename1, 1);
- X }
- X else
- X fd = creat (filename1, 1);
- X#else
- X fd = open (filename1, O_WRONLY|O_CREAT|O_EXCL, 0644);
- X if (fd < 0 && errno == EEXIST)
- X {
- X (void) sprintf(out_val, "Replace existing file %s?", filename1);
- X if (get_check(out_val))
- X fd = open(filename1, O_WRONLY, 0644);
- X }
- X#endif
- X#endif
- X if (fd >= 0)
- X {
- X /* on some non-unix machines, fdopen() is not reliable, hence must call
- X close() and then fopen() */
- X (void) close(fd);
- X file1 = fopen(filename1, "w");
- X }
- X else
- X file1 = NULL;
- X#else /* VMS */
- X fd = -1;
- X file1 = fopen (filename1, "w");
- X#endif
- X
- X if (file1 != NULL)
- X {
- X prt("Writing character sheet...", 0, 0);
- X put_qio();
- X colon = ":";
- X blank = " ";
- X#ifdef MAC
- X (void) fprintf(file1, "\n\n");
- X#else
- X (void) fprintf(file1, "%c\n\n", CTRL('L'));
- X#endif
- X (void) fprintf(file1, " Name%9s %-23s", colon, py.misc.name);
- X (void) fprintf(file1, " Age%11s %6d", colon, (int)py.misc.age);
- X cnv_stat(py.stats.use_stat[A_STR], prt1);
- X (void) fprintf(file1, " STR : %s\n", prt1);
- X (void) fprintf(file1, " Race%9s %-23s", colon,
- X race[py.misc.prace].trace);
- X (void) fprintf(file1, " Height%8s %6d", colon, (int)py.misc.ht);
- X cnv_stat(py.stats.use_stat[A_INT], prt1);
- X (void) fprintf(file1, " INT : %s\n", prt1);
- X (void) fprintf(file1, " Sex%10s %-23s", colon,
- X (py.misc.male ? "Male" : "Female"));
- X (void) fprintf(file1, " Weight%8s %6d", colon, (int)py.misc.wt);
- X cnv_stat(py.stats.use_stat[A_WIS], prt1);
- X (void) fprintf(file1, " WIS : %s\n", prt1);
- X (void) fprintf(file1, " Class%8s %-23s", colon,
- X class[py.misc.pclass].title);
- X (void) fprintf(file1, " Social Class : %6d", py.misc.sc);
- X cnv_stat(py.stats.use_stat[A_DEX], prt1);
- X (void) fprintf(file1, " DEX : %s\n", prt1);
- X (void) fprintf(file1, " Title%8s %-23s", colon, title_string());
- X (void) fprintf(file1, "%22s", blank);
- X cnv_stat(py.stats.use_stat[A_CON], prt1);
- X (void) fprintf(file1, " CON : %s\n", prt1);
- X (void) fprintf(file1, "%34s", blank);
- X (void) fprintf(file1, "%26s", blank);
- X cnv_stat(py.stats.use_stat[A_CHR], prt1);
- X (void) fprintf(file1, " CHR : %s\n\n", prt1);
- X
- X (void) fprintf(file1, " + To Hit : %6d", py.misc.dis_th);
- X (void) fprintf(file1, "%8sLevel : %6d", blank, (int)py.misc.lev);
- X (void) fprintf(file1, " Max Hit Points : %6d\n", py.misc.mhp);
- X (void) fprintf(file1, " + To Damage : %6d", py.misc.dis_td);
- X (void) fprintf(file1, "%8sExperience : %6ld", blank, py.misc.exp);
- X (void) fprintf(file1, " Cur Hit Points : %6d\n", py.misc.chp);
- X (void) fprintf(file1, " + To AC : %6d", py.misc.dis_tac);
- X (void) fprintf(file1, "%8sMax Exp : %6ld", blank, py.misc.max_exp);
- X (void) fprintf(file1, " Max Mana%8s %6d\n", colon, py.misc.mana);
- X (void) fprintf(file1, " Total AC : %6d", py.misc.dis_ac);
- X if (py.misc.lev == MAX_PLAYER_LEVEL)
- X (void) fprintf (file1, "%8sExp to Adv : ******", blank);
- X else
- X (void) fprintf(file1, "%8sExp to Adv : %6ld", blank,
- X (int32)(player_exp[py.misc.lev-1]
- X * py.misc.expfact / 100));
- X (void) fprintf(file1, " Cur Mana%8s %6d\n", colon, py.misc.cmana);
- X (void) fprintf(file1, "%29sGold%8s %6ld\n\n", blank, colon,
- X py.misc.au);
- X
- X p_ptr = &py.misc;
- X xbth = p_ptr->bth + p_ptr->ptohit * BTH_PLUS_ADJ
- X + (class_level_adj[p_ptr->pclass][CLA_BTH] * p_ptr->lev);
- X xbthb = p_ptr->bthb + p_ptr->ptohit * BTH_PLUS_ADJ
- X + (class_level_adj[p_ptr->pclass][CLA_BTHB] * p_ptr->lev);
- X /* this results in a range from 0 to 29 */
- X xfos = 40 - p_ptr->fos;
- X if (xfos < 0)
- X xfos = 0;
- X xsrh = p_ptr->srh;
- X /* this results in a range from 0 to 9 */
- X xstl = p_ptr->stl + 1;
- X xdis = p_ptr->disarm + 2 * todis_adj() + stat_adj(A_INT)
- X + (class_level_adj[p_ptr->pclass][CLA_DISARM] * p_ptr->lev / 3);
- X xsave = p_ptr->save + stat_adj(A_WIS)
- X + (class_level_adj[p_ptr->pclass][CLA_SAVE] * p_ptr->lev / 3);
- X xdev = p_ptr->save + stat_adj(A_INT)
- X + (class_level_adj[p_ptr->pclass][CLA_DEVICE] * p_ptr->lev / 3);
- X
- X (void) sprintf(xinfra, "%d feet", py.flags.see_infra * 10);
- X
- X (void) fprintf(file1, "(Miscellaneous Abilities)\n\n");
- X (void) fprintf(file1, " Fighting : %-10s", likert(xbth, 12));
- X (void) fprintf(file1, " Stealth : %-10s", likert(xstl, 1));
- X (void) fprintf(file1, " Perception : %s\n", likert(xfos, 3));
- X (void) fprintf(file1, " Bows/Throw : %-10s", likert(xbthb, 12));
- X (void) fprintf(file1, " Disarming : %-10s", likert(xdis, 8));
- X (void) fprintf(file1, " Searching : %s\n", likert(xsrh, 6));
- X (void) fprintf(file1, " Saving Throw: %-10s", likert(xsave, 6));
- X (void) fprintf(file1, " Magic Device: %-10s", likert(xdev, 6));
- X (void) fprintf(file1, " Infra-Vision: %s\n\n", xinfra);
- X /* Write out the character's history */
- X (void) fprintf(file1, "Character Background\n");
- X for (i = 0; i < 4; i++)
- X (void) fprintf(file1, " %s\n", py.misc.history[i]);
- X /* Write out the equipment list. */
- X j = 0;
- X (void) fprintf(file1, "\n [Character's Equipment List]\n\n");
- X if (equip_ctr == 0)
- X (void) fprintf(file1, " Character has no equipment in use.\n");
- X else
- X for (i = INVEN_WIELD; i < INVEN_ARRAY_SIZE; i++)
- X {
- X i_ptr = &inventory[i];
- X if (i_ptr->tval != TV_NOTHING)
- X {
- X switch (i)
- X {
- X case INVEN_WIELD: p = "You are wielding"; break;
- X case INVEN_HEAD: p = "Worn on head"; break;
- X case INVEN_NECK: p = "Worn around neck"; break;
- X case INVEN_BODY: p = "Worn on body"; break;
- X case INVEN_ARM: p = "Worn on shield arm";break;
- X case INVEN_HANDS: p = "Worn on hands"; break;
- X case INVEN_RIGHT: p = "Right ring finger";break;
- X case INVEN_LEFT: p = "Left ring finger";break;
- X case INVEN_FEET: p = "Worn on feet"; break;
- X case INVEN_OUTER: p = "Worn about body"; break;
- X case INVEN_LIGHT: p = "Light source is"; break;
- X case INVEN_AUX: p = "Secondary weapon"; break;
- X default: p = "*Unknown value*"; break;
- X }
- X objdes(prt2, &inventory[i], TRUE);
- X (void) fprintf(file1, " %c) %-19s: %s\n", j+'a', p, prt2);
- X j++;
- X }
- X }
- X
- X /* Write out the character's inventory. */
- X#ifdef MAC
- X (void) fprintf(file1, "\n\n");
- X#else
- X (void) fprintf(file1, "%c\n\n", CTRL('L'));
- X#endif
- X (void) fprintf(file1, " [General Inventory List]\n\n");
- X if (inven_ctr == 0)
- X (void) fprintf(file1, " Character has no objects in inventory.\n");
- X else
- X {
- X for (i = 0; i < inven_ctr; i++)
- X {
- X objdes(prt2, &inventory[i], TRUE);
- X (void) fprintf(file1, "%c) %s\n", i+'a', prt2);
- X }
- X }
- X#ifndef MAC
- X (void) fprintf(file1, "%c", CTRL('L'));
- X#endif
- X (void) fclose(file1);
- X#ifdef MAC
- X setfileinfo(filename1, vrefnum, INFO_FTYPE);
- X macendwait ();
- X#endif
- X prt("Completed.", 0, 0);
- X return TRUE;
- X }
- X else
- X {
- X if (fd >= 0)
- X (void) close (fd);
- X (void) sprintf (out_val, "Can't open file %s:", filename1);
- X msg_print(out_val);
- X return FALSE;
- X }
- X}
- END_OF_FILE
- if test 16041 -ne `wc -c <'source/files.c'`; then
- echo shar: \"'source/files.c'\" unpacked with wrong size!
- fi
- # end of 'source/files.c'
- fi
- echo shar: End of archive 12 \(of 39\).
- cp /dev/null ark12isdone
- MISSING=""
- for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 39 archives.
- echo "Now run "bldfiles.sh" to build split files"
- rm -f ark[1-9]isdone ark[1-9][0-9]isdone
- else
- echo You still need to unpack the following archives:
- echo " " ${MISSING}
- fi
- ## End of shell archive.
- exit 0
-