27 foods = [
'fishfood',
'food',
'bag_popcorn',
'apple',
'cheeseburger',
'loaf',
'tomato',
'waybread',
'roast_bird',
'orange',
'leg_mutton' ]
29 floors = [
'woodfloor',
'flagstone',
'dirtfloor' ]
31 walls = [
'flagstone',
'dwall',
'timberwall',
'stwall' ]
34 replace_with = [
'd_statue',
'statue',
'statue2' ]
37 '''Return a random choice in what, which should be an array.'''
38 return what[ random.randint( 1, len(what) ) - 1 ]
41 '''Teleport player back to bed of reality. Only in emergency.'''
43 if (act.BedMap.find(Crossfire.PlayerDirectory()) != -1):
46 dest = Crossfire.ReadyMap(act.BedMap, flags)
49 act.Message(
'The %s whines really loudly.'%l.Name)
52 act.Teleport(dest, act.BedX, act.BedY)
55 '''Teleport the player back to his starting point.'''
56 x = l.ReadKey(
'banquet_x')
57 y = l.ReadKey(
'banquet_y')
58 mn = l.ReadKey(
'banquet_map')
59 rw = l.ReadKey(
'banquet_rw')
61 l.WriteKey(
'banquet_x',
'', 0)
62 l.WriteKey(
'banquet_y',
'', 0)
63 l.WriteKey(
'banquet_map',
'', 0)
64 l.WriteKey(
'banquet_rw',
'', 0)
66 if x ==
'' or y ==
'' or mn ==
'':
68 act.Message(
'You feel a distorsion of reality!')
73 dest = Crossfire.ReadyMap(mn)
76 act.Message(
'The %s whines something. You barely understand it can\'t take you back to your starting point.'%l.Name)
81 st = dest.ObjectAt(
int(x),
int(y))
83 if (st.ArchName != rw):
89 act.Message(
'You feel a powerful force engulf you.')
90 act.Teleport(dest,
int(x),
int(y))
93 '''Teleports the player to the banquet map, if not used since one day. '''
95 now =
str(Crossfire.GetTime()[0]) +
'-' +
str(Crossfire.GetTime()[1]) +
'-' +
str(Crossfire.GetTime()[2])
97 l = Crossfire.WhoAmI()
98 act = Crossfire.WhoIsActivator()
100 last = l.ReadKey(
'banquet_last')
104 act.Message(
'You read the %s but nothing happens.'%l.Name)
107 l.WriteKey(
'banquet_last', now, 1)
110 m = Crossfire.CreateMap(size_x, size_y)
111 m.Path = os.path.join(Crossfire.ScriptName(), Crossfire.WhoIsActivator().Name)
115 for x
in range(size_x):
116 for y
in range(size_y):
117 fl = Crossfire.CreateObjectByName(floor)
123 m.CreateObject(wall +
'_2_2_2', 0, 0)
125 m.CreateObject(wall +
'_2_2_3', size_x - 1, 0)
127 m.CreateObject(wall +
'_2_2_1', 0, size_y - 1)
129 m.CreateObject(wall +
'_2_2_4', size_x - 1, size_y - 1)
131 for x
in range(size_x - 2):
132 m.CreateObject(wall +
'_2_1_2', x + 1, 0)
133 m.CreateObject(wall +
'_2_1_2', x + 1, size_y - 1)
135 for y
in range(size_y - 2):
136 m.CreateObject(wall +
'_2_1_1', 0, y + 1)
137 m.CreateObject(wall +
'_2_1_1', size_x - 1, y + 1)
140 for x
in range(size_x-2):
141 for y
in range(size_y-2):
142 m.CreateObject(
get_one(foods), x + 1, y + 1).GodGiven = 1
150 l.WriteKey(
'banquet_x',
str(x), 1)
151 l.WriteKey(
'banquet_y',
str(y), 1)
152 l.WriteKey(
'banquet_map', im.Path, 1)
153 l.WriteKey(
'banquet_rw', rw, 1)
156 act.Message(
'You feel grabbed by some powerful force.')
157 act.Teleport(m,
int(( size_x - 1 ) / 2),
int((size_y - 1) / 2))
160 statue = im.CreateObject(rw, x, y)
161 statue.Name =
'%s\'s statue'%act.Name
162 statue.Message =
'Gone eating.'
164 l = Crossfire.WhoAmI()
165 act = Crossfire.WhoIsActivator()
168 act.Message(
'You try to open the %s, but it seems to flee from you.'%l.Name)
169 elif (act.Map.Path.find(Crossfire.ScriptName()) != -1):
174 Crossfire.SetReturnValue(1)