1 | /* |
1 | /* |
2 | * static char *rcsid_skill_util_c = |
2 | * static char *rcsid_skill_util_c = |
3 | * "$Id: skill_util.c,v 1.3 2006/04/30 12:07:48 pippijn Exp $"; |
3 | * "$Id: skill_util.c,v 1.4 2006/05/01 12:33:06 pippijn Exp $"; |
4 | */ |
4 | */ |
5 | /* |
5 | /* |
6 | CrossFire, A Multiplayer game for X-windows |
6 | CrossFire, A Multiplayer game for X-windows |
7 | |
7 | |
8 | Copryight (C) 2002 Mark Wedel & Crossfire Development Team |
8 | Copryight (C) 2002 Mark Wedel & Crossfire Development Team |
… | |
… | |
49 | #ifndef __CEXTRACT__ |
49 | #ifndef __CEXTRACT__ |
50 | #include <sproto.h> |
50 | #include <sproto.h> |
51 | #endif |
51 | #endif |
52 | #include <living.h> /* for defs of STR,CON,DEX,etc. -b.t.*/ |
52 | #include <living.h> /* for defs of STR,CON,DEX,etc. -b.t.*/ |
53 | #include <spells.h> |
53 | #include <spells.h> |
|
|
54 | |
|
|
55 | static int attack_hth(object *pl, int dir, const char *string, object *skill); |
|
|
56 | static int attack_melee_weapon(object *op, int dir, const char *string, object *skill); |
54 | |
57 | |
55 | const char *skill_names[NUM_SKILLS]; |
58 | const char *skill_names[NUM_SKILLS]; |
56 | |
59 | |
57 | /* init_skills basically just sets up the skill_names table |
60 | /* init_skills basically just sets up the skill_names table |
58 | * above. The index into the array is set up by the |
61 | * above. The index into the array is set up by the |
… | |
… | |
359 | |
362 | |
360 | case SK_FLAME_TOUCH: |
363 | case SK_FLAME_TOUCH: |
361 | (void) attack_hth(op,dir,"flamed", skill); |
364 | (void) attack_hth(op,dir,"flamed", skill); |
362 | break; |
365 | break; |
363 | |
366 | |
364 | case SK_SPARK_TOUCH: |
367 | case SK_SPARK: |
365 | (void) attack_hth(op,dir,"zapped", skill); |
368 | (void) attack_hth(op,dir,"zapped", skill); |
366 | break; |
369 | break; |
367 | |
370 | |
368 | case SK_FROST_TOUCH: |
371 | case SK_SHIVER: |
369 | (void) attack_hth(op,dir,"froze", skill); |
372 | (void) attack_hth(op,dir,"froze", skill); |
370 | break; |
373 | break; |
371 | |
374 | |
372 | case SK_ACID_TOUCH: |
375 | case SK_ACID_SPLASH: |
373 | (void) attack_hth(op,dir,"dissolved", skill); |
376 | (void) attack_hth(op,dir,"dissolved", skill); |
374 | break; |
377 | break; |
375 | |
378 | |
376 | case SK_POISON_TOUCH: |
379 | case SK_POISON_NAIL: |
377 | (void) attack_hth(op,dir,"splashed with poison,", skill); |
380 | (void) attack_hth(op,dir,"injected poison into", skill); |
378 | break; |
381 | break; |
379 | |
382 | |
380 | case SK_CLAWING: |
383 | case SK_CLAWING: |
381 | (void) attack_hth(op,dir,"clawed", skill); |
384 | (void) attack_hth(op,dir,"clawed", skill); |
382 | break; |
385 | break; |
… | |
… | |
1006 | /* July 5, 1995 - I broke up attack_hth() into 2 parts. In the first |
1009 | /* July 5, 1995 - I broke up attack_hth() into 2 parts. In the first |
1007 | * (attack_hth) we check for weapon use, etc in the second (the new |
1010 | * (attack_hth) we check for weapon use, etc in the second (the new |
1008 | * function skill_attack() we actually attack. |
1011 | * function skill_attack() we actually attack. |
1009 | */ |
1012 | */ |
1010 | |
1013 | |
1011 | int attack_hth(object *pl, int dir, const char *string, object *skill) { |
1014 | static int attack_hth(object *pl, int dir, const char *string, object *skill) { |
1012 | object *enemy=NULL,*weapon; |
1015 | object *enemy=NULL,*weapon; |
1013 | |
1016 | |
1014 | if(QUERY_FLAG(pl, FLAG_READY_WEAPON)) |
1017 | if(QUERY_FLAG(pl, FLAG_READY_WEAPON)) |
1015 | for(weapon=pl->inv;weapon;weapon=weapon->below) { |
1018 | for(weapon=pl->inv;weapon;weapon=weapon->below) { |
1016 | if (weapon->type==WEAPON && QUERY_FLAG(weapon, FLAG_APPLIED)) { |
1019 | if (weapon->type==WEAPON && QUERY_FLAG(weapon, FLAG_APPLIED)) { |
… | |
… | |
1036 | * we may make this routine handle 'special' melee weapons attacks |
1039 | * we may make this routine handle 'special' melee weapons attacks |
1037 | * (like disarming manuever with sai) based on player SK_level and |
1040 | * (like disarming manuever with sai) based on player SK_level and |
1038 | * weapon type. |
1041 | * weapon type. |
1039 | */ |
1042 | */ |
1040 | |
1043 | |
1041 | int attack_melee_weapon(object *op, int dir, const char *string, object *skill) { |
1044 | static int attack_melee_weapon(object *op, int dir, const char *string, object *skill) { |
1042 | |
1045 | |
1043 | if(!QUERY_FLAG(op, FLAG_READY_WEAPON)) { |
1046 | if(!QUERY_FLAG(op, FLAG_READY_WEAPON)) { |
1044 | if(op->type==PLAYER) |
1047 | if(op->type==PLAYER) |
1045 | new_draw_info(NDI_UNIQUE, 0,op,"You have no ready weapon to attack with!"); |
1048 | new_draw_info(NDI_UNIQUE, 0,op,"You have no ready weapon to attack with!"); |
1046 | return 0; |
1049 | return 0; |