From e9ee20bc18e13f302553e546b987717f2bea612e Mon Sep 17 00:00:00 2001 From: PatR Date: Tue, 10 Jul 2018 16:35:50 -0700 Subject: [PATCH 1/2] fix github issue #116 - farlook at corpse Fixes #116 Farlook in 3.4.3 used xname() and just described any corpse as "corpse" whether you knew the monster type or not. 3.6.x switched to doname() and describes it as " corpse", but if it isn't there anymore, the fake object contructed for it would have a random corpse type. For corpses and statues, the map glyph provides enough information to give the fake object the same type as the original. For other items that have a monster component (figurines, tins, eggs) it does not, nor for other doname attributes of objects in general (which might be picked up by monsters rather than rot away). So this fixes the rotted-away-corpse-seems-to- become-random-corpse issue but not the general case of the details for a remembered item which isn't there anymore. --- doc/fixes36.2 | 2 ++ src/pager.c | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/doc/fixes36.2 b/doc/fixes36.2 index 5e1d1ad9d..f8af944e2 100644 --- a/doc/fixes36.2 +++ b/doc/fixes36.2 @@ -68,6 +68,8 @@ shopkeeper's position in front of shop door didn't correctly handle bottom attempting to update permanent inventory window during restore had problems with unpaid items (needed shop bill before shop and its shopkeeper were restored) and named fruit +remembered corpse which isn't there anymore would be described by farlook as + the corpse of a random monster type Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository diff --git a/src/pager.c b/src/pager.c index 308c84279..d44efb795 100644 --- a/src/pager.c +++ b/src/pager.c @@ -187,6 +187,10 @@ struct obj **obj_p; otmp->spe = context.current_fruit; /* give it a type */ if (mtmp && has_mcorpsenm(mtmp)) /* mimic as corpse/statue */ otmp->corpsenm = MCORPSENM(mtmp); + else if (otmp->otyp == CORPSE && glyph_is_body(glyph)) + otmp->corpsenm = glyph - GLYPH_BODY_OFF; + else if (otmp->otyp == STATUE && glyph_is_statue(glyph)) + otmp->corpsenm = glyph - GLYPH_STATUE_OFF; } /* if located at adjacent spot, mark it as having been seen up close (corpse type will be known even if dknown is 0, so we don't need a From 6d3760b923282c5e02c73a74aa2d45f8d7b1a952 Mon Sep 17 00:00:00 2001 From: PatR Date: Tue, 10 Jul 2018 17:14:36 -0700 Subject: [PATCH 2/2] github pull request #102 - Popeye vs Fixed_abil Fixes #102 This is a simplified version of the code in pull request #102, which replaces "You feel like Popeye!" with "You feel like {Olive Oyl or Bluto}!" if eating spinach fails to provide a strength gain. I think you should still feel like Popeye if the lack of gain is due to already being at maximum, so I left out the change to make gainstr() return a value which indicates whether a change took place. Unfortunately, if you're both already at maximum and have attribute changes suppressed by Fixed_abil, the latter overrides and you'll feel like Olive Oyl or Bluto. I think that situation is too obscure to bother with the complexity of figuring out if you're at maximum for the purpose of a silly message. --- doc/fixes36.2 | 2 ++ src/eat.c | 11 ++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/doc/fixes36.2 b/doc/fixes36.2 index f8af944e2..134788868 100644 --- a/doc/fixes36.2 +++ b/doc/fixes36.2 @@ -70,6 +70,8 @@ attempting to update permanent inventory window during restore had problems were restored) and named fruit remembered corpse which isn't there anymore would be described by farlook as the corpse of a random monster type +when eating a tin of spinach, don't "feel like Popeye" is sustain-abilities + prevents any strength gain Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository diff --git a/src/eat.c b/src/eat.c index 1c055abbc..f398c8cc5 100644 --- a/src/eat.c +++ b/src/eat.c @@ -1395,7 +1395,16 @@ const char *mesg; u.uconduct.food++; /* don't need vegetarian checks for spinach */ if (!tin->cursed) pline("This makes you feel like %s!", - Hallucination ? "Swee'pea" : "Popeye"); + /* "Swee'pea" is a character from the Popeye cartoons */ + Hallucination ? "Swee'pea" + /* "feel like Popeye" unless sustain ability suppresses + any attribute change; this slightly oversimplifies + things: we want "Popeye" if no strength increase + occurs due to already being at maximum, but we won't + get it if at-maximum and fixed-abil both apply */ + : !Fixed_abil ? "Popeye" + /* no gain, feel like another character from Popeye */ + : (flags.female ? "Olive Oyl" : "Bluto")); gainstr(tin, 0, FALSE); tin = costly_tin(COST_OPEN);