Mercurial > fife-parpg
diff clients/rio_de_hola/scripts/agents/hero.py @ 121:ae3b8139c7c7
* Applying settings patch by greyghost
* See: #274
author | mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Tue, 05 Aug 2008 14:44:15 +0000 |
parents | 214e3eb81eb2 |
children | 9a1529f9625e |
line wrap: on
line diff
--- a/clients/rio_de_hola/scripts/agents/hero.py Mon Aug 04 15:45:07 2008 +0000 +++ b/clients/rio_de_hola/scripts/agents/hero.py Tue Aug 05 14:44:15 2008 +0000 @@ -1,6 +1,8 @@ import random from agent import Agent -import settings as TDS +from settings import Setting + +TDS = Setting() _STATE_NONE, _STATE_IDLE, _STATE_RUN, _STATE_KICK, _STATE_TALK = xrange(5) @@ -17,8 +19,9 @@ else: self.idlecounter += 1 if self.idlecounter % 7 == 0: - txtindex = random.randint(0, len(TDS.heroTexts) - 1) - instance.say(TDS.heroTexts[txtindex], 2500) + heroTexts = TDS.readSetting("heroTexts", type='list', text=True) + txtindex = random.randint(0, len(heroTexts) - 1) + instance.say(heroTexts[txtindex], 2500) def start(self): self.idle() @@ -29,7 +32,7 @@ def run(self, location): self.state = _STATE_RUN - self.agent.move('run', location, 4 * TDS.TestAgentSpeed) + self.agent.move('run', location, 4 * float(TDS.readSetting("TestAgentSpeed"))) def kick(self, target): self.state = _STATE_KICK