1 | /* |
1 | /* |
2 | * CrossFire, A Multiplayer game for X-windows |
2 | * CrossFire, A Multiplayer game |
3 | * |
3 | * |
4 | * Copyright (C) 2005, 2006, 2007 Marc Lehmann & Crossfire+ Development Team |
4 | * Copyright (C) 2005, 2006, 2007 Marc Lehmann & Crossfire+ Development Team |
5 | * Copyright (C) 2002 Mark Wedel & Crossfire Development Team |
5 | * Copyright (C) 2002 Mark Wedel & Crossfire Development Team |
6 | * Copyright (C) 1992 Frank Tore Johansen |
6 | * Copyright (C) 1992 Frank Tore Johansen |
7 | * |
7 | * |
… | |
… | |
230 | * start with equipment, but only their abilities). |
230 | * start with equipment, but only their abilities). |
231 | */ |
231 | */ |
232 | static void |
232 | static void |
233 | put_treasure (object *op, object *creator, int flags) |
233 | put_treasure (object *op, object *creator, int flags) |
234 | { |
234 | { |
|
|
235 | if (flags & GT_ENVIRONMENT) |
|
|
236 | { |
235 | /* Bit of a hack - spells should never be put onto the map. The entire |
237 | /* Bit of a hack - spells should never be put onto the map. The entire |
236 | * treasure stuff is a problem - there is no clear idea of knowing |
238 | * treasure stuff is a problem - there is no clear idea of knowing |
237 | * this is the original object, or if this is an object that should be created |
239 | * this is the original object, or if this is an object that should be created |
238 | * by another object. |
240 | * by another object. |
239 | */ |
241 | */ |
240 | if (flags & GT_ENVIRONMENT && op->type != SPELL) |
242 | //TODO: flag such as objects... as such (no drop, anybody?) |
241 | { |
243 | if (op->type == SPELL) |
|
|
244 | { |
|
|
245 | op->destroy (); |
|
|
246 | return; |
|
|
247 | } |
|
|
248 | |
|
|
249 | op->expand_tail (); |
|
|
250 | |
242 | if (ob_blocked (op, creator->map, creator->x, creator->y)) |
251 | if (ob_blocked (op, creator->map, creator->x, creator->y)) |
243 | op->destroy (); |
252 | op->destroy (); |
244 | else |
253 | else |
245 | { |
254 | { |
246 | SET_FLAG (op, FLAG_OBJ_ORIGINAL); |
255 | SET_FLAG (op, FLAG_OBJ_ORIGINAL); |
… | |
… | |
1570 | if (change->msg) |
1579 | if (change->msg) |
1571 | op->msg = change->msg; |
1580 | op->msg = change->msg; |
1572 | } |
1581 | } |
1573 | |
1582 | |
1574 | static int |
1583 | static int |
1575 | legal_artifact_combination (object *op, artifact * art) |
1584 | legal_artifact_combination (object *op, artifact *art) |
1576 | { |
1585 | { |
1577 | int neg, success = 0; |
1586 | int neg, success = 0; |
1578 | linked_char *tmp; |
1587 | linked_char *tmp; |
1579 | const char *name; |
1588 | const char *name; |
1580 | |
1589 | |
1581 | if (art->allowed == (linked_char *) NULL) |
1590 | if (!art->allowed) |
1582 | return 1; /* Ie, "all" */ |
1591 | return 1; /* Ie, "all" */ |
|
|
1592 | |
1583 | for (tmp = art->allowed; tmp; tmp = tmp->next) |
1593 | for (tmp = art->allowed; tmp; tmp = tmp->next) |
1584 | { |
1594 | { |
1585 | #ifdef TREASURE_VERBOSE |
1595 | #ifdef TREASURE_VERBOSE |
1586 | LOG (llevDebug, "legal_art: %s\n", &tmp->name); |
1596 | LOG (llevDebug, "legal_art: %s\n", &tmp->name); |
1587 | #endif |
1597 | #endif |
… | |
… | |
1598 | * everything is allowed except what we match |
1608 | * everything is allowed except what we match |
1599 | */ |
1609 | */ |
1600 | else if (neg) |
1610 | else if (neg) |
1601 | success = 1; |
1611 | success = 1; |
1602 | } |
1612 | } |
|
|
1613 | |
1603 | return success; |
1614 | return success; |
1604 | } |
1615 | } |
1605 | |
1616 | |
1606 | /* |
1617 | /* |
1607 | * Fixes the given object, giving it the abilities and titles |
1618 | * Fixes the given object, giving it the abilities and titles |