Commit Graph

2351 Commits

Author SHA1 Message Date
PatR
fd5ef1ecaa more key bindings
number_pad==1 adds
 '5' => 'G'
 M-5 => 'g'
 '0' => 'i'
number_pad==2 swaps 5 and M-5 and adds M-0
 '5' => 'g'
 M-5 => 'G'
 '0' => 'i'
 M-0 => 'I'

M-5 and M-0 were missing from the bound key handling; they still
used hardcoded digits even though the actions for plain 5 and
plain 0 can be bound to other keys these days.  This implements
the M-5 variation as NHKF_RUSH2.  Changing numpad from 1 to 2
or vice versa will swap the NHKF_RUN2 and NHKF_RUSH2 actions
regardless of what keys they're assigned to.  I haven't done
anything for unimplemented NHKF_DOINV2 though (and am not
planning to in case someone else wants to jump in...).

This also fixes the description of the 'I' command.  The extended
command name for that still misleadingly refers to "type" rather
than "class" though.
2020-12-10 15:06:26 -08:00
PatR
e1406a8c08 txt2key() - parsing key binding specifications
While testing some addtional ?i (list of key assignments)
changes, I wanted to give every key a binding.  When I tried
BIND=M-^A:exploremode
the text to key conversion didn't like that.  This adds support
for M-^x and M-C-x plus variations where dashes are omitted.

This adds support for ^? even though that isn't really a
control character.  I bound #terrain to it and surprising--to
me at least--the <delete> key worked to invoke that command.

Also changes 'char txt2key(...)' to be 'uchar txt2key(...)'.
2020-12-09 16:52:54 -08:00
PatR
9f79ad56d9 NOSUSPEND
Provide a hook to inhibit unixconf.h from defining SUSPEND
without the need to modify it:  #define NOSUSPEND in config.h
or add -DNOSUSPEND to CFLAGS.  Similar to long-standing NOSHELL
for inhibiting SHELL.
2020-12-08 12:58:36 -08:00
Pasi Kallinen
13359648dd Remove duplicate wallify_map code 2020-12-06 18:36:37 +02:00
Pasi Kallinen
0462a2088c Increment EDITLEVEL
Forgot to increment EDITLEVEL when I did the stairs change,
and again after fixing the Oracle bones stairs. Lets do it now.
2020-12-05 19:38:20 +02:00
Pasi Kallinen
b797baba7a Make return values use defines 2020-12-04 09:30:21 +02:00
Pasi Kallinen
3ef3b425ad Unify the ad type switches 2020-12-04 09:30:21 +02:00
Pasi Kallinen
88e333a3a8 Unify ad_ssex 2020-12-04 09:30:21 +02:00
Pasi Kallinen
1696019361 Unify ad_sedu 2020-12-04 09:30:21 +02:00
Pasi Kallinen
376593dad5 Unify ad_dise 2020-12-04 09:30:21 +02:00
Pasi Kallinen
4118a7ea44 Unify ad_samu 2020-12-04 09:30:21 +02:00
Pasi Kallinen
d679d3a029 Unify ad_dgst 2020-12-04 09:30:20 +02:00
Pasi Kallinen
e777bd9670 Unify ad_legs 2020-12-04 09:30:20 +02:00
Pasi Kallinen
337e7da049 Unify ad_stun 2020-12-04 09:30:19 +02:00
Pasi Kallinen
12ee144936 Unify ad_heal 2020-12-04 09:30:19 +02:00
Pasi Kallinen
4901c8027c Unify ad_were 2020-12-04 09:30:19 +02:00
Pasi Kallinen
a6a676f720 Unify ad_ston 2020-12-04 09:30:19 +02:00
Pasi Kallinen
20b6ea602b Unify ad_phys 2020-12-04 09:30:19 +02:00
Pasi Kallinen
ac5822fe69 Unify ad_halu 2020-12-04 09:30:19 +02:00
Pasi Kallinen
36bb52466d Unify ad_deth 2020-12-04 09:30:19 +02:00
Pasi Kallinen
2999233332 Unify ad_pest 2020-12-04 09:30:18 +02:00
Pasi Kallinen
cb55d7c30f Unify ad_famn 2020-12-04 09:30:18 +02:00
Pasi Kallinen
618feabd88 Unify ad_poly 2020-12-04 09:30:18 +02:00
Pasi Kallinen
fda63d145b Unify ad_conf 2020-12-04 09:30:18 +02:00
Pasi Kallinen
558ec78b3a Unify ad_slow 2020-12-04 09:30:18 +02:00
Pasi Kallinen
b80c30bcf1 Unify ad_ench 2020-12-04 09:30:18 +02:00
Pasi Kallinen
96a4d14a36 Unify ad_slim 2020-12-04 09:30:17 +02:00
Pasi Kallinen
eb5508ba58 Unify ad_slee 2020-12-04 09:30:17 +02:00
Pasi Kallinen
654220f840 Unify ad_plys 2020-12-04 09:30:17 +02:00
Pasi Kallinen
7914237fbf Unify ad_wrap 2020-12-04 09:30:17 +02:00
Pasi Kallinen
bfb8931188 Unify ad_stck 2020-12-04 09:30:17 +02:00
Pasi Kallinen
b4ed25da46 Unify ad_drin 2020-12-04 09:30:17 +02:00
Pasi Kallinen
1ca0165bb9 Unify ad_drst 2020-12-04 09:30:16 +02:00
Pasi Kallinen
dba9aaf424 Unify ad_curs 2020-12-04 09:30:16 +02:00
Pasi Kallinen
d325e2cc60 Unify ad_blnd 2020-12-04 09:30:16 +02:00
Pasi Kallinen
607d1bcd96 Unify ad_tlpt 2020-12-04 09:30:16 +02:00
Pasi Kallinen
bfe773812e Unify ad_sgld 2020-12-04 09:30:16 +02:00
Pasi Kallinen
b7899ee014 Unify ad_acid 2020-12-04 09:30:15 +02:00
Pasi Kallinen
8a78c49fea Unify ad_elec 2020-12-04 09:30:15 +02:00
Pasi Kallinen
6abfe7e548 Unify ad_cold 2020-12-04 09:30:15 +02:00
Pasi Kallinen
6712876801 Unify ad_fire 2020-12-04 09:30:14 +02:00
Pasi Kallinen
cfd819f1c1 Unify ad_drli 2020-12-04 09:30:14 +02:00
Pasi Kallinen
518798d0d2 Unify ad_dren 2020-12-04 09:30:14 +02:00
Pasi Kallinen
6436ea1532 Unify ad_dcay 2020-12-04 09:30:14 +02:00
Pasi Kallinen
0d445a7a7c Unify monster-hits-monster 2020-12-04 09:30:14 +02:00
PatR
4d6a140d34 saving vs ball&chain
I started activating new program_state.saving and discovered that
saving of ball and chain could access freed memory.  The change
for the former and fix for the latter are mixed together here (but
easily distinguishable).

The saving flag inhibits status updating and perm_invent updating,
also map updating that goes through flush_screen().  That should
fix the exception triggered after an impossible warning was issued
during a save operation.  impossible() goes through pline() which
tries to bring the screen up to date before issuing a message.
During save, data for that update can be in an inconsistent state.

The code to save ball and/or chain when not on floor or in invent
(I think swallowed is the only expected case) was examining the
memory pointed to by uball and uchain even if saving the level had
just freed floor objects and saving invent had just freed carried
objects.  So for the usual cases, stale pointer values for uball
and uchain would be present and checking their obj->where field
was not reliable.
2020-12-02 06:29:58 -08:00
PatR
f8fcab3400 move 'g.restoring' to 'g.program_state.restoring'
Move the core's global restoring flag (not the same as main()'s
local resuming flag) to a more logical place.  Add a saving flag
in the process, but it isn't being set or cleared anywhere yet.
(Once in use it will probably fix the exception during save that
was just reported, but before that it would be useful to figure
out what specifically caused the event.)

The program_state struct really ought to be standalone rather
than part of struct g but I haven't made that change.

Removing an unused variable for wishing and some reformatting
that whent along with it got mixed in.  Removes some trailing
whitespace in sfstruct.c too.

Only lightly tested...
2020-11-30 11:40:21 -08:00
nhmall
0d6481ad8c spelling correction tidbit
Closes #415
2020-11-28 08:59:03 -05:00
Pasi Kallinen
fb188dc1aa Unify mfndpos monster movement flags 2020-11-28 12:49:18 +02:00
Pasi Kallinen
36d977f61f Unify HP loss and passing out from overexertion 2020-11-27 23:43:59 +02:00