curses interface

Source: http://nethack-curses.wikia.com

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
ncurses: fix build for TTY_GRAPHICS

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
ncurses: fix printout with % character

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
ncurses: pass Ctrl-Z and Ctrl-C to nethack

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
implement Ivy Bridge RDRAND support

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
dice roller: add a dice roller for testing the RNG

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
Assorted YAFMs 1.0

Adds new hallucinatory monsters, new funny messages when hitting
some special monsters with Vorpal Blade, couple special messages
when eating certain monsters, and few other things.

Signed-off-by: Adam Borowski <kilobyte@mimuw.edu.pl>
Signed-off-by: Steven Noonan <steven@uplinklabs.net>
Menucolors v1.5

Allows the user to define in what color menus are shown.
This patch allows the user to define in what color menus are shown.

For example, putting

OPTIONS=menucolors
MENUCOLOR=" blessed "=green
MENUCOLOR=" holy "=green
MENUCOLOR=" cursed "=red
MENUCOLOR=" unholy "=red
MENUCOLOR=" cursed .* (being worn)"=orange&underline

in the configuration file makes all known blessed items show up in green,
all cursed items show up in red and all cursed worn items show up in
orange and underlined when viewing inventory.

If you have regex.h but it is not GNU (e.g. DJGPP, *BSD), uncomment
in include/config.h

If you do not have regex.h, comment
out from include/config.h and replace the MENUCOLOR lines in your config
file with these:

MENUCOLOR="* blessed *"=green
MENUCOLOR="* holy *"=green
MENUCOLOR="* cursed *"=red
MENUCOLOR="* unholy *"=red
MENUCOLOR="* cursed * (being worn)"=orange&underline

Colors: black, red, green, brown, blue, magenta, cyan, gray, orange,
lightgreen, yellow, lightblue, lightmagenta, lightcyan, white.

Attributes: none, bold, dim, underline, blink, inverse.

Note that the terminal is free to interpret the attributes however it wants.

TTY or Windows GUI only, thought the Windows GUI part doesn't obey attributes.

Signed-off-by: Pasi Kallinen <paxed@alt.org>
Signed-off-by: Steven Noonan <steven@uplinklabs.net>
Statuscolors 1.0

Customizable coloring for the status (bottom) lines
Statuscolors is a patch for Nethack (version 3.4.3) that attempts to generalize
the hpmon patch to be more like the menucolors patch. Unlike menucolors, it
does not use regexps. Instead, it provides the following options:

To enable statuscolors:
OPTIONS=statuscolors

To specify statuscolor options, write:
STATUSCOLOR=<option>,<option>

Numeric options have the format <field>%<max-percent>:<color-option>. For
example:
STATUSCOLOR=hp%15:red&bold,pw%100=green

Text options have the format <text>:<color-option>. Text is case-insensitive.
For example:
STATUSCOLOR=hallu:orange,foodpois:red&inverse&blink

A color option is a <color> followed by an optional sequence of &<attr>. Color
and attribute names are case insensitive. Valid colors are:
black blue brown cyan gray green lightblue lightcyan lightgreen
lightmagenta magenta none orange red white yellow

Valid attributes are:
blink bold dim inverse none underline

A reasonable set of defaults might be:
STATUSCOLOR=hp%100=green,hp%66=yellow,hp%50=orange
STATUSCOLOR=hp%33=red&bold,hp%15:red&inverse,hp%0:red&inverse&blink
STATUSCOLOR=pw%100=green,pw%66=yellow,pw%50:orange,pw%33=red&bold
STATUSCOLOR=burdened:yellow,stressed:orange,strained:red&bold
STATUSCOLOR=overtaxed:red&inverse,overloaded:red&inverse&blink
STATUSCOLOR=satiated:yellow,hungry:orange,weak:red&bold
STATUSCOLOR=fainting:red&inverse,fainted:red&inverse&blink
STATUSCOLOR=hallu:yellow,conf:orange,stun:red&bold
STATUSCOLOR=ill:red&inverse,foodpois:red&inverse,slime:red&inverse
STATUSCOLOR=held:red&inverse,blind:red&inverse

