… | |
… | |
52 | |
52 | |
53 | static object * |
53 | static object * |
54 | gen_key (const shstr &keycode) |
54 | gen_key (const shstr &keycode) |
55 | { |
55 | { |
56 | /* get a key and set its keycode */ |
56 | /* get a key and set its keycode */ |
57 | object *key = archetype::get (shstr_key2); |
57 | object *key = archetype::get (shstr_key_random_map); |
58 | |
|
|
59 | key->slaying = keycode; |
58 | key->slaying = keycode; |
60 | key->stats.food = 100; |
|
|
61 | key->speed_left = -1.f; |
|
|
62 | key->flag [FLAG_IS_USED_UP] = true; |
|
|
63 | key->set_speed (1.f / 300.f); |
|
|
64 | |
|
|
65 | return key; |
59 | return key; |
66 | } |
60 | } |
67 | |
61 | |
68 | /* places keys in the map, preferably in something alive. |
62 | /* places keys in the map, preferably in something alive. |
69 | keycode is the key's code, |
63 | keycode is the key's code, |
… | |
… | |
154 | the_key->destroy (); |
148 | the_key->destroy (); |
155 | return 1; |
149 | return 1; |
156 | } |
150 | } |
157 | } |
151 | } |
158 | |
152 | |
|
|
153 | LOG(llevError, "key %d,%d %p\n", the_keymaster ? the_keymaster->x : x, the_keymaster ? the_keymaster->y : y, the_keymaster+0);//D |
159 | if (the_keymaster) |
154 | if (the_keymaster) |
160 | the_keymaster->head_ ()->insert (the_key); |
155 | the_keymaster->head_ ()->insert (the_key); |
161 | else |
156 | else |
162 | { |
157 | { |
163 | the_key->x = kx; |
158 | the_key->x = kx; |
… | |
… | |
828 | |
823 | |
829 | if (opts & DOORED) |
824 | if (opts & DOORED) |
830 | { |
825 | { |
831 | for (i = 0, door = doorlist[0]; doorlist[i] != NULL; i++) |
826 | for (i = 0, door = doorlist[0]; doorlist[i] != NULL; i++) |
832 | { |
827 | { |
833 | object *new_door = get_archetype ("locked_door1"); |
828 | object *new_door = get_archetype (shstr_locked_door1); |
834 | |
829 | |
835 | door = doorlist[i]; |
830 | door = doorlist[i]; |
836 | new_door->face = door->face; |
831 | new_door->face = door->face; |
837 | new_door->x = door->x; |
832 | new_door->x = door->x; |
838 | new_door->y = door->y; |
833 | new_door->y = door->y; |