| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
import adonthell |
| 18 |
from schedules.mapcharacters import schedule |
| 19 |
import random |
| 20 |
|
| 21 |
def _(message): return message |
| 22 |
|
| 23 |
class fellnir (schedule.speak): |
| 24 |
|
| 25 |
def __init__ (self, mapcharacterinstance): |
| 26 |
self.myself = mapcharacterinstance |
| 27 |
|
| 28 |
|
| 29 |
self.speech = [_("Master Orloth should throw out that brute!"), \ |
| 30 |
_("Take equal parts of vitriol, nitre and sal ammoniac ...")] |
| 31 |
self.speech_delay = (20, 40) |
| 32 |
schedule.speak.__init__(self) |
| 33 |
|
| 34 |
self.coords = [(2, 5, adonthell.STAND_EAST), \ |
| 35 |
(4, 4, adonthell.STAND_SOUTH), \ |
| 36 |
(4, 2, adonthell.STAND_NORTH), \ |
| 37 |
(6, 5, adonthell.STAND_WEST)] |
| 38 |
|
| 39 |
self.myself.set_callback (self.goal_reached) |
| 40 |
|
| 41 |
def walk (self): |
| 42 |
x, y, dir = self.coords[random.randrange (0, 4)] |
| 43 |
self.myself.set_goal (x, y, dir) |
| 44 |
|
| 45 |
def goal_reached (self): |
| 46 |
delay = "%it" % random.randrange (37, 75) |
| 47 |
self.myself.time_callback (delay, self.walk) |