Signed-off-by: Shachaf <shachaf+nethack@gmail.com>
Signed-off-by: Oren Ben-Kiki <nethack-oren@ben-kiki.org>
Signed-off-by: Steven Noonan <steven@uplinklabs.net>
Paranoid

This patch makes the commands #q (quit) and X (change to explore mode) (if the
option paranoid_quit is on), and the prompts for hitting peaceful monsters (if
options confirm and paranoid_hit are on) and leaving wizard mode bones
(regardless of runtime options), expect a typed "yes" instead of just 'y'.
Every other response will be treated as "no".

Now it also forces the menu to be shown with the 'T' and 'R' commands even when
there is only one item to be taken off or removed, if the additional
paranoid_remove option is set.

Signed-off-by: Jukka Lahtinen
Signed-off-by: Steven Noonan <steven@uplinklabs.net>
Extinct & showborn

This is a combination of "extinct" and "showborn" patches which were
separate for earlier versions.

The extinct patch makes extincted species listed among the genocide
list (marked with the "(extinct)" tag) when the game ends.

Notice that the counters used to check extinction keep track of the
number of each monster CREATED, not ones killed. So, if a monster is
marked extinct, it just means that none of them would have been
created any more in the game, not necessarily that you killed them
all. Some may still be alive somewhere in the dungeons.

The "showborn" patch will optionally add the number of each monster
species created after the number of them killed, if the number is
different. No born counter is shown for species with no killed
individuals, or for those species with all born individuals killed.

It also adds the wizard mode extended command #showkills that lets
you see the kill counters of each monster race as you see them when
the game ends.

Download and apply the patch and add the definition
somewhere in your include/config.h to compile the features in.
You also need to turn the "showborn" option on to actually show the
born counters. Use the 'O' option in the game or edit your
configuration file.

Signed-off-by: Wingnut
Signed-off-by: Jukka Lahtinen
Signed-off-by: Steven Noonan <steven@uplinklabs.net>
Show BUC v1.0

Adds an option to always show uncursed-status.

For some items, when you have identified it, NetHack doesn't
show the item's BUC-state, if it is uncursed. This patch adds
a configuration option "showbuc", which you can set so NetHack
never omits the BUC-status.

Signed-off-by: Pasi Kallinen <paxed@alt.org>
Signed-off-by: Steven Noonan <steven@uplinklabs.net>
use_darkgray v1.0

Adds an option use_darkgray to toggle use of dark gray color
This patch allows black objects (orcish daggers, ravens, pits, etc.) to
be represented using a dark shade of gray on some terminals. Normally,
nethack shows them as blue to avoid printing unreadable black-on-black
text, but this confuses them with with objects that are actually blue
(cornuthaums, sapphires, soldier ants, etc.).

The patch works by specifying "black foreground" and "boldface" at the
same time. On terminals that simulate bold with brighter colors, this
produces a distinct color. Terminal emulators based on PC CGA/EGA/VGA
textmode generally have this property.

However, on terminals that implement actual bolding -- thickening the
font without changing the color, it will result in invisible text. So,
the feature is not enabled by default. It must be activated with the new
option "use_darkgray".

Notes:
* This patch is only effective in when TERMINFO is defined in unixconf.h

* Highlights added by the existing "use_inverse" and/or "hilite_pet"
options will probably not be visible when applied to black objects.

* nethack doesn't properly follow the rules for using the tputs()
function of termcap/curses. The first argument is supposed to be a
string obtained from the termcap/terminfo functions. Nethack assumes it
can provide a null pointer to do nothing, and can string-concatenate
two codes (boldface and a color select) and use them as one. My code
does not fix this -- although it uses "" instead of a null pointer,
which is less likely to crash on a less permissive termcap/terminfo
implementation.

* I'm aware of a seperate patch to add darkgray support -- but it was
unconditional at runtime, and had to change the color numbers in
includes/color.h to work. My patch makes the TTY code independent of
the actual value of the CLR_* defines.

