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!");
+23 -51
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",
@@ -381,10 +365,9 @@ const struct Role roles[] = {
{"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.) */
@@ -400,9 +383,7 @@ const struct Role roles[] = {
{ "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",
@@ -1988,9 +1961,10 @@ winid where;
* 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 */
+18 -27
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. */
@@ -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.
+ Or just kill any egg which gets sent to another level.
Falling is the usual reason such transportation occurs.
*/ */
cansee_hatchspot = FALSE; cansee_hatchspot = FALSE;
mon = ??? mon = ???;
}
#endif #endif
}
if (mon) { if (mon) {
char monnambuf[BUFSZ], carriedby[BUFSZ]; char monnambuf[BUFSZ], carriedby[BUFSZ];
@@ -710,10 +705,9 @@ slip_or_trip()
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
@@ -1103,11 +1097,9 @@ long timeout;
* 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: * candelabrum:
* age = # of turns of fuel left * age = # of turns of fuel left
* spe = # of candles * spe = # of candles
@@ -1335,7 +1327,6 @@ do_storms()
* void run_timers(void) * void run_timers(void)
* Call timers that have timed out. * 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
@@ -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);
} }
/* /*
+43 -45
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. */
@@ -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 } };
@@ -229,7 +228,8 @@ static struct inv_sub {
{ 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_DAGGER, P_BASIC },
{ P_KNIFE, P_BASIC }, { P_KNIFE, P_BASIC },
{ P_PICK_AXE, P_EXPERT }, { P_PICK_AXE, P_EXPERT },
{ P_SHORT_SWORD, P_BASIC }, { P_SHORT_SWORD, P_BASIC },
@@ -248,11 +248,11 @@ static const struct def_skill Skill_A[] = { { P_DAGGER, P_BASIC },
{ P_MATTER_SPELL, P_BASIC }, { P_MATTER_SPELL, P_BASIC },
{ P_RIDING, P_BASIC }, { P_RIDING, P_BASIC },
{ P_TWO_WEAPON_COMBAT, P_BASIC }, { P_TWO_WEAPON_COMBAT, P_BASIC },
{ P_BARE_HANDED_COMBAT, { P_BARE_HANDED_COMBAT, P_EXPERT },
P_EXPERT }, { P_NONE, 0 }
{ P_NONE, 0 } }; };
static const struct def_skill Skill_B[] = {
static const struct def_skill Skill_B[] = { { P_DAGGER, P_BASIC }, { P_DAGGER, P_BASIC },
{ P_AXE, P_EXPERT }, { P_AXE, P_EXPERT },
{ P_PICK_AXE, P_SKILLED }, { P_PICK_AXE, P_SKILLED },
{ P_SHORT_SWORD, P_EXPERT }, { P_SHORT_SWORD, P_EXPERT },
@@ -273,11 +273,11 @@ static const struct def_skill Skill_B[] = { { P_DAGGER, P_BASIC },
{ P_ATTACK_SPELL, P_SKILLED }, { P_ATTACK_SPELL, P_SKILLED },
{ P_RIDING, P_BASIC }, { P_RIDING, P_BASIC },
{ P_TWO_WEAPON_COMBAT, P_BASIC }, { P_TWO_WEAPON_COMBAT, P_BASIC },
{ P_BARE_HANDED_COMBAT, { P_BARE_HANDED_COMBAT, P_MASTER },
P_MASTER }, { P_NONE, 0 }
{ P_NONE, 0 } }; };
static const struct def_skill Skill_C[] = {
static const struct def_skill Skill_C[] = { { P_DAGGER, P_BASIC }, { P_DAGGER, P_BASIC },
{ P_KNIFE, P_SKILLED }, { P_KNIFE, P_SKILLED },
{ P_AXE, P_SKILLED }, { P_AXE, P_SKILLED },
{ P_PICK_AXE, P_BASIC }, { P_PICK_AXE, P_BASIC },
@@ -296,11 +296,11 @@ static const struct def_skill Skill_C[] = { { P_DAGGER, P_BASIC },
{ P_MATTER_SPELL, P_SKILLED }, { P_MATTER_SPELL, P_SKILLED },
{ P_BOOMERANG, P_EXPERT }, { P_BOOMERANG, P_EXPERT },
{ P_UNICORN_HORN, P_BASIC }, { P_UNICORN_HORN, P_BASIC },
{ P_BARE_HANDED_COMBAT, { P_BARE_HANDED_COMBAT, P_MASTER },
P_MASTER }, { P_NONE, 0 }
{ P_NONE, 0 } }; };
static const struct def_skill Skill_H[] = {
static const struct def_skill Skill_H[] = { { P_DAGGER, P_SKILLED }, { P_DAGGER, P_SKILLED },
{ P_KNIFE, P_EXPERT }, { P_KNIFE, P_EXPERT },
{ P_SHORT_SWORD, P_SKILLED }, { P_SHORT_SWORD, P_SKILLED },
{ P_SCIMITAR, P_BASIC }, { P_SCIMITAR, P_BASIC },
@@ -317,8 +317,8 @@ static const struct def_skill Skill_H[] = { { P_DAGGER, P_SKILLED },
{ P_UNICORN_HORN, P_EXPERT }, { P_UNICORN_HORN, P_EXPERT },
{ P_HEALING_SPELL, P_EXPERT }, { P_HEALING_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_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,8 +364,8 @@ 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 },
@@ -387,9 +386,10 @@ static const struct def_skill Skill_P[] = { { P_CLUB, 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_DAGGER, P_EXPERT },
{ P_KNIFE, P_EXPERT }, { P_KNIFE, P_EXPERT },
{ P_SHORT_SWORD, P_EXPERT }, { P_SHORT_SWORD, P_EXPERT },
{ P_BROAD_SWORD, P_SKILLED }, { P_BROAD_SWORD, P_SKILLED },
@@ -412,10 +412,9 @@ static const struct def_skill Skill_R[] = { { P_DAGGER, P_EXPERT },
{ P_MATTER_SPELL, P_SKILLED }, { P_MATTER_SPELL, P_SKILLED },
{ P_RIDING, P_BASIC }, { P_RIDING, P_BASIC },
{ P_TWO_WEAPON_COMBAT, P_EXPERT }, { P_TWO_WEAPON_COMBAT, P_EXPERT },
{ P_BARE_HANDED_COMBAT, { P_BARE_HANDED_COMBAT, P_EXPERT },
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,8 +442,8 @@ 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 },
@@ -464,8 +463,8 @@ static const struct def_skill Skill_S[] = { { P_DAGGER, P_BASIC },
{ 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,8 +525,8 @@ 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 },
@@ -544,14 +542,14 @@ static const struct def_skill Skill_W[] = { { P_DAGGER, P_EXPERT },
{ 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;
@@ -890,6 +887,7 @@ u_init()
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) {
+5 -8
View File
@@ -1,4 +1,4 @@
/* 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. */
@@ -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 */
*/
}; };
/* /*
@@ -887,11 +886,9 @@ int x, y;
| | | |
\*===========================================================================*/ \*===========================================================================*/
/* ========================================================================= /* ======================================================================== *\
*\
Left and Right Pointer Updates Left and Right Pointer Updates
\* ========================================================================= \* ======================================================================== */
*/
/* /*
* LEFT and RIGHT pointer rules * LEFT and RIGHT pointer rules
@@ -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
+26 -26
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. */
@@ -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
+3 -2
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. */
@@ -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;