git @ Cat's Eye Technologies The-Swallows / 0c2e53e
Reform .notable() by adding .weapon(). But now, where is the brandy? Cat's Eye Technologies 11 years ago
1 changed file(s) with 20 addition(s) and 20 deletion(s). Raw diff Collapse all Expand all
181181 self.move_to(location)
182182
183183 def notable(self):
184 return self.treasure() or self.weapon() or self.animate() or self.horror()
185
186 def treasure(self):
184187 return False
185
186 def treasure(self): # impies notable usually
188
189 def weapon(self):
187190 return False
188191
189 def horror(self): # impies notable usually
192 def horror(self):
190193 return False
191194
192195 def takeable(self):
307310 self.memory = {}
308311
309312 def animate(self):
310 return True
311
312 def notable(self):
313313 return True
314314
315315 def address(self, other, topic, phrase, participants=None):
433433 return self.converse(self.topic)
434434
435435 # otherwise, if there are valuable items here, you *must* pick them up.
436 # TODO: OR IF IT IS AN ITEM YOU ARE LOOKING FOR; SAY, A BOTTLE OF BRANDY
436437 for x in self.location.contents:
437 if x.notable() and x.takeable():
438 if x.treasure() or x.weapon():
438439 self.emit("<1> picked up <2>", [self, x])
439440 x.move_to(self)
440441 self.memory[x.name] = Memory(x, self)
463464 return self.wander()
464465 if choice == 20:
465466 self.emit("<1> yawned", [self])
466 if choice == 21:
467 elif choice == 21:
467468 self.emit("<1> gazed thoughtfully into the distance", [self])
468 if choice == 22:
469 elif choice == 22:
469470 self.emit("<1> thought <he-1> heard something", [self])
470 if choice == 23:
471 elif choice == 23:
471472 self.emit("<1> scratched <his-1> head", [self])
472 if choice == 24:
473 elif choice == 24:
473474 self.emit("<1> immediately had a feeling something was amiss", [self])
474475 else:
475476 return self.wander()
528529 else: # no memories of this
529530 self.emit("<1> searched <2>", [self, container])
530531 for thing in container.contents:
531 if thing.notable() and thing.takeable():
532 # TODO: OR IF IT IS AN ITEM YOU ARE LOOKING FOR; SAY, A BOTTLE OF BRANDY
533 if thing.treasure() or thing.weapon():
532534 self.emit("<1> found <2> hidden there, and took <him-2>", [self, thing])
533535 thing.move_to(self)
534536 self.memory[thing.name] = Memory(thing, self)
601603 "'Where is the brandy? I need a drink,' moaned <1>",
602604 [self, other, self_memory.subject])
603605 return
604 # this needs to be not *all* the time
606 # this need not be *all* the time
605607 for x in other.contents:
606608 if x.notable():
607609 self.memory[x.name] = Memory(x, other)
681683 def takeable(self):
682684 return True
683685
684 def notable(self):
686
687 class Weapon(Item):
688 def weapon(self):
685689 return True
686
687690
688691
689692 class Male(Animate):
747750
748751
749752 class Horror(Actor):
750 def notable(self):
751 return True
752
753753 def horror(self):
754754 return True
755755
793793
794794 cupboards = Container('cupboards', kitchen)
795795 liquor_cabinet = Container('liquor cabinet', dining_room)
796 brandy = Item('bottle of brandy', liquor_cabinet)
797796 mailbox = Container('mailbox', driveway)
798797
799798 bobs_bed = Container("bed", bobs_bedroom)
800799 alices_bed = Container("bed", alices_bedroom)
801800
802 revolver = Item('revolver', pick([bobs_bed, alices_bed]))
801 brandy = Item('bottle of brandy', liquor_cabinet)
802 revolver = Weapon('revolver', pick([bobs_bed, alices_bed]))
803803 dead_body = Horror('dead body', bathroom)
804804
805805 alice = Female('Alice', None)