* I personally believe the correct spelling of the color involved is
"grey", however I have adopted the popular misspelling "gray"
throughout to be consistent with the rest of nethack. :)

Signed-off-by: Michael Deutschmann <michael@talamasca.ocis.net>
Signed-off-by: Steven Noonan <steven@uplinklabs.net>
Enhanced Artifacts Patch v1.0

This patch makes various artifacts (especially the banes) more powerful,
as an attempt to make artifact selection a little more interesting.

Details

- All banes warn you of targeted monsters (like Sting does for orcs).
- All banes give you +d8 to hit and +d20 to damage, rather than +d5 to
  hit and double damage. This makes them more useful without having to
  spend skill slots and enchant weapon scrolls.
- Dragonbane grants reflection.
- Demonbane prevents demons' gating ability (but not the magical power of
  summon nasties).
- On a critical hit, (a "natural 20"), Giantslayer will kill up to seven
  giants adjacent to you ("Seven at one blow!").
- Trollsbane gives hungerless regeneration.
- Trolls killed by Trollsbane will not revive.
- Sunsword has a 1 in 3 chance of blinding opponents.
- Sunsword has a light radius of 3 instead of 2. This gives players more
  of an incentive to wield it when they don't have a lamp.
- Vorpal Blade now does +d8 to damage, instead of the ridiculously
  low +1.
- The Tsurugi of Muramasa now does double damage instead of +d8. This
  puts it in the running for the most powerful weapon in the game, which
  is where it should be. The fact that it is a two-handed weapon balances
  it somewhat.
- Grimtooth is now a (permanantly) poisoned weapon. This makes it somewhat
  useful in the early game (instead of worthless like it is now), but not
  so much in the late game, where most of the tougher monsters are poison
  resistant.

Save/bones file compatibility is maintained, though if Grimtooth is
generated in a vanilla version, it won't be poisoned in this version.

Thoughts for future versions
- Ogresmasher needs a little more oomph.

http://zindorsky.kundor.org/patches/banes.html

Signed-off-by: Nephi <zindorsky@gmail.com>
Signed-off-by: Steven Noonan <steven@uplinklabs.net>
Bag of Tricks Enhancement Patch v1.3

This patch changes the behavior of the Bag of Tricks to something a
little more interesting than a wand of create monster in bag form.

Save/bones file compatibility is not affected.

As always, thanks to all the folks of rec.games.roguelike.nethack who
gave ideas and suggestions.

When you apply a bag of tricks a charge is used and one of the
following effects occurs:

d20     Effect
1-2     An item falls out of the bag.
        The item will be randomly generated if the bag has not
        been recharged and is not cursed, otherwise it will be an
        iron chain.
