yet more src reformatting

Last of the suspicious block comments, plus the usual miscellaneous
stuff in files that hadn't been subjected to it before.
This commit is contained in:
PatR
2015-11-06 18:03:13 -08:00
parent a975287467
commit e322623210
7 changed files with 476 additions and 517 deletions
+2 -2
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 potion.c $NHDT-Date: 1446603164 2015/11/04 02:12:44 $ $NHDT-Branch: master $:$NHDT-Revision: 1.120 $ */ /* NetHack 3.6 potion.c $NHDT-Date: 1446861768 2015/11/07 02:02:48 $ $NHDT-Branch: master $:$NHDT-Revision: 1.121 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -623,7 +623,7 @@ register struct obj *otmp;
exercise(A_CON, TRUE); exercise(A_CON, TRUE);
if (u.ulycn >= LOW_PM) if (u.ulycn >= LOW_PM)
you_unwere(TRUE); /* "Purified" */ you_unwere(TRUE); /* "Purified" */
/* make_confused(0L,TRUE); */ /* make_confused(0L, TRUE); */
} else { } else {
if (u.ualign.type == A_LAWFUL) { if (u.ualign.type == A_LAWFUL) {
pline("This burns like acid!"); pline("This burns like acid!");
+48 -76
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 role.c $NHDT-Date: 1445906861 2015/10/27 00:47:41 $ $NHDT-Branch: master $:$NHDT-Revision: 1.33 $ */ /* NetHack 3.6 role.c $NHDT-Date: 1446861770 2015/11/07 02:02:50 $ $NHDT-Branch: master $:$NHDT-Revision: 1.34 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985-1999. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985-1999. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -34,9 +34,7 @@ const struct Role roles[] = {
{ "Speleologist", 0 }, { "Speleologist", 0 },
{ "Collector", 0 }, { "Collector", 0 },
{ "Curator", 0 } }, { "Curator", 0 } },
"Quetzalcoatl", "Quetzalcoatl", "Camaxtli", "Huhetotl", /* Central American */
"Camaxtli",
"Huhetotl", /* Central American */
"Arc", "Arc",
"the College of Archeology", "the College of Archeology",
"the Tomb of the Toltec Kings", "the Tomb of the Toltec Kings",
@@ -78,9 +76,7 @@ const struct Role roles[] = {
{ "Slayer", 0 }, { "Slayer", 0 },
{ "Chieftain", "Chieftainess" }, { "Chieftain", "Chieftainess" },
{ "Conqueror", "Conqueress" } }, { "Conqueror", "Conqueress" } },
"Mitra", "Mitra", "Crom", "Set", /* Hyborian */
"Crom",
"Set", /* Hyborian */
"Bar", "Bar",
"the Camp of the Duali Tribe", "the Camp of the Duali Tribe",
"the Duali Oasis", "the Duali Oasis",
@@ -122,9 +118,7 @@ const struct Role roles[] = {
{ "Nomad", 0 }, { "Nomad", 0 },
{ "Rover", 0 }, { "Rover", 0 },
{ "Pioneer", 0 } }, { "Pioneer", 0 } },
"Anu", "Anu", "_Ishtar", "Anshar", /* Babylonian */
"_Ishtar",
"Anshar", /* Babylonian */
"Cav", "Cav",
"the Caves of the Ancestors", "the Caves of the Ancestors",
"the Dragon's Lair", "the Dragon's Lair",
@@ -166,9 +160,7 @@ const struct Role roles[] = {
{ "Magister", "Magistra" }, { "Magister", "Magistra" },
{ "Physician", 0 }, { "Physician", 0 },
{ "Chirurgeon", 0 } }, { "Chirurgeon", 0 } },
"_Athena", "_Athena", "Hermes", "Poseidon", /* Greek */
"Hermes",
"Poseidon", /* Greek */
"Hea", "Hea",
"the Temple of Epidaurus", "the Temple of Epidaurus",
"the Temple of Coeus", "the Temple of Coeus",
@@ -209,9 +201,7 @@ const struct Role roles[] = {
{ "Chevalier", "Chevaliere" }, { "Chevalier", "Chevaliere" },
{ "Seignieur", "Dame" }, { "Seignieur", "Dame" },
{ "Paladin", 0 } }, { "Paladin", 0 } },
"Lugh", "Lugh", "_Brigit", "Manannan Mac Lir", /* Celtic */
"_Brigit",
"Manannan Mac Lir", /* Celtic */
"Kni", "Kni",
"Camelot Castle", "Camelot Castle",
"the Isle of Glass", "the Isle of Glass",
@@ -252,9 +242,7 @@ const struct Role roles[] = {
{ "Student of Winds", 0 }, { "Student of Winds", 0 },
{ "Student of Fire", 0 }, { "Student of Fire", 0 },
{ "Master", 0 } }, { "Master", 0 } },
"Shan Lai Ching", "Shan Lai Ching", "Chih Sung-tzu", "Huan Ti", /* Chinese */
"Chih Sung-tzu",
"Huan Ti", /* Chinese */
"Mon", "Mon",
"the Monastery of Chan-Sune", "the Monastery of Chan-Sune",
"the Monastery of the Earth-Lord", "the Monastery of the Earth-Lord",
@@ -296,9 +284,7 @@ const struct Role roles[] = {
{ "Lama", 0 }, { "Lama", 0 },
{ "Patriarch", "Matriarch" }, { "Patriarch", "Matriarch" },
{ "High Priest", "High Priestess" } }, { "High Priest", "High Priestess" } },
0, 0, 0, 0, /* deities from a randomly chosen other role will be used */
0,
0, /* chosen randomly from among the other roles */
"Pri", "Pri",
"the Great Temple", "the Great Temple",
"the Temple of Nalzok", "the Temple of Nalzok",
@@ -342,9 +328,7 @@ const struct Role roles[] = {
{ "Filcher", 0 }, { "Filcher", 0 },
{ "Magsman", "Magswoman" }, { "Magsman", "Magswoman" },
{ "Thief", 0 } }, { "Thief", 0 } },
"Issek", "Issek", "Mog", "Kos", /* Nehwon */
"Mog",
"Kos", /* Nehwon */
"Rog", "Rog",
"the Thieves' Guild Hall", "the Thieves' Guild Hall",
"the Assassins' Guild Hall", "the Assassins' Guild Hall",
@@ -378,31 +362,28 @@ const struct Role roles[] = {
{ { "Ranger", 0 }, { { "Ranger", 0 },
{ {
#if 0 /* OBSOLETE */ #if 0 /* OBSOLETE */
{"Edhel", "Elleth"}, {"Edhel", "Elleth"},
{"Edhel", "Elleth"}, /* elf-maid */ {"Edhel", "Elleth"}, /* elf-maid */
{"Ohtar", "Ohtie"}, /* warrior */ {"Ohtar", "Ohtie"}, /* warrior */
{"Kano", /* commander (Q.) ['a] */ {"Kano", "Kanie"}, /* commander (Q.) ['a] educated guess,
"Kanie"}, /* educated guess, until further research- SAC */ until further research- SAC */
{"Arandur", /* king's servant, minister (Q.) - guess */ {"Arandur"," Aranduriel"}, /* king's servant, minister (Q.) - guess */
"Aranduriel"}, /* educated guess */ {"Hir", "Hiril"}, /* lord, lady (S.) ['ir] */
{"Hir", "Hiril"}, /* lord, lady (S.) ['ir] */ {"Aredhel", "Arwen"}, /* noble elf, maiden (S.) */
{"Aredhel", "Arwen"}, /* noble elf, maiden (S.) */ {"Ernil", "Elentariel"}, /* prince (S.), elf-maiden (Q.) */
{"Ernil", "Elentariel"}, /* prince (S.), elf-maiden (Q.) */ {"Elentar", "Elentari"}, /* Star-king, -queen (Q.) */
{"Elentar", "Elentari"}, /* Star-king, -queen (Q.) */ "Solonor Thelandira", "Aerdrie Faenya", "Lolth", /* Elven */
"Solonor Thelandira", "Aerdrie Faenya", "Lolth", /* Elven */
#endif #endif
{ "Tenderfoot", 0 }, { "Tenderfoot", 0 },
{ "Lookout", 0 }, { "Lookout", 0 },
{ "Trailblazer", 0 }, { "Trailblazer", 0 },
{ "Reconnoiterer", "Reconnoiteress" }, { "Reconnoiterer", "Reconnoiteress" },
{ "Scout", 0 }, { "Scout", 0 },
{ "Arbalester", 0 }, /* One skilled at crossbows */ { "Arbalester", 0 }, /* One skilled at crossbows */
{ "Archer", 0 }, { "Archer", 0 },
{ "Sharpshooter", 0 }, { "Sharpshooter", 0 },
{ "Marksman", "Markswoman" } }, { "Marksman", "Markswoman" } },
"Mercury", "Mercury", "_Venus", "Mars", /* Roman/planets */
"_Venus",
"Mars", /* Roman/planets */
"Ran", "Ran",
"Orion's camp", "Orion's camp",
"the cave of the wumpus", "the cave of the wumpus",
@@ -444,9 +425,7 @@ const struct Role roles[] = {
{ "Daimyo", 0 }, /* a samurai lord */ { "Daimyo", 0 }, /* a samurai lord */
{ "Kuge", 0 }, /* Noble of the Court */ { "Kuge", 0 }, /* Noble of the Court */
{ "Shogun", 0 } }, /* supreme commander, warlord */ { "Shogun", 0 } }, /* supreme commander, warlord */
"_Amaterasu Omikami", "_Amaterasu Omikami", "Raijin", "Susanowo", /* Japanese */
"Raijin",
"Susanowo", /* Japanese */
"Sam", "Sam",
"the Castle of the Taro Clan", "the Castle of the Taro Clan",
"the Shogun's Castle", "the Shogun's Castle",
@@ -487,9 +466,7 @@ const struct Role roles[] = {
{ "Voyager", 0 }, { "Voyager", 0 },
{ "Explorer", 0 }, { "Explorer", 0 },
{ "Adventurer", 0 } }, { "Adventurer", 0 } },
"Blind Io", "Blind Io", "_The Lady", "Offler", /* Discworld */
"_The Lady",
"Offler", /* Discworld */
"Tou", "Tou",
"Ankh-Morpork", "Ankh-Morpork",
"the Thieves' Guild Hall", "the Thieves' Guild Hall",
@@ -530,9 +507,7 @@ const struct Role roles[] = {
{ "Hero", "Heroine" }, { "Hero", "Heroine" },
{ "Champion", 0 }, { "Champion", 0 },
{ "Lord", "Lady" } }, { "Lord", "Lady" } },
"Tyr", "Tyr", "Odin", "Loki", /* Norse */
"Odin",
"Loki", /* Norse */
"Val", "Val",
"the Shrine of Destiny", "the Shrine of Destiny",
"the cave of Surtur", "the cave of Surtur",
@@ -573,9 +548,7 @@ const struct Role roles[] = {
{ "Necromancer", 0 }, { "Necromancer", 0 },
{ "Wizard", 0 }, { "Wizard", 0 },
{ "Mage", 0 } }, { "Mage", 0 } },
"Ptah", "Ptah", "Thoth", "Anhur", /* Egyptian */
"Thoth",
"Anhur", /* Egyptian */
"Wiz", "Wiz",
"the Lonely Tower", "the Lonely Tower",
"the Tower of Darkness", "the Tower of Darkness",
@@ -1787,7 +1760,7 @@ winid where;
a = 1; /* aligns[neutral] */ a = 1; /* aligns[neutral] */
else if ((allowmask & ROLE_ALIGNMASK) == AM_CHAOTIC) else if ((allowmask & ROLE_ALIGNMASK) == AM_CHAOTIC)
a = 2; /* alings[chaotic] */ a = 2; /* alings[chaotic] */
/* [c never forces gender] */ /* [c never forces gender] */
} }
/* [g and a don't constrain anything sufficiently /* [g and a don't constrain anything sufficiently
to narrow something done to a single choice] */ to narrow something done to a single choice] */
@@ -1979,18 +1952,19 @@ winid where;
} }
/* /*
* Special setup modifications here: * Special setup modifications here:
* *
* Unfortunately, this is going to have to be done * Unfortunately, this is going to have to be done
* on each newgame or restore, because you lose the permonst mods * on each newgame or restore, because you lose the permonst mods
* across a save/restore. :-) * across a save/restore. :-)
* *
* 1 - The Rogue Leader is the Tourist Nemesis. * 1 - The Rogue Leader is the Tourist Nemesis.
* 2 - Priests start with a random alignment - convert the leader and * 2 - Priests start with a random alignment - convert the leader and
* guardians here. * guardians here.
* 3 - Elves can have one of two different leaders, but can't work it * 3 - Priests also get their of deities from a randomly chosen role.
* out here because it requires hacking the level file data (see * 4 - [obsolete] Elves can have one of two different leaders,
* sp_lev.c). * but can't work it out here because it requires hacking the
* level file data (see sp_lev.c).
* *
* This code also replaces quest_init(). * This code also replaces quest_init().
*/ */
@@ -2074,10 +2048,8 @@ role_init()
pm->mflags3 |= M3_WANTSARTI | M3_WAITFORU; pm->mflags3 |= M3_WANTSARTI | M3_WAITFORU;
/* if gender is random, we choose it now instead of waiting /* if gender is random, we choose it now instead of waiting
until the nemesis monster is created */ until the nemesis monster is created */
quest_status.nemgend = quest_status.nemgend = is_neuter(pm) ? 2 : is_female(pm) ? 1
is_neuter(pm) ? 2 : is_female(pm) ? 1 : is_male(pm) : is_male(pm) ? 0 : (rn2(100) < 50);
? 0
: (rn2(100) < 50);
} }
/* Fix up the god names */ /* Fix up the god names */
+88 -97
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 timeout.c $NHDT-Date: 1440120659 2015/08/21 01:30:59 $ $NHDT-Branch: master $:$NHDT-Revision: 1.60 $ */ /* NetHack 3.6 timeout.c $NHDT-Date: 1446861771 2015/11/07 02:02:51 $ $NHDT-Branch: master $:$NHDT-Revision: 1.63 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -43,8 +43,8 @@ stoned_dialogue()
nomul(0); nomul(0);
break; break;
case 4: /* limbs stiffening */ case 4: /* limbs stiffening */
/* just one move left to save oneself so quit fiddling around; /* just one move left to save oneself so quit fiddling around;
don't stop attempt to eat tin--might be lizard or acidic */ don't stop attempt to eat tin--might be lizard or acidic */
if (!Popeye(STONED)) if (!Popeye(STONED))
stop_occupation(); stop_occupation();
if (multi > 0) if (multi > 0)
@@ -451,8 +451,8 @@ boolean wakeup_msg;
} }
/* Attach an egg hatch timeout to the given egg. /* Attach an egg hatch timeout to the given egg.
* when = Time to hatch, usually only passed if re-creating an * when = Time to hatch, usually only passed if re-creating an
* existing hatch timer. Pass 0L for random hatch time. * existing hatch timer. Pass 0L for random hatch time.
*/ */
void void
attach_egg_hatch_timeout(egg, when) attach_egg_hatch_timeout(egg, when)
@@ -546,33 +546,28 @@ long timeout;
hatchcount -= i; hatchcount -= i;
egg->quan -= (long) hatchcount; egg->quan -= (long) hatchcount;
} }
}
#if 0 #if 0
/* /*
* We could possibly hatch while migrating, but the code isn't * We could possibly hatch while migrating, but the code isn't
* set up for it... * set up for it...
*/ */
else if (obj->where == OBJ_MIGRATING) { } else if (obj->where == OBJ_MIGRATING) {
/* /*
We can do several things. The first ones that come to * We can do several things. The first ones that come to
mind are: * mind are:
* + Create the hatched monster then place it on the migrating
+ Create the hatched monster then place it on the migrating * mons list. This is tough because all makemon() is made
mons list. This is tough because all makemon() is made * to place the monster as well. Makemon() also doesn't lend
to place the monster as well. Makemon() also doesn't * itself well to splitting off a "not yet placed" subroutine.
lend itself well to splitting off a "not yet placed" * + Mark the egg as hatched, then place the monster when we
subroutine. * place the migrating objects.
* + Or just kill any egg which gets sent to another level.
+ Mark the egg as hatched, then place the monster when we * Falling is the usual reason such transportation occurs.
place the migrating objects. */
cansee_hatchspot = FALSE;
+ Or just kill any egg which gets sent to another level. mon = ???;
Falling is the usual reason such transportation occurs.
*/
cansee_hatchspot = FALSE;
mon = ???
}
#endif #endif
}
if (mon) { if (mon) {
char monnambuf[BUFSZ], carriedby[BUFSZ]; char monnambuf[BUFSZ], carriedby[BUFSZ];
@@ -630,8 +625,8 @@ long timeout;
} }
break; break;
#if 0 #if 0
case OBJ_MIGRATING: case OBJ_MIGRATING:
break; break;
#endif #endif
default: default:
impossible("egg hatched where? (%d)", (int) egg->where); impossible("egg hatched where? (%d)", (int) egg->where);
@@ -703,17 +698,16 @@ slip_or_trip()
otmp = 0; otmp = 0;
if (otmp && on_foot) { /* trip over something in particular */ if (otmp && on_foot) { /* trip over something in particular */
/* /*
If there is only one item, it will have just been named If there is only one item, it will have just been named
during the move, so refer to by via pronoun; otherwise, during the move, so refer to by via pronoun; otherwise,
if the top item has been or can be seen, refer to it by if the top item has been or can be seen, refer to it by
name; if not, look for rocks to trip over; trip over name; if not, look for rocks to trip over; trip over
anonymous "something" if there aren't any rocks. anonymous "something" if there aren't any rocks.
*/ */
what = what = (iflags.last_msg == PLNMSG_ONE_ITEM_HERE)
(iflags.last_msg == PLNMSG_ONE_ITEM_HERE) ? ((otmp->quan == 1L) ? "it"
? ((otmp->quan == 1L) ? "it" : Hallucination ? "they" : Hallucination ? "they" : "them")
: "them")
: (otmp->dknown || !Blind) : (otmp->dknown || !Blind)
? doname(otmp) ? doname(otmp)
: ((otmp2 = sobj_at(ROCK, u.ux, u.uy)) == 0 : ((otmp2 = sobj_at(ROCK, u.ux, u.uy)) == 0
@@ -1100,17 +1094,15 @@ long timeout;
* a timer. * a timer.
* *
* Burn rules: * Burn rules:
* potions of oil, lamps & candles: * potions of oil, lamps & candles:
* age = # of turns of fuel left * age = # of turns of fuel left
* spe = <unused> * spe = <unused>
* * magic lamps:
* magic lamps: * age = <unused>
* age = <unused> * spe = 0 not lightable, 1 lightable forever
* spe = 0 not lightable, 1 lightable forever * candelabrum:
* * age = # of turns of fuel left
* candelabrum: * spe = # of candles
* age = # of turns of fuel left
* spe = # of candles
* *
* Once the burn begins, the age will be set to the amount of fuel * Once the burn begins, the age will be set to the amount of fuel
* remaining _once_the_burn_finishes_. If the burn is terminated * remaining _once_the_burn_finishes_. If the burn is terminated
@@ -1314,56 +1306,55 @@ do_storms()
* Interface: * Interface:
* *
* General: * General:
* boolean start_timer(long timeout,short kind,short func_index, * boolean start_timer(long timeout,short kind,short func_index,
* anything *arg) * anything *arg)
* Start a timer of kind 'kind' that will expire at time * Start a timer of kind 'kind' that will expire at time
* monstermoves+'timeout'. Call the function at 'func_index' * monstermoves+'timeout'. Call the function at 'func_index'
* in the timeout table using argument 'arg'. Return TRUE if * in the timeout table using argument 'arg'. Return TRUE if
* a timer was started. This places the timer on a list ordered * a timer was started. This places the timer on a list ordered
* "sooner" to "later". If an object, increment the object's * "sooner" to "later". If an object, increment the object's
* timer count. * timer count.
* *
* long stop_timer(short func_index, anything *arg) * long stop_timer(short func_index, anything *arg)
* Stop a timer specified by the (func_index, arg) pair. This * Stop a timer specified by the (func_index, arg) pair. This
* assumes that such a pair is unique. Return the time the * assumes that such a pair is unique. Return the time the
* timer would have gone off. If no timer is found, return 0. * timer would have gone off. If no timer is found, return 0.
* If an object, decrement the object's timer count. * If an object, decrement the object's timer count.
* *
* long peek_timer(short func_index, anything *arg) * long peek_timer(short func_index, anything *arg)
* Return time specified timer will go off (0 if no such timer). * Return time specified timer will go off (0 if no such timer).
*
* void run_timers(void)
* Call timers that have timed out.
* *
* void run_timers(void)
* Call timers that have timed out.
* *
* Save/Restore: * Save/Restore:
* void save_timers(int fd, int mode, int range) * void save_timers(int fd, int mode, int range)
* Save all timers of range 'range'. Range is either global * Save all timers of range 'range'. Range is either global
* or local. Global timers follow game play, local timers * or local. Global timers follow game play, local timers
* are saved with a level. Object and monster timers are * are saved with a level. Object and monster timers are
* saved using their respective id's instead of pointers. * saved using their respective id's instead of pointers.
* *
* void restore_timers(int fd, int range, boolean ghostly, long adjust) * void restore_timers(int fd, int range, boolean ghostly, long adjust)
* Restore timers of range 'range'. If from a ghost pile, * Restore timers of range 'range'. If from a ghost pile,
* adjust the timeout by 'adjust'. The object and monster * adjust the timeout by 'adjust'. The object and monster
* ids are not restored until later. * ids are not restored until later.
* *
* void relink_timers(boolean ghostly) * void relink_timers(boolean ghostly)
* Relink all object and monster timers that had been saved * Relink all object and monster timers that had been saved
* using their object's or monster's id number. * using their object's or monster's id number.
* *
* Object Specific: * Object Specific:
* void obj_move_timers(struct obj *src, struct obj *dest) * void obj_move_timers(struct obj *src, struct obj *dest)
* Reassign all timers from src to dest. * Reassign all timers from src to dest.
* *
* void obj_split_timers(struct obj *src, struct obj *dest) * void obj_split_timers(struct obj *src, struct obj *dest)
* Duplicate all timers assigned to src and attach them to dest. * Duplicate all timers assigned to src and attach them to dest.
* *
* void obj_stop_timers(struct obj *obj) * void obj_stop_timers(struct obj *obj)
* Stop all timers attached to obj. * Stop all timers attached to obj.
* *
* boolean obj_has_timer(struct obj *object, short timer_type) * boolean obj_has_timer(struct obj *object, short timer_type)
* Check whether object has a timer of type timer_type. * Check whether object has a timer of type timer_type.
*/ */
STATIC_DCL const char *FDECL(kind_name, (SHORT_P)); STATIC_DCL const char *FDECL(kind_name, (SHORT_P));
@@ -1672,7 +1663,7 @@ short timer_type;
{ {
long timeout = peek_timer(timer_type, obj_to_any(object)); long timeout = peek_timer(timer_type, obj_to_any(object));
return (boolean)(timeout != 0L); return (boolean) (timeout != 0L);
} }
/* /*
@@ -1933,12 +1924,12 @@ boolean write_it;
* timers. * timers.
* *
* Global range: * Global range:
* + timeouts that follow the hero (global) * + timeouts that follow the hero (global)
* + timeouts that follow obj & monst that are migrating * + timeouts that follow obj & monst that are migrating
* *
* Level range: * Level range:
* + timeouts that are level specific (e.g. storms) * + timeouts that are level specific (e.g. storms)
* + timeouts that stay with the level (obj & monst) * + timeouts that stay with the level (obj & monst)
*/ */
void void
save_timers(fd, mode, range) save_timers(fd, mode, range)
+222 -224
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 u_init.c $NHDT-Date: 1432512766 2015/05/25 00:12:46 $ $NHDT-Branch: master $:$NHDT-Revision: 1.34 $ */ /* NetHack 3.6 u_init.c $NHDT-Date: 1446861772 2015/11/07 02:02:52 $ $NHDT-Branch: master $:$NHDT-Revision: 1.35 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -22,7 +22,7 @@ STATIC_DCL boolean FDECL(restricted_spell_discipline, (int));
#define UNDEF_BLESS 2 #define UNDEF_BLESS 2
/* /*
* Initial inventory for the various roles. * Initial inventory for the various roles.
*/ */
static struct trobj Archeologist[] = { static struct trobj Archeologist[] = {
@@ -170,7 +170,7 @@ static struct trobj Wizard[] = {
}; };
/* /*
* Optional extra inventory items. * Optional extra inventory items.
*/ */
static struct trobj Tinopener[] = { { TIN_OPENER, 0, TOOL_CLASS, 1, 0 }, static struct trobj Tinopener[] = { { TIN_OPENER, 0, TOOL_CLASS, 1, 0 },
@@ -184,8 +184,7 @@ static struct trobj Blindfold[] = { { BLINDFOLD, 0, TOOL_CLASS, 1, 0 },
{ 0, 0, 0, 0, 0 } }; { 0, 0, 0, 0, 0 } };
static struct trobj Instrument[] = { { WOODEN_FLUTE, 0, TOOL_CLASS, 1, 0 }, static struct trobj Instrument[] = { { WOODEN_FLUTE, 0, TOOL_CLASS, 1, 0 },
{ 0, 0, 0, 0, 0 } }; { 0, 0, 0, 0, 0 } };
static struct trobj Xtra_food[] = { { UNDEF_TYP, UNDEF_SPE, FOOD_CLASS, 2, static struct trobj Xtra_food[] = { { UNDEF_TYP, UNDEF_SPE, FOOD_CLASS, 2, 0 },
0 },
{ 0, 0, 0, 0, 0 } }; { 0, 0, 0, 0, 0 } };
static struct trobj Leash[] = { { LEASH, 0, TOOL_CLASS, 1, 0 }, static struct trobj Leash[] = { { LEASH, 0, TOOL_CLASS, 1, 0 },
{ 0, 0, 0, 0, 0 } }; { 0, 0, 0, 0, 0 } };
@@ -207,7 +206,7 @@ static struct inv_sub {
{ PM_ELF, BOW, ELVEN_BOW }, { PM_ELF, BOW, ELVEN_BOW },
{ PM_ELF, ARROW, ELVEN_ARROW }, { PM_ELF, ARROW, ELVEN_ARROW },
{ PM_ELF, HELMET, ELVEN_LEATHER_HELM }, { PM_ELF, HELMET, ELVEN_LEATHER_HELM },
/* { PM_ELF, SMALL_SHIELD, ELVEN_SHIELD }, */ /* { PM_ELF, SMALL_SHIELD, ELVEN_SHIELD }, */
{ PM_ELF, CLOAK_OF_DISPLACEMENT, ELVEN_CLOAK }, { PM_ELF, CLOAK_OF_DISPLACEMENT, ELVEN_CLOAK },
{ PM_ELF, CRAM_RATION, LEMBAS_WAFER }, { PM_ELF, CRAM_RATION, LEMBAS_WAFER },
{ PM_ORC, DAGGER, ORCISH_DAGGER }, { PM_ORC, DAGGER, ORCISH_DAGGER },
@@ -222,103 +221,104 @@ static struct inv_sub {
{ PM_DWARF, SPEAR, DWARVISH_SPEAR }, { PM_DWARF, SPEAR, DWARVISH_SPEAR },
{ PM_DWARF, SHORT_SWORD, DWARVISH_SHORT_SWORD }, { PM_DWARF, SHORT_SWORD, DWARVISH_SHORT_SWORD },
{ PM_DWARF, HELMET, DWARVISH_IRON_HELM }, { PM_DWARF, HELMET, DWARVISH_IRON_HELM },
/* { PM_DWARF, SMALL_SHIELD, DWARVISH_ROUNDSHIELD }, */ /* { PM_DWARF, SMALL_SHIELD, DWARVISH_ROUNDSHIELD }, */
/* { PM_DWARF, PICK_AXE, DWARVISH_MATTOCK }, */ /* { PM_DWARF, PICK_AXE, DWARVISH_MATTOCK }, */
{ PM_GNOME, BOW, CROSSBOW }, { PM_GNOME, BOW, CROSSBOW },
{ PM_GNOME, ARROW, CROSSBOW_BOLT }, { PM_GNOME, ARROW, CROSSBOW_BOLT },
{ NON_PM, STRANGE_OBJECT, STRANGE_OBJECT } { NON_PM, STRANGE_OBJECT, STRANGE_OBJECT }
}; };
static const struct def_skill Skill_A[] = { { P_DAGGER, P_BASIC }, static const struct def_skill Skill_A[] = {
{ P_KNIFE, P_BASIC }, { P_DAGGER, P_BASIC },
{ P_PICK_AXE, P_EXPERT }, { P_KNIFE, P_BASIC },
{ P_SHORT_SWORD, P_BASIC }, { P_PICK_AXE, P_EXPERT },
{ P_SCIMITAR, P_SKILLED }, { P_SHORT_SWORD, P_BASIC },
{ P_SABER, P_EXPERT }, { P_SCIMITAR, P_SKILLED },
{ P_CLUB, P_SKILLED }, { P_SABER, P_EXPERT },
{ P_QUARTERSTAFF, P_SKILLED }, { P_CLUB, P_SKILLED },
{ P_SLING, P_SKILLED }, { P_QUARTERSTAFF, P_SKILLED },
{ P_DART, P_BASIC }, { P_SLING, P_SKILLED },
{ P_BOOMERANG, P_EXPERT }, { P_DART, P_BASIC },
{ P_WHIP, P_EXPERT }, { P_BOOMERANG, P_EXPERT },
{ P_UNICORN_HORN, P_SKILLED }, { P_WHIP, P_EXPERT },
{ P_ATTACK_SPELL, P_BASIC }, { P_UNICORN_HORN, P_SKILLED },
{ P_HEALING_SPELL, P_BASIC }, { P_ATTACK_SPELL, P_BASIC },
{ P_DIVINATION_SPELL, P_EXPERT }, { P_HEALING_SPELL, P_BASIC },
{ P_MATTER_SPELL, P_BASIC }, { P_DIVINATION_SPELL, P_EXPERT },
{ P_RIDING, P_BASIC }, { P_MATTER_SPELL, P_BASIC },
{ P_TWO_WEAPON_COMBAT, P_BASIC }, { P_RIDING, P_BASIC },
{ P_BARE_HANDED_COMBAT, { P_TWO_WEAPON_COMBAT, P_BASIC },
P_EXPERT }, { P_BARE_HANDED_COMBAT, P_EXPERT },
{ P_NONE, 0 } }; { P_NONE, 0 }
};
static const struct def_skill Skill_B[] = { { P_DAGGER, P_BASIC }, static const struct def_skill Skill_B[] = {
{ P_AXE, P_EXPERT }, { P_DAGGER, P_BASIC },
{ P_PICK_AXE, P_SKILLED }, { P_AXE, P_EXPERT },
{ P_SHORT_SWORD, P_EXPERT }, { P_PICK_AXE, P_SKILLED },
{ P_BROAD_SWORD, P_SKILLED }, { P_SHORT_SWORD, P_EXPERT },
{ P_LONG_SWORD, P_SKILLED }, { P_BROAD_SWORD, P_SKILLED },
{ P_TWO_HANDED_SWORD, P_EXPERT }, { P_LONG_SWORD, P_SKILLED },
{ P_SCIMITAR, P_SKILLED }, { P_TWO_HANDED_SWORD, P_EXPERT },
{ P_SABER, P_BASIC }, { P_SCIMITAR, P_SKILLED },
{ P_CLUB, P_SKILLED }, { P_SABER, P_BASIC },
{ P_MACE, P_SKILLED }, { P_CLUB, P_SKILLED },
{ P_MORNING_STAR, P_SKILLED }, { P_MACE, P_SKILLED },
{ P_FLAIL, P_BASIC }, { P_MORNING_STAR, P_SKILLED },
{ P_HAMMER, P_EXPERT }, { P_FLAIL, P_BASIC },
{ P_QUARTERSTAFF, P_BASIC }, { P_HAMMER, P_EXPERT },
{ P_SPEAR, P_SKILLED }, { P_QUARTERSTAFF, P_BASIC },
{ P_TRIDENT, P_SKILLED }, { P_SPEAR, P_SKILLED },
{ P_BOW, P_BASIC }, { P_TRIDENT, P_SKILLED },
{ P_ATTACK_SPELL, P_SKILLED }, { P_BOW, P_BASIC },
{ P_RIDING, P_BASIC }, { P_ATTACK_SPELL, P_SKILLED },
{ P_TWO_WEAPON_COMBAT, P_BASIC }, { P_RIDING, P_BASIC },
{ P_BARE_HANDED_COMBAT, { P_TWO_WEAPON_COMBAT, P_BASIC },
P_MASTER }, { P_BARE_HANDED_COMBAT, P_MASTER },
{ P_NONE, 0 } }; { P_NONE, 0 }
};
static const struct def_skill Skill_C[] = { { P_DAGGER, P_BASIC }, static const struct def_skill Skill_C[] = {
{ P_KNIFE, P_SKILLED }, { P_DAGGER, P_BASIC },
{ P_AXE, P_SKILLED }, { P_KNIFE, P_SKILLED },
{ P_PICK_AXE, P_BASIC }, { P_AXE, P_SKILLED },
{ P_CLUB, P_EXPERT }, { P_PICK_AXE, P_BASIC },
{ P_MACE, P_EXPERT }, { P_CLUB, P_EXPERT },
{ P_MORNING_STAR, P_BASIC }, { P_MACE, P_EXPERT },
{ P_FLAIL, P_SKILLED }, { P_MORNING_STAR, P_BASIC },
{ P_HAMMER, P_SKILLED }, { P_FLAIL, P_SKILLED },
{ P_QUARTERSTAFF, P_EXPERT }, { P_HAMMER, P_SKILLED },
{ P_POLEARMS, P_SKILLED }, { P_QUARTERSTAFF, P_EXPERT },
{ P_SPEAR, P_EXPERT }, { P_POLEARMS, P_SKILLED },
{ P_TRIDENT, P_SKILLED }, { P_SPEAR, P_EXPERT },
{ P_BOW, P_SKILLED }, { P_TRIDENT, P_SKILLED },
{ P_SLING, P_EXPERT }, { P_BOW, P_SKILLED },
{ P_ATTACK_SPELL, P_BASIC }, { P_SLING, P_EXPERT },
{ P_MATTER_SPELL, P_SKILLED }, { P_ATTACK_SPELL, P_BASIC },
{ P_BOOMERANG, P_EXPERT }, { P_MATTER_SPELL, P_SKILLED },
{ P_UNICORN_HORN, P_BASIC }, { P_BOOMERANG, P_EXPERT },
{ P_BARE_HANDED_COMBAT, { P_UNICORN_HORN, P_BASIC },
P_MASTER }, { P_BARE_HANDED_COMBAT, P_MASTER },
{ P_NONE, 0 } }; { P_NONE, 0 }
};
static const struct def_skill Skill_H[] = { { P_DAGGER, P_SKILLED }, static const struct def_skill Skill_H[] = {
{ P_KNIFE, P_EXPERT }, { P_DAGGER, P_SKILLED },
{ P_SHORT_SWORD, P_SKILLED }, { P_KNIFE, P_EXPERT },
{ P_SCIMITAR, P_BASIC }, { P_SHORT_SWORD, P_SKILLED },
{ P_SABER, P_BASIC }, { P_SCIMITAR, P_BASIC },
{ P_CLUB, P_SKILLED }, { P_SABER, P_BASIC },
{ P_MACE, P_BASIC }, { P_CLUB, P_SKILLED },
{ P_QUARTERSTAFF, P_EXPERT }, { P_MACE, P_BASIC },
{ P_POLEARMS, P_BASIC }, { P_QUARTERSTAFF, P_EXPERT },
{ P_SPEAR, P_BASIC }, { P_POLEARMS, P_BASIC },
{ P_TRIDENT, P_BASIC }, { P_SPEAR, P_BASIC },
{ P_SLING, P_SKILLED }, { P_TRIDENT, P_BASIC },
{ P_DART, P_EXPERT }, { P_SLING, P_SKILLED },
{ P_SHURIKEN, P_SKILLED }, { P_DART, P_EXPERT },
{ P_UNICORN_HORN, P_EXPERT }, { P_SHURIKEN, P_SKILLED },
{ P_HEALING_SPELL, P_EXPERT }, { P_UNICORN_HORN, P_EXPERT },
{ P_BARE_HANDED_COMBAT, P_BASIC }, { P_HEALING_SPELL, P_EXPERT },
{ P_NONE, 0 } }; { P_BARE_HANDED_COMBAT, P_BASIC },
{ P_NONE, 0 }
};
static const struct def_skill Skill_K[] = { static const struct def_skill Skill_K[] = {
{ P_DAGGER, P_BASIC }, { P_DAGGER, P_BASIC },
{ P_KNIFE, P_BASIC }, { P_KNIFE, P_BASIC },
@@ -349,7 +349,6 @@ static const struct def_skill Skill_K[] = {
{ P_BARE_HANDED_COMBAT, P_EXPERT }, { P_BARE_HANDED_COMBAT, P_EXPERT },
{ P_NONE, 0 } { P_NONE, 0 }
}; };
static const struct def_skill Skill_Mon[] = { static const struct def_skill Skill_Mon[] = {
{ P_QUARTERSTAFF, P_BASIC }, { P_QUARTERSTAFF, P_BASIC },
{ P_SPEAR, P_BASIC }, { P_SPEAR, P_BASIC },
@@ -365,57 +364,57 @@ static const struct def_skill Skill_Mon[] = {
{ P_MARTIAL_ARTS, P_GRAND_MASTER }, { P_MARTIAL_ARTS, P_GRAND_MASTER },
{ P_NONE, 0 } { P_NONE, 0 }
}; };
static const struct def_skill Skill_P[] = {
static const struct def_skill Skill_P[] = { { P_CLUB, P_EXPERT }, { P_CLUB, P_EXPERT },
{ P_MACE, P_EXPERT }, { P_MACE, P_EXPERT },
{ P_MORNING_STAR, P_EXPERT }, { P_MORNING_STAR, P_EXPERT },
{ P_FLAIL, P_EXPERT }, { P_FLAIL, P_EXPERT },
{ P_HAMMER, P_EXPERT }, { P_HAMMER, P_EXPERT },
{ P_QUARTERSTAFF, P_EXPERT }, { P_QUARTERSTAFF, P_EXPERT },
{ P_POLEARMS, P_SKILLED }, { P_POLEARMS, P_SKILLED },
{ P_SPEAR, P_SKILLED }, { P_SPEAR, P_SKILLED },
{ P_TRIDENT, P_SKILLED }, { P_TRIDENT, P_SKILLED },
{ P_LANCE, P_BASIC }, { P_LANCE, P_BASIC },
{ P_BOW, P_BASIC }, { P_BOW, P_BASIC },
{ P_SLING, P_BASIC }, { P_SLING, P_BASIC },
{ P_CROSSBOW, P_BASIC }, { P_CROSSBOW, P_BASIC },
{ P_DART, P_BASIC }, { P_DART, P_BASIC },
{ P_SHURIKEN, P_BASIC }, { P_SHURIKEN, P_BASIC },
{ P_BOOMERANG, P_BASIC }, { P_BOOMERANG, P_BASIC },
{ P_UNICORN_HORN, P_SKILLED }, { P_UNICORN_HORN, P_SKILLED },
{ P_HEALING_SPELL, P_EXPERT }, { P_HEALING_SPELL, P_EXPERT },
{ P_DIVINATION_SPELL, P_EXPERT }, { P_DIVINATION_SPELL, P_EXPERT },
{ P_CLERIC_SPELL, P_EXPERT }, { P_CLERIC_SPELL, P_EXPERT },
{ P_BARE_HANDED_COMBAT, P_BASIC }, { P_BARE_HANDED_COMBAT, P_BASIC },
{ P_NONE, 0 } }; { P_NONE, 0 }
};
static const struct def_skill Skill_R[] = { { P_DAGGER, P_EXPERT }, static const struct def_skill Skill_R[] = {
{ P_KNIFE, P_EXPERT }, { P_DAGGER, P_EXPERT },
{ P_SHORT_SWORD, P_EXPERT }, { P_KNIFE, P_EXPERT },
{ P_BROAD_SWORD, P_SKILLED }, { P_SHORT_SWORD, P_EXPERT },
{ P_LONG_SWORD, P_SKILLED }, { P_BROAD_SWORD, P_SKILLED },
{ P_TWO_HANDED_SWORD, P_BASIC }, { P_LONG_SWORD, P_SKILLED },
{ P_SCIMITAR, P_SKILLED }, { P_TWO_HANDED_SWORD, P_BASIC },
{ P_SABER, P_SKILLED }, { P_SCIMITAR, P_SKILLED },
{ P_CLUB, P_SKILLED }, { P_SABER, P_SKILLED },
{ P_MACE, P_SKILLED }, { P_CLUB, P_SKILLED },
{ P_MORNING_STAR, P_BASIC }, { P_MACE, P_SKILLED },
{ P_FLAIL, P_BASIC }, { P_MORNING_STAR, P_BASIC },
{ P_HAMMER, P_BASIC }, { P_FLAIL, P_BASIC },
{ P_POLEARMS, P_BASIC }, { P_HAMMER, P_BASIC },
{ P_SPEAR, P_BASIC }, { P_POLEARMS, P_BASIC },
{ P_CROSSBOW, P_EXPERT }, { P_SPEAR, P_BASIC },
{ P_DART, P_EXPERT }, { P_CROSSBOW, P_EXPERT },
{ P_SHURIKEN, P_SKILLED }, { P_DART, P_EXPERT },
{ P_DIVINATION_SPELL, P_SKILLED }, { P_SHURIKEN, P_SKILLED },
{ P_ESCAPE_SPELL, P_SKILLED }, { P_DIVINATION_SPELL, P_SKILLED },
{ P_MATTER_SPELL, P_SKILLED }, { P_ESCAPE_SPELL, P_SKILLED },
{ P_RIDING, P_BASIC }, { P_MATTER_SPELL, P_SKILLED },
{ P_TWO_WEAPON_COMBAT, P_EXPERT }, { P_RIDING, P_BASIC },
{ P_BARE_HANDED_COMBAT, { P_TWO_WEAPON_COMBAT, P_EXPERT },
P_EXPERT }, { P_BARE_HANDED_COMBAT, P_EXPERT },
{ P_NONE, 0 } }; { P_NONE, 0 }
};
static const struct def_skill Skill_Ran[] = { static const struct def_skill Skill_Ran[] = {
{ P_DAGGER, P_EXPERT }, { P_DAGGER, P_EXPERT },
{ P_KNIFE, P_SKILLED }, { P_KNIFE, P_SKILLED },
@@ -443,29 +442,29 @@ static const struct def_skill Skill_Ran[] = {
{ P_BARE_HANDED_COMBAT, P_BASIC }, { P_BARE_HANDED_COMBAT, P_BASIC },
{ P_NONE, 0 } { P_NONE, 0 }
}; };
static const struct def_skill Skill_S[] = {
static const struct def_skill Skill_S[] = { { P_DAGGER, P_BASIC }, { P_DAGGER, P_BASIC },
{ P_KNIFE, P_SKILLED }, { P_KNIFE, P_SKILLED },
{ P_SHORT_SWORD, P_EXPERT }, { P_SHORT_SWORD, P_EXPERT },
{ P_BROAD_SWORD, P_SKILLED }, { P_BROAD_SWORD, P_SKILLED },
{ P_LONG_SWORD, P_EXPERT }, { P_LONG_SWORD, P_EXPERT },
{ P_TWO_HANDED_SWORD, P_EXPERT }, { P_TWO_HANDED_SWORD, P_EXPERT },
{ P_SCIMITAR, P_BASIC }, { P_SCIMITAR, P_BASIC },
{ P_SABER, P_BASIC }, { P_SABER, P_BASIC },
{ P_FLAIL, P_SKILLED }, { P_FLAIL, P_SKILLED },
{ P_QUARTERSTAFF, P_BASIC }, { P_QUARTERSTAFF, P_BASIC },
{ P_POLEARMS, P_SKILLED }, { P_POLEARMS, P_SKILLED },
{ P_SPEAR, P_SKILLED }, { P_SPEAR, P_SKILLED },
{ P_LANCE, P_SKILLED }, { P_LANCE, P_SKILLED },
{ P_BOW, P_EXPERT }, { P_BOW, P_EXPERT },
{ P_SHURIKEN, P_EXPERT }, { P_SHURIKEN, P_EXPERT },
{ P_ATTACK_SPELL, P_SKILLED }, { P_ATTACK_SPELL, P_SKILLED },
{ P_CLERIC_SPELL, P_SKILLED }, { P_CLERIC_SPELL, P_SKILLED },
{ P_RIDING, P_SKILLED }, { P_RIDING, P_SKILLED },
{ P_TWO_WEAPON_COMBAT, P_EXPERT }, { P_TWO_WEAPON_COMBAT, P_EXPERT },
{ P_MARTIAL_ARTS, P_MASTER }, { P_MARTIAL_ARTS, P_MASTER },
{ P_NONE, 0 } }; { P_NONE, 0 }
};
static const struct def_skill Skill_T[] = { static const struct def_skill Skill_T[] = {
{ P_DAGGER, P_EXPERT }, { P_DAGGER, P_EXPERT },
{ P_KNIFE, P_SKILLED }, { P_KNIFE, P_SKILLED },
@@ -502,7 +501,6 @@ static const struct def_skill Skill_T[] = {
{ P_BARE_HANDED_COMBAT, P_SKILLED }, { P_BARE_HANDED_COMBAT, P_SKILLED },
{ P_NONE, 0 } { P_NONE, 0 }
}; };
static const struct def_skill Skill_V[] = { static const struct def_skill Skill_V[] = {
{ P_DAGGER, P_EXPERT }, { P_DAGGER, P_EXPERT },
{ P_AXE, P_EXPERT }, { P_AXE, P_EXPERT },
@@ -527,31 +525,31 @@ static const struct def_skill Skill_V[] = {
{ P_BARE_HANDED_COMBAT, P_EXPERT }, { P_BARE_HANDED_COMBAT, P_EXPERT },
{ P_NONE, 0 } { P_NONE, 0 }
}; };
static const struct def_skill Skill_W[] = {
static const struct def_skill Skill_W[] = { { P_DAGGER, P_EXPERT }, { P_DAGGER, P_EXPERT },
{ P_KNIFE, P_SKILLED }, { P_KNIFE, P_SKILLED },
{ P_AXE, P_SKILLED }, { P_AXE, P_SKILLED },
{ P_SHORT_SWORD, P_BASIC }, { P_SHORT_SWORD, P_BASIC },
{ P_CLUB, P_SKILLED }, { P_CLUB, P_SKILLED },
{ P_MACE, P_BASIC }, { P_MACE, P_BASIC },
{ P_QUARTERSTAFF, P_EXPERT }, { P_QUARTERSTAFF, P_EXPERT },
{ P_POLEARMS, P_SKILLED }, { P_POLEARMS, P_SKILLED },
{ P_SPEAR, P_BASIC }, { P_SPEAR, P_BASIC },
{ P_TRIDENT, P_BASIC }, { P_TRIDENT, P_BASIC },
{ P_SLING, P_SKILLED }, { P_SLING, P_SKILLED },
{ P_DART, P_EXPERT }, { P_DART, P_EXPERT },
{ P_SHURIKEN, P_BASIC }, { P_SHURIKEN, P_BASIC },
{ P_ATTACK_SPELL, P_EXPERT }, { P_ATTACK_SPELL, P_EXPERT },
{ P_HEALING_SPELL, P_SKILLED }, { P_HEALING_SPELL, P_SKILLED },
{ P_DIVINATION_SPELL, P_EXPERT }, { P_DIVINATION_SPELL, P_EXPERT },
{ P_ENCHANTMENT_SPELL, { P_ENCHANTMENT_SPELL, P_SKILLED },
P_SKILLED }, { P_CLERIC_SPELL, P_SKILLED },
{ P_CLERIC_SPELL, P_SKILLED }, { P_ESCAPE_SPELL, P_EXPERT },
{ P_ESCAPE_SPELL, P_EXPERT }, { P_MATTER_SPELL, P_EXPERT },
{ P_MATTER_SPELL, P_EXPERT }, { P_RIDING, P_BASIC },
{ P_RIDING, P_BASIC }, { P_BARE_HANDED_COMBAT, P_BASIC },
{ P_BARE_HANDED_COMBAT, P_BASIC }, { P_NONE, 0 }
{ P_NONE, 0 } }; };
STATIC_OVL void STATIC_OVL void
knows_object(obj) knows_object(obj)
@@ -578,8 +576,7 @@ void
u_init() u_init()
{ {
register int i; register int i;
struct u_roleplay tmpuroleplay = struct u_roleplay tmpuroleplay = u.uroleplay; /* set by rcfile options */
u.uroleplay; /* these set by rcfile options */
flags.female = flags.initgend; flags.female = flags.initgend;
flags.beginner = 1; flags.beginner = 1;
@@ -594,24 +591,24 @@ u_init()
u.uroleplay = tmpuroleplay; /* restore options set via rcfile */ u.uroleplay = tmpuroleplay; /* restore options set via rcfile */
#if 0 /* documentation of more zero values as desirable */ #if 0 /* documentation of more zero values as desirable */
u.usick_cause[0] = 0; u.usick_cause[0] = 0;
u.uluck = u.moreluck = 0; u.uluck = u.moreluck = 0;
uarmu = 0; uarmu = 0;
uarm = uarmc = uarmh = uarms = uarmg = uarmf = 0; uarm = uarmc = uarmh = uarms = uarmg = uarmf = 0;
uwep = uball = uchain = uleft = uright = 0; uwep = uball = uchain = uleft = uright = 0;
uswapwep = uquiver = 0; uswapwep = uquiver = 0;
u.twoweap = 0; u.twoweap = 0;
u.ublessed = 0; /* not worthy yet */ u.ublessed = 0; /* not worthy yet */
u.ugangr = 0; /* gods not angry */ u.ugangr = 0; /* gods not angry */
u.ugifts = 0; /* no divine gifts bestowed */ u.ugifts = 0; /* no divine gifts bestowed */
u.uevent.uhand_of_elbereth = 0; u.uevent.uhand_of_elbereth = 0;
u.uevent.uheard_tune = 0; u.uevent.uheard_tune = 0;
u.uevent.uopened_dbridge = 0; u.uevent.uopened_dbridge = 0;
u.uevent.udemigod = 0; /* not a demi-god yet... */ u.uevent.udemigod = 0; /* not a demi-god yet... */
u.udg_cnt = 0; u.udg_cnt = 0;
u.mh = u.mhmax = u.mtimedone = 0; u.mh = u.mhmax = u.mtimedone = 0;
u.uz.dnum = u.uz0.dnum = 0; u.uz.dnum = u.uz0.dnum = 0;
u.utotype = 0; u.utotype = 0;
#endif /* 0 */ #endif /* 0 */
u.uz.dlevel = 1; u.uz.dlevel = 1;
@@ -884,12 +881,13 @@ u_init()
find_ac(); /* get initial ac value */ find_ac(); /* get initial ac value */
init_attr(75); /* init attribute values */ init_attr(75); /* init attribute values */
max_rank_sz(); /* set max str size for class ranks */ max_rank_sz(); /* set max str size for class ranks */
/* /*
* Do we really need this? * Do we really need this?
*/ */
for (i = 0; i < A_MAX; i++) for (i = 0; i < A_MAX; i++)
if (!rn2(20)) { if (!rn2(20)) {
register int xd = rn2(7) - 2; /* biased variation */ register int xd = rn2(7) - 2; /* biased variation */
(void) adjattrib(i, xd, TRUE); (void) adjattrib(i, xd, TRUE);
if (ABASE(i) < AMAX(i)) if (ABASE(i) < AMAX(i))
AMAX(i) = ABASE(i); AMAX(i) = ABASE(i);
@@ -957,8 +955,8 @@ int otyp;
skills = Skill_W; skills = Skill_W;
break; break;
default: default:
skills = 0; skills = 0; /* lint suppression */
break; /* lint suppression */ break;
} }
while (skills->skill != P_NONE) { while (skills->skill != P_NONE) {
+81 -84
View File
@@ -1,6 +1,6 @@
/* NetHack 3.6 vision.c $NHDT-Date: 1432512763 2015/05/25 00:12:43 $ $NHDT-Branch: master $:$NHDT-Revision: 1.23 $ */ /* NetHack 3.6 vision.c $NHDT-Date: 1446861773 2015/11/07 02:02:53 $ $NHDT-Branch: master $:$NHDT-Revision: 1.26 $ */
/* Copyright (c) Dean Luick, with acknowledgements to Dave Cohrs, 1990. */ /* Copyright (c) Dean Luick, with acknowledgements to Dave Cohrs, 1990. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
#include "hack.h" #include "hack.h"
@@ -16,11 +16,11 @@
* offset on the same row as the source *is* included so we don't have to * offset on the same row as the source *is* included so we don't have to
* make an extra check. For example, a circle of radius 4 has offsets: * make an extra check. For example, a circle of radius 4 has offsets:
* *
* XXX +2 * XXX +2
* ...X +3 * ...X +3
* ....X +4 * ....X +4
* ....X +4 * ....X +4
* @...X +4 * @...X +4
* *
*/ */
char circle_data[] = { char circle_data[] = {
@@ -39,8 +39,7 @@ char circle_data[] = {
/* 90*/ 13, 13, 13, 13, 12, 12, 12, 11, 10, 10, 9, 7, 6, 3, /* 90*/ 13, 13, 13, 13, 12, 12, 12, 11, 10, 10, 9, 7, 6, 3,
/*104*/ 14, 14, 14, 14, 13, 13, 13, 12, 12, 11, 10, 9, 8, 6, 3, /*104*/ 14, 14, 14, 14, 13, 13, 13, 12, 12, 11, 10, 9, 8, 6, 3,
/*119*/ 15, 15, 15, 15, 14, 14, 14, 13, 13, 12, 11, 10, 9, 8, 6, 3, /*119*/ 15, 15, 15, 15, 14, 14, 14, 13, 13, 12, 11, 10, 9, 8, 6, 3,
/*135*/ 16 /* should be MAX_RADIUS+1; used to terminate range loops -dlc /*135*/ 16 /* MAX_RADIUS+1; used to terminate range loops -dlc */
*/
}; };
/* /*
@@ -74,10 +73,10 @@ char circle_start[] = {
#if 0 /* (moved to decl.c) */ #if 0 /* (moved to decl.c) */
/* True if we need to run a full vision recalculation. */ /* True if we need to run a full vision recalculation. */
boolean vision_full_recalc = 0; boolean vision_full_recalc = 0;
/* Pointers to the current vision array. */ /* Pointers to the current vision array. */
char **viz_array; char **viz_array;
#endif #endif
char *viz_rmin, *viz_rmax; /* current vision cs bounds */ char *viz_rmin, *viz_rmax; /* current vision cs bounds */
@@ -289,8 +288,8 @@ char **rmin, **rmax;
* Set the "could see" and in sight bits so vision acts just like the old * Set the "could see" and in sight bits so vision acts just like the old
* rogue game: * rogue game:
* *
* + If in a room, the hero can see to the room boundaries. * + If in a room, the hero can see to the room boundaries.
* + The hero can always see adjacent squares. * + The hero can always see adjacent squares.
* *
* We set the in_sight bit here as well to escape a bug that shows up * We set the in_sight bit here as well to escape a bug that shows up
* due to the one-sided lit wall hack. * due to the one-sided lit wall hack.
@@ -367,17 +366,17 @@ STATIC_DCL int FDECL(new_angle, (struct rm *, unsigned char *, int, int));
* see, then we want to extend a spine of the T to connect with the wall * see, then we want to extend a spine of the T to connect with the wall
* that is beyond. Example: * that is beyond. Example:
* *
* Correct, but ugly Extend T spine * Correct, but ugly Extend T spine
* *
* | ... | ... * | ... | ...
* | ... <-- wall beyond & floor --> | ... * | ... <-- wall beyond & floor --> | ...
* | ... | ... * | ... | ...
* Unseen --> ... | ... * Unseen --> ... | ...
* spine +-... <-- trwall & doorway --> +-... * spine +-... <-- trwall & doorway --> +-...
* | ... | ... * | ... | ...
* *
* *
* @ <-- hero --> @ * @ <-- hero --> @
* *
* *
* We fake the above check by only checking if the horizontal & * We fake the above check by only checking if the horizontal &
@@ -385,17 +384,17 @@ STATIC_DCL int FDECL(new_angle, (struct rm *, unsigned char *, int, int));
* unblocked. Then, _in general_ we can see beyond. Generally, * unblocked. Then, _in general_ we can see beyond. Generally,
* this is good enough. * this is good enough.
* *
* + When this function is called we don't have all of the seen * + When this function is called we don't have all of the seen
* information (we're doing a top down scan in vision_recalc). * information (we're doing a top down scan in vision_recalc).
* We would need to scan once to set all IN_SIGHT and COULD_SEE * We would need to scan once to set all IN_SIGHT and COULD_SEE
* bits, then again to correctly set the seenv bits. * bits, then again to correctly set the seenv bits.
* + I'm trying to make this as cheap as possible. The display & * + I'm trying to make this as cheap as possible. The display &
* vision eat up too much CPU time. * vision eat up too much CPU time.
* *
* *
* Note: Even as I write this, I'm still not convinced. There are too * Note: Even as I write this, I'm still not convinced. There are too
* many exceptions. I may have to bite the bullet and do more * many exceptions. I may have to bite the bullet and do more
* checks. - Dean 2/11/93 * checks. - Dean 2/11/93
*/ */
STATIC_OVL int STATIC_OVL int
new_angle(lev, sv, row, col) new_angle(lev, sv, row, col)
@@ -471,32 +470,32 @@ int row, col;
* can see. (1) and (2) call this routine for synchronization purposes, (3) * can see. (1) and (2) call this routine for synchronization purposes, (3)
* calls this routine so it can operate correctly. * calls this routine so it can operate correctly.
* *
* + After the monster move, before input from the player. [moveloop()] * + After the monster move, before input from the player. [moveloop()]
* + At end of moveloop. [moveloop() ??? not sure why this is here] * + At end of moveloop. [moveloop() ??? not sure why this is here]
* + Right before something is printed. [pline()] * + Right before something is printed. [pline()]
* + Right before we do a vision based operation. [do_clear_area()] * + Right before we do a vision based operation. [do_clear_area()]
* + screen redraw, so we can renew all positions in sight. [docrt()] * + screen redraw, so we can renew all positions in sight. [docrt()]
* + When toggling temporary blindness, in case additional events * + When toggling temporary blindness, in case additional events
* impacted by vision occur during the same move [make_blinded()] * impacted by vision occur during the same move [make_blinded()]
* *
* Control flag = 1. An adjacent vision recalculation. The hero has moved * Control flag = 1. An adjacent vision recalculation. The hero has moved
* one square. Knowing this, it might be possible to optimize the vision * one square. Knowing this, it might be possible to optimize the vision
* recalculation using the current knowledge. This is presently unimplemented * recalculation using the current knowledge. This is presently unimplemented
* and is treated as a control = 0 call. * and is treated as a control = 0 call.
* *
* + Right after the hero moves. [domove()] * + Right after the hero moves. [domove()]
* *
* Control flag = 2. Turn off the vision system. Nothing new will be * Control flag = 2. Turn off the vision system. Nothing new will be
* displayed, since nothing is seen. This is usually done when you need * displayed, since nothing is seen. This is usually done when you need
* a newsym() run on all locations in sight, or on some locations but you * a newsym() run on all locations in sight, or on some locations but you
* don't know which ones. * don't know which ones.
* *
* + Before a screen redraw, so all positions are renewed. [docrt()] * + Before a screen redraw, so all positions are renewed. [docrt()]
* + Right before the hero arrives on a new level. [goto_level()] * + Right before the hero arrives on a new level. [goto_level()]
* + Right after a scroll of light is read. [litroom()] * + Right after a scroll of light is read. [litroom()]
* + After an option has changed that affects vision [parseoptions()] * + After an option has changed that affects vision [parseoptions()]
* + Right after the hero is swallowed. [gulpmu()] * + Right after the hero is swallowed. [gulpmu()]
* + Just before bubbles are moved. [movebubbles()] * + Just before bubbles are moved. [movebubbles()]
*/ */
void void
vision_recalc(control) vision_recalc(control)
@@ -542,10 +541,10 @@ int control;
* can see you, even if you can't see them. Note that the current * can see you, even if you can't see them. Note that the current
* setup allows: * setup allows:
* *
* + Monsters to see with the "new" vision, even on the rogue * + Monsters to see with the "new" vision, even on the rogue
* level. * level.
* *
* + Monsters can see you even when you're in a pit. * + Monsters can see you even when you're in a pit.
*/ */
view_from(u.uy, u.ux, next_array, next_rmin, next_rmax, 0, view_from(u.uy, u.ux, next_array, next_rmin, next_rmax, 0,
(void FDECL((*), (int, int, genericptr_t))) 0, (void FDECL((*), (int, int, genericptr_t))) 0,
@@ -702,8 +701,8 @@ int control;
/* /*
* The main update loop. Here we do two things: * The main update loop. Here we do two things:
* *
* + Set the IN_SIGHT bit for places that we could see and are lit. * + Set the IN_SIGHT bit for places that we could see and are lit.
* + Reset changed places. * + Reset changed places.
* *
* There is one thing that make deciding what the hero can see * There is one thing that make deciding what the hero can see
* difficult: * difficult:
@@ -712,8 +711,8 @@ int control;
* The worst offenders are doors. Suppose a door to a lit room * The worst offenders are doors. Suppose a door to a lit room
* is closed. It is lit on one side, but not on the other. How * is closed. It is lit on one side, but not on the other. How
* do you know? You have to check the closest adjacent position. * do you know? You have to check the closest adjacent position.
* Even so, that is not entirely correct. But it seems close * Even so, that is not entirely correct. But it seems close
* enough for now. * enough for now.
*/ */
colbump[u.ux] = colbump[u.ux + 1] = 1; colbump[u.ux] = colbump[u.ux + 1] = 1;
for (row = 0; row < ROWNO; row++) { for (row = 0; row < ROWNO; row++) {
@@ -880,21 +879,19 @@ int x, y;
} }
/*===========================================================================*\ /*===========================================================================*\
| | | |
| Everything below this line uses (y,x) instead of (x,y) --- the | | Everything below this line uses (y,x) instead of (x,y) --- the |
| algorithms are faster if they are less recursive and can scan | | algorithms are faster if they are less recursive and can scan |
| on a row longer. | | on a row longer. |
| | | |
\*===========================================================================*/ \*===========================================================================*/
/* ========================================================================= /* ======================================================================== *\
*\
Left and Right Pointer Updates Left and Right Pointer Updates
\* ========================================================================= \* ======================================================================== */
*/
/* /*
* LEFT and RIGHT pointer rules * LEFT and RIGHT pointer rules
* *
* *
* **NOTE** The rules changed on 4/4/90. This comment reflects the * **NOTE** The rules changed on 4/4/90. This comment reflects the
@@ -1117,12 +1114,12 @@ static genericptr_t varg;
/* /*
* Both Algorithms C and D use the following macros. * Both Algorithms C and D use the following macros.
* *
* good_row(z) - Return TRUE if the argument is a legal row. * good_row(z) - Return TRUE if the argument is a legal row.
* set_cs(rowp,col) - Set the local could see array. * set_cs(rowp,col) - Set the local could see array.
* set_min(z) - Save the min value of the argument and the current * set_min(z) - Save the min value of the argument and the current
* row minimum. * row minimum.
* set_max(z) - Save the max value of the argument and the current * set_max(z) - Save the max value of the argument and the current
* row maximum. * row maximum.
* *
* The last three macros depend on having local pointers row_min, row_max, * The last three macros depend on having local pointers row_min, row_max,
* and rowp being set correctly. * and rowp being set correctly.
@@ -1131,19 +1128,19 @@ static genericptr_t varg;
#define good_row(z) ((z) >= 0 && (z) < ROWNO) #define good_row(z) ((z) >= 0 && (z) < ROWNO)
#define set_min(z) \ #define set_min(z) \
if (*row_min > (z)) \ if (*row_min > (z)) \
*row_min = (z) *row_min = (z)
#define set_max(z) \ #define set_max(z) \
if (*row_max < (z)) \ if (*row_max < (z)) \
*row_max = (z) *row_max = (z)
#define is_clear(row, col) viz_clear_rows[row][col] #define is_clear(row, col) viz_clear_rows[row][col]
/* /*
* clear_path() expanded into 4 macros/functions: * clear_path() expanded into 4 macros/functions:
* *
* q1_path() * q1_path()
* q2_path() * q2_path()
* q3_path() * q3_path()
* q4_path() * q4_path()
* *
* "Draw" a line from the start to the given location. Stop if we hit * "Draw" a line from the start to the given location. Stop if we hit
* something that blocks light. The start and finish points themselves are * something that blocks light. The start and finish points themselves are
@@ -1567,9 +1564,9 @@ int scol, srow, y2, x2;
/* /*
* Use vision tables to determine if there is a clear path from * Use vision tables to determine if there is a clear path from
* (col1,row1) to (col2,row2). This is used by: * (col1,row1) to (col2,row2). This is used by:
* m_cansee() * m_cansee()
* m_canseeu() * m_canseeu()
* do_light_sources() * do_light_sources()
*/ */
boolean boolean
clear_path(col1, row1, col2, row2) clear_path(col1, row1, col2, row2)
@@ -1595,7 +1592,7 @@ int col1, row1, col2, row2;
#ifdef MACRO_CPATH #ifdef MACRO_CPATH
cleardone: cleardone:
#endif #endif
return ((boolean) result); return (boolean) result;
} }
#ifdef VISION_TABLES #ifdef VISION_TABLES
@@ -1854,12 +1851,12 @@ char *limits; /* points at range limit for current row, or NULL */
if (!viz_clear_rows[row][left]) { if (!viz_clear_rows[row][left]) {
hit_stone = 1; /* use stone on this row as close block */ hit_stone = 1; /* use stone on this row as close block */
/* /*
* We can see all of the wall until the next open spot or the * We can see all of the wall until the next open spot or the
* start of the shadow caused by the far block (right). * start of the shadow caused by the far block (right).
* *
* Can't see stone beyond the right mark. * Can't see stone beyond the right mark.
*/ */
if (loc_right > right_mark) if (loc_right > right_mark)
loc_right = right_mark; loc_right = right_mark;
@@ -2415,7 +2412,7 @@ char *limits; /* points at range limit for current row, or NULL */
* Check for boundary conditions. We *need* check (2) to break * Check for boundary conditions. We *need* check (2) to break
* an infinite loop where: * an infinite loop where:
* *
* left == right_edge == right_mark == lim_max. * left == right_edge == right_mark == lim_max.
* *
*/ */
if (left > lim_max) if (left > lim_max)
+29 -29
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 wield.c $NHDT-Date: 1445126432 2015/10/18 00:00:32 $ $NHDT-Branch: master $:$NHDT-Revision: 1.45 $ */ /* NetHack 3.6 wield.c $NHDT-Date: 1446861774 2015/11/07 02:02:54 $ $NHDT-Branch: master $:$NHDT-Revision: 1.46 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -87,9 +87,9 @@ register struct obj *obj;
if (obj == uwep) if (obj == uwep)
return; /* necessary to not set unweapon */ return; /* necessary to not set unweapon */
/* This message isn't printed in the caller because it happens /* This message isn't printed in the caller because it happens
* *whenever* Sunsword is unwielded, from whatever cause. * *whenever* Sunsword is unwielded, from whatever cause.
*/ */
setworn(obj, W_WEP); setworn(obj, W_WEP);
if (uwep == obj && artifact_light(olduwep) && olduwep->lamplit) { if (uwep == obj && artifact_light(olduwep) && olduwep->lamplit) {
end_burn(olduwep, FALSE); end_burn(olduwep, FALSE);
@@ -211,7 +211,7 @@ struct obj *wep;
} }
} }
} }
return (res); return res;
} }
void void
@@ -249,35 +249,35 @@ dowield()
multi = 0; multi = 0;
if (cantwield(youmonst.data)) { if (cantwield(youmonst.data)) {
pline("Don't be ridiculous!"); pline("Don't be ridiculous!");
return (0); return 0;
} }
/* Prompt for a new weapon */ /* Prompt for a new weapon */
if (!(wep = getobj(wield_objs, "wield"))) if (!(wep = getobj(wield_objs, "wield")))
/* Cancelled */ /* Cancelled */
return (0); return 0;
else if (wep == uwep) { else if (wep == uwep) {
You("are already wielding that!"); You("are already wielding that!");
if (is_weptool(wep) || is_wet_towel(wep)) if (is_weptool(wep) || is_wet_towel(wep))
unweapon = FALSE; /* [see setuwep()] */ unweapon = FALSE; /* [see setuwep()] */
return (0); return 0;
} else if (welded(uwep)) { } else if (welded(uwep)) {
weldmsg(uwep); weldmsg(uwep);
/* previously interrupted armor removal mustn't be resumed */ /* previously interrupted armor removal mustn't be resumed */
reset_remarm(); reset_remarm();
return (0); return 0;
} }
/* Handle no object, or object in other slot */ /* Handle no object, or object in other slot */
if (wep == &zeroobj) if (wep == &zeroobj)
wep = (struct obj *) 0; wep = (struct obj *) 0;
else if (wep == uswapwep) else if (wep == uswapwep)
return (doswapweapon()); return doswapweapon();
else if (wep == uquiver) else if (wep == uquiver)
setuqwep((struct obj *) 0); setuqwep((struct obj *) 0);
else if (wep->owornmask & (W_ARMOR | W_ACCESSORY | W_SADDLE)) { else if (wep->owornmask & (W_ARMOR | W_ACCESSORY | W_SADDLE)) {
You("cannot wield that!"); You("cannot wield that!");
return (0); return 0;
} }
/* Set your new primary weapon */ /* Set your new primary weapon */
@@ -287,7 +287,7 @@ dowield()
setuswapwep(oldwep); setuswapwep(oldwep);
untwoweapon(); untwoweapon();
return (result); return result;
} }
int int
@@ -300,11 +300,11 @@ doswapweapon()
multi = 0; multi = 0;
if (cantwield(youmonst.data)) { if (cantwield(youmonst.data)) {
pline("Don't be ridiculous!"); pline("Don't be ridiculous!");
return (0); return 0;
} }
if (welded(uwep)) { if (welded(uwep)) {
weldmsg(uwep); weldmsg(uwep);
return (0); return 0;
} }
/* Unwield your current secondary weapon */ /* Unwield your current secondary weapon */
@@ -330,7 +330,7 @@ doswapweapon()
if (u.twoweap && !can_twoweapon()) if (u.twoweap && !can_twoweapon())
untwoweapon(); untwoweapon();
return (result); return result;
} }
int int
@@ -350,7 +350,7 @@ dowieldquiver()
/* Prompt for a new quiver */ /* Prompt for a new quiver */
if (!(newquiver = getobj(quivee_types, "ready"))) if (!(newquiver = getobj(quivee_types, "ready")))
/* Cancelled */ /* Cancelled */
return (0); return 0;
/* Handle no object, or object in other slot */ /* Handle no object, or object in other slot */
/* Any type is okay, since we give no intrinsics anyways */ /* Any type is okay, since we give no intrinsics anyways */
@@ -361,19 +361,19 @@ dowieldquiver()
setuqwep(newquiver = (struct obj *) 0); setuqwep(newquiver = (struct obj *) 0);
} else { } else {
You("already have no ammunition readied!"); You("already have no ammunition readied!");
return (0); return 0;
} }
} else if (newquiver == uquiver) { } else if (newquiver == uquiver) {
pline("That ammunition is already readied!"); pline("That ammunition is already readied!");
return (0); return 0;
} else if (newquiver == uwep) { } else if (newquiver == uwep) {
/* Prevent accidentally readying the main weapon */ /* Prevent accidentally readying the main weapon */
pline("%s already being used as a weapon!", pline("%s already being used as a weapon!",
!is_plural(uwep) ? "That is" : "They are"); !is_plural(uwep) ? "That is" : "They are");
return (0); return 0;
} else if (newquiver->owornmask & (W_ARMOR | W_ACCESSORY | W_SADDLE)) { } else if (newquiver->owornmask & (W_ARMOR | W_ACCESSORY | W_SADDLE)) {
You("cannot ready that!"); You("cannot ready that!");
return (0); return 0;
} else { } else {
long dummy; long dummy;
@@ -393,7 +393,7 @@ dowieldquiver()
/* Finally, place it in the quiver */ /* Finally, place it in the quiver */
setuqwep(newquiver); setuqwep(newquiver);
/* Take no time since this is a convenience slot */ /* Take no time since this is a convenience slot */
return (0); return 0;
} }
/* used for #rub and for applying pick-axe, whip, grappling hook or polearm */ /* used for #rub and for applying pick-axe, whip, grappling hook or polearm */
@@ -507,8 +507,8 @@ can_twoweapon()
uswapwep->bknown = TRUE; uswapwep->bknown = TRUE;
drop_uswapwep(); drop_uswapwep();
} else } else
return (TRUE); return TRUE;
return (FALSE); return FALSE;
} }
void void
@@ -531,7 +531,7 @@ dotwoweapon()
You("switch to your primary weapon."); You("switch to your primary weapon.");
u.twoweap = 0; u.twoweap = 0;
update_inventory(); update_inventory();
return (0); return 0;
} }
/* May we use two weapons? */ /* May we use two weapons? */
@@ -542,7 +542,7 @@ dotwoweapon()
update_inventory(); update_inventory();
return (rnd(20) > ACURR(A_DEX)); return (rnd(20) > ACURR(A_DEX));
} }
return (0); return 0;
} }
/*** Functions to empty a given slot ***/ /*** Functions to empty a given slot ***/
@@ -612,7 +612,7 @@ register int amount;
(amount >= 0) ? "twitch" : "itch"); (amount >= 0) ? "twitch" : "itch");
strange_feeling(otmp, buf); strange_feeling(otmp, buf);
exercise(A_DEX, (boolean)(amount >= 0)); exercise(A_DEX, (boolean)(amount >= 0));
return (0); return 0;
} }
if (otmp && otmp->oclass == SCROLL_CLASS) if (otmp && otmp->oclass == SCROLL_CLASS)
@@ -663,7 +663,7 @@ register int amount;
if (amount < 0 && uwep->oartifact && restrict_name(uwep, wepname)) { if (amount < 0 && uwep->oartifact && restrict_name(uwep, wepname)) {
if (!Blind) if (!Blind)
pline("%s %s.", Yobjnam2(uwep, "faintly glow"), color); pline("%s %s.", Yobjnam2(uwep, "faintly glow"), color);
return (1); return 1;
} }
/* there is a (soft) upper and lower limit to uwep->spe */ /* there is a (soft) upper and lower limit to uwep->spe */
if (((uwep->spe > 5 && amount >= 0) || (uwep->spe < -5 && amount < 0)) if (((uwep->spe > 5 && amount >= 0) || (uwep->spe < -5 && amount < 0))
@@ -676,7 +676,7 @@ register int amount;
pline("%s.", Yobjnam2(uwep, "evaporate")); pline("%s.", Yobjnam2(uwep, "evaporate"));
useupall(uwep); /* let all of them disappear */ useupall(uwep); /* let all of them disappear */
return (1); return 1;
} }
if (!Blind) { if (!Blind) {
xtime = (amount * amount == 1) ? "moment" : "while"; xtime = (amount * amount == 1) ? "moment" : "while";
@@ -714,7 +714,7 @@ register int amount;
&& (is_elven_weapon(uwep) || uwep->oartifact || !rn2(7))) && (is_elven_weapon(uwep) || uwep->oartifact || !rn2(7)))
pline("%s unexpectedly.", Yobjnam2(uwep, "suddenly vibrate")); pline("%s unexpectedly.", Yobjnam2(uwep, "suddenly vibrate"));
return (1); return 1;
} }
int int
+6 -5
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 zap.c $NHDT-Date: 1446713647 2015/11/05 08:54:07 $ $NHDT-Branch: master $:$NHDT-Revision: 1.231 $ */ /* NetHack 3.6 zap.c $NHDT-Date: 1446861775 2015/11/07 02:02:55 $ $NHDT-Branch: master $:$NHDT-Revision: 1.232 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -344,8 +344,8 @@ struct obj *otmp;
} }
break; break;
case WAN_SLEEP: /* (broken wand) */ case WAN_SLEEP: /* (broken wand) */
/* [wakeup() doesn't rouse victims of temporary sleep, /* [wakeup() doesn't rouse victims of temporary sleep,
so it's okay to leave `wake' set to TRUE here] */ so it's okay to leave `wake' set to TRUE here] */
reveal_invis = TRUE; reveal_invis = TRUE;
if (sleep_monst(mtmp, d(1 + otmp->spe, 12), WAND_CLASS)) if (sleep_monst(mtmp, d(1 + otmp->spe, 12), WAND_CLASS))
slept_monst(mtmp); slept_monst(mtmp);
@@ -355,6 +355,7 @@ struct obj *otmp;
case SPE_STONE_TO_FLESH: case SPE_STONE_TO_FLESH:
if (monsndx(mtmp->data) == PM_STONE_GOLEM) { if (monsndx(mtmp->data) == PM_STONE_GOLEM) {
char *name = Monnam(mtmp); char *name = Monnam(mtmp);
/* turn into flesh golem */ /* turn into flesh golem */
if (newcham(mtmp, &mons[PM_FLESH_GOLEM], FALSE, FALSE)) { if (newcham(mtmp, &mons[PM_FLESH_GOLEM], FALSE, FALSE)) {
if (canseemon(mtmp)) if (canseemon(mtmp))
@@ -1669,7 +1670,7 @@ struct obj *obj;
smell = TRUE; smell = TRUE;
break; break;
case WEAPON_CLASS: /* crysknife */ case WEAPON_CLASS: /* crysknife */
/* fall through */ /*FALLTHRU*/
default: default:
res = 0; res = 0;
break; break;
@@ -2320,7 +2321,7 @@ boolean ordinary;
You_feel("%sbetter.", obj->otyp == SPE_EXTRA_HEALING ? "much " : ""); You_feel("%sbetter.", obj->otyp == SPE_EXTRA_HEALING ? "much " : "");
break; break;
case WAN_LIGHT: /* (broken wand) */ case WAN_LIGHT: /* (broken wand) */
/* assert( !ordinary ); */ /* assert( !ordinary ); */
damage = d(obj->spe, 25); damage = d(obj->spe, 25);
case EXPENSIVE_CAMERA: case EXPENSIVE_CAMERA:
if (!damage) if (!damage)