Skip to content

Commit

Permalink
Greased weapons won't usually stick to adherers. Cleaned up some mess…
Browse files Browse the repository at this point in the history
…ages in the adherer interactions.
  • Loading branch information
elunna committed Oct 2, 2023
1 parent 7f10582 commit 2611cb8
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
9 changes: 8 additions & 1 deletion src/mhitu.c
Original file line number Diff line number Diff line change
Expand Up @@ -5523,7 +5523,14 @@ struct attack *mattk;
break;
case AD_DSRM: /* adherer */
otmp = MON_WEP(mtmp);
if (otmp) {
if (otmp && otmp->greased && (!otmp->cursed || rn2(4))) {
pline("%s %s off of your %s!", s_suffix(Monnam(mtmp)),
aobjnam(otmp, "slip"), body_part(SKIN));
if (otmp->greased && !rn2(2)) {
pline_The("grease wears off.");
otmp->greased = 0;
}
} else if (otmp) {
pline("%s's %s sticks to you!", Monnam(mtmp), xname(otmp));
obj_extract_self(otmp);
possibly_unwield(mtmp, FALSE);
Expand Down
18 changes: 14 additions & 4 deletions src/uhitm.c
Original file line number Diff line number Diff line change
Expand Up @@ -5025,10 +5025,20 @@ boolean wep_was_destroyed;
if (malive && !mon->mcan && rn2(3)) {
switch (mattk[i].adtyp) {
case AD_DSRM: /* adherer */
if (uwep && uwep != uball) {
otmp = uwep;
Your("weapon sticks to %s!", mon_nam(mon));
dropx(uwep);
otmp = uwep;
if (otmp && otmp->greased && (!otmp->cursed || rn2(4))) {
pline("%s off of %s %s!", Yobjnam2(otmp, "slip"),
s_suffix(mon_nam(mon)),
mbodypart(mon, SKIN));
if (otmp->greased && !rn2(2)) {
pline_The("grease wears off.");
otmp->greased = 0;
update_inventory();
}
} else if (otmp && otmp != uball) {
/* Just the main weapon */
pline("%s to %s!", Yobjnam2(otmp, "stick"), mon_nam(mon));
dropx(otmp);
obj_extract_self(otmp);
add_to_minv(mon, otmp);
} else {
Expand Down

0 comments on commit 2611cb8

Please sign in to comment.