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.81 by root, Mon Sep 29 10:20:49 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 */
786 if (failure <= -20 && failure > -40) /* wonder */ 767 if (failure <= -20 && failure > -40) /* wonder */
787 { 768 {
788 new_draw_info_format (NDI_UNIQUE, 0, op, "%s gives a sign to renew your faith.", godname); 769 new_draw_info_format (NDI_UNIQUE, 0, op, "%s gives a sign to renew your faith.", godname);
789 tmp = get_archetype (SPELL_WONDER); 770 tmp = get_archetype (SPELL_WONDER);
790 cast_cone (op, op, 0, tmp); 771 cast_cone (op, op, 0, tmp);
791 tmp->destroy (true); 772 tmp->destroy ();
792 } 773 }
793 774
794 else if (failure <= -40 && failure > -60) /* confusion */ 775 else if (failure <= -40 && failure > -60) /* confusion */
795 { 776 {
796 new_draw_info (NDI_UNIQUE, 0, op, "Your diety touches your mind!"); 777 new_draw_info (NDI_UNIQUE, 0, op, "Your diety touches your mind!");
830 if (failure <= -20 && failure > -40) /* wonder */ 811 if (failure <= -20 && failure > -40) /* wonder */
831 { 812 {
832 new_draw_info (NDI_UNIQUE, 0, op, "Your spell causes an unexpected effect."); 813 new_draw_info (NDI_UNIQUE, 0, op, "Your spell causes an unexpected effect.");
833 tmp = get_archetype (SPELL_WONDER); 814 tmp = get_archetype (SPELL_WONDER);
834 cast_cone (op, op, 0, tmp); 815 cast_cone (op, op, 0, tmp);
835 tmp->destroy (true); 816 tmp->destroy ();
836 } 817 }
837 818
838 else if (failure <= -40 && failure > -60) /* confusion */ 819 else if (failure <= -40 && failure > -60) /* confusion */
839 { 820 {
840 new_draw_info (NDI_UNIQUE, 0, op, "Your magic recoils on you, making you confused!"); 821 new_draw_info (NDI_UNIQUE, 0, op, "Your magic recoils on you, making you confused!");
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 spell->destroy (true); 1458 spell->destroy ();
1478 } 1459 }
1479 break; 1460 break;
1480 1461
1481 case SP_MOVING_BALL: 1462 case SP_MOVING_BALL:
1482 if (QUERY_FLAG (victim, FLAG_ALIVE)) 1463 if (QUERY_FLAG (victim, FLAG_ALIVE))

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines