comparison clients/rio_de_hola/scripts/world.py @ 48:097996ee0b3d

fixed talk functionality in techdemo
author jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
date Sun, 13 Jul 2008 12:40:54 +0000
parents 47fff0eee32e
children 214e3eb81eb2
comparison
equal deleted inserted replaced
47:b3838661971f 48:097996ee0b3d
105 105
106 self.girl = Girl(self.model, 'NPC:girl', self.agentlayer) 106 self.girl = Girl(self.model, 'NPC:girl', self.agentlayer)
107 self.instance_to_agent[self.girl.agent.getFifeId()] = self.girl 107 self.instance_to_agent[self.girl.agent.getFifeId()] = self.girl
108 self.girl.start() 108 self.girl.start()
109 109
110 self.beekeepers = create_anonymous_agents(self.model, 'Beekeeper', self.agentlayer, Beekeeper) 110 self.beekeepers = create_anonymous_agents(self.model, 'beekeeper', self.agentlayer, Beekeeper)
111 for beekeeper in self.beekeepers: 111 for beekeeper in self.beekeepers:
112 self.instance_to_agent[beekeeper.agent.getFifeId()] = beekeeper 112 self.instance_to_agent[beekeeper.agent.getFifeId()] = beekeeper
113 beekeeper.start() 113 beekeeper.start()
114 114
115 cloudlayer = self.map.getLayer('TechdemoMapTileLayer') 115 cloudlayer = self.map.getLayer('TechdemoMapTileLayer')
234 234
235 def onTalkButtonPress(self): 235 def onTalkButtonPress(self):
236 self.hide_instancemenu() 236 self.hide_instancemenu()
237 instance = self.instancemenu.instance 237 instance = self.instancemenu.instance
238 self.hero.talk(instance.getLocationRef()) 238 self.hero.talk(instance.getLocationRef())
239 if instance.getObject().getId() == 'Beekeeper': 239 if instance.getObject().getId() == 'beekeeper':
240 txtindex = random.randint(0, len(TDS.beekeeperTexts) - 1) 240 txtindex = random.randint(0, len(TDS.beekeeperTexts) - 1)
241 instance.say(TDS.beekeeperTexts[txtindex], 5000) 241 instance.say(TDS.beekeeperTexts[txtindex], 5000)
242 if instance.getObject().getId() == 'Girl': 242 if instance.getObject().getId() == 'girl':
243 txtindex = random.randint(0, len(TDS.girlTexts) - 1) 243 txtindex = random.randint(0, len(TDS.girlTexts) - 1)
244 instance.say(TDS.girlTexts[txtindex], 5000) 244 instance.say(TDS.girlTexts[txtindex], 5000)
245 245
246 def onKickButtonPress(self): 246 def onKickButtonPress(self):
247 self.hide_instancemenu() 247 self.hide_instancemenu()