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.14 by root, Sun Dec 3 20:26:35 2006 UTC vs.
Revision 1.15 by root, Mon Dec 4 20:39:32 2006 UTC

874 return 1; 874 return 1;
875 875
876 return 0; 876 return 0;
877} 877}
878 878
879
880
881/* This finds the best unarmed skill the player has, and returns 879/* This finds the best unarmed skill the player has, and returns
882 * it. Best can vary a little - we consider clawing to always 880 * it. Best can vary a little - we consider clawing to always
883 * be the best for dragons. 881 * be the best for dragons.
884 * This could be more intelligent, eg, look at the skill level 882 * This could be more intelligent, eg, look at the skill level
885 * of the skill and go from there (eg, a level 40 puncher is 883 * of the skill and go from there (eg, a level 40 puncher is
907 905
908 /* The order in the array is preferred order. So basically, 906 /* The order in the array is preferred order. So basically,
909 * we just cut down the number to search - eg, if we find a skill 907 * we just cut down the number to search - eg, if we find a skill
910 * early on in flame touch, then we only need to look into the unarmed_array 908 * early on in flame touch, then we only need to look into the unarmed_array
911 * to the entry before flame touch - don't care about the entries afterward, 909 * to the entry before flame touch - don't care about the entries afterward,
912 * because they are infrerior skills. 910 * because they are inferior skills.
913 * if we end up finding the best skill (i==0) might as well return
914 * right away - can't get any better than that.
915 */ 911 */
916 for (i = 0; i < last_skill; i++) 912 for (i = 0; i < last_skill; i++)
917 {
918 if (tmp->subtype == unarmed_skills[i] && QUERY_FLAG (tmp, FLAG_CAN_USE_SKILL)) 913 if (tmp->subtype == unarmed_skills[i] && QUERY_FLAG (tmp, FLAG_CAN_USE_SKILL))
919 { 914 {
920 best_skill = tmp; 915 best_skill = tmp;
921 last_skill = i; 916 last_skill = i;
922 if (i == 0)
923 return best_skill;
924 } 917 }
925 } 918 }
926 }
927 } 919 }
920
928 return best_skill; 921 return best_skill;
929} 922}
930 923
931/* do_skill_attack() - We have got an appropriate opponent from either 924/* do_skill_attack() - We have got an appropriate opponent from either
932 * move_player_attack() or skill_attack(). In this part we get on with 925 * move_player_attack() or skill_attack(). In this part we get on with

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines