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.66 by root, Fri Aug 10 01:47:53 2007 UTC vs.
Revision 1.70 by root, Mon Aug 27 05:10:51 2007 UTC

335 * pl is invisible. 335 * pl is invisible.
336 */ 336 */
337int 337int
338makes_invisible_to (object *pl, object *mon) 338makes_invisible_to (object *pl, object *mon)
339{ 339{
340
341 if (!pl->invisible) 340 if (!pl->invisible)
342 return 0; 341 return 0;
342
343 if (pl->type == PLAYER) 343 if (pl->type == PLAYER)
344 { 344 {
345 /* If race isn't set, then invisible unless it is undead */ 345 /* If race isn't set, then invisible unless it is undead */
346 if (!pl->contr->invis_race) 346 if (!pl->contr->invis_race)
347 { 347 {
348 if (QUERY_FLAG (mon, FLAG_UNDEAD)) 348 if (QUERY_FLAG (mon, FLAG_UNDEAD))
349 return 0; 349 return 0;
350
350 return 1; 351 return 1;
351 } 352 }
353
352 /* invis_race is set if we get here */ 354 /* invis_race is set if we get here */
353 if (!strcmp (pl->contr->invis_race, "undead") && is_true_undead (mon)) 355 if (!strcmp (pl->contr->invis_race, "undead") && is_true_undead (mon))
354 return 1; 356 return 1;
357
355 /* No race, can't be invisible to it */ 358 /* No race, can't be invisible to it */
356 if (!mon->race) 359 if (!mon->race)
357 return 0; 360 return 0;
361
358 if (strstr (mon->race, pl->contr->invis_race)) 362 if (strstr (mon->race, pl->contr->invis_race))
359 return 1; 363 return 1;
364
360 /* Nothing matched above, return 0 */ 365 /* Nothing matched above, return 0 */
361 return 0; 366 return 0;
362 } 367 }
363 else 368 else
364 { 369 {
601 606
602 if (is_dragon_pl (op)) 607 if (is_dragon_pl (op))
603 /* now grab the 'dragon_ability'-force from the player's inventory */ 608 /* now grab the 'dragon_ability'-force from the player's inventory */
604 for (tmp = op->inv; tmp; tmp = tmp->below) 609 for (tmp = op->inv; tmp; tmp = tmp->below)
605 { 610 {
606 if (tmp->type == FORCE && !strcmp (tmp->arch->archname, "dragon_ability_force")) 611 if (tmp->type == FORCE && tmp->arch->archname == shstr_dragon_ability_force)
607 { 612 {
608 if (tmp->stats.exp == 0) 613 if (tmp->stats.exp == 0)
609 buf << "Your metabolism isn't focused on anything.\n"; 614 buf << "Your metabolism isn't focused on anything.\n";
610 else 615 else
611 buf << "Your metabolism is focused on " << change_resist_msg[tmp->stats.exp] << ".\n"; 616 buf << "Your metabolism is focused on " << change_resist_msg[tmp->stats.exp] << ".\n";
895 900
896 op->speed_left = -FABS (op->speed) * 5; /* Freeze them for a short while */ 901 op->speed_left = -FABS (op->speed) * 5; /* Freeze them for a short while */
897 return 1; 902 return 1;
898} 903}
899 904
900
901/* cast_heal: Heals something. 905/* cast_heal: Heals something.
902 * op is the caster. 906 * op is the caster.
903 * dir is the direction he is casting it in. 907 * dir is the direction he is casting it in.
904 * spell is the spell object. 908 * spell is the spell object.
905 */ 909 */
931 { 935 {
932 /* See how many points we actually heal. Instead of messages 936 /* See how many points we actually heal. Instead of messages
933 * based on type of spell, we instead do messages based 937 * based on type of spell, we instead do messages based
934 * on amount of damage healed. 938 * on amount of damage healed.
935 */ 939 */
936 if (heal > (tmp->stats.maxhp - tmp->stats.hp)) 940 if (heal > tmp->stats.maxhp - tmp->stats.hp)
937 heal = tmp->stats.maxhp - tmp->stats.hp; 941 heal = tmp->stats.maxhp - tmp->stats.hp;
942
938 tmp->stats.hp += heal; 943 tmp->stats.hp += heal;
939 944
940 if (tmp->stats.hp >= tmp->stats.maxhp) 945 if (tmp->stats.hp >= tmp->stats.maxhp)
941 new_draw_info (NDI_UNIQUE, 0, tmp, "You feel just fine!"); 946 new_draw_info (NDI_UNIQUE, 0, tmp, "You feel just fine!");
942 else if (heal > 50) 947 else if (heal > 50)
951 success = 1; 956 success = 1;
952 } 957 }
953 } 958 }
954 959
955 if (spell->attacktype & AT_DISEASE) 960 if (spell->attacktype & AT_DISEASE)
956 if (cure_disease (tmp, op)) 961 if (cure_disease (tmp, op, spell))
957 success = 1; 962 success = 1;
958 963
959 if (spell->attacktype & AT_POISON) 964 if (spell->attacktype & AT_POISON)
960 { 965 {
961 at = archetype::find ("poisoning"); 966 at = archetype::find ("poisoning");
1010 } 1015 }
1011 1016
1012 if (spell->stats.food && tmp->stats.food < 999) 1017 if (spell->stats.food && tmp->stats.food < 999)
1013 { 1018 {
1014 tmp->stats.food += spell->stats.food; 1019 tmp->stats.food += spell->stats.food;
1020
1015 if (tmp->stats.food > 999) 1021 if (tmp->stats.food > 999)
1016 tmp->stats.food = 999; 1022 tmp->stats.food = 999;
1023
1017 success = 1; 1024 success = 1;
1018 /* We could do something a bit better like the messages for healing above */ 1025 /* We could do something a bit better like the messages for healing above */
1019 new_draw_info (NDI_UNIQUE, 0, tmp, "You feel your belly fill with food"); 1026 new_draw_info (NDI_UNIQUE, 0, tmp, "You feel your belly fill with food");
1020 } 1027 }
1021 1028
1397 value -= nrof * nugget[i]->value; 1404 value -= nrof * nugget[i]->value;
1398 1405
1399 object *tmp = arch_to_object (nugget[i]); 1406 object *tmp = arch_to_object (nugget[i]);
1400 tmp->nrof = nrof; 1407 tmp->nrof = nrof;
1401 tmp->flag [FLAG_IDENTIFIED] = true; 1408 tmp->flag [FLAG_IDENTIFIED] = true;
1402 caster->map->insert (tmp, x, y, caster, 0); 1409 op->map->insert (tmp, x, y, op, 0);
1403 } 1410 }
1404 1411
1405 if (weight > weight_max) 1412 if (weight > weight_max)
1406 goto bailout; 1413 goto bailout;
1407 } 1414 }
2277} 2284}
2278 2285
2279/* moves the peacemaker spell. 2286/* moves the peacemaker spell.
2280 * op is the piece object. 2287 * op is the piece object.
2281 */ 2288 */
2282
2283void 2289void
2284move_peacemaker (object *op) 2290move_peacemaker (object *op)
2285{ 2291{
2286 object *tmp; 2292 object *tmp;
2287 2293

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines