1 | /* |
1 | /* |
2 | * This file is part of Deliantra, the Roguelike Realtime MMORPG. |
2 | * This file is part of Deliantra, the Roguelike Realtime MMORPG. |
3 | * |
3 | * |
4 | * Copyright (©) 2005,2006,2007,2008,2009,2010 Marc Alexander Lehmann / Robin Redeker / the Deliantra team |
4 | * Copyright (©) 2005,2006,2007,2008,2009,2010,2011 Marc Alexander Lehmann / Robin Redeker / the Deliantra team |
5 | * Copyright (©) 2001 Mark Wedel & Crossfire Development Team |
5 | * Copyright (©) 2001 Mark Wedel & Crossfire Development Team |
6 | * Copyright (©) 1992 Frank Tore Johansen |
6 | * Copyright (©) 1992 Frank Tore Johansen |
7 | * |
7 | * |
8 | * Deliantra is free software: you can redistribute it and/or modify it under |
8 | * Deliantra is free software: you can redistribute it and/or modify it under |
9 | * the terms of the Affero GNU General Public License as published by the |
9 | * the terms of the Affero GNU General Public License as published by the |
… | |
… | |
174 | { |
174 | { |
175 | new_draw_info (NDI_UNIQUE, 0, pl, "Could not create more groups."); |
175 | new_draw_info (NDI_UNIQUE, 0, pl, "Could not create more groups."); |
176 | return shstr_tmp (); |
176 | return shstr_tmp (); |
177 | } |
177 | } |
178 | |
178 | |
179 | force = get_archetype (FORCE_NAME); |
179 | force = archetype::get (FORCE_NAME); |
180 | force->slaying = pl->map->path; |
180 | force->slaying = pl->map->path; |
181 | force->msg = rune->msg; |
181 | force->msg = rune->msg; |
182 | force->race = id; |
182 | force->race = id; |
183 | force->set_speed (0); |
183 | force->set_speed (0); |
184 | |
184 | |
… | |
… | |
222 | { |
222 | { |
223 | new_draw_info (NDI_UNIQUE, 0, pl, "You need to put a book or scroll with the message."); |
223 | new_draw_info (NDI_UNIQUE, 0, pl, "You need to put a book or scroll with the message."); |
224 | return -1; |
224 | return -1; |
225 | } |
225 | } |
226 | |
226 | |
|
|
227 | if (tmp->type == MAGIC_EAR) |
|
|
228 | { |
|
|
229 | snprintf (buf, sizeof (buf), "@match %s", &(book->msg)); |
|
|
230 | tmp->msg = buf; |
|
|
231 | } |
|
|
232 | else |
227 | tmp->msg = book->msg; |
233 | tmp->msg = book->msg; |
228 | |
234 | |
229 | if (tmp->invisible) |
235 | if (tmp->invisible) |
230 | { |
236 | { |
231 | if (book->custom_name) |
237 | if (book->custom_name) |
232 | snprintf (buf, sizeof (buf), "talking %s", &book->custom_name); |
238 | snprintf (buf, sizeof (buf), "talking %s", &book->custom_name); |
… | |
… | |
307 | if (x > 0 && get_wall (map, x - 1, y)) connect |= 1; |
313 | if (x > 0 && get_wall (map, x - 1, y)) connect |= 1; |
308 | if (x < map->width - 1 && get_wall (map, x + 1, y)) connect |= 2; |
314 | if (x < map->width - 1 && get_wall (map, x + 1, y)) connect |= 2; |
309 | if (y > 0 && get_wall (map, x, y - 1)) connect |= 4; |
315 | if (y > 0 && get_wall (map, x, y - 1)) connect |= 4; |
310 | if (y < map->height - 1 && get_wall (map, x, y + 1)) connect |= 8; |
316 | if (y < map->height - 1 && get_wall (map, x, y + 1)) connect |= 8; |
311 | |
317 | |
312 | // one bit per dir, 1 left, 2 right, 4 up, 8 down |
|
|
313 | static const char *walltype[16] = { |
|
|
314 | "0", |
|
|
315 | "1_3", |
|
|
316 | "1_4", |
|
|
317 | "2_1_2", |
|
|
318 | "1_2", |
|
|
319 | "2_2_4", |
|
|
320 | "2_2_1", |
|
|
321 | "3_1", |
|
|
322 | "1_1", |
|
|
323 | "2_2_3", |
|
|
324 | "2_2_2", |
|
|
325 | "3_3", |
|
|
326 | "2_1_1", |
|
|
327 | "3_4", |
|
|
328 | "3_2", |
|
|
329 | "4" |
|
|
330 | }; |
|
|
331 | |
|
|
332 | strcat (archetype, walltype [connect]); |
318 | strcat (archetype, wall_suffix [connect]); |
333 | |
319 | |
334 | /* |
320 | /* |
335 | * Before anything, make sure the archetype does exist... |
321 | * Before anything, make sure the archetype does exist... |
336 | * If not, prolly an error... |
322 | * If not, prolly an error... |
337 | */ |
323 | */ |