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.79 by root, Sat Nov 7 18:30:06 2009 UTC vs.
Revision 1.86 by root, Sat Apr 3 22:30:21 2010 UTC

1/* 1/*
2 * This file is part of Deliantra, the Roguelike Realtime MMORPG. 2 * This file is part of Deliantra, the Roguelike Realtime MMORPG.
3 * 3 *
4 * Copyright (©) 2005,2006,2007,2008,2009 Marc Alexander Lehmann / Robin Redeker / the Deliantra team 4 * Copyright (©) 2005,2006,2007,2008,2009,2010 Marc Alexander Lehmann / Robin Redeker / the Deliantra team
5 * Copyright (©) 2002,2007 Mark Wedel & Crossfire Development Team 5 * Copyright (©) 2002 Mark Wedel & Crossfire Development Team
6 * Copyright (©) 1992,2007 Frank Tore Johansen 6 * Copyright (©) 1992 Frank Tore Johansen
7 * 7 *
8 * Deliantra is free software: you can redistribute it and/or modify it under 8 * Deliantra is free software: you can redistribute it and/or modify it under
9 * the terms of the Affero GNU General Public License as published by the 9 * the terms of the Affero GNU General Public License as published by the
10 * Free Software Foundation, either version 3 of the License, or (at your 10 * Free Software Foundation, either version 3 of the License, or (at your
11 * option) any later version. 11 * option) any later version.
59/* init_skills basically just sets up the skill_names table 59/* init_skills basically just sets up the skill_names table
60 * above. The index into the array is set up by the 60 * above. The index into the array is set up by the
61 * subtypes. 61 * subtypes.
62 */ 62 */
63void 63void
64init_skills (void) 64init_skills ()
65{ 65{
66 for_all_archetypes (at) 66 for_all_archetypes (at)
67 if (at->type == SKILL) 67 if (at->type == SKILL)
68 { 68 {
69 if (skill_names[at->subtype]) 69 if (skill_names[at->subtype])
168 168
169 if (!skill) 169 if (!skill)
170 skill = give_skill_by_name (who, skill_tool->skill); 170 skill = give_skill_by_name (who, skill_tool->skill);
171 171
172 if (!skill_tool->flag [FLAG_APPLIED]) 172 if (!skill_tool->flag [FLAG_APPLIED])
173 if (apply_special (who, splay (skill_tool), AP_APPLY | AP_NO_READY)) 173 if (apply_special (who, splay (skill_tool), AP_APPLY))
174 return 0; 174 return 0;
175 175
176 return splay (skill); 176 return splay (skill);
177} 177}
178 178
462 case SK_EVOCATION: 462 case SK_EVOCATION:
463 case SK_PYROMANCY: 463 case SK_PYROMANCY:
464 case SK_SUMMONING: 464 case SK_SUMMONING:
465 case SK_CLIMBING: 465 case SK_CLIMBING:
466 new_draw_info (NDI_UNIQUE, 0, op, "This skill is already in effect."); 466 new_draw_info (NDI_UNIQUE, 0, op, "This skill is already in effect.");
467 break;
468
469 case SK_MINING:
470 success = skill_mining (op, part, skill, dir, string);
471 break;
472
473 case SK_FISHING:
474 success = skill_fishing (op, part, skill, dir, string);
467 break; 475 break;
468 476
469 default: 477 default:
470 LOG (llevDebug, "%s attempted to use unknown skill: %d\n", query_name (op), op->chosen_skill->stats.sp); 478 LOG (llevDebug, "%s attempted to use unknown skill: %d\n", query_name (op), op->chosen_skill->stats.sp);
471 break; 479 break;
808} 816}
809 817
810static bool 818static bool
811hth_skill_p (object *skill) 819hth_skill_p (object *skill)
812{ 820{
813 return (skill_flags [skill->subtype] & (SF_COMBAT | SF_NEED_WEAPON)) == SF_COMBAT; 821 return (skill_flags [skill->subtype] & (SF_COMBAT | SF_NEED_ITEM)) == SF_COMBAT;
814} 822}
815 823
816/* This finds the first unarmed skill the player has, and returns it. 824/* This finds the first unarmed skill the player has, and returns it.
817 */ 825 */
818static object * 826static object *
879 887
880 if (!skill) 888 if (!skill)
881 new_draw_info (NDI_BLACK, 0, op, "You have no unarmed combat skills!"); 889 new_draw_info (NDI_BLACK, 0, op, "You have no unarmed combat skills!");
882 } 890 }
883 891
884 if (skill) 892 op->apply (skill);
885 {
886 op->change_skill (0);
887 apply_special (op, skill, AP_APPLY);
888 }
889 } 893 }
890 894
891 if (!pl->combat_ob) 895 if (!pl->combat_ob)
892 { 896 {
893 LOG (llevError, "Could not find anything to attack on %s\n", &op->name); 897 LOG (llevError, "Could not find anything to attack on %s\n", &op->name);
894 return 0; 898 return 0;
895 } 899 }
896 } 900 }
897 901
898 if (!op->change_weapon (pl->combat_ob)) 902 if (!op->apply (pl->combat_ob))
899 return 0; 903 return 0;
900 } 904 }
901 905
902 /* lose invisiblity/hiding status for running attacks */ 906 /* lose invisiblity/hiding status for running attacks */
903 if (pl->tmp_invis) 907 if (pl->tmp_invis)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines