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

Comparing deliantra/server/server/spell_attack.C (file contents):
Revision 1.9 by root, Sun Sep 10 15:59:57 2006 UTC vs.
Revision 1.12 by root, Thu Sep 14 21:16:13 2006 UTC

1 1
2/* 2/*
3 * static char *rcsid_spell_attack_c = 3 * static char *rcsid_spell_attack_c =
4 * "$Id: spell_attack.C,v 1.9 2006/09/10 15:59:57 root Exp $"; 4 * "$Id: spell_attack.C,v 1.12 2006/09/14 21:16:13 root Exp $";
5 */ 5 */
6 6
7 7
8/* 8/*
9 CrossFire, A Multiplayer game for X-windows 9 CrossFire, A Multiplayer game for X-windows
185 { 185 {
186 remove_ob (op); 186 remove_ob (op);
187 free_object (op); 187 free_object (op);
188 return; 188 return;
189 } 189 }
190
190 hit_map (op, 0, op->attacktype, 1); 191 hit_map (op, 0, op->attacktype, 1);
191 192
192 if (!op->direction) 193 if (!op->direction)
193 return; 194 return;
194 195
468 469
469 copy_owner (tmp, op); 470 copy_owner (tmp, op);
470 tmp->skill = op->skill; 471 tmp->skill = op->skill;
471 472
472 owner = get_owner (op); 473 owner = get_owner (op);
474
473 if ((tmp->attacktype & AT_HOLYWORD || tmp->attacktype & AT_GODPOWER) && owner && !tailor_god_spell (tmp, owner)) 475 if ((tmp->attacktype & AT_HOLYWORD || tmp->attacktype & AT_GODPOWER) && owner && !tailor_god_spell (tmp, owner))
474 { 476 {
475 remove_ob (op); 477 remove_ob (op);
476 free_object (op); 478 free_object (op);
477 return; 479 return;
478 } 480 }
481
479 tmp->x = op->x; 482 tmp->x = op->x;
480 tmp->y = op->y; 483 tmp->y = op->y;
481 484
482 /* special for bombs - it actually has sane values for these */ 485 /* special for bombs - it actually has sane values for these */
483 if (op->type == SPELL_EFFECT && op->subtype == SP_BOMB) 486 if (op->type == SPELL_EFFECT && op->subtype == SP_BOMB)
931 tmp->y = sy; 934 tmp->y = sy;
932 tmp->attacktype = spell->attacktype; 935 tmp->attacktype = spell->attacktype;
933 936
934 /* holy word stuff */ 937 /* holy word stuff */
935 if ((tmp->attacktype & AT_HOLYWORD) || (tmp->attacktype & AT_GODPOWER)) 938 if ((tmp->attacktype & AT_HOLYWORD) || (tmp->attacktype & AT_GODPOWER))
936 {
937 if (!tailor_god_spell (tmp, op)) 939 if (!tailor_god_spell (tmp, op))
938 return 0; 940 return 0;
939 }
940 941
941 if (dir) 942 if (dir)
942 tmp->stats.sp = dir; 943 tmp->stats.sp = dir;
943 else 944 else
944 tmp->stats.sp = i; 945 tmp->stats.sp = i;
950 { 951 {
951 tmp->range /= 4; 952 tmp->range /= 4;
952 if (tmp->range < 2 && spell->range >= 2) 953 if (tmp->range < 2 && spell->range >= 2)
953 tmp->range = 2; 954 tmp->range = 2;
954 } 955 }
956
955 tmp->stats.dam = spell->stats.dam + SP_level_dam_adjust (caster, spell); 957 tmp->stats.dam = spell->stats.dam + SP_level_dam_adjust (caster, spell);
956 tmp->duration = spell->duration + SP_level_duration_adjust (caster, spell); 958 tmp->duration = spell->duration + SP_level_duration_adjust (caster, spell);
957 959
958 /* Special bonus for fear attacks */ 960 /* Special bonus for fear attacks */
959 if (tmp->attacktype & AT_FEAR) 961 if (tmp->attacktype & AT_FEAR)
961 if (caster->type == PLAYER) 963 if (caster->type == PLAYER)
962 tmp->duration += fear_bonus[caster->stats.Cha]; 964 tmp->duration += fear_bonus[caster->stats.Cha];
963 else 965 else
964 tmp->duration += caster->level / 3; 966 tmp->duration += caster->level / 3;
965 } 967 }
968
966 if (tmp->attacktype & (AT_HOLYWORD | AT_TURN_UNDEAD)) 969 if (tmp->attacktype & (AT_HOLYWORD | AT_TURN_UNDEAD))
967 { 970 {
968 if (caster->type == PLAYER) 971 if (caster->type == PLAYER)
969 tmp->duration += turn_bonus[caster->stats.Wis] / 5; 972 tmp->duration += turn_bonus[caster->stats.Wis] / 5;
970 else 973 else
971 tmp->duration += caster->level / 3; 974 tmp->duration += caster->level / 3;
972 } 975 }
973 976
974
975 if (!(tmp->move_type & MOVE_FLY_LOW)) 977 if (!(tmp->move_type & MOVE_FLY_LOW))
976 LOG (llevDebug, "cast_cone(): arch %s doesn't have flying 1\n", &spell->other_arch->name); 978 LOG (llevDebug, "cast_cone(): arch %s doesn't have flying 1\n", &spell->other_arch->name);
977 979
978 if (!tmp->move_on && tmp->stats.dam) 980 if (!tmp->move_on && tmp->stats.dam)
979 { 981 {
980 LOG (llevDebug, "cast_cone(): arch %s doesn't have move_on set\n", &spell->other_arch->name); 982 LOG (llevDebug, "cast_cone(): arch %s doesn't have move_on set\n", &spell->other_arch->name);
981 } 983 }
984
982 insert_ob_in_map (tmp, m, op, 0); 985 insert_ob_in_map (tmp, m, op, 0);
983 986
984 /* This is used for tracking spells so that one effect doesn't hit 987 /* This is used for tracking spells so that one effect doesn't hit
985 * a single space too many times. 988 * a single space too many times.
986 */ 989 */
987 tmp->stats.maxhp = tmp->count; 990 tmp->stats.maxhp = tmp->count;
988 991
989 if (tmp->other_arch) 992 if (tmp->other_arch)
990 cone_drop (tmp); 993 cone_drop (tmp);
991 } 994 }
995
992 return success; 996 return success;
993} 997}
994 998
995/**************************************************************************** 999/****************************************************************************
996 * 1000 *
1010 archetype *at; 1014 archetype *at;
1011 1015
1012 if (op->state != NUM_ANIMATIONS (op) - 1) 1016 if (op->state != NUM_ANIMATIONS (op) - 1)
1013 return; 1017 return;
1014 1018
1015
1016 env = object_get_env_recursive (op); 1019 env = object_get_env_recursive (op);
1017 1020
1018 if (op->env) 1021 if (op->env)
1019 { 1022 {
1020 if (env->map == NULL) 1023 if (env->map == NULL)
1042 1045
1043 /* This copies a lot of the code from the fire bullet, 1046 /* This copies a lot of the code from the fire bullet,
1044 * but using the cast_bullet isn't really feasible, 1047 * but using the cast_bullet isn't really feasible,
1045 * so just set up the appropriate values. 1048 * so just set up the appropriate values.
1046 */ 1049 */
1047 at = find_archetype (SPLINT); 1050 at = archetype::find (SPLINT);
1048 if (at) 1051 if (at)
1049 { 1052 {
1050 for (i = 1; i < 9; i++) 1053 for (i = 1; i < 9; i++)
1051 { 1054 {
1052 if (out_of_map (op->map, op->x + freearr_x[i], op->y + freearr_x[i])) 1055 if (out_of_map (op->map, op->x + freearr_x[i], op->y + freearr_x[i]))

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines