Constant Story "Peanuts"; Constant Headline "^A small exercise to see how attributes^ and properties can be implemented.^^"; Release 1; Serial "000001"; CONSTANT DEBUG; CONSTANT MANUAL_PRONOUNS; Include "Parser"; Include "VerbLib"; Include "replay"; attribute salted; [Initialise; location = PlainRoom; "You are in a plain non-descript room wth a table, a jar of unsalted^ peanuts, a pitcher of water, and a salt shaker with an infinite supply of salt.^";]; Object PlainRoom "Plain Room" with description "You are in a plain non descript room.^ All that is in here is a table, a pitcher of water, a jar of peanuts^ and a salt shaker.", cant_go "You are stuck here till you quit the game.", has light ; Object DiningTable "Dining Table" PlainRoom with name 'dining' 'table' 'diningtable', description "This is a table upon which you can perform actions with the peanuts. ", has static supporter ; Object PeaJar "Peanut Jar" DiningTable with name 'jar', description "Just a plain old jar of peanuts.", has container openable ; Object Peanut "Plain Peanuts" PeaJar with name 'unsalted' 'peanuts' 'plain' 'nuts', description " There are a bunch of plain unsalted peanuts here.", after [; eat: if (self hasnt salted) {move peanut to PeaJar; "You pop a few of the peanuts into your mouth. UGH!!^ You spit them out. Way way too plain for your delicate palate.";} else if (self has salted) {move peanut to Peajar; "You pop a few of the peanuts into your mouth.^ MMM velly velly tasteee.";}], before [; salt: if (noun has salted) "You've already over-salted the damn things as it is!"; if (noun hasnt salted) {give noun salted; "You pour salt over the peanuts they have now become salted.";} pour: if (self in DiningTable) {move peanut to peajar; "Your re-pour the peanuts back into the jar;";} if (noun==TableSalt && second == self && self hasnt salted) {give Peanut salted; "You salt the peanuts";} if (PeaJar hasnt open) "The jar ain't open!"; if (self in PeaJar) {move Peanut to DiningTable; "You pour the plain peanuts on the table.";} wash: if (self hasnt salted) "They've already been washed & made plain again."; else {give self ~salted; "You wash the salt off the peanuts they become plain once again.";};], has edible pluralname ; Object Shaker "Salt Shaker" DiningTable with name 'shaker', description "Just your everyday Magical Plotzkin Salt Shaker^ which contains an infinite amount of salt.", has container open ; Object TableSalt "Table Salt" Shaker with name 'salt' 'seasoning' 'condiment', description "a bunch of table salt.", before [; pour: if (second ~=Peanut) "You can't salt that!"; if (Peanut has salted) "You've already over-salted the damn things as it is!"; else if (peanut hasnt salted) {give peanut salted; "You pour salt over the peanuts they have now become salted.";}], has pluralname concealed ; Object WaterPitch "Pitcher" DiningTable with name 'pitcher', description "This is your handy-dandy pitcher of water.", before [; receive: "Nothing goes in the pitcher except water.";] has container open ; Object Water "Water" WaterPitch with name 'water', description "Water for washing the peanuts", before [; pour: if (second ~=peanut) "What? and waste some good washing water on that?"; if (Peanut hasnt salted) "The nuts are already unsalted so you don't have to do that!"; else {give peanut ~salted; "You pour water over the peanuts they have now become plain again.";};], has pluralname concealed ; Include "Grammar"; [WashSub; "You can't wash that!";]; [PourSub; "You can't pour that.";]; [SaltSub; "You can't salt that.";]; verb "salt" * noun -> Salt; verb "pour" * noun -> Pour * noun 'on' noun -> Pour; verb "wash" * noun -> Wash * noun 'with' noun -> Wash;