| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
import adonthell |
| 19 |
from schedules.mapcharacters import schedule |
| 20 |
import random |
| 21 |
|
| 22 |
def _(message): return message |
| 23 |
|
| 24 |
class oliver (schedule.speak): |
| 25 |
def __init__ (self, mapcharacterinstance): |
| 26 |
self.myself = mapcharacterinstance |
| 27 |
|
| 28 |
|
| 29 |
self.speech = [_("It's so exciting. An Elven Lady, here at Waste's Edge!"), \ |
| 30 |
_("I gotta hurry before mother complains again."), \ |
| 31 |
_("Why can't I have a little dog!?")] |
| 32 |
self.speech_delay = (20, 40) |
| 33 |
schedule.speak.__init__(self) |
| 34 |
|
| 35 |
|
| 36 |
self.offsets = [(1,1),(1,-1),(-1,1),(-1,-1),(1,0),(0,1),(-1,0),(0,-1)] |
| 37 |
|
| 38 |
self.myself.set_callback (self.goal_reached) |
| 39 |
|
| 40 |
|
| 41 |
def goto_common_room (self): |
| 42 |
|
| 43 |
self.myself.jump_to (1, 13, 7, adonthell.STAND_NORTH) |
| 44 |
|
| 45 |
|
| 46 |
orloth = adonthell.gamedata_get_character ("Orloth Redwyne") |
| 47 |
for (x, y) in self.offsets: |
| 48 |
x = x + orloth.posx () |
| 49 |
y = y + orloth.posy () |
| 50 |
|
| 51 |
if self.myself.set_goal (x, y): |
| 52 |
break |
| 53 |
|
| 54 |
|
| 55 |
def goto_barn (self): |
| 56 |
location = self.myself.submap () |
| 57 |
|
| 58 |
|
| 59 |
if location == 12: |
| 60 |
self.myself.set_goal (5, 1) |
| 61 |
|
| 62 |
|
| 63 |
elif location == 9: |
| 64 |
self.myself.set_goal (8, 1) |
| 65 |
|
| 66 |
|
| 67 |
elif location == 14: |
| 68 |
self.myself.set_goal (4, 1) |
| 69 |
|
| 70 |
|
| 71 |
elif location == 1: |
| 72 |
self.myself.set_goal (13, 8) |
| 73 |
|
| 74 |
|
| 75 |
elif location == 0: |
| 76 |
self.myself.set_goal (25, 15) |
| 77 |
self.myself.goto_barn = 0 |
| 78 |
|
| 79 |
def goal_reached (self): |
| 80 |
if self.myself.get_val ("goto_barn") == 1: |
| 81 |
self.goto_barn () |