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.119 by root, Sun Apr 18 11:42:46 2010 UTC vs.
Revision 1.122 by root, Sat Dec 31 06:18:02 2011 UTC

1/* 1/*
2 * This file is part of Deliantra, the Roguelike Realtime MMORPG. 2 * This file is part of Deliantra, the Roguelike Realtime MMORPG.
3 * 3 *
4 * Copyright (©) 2005,2006,2007,2008,2009,2010 Marc Alexander Lehmann / Robin Redeker / the Deliantra team 4 * Copyright (©) 2005,2006,2007,2008,2009,2010,2011 Marc Alexander Lehmann / Robin Redeker / the Deliantra team
5 * Copyright (©) 2001 Mark Wedel & Crossfire Development Team 5 * Copyright (©) 2001 Mark Wedel & Crossfire Development Team
6 * Copyright (©) 1992 Frank Tore Johansen 6 * Copyright (©) 1992 Frank Tore Johansen
7 * 7 *
8 * Deliantra is free software: you can redistribute it and/or modify it under 8 * Deliantra is free software: you can redistribute it and/or modify it under
9 * the terms of the Affero GNU General Public License as published by the 9 * the terms of the Affero GNU General Public License as published by the
158 sp *= (int) PATH_SP_MULT (caster, spell); 158 sp *= (int) PATH_SP_MULT (caster, spell);
159 if (!sp && spell->stats.sp) 159 if (!sp && spell->stats.sp)
160 sp = 1; 160 sp = 1;
161 161
162 if (spell->stats.grace && spell->stats.maxgrace) 162 if (spell->stats.grace && spell->stats.maxgrace)
163 grace = spell->stats.grace * (1.0 + max (0, float (level - spell->level) / spell->stats.maxgrace)); 163 grace = spell->stats.grace * (1.f + max (0.f, float (level - spell->level) / spell->stats.maxgrace));
164 else 164 else
165 grace = spell->stats.grace; 165 grace = spell->stats.grace;
166 166
167 grace *= PATH_SP_MULT (caster, spell); 167 grace *= PATH_SP_MULT (caster, spell);
168 if (spell->stats.grace && !grace) 168 if (spell->stats.grace && !grace)
795 godname = "Your spirit"; 795 godname = "Your spirit";
796 796
797 if (failure <= -20 && failure > -40) /* wonder */ 797 if (failure <= -20 && failure > -40) /* wonder */
798 { 798 {
799 op->failmsgf ("%s gives a sign to renew your faith." HINT_GRACE, godname); 799 op->failmsgf ("%s gives a sign to renew your faith." HINT_GRACE, godname);
800 tmp = get_archetype (SPELL_WONDER); 800 tmp = archetype::get (SPELL_WONDER);
801 cast_cone (op, op, 0, tmp); 801 cast_cone (op, op, 0, tmp);
802 tmp->destroy (); 802 tmp->destroy ();
803 } 803 }
804 804
805 else if (failure <= -40 && failure > -60) /* confusion */ 805 else if (failure <= -40 && failure > -60) /* confusion */
814 godname); 814 godname);
815 paralyze_player (op, op, 99); 815 paralyze_player (op, op, 99);
816 } 816 }
817 else if (failure <= -150) /* blast the immediate area */ 817 else if (failure <= -150) /* blast the immediate area */
818 { 818 {
819 tmp = get_archetype (GOD_POWER); 819 tmp = archetype::get (GOD_POWER);
820 op->failmsgf ("%s smites you!" HINT_GRACE, godname); 820 op->failmsgf ("%s smites you!" HINT_GRACE, godname);
821 cast_magic_storm (op, tmp, power); 821 cast_magic_storm (op, tmp, power);
822 } 822 }
823} 823}
824 824
840 return; 840 return;
841 841
842 if (failure <= -20 && failure > -40) /* wonder */ 842 if (failure <= -20 && failure > -40) /* wonder */
843 { 843 {
844 op->failmsg ("Your spell causes an unexpected effect."); 844 op->failmsg ("Your spell causes an unexpected effect.");
845 tmp = get_archetype (SPELL_WONDER); 845 tmp = archetype::get (SPELL_WONDER);
846 cast_cone (op, op, 0, tmp); 846 cast_cone (op, op, 0, tmp);
847 tmp->destroy (); 847 tmp->destroy ();
848 } 848 }
849 849
850 else if (failure <= -40 && failure > -60) /* confusion */ 850 else if (failure <= -40 && failure > -60) /* confusion */
869 869
870 } 870 }
871 else 871 else
872 { 872 {
873 op->failmsg ("You lose control of the mana! The uncontrolled magic blasts you!"); 873 op->failmsg ("You lose control of the mana! The uncontrolled magic blasts you!");
874 tmp = get_archetype (LOOSE_MANA); 874 tmp = archetype::get (LOOSE_MANA);
875 tmp->level = skill->level; 875 tmp->level = skill->level;
876 876
877 /* increase the area of destruction a little for more powerful spells */ 877 /* increase the area of destruction a little for more powerful spells */
878 tmp->range += isqrt (power); 878 tmp->range += isqrt (power);
879 879
1504 * the victim with a specific maximum level. 1504 * the victim with a specific maximum level.
1505 */ 1505 */
1506void 1506void
1507create_exploding_ball_at (object *victim, int level) 1507create_exploding_ball_at (object *victim, int level)
1508{ 1508{
1509 object *ball = get_archetype (EXPLODING_FIREBALL); 1509 object *ball = archetype::get (EXPLODING_FIREBALL);
1510 ball->dam_modifier = random_roll (1, level, victim, PREFER_LOW) / 5 + 1; 1510 ball->dam_modifier = random_roll (1, level, victim, PREFER_LOW) / 5 + 1;
1511 ball->stats.maxhp = random_roll (1, level, victim, PREFER_LOW) / 10 + 2; 1511 ball->stats.maxhp = random_roll (1, level, victim, PREFER_LOW) / 10 + 2;
1512 ball->insert_at (victim); 1512 ball->insert_at (victim);
1513} 1513}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines