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

Comparing deliantra/server/server/spell_util.C (file contents):
Revision 1.80 by root, Mon Sep 29 08:25:02 2008 UTC vs.
Revision 1.83 by root, Mon Sep 29 11:52:34 2008 UTC

93 // compute the attuned/repelled bonus 93 // compute the attuned/repelled bonus
94 // attuned only increases up to 2 times the original level (i.e. bonus <= level) */ 94 // attuned only increases up to 2 times the original level (i.e. bonus <= level) */
95 // repell has no such quarrels 95 // repell has no such quarrels
96 return (caster->path_attuned & spell->path_attuned ? min (level, +ATTUNE_REPELL) : 0) 96 return (caster->path_attuned & spell->path_attuned ? min (level, +ATTUNE_REPELL) : 0)
97 + (caster->path_repelled & spell->path_attuned ? -ATTUNE_REPELL : 0); 97 + (caster->path_repelled & spell->path_attuned ? -ATTUNE_REPELL : 0);
98}
99
100/*
101 * This function takes a caster and spell and presents the
102 * effective level the caster needs to be to cast the spell.
103 * basically, it just adjusts the spell->level with attuned/repelled
104 * spellpaths. Was called path_level_mod.
105 *
106 * caster is person casting the spell.
107 * spell is the spell object.
108 * Returns modified level.
109 */
110int
111min_casting_level (object *caster, object *spell)
112{
113 if (caster->path_denied & spell->path_attuned)
114 return 500;
115
116 return max (1, spell->level + attuned_bonus (caster, spell, spell->level));
117} 98}
118 99
119/* This function returns the effective level the spell 100/* This function returns the effective level the spell
120 * is being cast at. 101 * is being cast at.
121 */ 102 */
1472 1453
1473 case SP_MAGIC_MISSILE: 1454 case SP_MAGIC_MISSILE:
1474 if (QUERY_FLAG (victim, FLAG_ALIVE)) 1455 if (QUERY_FLAG (victim, FLAG_ALIVE))
1475 { 1456 {
1476 hit_player (victim, spell->stats.dam, spell, spell->attacktype, 1); 1457 hit_player (victim, spell->stats.dam, spell, spell->attacktype, 1);
1477
1478 if (!spell->destroyed ())
1479 spell->destroy (); 1458 spell->destroy ();
1480 } 1459 }
1481 break; 1460 break;
1482 1461
1483 case SP_MOVING_BALL: 1462 case SP_MOVING_BALL:
1484 if (QUERY_FLAG (victim, FLAG_ALIVE)) 1463 if (QUERY_FLAG (victim, FLAG_ALIVE))
1485 hit_player (victim, spell->stats.dam, spell, spell->attacktype, 1); 1464 hit_player (victim, spell->stats.dam, spell, spell->attacktype, 1);
1486 else if (victim->materialname) 1465 else if (victim->materialname)
1487 save_throw_object (victim, spell->attacktype, spell); 1466 save_throw_object (victim, spell->attacktype, spell);
1488 break;
1489 }
1490}
1491 1467
1468 break;
1469 }
1470}
1471

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines