Sell me a new brain

The “say” command didn’t execute when I sold the trophy to the pawnbroker, Harley.

Check selling something to Harley: if noun is guitar: say "[']Got pleny o['] guitars already,['] Harley says.[line break] Harley still eyes you expectantly."; stop the action; otherwise: if noun is leather case: say "[']Got plenty o' guitar cases,['] Harley says.."; stop the action; otherwise: if noun is pick guard: if player carries pick guard: say "Harley smiles at you broadly. [']Give ya fifty bucks,' he says."; increase the dollars of the wallet by 50; continue the action; otherwise: say "You're not holding the pick guard."; stop the action; if the noun is trophy: say "[']I[']ll give you three bucks for that,['] Harley says."; increase the dollars of the wallet by 3; now trophy is off-stage; continue the action.

Also, the trophy didn’t go off-stage, as I expected it to.

“if noun is trophy” is indented under “if noun is pick guard,” so that whole block of code isn’t running. Move that block one tab to the left and I think it’ll work.

By the way this kind of code would be much easier to write and maintain if you broke it up into a lot of different rules for each noun:

Check selling the guitar to Harley: ... Check selling the pick guard to Harley: ... Check selling the trophy to Harley: ...

With a general case for something else:

Check selling something to Harley: say "Harley says 'Don't need that.'" instead.

(Though you’d have to make sure that that rule didn’t run after the more specific check rules.) And sometimes it’ll be better to break things up into check, carry out, and report rules, rather than having everything happen in the check rule–that might let you write a check rule that stops the action whenever the player doesn’t hold the noun, for instance.

That worked. Thanks, matt-w.