!\--------------------------------------------------------------------------- SPURDEF.HUG by Kent Tessman (c) 1995-1997 New classes and definitions for Spur ---------------------------------------------------------------------------\! synonym "mine" for "my" attribute shot attribute dead alias shot attribute scored attribute shootable ! not everything is attribute outside property corpse ! for characters property body_of ! and their corpses property ammo ! for guns only property max_ammo ! property ammo_type ! property just_clicked ! property gunshot_reaction ! for characters property price ! for General Store items character spur_character "spur_character_class" { after { object DoShoot { "You pull the trigger and shoot "; print The(object); ". "; capital object.pronoun; " falls to the ground, twitches a couple of times, then lies there, getting cold." Activate(murderer_fuse, 5) if object = obstacle: obstacle = 0 local i for i in location { if i is living and i ~= player { print "" CThe(i) " looks at you like you're crazy. \ Which you probably are. Then "; print i.pronoun #1; " runs like hell out of there." remove i CancelScript(i) if i is obstacle: obstacle = 0 break } } } } parse_rank 1 ! preference over like-named corpses is shootable } spur_character spur_female_character "spur_female_character_class" { type female_character pronouns "she", "her", "her", "herself" is female } ! Note for corpse objects: best not to use the proper name of the living ! character as a noun for the corpse, to avoid confusing the parser in ! "ask about " player commands class corpse_object "corpse_object_class" { short_desc {CArt(self.body_of) " is lying dead on the ground here."} long_desc {print capital (self.body_of).pronoun; "'s dead. Shouldn't be any big surprise to you, though, seeing as you shot "; print capital (self.body_of).pronoun #2; "."} before { object DoGet {"Only if you want to be spotted carting a dead body around town. Not recommended."} } is shootable } class gun "gun_class" { type gun size 10 ammo 6 max_ammo 6 just_clicked 0 before { object DoGet { if self in holster Perform(&DoDraw, self) else: return false } object DoLookIn, DoOpen { "You crack it open. "; if self.ammo = 0 "It's empty." else { "There"; if self.ammo = 1: "'s only"; else: " are"; print " "; NumberWord(self.ammo); " "; if self.ammo > 1 print (self.ammo_type).name; else print (self.ammo_type).name #2; " left." } } object DoEmpty { if self.ammo = 0 "It's already empty." else {"There's no point in doing that--you might need the "; print (object.ammo_type).name; "."} } } plural_is pistols is container, openable } plural_class pistols "pistols" { article "a couple of" noun "pistols", "guns", "handguns", "weapons" single_noun "pistol" plural_of yourgun, roysgun } class ammo_obj "ammo_obj_class" { before { object DoGet { local i, n, pobj for i in player { if i.type = gun and i.ammo_type = self { pobj = i if pobj.ammo < pobj.max_ammo break } } if not pobj {"Except that you're not holding any gun that "; print The(self); " fit in."} else Perform(&DoLoad, pobj) } } is plural } class storeitem "storeitem_class" { type storeitem before { object DoGet, DoOpen { if self is not moved and lucille is not shot { if word[1] = "steal" {"And I suppose your plan includes that Lucille won't shoot you dead if you try to swipe "; print The(self); "? Not likely." return true} "You'll have to buy "; print The(self); " first." } else: return false } } } vehicle horse "horse_class" { prep "on", "off" list_contents 1 ! don't list contents before { object DoMoveinVehicle { if player not in self Perform(&DoEnter, self) else: return false } parent(player) DoGo { if (word[1] = "d", "down") or (word[2] = "d", "down") Perform(&DoExit) else: return false } } after { object DoShoot { local i "You shoot "; The(self) ". It lets out a loud shriek and rears up. Then suddenly it becomes very quiet. It takes a couple of unsure steps, staggering forward, then collapses onto the ground. Dead. Nice going." if player in self { "\nNow, seeing as you were sitting on the horse when you put a bullet in it, you've also sent yourself tumbling to the ground." move player to location } } } is shootable }