dipping in acid
Add checks to allow erosion of objects #dip'd in acid. From a bug report.
This commit is contained in:
@@ -79,6 +79,7 @@ flyers can get out of pits more easily than non-flyers
|
|||||||
allow use of the < command to try to exit a pit
|
allow use of the < command to try to exit a pit
|
||||||
clean up messages when you stop levitation while riding a flying steed
|
clean up messages when you stop levitation while riding a flying steed
|
||||||
account for all attacks when determining max_passive_dmg
|
account for all attacks when determining max_passive_dmg
|
||||||
|
dipping in acid can erode the dipped object
|
||||||
|
|
||||||
|
|
||||||
Platform- and/or Interface-Specific Fixes
|
Platform- and/or Interface-Specific Fixes
|
||||||
|
|||||||
+1
-1
@@ -2361,7 +2361,7 @@ E void NDECL(uwepgone);
|
|||||||
E void NDECL(uswapwepgone);
|
E void NDECL(uswapwepgone);
|
||||||
E void NDECL(uqwepgone);
|
E void NDECL(uqwepgone);
|
||||||
E void NDECL(untwoweapon);
|
E void NDECL(untwoweapon);
|
||||||
E void FDECL(erode_obj, (struct obj *,BOOLEAN_P,BOOLEAN_P));
|
E boolean FDECL(erode_obj, (struct obj *,BOOLEAN_P,BOOLEAN_P,BOOLEAN_P));
|
||||||
E int FDECL(chwepon, (struct obj *,int));
|
E int FDECL(chwepon, (struct obj *,int));
|
||||||
E int FDECL(welded, (struct obj *));
|
E int FDECL(welded, (struct obj *));
|
||||||
E void FDECL(weldmsg, (struct obj *));
|
E void FDECL(weldmsg, (struct obj *));
|
||||||
|
|||||||
+1
-1
@@ -1734,7 +1734,7 @@ boolean acid_dmg;
|
|||||||
struct obj *otmph = some_armor(victim);
|
struct obj *otmph = some_armor(victim);
|
||||||
|
|
||||||
if (otmph && (otmph != uarmf)) {
|
if (otmph && (otmph != uarmf)) {
|
||||||
erode_obj(otmph, acid_dmg, FALSE);
|
(void) erode_obj(otmph, acid_dmg, FALSE, FALSE);
|
||||||
if (carried(otmph)) update_inventory();
|
if (carried(otmph)) update_inventory();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -891,7 +891,7 @@ mdamagem(magr, mdef, mattk)
|
|||||||
pline("It burns %s!", mon_nam(mdef));
|
pline("It burns %s!", mon_nam(mdef));
|
||||||
}
|
}
|
||||||
if (!rn2(30)) erode_armor(mdef, TRUE);
|
if (!rn2(30)) erode_armor(mdef, TRUE);
|
||||||
if (!rn2(6)) erode_obj(MON_WEP(mdef), TRUE, TRUE);
|
if (!rn2(6)) (void) erode_obj(MON_WEP(mdef), TRUE, TRUE, FALSE);
|
||||||
break;
|
break;
|
||||||
case AD_RUST:
|
case AD_RUST:
|
||||||
if (magr->mcan) break;
|
if (magr->mcan) break;
|
||||||
|
|||||||
+1
-1
@@ -2487,7 +2487,7 @@ register struct attack *mattk;
|
|||||||
}
|
}
|
||||||
} else tmp = 0;
|
} else tmp = 0;
|
||||||
if (!rn2(30)) erode_armor(mtmp, TRUE);
|
if (!rn2(30)) erode_armor(mtmp, TRUE);
|
||||||
if (!rn2(6)) erode_obj(MON_WEP(mtmp), TRUE, TRUE);
|
if (!rn2(6)) (void)erode_obj(MON_WEP(mtmp), TRUE, TRUE, FALSE);
|
||||||
goto assess_dmg;
|
goto assess_dmg;
|
||||||
case AD_STON: /* cockatrice */
|
case AD_STON: /* cockatrice */
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1888,6 +1888,11 @@ dodip()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (potion->otyp == POT_ACID) {
|
||||||
|
if (erode_obj(obj, TRUE, FALSE, TRUE))
|
||||||
|
goto poof;
|
||||||
|
}
|
||||||
|
|
||||||
if (potion->otyp == POT_OIL) {
|
if (potion->otyp == POT_OIL) {
|
||||||
boolean wisx = FALSE;
|
boolean wisx = FALSE;
|
||||||
if (potion->lamplit) { /* burning */
|
if (potion->lamplit) { /* burning */
|
||||||
|
|||||||
+5
-4
@@ -863,7 +863,8 @@ unsigned trflags;
|
|||||||
if (rust_dmg(uarms, "shield", 1, TRUE, &youmonst))
|
if (rust_dmg(uarms, "shield", 1, TRUE, &youmonst))
|
||||||
break;
|
break;
|
||||||
if (u.twoweap || (uwep && bimanual(uwep)))
|
if (u.twoweap || (uwep && bimanual(uwep)))
|
||||||
erode_obj(u.twoweap ? uswapwep : uwep, FALSE, TRUE);
|
(void) erode_obj(u.twoweap ? uswapwep : uwep,
|
||||||
|
FALSE, TRUE, FALSE);
|
||||||
glovecheck: (void) rust_dmg(uarmg, "gauntlets", 1, TRUE, &youmonst);
|
glovecheck: (void) rust_dmg(uarmg, "gauntlets", 1, TRUE, &youmonst);
|
||||||
/* Not "metal gauntlets" since it gets called
|
/* Not "metal gauntlets" since it gets called
|
||||||
* even if it's leather for the message
|
* even if it's leather for the message
|
||||||
@@ -872,7 +873,7 @@ glovecheck: (void) rust_dmg(uarmg, "gauntlets", 1, TRUE, &youmonst);
|
|||||||
case 2:
|
case 2:
|
||||||
pline("%s your right %s!", A_gush_of_water_hits,
|
pline("%s your right %s!", A_gush_of_water_hits,
|
||||||
body_part(ARM));
|
body_part(ARM));
|
||||||
erode_obj(uwep, FALSE, TRUE);
|
(void) erode_obj(uwep, FALSE, TRUE, FALSE);
|
||||||
goto glovecheck;
|
goto glovecheck;
|
||||||
default:
|
default:
|
||||||
pline("%s you!", A_gush_of_water_hits);
|
pline("%s you!", A_gush_of_water_hits);
|
||||||
@@ -1932,7 +1933,7 @@ register struct monst *mtmp;
|
|||||||
break;
|
break;
|
||||||
target = MON_WEP(mtmp);
|
target = MON_WEP(mtmp);
|
||||||
if (target && bimanual(target))
|
if (target && bimanual(target))
|
||||||
erode_obj(target, FALSE, TRUE);
|
(void) erode_obj(target, FALSE, TRUE, FALSE);
|
||||||
glovecheck: target = which_armor(mtmp, W_ARMG);
|
glovecheck: target = which_armor(mtmp, W_ARMG);
|
||||||
(void) rust_dmg(target, "gauntlets", 1, TRUE, mtmp);
|
(void) rust_dmg(target, "gauntlets", 1, TRUE, mtmp);
|
||||||
break;
|
break;
|
||||||
@@ -1940,7 +1941,7 @@ glovecheck: target = which_armor(mtmp, W_ARMG);
|
|||||||
if (in_sight)
|
if (in_sight)
|
||||||
pline("%s %s's right %s!", A_gush_of_water_hits,
|
pline("%s %s's right %s!", A_gush_of_water_hits,
|
||||||
mon_nam(mtmp), mbodypart(mtmp, ARM));
|
mon_nam(mtmp), mbodypart(mtmp, ARM));
|
||||||
erode_obj(MON_WEP(mtmp), FALSE, TRUE);
|
(void) erode_obj(MON_WEP(mtmp), FALSE, TRUE, FALSE);
|
||||||
goto glovecheck;
|
goto glovecheck;
|
||||||
default:
|
default:
|
||||||
if (in_sight)
|
if (in_sight)
|
||||||
|
|||||||
+3
-3
@@ -2417,17 +2417,17 @@ struct attack *mattk; /* null means we find one internally */
|
|||||||
|
|
||||||
case AD_ACID:
|
case AD_ACID:
|
||||||
if(!rn2(6)) {
|
if(!rn2(6)) {
|
||||||
erode_obj(obj, TRUE, FALSE);
|
(void) erode_obj(obj, TRUE, FALSE, FALSE);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case AD_RUST:
|
case AD_RUST:
|
||||||
if(!mon->mcan) {
|
if(!mon->mcan) {
|
||||||
erode_obj(obj, FALSE, FALSE);
|
(void) erode_obj(obj, FALSE, FALSE, FALSE);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case AD_CORR:
|
case AD_CORR:
|
||||||
if(!mon->mcan) {
|
if(!mon->mcan) {
|
||||||
erode_obj(obj, TRUE, FALSE);
|
(void) erode_obj(obj, TRUE, FALSE, FALSE);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case AD_ENCH:
|
case AD_ENCH:
|
||||||
|
|||||||
+16
-8
@@ -597,20 +597,23 @@ untwoweapon()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Maybe rust object, or corrode it if acid damage is called for */
|
/* Maybe rust object, or corrode it if acid damage is called for.
|
||||||
void
|
* Returns TRUE if something happened. */
|
||||||
erode_obj(target, acid_dmg, fade_scrolls)
|
boolean
|
||||||
|
erode_obj(target, acid_dmg, fade_scrolls, for_dip)
|
||||||
struct obj *target; /* object (e.g. weapon or armor) to erode */
|
struct obj *target; /* object (e.g. weapon or armor) to erode */
|
||||||
boolean acid_dmg;
|
boolean acid_dmg;
|
||||||
boolean fade_scrolls;
|
boolean fade_scrolls;
|
||||||
|
boolean for_dip;
|
||||||
{
|
{
|
||||||
int erosion;
|
int erosion;
|
||||||
struct monst *victim;
|
struct monst *victim;
|
||||||
boolean vismon;
|
boolean vismon;
|
||||||
boolean visobj;
|
boolean visobj;
|
||||||
|
boolean ret = FALSE;
|
||||||
|
|
||||||
if (!target)
|
if (!target)
|
||||||
return;
|
return FALSE;
|
||||||
victim = carried(target) ? &youmonst :
|
victim = carried(target) ? &youmonst :
|
||||||
mcarried(target) ? target->ocarry : (struct monst *)0;
|
mcarried(target) ? target->ocarry : (struct monst *)0;
|
||||||
vismon = victim && (victim != &youmonst) && canseemon(victim);
|
vismon = victim && (victim != &youmonst) && canseemon(victim);
|
||||||
@@ -620,6 +623,7 @@ boolean fade_scrolls;
|
|||||||
|
|
||||||
if (target->greased) {
|
if (target->greased) {
|
||||||
grease_protect(target,(char *)0,victim);
|
grease_protect(target,(char *)0,victim);
|
||||||
|
ret = TRUE;
|
||||||
} else if (target->oclass == SCROLL_CLASS) {
|
} else if (target->oclass == SCROLL_CLASS) {
|
||||||
if(fade_scrolls && target->otyp != SCR_BLANK_PAPER
|
if(fade_scrolls && target->otyp != SCR_BLANK_PAPER
|
||||||
#ifdef MAIL
|
#ifdef MAIL
|
||||||
@@ -633,15 +637,16 @@ boolean fade_scrolls;
|
|||||||
}
|
}
|
||||||
target->otyp = SCR_BLANK_PAPER;
|
target->otyp = SCR_BLANK_PAPER;
|
||||||
target->spe = 0;
|
target->spe = 0;
|
||||||
|
ret = TRUE;
|
||||||
}
|
}
|
||||||
} else if (target->oerodeproof ||
|
} else if (target->oerodeproof ||
|
||||||
(acid_dmg ? !is_corrodeable(target) : !is_rustprone(target))) {
|
(acid_dmg ? !is_corrodeable(target) : !is_rustprone(target))) {
|
||||||
if (flags.verbose || !(target->oerodeproof && target->rknown)) {
|
if (flags.verbose || !(target->oerodeproof && target->rknown)) {
|
||||||
if ((victim == &youmonst) || vismon)
|
if (((victim == &youmonst) || vismon) && !for_dip)
|
||||||
pline("%s not affected.", Yobjnam2(target, "are"));
|
pline("%s not affected.", Yobjnam2(target, "are"));
|
||||||
/* no message if not carried */
|
/* no message if not carried or dipping */
|
||||||
}
|
}
|
||||||
if (target->oerodeproof) target->rknown = TRUE;
|
if (target->oerodeproof) target->rknown = !for_dip;
|
||||||
} else if (erosion < MAX_ERODE) {
|
} else if (erosion < MAX_ERODE) {
|
||||||
if ((victim == &youmonst) || vismon || visobj)
|
if ((victim == &youmonst) || vismon || visobj)
|
||||||
pline("%s%s!", Yobjnam2(target, acid_dmg ? "corrode" : "rust"),
|
pline("%s%s!", Yobjnam2(target, acid_dmg ? "corrode" : "rust"),
|
||||||
@@ -651,8 +656,9 @@ boolean fade_scrolls;
|
|||||||
target->oeroded2++;
|
target->oeroded2++;
|
||||||
else
|
else
|
||||||
target->oeroded++;
|
target->oeroded++;
|
||||||
|
ret = TRUE;
|
||||||
} else {
|
} else {
|
||||||
if (flags.verbose) {
|
if (flags.verbose && !for_dip) {
|
||||||
if (victim == &youmonst)
|
if (victim == &youmonst)
|
||||||
pline("%s completely %s.",
|
pline("%s completely %s.",
|
||||||
Yobjnam2(target, Blind ? "feel" : "look"),
|
Yobjnam2(target, Blind ? "feel" : "look"),
|
||||||
@@ -663,6 +669,8 @@ boolean fade_scrolls;
|
|||||||
acid_dmg ? "corroded" : "rusty");
|
acid_dmg ? "corroded" : "rusty");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|||||||
@@ -3136,7 +3136,7 @@ struct obj **ootmp; /* to return worn armor for caller to disintegrate */
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
tmp = d(nd,6);
|
tmp = d(nd,6);
|
||||||
if (!rn2(6)) erode_obj(MON_WEP(mon), TRUE, TRUE);
|
if (!rn2(6)) (void) erode_obj(MON_WEP(mon), TRUE, TRUE, FALSE);
|
||||||
if (!rn2(6)) erode_armor(mon, TRUE);
|
if (!rn2(6)) erode_armor(mon, TRUE);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -3265,8 +3265,10 @@ xchar sx, sy;
|
|||||||
exercise(A_STR, FALSE);
|
exercise(A_STR, FALSE);
|
||||||
}
|
}
|
||||||
/* using two weapons at once makes both of them more vulnerable */
|
/* using two weapons at once makes both of them more vulnerable */
|
||||||
if (!rn2(u.twoweap ? 3 : 6)) erode_obj(uwep, TRUE, TRUE);
|
if (!rn2(u.twoweap ? 3 : 6))
|
||||||
if (u.twoweap && !rn2(3)) erode_obj(uswapwep, TRUE, TRUE);
|
(void) erode_obj(uwep, TRUE, TRUE, FALSE);
|
||||||
|
if (u.twoweap && !rn2(3))
|
||||||
|
(void) erode_obj(uswapwep, TRUE, TRUE, FALSE);
|
||||||
if (!rn2(6)) erode_armor(&youmonst, TRUE);
|
if (!rn2(6)) erode_armor(&youmonst, TRUE);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user