Merge branch 'early_return' of https://github.com/argrath/NetHack into NetHack-3.7

This commit is contained in:
nhmall
2024-11-13 14:54:34 -05:00

View File

@@ -1914,7 +1914,8 @@ offer_corpse(struct obj *otmp, boolean highaltar, aligntyp altaralign)
if (your_race(ptr)) {
sacrifice_your_race(otmp, highaltar, altaralign);
return;
} else if (has_omonst(otmp)
}
if (has_omonst(otmp)
&& (mtmp = get_mtraits(otmp, FALSE)) != 0
&& mtmp->mtame) {
/* mtmp is a temporary pointer to a tame monster's attributes,
@@ -1924,11 +1925,13 @@ offer_corpse(struct obj *otmp, boolean highaltar, aligntyp altaralign)
HAggravate_monster |= FROMOUTSIDE;
offer_negative_valued(highaltar, altaralign);
return;
} else if (!value) {
}
if (!value) {
/* too old; don't give undead or unicorn bonus or penalty */
pline1(nothing_happens);
return;
} else if (is_undead(ptr)) { /* Not demons--no demon corpses */
}
if (is_undead(ptr)) { /* Not demons--no demon corpses */
/* most undead that leave a corpse yield 'human' (or other race)
corpse so won't get here; the exception is wraith; give the
bonus for wraith to chaotics too because they are sacrificing
@@ -1976,88 +1979,89 @@ offer_corpse(struct obj *otmp, boolean highaltar, aligntyp altaralign)
if (altaralign != u.ualign.type && highaltar) {
desecrate_altar(highaltar, altaralign);
} else if (u.ualign.type != altaralign) {
return;
}
if (u.ualign.type != altaralign) {
/* Sacrificing at an altar of a different alignment */
offer_different_alignment_altar(otmp, altaralign);
return;
} else {
consume_offering(otmp);
/* OK, you get brownie points. */
if (u.ugangr) {
int saved_anger = u.ugangr;
u.ugangr -= ((value * (u.ualign.type == A_CHAOTIC ? 2 : 3))
/ MAXVALUE);
if (u.ugangr < 0)
u.ugangr = 0;
if (u.ugangr != saved_anger) {
if (u.ugangr) {
pline("%s seems %s.", u_gname(),
Hallucination ? "groovy" : "slightly mollified");
}
consume_offering(otmp);
/* OK, you get brownie points. */
if (u.ugangr) {
int saved_anger = u.ugangr;
u.ugangr -= ((value * (u.ualign.type == A_CHAOTIC ? 2 : 3))
/ MAXVALUE);
if (u.ugangr < 0)
u.ugangr = 0;
if (u.ugangr != saved_anger) {
if (u.ugangr) {
pline("%s seems %s.", u_gname(),
Hallucination ? "groovy" : "slightly mollified");
if ((int) u.uluck < 0)
change_luck(1);
} else {
pline("%s seems %s.", u_gname(),
Hallucination ? "cosmic (not a new fact)"
: "mollified");
if ((int) u.uluck < 0)
change_luck(1);
} else {
pline("%s seems %s.", u_gname(),
Hallucination ? "cosmic (not a new fact)"
: "mollified");
if ((int) u.uluck < 0)
u.uluck = 0;
}
} else { /* not satisfied yet */
if ((int) u.uluck < 0)
u.uluck = 0;
}
} else { /* not satisfied yet */
if (Hallucination)
pline_The("gods seem tall.");
else
You("have a feeling of inadequacy.");
}
} else if (ugod_is_angry()) {
if (value > MAXVALUE)
value = MAXVALUE;
if (value > -u.ualign.record)
value = -u.ualign.record;
adjalign(value);
You_feel("partially absolved.");
} else if (u.ublesscnt > 0) {
int saved_cnt = u.ublesscnt;
u.ublesscnt -= ((value * (u.ualign.type == A_CHAOTIC ? 500 : 300))
/ MAXVALUE);
if (u.ublesscnt < 0)
u.ublesscnt = 0;
if (u.ublesscnt != saved_cnt) {
if (u.ublesscnt) {
if (Hallucination)
pline_The("gods seem tall.");
You("realize that the gods are not like you and I.");
else
You("have a feeling of inadequacy.");
}
} else if (ugod_is_angry()) {
if (value > MAXVALUE)
value = MAXVALUE;
if (value > -u.ualign.record)
value = -u.ualign.record;
adjalign(value);
You_feel("partially absolved.");
} else if (u.ublesscnt > 0) {
int saved_cnt = u.ublesscnt;
u.ublesscnt -= ((value * (u.ualign.type == A_CHAOTIC ? 500 : 300))
/ MAXVALUE);
if (u.ublesscnt < 0)
u.ublesscnt = 0;
if (u.ublesscnt != saved_cnt) {
if (u.ublesscnt) {
if (Hallucination)
You("realize that the gods are not like you and I.");
else
You("have a hopeful feeling.");
if ((int) u.uluck < 0)
change_luck(1);
} else {
if (Hallucination)
pline("Overall, there is a smell of fried onions.");
else
You("have a feeling of reconciliation.");
if ((int) u.uluck < 0)
u.uluck = 0;
}
}
} else {
int saved_luck = u.uluck;
if (bestow_artifact())
return;
change_luck((value * LUCKMAX) / (MAXVALUE * 2));
if ((int) u.uluck < 0)
u.uluck = 0;
if (u.uluck != saved_luck) {
if (Blind)
You("think %s brushed your %s.", something,
body_part(FOOT));
You("have a hopeful feeling.");
if ((int) u.uluck < 0)
change_luck(1);
} else {
if (Hallucination)
pline("Overall, there is a smell of fried onions.");
else
You(Hallucination
? "see crabgrass at your %s. A funny thing in a dungeon."
: "glimpse a four-leaf clover at your %s.",
makeplural(body_part(FOOT)));
You("have a feeling of reconciliation.");
if ((int) u.uluck < 0)
u.uluck = 0;
}
}
} else {
int saved_luck = u.uluck;
if (bestow_artifact())
return;
change_luck((value * LUCKMAX) / (MAXVALUE * 2));
if ((int) u.uluck < 0)
u.uluck = 0;
if (u.uluck != saved_luck) {
if (Blind)
You("think %s brushed your %s.", something,
body_part(FOOT));
else
You(Hallucination
? "see crabgrass at your %s. A funny thing in a dungeon."
: "glimpse a four-leaf clover at your %s.",
makeplural(body_part(FOOT)));
}
}
}