| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
import adonthell |
| 18 |
import random |
| 19 |
from schedules.mapcharacters import schedule |
| 20 |
|
| 21 |
def _(message): return message |
| 22 |
|
| 23 |
class talan (schedule.speak): |
| 24 |
|
| 25 |
def __init__ (self, mapcharacterinstance): |
| 26 |
self.myself = mapcharacterinstance |
| 27 |
|
| 28 |
|
| 29 |
self.speech = [_("Halt! Who goes there?"), \ |
| 30 |
"\"Ai! laurie lantar lassi surinen ...\"", \ |
| 31 |
_("Nobody may pass through the gate!")] |
| 32 |
self.speech_delay = (30, 60) |
| 33 |
schedule.speak.__init__(self) |
| 34 |
|
| 35 |
self.myself.set_callback (self.goal_reached) |
| 36 |
|
| 37 |
def walk (self): |
| 38 |
if self.myself.posy () == 17: |
| 39 |
self.myself.set_goal (11, 19, adonthell.STAND_NORTH) |
| 40 |
else: |
| 41 |
self.myself.set_goal (11, 17, adonthell.STAND_SOUTH) |
| 42 |
|
| 43 |
def goal_reached (self): |
| 44 |
delay = "%it" % random.randrange (10, 20) |
| 45 |
self.myself.time_callback (delay, self.walk) |
| 46 |
|