comparison arogue5/trader.c @ 315:ad2570b5b21f

Advanced Rogue 5, 7: fix some trading post messages. When attempting to buy an unaffordable object, messages were often of the form "You can't afford that a scroll of hold monster !", because the object description (stored in curpurch) was the same text used in inventory displays. This has been worked around by inspecting the contents of curpurch and using different message templates.
author John "Elwin" Edwards
date Sun, 24 Oct 2021 20:26:21 -0400
parents 56e748983fa8
children
comparison
equal deleted inserted replaced
314:2f0eb38da609 315:ad2570b5b21f
49 } 49 }
50 } until(wh == 'y'); 50 } until(wh == 'y');
51 } 51 }
52 mpos = 0; 52 mpos = 0;
53 if (curprice > purse) { 53 if (curprice > purse) {
54 msg("You can't afford to buy that %s !",curpurch); 54 if (!strncmp(curpurch, "a ", 2))
55 msg("You can't afford to buy that %s!", curpurch + 2);
56 else if (!strncmp(curpurch, "an ", 3))
57 msg("You can't afford to buy that %s!", curpurch + 3);
58 else if (!strncmp(curpurch, "some ", 5))
59 msg("You can't afford to buy that %s!", curpurch + 5);
60 else if (isdigit(curpurch[0]))
61 msg("You can't afford to buy those %s!", curpurch);
62 else
63 msg("You can't afford to buy that %s!", curpurch);
55 return; 64 return;
56 } 65 }
57 /* 66 /*
58 * See if the hero has done all his transacting 67 * See if the hero has done all his transacting
59 */ 68 */