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

Comparing deliantra/server/server/rune.C (file contents):
Revision 1.31 by root, Sun Apr 20 23:25:09 2008 UTC vs.
Revision 1.32 by root, Wed Apr 23 07:13:23 2008 UTC

383 if (tmp == NULL) 383 if (tmp == NULL)
384 { 384 {
385 new_draw_info (NDI_UNIQUE, 0, op, "There's nothing there!"); 385 new_draw_info (NDI_UNIQUE, 0, op, "There's nothing there!");
386 return 0; 386 return 0;
387 } 387 }
388
388 trap_disarm (op, tmp, 0, skill); 389 trap_disarm (op, tmp, 0, skill);
389 return 1; 390 return 1;
390
391} 391}
392 392
393int 393int
394trap_see (object *op, object *trap) 394trap_see (object *op, object *trap)
395{ 395{
402 + trap->level + trap->stats.Cha - op->level) / 10.0 * 50.0)))))) 402 + trap->level + trap->stats.Cha - op->level) / 10.0 * 50.0))))))
403 { 403 {
404 new_draw_info_format (NDI_UNIQUE, 0, op, "You spot a %s!", &trap->name); 404 new_draw_info_format (NDI_UNIQUE, 0, op, "You spot a %s!", &trap->name);
405 return 1; 405 return 1;
406 } 406 }
407
407 return 0; 408 return 0;
408} 409}
409 410
410int 411int
411trap_show (object *trap, object *where) 412trap_show (object *trap, object *where)
421} 422}
422 423
423int 424int
424trap_disarm (object *disarmer, object *trap, int risk, object *skill) 425trap_disarm (object *disarmer, object *trap, int risk, object *skill)
425{ 426{
426 int trapworth; /* need to compute the experience worth of the trap 427 int trapworth; /* need to compute the experience worth of the trap before we kill it */
427 before we kill it */
428 428
429 /* this formula awards a more reasonable amount of exp */ 429 /* this formula awards a more reasonable amount of exp */
430 trapworth = MAX (1, trap->level) * disarmer->map->difficulty * 430 trapworth = MAX (1, trap->level)
431 * disarmer->map->difficulty
431 sqr (MAX (trap->stats.dam, trap->inv ? trap->inv->level : 1)) / skill->level; 432 * sqr (MAX (trap->stats.dam, trap->inv ? trap->inv->level : 1))
433 / skill->level;
432 434
433 if (!(random_roll (0, (MAX (2, MIN (20, trap->level - skill->level + 5 - disarmer->stats.Dex / 2)) - 1), disarmer, PREFER_LOW))) 435 if (!(random_roll (0, (MAX (2, MIN (20, trap->level - skill->level + 5 - disarmer->stats.Dex / 2)) - 1), disarmer, PREFER_LOW)))
434 { 436 {
435 new_draw_info_format (NDI_UNIQUE, 0, disarmer, "You successfully disarm the %s!", &trap->name); 437 new_draw_info_format (NDI_UNIQUE, 0, disarmer, "You successfully disarm the %s!", &trap->name);
436 trap->destroy (1); 438 trap->destroy (1);
453 } 455 }
454 return 0; 456 return 0;
455 } 457 }
456} 458}
457 459
458
459/* traps need to be adjusted for the difficulty of the map. The 460/* traps need to be adjusted for the difficulty of the map. The
460 * default traps are too strong for wimpy level 1 players, and 461 * default traps are too strong for wimpy level 1 players, and
461 * unthreatening to anyone of high level 462 * unthreatening to anyone of high level
462 */ 463 */
463
464void 464void
465trap_adjust (object *trap, int difficulty) 465trap_adjust (object *trap, int difficulty)
466{ 466{
467 int i; 467 int i;
468 468

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines