1
0
Fork 0
mirror of https://codeberg.org/noisytoot/notnotdnethack.git synced 2025-07-28 16:32:27 +01:00

Merge branch 'compat-3.21.1' into devel-3.21.2

This commit is contained in:
ChrisANG 2021-08-31 00:00:37 -04:00
commit a534d6ab90
11 changed files with 35 additions and 59 deletions

View file

@ -1651,7 +1651,7 @@ E struct permonst * FDECL(permonst_of, (int, int));
E struct attack *FDECL(attacktype_fordmg, (struct permonst *,int,int));
E boolean FDECL(at_least_one_attack, (struct monst *));
E boolean FDECL(attacktype, (struct permonst *,int));
E boolean FDECL(mon_attacktype, (struct monst *,int));
E struct attack *FDECL(mon_attacktype, (struct monst *,int));
E boolean FDECL(noattacks, (struct permonst *));
E int FDECL(attackindex, (struct permonst *,int,int));
E boolean FDECL(poly_when_stoned, (struct permonst *));

View file

@ -4723,6 +4723,7 @@ mergable_traits(otmp, obj) /* returns TRUE if obj & otmp can be merged */
obj->oeroded != otmp->oeroded ||
obj->oeroded2 != otmp->oeroded2 ||
obj->oeroded3 != otmp->oeroded3 ||
obj->odiluted != otmp->odiluted ||
obj->obj_material != otmp->obj_material ||
obj->bypass != otmp->bypass)
return(FALSE);

View file

@ -134,7 +134,8 @@ int mx_id;
void * mx_p2;
if ((mx_p1 = get_mx(mon1, mx_id))) {
mx_p2 = get_mx(mon2, mx_id);
if(!mx_p2) {
if(!mx_p2 || mx_list[mx_id].s_size == -1) {
rem_mx(mon2, mx_id);
if (mx_list[mx_id].s_size != -1)
add_mx(mon2, mx_id);
else

View file

@ -516,10 +516,13 @@ register struct obj *otmp;
subfrombill(otmp, shop_keeper(*u.ushops));
dummy = newobj(0);
*dummy = *otmp;
dummy->oextra_p = NULL;
dummy->light = NULL;
dummy->timed = NULL;
dummy->mp = NULL;
dummy->where = OBJ_FREE;
dummy->o_id = flags.ident++;
if (!dummy->o_id) dummy->o_id = flags.ident++; /* ident overflowed */
dummy->timed = 0;
register int ox_id;
for (ox_id=0; ox_id<NUM_OX; ox_id++)
cpy_ox(otmp, dummy, ox_id);

View file

@ -1627,7 +1627,7 @@ mkkamereltowers()
tries = 0;
otmp = 0;
while(!otmp){
while(!otmp && tries < 20){
switch(rn2(4)) {
case 0:
otmp = oname(mksobj(DOUBLE_LIGHTSABER, MKOBJ_NOINIT), artiname(ART_INFINITY_S_MIRRORED_ARC));
@ -1654,6 +1654,7 @@ mkkamereltowers()
else {
obfree(otmp, (struct obj *)0);
otmp = 0;
tries++;
continue;
}
}
@ -1728,7 +1729,7 @@ mkkamereltowers()
wallification(x-3, y-3, x+3, y+3);
tries = 0;
otmp = 0;
while(!otmp){
while(!otmp && tries < 20){
switch(rn2(4)) {
case 0:
otmp = oname(mksobj(DOUBLE_LIGHTSABER, MKOBJ_NOINIT), artiname(ART_INFINITY_S_MIRRORED_ARC));
@ -1755,6 +1756,7 @@ mkkamereltowers()
else {
obfree(otmp, (struct obj *)0);
otmp = 0;
tries++;
continue;
}
}

View file

@ -1457,7 +1457,7 @@ int atyp;
return attacktype_fordmg(ptr, atyp, AD_ANY) ? TRUE : FALSE;
}
boolean
struct attack *
mon_attacktype(mon, atyp)
struct monst *mon;
int atyp;
@ -1480,10 +1480,10 @@ int atyp;
attk = getattk(mon, (struct monst *) 0, res, &indexnum, &prev_attk, TRUE, &subout, &tohitmod)
){
if(attk->aatyp == atyp)
return TRUE;
return attk;
}
return FALSE;
return (struct attack *)0;
}
boolean

View file

@ -243,8 +243,8 @@ int force_linedup; /* if TRUE, we have some offensive item ready that will work
/* attacks that are on a line that do NOT stop on hit */
(m_online(magr, mdef, tarx, tary, dogbesafe, FALSE) && (
(mon_attacktype(magr, AT_BREA) && !magr->mcan) ||
(mon_attacktype(magr, AT_MAGC) && !magr->mcan && !real_spell_adtyp((attacktype_fordmg(magr->data, AT_MAGC, AD_ANY))->adtyp)) ||
(mon_attacktype(magr, AT_MMGC) && !magr->mcan && !real_spell_adtyp((attacktype_fordmg(magr->data, AT_MMGC, AD_ANY))->adtyp))
(mon_attacktype(magr, AT_MAGC) && !magr->mcan && !real_spell_adtyp(mon_attacktype(magr, AT_MAGC)->adtyp)) ||
(mon_attacktype(magr, AT_MMGC) && !magr->mcan && !real_spell_adtyp(mon_attacktype(magr, AT_MMGC)->adtyp))
))
||
/* attacks that splash */
@ -289,8 +289,8 @@ int force_linedup; /* if TRUE, we have some offensive item ready that will work
(distmin(magr->mx, magr->my, tarx, tary) <= 8 && (
(is_commander(magr->data) && !rn2(4)) || /* !rn2(4) -> reduce command frequency */
(mon_attacktype(magr, AT_GAZE) && !magr->mcan) ||
(mon_attacktype(magr, AT_MAGC) && !magr->mcan && real_spell_adtyp((attacktype_fordmg(magr->data, AT_MAGC, AD_ANY))->adtyp)) ||
(mon_attacktype(magr, AT_MMGC) && !magr->mcan && real_spell_adtyp((attacktype_fordmg(magr->data, AT_MMGC, AD_ANY))->adtyp))
(mon_attacktype(magr, AT_MAGC) && !magr->mcan && real_spell_adtyp(mon_attacktype(magr, AT_MAGC)->adtyp)) ||
(mon_attacktype(magr, AT_MMGC) && !magr->mcan && real_spell_adtyp(mon_attacktype(magr, AT_MMGC)->adtyp))
))
))
{

View file

@ -797,19 +797,21 @@ struct obj *obj;
char *buf;
{
boolean iscrys = (obj->otyp == CRYSKNIFE);
if (!is_damageable(obj) && obj->otyp != MASK && !iscrys && !(obj->oclass == POTION_CLASS && obj->odiluted)) return;
if (!is_damageable(obj) && obj->otyp != MASK && !iscrys) return;
/* food uses oeroded to determine if it is rotten -- do not show this */
if (obj->oclass == FOOD_CLASS)
return;
if (obj->oclass == POTION_CLASS && obj->odiluted)
Strcat(buf, "diluted ");
if (obj->oeroded && !iscrys) {
switch (obj->oeroded) {
case 2: Strcat(buf, "very "); break;
case 3: Strcat(buf, "thoroughly "); break;
}
Strcat(buf,
obj->oclass == POTION_CLASS ? "diluted " :
is_rustprone(obj) ? "rusty " :
is_evaporable(obj) ? "tenuous " :
is_flammable(obj) ? "burnt " : "eroded ");
@ -4370,6 +4372,15 @@ int wishflags;
} else if (!strncmpi(bp, "sets of ",8) && strncmpi(bp, "sets of crow talons", 19)) {
bp += 8;
}
/* change to singular if necessary */
if (*bp) {
char *sng = makesingular(bp);
if (strcmp(bp, sng)) {
if (cnt == 1) cnt = 2;
Strcpy(bp, sng);
}
}
/*
* Find corpse type using "of" (figurine of an orc, tin of orc meat)
@ -4454,15 +4465,6 @@ int wishflags;
mntmp = NON_PM;
}
}
/* first change to singular if necessary */
if (*bp) {
char *sng = makesingular(bp);
if (strcmp(bp, sng)) {
if (cnt == 1) cnt = 2;
Strcpy(bp, sng);
}
}
/* Alternate spellings (pick-ax, silver sabre, &c) */
{

View file

@ -130,7 +130,8 @@ int ox_id;
void * ox_p2;
if ((ox_p1 = get_ox(obj1, ox_id))) {
ox_p2 = get_ox(obj2, ox_id);
if(!ox_p2) {
if(!ox_p2 || ox_list[ox_id].s_size == -1) {
rem_ox(obj2, ox_id);
if (ox_list[ox_id].s_size != -1)
add_ox(obj2, ox_id);
else

View file

@ -134,6 +134,7 @@ test_readobjnam()
/* tests for specific items */
TEST("potion of green dragon blood", otmp->otyp == POT_BLOOD && otmp->corpsenm == PM_GREEN_DRAGON);
TEST("2 potions of tengu blood", otmp->otyp == POT_BLOOD && otmp->corpsenm == PM_TENGU && otmp->quan == 2);
TEST("tin of spinach", otmp->otyp == TIN && otmp->spe == 1);
TEST("healing potion", otmp->otyp == POT_HEALING);

View file

@ -1490,41 +1490,6 @@ struct obj * otmp;
dmg += vd(ndice, diesize);
}
if (hates_unholy_mon(mdef) &&
is_unholy(otmp)) {
/* default: 1d9 */
ndice = 1;
diesize = 9;
/* special cases */
if (otmp->oartifact == ART_STORMBRINGER)
ndice = 4; //Extra unholy (4d9 vs excal's 3d7)
else if (otmp->oartifact == ART_GODHANDS)
dmg += 9;
else if (otmp->oartifact == ART_DIRGE)
dmg += 6;
else if (otmp->oartifact == ART_LANCE_OF_LONGINUS)
ndice = 3;
else if (otmp->oartifact == ART_SCEPTRE_OF_THE_FROZEN_FLOO)
{ ndice = 0; dmg += 8; } // add directly; no dice rolled
else if (otmp->oartifact == ART_ROD_OF_SEVEN_PARTS)
diesize = 20;
else if (otmp->oartifact == ART_AMHIMITL)
{ ndice = 3; diesize = 4; }
else if (otmp->oartifact == ART_TECPATL_OF_HUHETOTL) /* SCOPECREEP: add ART_TECPATL_OF_HUHETOTL to is_unholy() macro */
{ ndice = (otmp->cursed ? 4 : 2); diesize = 4; }
if (otmp->otyp == KHAKKHARA)
ndice *= khakharadice;
/* gold has a particular affinity to blessings and curses */
if (otmp->obj_material == GOLD &&
!(is_lightsaber(otmp) && litsaber(otmp))) {
ndice *= 2;
}
/* calculate */
if (ndice)
dmg += vd(ndice, diesize);
}
if (hates_unblessed_mon(mdef) &&
!(is_unholy(otmp) || otmp->blessed)
) {