1 | |
|
|
2 | /* |
|
|
3 | * static char *rcsid_skill_util_c = |
|
|
4 | * "$Id: skill_util.C,v 1.10 2006/09/12 00:26:16 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 | Copryight (C) 2002 Mark Wedel & Crossfire Development Team |
4 | Copryight (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 author can be reached via e-mail to crossfire-devel@real-time.com |
21 | The author can be reached via e-mail to <crossfire@schmorp.de> |
28 | */ |
22 | */ |
29 | |
23 | |
30 | /* Created July 95 to separate skill utilities from actual skills -b.t. */ |
24 | /* Created July 95 to separate skill utilities from actual skills -b.t. */ |
31 | |
25 | |
32 | /* Reconfigured skills code to allow linking of skills to experience |
26 | /* Reconfigured skills code to allow linking of skills to experience |
… | |
… | |
42 | */ |
36 | */ |
43 | |
37 | |
44 | /* define the following for skills utility debuging */ |
38 | /* define the following for skills utility debuging */ |
45 | |
39 | |
46 | /* #define SKILL_UTIL_DEBUG */ |
40 | /* #define SKILL_UTIL_DEBUG */ |
47 | |
|
|
48 | #define WANT_UNARMED_SKILLS |
|
|
49 | |
41 | |
50 | #include <global.h> |
42 | #include <global.h> |
51 | #include <object.h> |
43 | #include <object.h> |
52 | #ifndef __CEXTRACT__ |
44 | #ifndef __CEXTRACT__ |
53 | # include <sproto.h> |
45 | # include <sproto.h> |
54 | #endif |
46 | #endif |
55 | #include <living.h> /* for defs of STR,CON,DEX,etc. -b.t. */ |
47 | #include <living.h> /* for defs of STR,CON,DEX,etc. -b.t. */ |
56 | #include <spells.h> |
48 | #include <spells.h> |
|
|
49 | |
|
|
50 | /* Table of unarmed attack skills. Terminated by -1. This |
|
|
51 | * is also the list that we should try to use skills when |
|
|
52 | * automatically applying one for the player. |
|
|
53 | * Note it is hardcoded in the skill_util.c that dragons always |
|
|
54 | * want clawing if possible. |
|
|
55 | */ |
|
|
56 | static uint8 unarmed_skills[] = { |
|
|
57 | SK_KARATE, |
|
|
58 | SK_CLAWING, |
|
|
59 | SK_FLAME_TOUCH, |
|
|
60 | SK_SPARK_TOUCH, |
|
|
61 | SK_SHIVER, |
|
|
62 | SK_ACID_SPLASH, |
|
|
63 | SK_POISON_NAIL, |
|
|
64 | SK_PUNCHING, |
|
|
65 | (uint8)-1 |
|
|
66 | }; |
57 | |
67 | |
58 | static int attack_hth (object *pl, int dir, const char *string, object *skill); |
68 | static int attack_hth (object *pl, int dir, const char *string, object *skill); |
59 | static int attack_melee_weapon (object *op, int dir, const char *string, object *skill); |
69 | static int attack_melee_weapon (object *op, int dir, const char *string, object *skill); |
60 | |
70 | |
61 | /* init_skills basically just sets up the skill_names table |
71 | /* init_skills basically just sets up the skill_names table |
… | |
… | |
1060 | |
1070 | |
1061 | int |
1071 | int |
1062 | skill_attack (object *tmp, object *pl, int dir, const char *string, object *skill) |
1072 | skill_attack (object *tmp, object *pl, int dir, const char *string, object *skill) |
1063 | { |
1073 | { |
1064 | sint16 tx, ty; |
1074 | sint16 tx, ty; |
1065 | mapstruct *m; |
1075 | maptile *m; |
1066 | int mflags; |
1076 | int mflags; |
1067 | |
1077 | |
1068 | if (!dir) |
1078 | if (!dir) |
1069 | dir = pl->facing; |
1079 | dir = pl->facing; |
1070 | tx = freearr_x[dir]; |
1080 | tx = freearr_x[dir]; |