| 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 bjarn (schedule.speak): |
| 24 |
|
| 25 |
def __init__ (self, mapcharacterinstance): |
| 26 |
self.myself = mapcharacterinstance |
| 27 |
|
| 28 |
|
| 29 |
self.speech = [_("Ha! A tradesman is an honourable person, they say!"), \ |
| 30 |
_("Why don't they just take that Silverhair woman to prison!?"), \ |
| 31 |
_("Elves! The head in the sky and the mind full of clouds!")] |
| 32 |
self.speech_delay = (20, 40) |
| 33 |
schedule.speak.__init__(self) |
| 34 |
|
| 35 |
self.coords = [(7, 5, adonthell.STAND_WEST), \ |
| 36 |
(2, 4, adonthell.STAND_SOUTH), \ |
| 37 |
(7, 3, adonthell.STAND_NORTH), \ |
| 38 |
(3, 6, adonthell.STAND_WEST)] |
| 39 |
|
| 40 |
self.myself.set_callback (self.goal_reached) |
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
def await_player (self): |
| 45 |
self.myself.jump_to (7, 3, 6) |
| 46 |
self.myself.stand_west () |
| 47 |
|
| 48 |
def start_talking (self): |
| 49 |
self.myself.launch_action (adonthell.gamedata_player ()) |
| 50 |
adonthell.gamedata_get_character ("Erek Stonebreaker").pause () |
| 51 |
|
| 52 |
def walk (self): |
| 53 |
x, y, dir = self.coords[random.randint (0, 3)] |
| 54 |
self.myself.set_goal (x, y, dir) |
| 55 |
|
| 56 |
def goal_reached (self): |
| 57 |
delay = "%it" % random.randrange (15, 30) |
| 58 |
self.myself.time_callback (delay, self.walk) |