home · contact · privacy
Plugin: Add mission, fix slipper usage, change GAME_WON to FAVOR_STAGE.
[plomrogue] / plugins / server / PleaseTheIslandGod.py
1 from server.io import log, strong_write
2 from server.config.world_data import world_db, symbols_passable, directions_db
3 from server.utils import mv_yx_in_dir_legal, rand, id_setter
4 from server.config.io import io_db
5 from server.new_thing import new_Thing
6
7 def make_world(seed):
8     from server.update_map_memory import update_map_memory
9     from server.config.misc import make_map_func
10     from server.utils import libpr
11
12     def free_pos(plant=False):
13         i = 0
14         while 1:
15             err = "Space to put thing on too hard to find. Map too small?"
16             while 1:
17                 y = rand.next() % world_db["MAP_LENGTH"]
18                 x = rand.next() % world_db["MAP_LENGTH"]
19                 pos = y * world_db["MAP_LENGTH"] + x;
20                 if (not plant
21                     and "." == chr(world_db["MAP"][pos])) \
22                    or ":" == chr(world_db["MAP"][pos]):
23                     break
24                 i += 1
25                 if i == 65535:
26                     raise SystemExit(err)
27             pos_clear = (0 == len([id for id in world_db["Things"]
28                                    if world_db["Things"][id]["T_LIFEPOINTS"]
29                                    if world_db["Things"][id]["T_POSY"] == y
30                                    if world_db["Things"][id]["T_POSX"] == x]))
31             if pos_clear:
32                 break
33         return (y, x)
34
35     rand.seed = seed
36     if world_db["MAP_LENGTH"] < 1:
37         print("Ignoring: No map length >= 1 defined.")
38         return
39     libpr.set_maplength(world_db["MAP_LENGTH"])
40     player_will_be_generated = False
41     playertype = world_db["PLAYER_TYPE"]
42     for ThingType in world_db["ThingTypes"]:
43         if playertype == ThingType:
44             if 0 < world_db["ThingTypes"][ThingType]["TT_START_NUMBER"]:
45                 player_will_be_generated = True
46             break
47     if not player_will_be_generated:
48         print("Ignoring: No player type with start number >0 defined.")
49         return
50     wait_action = False
51     for ThingAction in world_db["ThingActions"]:
52         if "wait" == world_db["ThingActions"][ThingAction]["TA_NAME"]:
53             wait_action = True
54     if not wait_action:
55         print("Ignoring beyond SEED_MAP: " +
56               "No thing action with name 'wait' defined.")
57         return
58     if not world_db["SLIPPERS"] in world_db["ThingTypes"]:
59         print("Ignoring: No valid SLIPPERS set.")
60         return
61     if not world_db["PLANT_0"] in world_db["ThingTypes"]:
62         print("Ignoring: No valid PLANT_0 set.")
63         return
64     #for name in specials:
65     #    if world_db[name] not in world_db["ThingTypes"]:
66     #        print("Ignoring: No valid " + name + " set.")
67     #        return
68     world_db["Things"] = {}
69     make_map()
70     world_db["WORLD_ACTIVE"] = 1
71     world_db["TURN"] = 1
72     for i in range(world_db["ThingTypes"][playertype]["TT_START_NUMBER"]):
73         id = id_setter(-1, "Things")
74         world_db["Things"][id] = new_Thing(playertype, free_pos())
75     if not world_db["Things"][0]["fovmap"]:
76         empty_fovmap = bytearray(b" " * world_db["MAP_LENGTH"] ** 2)
77         world_db["Things"][0]["fovmap"] = empty_fovmap
78     update_map_memory(world_db["Things"][0])
79     for type in world_db["ThingTypes"]:
80         for i in range(world_db["ThingTypes"][type]["TT_START_NUMBER"]):
81             if type != playertype:
82                 id = id_setter(-1, "Things")
83                 plantness = world_db["ThingTypes"][type]["TT_PROLIFERATE"]
84                 world_db["Things"][id] = new_Thing(type, free_pos(plantness))
85     strong_write(io_db["file_out"], "NEW_WORLD\n")
86
87 def thingproliferation(t, prol_map):
88     from server.new_thing import new_Thing
89     global directions_db, mv_yx_in_dir_legal
90     prolscore = world_db["ThingTypes"][t["T_TYPE"]]["TT_PROLIFERATE"]
91     if prolscore and \
92       (world_db["ThingTypes"][t["T_TYPE"]]["TT_LIFEPOINTS"] == 0 or
93        t["T_LIFEPOINTS"] >= 0.9 *
94                         world_db["ThingTypes"][t["T_TYPE"]]["TT_LIFEPOINTS"]) \
95        and \
96       (1 == prolscore or 1 == (rand.next() % prolscore)):
97         candidates = []
98         for dir in [directions_db[key] for key in directions_db]:
99             mv_result = mv_yx_in_dir_legal(dir, t["T_POSY"], t["T_POSX"])
100             pos = mv_result[1] * world_db["MAP_LENGTH"] + mv_result[2]
101             if mv_result[0] and \
102                (ord(":") == prol_map[pos]
103                 or (world_db["ThingTypes"][t["T_TYPE"]]["TT_LIFEPOINTS"]
104                     and ord(".") == prol_map[pos])):
105                 candidates.append((mv_result[1], mv_result[2]))
106         if len(candidates):
107             i = rand.next() % len(candidates)
108             id = id_setter(-1, "Things")
109             newT = new_Thing(t["T_TYPE"], (candidates[i][0], candidates[i][1]))
110             world_db["Things"][id] = newT
111             if (world_db["FAVOR_STAGE"] > 0
112                 and t["T_TYPE"] == world_db["PLANT_0"]):
113                 world_db["GOD_FAVOR"] += 5
114             #elif t["T_TYPE"] == world_db["PLANT_1"];
115             #    world_db["GOD_FAVOR"] += 25
116             #elif world_db["FAVOR_STAGE"] >= 4 and \
117             #     t["T_TYPE"] == world_db["ANIMAL_1"]:
118             #    log("The Island God SMILES upon a new-born bear baby.")
119             #    world_db["GOD_FAVOR"] += 750
120
121 def make_map():
122     global rand
123
124     def is_neighbor(coordinates, type):
125         y = coordinates[0]
126         x = coordinates[1]
127         length = world_db["MAP_LENGTH"]
128         ind = y % 2
129         diag_west = x + (ind > 0)
130         diag_east = x + (ind < (length - 1))
131         pos = (y * length) + x
132         if (y > 0 and diag_east
133             and type == chr(world_db["MAP"][pos - length + ind])) \
134            or (x < (length - 1)
135                and type == chr(world_db["MAP"][pos + 1])) \
136            or (y < (length - 1) and diag_east
137                and type == chr(world_db["MAP"][pos + length + ind])) \
138            or (y > 0 and diag_west
139                and type == chr(world_db["MAP"][pos - length - (not ind)])) \
140            or (x > 0
141                and type == chr(world_db["MAP"][pos - 1])) \
142            or (y < (length - 1) and diag_west
143                and type == chr(world_db["MAP"][pos + length - (not ind)])):
144             return True
145         return False
146
147     world_db["MAP"] = bytearray(b'~' * (world_db["MAP_LENGTH"] ** 2))
148     length = world_db["MAP_LENGTH"]
149     add_half_width = (not (length % 2)) * int(length / 2)
150     world_db["MAP"][int((length ** 2) / 2) + add_half_width] = ord(".")
151     while (1):
152         y = rand.next() % length
153         x = rand.next() % length
154         pos = (y * length) + x
155         if "~" == chr(world_db["MAP"][pos]) and is_neighbor((y, x), "."):
156             if y == 0 or y == (length - 1) or x == 0 or x == (length - 1):
157                 break
158             world_db["MAP"][pos] = ord(".")
159     n_trees = int((length ** 2) / 16)
160     i_trees = 0
161     while (i_trees <= n_trees):
162         single_allowed = rand.next() % 32
163         y = rand.next() % length
164         x = rand.next() % length
165         pos = (y * length) + x
166         if "." == chr(world_db["MAP"][pos]) \
167           and ((not single_allowed) or is_neighbor((y, x), "X")):
168             world_db["MAP"][pos] = ord("X")
169             i_trees += 1
170     n_colons = int((length ** 2) / 16)
171     i_colons = 0
172     while (i_colons <= n_colons):
173         single_allowed = rand.next() % 256
174         y = rand.next() % length
175         x = rand.next() % length
176         pos = (y * length) + x
177         if ("." == chr(world_db["MAP"][pos])
178           and ((not single_allowed) or is_neighbor((y, x), ":"))):
179             world_db["MAP"][pos] = ord(":")
180             i_colons += 1
181     altar_placed = False
182     while not altar_placed:
183         y = rand.next() % length
184         x = rand.next() % length
185         pos = (y * length) + x
186         if (("." == chr(world_db["MAP"][pos]
187              or ":" == chr(world_db["MAP"][pos]))
188             and not is_neighbor((y, x), "X"))):
189             world_db["MAP"][pos] = ord("_")
190             world_db["altar"] = (y, x)
191             altar_placed = True
192
193 def ai(t):
194     from server.ai import get_dir_to_target, get_inventory_slot_to_consume, \
195         standing_on_food
196     t["T_COMMAND"] = [id for id in world_db["ThingActions"]
197                       if world_db["ThingActions"][id]["TA_NAME"] == "wait"][0]
198     eating = len([id for id in world_db["ThingActions"]
199                   if world_db["ThingActions"][id]["TA_NAME"] == "use"]) > 0
200     picking = len([id for id in world_db["ThingActions"]
201                    if world_db["ThingActions"][id]["TA_NAME"] == "pickup"]) > 0
202     if eating and picking:
203         if get_dir_to_target(t, "f"):
204             return
205         sel = get_inventory_slot_to_consume(t)
206         if -1 != sel:
207             t["T_COMMAND"] = [id for id in world_db["ThingActions"]
208                               if world_db["ThingActions"][id]["TA_NAME"]
209                                  == "use"][0]
210             t["T_ARGUMENT"] = sel
211         elif standing_on_food(t) and (len(t["T_CARRIES"]) <
212                 world_db["ThingTypes"][t["T_TYPE"]]["TT_STORAGE"]):
213                 t["T_COMMAND"] = [id for id in world_db["ThingActions"]
214                                   if world_db["ThingActions"][id]["TA_NAME"]
215                                   == "pickup"][0]
216         else:
217             going_to_known_food_spot = get_dir_to_target(t, "c")
218             if not going_to_known_food_spot:
219                 aiming_for_walking_food = get_dir_to_target(t, "a")
220                 if not aiming_for_walking_food:
221                     get_dir_to_target(t, "s")
222
223 def actor_pickup(t):
224     from server.ai import eat_vs_hunger_threshold
225     used_slots = len(t["T_CARRIES"])
226     if used_slots < world_db["ThingTypes"][t["T_TYPE"]]["TT_STORAGE"]:
227         ids = [id for id in world_db["Things"] if world_db["Things"][id] != t
228                if not world_db["Things"][id]["carried"]
229                if world_db["Things"][id]["T_POSY"] == t["T_POSY"]
230                if world_db["Things"][id]["T_POSX"] == t["T_POSX"]]
231         if len(ids):
232             lowest_tid = -1
233             eat_cost = eat_vs_hunger_threshold(t["T_TYPE"])
234             for iid in ids:
235                 tid = world_db["Things"][iid]["T_TYPE"] 
236                 if lowest_tid == -1 or tid < lowest_tid:
237                     if (t != world_db["Things"][0] and
238                         (world_db["ThingTypes"][tid]["TT_TOOL"] != "food"
239                          or (world_db["ThingTypes"][tid]["TT_TOOLPOWER"]
240                              <= eat_cost))):
241                         continue
242                     id = iid
243                     lowest_tid = tid
244             world_db["Things"][id]["carried"] = True
245             ty = world_db["Things"][id]["T_TYPE"]
246             if (t != world_db["Things"][0]
247                 and world_db["Things"][id]["T_PLAYERDROP"]
248                 and world_db["ThingTypes"][ty]["TT_TOOL"] == "food"):
249                 score = int(world_db["ThingTypes"][ty]["TT_TOOLPOWER"] / 32)
250                 world_db["GOD_FAVOR"] += score
251                 world_db["Things"][id]["T_PLAYERDROP"] = 0
252             t["T_CARRIES"].append(id)
253             if t == world_db["Things"][0]:
254                 log("You PICK UP an object.")
255     elif t == world_db["Things"][0]:
256         log("Can't pick up object: No storage room to carry more.")
257
258
259 def actor_drop(t):
260     """Make t rop Thing from inventory to ground indexed by T_ARGUMENT."""
261     if len(t["T_CARRIES"]):
262         id = t["T_CARRIES"][t["T_ARGUMENT"]]
263         t["T_CARRIES"].remove(id)
264         world_db["Things"][id]["carried"] = False
265         if t == world_db["Things"][0]:
266             log("You DROP an object.")
267             world_db["Things"][id]["T_PLAYERDROP"] = 1
268
269
270 def actor_use(t):
271     if len(t["T_CARRIES"]):
272         id = t["T_CARRIES"][t["T_ARGUMENT"]]
273         type = world_db["Things"][id]["T_TYPE"]
274         if type == world_db["SLIPPERS"]:
275             if t == world_db["Things"][0]:
276                 log("You use the " + world_db["ThingTypes"][type]["TT_NAME"]
277                     + ". It glows in wondrous colors, and emits a sound as if "
278                     + "from a dying cat. The Island God laughs.\n")
279             t["T_LIFEPOINTS"] = 1
280             from server.config.misc import decrement_lifepoints_func
281             decrement_lifepoints_func(t)
282         elif world_db["ThingTypes"][type]["TT_TOOL"] == "food":
283             t["T_CARRIES"].remove(id)
284             del world_db["Things"][id]
285             t["T_SATIATION"] += world_db["ThingTypes"][type]["TT_TOOLPOWER"]
286             if t == world_db["Things"][0]:
287                 log("You CONSUME this object.")
288         elif t == world_db["Things"][0]:
289             log("You try to use this object, but FAIL.")
290
291 def decrement_lifepoints(t):
292     t["T_LIFEPOINTS"] -= 1
293     _id = [_id for _id in world_db["Things"] if world_db["Things"][_id] == t][0]
294     if 0 == t["T_LIFEPOINTS"]:
295         sadness = world_db["ThingTypes"][t["T_TYPE"]]["TT_LIFEPOINTS"]
296         for id in t["T_CARRIES"]:
297             t["T_CARRIES"].remove(id)
298             world_db["Things"][id]["T_POSY"] = t["T_POSY"]
299             world_db["Things"][id]["T_POSX"] = t["T_POSX"]
300             world_db["Things"][id]["carried"] = False
301         t["T_TYPE"] = world_db["ThingTypes"][t["T_TYPE"]]["TT_CORPSE_ID"]
302         if world_db["Things"][0] == t:
303             t["fovmap"] = bytearray(b' ' * (world_db["MAP_LENGTH"] ** 2))
304             log("You die.")
305             log("See README on how to start over.")
306         else:
307             t["fovmap"] = False
308             t["T_MEMMAP"] = False
309             t["T_MEMDEPTHMAP"] = False
310             t["T_MEMTHING"] = []
311         return sadness
312     return 0
313
314 def actor_move(t):
315
316     def enter_altar():
317         from server.new_thing import new_Thing
318         if world_db["FAVOR_STAGE"] > 9000:
319            log("You step on a soul-less slab of stone.")
320            return
321         log("YOU ENTER SACRED GROUND.")
322         if world_db["FAVOR_STAGE"] == 0:
323             world_db["FAVOR_STAGE"] = 1
324             log("The Island God speaks to you: \"I don't trust you. You intrud"
325                  + "e on the island's affairs. I think you're a nuisance at be"
326                  + "st, and a danger to my children at worst. I will give you "
327                  + "a chance to lighten my mood, however: For a while now, I'v"
328                  + "e been trying to spread the plant "
329                  + world_db["ThingTypes"][world_db["PLANT_0"]]["TT_NAME"]
330                  + " (\""
331                  + world_db["ThingTypes"][world_db["PLANT_0"]]["TT_SYMBOL"]
332                  + "\"). I have not been very successful so far. Maybe you can"
333                  + " make yourself useful there. I will count each further "
334                  + world_db["ThingTypes"][world_db["PLANT_0"]]["TT_NAME"]
335                  + " that grows to your favor.\"")
336         elif world_db["GOD_FAVOR"] > 150:
337             world_db["FAVOR_STAGE"] = 9001
338             log("The Island God speaks to you: \"You have proven yourself wort"
339                  + "hy of my respect. You were a good citizen to the island, a"
340                  + "nd sometimes a better steward to its inhabitants than me. "
341                  + "The island shall miss you when you leave. But you have ear"
342                  + "ned the right to do so. Take this "
343                  + world_db["ThingTypes"][world_db["SLIPPERS"]]["TT_NAME"]
344                  + " and USE it when you please. It will take you to where you"
345                  + " came from. (But do feel free to stay here as long as you "
346                  + "like.)\"")
347             id = id_setter(-1, "Things")
348             world_db["Things"][id] = new_Thing(world_db["SLIPPERS"],
349                                                world_db["altar"])
350
351     from server.config.world_data import symbols_passable
352     from server.build_fov_map import build_fov_map
353     from server.config.misc import decrement_lifepoints_func
354     passable = False
355     move_result = mv_yx_in_dir_legal(chr(t["T_ARGUMENT"]),
356                                      t["T_POSY"], t["T_POSX"])
357     if 1 == move_result[0]:
358         pos = (move_result[1] * world_db["MAP_LENGTH"]) + move_result[2]
359         hitted = [id for id in world_db["Things"]
360                   if world_db["Things"][id] != t
361                   if world_db["Things"][id]["T_LIFEPOINTS"]
362                   if world_db["Things"][id]["T_POSY"] == move_result[1]
363                   if world_db["Things"][id]["T_POSX"] == move_result[2]]
364         if len(hitted):
365             hit_id = hitted[0]
366             if t == world_db["Things"][0]:
367                 hitted_type = world_db["Things"][hit_id]["T_TYPE"]
368                 hitted_name = world_db["ThingTypes"][hitted_type]["TT_NAME"]
369                 log("You WOUND " + hitted_name + ".")
370                 world_db["GOD_FAVOR"] -= 1
371             elif 0 == hit_id:
372                 hitter_name = world_db["ThingTypes"][t["T_TYPE"]]["TT_NAME"]
373                 log(hitter_name +" WOUNDS you.")
374             test = decrement_lifepoints_func(world_db["Things"][hit_id])
375             if test and t == world_db["Things"][0]:
376                 world_db["GOD_FAVOR"] -= test 
377             return
378         passable = chr(world_db["MAP"][pos]) in symbols_passable
379     dir = [dir for dir in directions_db
380            if directions_db[dir] == chr(t["T_ARGUMENT"])][0]
381     if passable:
382         t["T_POSY"] = move_result[1]
383         t["T_POSX"] = move_result[2]
384         for id in t["T_CARRIES"]:
385             world_db["Things"][id]["T_POSY"] = move_result[1]
386             world_db["Things"][id]["T_POSX"] = move_result[2]
387         build_fov_map(t)
388         if t == world_db["Things"][0]:
389             log("You MOVE " + dir + ".")
390             if (move_result[1] == world_db["altar"][0] and
391                 move_result[2] == world_db["altar"][1]):
392                 enter_altar()
393
394 def command_ttid(id_string):
395     id = id_setter(id_string, "ThingTypes", command_ttid)
396     if None != id:
397         world_db["ThingTypes"][id] = {
398             "TT_NAME": "(none)",
399             "TT_TOOLPOWER": 0,
400             "TT_LIFEPOINTS": 0,
401             "TT_PROLIFERATE": 0,
402             "TT_START_NUMBER": 0,
403             "TT_STORAGE": 0,
404             "TT_SYMBOL": "?",
405             "TT_CORPSE_ID": id,
406             "TT_TOOL": ""
407         }
408
409 def command_worldactive(worldactive_string):
410     val = integer_test(worldactive_string, 0, 1)
411     if None != val:
412         if 0 != world_db["WORLD_ACTIVE"]:
413             if 0 == val:
414                 set_world_inactive()
415             else:
416                 print("World already active.")
417         elif 0 == world_db["WORLD_ACTIVE"]:
418             wait_exists = False
419             for ThingAction in world_db["ThingActions"]:
420                 if "wait" == world_db["ThingActions"][ThingAction]["TA_NAME"]:
421                     wait_exists = True
422                     break
423             player_exists = False
424             for Thing in world_db["Things"]:
425                 if 0 == Thing:
426                     player_exists = True
427                     break
428             altar_found = False
429             if world_db["MAP"]:
430                 pos = world_db["MAP"].find(b'_')
431                 if pos > 0:
432                     y = int(pos / world_db["MAP_LENGTH"])
433                     x = pos % world_db["MAP_LENGTH"]
434                     world_db["altar"] = (y, x)
435                     altar_found = True
436             valid_slippers = world_db["SLIPPERS"] in world_db["ThingTypes"]
437             valid_plant0 = world_db["PLANT_0"] in world_db["ThingTypes"]
438             if altar_found and wait_exists and player_exists and \
439                     world_db["MAP"] and valid_slippers and valid_plant0:
440                 for id in world_db["Things"]:
441                     if world_db["Things"][id]["T_LIFEPOINTS"]:
442                         build_fov_map(world_db["Things"][id])
443                         if 0 == id:
444                             update_map_memory(world_db["Things"][id], False)
445                 if not world_db["Things"][0]["T_LIFEPOINTS"]:
446                     empty_fovmap = bytearray(b" " * world_db["MAP_LENGTH"] ** 2)
447                     world_db["Things"][0]["fovmap"] = empty_fovmap
448                 world_db["WORLD_ACTIVE"] = 1
449             else:
450                 print("Ignoring: Not all conditions for world activation met.")
451
452 def command_slippers(str_int):
453     val = integer_test(str_int, 0)
454     if None != val:
455         world_db["SLIPPERS"] = val
456         if world_db["WORLD_ACTIVE"] and \
457            world_db["SLIPPERS"] not in world_db["ThingTypes"]:
458             world_db["WORLD_ACTIVE"] = 0
459             print("SLIPPERS matches no known ThingTypes, deactivating world.")
460
461 def command_plant0(str_int):
462     val = integer_test(str_int, 0)
463     if None != val:
464         world_db["PLANT_0"] = val
465         if world_db["WORLD_ACTIVE"] and \
466            world_db["PLANT_0"] not in world_db["ThingTypes"]:
467             world_db["WORLD_ACTIVE"] = 0
468             print("PLANT_0 matches no known ThingTypes, deactivating world.")
469
470 def play_use(str_arg):
471     """Try "use" as player's T_COMMAND, int(str_arg) as T_ARGUMENT / slot."""
472     if action_exists("use"):
473         t = world_db["Things"][0]
474         if 0 == len(t["T_CARRIES"]):
475             log("You have NOTHING to use in your inventory.")
476         else:
477             val = integer_test(str_arg, 0, 255)
478             if None != val and val < len(t["T_CARRIES"]):
479                 id = t["T_CARRIES"][val]
480                 type = world_db["Things"][id]["T_TYPE"]
481                 if type != world_db["SLIPPERS"] and not \
482                         world_db["ThingTypes"][type]["TT_TOOL"] == "food":
483                     log("You CAN'T consume this thing.")
484                     return
485                 world_db["Things"][0]["T_ARGUMENT"] = val
486                 set_command("use")
487             else:
488                 print("Illegal inventory index.")
489
490 strong_write(io_db["file_out"], "PLUGIN PleaseTheIslandGod\n")
491
492 if not "GOD_FAVOR" in world_db:
493     world_db["GOD_FAVOR"] = 0
494 if not "FAVOR_STAGE" in world_db:
495     world_db["FAVOR_STAGE"] = 0
496 if not "SLIPPERS" in world_db:
497     world_db["SLIPPERS"] = 0
498 if not "PLANT_0" in world_db:
499     world_db["PLANT_0"] = 0
500 io_db["worldstate_write_order"] += [["GOD_FAVOR", "world_int"]]
501
502 import server.config.world_data
503 server.config.world_data.symbols_passable += ":_"
504
505 from server.config.world_data import thing_defaults
506 thing_defaults["T_PLAYERDROP"] = 0
507
508 import server.config.actions
509 server.config.actions.action_db["actor_move"] = actor_move
510 server.config.actions.action_db["actor_pickup"] = actor_pickup
511 server.config.actions.action_db["actor_drop"] = actor_drop
512 server.config.actions.action_db["actor_use"] = actor_use
513 server.config.actions.ai_func = ai
514
515 from server.config.commands import commands_db
516 commands_db["TT_ID"] = (1, False, command_ttid)
517 commands_db["GOD_FAVOR"] = (1, False, setter(None, "GOD_FAVOR", -32768, 32767))
518 commands_db["TT_STORAGE"] = (1, False, setter("ThingType", "TT_STORAGE", 0, 255))
519 commands_db["T_PLAYERDROP"] = (1, False, setter("Thing", "T_PLAYERDROP", 0, 1))
520 commands_db["WORLD_ACTIVE"] = (1, False, command_worldactive)
521 commands_db["FAVOR_STAGE"] = (1, False, setter(None, "FAVOR_STAGE", 0, 1))
522 commands_db["SLIPPERS"] = (1, False, command_slippers)
523 commands_db["PLANT_0"] = (1, False, command_plant0)
524 commands_db["use"] = (1, False, play_use)
525
526 import server.config.misc
527 server.config.misc.make_map_func = make_map
528 server.config.misc.thingproliferation_func = thingproliferation
529 server.config.misc.make_world = make_world
530 server.config.decrement_lifepoints_func = decrement_lifepoints