Merge branch 'master' into win32-x64-working
Resolved Conflicts: src/cmd.c src/mkobj.c All conflicts fixed but you are still merging. Changes to be committed: modified: dat/Priest.des modified: dat/Rogue.des modified: dat/Valkyrie.des modified: dat/Wizard.des modified: dat/gehennom.des modified: src/cmd.c modified: src/mkobj.c modified: src/steal.c modified: sys/share/lev_yacc.c modified: util/lev_comp.y
This commit is contained in:
51
src/cmd.c
51
src/cmd.c
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.5 cmd.c $NHDT-Date: 1429675557 2015/04/22 04:05:57 $ $NHDT-Branch: win32-x64-working $:$NHDT-Revision: 1.187 $ */
|
||||
/* NetHack 3.5 cmd.c $NHDT-Date: 1430534601 2015/05/02 02:43:21 $ $NHDT-Branch: master $:$NHDT-Revision: 1.186 $ */
|
||||
/* NetHack 3.5 cmd.c $Date: 2013/03/16 01:44:28 $ $Revision: 1.162 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -1935,27 +1935,54 @@ int final;
|
||||
}
|
||||
if (Half_physical_damage) enlght_halfdmg(HALF_PHDAM, final);
|
||||
if (Half_spell_damage) enlght_halfdmg(HALF_SPDAM, final);
|
||||
/* polymorph and other shape change */
|
||||
if (Protection_from_shape_changers)
|
||||
you_are("protected from shape changers",
|
||||
from_what(PROT_FROM_SHAPE_CHANGERS));
|
||||
if (Polymorph) you_are("polymorphing", from_what(POLYMORPH));
|
||||
if (Unchanging) {
|
||||
const char *what = 0;
|
||||
|
||||
if (!Upolyd) /* Upolyd handled below after current form */
|
||||
you_can("not change from your current form",
|
||||
from_what(UNCHANGING));
|
||||
/* blocked shape changes */
|
||||
if (Polymorph)
|
||||
what = !final ? "polymorph" : "have polymorphed";
|
||||
else if (u.ulycn >= LOW_PM)
|
||||
what = !final ? "change shape" : "have changed shape";
|
||||
if (what) {
|
||||
Sprintf(buf, "would %s periodically", what);
|
||||
/* omit from_what(UNCHANGING); too verbose */
|
||||
enl_msg(You_, buf, buf,
|
||||
" if not locked into your current form", "");
|
||||
}
|
||||
} else if (Polymorph) {
|
||||
you_are("polymorphing periodically", from_what(POLYMORPH));
|
||||
}
|
||||
if (Polymorph_control)
|
||||
you_have("polymorph control",from_what(POLYMORPH_CONTROL));
|
||||
if (u.ulycn >= LOW_PM) {
|
||||
Strcpy(buf, an(mons[u.ulycn].mname));
|
||||
if (Upolyd && u.umonnum != u.ulycn) {
|
||||
/* foreign shape (except were-form which is handled below) */
|
||||
Sprintf(buf, "polymorphed into %s", an(youmonst.data->mname));
|
||||
if (wizard) Sprintf(eos(buf), " (%d)", u.mtimedone);
|
||||
you_are(buf,"");
|
||||
}
|
||||
if (Upolyd) {
|
||||
if (u.umonnum == u.ulycn) Strcpy(buf, "in beast form");
|
||||
else Sprintf(buf, "polymorphed into %s", an(youmonst.data->mname));
|
||||
if (wizard) Sprintf(eos(buf), " (%d)", u.mtimedone);
|
||||
you_are(buf,"");
|
||||
if (lays_eggs(youmonst.data) && flags.female)
|
||||
if (lays_eggs(youmonst.data) && flags.female) /* Upolyd */
|
||||
you_can("lay eggs", "");
|
||||
if (u.ulycn >= LOW_PM) {
|
||||
/* "you are a werecreature [in beast form]" */
|
||||
Strcpy(buf, an(mons[u.ulycn].mname));
|
||||
if (u.umonnum == u.ulycn) {
|
||||
Strcat(buf, " in beast form");
|
||||
if (wizard) Sprintf(eos(buf), " (%d)", u.mtimedone);
|
||||
}
|
||||
you_are(buf,"");
|
||||
}
|
||||
if (Unchanging) you_can("not change from your current form",
|
||||
from_what(UNCHANGING));
|
||||
if (Unchanging && Upolyd) /* !Upolyd handled above */
|
||||
you_can("not change from your current form",
|
||||
from_what(UNCHANGING));
|
||||
if (Hate_silver) you_are("harmed by silver","");
|
||||
/* movement and non-armor-based protection */
|
||||
if (Fast) you_are(Very_fast ? "very fast" : "fast",from_what(FAST));
|
||||
if (Reflecting) you_have("reflection",from_what(REFLECTING));
|
||||
if (Free_action) you_have("free action",from_what(FREE_ACTION));
|
||||
|
||||
58
src/mkobj.c
58
src/mkobj.c
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.5 mkobj.c $NHDT-Date: 1430472720 2015/05/01 09:32:00 $ $NHDT-Branch: master $:$NHDT-Revision: 1.95 $ */
|
||||
/* NetHack 3.5 mkobj.c $NHDT-Date: 1430559882 2015/05/02 09:44:42 $ $NHDT-Branch: master $:$NHDT-Revision: 1.96 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -2179,32 +2179,44 @@ struct obj *obj;
|
||||
/* [W_ART,W_ARTI are property bits for items which aren't worn] */
|
||||
};
|
||||
char maskbuf[60];
|
||||
unsigned long allmask = 0L;
|
||||
unsigned long owornmask, allmask = 0L;
|
||||
int i, n = 0;
|
||||
|
||||
/* use owornmask for testing and bit twiddling, but use original
|
||||
obj->owornmask for printing */
|
||||
owornmask = obj->owornmask;
|
||||
/* figure out how many bits are set, and also which are viable */
|
||||
for (i = 0; wearbits[i]; ++i) {
|
||||
if ((owornmask & wearbits[i]) != 0L) ++n;
|
||||
allmask |= wearbits[i];
|
||||
if ((obj->owornmask & wearbits[i]) != 0L) ++n;
|
||||
}
|
||||
if (n == 2 && carried(obj) && obj == uball && (owornmask & W_BALL) != 0L
|
||||
&& (owornmask & (W_WEP|W_SWAPWEP|W_QUIVER)) != 0L) {
|
||||
/* chained ball can be wielded/alt-wielded/quivered; if so,
|
||||
pretend it's not chained in order to check the weapon pointer
|
||||
(we've already verified the ball pointer by successfully passing
|
||||
the if-condition to get here...) */
|
||||
owornmask &= ~W_BALL;
|
||||
n = 1;
|
||||
}
|
||||
if (n > 1) {
|
||||
/* multiple bits set */
|
||||
Sprintf(maskbuf, "worn mask (multiple) 0x%08lx", obj->owornmask);
|
||||
insane_object(obj, ofmt0, maskbuf, (struct monst *)0);
|
||||
}
|
||||
if ((obj->owornmask & ~allmask) != 0L
|
||||
|| (carried(obj) && (obj->owornmask & W_SADDLE) != 0L)) {
|
||||
if ((owornmask & ~allmask) != 0L
|
||||
|| (carried(obj) && (owornmask & W_SADDLE) != 0L)) {
|
||||
/* non-wearable bit(s) set */
|
||||
Sprintf(maskbuf, "worn mask (bogus)) 0x%08lx", obj->owornmask);
|
||||
insane_object(obj, ofmt0, maskbuf, (struct monst *)0);
|
||||
}
|
||||
if (n == 1 && (carried(obj)
|
||||
|| (obj->owornmask & (W_BALL|W_CHAIN)) != 0L)) {
|
||||
if (n == 1 && (carried(obj) || (owornmask & (W_BALL|W_CHAIN)) != 0L)) {
|
||||
const char *what = 0;
|
||||
|
||||
/* verify that obj in hero's invent (or ball/chain elsewhere)
|
||||
with owornmask of W_foo is the object pointed to by ufoo */
|
||||
switch (obj->owornmask) {
|
||||
case W_ARM: if (obj != uarm) what = "armor"; /* suit */
|
||||
switch (owornmask) {
|
||||
case W_ARM: if (obj != uarm) what = "suit";
|
||||
break;
|
||||
case W_ARMC: if (obj != uarmc) what = "cloak";
|
||||
break;
|
||||
@@ -2244,6 +2256,34 @@ struct obj *obj;
|
||||
Sprintf(maskbuf, "worn mask 0x%08lx != %s", obj->owornmask, what);
|
||||
insane_object(obj, ofmt0, maskbuf, (struct monst *)0);
|
||||
}
|
||||
/* check for items worn in invalid slots; practically anything can
|
||||
be wielded/alt-wielded/quivered, so skip obj if it's one of those */
|
||||
what = 0;
|
||||
if (owornmask & W_ARMOR) {
|
||||
if (obj->oclass != ARMOR_CLASS) what = "armor";
|
||||
} else if (owornmask & W_AMUL) {
|
||||
if (obj->oclass != AMULET_CLASS) what = "amulet";
|
||||
} else if (owornmask & W_RING) {
|
||||
if (obj->oclass != RING_CLASS && obj->otyp != MEAT_RING)
|
||||
what = "ring";
|
||||
} else if (owornmask & W_TOOL) {
|
||||
if (obj->otyp != BLINDFOLD && obj->otyp != TOWEL
|
||||
&& obj->otyp != LENSES) what = "blindfold";
|
||||
} else if (owornmask & W_BALL) {
|
||||
if (obj->oclass != BALL_CLASS) what = "chained ball";
|
||||
} else if (owornmask & W_CHAIN) {
|
||||
if (obj->oclass != CHAIN_CLASS) what = "chain";
|
||||
}
|
||||
if (what) {
|
||||
char oclassname[30];
|
||||
|
||||
/* if we've found a potion worn in the amulet slot,
|
||||
this yields "worn (potion amulet)" */
|
||||
Strcpy(oclassname, def_oc_syms[(uchar)obj->oclass].name);
|
||||
Sprintf(maskbuf, "worn (%s %s)",
|
||||
makesingular(oclassname), what);
|
||||
insane_object(obj, ofmt0, maskbuf, (struct monst *)0);
|
||||
}
|
||||
}
|
||||
#else /* not (BETA || DEBUG) */
|
||||
/* dummy use of obj to avoid "arg not used" complaint */
|
||||
|
||||
28
src/steal.c
28
src/steal.c
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.5 steal.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */
|
||||
/* NetHack 3.5 steal.c $NHDT-Date: 1430528463 2015/05/02 01:01:03 $ $NHDT-Branch: master $:$NHDT-Revision: 1.53 $ */
|
||||
/* NetHack 3.5 steal.c $Date: 2012/02/05 04:26:48 $ $Revision: 1.41 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -23,15 +23,31 @@ register struct obj *otmp;
|
||||
}
|
||||
|
||||
long /* actually returns something that fits in an int */
|
||||
somegold(umoney)
|
||||
long umoney;
|
||||
somegold(lmoney)
|
||||
long lmoney;
|
||||
{
|
||||
#ifdef LINT /* long conv. ok */
|
||||
return(0L);
|
||||
int igold = 0;
|
||||
#else
|
||||
return (long)( (umoney < 100) ? umoney :
|
||||
(umoney > 10000) ? rnd(10000) : rnd((int) umoney) );
|
||||
int igold = (lmoney >= (long)LARGEST_INT) ? LARGEST_INT : (int)lmoney;
|
||||
#endif
|
||||
|
||||
if (igold < 50)
|
||||
; /* all gold */
|
||||
else if (igold < 100)
|
||||
igold = rn1(igold - 25 + 1, 25);
|
||||
else if (igold < 500)
|
||||
igold = rn1(igold - 50 + 1, 50);
|
||||
else if (igold < 1000)
|
||||
igold = rn1(igold - 100 + 1, 100);
|
||||
else if (igold < 5000)
|
||||
igold = rn1(igold - 500 + 1, 500);
|
||||
else if (igold < 10000)
|
||||
igold = rn1(igold - 1000 + 1, 1000);
|
||||
else
|
||||
igold = rn1(igold - 5000 + 1, 5000);
|
||||
|
||||
return (long)igold;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user