1 |
/* |
2 |
CrossFire, A Multiplayer game for X-windows |
3 |
|
4 |
Copyright (C) 2005, 2006, 2007 Marc Lehmann & Crossfire+ Development Team |
5 |
Copyright (C) 2002 Mark Wedel & Crossfire Development Team |
6 |
Copyright (C) 1992 Frank Tore Johansen |
7 |
|
8 |
This program is free software; you can redistribute it and/or modify |
9 |
it under the terms of the GNU General Public License as published by |
10 |
the Free Software Foundation; either version 2 of the License, or |
11 |
(at your option) any later version. |
12 |
|
13 |
This program is distributed in the hope that it will be useful, |
14 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 |
GNU General Public License for more details. |
17 |
|
18 |
You should have received a copy of the GNU General Public License |
19 |
along with this program; if not, write to the Free Software |
20 |
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
21 |
|
22 |
The authors can be reached via e-mail at <crossfire@schmorp.de> |
23 |
*/ |
24 |
|
25 |
#include <global.h> |
26 |
#include <funcpoint.h> |
27 |
|
28 |
/* Determine if the attacktype represented by the |
29 |
* specified attack-number is enabled for dragon players. |
30 |
* A dragon player (quetzal) can gain resistances for |
31 |
* all enabled attacktypes. |
32 |
*/ |
33 |
int |
34 |
atnr_is_dragon_enabled (int attacknr) |
35 |
{ |
36 |
if (attacknr == ATNR_MAGIC || attacknr == ATNR_FIRE || |
37 |
attacknr == ATNR_ELECTRICITY || attacknr == ATNR_COLD || attacknr == ATNR_ACID || attacknr == ATNR_POISON) |
38 |
return 1; |
39 |
|
40 |
return 0; |
41 |
} |
42 |
|
43 |
/* |
44 |
* returns true if the adressed object 'ob' is a player |
45 |
* of the dragon race. |
46 |
*/ |
47 |
int |
48 |
is_dragon_pl (const object *op) |
49 |
{ |
50 |
if (op != NULL && op->type == PLAYER && op->arch != NULL && op->arch->clone.race != NULL && strcmp (op->arch->clone.race, "dragon") == 0) |
51 |
return 1; |
52 |
return 0; |
53 |
} |