comparison arogue7/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 f9ef86cf22b2
children
comparison
equal deleted inserted replaced
314:2f0eb38da609 315:ad2570b5b21f
53 } 53 }
54 } until(wh == 'y'); 54 } until(wh == 'y');
55 } 55 }
56 mpos = 0; 56 mpos = 0;
57 if (curprice > purse) { 57 if (curprice > purse) {
58 msg("You can't afford to buy that %s !",curpurch); 58 if (!strncmp(curpurch, "a ", 2))
59 msg("You can't afford to buy that %s!", curpurch + 2);
60 else if (!strncmp(curpurch, "an ", 3))
61 msg("You can't afford to buy that %s!", curpurch + 3);
62 else if (isdigit(curpurch[0]))
63 msg("You can't afford to buy those %s!", curpurch);
64 else
65 msg("You can't afford to buy that %s!", curpurch);
59 return; 66 return;
60 } 67 }
61 /* 68 /*
62 * See if the hero has done all his transacting 69 * See if the hero has done all his transacting
63 */ 70 */