ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/server/skill_util.C
(Generate patch)

Comparing deliantra/server/server/skill_util.C (file contents):
Revision 1.29 by root, Wed Mar 14 04:12:29 2007 UTC vs.
Revision 1.30 by root, Sun Apr 29 03:44:36 2007 UTC

403 success = 1; 403 success = 1;
404 break; 404 break;
405 /* note that the following 'attack' skills gain exp through hit_player() */ 405 /* note that the following 'attack' skills gain exp through hit_player() */
406 406
407 case SK_KARATE: 407 case SK_KARATE:
408 (void) attack_hth (op, dir, "karate-chopped", skill); 408 attack_hth (op, dir, "karate-chopped", skill);
409 break; 409 break;
410 410
411 case SK_PUNCHING: 411 case SK_PUNCHING:
412 (void) attack_hth (op, dir, "punched", skill); 412 attack_hth (op, dir, "punched", skill);
413 break; 413 break;
414 414
415 case SK_FLAME_TOUCH: 415 case SK_FLAME_TOUCH:
416 (void) attack_hth (op, dir, "flamed", skill); 416 attack_hth (op, dir, "flamed", skill);
417 break; 417 break;
418 418
419 case SK_SPARK_TOUCH: 419 case SK_SPARK_TOUCH:
420 (void) attack_hth (op, dir, "zapped", skill); 420 attack_hth (op, dir, "zapped", skill);
421 break; 421 break;
422 422
423 case SK_SHIVER: 423 case SK_SHIVER:
424 (void) attack_hth (op, dir, "froze", skill); 424 attack_hth (op, dir, "froze", skill);
425 break; 425 break;
426 426
427 case SK_ACID_SPLASH: 427 case SK_ACID_SPLASH:
428 (void) attack_hth (op, dir, "dissolved", skill); 428 attack_hth (op, dir, "dissolved", skill);
429 break; 429 break;
430 430
431 case SK_POISON_NAIL: 431 case SK_POISON_NAIL:
432 (void) attack_hth (op, dir, "injected poison into", skill); 432 attack_hth (op, dir, "injected poison into", skill);
433 break; 433 break;
434 434
435 case SK_CLAWING: 435 case SK_CLAWING:
436 (void) attack_hth (op, dir, "clawed", skill); 436 attack_hth (op, dir, "clawed", skill);
437 break; 437 break;
438 438
439 case SK_ONE_HANDED_WEAPON: 439 case SK_ONE_HANDED_WEAPON:
440 case SK_TWO_HANDED_WEAPON: 440 case SK_TWO_HANDED_WEAPON:
441 (void) attack_melee_weapon (op, dir, NULL, skill); 441 attack_melee_weapon (op, dir, NULL, skill);
442 break; 442 break;
443 443
444 case SK_FIND_TRAPS: 444 case SK_FIND_TRAPS:
445 exp = success = find_traps (op, skill); 445 exp = success = find_traps (op, skill);
446 break; 446 break;
904 * tmp is the targetted monster. 904 * tmp is the targetted monster.
905 * op is what is attacking 905 * op is what is attacking
906 * string is passed along to describe what messages to describe 906 * string is passed along to describe what messages to describe
907 * the damage. 907 * the damage.
908 */ 908 */
909
910static int 909static int
911do_skill_attack (object *tmp, object *op, const char *string, object *skill) 910do_skill_attack (object *tmp, object *op, const char *string, object *skill)
912{ 911{
913 int success; 912 int success;
914 913
1001 if (op->type == PLAYER) 1000 if (op->type == PLAYER)
1002 new_draw_info_format (NDI_UNIQUE, 0, op, "You %s %s!", string, query_name (tmp)); 1001 new_draw_info_format (NDI_UNIQUE, 0, op, "You %s %s!", string, query_name (tmp));
1003 else if (tmp->type == PLAYER) 1002 else if (tmp->type == PLAYER)
1004 new_draw_info_format (NDI_UNIQUE, 0, tmp, "%s %s you!", query_name (op), string); 1003 new_draw_info_format (NDI_UNIQUE, 0, tmp, "%s %s you!", query_name (op), string);
1005 } 1004 }
1005
1006 return success; 1006 return success;
1007} 1007}
1008
1009 1008
1010/* skill_attack() - Core routine for use when we attack using a skills 1009/* skill_attack() - Core routine for use when we attack using a skills
1011 * system. In essence, this code handles 1010 * system. In essence, this code handles
1012 * all skill-based attacks, ie hth, missile and melee weapons should be 1011 * all skill-based attacks, ie hth, missile and melee weapons should be
1013 * treated here. If an opponent is already supplied by move_player(), 1012 * treated here. If an opponent is already supplied by move_player(),
1016 * 1015 *
1017 * This is called by move_player() and attack_hth() 1016 * This is called by move_player() and attack_hth()
1018 * 1017 *
1019 * Initial implementation by -bt thomas@astro.psu.edu 1018 * Initial implementation by -bt thomas@astro.psu.edu
1020 */ 1019 */
1021
1022int 1020int
1023skill_attack (object *tmp, object *pl, int dir, const char *string, object *skill) 1021skill_attack (object *tmp, object *pl, int dir, const char *string, object *skill)
1024{ 1022{
1025 sint16 tx, ty; 1023 sint16 tx, ty;
1026 maptile *m; 1024 maptile *m;
1096 esrv_update_item (UPD_FLAGS, pl, weapon); 1094 esrv_update_item (UPD_FLAGS, pl, weapon);
1097 } 1095 }
1098 break; 1096 break;
1099 } 1097 }
1100 } 1098 }
1099
1101 return skill_attack (enemy, pl, dir, string, skill); 1100 return skill_attack (enemy, pl, dir, string, skill);
1102} 1101}
1103
1104 1102
1105/* attack_melee_weapon() - this handles melee weapon attacks -b.t. 1103/* attack_melee_weapon() - this handles melee weapon attacks -b.t.
1106 * For now we are just checking to see if we have a ready weapon here. 1104 * For now we are just checking to see if we have a ready weapon here.
1107 * But there is a real neato possible feature of this scheme which 1105 * But there is a real neato possible feature of this scheme which
1108 * bears mentioning: 1106 * bears mentioning:
1109 * Since we are only calling this from do_skill() in the future 1107 * Since we are only calling this from do_skill() in the future
1110 * we may make this routine handle 'special' melee weapons attacks 1108 * we may make this routine handle 'special' melee weapons attacks
1111 * (like disarming manuever with sai) based on player SK_level and 1109 * (like disarming manuever with sai) based on player SK_level and
1112 * weapon type. 1110 * weapon type.
1113 */ 1111 */
1114
1115static int 1112static int
1116attack_melee_weapon (object *op, int dir, const char *string, object *skill) 1113attack_melee_weapon (object *op, int dir, const char *string, object *skill)
1117{ 1114{
1118 1115
1119 if (!QUERY_FLAG (op, FLAG_READY_WEAPON)) 1116 if (!QUERY_FLAG (op, FLAG_READY_WEAPON))
1120 { 1117 {
1121 if (op->type == PLAYER) 1118 if (op->type == PLAYER)
1122 new_draw_info (NDI_UNIQUE, 0, op, "You have no ready weapon to attack with!"); 1119 new_draw_info (NDI_UNIQUE, 0, op, "You have no ready weapon to attack with!");
1120
1123 return 0; 1121 return 0;
1124 } 1122 }
1123
1125 return skill_attack (NULL, op, dir, string, skill); 1124 return skill_attack (NULL, op, dir, string, skill);
1126 1125
1127} 1126}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines