1 | |
|
|
2 | /* |
|
|
3 | * static char *rcsid_attack_c = |
|
|
4 | * "$Id: attack.C,v 1.15 2006/09/14 20:46:10 root Exp $"; |
|
|
5 | */ |
|
|
6 | |
|
|
7 | /* |
1 | /* |
8 | CrossFire, A Multiplayer game for X-windows |
2 | CrossFire, A Multiplayer game for X-windows |
9 | |
3 | |
10 | Copyright (C) 2002 Mark Wedel & Crossfire Development Team |
4 | Copyright (C) 2002 Mark Wedel & Crossfire Development Team |
11 | Copyright (C) 1992 Frank Tore Johansen |
5 | Copyright (C) 1992 Frank Tore Johansen |
… | |
… | |
22 | |
16 | |
23 | You should have received a copy of the GNU General Public License |
17 | You should have received a copy of the GNU General Public License |
24 | along with this program; if not, write to the Free Software |
18 | along with this program; if not, write to the Free Software |
25 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
19 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
26 | |
20 | |
27 | The authors can be reached via e-mail to crossfire-devel@real-time.com |
21 | The authors can be reached via e-mail to <crossfire@schmorp.de> |
28 | */ |
22 | */ |
29 | #include <assert.h> |
23 | #include <assert.h> |
30 | #include <global.h> |
24 | #include <global.h> |
31 | #include <living.h> |
25 | #include <living.h> |
32 | #include <material.h> |
26 | #include <material.h> |
… | |
… | |
247 | |
241 | |
248 | /* The value of 50 is arbitrary. */ |
242 | /* The value of 50 is arbitrary. */ |
249 | if (type & AT_COLD && (op->resist[ATNR_COLD] < 50) && !QUERY_FLAG (op, FLAG_NO_PICK) && (RANDOM () & 2)) |
243 | if (type & AT_COLD && (op->resist[ATNR_COLD] < 50) && !QUERY_FLAG (op, FLAG_NO_PICK) && (RANDOM () & 2)) |
250 | { |
244 | { |
251 | object *tmp; |
245 | object *tmp; |
252 | archetype *at = find_archetype ("icecube"); |
246 | archetype *at = archetype::find ("icecube"); |
253 | |
247 | |
254 | if (at == NULL) |
248 | if (at == NULL) |
255 | return; |
249 | return; |
256 | |
250 | |
257 | op = stop_item (op); |
251 | op = stop_item (op); |
… | |
… | |
2066 | |
2060 | |
2067 | |
2061 | |
2068 | void |
2062 | void |
2069 | poison_player (object *op, object *hitter, int dam) |
2063 | poison_player (object *op, object *hitter, int dam) |
2070 | { |
2064 | { |
2071 | archetype *at = find_archetype ("poisoning"); |
2065 | archetype *at = archetype::find ("poisoning"); |
2072 | object *tmp = present_arch_in_ob (at, op); |
2066 | object *tmp = present_arch_in_ob (at, op); |
2073 | |
2067 | |
2074 | if (tmp == NULL) |
2068 | if (tmp == NULL) |
2075 | { |
2069 | { |
2076 | if ((tmp = arch_to_object (at)) == NULL) |
2070 | if ((tmp = arch_to_object (at)) == NULL) |
… | |
… | |
2122 | } |
2116 | } |
2123 | |
2117 | |
2124 | void |
2118 | void |
2125 | slow_player (object *op, object *hitter, int dam) |
2119 | slow_player (object *op, object *hitter, int dam) |
2126 | { |
2120 | { |
2127 | archetype *at = find_archetype ("slowness"); |
2121 | archetype *at = archetype::find ("slowness"); |
2128 | object *tmp; |
2122 | object *tmp; |
2129 | |
2123 | |
2130 | if (at == NULL) |
2124 | if (at == NULL) |
2131 | { |
2125 | { |
2132 | LOG (llevError, "Can't find slowness archetype.\n"); |
2126 | LOG (llevError, "Can't find slowness archetype.\n"); |