3       The bag wriggles away from you.
4       You are paralyzed for 1d4 turns. ("Something tries to pull
        you into the bag!")
5       Stinking cloud, centered at the bag.
6       Hallucination for 1d35+10 turns. ("The bag exhales a puff
        of spores.")
7       Scare monster effect. ("The bag yells "Boo!")
        If the bag is cursed or you fail a save vs wisdom, you are
        paralyzed for 1d3 turns. If the bag is blessed or you make
        your save, there is no effect on you.
8       The bag bites you for 1d10 points of damage.
9       The bag sprouts a tongue and flicks your weapon to the
        floor.
10-20   Monsters are created.

When the bag is depleted of charges, it can be used to store
items.

Looting the bag will get you bitten (as in Vanilla) unless it
has no charges, in which case the behavior is the same as
looting a normal container.

If you recharge the bag while items are in it, they get devoured.
("You hear loud crunching sounds from the bag.")

Side effects of existing code:
- The same things that destroy a bag of holding will also destroy a
  bag of tricks.
- A cursed bag of tricks will devour items, just like a cursed bag
  of holding.

In order to partially compensate for lower monster generation, a bag
of tricks will be generated with d30 charges instead of d20.

http://zindorsky.kundor.org/patches/tricks-desc.html

Signed-off-by: Nephi <zindorsky@gmail.com>
Signed-off-by: Steven Noonan <steven@uplinklabs.net>
Grudge Patch v1.5

This simple patch allows various monsters to attack certain other
types of monsters without prior provocation (i.e. they just don't
like each other.) (Currently the Dev Team only provides for this
behavior in the case of a purple worm attacking a shrieker.)

This patch doesn't change bones/save file compatability.

Grudge pairings added in this patch:
- Quest guardians (not leader) vs. hostile monsters
- Angels vs. demons
- Elves vs. orcs
- Woodchucks vs. the Oracle

Since the Oracle doesn't directly attack, the patch also extends
the Oracle's passive attack to affect monsters (with YAFM for
woodchucks).

Grudge pairings considered but rejected:
- Dogs vs. cats
- Cats vs. rats
- Birds vs. snakes
- Croesus vs. gold golems
- Prisoners vs. hostiles

http://zindorsky.kundor.org/patches/grudge-desc.html

Signed-off-by: Nephi <zindorsky@gmail.com>
Signed-off-by: Steven Noonan <steven@uplinklabs.net>
SIMPLE_MAIL patch

Allows players using dgamelauch to mail each other.

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
Color Alchemy v1.2

Dipping potions into each other creates new potions depending
on their colors.

The current system of alchemy based on potion type (e.g.
healing + gain energy = extra healing) is changed to one based
on color (e.g. sky blue + yellow = emerald). The advantage of
this is that what potions you can get from alchemy change with
each game, which contributes to each game's uniqueness.

This patch doesn't change bones/save file compatability.

First we catagorize the potions by color and dark/light level:

Dark Light
Red ruby pink
Yellow golden yellow
Blue brilliant blue sky blue

Orange amber orange
Green dark green emerald
Purple magenta puce

Brown brown

Black black
White white
Gray cloudy

Non-colors:
murky, milky, dark, smoky, swirly, bubbly, effervescent,
fizzy, viscous

Note a few changes from vanilla: "purple-red" has been
changed to "amber" and "cyan" has been changed to "viscous".

Brown has no light/dark distinction: "brown" is both.

You could classify "milky" as White, "dark" as Black, "smoky"
as Gray, "murky" as Dark Brown and re-classify "brown" as
Light Brown. However, for balance reasons I want to cut down
on the number of possible combinations.

Combination rules:
Primary+Primary
Red+Yellow = Orange
Red+Blue = Purple
Yellow+Blue = Green

Secondary+Secondary
Always yields Brown

In the above combinations, the light/dark level of the resulting
potion will be the same as that of the input potions if they are
the same, or randomly chosen if they are different. An exception
to this rule is that if one input potion is diluted and the other
isn't, the non-diluted potion passes its light/dark level to the
resulting potion.

Black+White = Gray
Black+light color = dark color
White+dark color = light color

Other combinations:
1/2 evaporates, 1/4 sickness, 1/8 random potion, 1/8 water
(Unchanged from vanilla)

Exception:
Potion of polymorph always polymorphs the other potion instead of
combining.

Examples:
yellow + sky blue = emerald
ruby + golden = amber
orange + dark green = brown
brilliant blue + pink = equal chance of magenta or puce
diluted golden + sky blue = always emerald
pink + black = ruby
amber + white = orange.

Signed-off-by: Nephi <zindorsky@gmail.com>
Signed-off-by: Steven Noonan <steven@uplinklabs.net>
character dumps: added patch for character dumps

Authors: Tom Friedetzky, Jukka Lahtinen, Darshan Shaligram,
         Clive Crous (Slash'em version)

Source: http://www.netsonic.fi/~walker/nethack.html#dump

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
Sortloot patch (28.6.2006)

This patch optionally causes item lists be sorted alphabetically by
description when you loot or apply containers or pick up something,
and with the "full" setting also in inventory and drop listings.
The items are still grouped in classes if the sortpack option is
on, but the order of items of the same class is different.

Signed-off-by: Steven Noonan <steven@uplinklabs.net>