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.2' into devel-3.21.3

# Conflicts:
#	src/objects.c
#	src/xhity.c
This commit is contained in:
chris 2022-05-18 08:43:53 -04:00
commit fb42635b07
23 changed files with 639 additions and 599 deletions

View file

@ -171,7 +171,7 @@ struct objclass {
#define ARM_SHIRT 6
#define ARM_SUIT 0
uchar oc_oprop; /* property (invis, &c.) conveyed */
uchar oc_oprop[8]; /* property (invis, &c.) conveyed */
char oc_class; /* object class */
schar oc_delay; /* delay when using such an object */
uchar oc_color; /* color of the object */

View file

@ -4430,9 +4430,8 @@ use_crook (obj)
"pull a monster", MENU_UNSELECTED);
any.a_int++;
Sprintf(buf, "pull an object on the %s", surface(cc.x, cc.y));
add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE,
buf, MENU_UNSELECTED);
"pull an object", MENU_UNSELECTED);
end_menu(tmpwin, "Aim for what?");
if (select_menu(tmpwin, PICK_ONE, &selected) > 0)
tohit = selected[0].item.a_int - 1;
@ -4493,6 +4492,13 @@ use_crook (obj)
}
break;
case 3: /* Object */
{
int tmp = flags.standard_polearms;
flags.standard_polearms = 1;
res = pick_polearm_target(obj, &mtmp, &cc);
flags.standard_polearms = tmp;
}
if (!res) return 0;
if ((otmp = level.objects[cc.x][cc.y]) != 0) {
You("snag an object from the %s!", surface(cc.x, cc.y));
(void) pickup_object(otmp, 1L, FALSE);

View file

@ -100,7 +100,7 @@ Boots_on()
ABON(A_CHA) += 2;
flags.botl = 1;
}
oldprop = (u.uprops[objects[uarmf->otyp].oc_oprop].extrinsic & ~WORN_BOOTS);
oldprop = (u.uprops[objects[uarmf->otyp].oc_oprop[0]].extrinsic & ~WORN_BOOTS);
switch(uarmf->otyp) {
case LOW_BOOTS:
@ -154,7 +154,7 @@ int
Boots_off()
{
int otyp = uarmf->otyp;
long oldprop = u.uprops[objects[otyp].oc_oprop].extrinsic & ~WORN_BOOTS;
long oldprop = u.uprops[objects[otyp].oc_oprop[0]].extrinsic & ~WORN_BOOTS;
if (!cancelled_don) adj_abon(uarmf, -uarmf->spe);
@ -226,7 +226,7 @@ Cloak_on()
long oldprop;
if (!uarmc) return 0;
oldprop =
u.uprops[objects[uarmc->otyp].oc_oprop].extrinsic & ~WORN_CLOAK;
u.uprops[objects[uarmc->otyp].oc_oprop[0]].extrinsic & ~WORN_CLOAK;
adj_abon(uarmc, uarmc->spe);
switch(uarmc->otyp) {
@ -294,7 +294,7 @@ Cloak_off()
{
int otyp = uarmc->otyp;
boolean checkweight = FALSE;
long oldprop = u.uprops[objects[otyp].oc_oprop].extrinsic & ~WORN_CLOAK;
long oldprop = u.uprops[objects[otyp].oc_oprop[0]].extrinsic & ~WORN_CLOAK;
if(arti_lighten(uarmc, FALSE)) checkweight = TRUE;
if (!cancelled_don) adj_abon(uarmc, -uarmc->spe);
@ -554,7 +554,7 @@ Gloves_on()
long oldprop;
if (!uarmg) return 0;
oldprop =
u.uprops[objects[uarmg->otyp].oc_oprop].extrinsic & ~WORN_GLOVES;
u.uprops[objects[uarmg->otyp].oc_oprop[0]].extrinsic & ~WORN_GLOVES;
adj_abon(uarmg, uarmg->spe);
switch(uarmg->otyp) {
@ -587,7 +587,7 @@ int
Gloves_off()
{
long oldprop =
u.uprops[objects[uarmg->otyp].oc_oprop].extrinsic & ~WORN_GLOVES;
u.uprops[objects[uarmg->otyp].oc_oprop[0]].extrinsic & ~WORN_GLOVES;
if (!cancelled_don) adj_abon(uarmg, -uarmg->spe);
takeoff_mask &= ~W_ARMG;
@ -969,7 +969,7 @@ void
Ring_on(obj)
register struct obj *obj;
{
long oldprop = u.uprops[objects[obj->otyp].oc_oprop].extrinsic;
long oldprop = u.uprops[objects[obj->otyp].oc_oprop[0]].extrinsic;
int old_attrib, which;
if (obj == uwep) setuwep((struct obj *) 0);
@ -1094,7 +1094,7 @@ boolean gone;
int old_attrib, which;
takeoff_mask &= ~mask;
if(objects[obj->otyp].oc_oprop && !(u.uprops[objects[obj->otyp].oc_oprop].extrinsic & mask))
if(objects[obj->otyp].oc_oprop[0] && !(u.uprops[objects[obj->otyp].oc_oprop[0]].extrinsic & mask))
impossible("Strange... I didn't know you had that ring.");
if(gone) setnotworn(obj);
else setworn((struct obj *)0, obj->owornmask);
@ -3076,6 +3076,14 @@ register struct obj *otmp;
return 0;
}
}
/* merged-with-skin check */
if (otmp->owornmask & W_SKIN) {
Your("%s %s merged with your skin!",
simple_typename(otmp->otyp),
otmp->otyp >= GRAY_DRAGON_SCALES && otmp->otyp <= YELLOW_DRAGON_SCALES ? "are" : "is"
);
return 0;
}
/* basic curse check */
if (otmp == uquiver || (otmp == uswapwep && !u.twoweap)) {
; /* some items can be removed even when cursed */

View file

@ -2148,7 +2148,7 @@ struct obj *otmp;
/* Note: rings are not so common that this is unbalancing. */
/* (How often do you even _find_ 3 rings of polymorph in a game?) */
oldprop = u.uprops[objects[typ].oc_oprop].intrinsic;
oldprop = u.uprops[objects[typ].oc_oprop[0]].intrinsic;
if (otmp == uleft || otmp == uright) {
Ring_gone(otmp);
if (u.uhp <= 0) return; /* died from sink fall */
@ -2157,12 +2157,12 @@ struct obj *otmp;
if (otmp->otyp == AMULET_OF_STRANGULATION || otmp->otyp == AMULET_OF_DRAIN_RESISTANCE || !rn2(otmp->oclass == RING_CLASS ? 3 : 5)) {
switch (otmp->otyp) {
default:
if (!objects[typ].oc_oprop) break; /* should never happen */
if (!objects[typ].oc_oprop[0]) break; /* should never happen */
if (!(u.uprops[objects[typ].oc_oprop].intrinsic & FROMOUTSIDE))
if (!(u.uprops[objects[typ].oc_oprop[0]].intrinsic & FROMOUTSIDE))
accessory_has_effect(otmp);
u.uprops[objects[typ].oc_oprop].intrinsic |= TIMEOUT_INF;
u.uprops[objects[typ].oc_oprop[0]].intrinsic |= TIMEOUT_INF;
switch (typ) {
case RIN_SEE_INVISIBLE:

View file

@ -391,6 +391,14 @@ register struct monst *mtmp;
You("die...");
mark_synch(); /* flush buffered screen output */
if (mtmp == &youmonst) {
killer_format = KILLED_BY;
killer = "their own actions";
done(DIED);
return;
}
buf[0] = '\0';
killer_format = KILLED_BY_AN;
/* "killed by the high priest of Crom" is okay, "killed by the high

View file

@ -1442,8 +1442,6 @@ resistances_enlightenment()
if(u.spirit[GPREM_SPIRIT]) numBound++;
if(u.spirit[ALIGN_SPIRIT]) numBound++;
if(u.spirit[OUTER_SPIRIT]) numBound++;
if(Role_if(PM_ANACHRONONAUT) && (u.specialSealsActive&SEAL_BLACK_WEB))
numBound++;
Sprintf(buf, "Your soul is bound to ");
for(i=0;i<QUEST_SPIRIT;i++){
if(u.spirit[i]) for(j=0;j<32;j++){

View file

@ -3051,9 +3051,9 @@ winid *datawin;
ADDCLASSPROP((oart->aflags&ARTA_SHATTER), "shattering");
ADDCLASSPROP((oart->aflags&ARTA_DISARM), "disarming");
ADDCLASSPROP((oart->aflags&ARTA_STEAL), "theiving");
ADDCLASSPROP((oart->aflags&(ARTA_EXPLFIRE|ARTA_EXPLFIREX)), " fire exploding");
ADDCLASSPROP((oart->aflags&(ARTA_EXPLCOLD|ARTA_EXPLCOLDX)), " cold exploding");
ADDCLASSPROP((oart->aflags&(ARTA_EXPLELEC|ARTA_EXPLELECX)), " shock exploding");
ADDCLASSPROP((oart->aflags&(ARTA_EXPLFIRE|ARTA_EXPLFIREX)), "fire exploding");
ADDCLASSPROP((oart->aflags&(ARTA_EXPLCOLD|ARTA_EXPLCOLDX)), "cold exploding");
ADDCLASSPROP((oart->aflags&(ARTA_EXPLELEC|ARTA_EXPLELECX)), "shock exploding");
ADDCLASSPROP((oart->aflags&(ARTA_KNOCKBACK|ARTA_KNOCKBACKX)), "kinetic");
if (buf[0] != '\0')
{
@ -3624,8 +3624,11 @@ winid *datawin;
boolean got_prop = FALSE, while_carried = FALSE;
int j = 0;
if (oc.oc_oprop == propertynames[i].prop_num)
got_prop = TRUE;
while(oc.oc_oprop[j] && !got_prop) {
if (oc.oc_oprop[j] == propertynames[i].prop_num)
got_prop = TRUE;
j++;
}
j = 0;
while (properties_item[j] && !got_prop) {
@ -3701,6 +3704,7 @@ winid *datawin;
case POLYMORPH_CONTROL:
case FREE_ACTION:
case FIXED_ABIL:
case CLEAR_THOUGHTS:
confers = "Confers";
break;
default:

View file

@ -123,7 +123,7 @@ picklock() /* try to open/close a lock */
{
if (xlock.box) {
if((xlock.box->ox != u.ux) || (xlock.box->oy != u.uy)) {
if((xlock.box->where != OBJ_FLOOR) || (xlock.box->ox != u.ux) || (xlock.box->oy != u.uy)) {
return((xlock.usedtime = 0)); /* you or it moved */
}
} else { /* door */

View file

@ -9187,35 +9187,39 @@ boolean goodequip;
}
} else if(ptr->mtyp == PM_LURKING_ONE) {
int i;
long long oprop;
switch(rnd(20)){
long long oprop = 0;
int spe = rn2(4);
if(!rn2(20)) switch(rnd(10)){
case 1:
case 2:
oprop = OPROP_ELECW;
break;
case 2:
case 3:
oprop = OPROP_ACIDW;
break;
case 3:
oprop = OPROP_MAGCW;
break;
case 4:
oprop = OPROP_WATRW;
break;
case 5:
case 6:
oprop = OPROP_MAGCW;
break;
case 7:
oprop = OPROP_WATRW;
break;
case 8:
case 9:
case 10:
oprop = OPROP_PSIOW;
break;
default:
oprop = 0;
break;
}
if(!oprop && !rn2(10))
spe = 10;
for(i = 2; i > 0; i--){
otmp = mksobj(CLUB, mkobjflags|MKOBJ_NOINIT);
set_material_gm(otmp, BONE);
add_oprop(otmp, OPROP_CCLAW);
add_oprop(otmp, oprop);
otmp->objsize = mtmp->data->msize;
otmp->spe = spe;
fix_object(otmp);
(void) mpickobj(mtmp, otmp);
}

View file

@ -4503,7 +4503,7 @@ int tary;
struct obj* otmp;
/* not a perfect method to check if mdef gets INVIS from an item */
for (otmp = mdef->minvent; otmp; otmp = otmp->nobj)
if (otmp->owornmask && objects[otmp->otyp].oc_oprop == INVIS)
if (otmp->owornmask && objects[otmp->otyp].oc_oprop[0] == INVIS)
break;
if (!otmp) mdef->minvis = 0;
newsym(x(mdef), y(mdef));

View file

View file

View file

@ -1150,6 +1150,13 @@ int level_bonus;
attkptr->damn = 1 + d(1, 2) + rn2(2)*rn2(3); /* 2 - 5, trailing right */
attkptr->damd = rn2(5 - attkptr->damn) * 2 + 6; /* 6 - 10, by 2s */
/* int-drain attack uses dice as stat damage, reduce dice to compensate */
if (attkptr->adtyp == AD_DRIN) {
attkptr->damn /= 2; /* 1 - 2 */
attkptr->damd /= 2; /* 3 - 5 */
}
/* sometimes consolidate into a high-variance attack */
if (!rn2(4)) {
int n = 1 + rn2(2)*rn2(2);

View file

@ -260,7 +260,7 @@ NEARDATA struct permonst mons[] = {
MM_AMORPHOUS|MM_FLY|MM_AMPHIBIOUS|MM_SWIM|MM_WEBRIP /*MM*/, MT_COLLECT|MT_OMNIVORE|MT_STALK /*MT*/, 0 /*MF*/,
MB_NOHEAD|MB_CAN_AMULET|MB_ACID|MB_STRONG|MB_FEMALE /*MB*/, MG_NOPOLY|MG_NOWISH|MG_INFRAVISIBLE|MG_NASTY|MG_REGEN|MG_LORD|MG_HATESUNHOLY|MG_TRACKER|MG_SANLOSS|MG_INSIGHT /*MG*/,
MA_PRIMORDIAL|MA_MINION|MA_FEY /*MA*/, MV_CATSIGHT|MV_SEE_INVIS|MV_INFRAVISION|MV_LOWLIGHT3 /*MV*/, CLR_BRIGHT_MAGENTA),
MON("coiling brawn", S_BLOB,//24
MON("coiling brawn", S_BLOB,//24 /*needs encyc entry*/
LVL(11, 12, 0, -5), (G_GENO|G_NOGEN),
DEF(NAT_AC(5)),
A(ATTK(AT_CLAW, AD_PHYS, 1, 6), ATTK(AT_CLAW, AD_PHYS, 1, 6),
@ -1748,7 +1748,7 @@ NEARDATA struct permonst mons[] = {
0 /*MM*/, MT_HOSTILE|MT_CARNIVORE /*MT*/, 0 /*MF*/,
MB_ANIMAL|MB_LONGHEAD|MB_NOHANDS|MB_OVIPAROUS|MB_POIS|MB_STRONG /*MB*/, 0 /*MG*/,
MA_ARACHNID /*MA*/, MV_NORMAL /*MV*/, CLR_BRIGHT_MAGENTA),
MON("yurian", S_SPIDER,//18 Dweller in the Depths
MON("yurian", S_SPIDER,//18 Needs encyc entry
LVL(15, 9, 0, -3), G_NOGEN,
DEF(NAT_AC(5), SPE_AC(10), NAT_DR(2)),
A(ATTK(AT_CLAW, AD_PHYS, 8, 2), ATTK(AT_CLAW, AD_PHYS, 4, 2),

File diff suppressed because it is too large Load diff

View file

@ -3654,6 +3654,7 @@ int wishflags;
int blessed, uncursed, iscursed, ispoisoned, isgreased, isdrained, stolen, uncharged;
int moonphase = -1, viperheads = -1, ampule = -1, mat = 0;
int eroded, eroded2, eroded3, erodeproof;
int summoned = 0;
int gemtype = 0;
#ifdef INVISIBLE_OBJECTS
int isinvisible;
@ -3706,6 +3707,7 @@ int wishflags;
char *un, *dn, *actualn;
const char *name=0;
boolean isartifact = FALSE;
int mkobjflags = NO_MKOBJ_FLAGS;
cnt = spe = spesgn = typ = very = rechrg =
blessed = uncursed = iscursed = stolen =
@ -3775,6 +3777,18 @@ int wishflags;
l = 0;
} else if (!strncmpi(bp, "stolen ", l=7)) {
stolen = 1;
} else if (!strncmpi(bp, "summoned ", l=9)) {
int tmp;
if (bp[9] == '(' && rindex(bp, ')')) {
bp += 10;
summoned = atoi(bp);
while(digit(*bp)) bp++;
while((*bp == ' ') || (*bp == ')')) bp++;
l = 0;
}
else {
summoned = ESUMMON_PERMANENT;
}
} else if(!strncmpi(bp, "heptagram ", l=10)){
heptagram = TRUE;
} else if(!strncmpi(bp, "gorgoneion ", l=10)){
@ -4640,7 +4654,7 @@ int wishflags;
*wishreturn = WISH_SUCCESS;
return (&zeroobj);
#else
otmp = mksobj(GOLD_PIECE, MKOBJ_NOINIT);
otmp = mksobj(GOLD_PIECE, mkobjflags|MKOBJ_NOINIT);
otmp->quan = cnt;
otmp->owt = weight(otmp);
flags.botl=1;
@ -5212,14 +5226,23 @@ typfnd:
*wishreturn = WISH_DENIED;
return &zeroobj;
}
if (summoned && wizwish) {
mkobjflags |= MKOBJ_SUMMON;
}
if(typ) {
otmp = mksobj(typ, NO_MKOBJ_FLAGS);
otmp = mksobj(typ, mkobjflags);
} else {
otmp = mkobj(oclass, FALSE);
otmp = mkobj(oclass, mkobjflags);
if (otmp) typ = otmp->otyp;
}
if (get_ox(otmp, OX_ESUM) && summoned != ESUMMON_PERMANENT) {
otmp->oextra_p->esum_p->permanent = 0;
adjust_timer_duration(get_timer(otmp->timed, DESUMMON_OBJ), summoned - ESUMMON_PERMANENT);
}
if (islit &&
(typ == OIL_LAMP || typ == MAGIC_LAMP || typ == LANTERN ||
Is_candle(otmp) || typ == POT_OIL)) {

View file

@ -78,6 +78,7 @@ static const char * const sizeStr[] = {
"bigger-than-a-breadbox",
"small",
"human-sized",
"medium",
"large",
"gigantic",
"colossal",
@ -420,7 +421,7 @@ lookat(x, y, buf, monbuf, shapebuff)
if(!do_halu){
if(mdat->msize == MZ_TINY) Sprintf(shapebuff, "a tiny");
else if(mdat->msize == MZ_SMALL) Sprintf(shapebuff, "a small");
else if(mdat->msize == MZ_HUMAN) Sprintf(shapebuff, "a human-sized");
else if(mdat->msize == MZ_MEDIUM) Sprintf(shapebuff, "a medium");
else if(mdat->msize == MZ_LARGE) Sprintf(shapebuff, "a large");
else if(mdat->msize == MZ_HUGE) Sprintf(shapebuff, "a huge");
else if(mdat->msize == MZ_GIGANTIC) Sprintf(shapebuff, "a gigantic");

View file

@ -64,6 +64,7 @@ const struct propname {
{ SICK_RES, "sickness resistance" },
{ ANTIMAGIC, "magic resistance" },
{ HALLUC_RES, "hallucination resistance" },
{ BLOCK_CONFUSION, "confusion resistance" },
{ FUMBLING, "fumbling" },
{ HUNGER, "voracious hunger" },
{ TELEPAT, "telepathic" },
@ -104,6 +105,7 @@ const struct propname {
{ SHATTERING, "fracturing" },
{ DARKVISION_ONLY, "darksight-override" },
{ DIMENSION_LOCK, "dimensional lock" },
{ CLEAR_THOUGHTS, "clear thoughts" },
{ 0, 0 },
};

View file

View file

@ -87,33 +87,24 @@ int * property_list;
struct obj* obj;
int otyp;
{
int cur_prop, i;
int cur_prop, i, j;
boolean got_prop;
if (obj)
otyp = obj->otyp;
// bonus properties some items have that cannot fit into objclass->oc_oprop
const static int NO_RES[] = { 0 };
const static int ALCHEMY_RES[] = { ACID_RES, 0 };
const static int FACEPLATE_RES[] = { WATERPROOF, 0 };
const static int ORANGE_RES[] = { SLEEP_RES, HALLUC_RES, 0 };
const static int YELLOW_RES[] = { STONE_RES, 0 };
const static int GREEN_RES[] = { SICK_RES, 0 };
const static int BLUE_RES[] = { FAST, 0 };
const static int BLACK_RES[] = { DRAIN_RES, 0 };
const static int RED_RES[] = { FLYING, 0 };
const static int WHITE_RES[] = { MAGICAL_BREATHING, SWIMMING, WATERPROOF, 0 };
const static int GRAY_RES[] = { HALF_SPDAM, 0 };
const static int SHIM_RES[] = { SEE_INVIS, 0 };
i = 0;
for (cur_prop = 1; cur_prop < LAST_PROP; cur_prop++)
{
got_prop = FALSE;
// from objclass
if (objects[otyp].oc_oprop == cur_prop)
got_prop = TRUE;
j = 0;
while(objects[otyp].oc_oprop[j] && !got_prop) {
if (objects[otyp].oc_oprop[j] == cur_prop)
got_prop = TRUE;
j++;
}
// from object properties
if (!got_prop && obj && !check_oprop(obj, OPROP_NONE)){
switch (cur_prop)
@ -152,77 +143,6 @@ int otyp;
break;
}
}
// from object type that doesn't fit into objclass
if (!got_prop)
{
// first, select the item's list of bonus properties
const int * bonus_prop_list;
switch (otyp)
{
case ALCHEMY_SMOCK:
bonus_prop_list = (ALCHEMY_RES);
break;
case R_LYEHIAN_FACEPLATE:
bonus_prop_list = (FACEPLATE_RES);
break;
case RED_DRAGON_SCALES:
case RED_DRAGON_SCALE_MAIL:
//Note: NOT shield: flight is due to wings.
bonus_prop_list = (RED_RES);
break;
case ORANGE_DRAGON_SCALES:
case ORANGE_DRAGON_SCALE_MAIL:
case ORANGE_DRAGON_SCALE_SHIELD:
bonus_prop_list = (ORANGE_RES);
break;
case YELLOW_DRAGON_SCALES:
case YELLOW_DRAGON_SCALE_MAIL:
case YELLOW_DRAGON_SCALE_SHIELD:
bonus_prop_list = (YELLOW_RES);
break;
case GREEN_DRAGON_SCALES:
case GREEN_DRAGON_SCALE_MAIL:
case GREEN_DRAGON_SCALE_SHIELD:
bonus_prop_list = (GREEN_RES);
break;
case BLUE_DRAGON_SCALES:
case BLUE_DRAGON_SCALE_MAIL:
case BLUE_DRAGON_SCALE_SHIELD:
bonus_prop_list = (BLUE_RES);
break;
case BLACK_DRAGON_SCALES:
case BLACK_DRAGON_SCALE_MAIL:
case BLACK_DRAGON_SCALE_SHIELD:
bonus_prop_list = (BLACK_RES);
break;
case WHITE_DRAGON_SCALES:
case WHITE_DRAGON_SCALE_MAIL:
case WHITE_DRAGON_SCALE_SHIELD:
bonus_prop_list = (WHITE_RES);
break;
case GRAY_DRAGON_SCALES:
case GRAY_DRAGON_SCALE_MAIL:
case GRAY_DRAGON_SCALE_SHIELD:
bonus_prop_list = (GRAY_RES);
break;
case SHIMMERING_DRAGON_SCALES:
case SHIMMERING_DRAGON_SCALE_MAIL:
case SHIMMERING_DRAGON_SCALE_SHIELD:
bonus_prop_list = (SHIM_RES);
break;
default:
bonus_prop_list = (NO_RES);
break;
}
// if it has one, then see if the current property is on the list
if (bonus_prop_list != (NO_RES))
{
int j;
for (j = 0; bonus_prop_list[j]; j++)
if (bonus_prop_list[j] == cur_prop)
got_prop = TRUE;
}
}
// if we've got the property, add it to the array
if (got_prop)
{
@ -1879,112 +1799,116 @@ struct obj *obj;
if (!obj)
return 0;
int score = 0;
/* specific item types that are more than their oc_oprop */
switch (obj->otyp)
{
/* gloves */
case GAUNTLETS_OF_POWER:
return 8;
score += 8;
break;
case GAUNTLETS_OF_DEXTERITY:
return (obj->spe / 2);
score += (obj->spe / 2);
break;
/* cloaks */
case ALCHEMY_SMOCK:
if (!species_resists_acid(mon) || !species_resists_poison(mon))
return 5;
score += 5;
break;
case LIVING_MASK:
return 3;
score += 3;
break;
case SUNGLASSES:
return 2;
score += 2;
break;
case ANDROID_VISOR:
if(is_android(mon)) return 4;
return 1;
if(is_android(mon)) score += 4;
score += 1;
break;
case MUMMY_WRAPPING:
case PRAYER_WARDED_WRAPPING:
if (mon->data->mlet == S_MUMMY)
return 30;
score += 30;
else if (mon->mtame && mon->minvis && !See_invisible_old)
return 10;
score += 10;
else if (mon->minvis)
return -5;
score += -5;
break;
}
/* oc_oprop -- does not include extra properties
* such as the alchemy smock or object properties */
switch (objects[obj->otyp].oc_oprop)
{
case ANTIMAGIC:
if (!species_resists_magic(mon))
return 20;
break;
case REFLECTING:
if (!(has_template(mon, FRACTURED) || species_reflects(mon)))
return 18;
break;
case FAST:
if (mon->permspeed != MFAST)
return 15;
break;
case FLYING:
if (!species_flies(mon->data))
return 10;
break;
case DISPLACED:
if (!species_displaces(mon->data))
return 8;
break;
case STONE_RES:
if (!species_resists_ston(mon))
return 7;
break;
case SICK_RES:
if (!species_resists_sickness(mon))
return 5;
break;
case FIRE_RES:
if (!species_resists_fire(mon))
return 3;
case COLD_RES:
if (!species_resists_cold(mon))
return 3;
case SHOCK_RES:
if (!species_resists_elec(mon))
return 3;
case ACID_RES:
if (!species_resists_acid(mon))
return 3;
case POISON_RES:
if (!species_resists_poison(mon))
return 3;
case SLEEP_RES:
if (!species_resists_sleep(mon))
return 3;
case DRAIN_RES:
if (!species_resists_drain(mon))
return 3;
break;
case TELEPAT:
if (!species_is_telepathic(mon->data))
return 1;
break;
case FUMBLING:
return -20;
break;
/* pets prefer not to wear items that make themselves invisible to you */
case INVIS:
if (mon->mtame && !See_invisible_old)
return -20;
else if (!pm_invisible(mon->data))
return 5;
break;
int j;
for (j=0; objects[obj->otyp].oc_oprop[j]; j++) {
switch (objects[obj->otyp].oc_oprop[j])
{
case ANTIMAGIC:
if (!species_resists_magic(mon))
score += 20;
break;
case REFLECTING:
if (!(has_template(mon, FRACTURED) || species_reflects(mon)))
score += 18;
break;
case FAST:
if (mon->permspeed != MFAST)
score += 15;
break;
case FLYING:
if (!species_flies(mon->data))
score += 10;
break;
case DISPLACED:
if (!species_displaces(mon->data))
score += 8;
break;
case STONE_RES:
if (!species_resists_ston(mon))
score += 7;
break;
case SICK_RES:
if (!species_resists_sickness(mon))
score += 5;
break;
case FIRE_RES:
if (!species_resists_fire(mon))
score += 3;
case COLD_RES:
if (!species_resists_cold(mon))
score += 3;
case SHOCK_RES:
if (!species_resists_elec(mon))
score += 3;
case ACID_RES:
if (!species_resists_acid(mon))
score += 3;
case POISON_RES:
if (!species_resists_poison(mon))
score += 3;
case SLEEP_RES:
if (!species_resists_sleep(mon))
score += 3;
case DRAIN_RES:
if (!species_resists_drain(mon))
score += 3;
break;
case TELEPAT:
if (!species_is_telepathic(mon->data))
score += 1;
break;
case FUMBLING:
score += -20;
break;
/* pets prefer not to wear items that make themselves invisible to you */
case INVIS:
if (mon->mtame && !See_invisible_old)
score += -20;
else if (!pm_invisible(mon->data))
score += 5;
break;
}
}
return 0;
return score;
}
/* magic_negation()

View file

@ -2479,7 +2479,9 @@ struct attack *attk;
(attk->adtyp == AD_MERC) ? " with a blade of mercury!" :
(attk->adtyp == AD_WET) ? " with a water-jet blade!" :
(attk->adtyp == AD_PSON) ? " with a soul blade!" :
(attk->adtyp == AD_BLUD) ? " with a blade of blood!" : "!";
(attk->adtyp == AD_BLUD) ? " with a blade of blood!" :
(attk->adtyp == AD_EFIR) ? " with a blade of fire!" :
(attk->adtyp == AD_EDRC) ? " with a blade of poison!" : "!";
if (youdef)
specify_you = TRUE;
}
@ -15837,6 +15839,7 @@ boolean endofchain; /* if the passive is occuring at the end of aggressor's at
&& badtouch(magr, mdef, attk, weapon))
{
if (youagr) {
/* don't call xstoney, we want instant-stoning for the player */
if (poly_when_stoned(youracedata) && polymon(PM_STONE_GOLEM)) {
/* polyd into a stone golem */
result |= MM_AGR_STOP;
@ -15849,25 +15852,7 @@ boolean endofchain; /* if the passive is occuring at the end of aggressor's at
}
}
else {
if (poly_when_stoned(pa)) {
mon_to_stone(magr);
result |= MM_AGR_STOP;
}
else {
if (vis&VIS_MAGR) {
pline("%s turns to stone!", Monnam(magr));
}
stoned = 1;
if(youdef)
xkilled(magr, 0);
else
monkilled(magr, "", AD_STON);
stoned = 0;
if (*hp(magr) > 0)
result |= MM_AGR_STOP;
else
result |= MM_AGR_DIED;
}
result |= xstoney(mdef, magr);
}
}
break;

View file

@ -1668,10 +1668,45 @@ struct obj * weapon;
))
return 2;
if (hates_holy_mon(mdef) &&
attk && attk->adtyp == AD_HOLY)
return 2;
if (hates_unholy_mon(mdef) &&
attk && attk->adtyp == AD_UNHY)
return 2;
if (has_blood_mon(mdef) &&
attk && attk->adtyp == AD_BLUD)
return 2;
if (!mindless_mon(mdef) &&
attk && attk->adtyp == AD_PSON)
return 2;
if (attk && attk->adtyp == AD_SHDW)
return 2;
/*if (attk && (attk->adtyp == AD_MERC))
return 2; Currently unused, unclear what conditions it should check exactly
*/
if ((flaming(mdef->data) || is_iron(mdef->data)) &&
attk && attk->adtyp == AD_WET)
return 2;
if (!((species_resists_fire(mdef))
|| (ward_at(x(mdef), y(mdef)) == SIGIL_OF_CTHUGHA)
|| (youdef && ((Race_if(PM_HALF_DRAGON) && flags.HDbreath == AD_FIRE)))
|| (!youdef && is_half_dragon(pd) && mdef->mvar_hdBreath == AD_FIRE)
|| (youdef && u.sealsActive&SEAL_FAFNIR)) &&
attk && attk->adtyp == AD_EFIR)
return 2;
if (!Poison_res(mdef) &&
attk && attk->adtyp == AD_EDRC)
return 2; /* likely will be swapped out to wormwood (poisonous/starlight/water damage) at some point */
if ((hates_silver(pd) && !(youdef && u.sealsActive&SEAL_EDEN)) && (
(youagr && u.sealsActive&SEAL_EDEN) ||
(attk && attk->adtyp == AD_GLSS) ||

View file

@ -4164,12 +4164,18 @@ struct zapdata * zapdata;
return xdamagey(magr, mdef, &attk, dmg);
case AD_FIRE:
case AD_EFIR:
/* check resist / weakness */
if (Fire_res(mdef)) {
doshieldeff = TRUE;
if (youdef)
addmsg("You don't feel hot!");
dmg = 0;
if (zapdata->adtyp == AD_EFIR) {
dmg *= 0.5;
}
else {
doshieldeff = TRUE;
if (youdef)
addmsg("You don't feel hot!");
dmg = 0;
}
}
else if (Cold_res(mdef)) {
dmg *= 1.5;
@ -4192,12 +4198,18 @@ struct zapdata * zapdata;
return xdamagey(magr, mdef, &attk, dmg);
case AD_COLD:
case AD_ECLD:
/* check resist / weakness */
if (Cold_res(mdef)) {
doshieldeff = TRUE;
if (youdef)
addmsg("You don't feel cold!");
dmg = 0;
if (zapdata->adtyp == AD_ECLD) {
dmg *= 0.5;
}
else {
doshieldeff = TRUE;
if (youdef)
addmsg("You don't feel cold!");
dmg = 0;
}
}
else if (Fire_res(mdef)) {
dmg *= 1.5;
@ -4216,12 +4228,18 @@ struct zapdata * zapdata;
return xdamagey(magr, mdef, &attk, dmg);
case AD_ELEC:
case AD_EELC:
/* check resist */
if (Shock_res(mdef)) {
doshieldeff = TRUE;
if (youdef)
addmsg("You aren't shocked!");
dmg = 0;
if (zapdata->adtyp == AD_EELC) {
dmg *= 0.5;
}
else {
doshieldeff = TRUE;
if (youdef)
addmsg("You aren't shocked!");
dmg = 0;
}
}
domsg();
golemeffects(mdef, AD_ELEC, svddmg);
@ -4233,12 +4251,18 @@ struct zapdata * zapdata;
return xdamagey(magr, mdef, &attk, dmg);
case AD_ACID:
case AD_EACD:
/* check resist */
if (Acid_res(mdef)) {
doshieldeff = TRUE;
if (youdef)
addmsg("You seem unaffected.");
dmg = 0;
if (zapdata->adtyp == AD_EACD) {
dmg *= 0.5;
}
else {
doshieldeff = TRUE;
if (youdef)
addmsg("You seem unaffected.");
dmg = 0;
}
}
/* extra effects vs player */
if (youdef && dmg > 0) {