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.89 by root, Fri Nov 6 12:49:19 2009 UTC vs.
Revision 1.92 by root, Wed Nov 11 04:45:23 2009 UTC

108 ***************************************************************************/ 108 ***************************************************************************/
109 109
110/* Causes op to fork. op is the original bolt, tmp 110/* Causes op to fork. op is the original bolt, tmp
111 * is the first piece of the fork. 111 * is the first piece of the fork.
112 */ 112 */
113void 113static void
114forklightning (object *op, object *tmp) 114forklightning (object *op, object *tmp)
115{ 115{
116 int new_dir = 1; /* direction or -1 for left, +1 for right 0 if no new bolt */ 116 int new_dir = 1; /* direction or -1 for left, +1 for right 0 if no new bolt */
117 int t_dir; /* stores temporary dir calculation */ 117 int t_dir; /* stores temporary dir calculation */
118 maptile *m; 118 maptile *m;
1047 * dir is the direction to look in. 1047 * dir is the direction to look in.
1048 * range is how far out to look. 1048 * range is how far out to look.
1049 * type is the type of spell - either SPELL_MANA or SPELL_GRACE. 1049 * type is the type of spell - either SPELL_MANA or SPELL_GRACE.
1050 * this info is used for blocked magic/unholy spaces. 1050 * this info is used for blocked magic/unholy spaces.
1051 */ 1051 */
1052object * 1052static object *
1053get_pointed_target (object *op, int dir, int range, int type) 1053get_pointed_target (object *op, int dir, int range, int type)
1054{ 1054{
1055 object *target; 1055 object *target;
1056 sint16 x, y; 1056 sint16 x, y;
1057 int dist, mflags; 1057 int dist, mflags;
1244 * we do this by creating a force and inserting it in the 1244 * we do this by creating a force and inserting it in the
1245 * object. if time is 0, the object glows permanently. To truely 1245 * object. if time is 0, the object glows permanently. To truely
1246 * make this work for non-living objects, we would have to 1246 * make this work for non-living objects, we would have to
1247 * give them the capability to have an inventory. b.t. 1247 * give them the capability to have an inventory. b.t.
1248 */ 1248 */
1249int 1249static int
1250make_object_glow (object *op, int radius, int time) 1250make_object_glow (object *op, int radius, int time)
1251{ 1251{
1252 /* some things are unaffected... */ 1252 /* some things are unaffected... */
1253 if (op->path_denied & PATH_LIGHT) 1253 if (op->path_denied & PATH_LIGHT)
1254 return 0; 1254 return 0;
1325/*************************************************************************** 1325/***************************************************************************
1326 * 1326 *
1327 * CURSE 1327 * CURSE
1328 * 1328 *
1329 ***************************************************************************/ 1329 ***************************************************************************/
1330
1331int 1330int
1332cast_curse (object *op, object *caster, object *spell_ob, int dir) 1331cast_curse (object *op, object *caster, object *spell_ob, int dir)
1333{ 1332{
1334 object *god = find_god (determine_god (op)); 1333 object *god = find_god (determine_god (op));
1335 object *tmp, *force; 1334 object *tmp, *force;
1413 force->stats.wc = spell_ob->stats.wc; 1412 force->stats.wc = spell_ob->stats.wc;
1414 1413
1415 change_abil (tmp, force); /* Mostly to display any messages */ 1414 change_abil (tmp, force); /* Mostly to display any messages */
1416 insert_ob_in_ob (force, tmp); 1415 insert_ob_in_ob (force, tmp);
1417 tmp->update_stats (); 1416 tmp->update_stats ();
1417
1418 return 1; 1418 return 1;
1419
1420} 1419}
1421 1420
1422/********************************************************************** 1421/**********************************************************************
1423 * mood change 1422 * mood change
1424 * Arguably, this may or may not be an attack spell. But since it 1423 * Arguably, this may or may not be an attack spell. But since it
1525 Ryo, august 14th 1524 Ryo, august 14th
1526 */ 1525 */
1527 if (head->level > level) 1526 if (head->level > level)
1528 continue; 1527 continue;
1529 1528
1530 if (random_roll (0, 100, caster, PREFER_LOW) >= (20 + MIN (50, 2 * (level - head->level)))) 1529 if (random_roll (0, 100, caster, PREFER_LOW) >= (20 + min (50, 2 * (level - head->level))))
1531 /* Failed, no effect */ 1530 /* Failed, no effect */
1532 continue; 1531 continue;
1533 } 1532 }
1534 1533
1535 /* Done with saving throw. Now start affecting the monster */ 1534 /* Done with saving throw. Now start affecting the monster */
2032 if (infect_object (walk, disease, 1)) 2031 if (infect_object (walk, disease, 1))
2033 { 2032 {
2034 new_draw_info_format (NDI_UNIQUE, 0, op, "You inflict %s on %s!", &disease->name, &walk->name); 2033 new_draw_info_format (NDI_UNIQUE, 0, op, "You inflict %s on %s!", &disease->name, &walk->name);
2035 2034
2036 disease->destroy (); /* don't need this one anymore */ 2035 disease->destroy (); /* don't need this one anymore */
2037 walk->map->insert (get_archetype ("detect_magic"), x, y, op); 2036 walk->map->insert (get_archetype (shstr_detect_magic), x, y, op);
2038 return 1; 2037 return 1;
2039 } 2038 }
2040 2039
2041 disease->destroy (); 2040 disease->destroy ();
2042 } 2041 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines