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.110 by root, Mon Oct 12 14:00:59 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 = -FABS (op->speed) * 5; /* Freeze them for a short while */ 890 op->speed_left = -5. * op->speed; /* Freeze them for a short while */
891
891 return 1; 892 return 1;
892} 893}
893 894
894/* cast_heal: Heals something. 895/* cast_heal: Heals something.
895 * op is the caster. 896 * op is the caster.
950 if (cure_disease (tmp, op, spell)) 951 if (cure_disease (tmp, op, spell))
951 success = 1; 952 success = 1;
952 953
953 if (spell->attacktype & AT_POISON) 954 if (spell->attacktype & AT_POISON)
954 { 955 {
955 at = archetype::find ("poisoning"); 956 at = archetype::find (shstr_poisoning);
956 poison = present_arch_in_ob (at, tmp); 957 poison = present_arch_in_ob (at, tmp);
957 if (poison) 958 if (poison)
958 { 959 {
959 success = 1; 960 success = 1;
960 new_draw_info (NDI_UNIQUE, 0, tmp, "Your body feels cleansed"); 961 new_draw_info (NDI_UNIQUE, 0, tmp, "Your body feels cleansed");
962 } 963 }
963 } 964 }
964 965
965 if (spell->attacktype & AT_CONFUSION) 966 if (spell->attacktype & AT_CONFUSION)
966 { 967 {
967 poison = present_in_ob_by_name (FORCE, "confusion", tmp); 968 poison = present_in_ob_by_name (FORCE, shstr_confusion, tmp);
968 if (poison) 969 if (poison)
969 { 970 {
970 success = 1; 971 success = 1;
971 new_draw_info (NDI_UNIQUE, 0, tmp, "Your mind feels clearer"); 972 new_draw_info (NDI_UNIQUE, 0, tmp, "Your mind feels clearer");
972 poison->duration = 1; 973 poison->duration = 1;
973 } 974 }
974 } 975 }
975 976
976 if (spell->attacktype & AT_BLIND) 977 if (spell->attacktype & AT_BLIND)
977 { 978 {
978 at = archetype::find ("blindness"); 979 at = archetype::find (shstr_blindness);
979 poison = present_arch_in_ob (at, tmp); 980 poison = present_arch_in_ob (at, tmp);
980 if (poison) 981 if (poison)
981 { 982 {
982 success = 1; 983 success = 1;
983 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.");
1249 } 1250 }
1250 else 1251 else
1251 { 1252 {
1252 /* Only give out good benefits, and put a max on it */ 1253 /* Only give out good benefits, and put a max on it */
1253 for (i = 0; i < NROFATTACKS; i++) 1254 for (i = 0; i < NROFATTACKS; i++)
1254 {
1255 if (god->resist[i] > 0) 1255 if (god->resist[i] > 0)
1256 {
1257 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]);
1258 } 1257
1259 }
1260 force->path_attuned |= god->path_attuned; 1258 force->path_attuned |= god->path_attuned;
1261 1259
1262 if (spell_ob->attacktype) 1260 if (spell_ob->attacktype)
1263 force->slaying = god->slaying; 1261 force->slaying = god->slaying;
1264 1262
1329 if (op->type != PLAYER) 1327 if (op->type != PLAYER)
1330 return 0; 1328 return 0;
1331 1329
1332 archetype *nugget[3]; 1330 archetype *nugget[3];
1333 1331
1334 nugget[0] = archetype::find ("pyrite3"); 1332 nugget[0] = archetype::find (shstr_pyrite3);
1335 nugget[1] = archetype::find ("pyrite2"); 1333 nugget[1] = archetype::find (shstr_pyrite2);
1336 nugget[2] = archetype::find ("pyrite"); 1334 nugget[2] = archetype::find (shstr_pyrite);
1337 1335
1338 /* 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
1339 * some, and also prevents people from alchemising every table/chair/clock 1337 * some, and also prevents people from alchemising every table/chair/clock
1340 * in sight 1338 * in sight
1341 */ 1339 */
1574 /* show invisible */ 1572 /* show invisible */
1575 if (QUERY_FLAG (spell, FLAG_MAKE_INVIS) && 1573 if (QUERY_FLAG (spell, FLAG_MAKE_INVIS) &&
1576 /* Might there be other objects that we can make visible? */ 1574 /* Might there be other objects that we can make visible? */
1577 (tmp->invisible && (QUERY_FLAG (tmp, FLAG_MONSTER) 1575 (tmp->invisible && (QUERY_FLAG (tmp, FLAG_MONSTER)
1578 || (tmp->type == PLAYER && !QUERY_FLAG (tmp, FLAG_WIZ)) 1576 || (tmp->type == PLAYER && !QUERY_FLAG (tmp, FLAG_WIZ))
1579 || tmp->type == CF_HANDLE 1577 || tmp->type == T_HANDLE
1580 || tmp->type == TRAPDOOR 1578 || tmp->type == TRAPDOOR
1581 || tmp->type == EXIT 1579 || tmp->type == EXIT
1582 || tmp->type == HOLE 1580 || tmp->type == HOLE
1583 || tmp->type == BUTTON 1581 || tmp->type == BUTTON
1584 || tmp->type == TELEPORTER 1582 || tmp->type == TELEPORTER
2087 2085
2088 /* attacktype */ 2086 /* attacktype */
2089 if (!tmp->attacktype) 2087 if (!tmp->attacktype)
2090 tmp->attacktype = AT_PHYSICAL; 2088 tmp->attacktype = AT_PHYSICAL;
2091 2089
2092 if (materialtype_t *mt = name_to_material (op->materialname))
2093 {
2094 for (i = 0; i < NROFATTACKS; i++) 2090 for (i = 0; i < NROFATTACKS; i++)
2095 tmp->resist[i] = 50 - (mt->save[i] * 5); 2091 tmp->resist[i] = 50 - (op->material->save[i] * 5);
2096 a = mt->save[0]; 2092
2097 } 2093 a = op->material->save[0];
2098 else
2099 {
2100 for (i = 0; i < NROFATTACKS; i++)
2101 tmp->resist[i] = 5;
2102 a = 10;
2103 }
2104 2094
2105 /* Set weapon's immunity */ 2095 /* Set weapon's immunity */
2106 tmp->resist[ATNR_CONFUSION] = 100; 2096 tmp->resist[ATNR_CONFUSION] = 100;
2107 tmp->resist[ATNR_POISON] = 100; 2097 tmp->resist[ATNR_POISON] = 100;
2108 tmp->resist[ATNR_SLOW] = 100; 2098 tmp->resist[ATNR_SLOW] = 100;
2135 tmp->state = weapon->state; 2125 tmp->state = weapon->state;
2136 tmp->flag [FLAG_ANIMATE] = weapon->flag [FLAG_ANIMATE]; 2126 tmp->flag [FLAG_ANIMATE] = weapon->flag [FLAG_ANIMATE];
2137 } 2127 }
2138 2128
2139 /* 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. */
2140 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));
2141 2131
2142 tmp->speed_left = -1; 2132 tmp->speed_left = -1;
2143 tmp->direction = dir; 2133 tmp->direction = dir;
2144 2134
2145 m->insert (tmp, x, y, op); 2135 m->insert (tmp, x, y, op);
2288 continue; 2278 continue;
2289 2279
2290 if (victim->stats.exp == 0) 2280 if (victim->stats.exp == 0)
2291 continue; 2281 continue;
2292 2282
2293 def_lev = MAX (1, victim->level); 2283 def_lev = max (1, victim->level);
2294 atk_lev = MAX (1, op->level); 2284 atk_lev = max (1, op->level);
2295 2285
2296 if (rndm (0, atk_lev - 1) > def_lev) 2286 if (rndm (0, atk_lev - 1) > def_lev)
2297 { 2287 {
2298 /* make this sucker peaceful. */ 2288 /* make this sucker peaceful. */
2299 2289

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines