Fold get_wet() into water_damage().

This now ensures that dipping into water works like other sources of
water damage. There is a potentially significant gameplay change here:
dipping a container into uncursed water will wet all its contents. If
this is a problem, then we should add another parameter to water_damage
which will suppress this behaviour for dipping.
This commit is contained in:
Sean Hunt
2015-03-17 18:47:08 +02:00
committed by Pasi Kallinen
parent cd83f7e802
commit d58a9bb56e
5 changed files with 6 additions and 98 deletions
+1 -1
View File
@@ -864,7 +864,7 @@ grease protects from all types of erosion
all sources of erosion now affect objects the same way all sources of erosion now affect objects the same way
passive attacks no longer erode armor covered by other armor passive attacks no longer erode armor covered by other armor
dipping a fooproof item into acid no longer forgets that it's fooproof dipping a fooproof item into acid no longer forgets that it's fooproof
dipping a container into uncursed water now gets its contents wet
Platform- and/or Interface-Specific Fixes Platform- and/or Interface-Specific Fixes
----------------------------------------- -----------------------------------------
-1
View File
@@ -1726,7 +1726,6 @@ E void FDECL(healup, (int,int,BOOLEAN_P,BOOLEAN_P));
E void FDECL(strange_feeling, (struct obj *,const char *)); E void FDECL(strange_feeling, (struct obj *,const char *));
E void FDECL(potionhit, (struct monst *,struct obj *,BOOLEAN_P)); E void FDECL(potionhit, (struct monst *,struct obj *,BOOLEAN_P));
E void FDECL(potionbreathe, (struct obj *)); E void FDECL(potionbreathe, (struct obj *));
E boolean FDECL(get_wet, (struct obj *));
E int NDECL(dodip); E int NDECL(dodip);
E void FDECL(mongrantswish, (struct monst **)); E void FDECL(mongrantswish, (struct monst **));
E void FDECL(djinni_from_bottle, (struct obj *)); E void FDECL(djinni_from_bottle, (struct obj *));
+1 -1
View File
@@ -402,7 +402,7 @@ register struct obj *obj;
if(in_town(u.ux, u.uy)) if(in_town(u.ux, u.uy))
(void) angry_guards(FALSE); (void) angry_guards(FALSE);
return; return;
} else if (get_wet(obj)) { } else if (water_damage(obj, NULL, TRUE)) {
if (obj->otyp == POT_ACID) { /* Acid and water don't mix */ if (obj->otyp == POT_ACID) { /* Acid and water don't mix */
useup(obj); useup(obj);
return; return;
+2 -94
View File
@@ -1088,7 +1088,7 @@ const char *objphrase; /* "Your widget glows" or "Steed's saddle glows" */
} else { } else {
/* dipping into uncursed water; carried() check skips steed saddle */ /* dipping into uncursed water; carried() check skips steed saddle */
if (carried(targobj)) { if (carried(targobj)) {
if (get_wet(targobj)) if (water_damage(targobj, 0, TRUE))
res = TRUE; res = TRUE;
} }
} }
@@ -1626,98 +1626,6 @@ register struct obj *o1, *o2;
return 0; return 0;
} }
boolean
get_wet(obj)
register struct obj *obj;
/* returns TRUE if something happened (potion should be used up) */
{
if (snuff_lit(obj)) return(TRUE);
if (obj->greased) {
grease_protect(obj,(char *)0,&youmonst);
return(FALSE);
}
/* (Rusting shop goods ought to be charged for.) */
switch (obj->oclass) {
case POTION_CLASS:
if (obj->otyp == POT_WATER) return FALSE;
/* KMH -- Water into acid causes an explosion */
if (obj->otyp == POT_ACID) {
pline("It boils vigorously!");
You("are caught in the explosion!");
losehp(Maybe_Half_Phys(rnd(10)), "elementary chemistry",
KILLED_BY);
makeknown(obj->otyp);
update_inventory();
return (TRUE);
}
pline("%s%s.", Yobjnam2(obj,"dilute"),
obj->odiluted ? " further" : "");
costly_alteration(obj, COST_DILUTE);
if (obj->odiluted) {
obj->odiluted = 0;
obj->blessed = FALSE;
obj->cursed = FALSE;
obj->otyp = POT_WATER;
} else
obj->odiluted++;
update_inventory();
return TRUE;
case SCROLL_CLASS:
if (obj->otyp != SCR_BLANK_PAPER
#ifdef MAIL
&& obj->otyp != SCR_MAIL
#endif
) {
if (!Blind)
pline_The("scroll%s %s.",
plur(obj->quan), otense(obj, "fade"));
costly_alteration(obj, COST_ERASE);
obj->otyp = SCR_BLANK_PAPER;
obj->spe = 0;
update_inventory();
return TRUE;
} else break;
case SPBOOK_CLASS:
if (obj->otyp != SPE_BLANK_PAPER) {
if (obj->otyp == SPE_BOOK_OF_THE_DEAD) {
pline(
"%s suddenly heats up; steam rises and it remains dry.",
The(xname(obj)));
} else {
if (!Blind)
pline_The("spellbook%s %s.",
plur(obj->quan),
otense(obj, "fade"));
costly_alteration(obj, COST_ERASE);
obj->otyp = SPE_BLANK_PAPER;
update_inventory();
}
return TRUE;
}
break;
case WEAPON_CLASS:
/* Just "fall through" to generic rustprone check for now. */
/* fall through */
default:
if (!obj->oerodeproof && is_rustprone(obj) &&
(obj->oeroded < MAX_ERODE) && !rn2(2)) {
pline("%s some%s.",
Yobjnam2(obj, "rust"),
obj->oeroded ? " more" : "what");
obj->oeroded++;
update_inventory();
return TRUE;
}
break;
}
pline("%s wet.", Yobjnam2(obj, "get"));
return FALSE;
}
int int
dodip() dodip()
{ {
@@ -1756,7 +1664,7 @@ dodip()
rider_cant_reach(); /* not skilled enough to reach */ rider_cant_reach(); /* not skilled enough to reach */
} else { } else {
if (obj->otyp == POT_ACID) obj->in_use = 1; if (obj->otyp == POT_ACID) obj->in_use = 1;
(void) get_wet(obj); (void) water_damage(obj, 0, TRUE);
if (obj->in_use) useup(obj); if (obj->in_use) useup(obj);
} }
return 1; return 1;
+2 -1
View File
@@ -3118,7 +3118,8 @@ boolean force;
{ {
boolean loose_obj = (obj && obj->where == OBJ_FREE), exploded = FALSE; boolean loose_obj = (obj && obj->where == OBJ_FREE), exploded = FALSE;
(void) snuff_lit(obj); if (snuff_lit(obj))
return 2;
if(obj->otyp == CAN_OF_GREASE && obj->spe > 0) { if(obj->otyp == CAN_OF_GREASE && obj->spe > 0) {
return 0; return 0;