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

Comparing deliantra/server/server/monster.C (file contents):
Revision 1.73 by root, Fri Nov 6 12:49:19 2009 UTC vs.
Revision 1.74 by root, Fri Nov 6 13:03:34 2009 UTC

272 } 272 }
273 273
274 return 0; 274 return 0;
275} 275}
276 276
277int 277static int
278move_randomly (object *op) 278move_randomly (object *op)
279{ 279{
280 /* Give up to 15 chances for a monster to move randomly */ 280 /* Give up to 15 chances for a monster to move randomly */
281 for (int i = 0; i < 15; i++) 281 for (int i = 0; i < 15; i++)
282 if (move_object (op, rndm (8) + 1)) 282 if (move_object (op, rndm (8) + 1))
873/* Returns a randomly selected spell. This logic is still 873/* Returns a randomly selected spell. This logic is still
874 * less than ideal. This code also only seems to deal with 874 * less than ideal. This code also only seems to deal with
875 * wizard spells, as the check is against sp, and not grace. 875 * wizard spells, as the check is against sp, and not grace.
876 * can mosnters know cleric spells? 876 * can mosnters know cleric spells?
877 */ 877 */
878object * 878static object *
879monster_choose_random_spell (object *monster) 879monster_choose_random_spell (object *monster)
880{ 880{
881 object *altern[MAX_KNOWN_SPELLS]; 881 object *altern[MAX_KNOWN_SPELLS];
882 int i = 0; 882 int i = 0;
883 883
906 * part is the part of the monster we are checking against. 906 * part is the part of the monster we are checking against.
907 * pl is the target. 907 * pl is the target.
908 * dir is the direction to case. 908 * dir is the direction to case.
909 * rv is the vector which describes where the enemy is. 909 * rv is the vector which describes where the enemy is.
910 */ 910 */
911int 911static int
912monster_cast_spell (object *head, object *part, object *pl, int dir, rv_vector * rv) 912monster_cast_spell (object *head, object *part, object *pl, int dir, rv_vector * rv)
913{ 913{
914 object *spell_item; 914 object *spell_item;
915 object *owner; 915 object *owner;
916 rv_vector rv1; 916 rv_vector rv1;
982 head->spellitem = NULL; 982 head->spellitem = NULL;
983 983
984 return cast_spell (part, part, dir, spell_item, NULL); 984 return cast_spell (part, part, dir, spell_item, NULL);
985} 985}
986 986
987int 987static int
988monster_use_scroll (object *head, object *part, object *pl, int dir, rv_vector * rv) 988monster_use_scroll (object *head, object *part, object *pl, int dir, rv_vector * rv)
989{ 989{
990 object *scroll; 990 object *scroll;
991 object *owner; 991 object *owner;
992 rv_vector rv1; 992 rv_vector rv1;
1040 * The skills we are treating here are all but those. -b.t. 1040 * The skills we are treating here are all but those. -b.t.
1041 * 1041 *
1042 * At the moment this is only useful for throwing, perhaps for 1042 * At the moment this is only useful for throwing, perhaps for
1043 * stealing. TODO: This should be more integrated in the game. -MT, 25.11.01 1043 * stealing. TODO: This should be more integrated in the game. -MT, 25.11.01
1044 */ 1044 */
1045int 1045static int
1046monster_use_skill (object *head, object *part, object *pl, int dir) 1046monster_use_skill (object *head, object *part, object *pl, int dir)
1047{ 1047{
1048 object *skill, *owner; 1048 object *skill, *owner;
1049 1049
1050 if (!(dir = path_to_player (part, pl, 0))) 1050 if (!(dir = path_to_player (part, pl, 0)))
1083 /* use skill */ 1083 /* use skill */
1084 return do_skill (head, part, head->chosen_skill, dir, NULL); 1084 return do_skill (head, part, head->chosen_skill, dir, NULL);
1085} 1085}
1086 1086
1087/* Monster will use a ranged spell attack. */ 1087/* Monster will use a ranged spell attack. */
1088int 1088static int
1089monster_use_range (object *head, object *part, object *pl, int dir) 1089monster_use_range (object *head, object *part, object *pl, int dir)
1090{ 1090{
1091 object *wand, *owner; 1091 object *wand, *owner;
1092 int at_least_one = 0; 1092 int at_least_one = 0;
1093 1093
1153 LOG (llevError, "Error: Monster %s (%d) HAS_READY_RANGE() without wand/horn/rod.\n", &head->name, head->count); 1153 LOG (llevError, "Error: Monster %s (%d) HAS_READY_RANGE() without wand/horn/rod.\n", &head->name, head->count);
1154 CLEAR_FLAG (head, FLAG_READY_RANGE); 1154 CLEAR_FLAG (head, FLAG_READY_RANGE);
1155 return 0; 1155 return 0;
1156} 1156}
1157 1157
1158int 1158static int
1159monster_use_bow (object *head, object *part, object *pl, int dir) 1159monster_use_bow (object *head, object *part, object *pl, int dir)
1160{ 1160{
1161 object *owner; 1161 object *owner;
1162 1162
1163 if (!(dir = path_to_player (part, pl, 0))) 1163 if (!(dir = path_to_player (part, pl, 0)))

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines