Commit Graph

4716 Commits

Author SHA1 Message Date
PatR
274904f9be stabilize loss of gold
When gold is stolen by a leprechaun or lost when being "overwhelmed
by an urge to take a bath" while dipping in a fountain, if you had
99 gold pieces or less, you'd lose all of it (in the bath case, only
if it was at least 10 to start with), but if you had 100 or more,
you would lose a random amount which could be as little as 1.  And
in the bath case, if the random amount was less than 10, you would
lose nothing but be told that "you lost some of your money in the
fountain".  After this change, it is still possible to lose less
when starting with more, but not as likely and not as extreme a case
as maybe losing only 1 when starting with thousands.

The fountain-dip bath case has code to handle mutiple denominations
of coins, possibly the only place in the program where that exists.
I've left that alone although it should probably be taken out....
2015-05-01 18:01:12 -07:00
nhmall
d29ee35ae8 fixes entry for previous bubble fix
Changes to be committed:
	modified:   doc/fixes35.0
2015-05-01 18:34:06 -04:00
nhmall
573c9dc98f Merge branch 'AlexK-misc' 2015-05-01 18:24:59 -04:00
Pasi Kallinen
8f639796d5 Handle boulder-option in config file
Setting boulder in config file did not work correctly in post-3.4.3
code, due to the symset changes.
2015-05-01 22:03:13 +03:00
Pasi Kallinen
40080817ce Uninitialized variable 2015-05-01 14:52:25 +03:00
nhmall
67a53a2aa3 another ball & chain tweak
checking if uball is OBJ_FREE was inappropriate, because
sometimes it is in inventory.
2015-05-01 07:39:53 -04:00
PatR
18a29f0dfe sanity check owornmask
Extend the processing done by the wizard mode 'sanity_check' option
to look for anomalies with obj->owornmask since there seem to have
been a few lately.  I haven't actually triggered any so this code
isn't very well exercized yet.

sanity_check uses pline() rather than impossible() or debugpline()
to deliver messages so might not be very useful with keymasking.

A sizeable chunk of this diff is just cleaning up indentation so
that I could see what I was working with....
2015-05-01 02:32:14 -07:00
Pasi Kallinen
fdda06f678 Initialize variable 2015-05-01 11:55:15 +03:00
keni
a37a35b4e1 Merge branch 'master' of https://rodney.nethack.org:20040/git/NHsource 2015-04-30 22:01:12 -04:00
keni
7823322556 nhsub: add -m flag for fixing commit dates 2015-04-30 22:00:19 -04:00
PatR
e8ec76b551 lint: use const for string literal 2015-04-30 17:59:05 -07:00
nhmall
c25ea3d851 can't use BALL_IN_MON after u.uswallow set to 0
u.uswallow is set to 0 a couple of lines above so
the test will never be TRUE.
2015-04-30 08:26:46 -04:00
nhmall
fcfab90907 fix a panic and infinite recursion
Changes to be committed:
	modified:   src/ball.c
	modified:   src/display.c
	modified:   src/mon.c
2015-04-29 23:53:31 -04:00
nhmall
97a5bdfb17 comment rearranged
Requested by Sean for some work he's doing for reindent.
2015-04-29 20:54:11 -04:00
Pasi Kallinen
9edec13063 Extract ball and chain before flooreffects 2015-04-29 20:35:49 +03:00
Pasi Kallinen
0d3c858452 Check for valid coord in obj_nexto_xy 2015-04-29 17:04:49 +03:00
Pasi Kallinen
b8cfa9b33f Prevent monsters throwing items out of map
If a monster was in the projectile's path, the projectile stopping
checks would not be reached.  The thrown object could fly up to
the maximum range, through walls, or even outside the map.
2015-04-29 16:28:05 +03:00
Pasi Kallinen
d768887385 Unquiver gold before making it vanish
This fixes a complaint for "deleting worn obj":  If reading a cursed
spellbook took your money, and the gold was quivered.
2015-04-28 22:14:23 +03:00
Pasi Kallinen
f83523eeb4 Make spell list title obey menu_headings 2015-04-28 14:13:01 +03:00
Pasi Kallinen
d9ac7f3de7 Exclude "grey" from color picker menu 2015-04-28 12:46:39 +03:00
nhmall
3924b01e73 trade a segfault for a panic
Changes to be committed:
	modified:   src/invent.c
	modified:   src/options.c

Apparently we need this based on Pasi's segfault. We just
don't yet know why we need them.

Also fix a warning:
..\src\options.c(1282) : warning C4101: 'tmp' : unreferenced local variable
2015-04-27 23:42:06 -04:00
Pasi Kallinen
86dc5cf588 Unify getting terrain under drawbridge 2015-04-27 22:15:23 +03:00
Pasi Kallinen
0903df974f Unify guards yelling 2015-04-27 21:31:25 +03:00
Pasi Kallinen
f0699b76d9 Add is_watch define for watchmen 2015-04-27 21:09:26 +03:00
Pasi Kallinen
93cbd1fbb1 Allow all text attributes for menu_headings 2015-04-27 18:44:18 +03:00
Pasi Kallinen
eecd19caa9 Allow changing menucolors in-game via Options 2015-04-27 17:45:48 +03:00
Pasi Kallinen
4fa3c39b55 Show only beginning of annotation when redoing it 2015-04-27 16:18:59 +03:00
PatR
b4741d6206 more BUCX: union vs intersection
Fix filtering used by the 'D' command, and a few other activities that
allow both object class filtering and bless/curse state filtering, so
that when both class(es) and state(s) are specified, objects need to
match both rather than either.  D?C will present the player with cursed
scrolls to drop rather than all scrolls plus all other cursed objects.

This also fixes another instance when gold could end up with its bknown
flag set.
2015-04-27 01:22:39 -07:00
Alex Kompel
664b4eb643 bubble structure contains pointer into static array. Bubble objects
are being flat-dumped into save file and this causes segfault in restore()
whenever data segment layout changes (e.g. global variables added/removed).
bmask should either be stored with the objects.
2015-04-26 14:47:38 -07:00
Pasi Kallinen
467ee34b2f Prevent possible buffer overflow
getlin() gets at most a BUFSZ string from user; make the buf big
enough to hold that _and_ the query itself.
2015-04-26 16:15:44 +03:00
PatR
6386331148 'I' command support for BUCX
Allow the 'I' command to show inventory of known blessed items via
pseudo object classes B, C, U, and X.  That's instead of an showing
inventory of specific object class.  The two can't be combined
because 'I' operates on single character input.

I had to modify tty_yn_function to prevent it from forcing a BUCX
character into lower case (simply using lower case would cause a
conflict with 'u' and 'x' for inventory of shopping bill), and did
that by checking whether any of the acceptable response characters
are upper case.  Pretty straightforward and shouldn't impact any
other uses that don't specify upper case choices.

I did the same thing for X11.  Other interfaces most likely need
to do something similar.  If they don't, a response of 'B' or 'C'
(for menustyle:traditional or menustyle:combination) will simply
not work, without causing any problems, same as typing an invalid
choice, and 'U' or 'X' will give shop feedback instead of the
requested subset of inventory.

The Guidebook revisions are untested.
2015-04-26 03:20:58 -07:00
Pasi Kallinen
54a22d39ea Add level annotating to the Call menu
Via UnNetHack
2015-04-26 11:29:59 +03:00
Pasi Kallinen
f28ba6f131 Show level annotation when overwriting existing one
Idea by Chris Smith, via UnNetHack
2015-04-26 11:10:38 +03:00
Pasi Kallinen
cc5274d0b6 Mung annotation spaces 2015-04-26 10:57:21 +03:00
Pasi Kallinen
4e067f5f2b Show level annotation on level entry
Idea by Chris Smith, via Unnethack
2015-04-26 10:46:42 +03:00
nhmall
8624709c0d comment termination bit 2015-04-25 15:49:14 -04:00
nhmall
07c5467434 checkfile protection from caller
Changes to be committed:
	modified:   src/pager.c
2015-04-25 10:51:07 -04:00
Pasi Kallinen
5828d17eef Show only the short automatic glyph description
When you turn on the automatic description of a glyph under cursor,
we want to show the short description of what glyph it actually is.
The long full description of all possibilities is far too long, so
may cause more-prompts, and is awkward for blind players.
2015-04-25 15:19:19 +03:00
Pasi Kallinen
5479a0b44c Also allow q at the Itemized billing -prompt
Original change via AceHack by Alex Smith
2015-04-25 12:56:55 +03:00
PatR
27d8b631cd isspace() usage
Replace most uses of isspace() with a simple test for ' ' after
processing the string buffer with mungspaces (which replaces tab
with space, converts instances of consecutive whitespace into a
single space, and removes leading and trailing spaces).  The uses
where this wasn't done now cast their argument to (uchar) so that
platforms with signed chars will never pass negative values to it.

I didn't mess with the menu coloring code (except for casts to the
isspace() argument); it almost certainly could benefit from using
mungspaces.  I did mess with the symset processing quite a bit,
and hope I haven't accidentally broken anything.  Default symbols
and DECgraphics symbols still parse and display ok, so the rest of
dat/symbols should be ok too.  I didn't test symbols in the user's
config file because I don't remember how that's supposed to work.
2015-04-25 02:11:13 -07:00
Pasi Kallinen
672ef5223a Fix adding doors to levels 2015-04-25 12:00:44 +03:00
Pasi Kallinen
8e6dde226f Fix out-of-map condition in buzz 2015-04-25 06:24:43 +03:00
PatR
1eff16afcb do_look fix fix
Avoid initializer for auto-class array since many pre-ANSI compilers
didn't support that.  Also, when ESC is used to cancel inventory
selection, don't continue on searching for that selection in invent.
2015-04-24 16:07:00 -07:00
nhmall
65e699b646 fix an observed stack corruption
Changes to be committed:
	modified:   src/pager.c
2015-04-24 11:23:07 -04:00
keni
24eb44a8c0 force date change (another mail test) 2015-04-24 10:11:17 -04:00
keni
de87c7550c and fill in the line (another mail test) 2015-04-24 10:01:00 -04:00
keni
34508d5df2 add a date line (another mail test) 2015-04-24 09:56:24 -04:00
keni
5e39fdffde Merge branch 'master' of https://rodney.nethack.org:20040/git/NHsource 2015-04-24 09:33:35 -04:00
keni
2774278607 enable subst for all DEVEL/*.txt (really another mail test) 2015-04-24 09:32:50 -04:00
Pasi Kallinen
1369b17e3b Stop travel or run when you get hungry 2015-04-24 16:24:50 +03:00