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

Comparing deliantra/server/server/spell_effect.C (file contents):
Revision 1.112 by root, Wed Nov 4 18:17:58 2009 UTC vs.
Revision 1.115 by root, Sun Nov 29 09:41:28 2009 UTC

72 if (!(random_roll (0, 3, op, PREFER_HIGH))) 72 if (!(random_roll (0, 3, op, PREFER_HIGH)))
73 { 73 {
74 new_draw_info_format (NDI_UNIQUE, 0, op, "The %s vibrates violently, then explodes!", query_name (wand)); 74 new_draw_info_format (NDI_UNIQUE, 0, op, "The %s vibrates violently, then explodes!", query_name (wand));
75 op->play_sound (sound_find ("ob_explode")); 75 op->play_sound (sound_find ("ob_explode"));
76 wand->destroy (); 76 wand->destroy ();
77 tmp = get_archetype ("fireball"); 77 tmp = get_archetype (shstr_fireball);
78 tmp->stats.dam = (spell_ob->stats.dam + SP_level_dam_adjust (caster, spell_ob)) / 10; 78 tmp->stats.dam = (spell_ob->stats.dam + SP_level_dam_adjust (caster, spell_ob)) / 10;
79 79
80 if (!tmp->stats.dam) 80 if (!tmp->stats.dam)
81 tmp->stats.dam = 1; 81 tmp->stats.dam = 1;
82 82
565 565
566int 566int
567perceive_self (object *op) 567perceive_self (object *op)
568{ 568{
569 const char *cp = describe_item (op, op); 569 const char *cp = describe_item (op, op);
570 archetype *at = archetype::find (ARCH_DEPLETION); 570 archetype *at = archetype::find (shstr_depletion);
571 571
572 dynbuf_text &buf = msg_dynbuf; buf.clear (); 572 dynbuf_text &buf = msg_dynbuf; buf.clear ();
573 573
574 if (!op->is_player ()) 574 if (!op->is_player ())
575 return 0; 575 return 0;
885 885
886 /* Actually move the player now */ 886 /* Actually move the player now */
887 if (!(op = op->map->insert (op, op->x + freearr_x[dir] * dist, op->y + freearr_y[dir] * dist, op))) 887 if (!(op = op->map->insert (op, op->x + freearr_x[dir] * dist, op->y + freearr_y[dir] * dist, op)))
888 return 1; 888 return 1;
889 889
890 op->speed_left = -5. * fabs (op->speed); /* Freeze them for a short while */ 890 op->speed_left = -5. * op->speed; /* Freeze them for a short while */
891 891
892 return 1; 892 return 1;
893} 893}
894 894
895/* cast_heal: Heals something. 895/* cast_heal: Heals something.
951 if (cure_disease (tmp, op, spell)) 951 if (cure_disease (tmp, op, spell))
952 success = 1; 952 success = 1;
953 953
954 if (spell->attacktype & AT_POISON) 954 if (spell->attacktype & AT_POISON)
955 { 955 {
956 at = archetype::find ("poisoning"); 956 at = archetype::find (shstr_poisoning);
957 poison = present_arch_in_ob (at, tmp); 957 poison = present_arch_in_ob (at, tmp);
958 if (poison) 958 if (poison)
959 { 959 {
960 success = 1; 960 success = 1;
961 new_draw_info (NDI_UNIQUE, 0, tmp, "Your body feels cleansed"); 961 new_draw_info (NDI_UNIQUE, 0, tmp, "Your body feels cleansed");
963 } 963 }
964 } 964 }
965 965
966 if (spell->attacktype & AT_CONFUSION) 966 if (spell->attacktype & AT_CONFUSION)
967 { 967 {
968 poison = present_in_ob_by_name (FORCE, "confusion", tmp); 968 poison = present_in_ob_by_name (FORCE, shstr_confusion, tmp);
969 if (poison) 969 if (poison)
970 { 970 {
971 success = 1; 971 success = 1;
972 new_draw_info (NDI_UNIQUE, 0, tmp, "Your mind feels clearer"); 972 new_draw_info (NDI_UNIQUE, 0, tmp, "Your mind feels clearer");
973 poison->duration = 1; 973 poison->duration = 1;
974 } 974 }
975 } 975 }
976 976
977 if (spell->attacktype & AT_BLIND) 977 if (spell->attacktype & AT_BLIND)
978 { 978 {
979 at = archetype::find ("blindness"); 979 at = archetype::find (shstr_blindness);
980 poison = present_arch_in_ob (at, tmp); 980 poison = present_arch_in_ob (at, tmp);
981 if (poison) 981 if (poison)
982 { 982 {
983 success = 1; 983 success = 1;
984 new_draw_info (NDI_UNIQUE, 0, tmp, "Your vision begins to return."); 984 new_draw_info (NDI_UNIQUE, 0, tmp, "Your vision begins to return.");
1250 } 1250 }
1251 else 1251 else
1252 { 1252 {
1253 /* Only give out good benefits, and put a max on it */ 1253 /* Only give out good benefits, and put a max on it */
1254 for (i = 0; i < NROFATTACKS; i++) 1254 for (i = 0; i < NROFATTACKS; i++)
1255 {
1256 if (god->resist[i] > 0) 1255 if (god->resist[i] > 0)
1257 {
1258 force->resist[i] = MIN (god->resist[i], spell_ob->resist[ATNR_GODPOWER]); 1256 force->resist[i] = min (god->resist[i], spell_ob->resist[ATNR_GODPOWER]);
1259 } 1257
1260 }
1261 force->path_attuned |= god->path_attuned; 1258 force->path_attuned |= god->path_attuned;
1262 1259
1263 if (spell_ob->attacktype) 1260 if (spell_ob->attacktype)
1264 force->slaying = god->slaying; 1261 force->slaying = god->slaying;
1265 1262
1330 if (op->type != PLAYER) 1327 if (op->type != PLAYER)
1331 return 0; 1328 return 0;
1332 1329
1333 archetype *nugget[3]; 1330 archetype *nugget[3];
1334 1331
1335 nugget[0] = archetype::find ("pyrite3"); 1332 nugget[0] = archetype::find (shstr_pyrite3);
1336 nugget[1] = archetype::find ("pyrite2"); 1333 nugget[1] = archetype::find (shstr_pyrite2);
1337 nugget[2] = archetype::find ("pyrite"); 1334 nugget[2] = archetype::find (shstr_pyrite);
1338 1335
1339 /* Put a maximum weight of items that can be alchemised. Limits the power 1336 /* Put a maximum weight of items that can be alchemised. Limits the power
1340 * some, and also prevents people from alchemising every table/chair/clock 1337 * some, and also prevents people from alchemising every table/chair/clock
1341 * in sight 1338 * in sight
1342 */ 1339 */
2088 2085
2089 /* attacktype */ 2086 /* attacktype */
2090 if (!tmp->attacktype) 2087 if (!tmp->attacktype)
2091 tmp->attacktype = AT_PHYSICAL; 2088 tmp->attacktype = AT_PHYSICAL;
2092 2089
2093 if (materialtype_t *mt = name_to_material (op->materialname))
2094 {
2095 for (i = 0; i < NROFATTACKS; i++) 2090 for (i = 0; i < NROFATTACKS; i++)
2096 tmp->resist[i] = 50 - (mt->save[i] * 5); 2091 tmp->resist[i] = 50 - (op->material->save[i] * 5);
2097 a = mt->save[0]; 2092
2098 } 2093 a = op->material->save[0];
2099 else
2100 {
2101 for (i = 0; i < NROFATTACKS; i++)
2102 tmp->resist[i] = 5;
2103 a = 10;
2104 }
2105 2094
2106 /* Set weapon's immunity */ 2095 /* Set weapon's immunity */
2107 tmp->resist[ATNR_CONFUSION] = 100; 2096 tmp->resist[ATNR_CONFUSION] = 100;
2108 tmp->resist[ATNR_POISON] = 100; 2097 tmp->resist[ATNR_POISON] = 100;
2109 tmp->resist[ATNR_SLOW] = 100; 2098 tmp->resist[ATNR_SLOW] = 100;
2136 tmp->state = weapon->state; 2125 tmp->state = weapon->state;
2137 tmp->flag [FLAG_ANIMATE] = weapon->flag [FLAG_ANIMATE]; 2126 tmp->flag [FLAG_ANIMATE] = weapon->flag [FLAG_ANIMATE];
2138 } 2127 }
2139 2128
2140 /* make experience increase in proportion to the strength of the summoned creature. */ 2129 /* make experience increase in proportion to the strength of the summoned creature. */
2141 tmp->stats.exp *= 1 + (MAX (spell->stats.maxgrace, spell->stats.sp) / casting_level (caster, spell)); 2130 tmp->stats.exp *= 1 + (max (spell->stats.maxgrace, spell->stats.sp) / casting_level (caster, spell));
2142 2131
2143 tmp->speed_left = -1; 2132 tmp->speed_left = -1;
2144 tmp->direction = dir; 2133 tmp->direction = dir;
2145 2134
2146 m->insert (tmp, x, y, op); 2135 m->insert (tmp, x, y, op);
2289 continue; 2278 continue;
2290 2279
2291 if (victim->stats.exp == 0) 2280 if (victim->stats.exp == 0)
2292 continue; 2281 continue;
2293 2282
2294 def_lev = MAX (1, victim->level); 2283 def_lev = max (1, victim->level);
2295 atk_lev = MAX (1, op->level); 2284 atk_lev = max (1, op->level);
2296 2285
2297 if (rndm (0, atk_lev - 1) > def_lev) 2286 if (rndm (0, atk_lev - 1) > def_lev)
2298 { 2287 {
2299 /* make this sucker peaceful. */ 2288 /* make this sucker peaceful. */
2300 2289

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines