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

Comparing deliantra/server/server/attack.C (file contents):
Revision 1.13 by root, Thu Sep 14 00:14:51 2006 UTC vs.
Revision 1.15 by root, Thu Sep 14 20:46:10 2006 UTC

1 1
2/* 2/*
3 * static char *rcsid_attack_c = 3 * static char *rcsid_attack_c =
4 * "$Id: attack.C,v 1.13 2006/09/14 00:14:51 root Exp $"; 4 * "$Id: attack.C,v 1.15 2006/09/14 20:46:10 root Exp $";
5 */ 5 */
6 6
7/* 7/*
8 CrossFire, A Multiplayer game for X-windows 8 CrossFire, A Multiplayer game for X-windows
9 9
242 else 242 else
243 replace_insert_ob_in_map ("burnout", originator); 243 replace_insert_ob_in_map ("burnout", originator);
244 244
245 return; 245 return;
246 } 246 }
247
247 /* The value of 50 is arbitrary. */ 248 /* The value of 50 is arbitrary. */
248 if (type & AT_COLD && (op->resist[ATNR_COLD] < 50) && !QUERY_FLAG (op, FLAG_NO_PICK) && (RANDOM () & 2)) 249 if (type & AT_COLD && (op->resist[ATNR_COLD] < 50) && !QUERY_FLAG (op, FLAG_NO_PICK) && (RANDOM () & 2))
249 { 250 {
250 object *tmp; 251 object *tmp;
251 archetype *at = find_archetype ("icecube"); 252 archetype *at = find_archetype ("icecube");
252 253
253 if (at == NULL) 254 if (at == NULL)
254 return; 255 return;
256
255 op = stop_item (op); 257 op = stop_item (op);
256 if (op == NULL) 258 if (op == NULL)
257 return; 259 return;
260
258 if ((tmp = present_arch (at, op->map, op->x, op->y)) == NULL) 261 if ((tmp = present_arch (at, op->map, op->x, op->y)) == NULL)
259 { 262 {
260 tmp = arch_to_object (at); 263 tmp = arch_to_object (at);
261 tmp->x = op->x, tmp->y = op->y; 264 tmp->x = op->x, tmp->y = op->y;
262 /* This was in the old (pre new movement code) - 265 /* This was in the old (pre new movement code) -
265 */ 268 */
266 tmp->move_slow_penalty = 0; 269 tmp->move_slow_penalty = 0;
267 tmp->move_slow = 0; 270 tmp->move_slow = 0;
268 insert_ob_in_map (tmp, op->map, originator, 0); 271 insert_ob_in_map (tmp, op->map, originator, 0);
269 } 272 }
273
270 if (!QUERY_FLAG (op, FLAG_REMOVED)) 274 if (!QUERY_FLAG (op, FLAG_REMOVED))
271 remove_ob (op); 275 remove_ob (op);
276
272 (void) insert_ob_in_ob (op, tmp); 277 insert_ob_in_ob (op, tmp);
273 return; 278 return;
274 } 279 }
275} 280}
276 281
277/* Object op is hitting the map. 282/* Object op is hitting the map.
1335 break; 1340 break;
1336 case ATNR_TURN_UNDEAD: 1341 case ATNR_TURN_UNDEAD:
1337 { 1342 {
1338 if (QUERY_FLAG (op, FLAG_UNDEAD)) 1343 if (QUERY_FLAG (op, FLAG_UNDEAD))
1339 { 1344 {
1340 object *owner = get_owner (hitter) == NULL ? hitter : get_owner (hitter); 1345 object *owner = hitter->owner ? (object *)hitter->owner : hitter;
1341 object *god = find_god (determine_god (owner)); 1346 object *god = find_god (determine_god (owner));
1342 int div = 1; 1347 int div = 1;
1343 1348
1344 /* if undead are not an enemy of your god, you turn them 1349 /* if undead are not an enemy of your god, you turn them
1345 * at half strength */ 1350 * at half strength */
1371 break; 1376 break;
1372 case ATNR_HOLYWORD: 1377 case ATNR_HOLYWORD:
1373 { 1378 {
1374 /* This has already been handled by hit_player, 1379 /* This has already been handled by hit_player,
1375 * no need to check twice -- DAMN */ 1380 * no need to check twice -- DAMN */
1376 1381 object *owner = hitter->owner ? (object *)hitter->owner : hitter;
1377 object *owner = get_owner (hitter) == NULL ? hitter : get_owner (hitter);
1378 1382
1379 /* As with turn undead above, give a bonus on the saving throw */ 1383 /* As with turn undead above, give a bonus on the saving throw */
1380 if ((op->level + (op->resist[ATNR_HOLYWORD] / 100)) < owner->level + turn_bonus[owner->stats.Wis]) 1384 if ((op->level + (op->resist[ATNR_HOLYWORD] / 100)) < owner->level + turn_bonus[owner->stats.Wis])
1381 scare_creature (op, owner); 1385 scare_creature (op, owner);
1382 } 1386 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines