Commit Graph

26 Commits

Author SHA1 Message Date
Sean Hunt
1c081b1647 Remove stale version control lines. 2015-05-25 09:21:31 +09:00
Sean Hunt
97d6fade74 Reformat all C files.
I'll push a formatting guide at some point. There may still be
outstanding changes, but please feel free to resolve those as you arrive
a them.

To the best of my knowledge, there is no changes to the actual code
content, but the formatter does have the occasional bug. If you run into
an issue, please fix it!
2015-05-09 13:43:16 -04:00
karnov
2a907f894e Version number increment 2015-05-06 22:04:27 -04:00
PatR
ad03a7fb7a some lint cleanup 2015-03-16 19:22:49 -07:00
Pasi Kallinen
f0a335da2a Fix GENERIC_USERNAMES thinko 2015-03-10 17:30:24 +02:00
Pasi Kallinen
8e31929ef5 Define for generic usernames which prompt for name
Instead of hard-coding the "play", "player", etc. usernames
which will prompt the user for their name, allow defining
the names in config.h
2015-03-09 18:42:53 +02:00
Sean Hunt
260f7ea860 Make TOURIST unconditional. 2015-02-27 19:33:12 -05:00
keni
03140969ee Bulk recovery of file CVS headers and addition of NHDT- headers. 2015-02-26 09:19:03 -05:00
nethack.rankin
b94f26a8c8 some lint bits (trunk only) 2012-02-16 03:01:38 +00:00
keni
4eabcee787 Add RCS version lines 2009-05-06 10:50:32 +00:00
nethack.rankin
e205569714 extended quest text formatting (trunk only)
Add questpgr formatting codes to support pronouns for leader,
nemesis, deity, and artifact.
  %lh -> "he" or "she" for leader; %nh for nemesis; %dh for hero's god;
  %li -> "him" or "her"; likewise %ni, %di;
  %lj -> "his" or "her"; and %nj, %dj;
H, I, and J modifiers yield capitalized form of same.
  %oh -> "it" or "they" for artifact (Eyes of the Overworld is plural);
  %oi -> "it" or "them";
  %oj -> "its" or "their"; plus capitalization with uppercase modifiers.
Also, %O yields shortened artifact name ("the Foo" in place of "the Foo
of Bar").  These provide support for terser summary lines, but can also
be used in the regular quest text passages.

     A couple of nemeses don't specify gender.  The random choices need
to be made early so that the leaders' messages can get them right.  This
chooses during role initialization and then uses that result once the
corresponding monster is eventually created.  It does the same for leader
even though no current leader needs it, and for deity too.
2009-04-07 02:19:54 +00:00
nethack.rankin
a2124ab231 role selection bits (trunk only)
Add a couple of comments and remove a block of unnecessary code left
over from early development.
2009-03-22 22:42:51 +00:00
cohrs
694a330a24 role.c compilation bit (trunk only)
gcc warnings noticed a mismatch in a format string
2009-03-22 17:02:28 +00:00
nethack.rankin
c35d7f42be enhanced interactive role selection (trunk only)
[This verbose description is being committed with role.c only;
  the dozen or so other affected files will use a much shorter one.]

     Executive summary:  using Unix (or VMS) with tty, start up via
	nethack -u player
and follow the prompts.  Seeing this in action will be much clearer than
any description.  It might work as is with Mac and Be too, where you
don't need to bother with "-u player" to get "who are you?".  Only half
of it will work with other ports using tty so far, and it does nothing
for ports which don't use tty.

     I started out attempting to add an option which would let you defer
picking your character name until after you'd picked role and race and
so forth (so that you could let the game pick randomly, then use your own
role- or race- or gender-specific name for the result) but threw my ends
up in frustration.  Instead, this allows you to specify race and/or gender
and/or alignment before role when interactively choosing them (ie, after
giving 'n' to the "shall I pick for you?" prompt), by adding extra menu
entries to the role menu, with similar entries in the other menus so you
can actually bounce back and forth picking whichever of the four role/race/
gender/alignment attributes in any order.  (<Someone> has a patch to
control the order of the four prompts via option setting, but it's not as
versatile as this ended up being.)

     That works pretty well, so I added a confirmation prompt when you're
done (which can be bypassed by picking new 'a' instead 'y' at the "shall
I pick your character's role [ynaq]?" prompt).  And I introduced a chance
to rename the character during that confirmation, with a quite modest
amount of spaghetti being added into main() to support it.  Picking a new
name which matches a save file will result restoring the saved game just
as if you'd used that name from the start.  [One thing which hasn't been
resolved yet is whether anything special needs to be done when changing
name to or from "wizard", particulary for ports which allow/reject wizard
mode access based on character name rather than user name.]

     Right now, renaming is only available if you've gone through the
"who are you?" prompt (thereby demonstrating that you're allowed to use
an arbitrary name), since some multi-user sites may be using scripting to
force the character name for players who share an account.  There should
be a new SYSCF option to let sites explicitly allow renaming, but this
had already grown pretty big so that is deferred.  (And I haven't yet
implemented sysconf for VMS so wouldn't have been able to test it....)

     Unfortunately, role selection has been implemented in the interface
code instead of in the core--a big mistake, in my opinion, even if some
interfaces can give easy point and click control to the player--so this
has only been implemented for tty.

     Also, renaming needs to manipulate lock files in the case where the
file name is based on the character name.  I moved the file name part
into getlock() itself, removing some clutter from main().  But getlock()
handling in pcmain.c is something I won't touch with a pole of any length.
It needs to be cleaned up before the rename capability can be activated
for ports that use that main().  The rest of the rename support there is
present but bracketed by #if 0.

     Lastly, the handling of generic character names like "player" and
"games" has been moved into plnamesuffix(), again to eliminate a bit of
clutter from main().  And plnamesuffix()'s potential for uncontrolled
recursion (if player keeps giving -Role instead of Name to askname()) has
been replaced by iteration.  It could still go on forever if the player
is persistent or askname() goes haywire, but I don't think we really care.

     The interface-specific changes are limited to player_selection() and
askname(), so folks can add this to other interfaces as desired without
flailing all over the place.  But the changes to tty's player_selection()
were quite extensive.  (Fortunately, some of it is just fixing up the
indentation to match changes in block nesting.)  Like tty, win32 and gem
use build_plselection_prompt().  It now returns a string ending in "[ynaq]"
rather than just "[ynq]" so if they don't bother with these changes, they
should either fix that up or at least accept 'a' as a synonym for 'y'
during the initial "shall I pick your character's role?" prompt.
2009-03-22 00:22:33 +00:00
keni
5d24f9ab3a warnings cleanup (trunk only)
This covers the warning cleanup bits no one objected to.
2008-02-20 00:27:56 +00:00
nethack.rankin
949d71e3e0 fix [part of] #H103 - misleading prompt when choosing role,&c
From a bug report, specifying role and race
along with invalid alignment for that role/race combination resulted in a
prompt of "pick the alignment of your chaotic human Valkyrie".  This fixes
that particular problem, but the role selection code is incomprehensible
and I don't have a lot of confidence about whether other combinations have
similar trouble.

     This also fixes an obvious typo in ok_align().  Unfortunately I can't
figure out what to do with the if-then-else block in root_plselection_prompt
which has identical code for its `then' and `else' halves (in the alignment
code that the new ok_align() test skips).
2006-05-25 05:43:49 +00:00
nethack.allison
b064510a9b customize role, race, gender, align choices (trunk only)
Support negation syntax to restrict unwanted race, role, gender, align
options:
        OPTIONS=role:!knight, role:!tourist, race:!orc
prevents them from being picked randomly or
appearing in the pick lists at the start of the game.
2005-01-15 14:01:47 +00:00
nethack.allison
5fa8f73af8 housekeeping: mark trunk sources 3.5 (src) 2005-01-02 16:44:46 +00:00
nethack.allison
422a6f8145 Master of Thieves
<Someone>  wrote:
> The "/* Fix up the quest nemesis */" code in role_init()
> adds M3_WAITFORU but _doesn't_ remove M3_CLOSE;
> since the Master of Thieves as the Rogue Quest Leader is
> defined with that flag, he keeps it when acting as the Tourist
> Quest Nemesis. Thus, when STRAT_WAITFORU
> is cleared by your actions, STRAT_CLOSE may stay in
> place making him stay meditating when another Nemesis
> wouldn't.
2004-12-17 00:33:05 +00:00
nethack.allison
28a1a41668 shadowed declaration warning
<Someone> complained that his compiler was giving these
warnings:
cmd.c:2119: warning: declaration of `expl' shadows a global declaration
dungeon.c:292: warning: declaration of `rand' shadows a global declaration
exper.c💯 warning: declaration of `exp' shadows a global declaration
files.c:278: warning: declaration of `basename' shadows a global declaration
hack.c:1102: warning: declaration of `expl' shadows a global declaration
pickup.c:2081: warning: declaration of `select' shadows a global declaration
role.c:1060: warning: declaration of `conj' shadows a global declaration
2004-12-16 00:20:54 +00:00
cohrs
1f712ac626 U303 - starting the game as a male valkyrie
A core fixup if the the port startup code sets an invalid flags.female when
starting a new game.  The old comment regarding being unable to change
flags.female was not completely correct.  The flags.pantheon can be used to
differenciate new games from a restored game.
2003-05-25 20:28:41 +00:00
nethack.rankin
ea400a778d some lint cleanup
Building with an old version of gcc with various warnings enabled
generated a lot of noise.  Most of it was due to not guarding string
literals with `const', but there were a couple of actual problems too.
2003-01-09 09:18:14 +00:00
cohrs
38d84ba3c8 role level names
A few role level names didn't include valid male/female variants
2002-02-09 18:39:54 +00:00
nethack.allison
7d1e6f7d57 from Yitzhak
Add absent prototypes to some core routines.
Also add some port function() to function(void) in some win32 routines.
Also updates the Borland C Makefile for win32.
2002-02-05 13:21:43 +00:00
nethack.allison
06528d1002 3.3.2 to 3.4.0 2002-02-04 16:06:00 +00:00
jwalz
dcee0eb3b0 *** empty log message *** 2002-01-05 21:05:52 +00:00