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

Comparing deliantra/server/server/skills.C (file contents):
Revision 1.34 by root, Fri May 18 13:54:52 2007 UTC vs.
Revision 1.35 by root, Sat May 19 00:31:08 2007 UTC

409 new_draw_info (NDI_UNIQUE, 0, pl, "You fail to pick the lock."); 409 new_draw_info (NDI_UNIQUE, 0, pl, "You fail to pick the lock.");
410 return 0; 410 return 0;
411 } 411 }
412} 412}
413 413
414
415/* HIDE CODE. The user becomes undetectable (not just 'invisible') for 414/* HIDE CODE. The user becomes undetectable (not just 'invisible') for
416 * a short while (success and duration dependant on player SK_level, 415 * a short while (success and duration dependant on player SK_level,
417 * dexterity, charisma, and map difficulty). 416 * dexterity, charisma, and map difficulty).
418 * Players have a good chance of becoming 'unhidden' if they move 417 * Players have a good chance of becoming 'unhidden' if they move
419 * and like invisiblity will be come visible if they attack 418 * and like invisiblity will be come visible if they attack
420 * Implemented by b.t. (thomas@astro.psu.edu) 419 * Implemented by b.t. (thomas@astro.psu.edu)
421 * July 7, 1995 - made hiding possible for monsters. -b.t. 420 * July 7, 1995 - made hiding possible for monsters. -b.t.
422 */ 421 */
423
424static int 422static int
425attempt_hide (object *op, object *skill) 423attempt_hide (object *op, object *skill)
426{ 424{
427 int number, difficulty = op->map->difficulty; 425 int number, difficulty = op->map->difficulty;
428 int terrain = hideability (op); 426 int terrain = hideability (op);
431 return 0; 429 return 0;
432 430
433 /* Hiding success and duration dependant on skill level, 431 /* Hiding success and duration dependant on skill level,
434 * op->stats.Dex, map difficulty and terrain. 432 * op->stats.Dex, map difficulty and terrain.
435 */ 433 */
436
437 number = (die_roll (2, 25, op, PREFER_LOW) - 2) / 2; 434 number = (die_roll (2, 25, op, PREFER_LOW) - 2) / 2;
435
438 if (!stand_near_hostile (op) && (number < (op->stats.Dex + skill->level + terrain - difficulty))) 436 if (!stand_near_hostile (op) && (number < (op->stats.Dex + skill->level + terrain - difficulty)))
439 { 437 {
440 op->invisible += 100; /* set the level of 'hiddeness' */ 438 op->invisible += 100; /* set the level of 'hiddeness' */
439
441 if (op->type == PLAYER) 440 if (op->type == PLAYER)
442 op->contr->tmp_invis = 1; 441 op->contr->tmp_invis = 1;
442
443 op->hide = 1; 443 op->hide = 1;
444 return 1; 444 return 1;
445 } 445 }
446
446 return 0; 447 return 0;
447} 448}
448 449
449/* patched this to take terrain into consideration */ 450/* patched this to take terrain into consideration */
450int 451int
451hide (object *op, object *skill) 452hide (object *op, object *skill)
452{ 453{
453
454 /* the preliminaries -- Can we really hide now? */ 454 /* the preliminaries -- Can we really hide now? */
455 /* this keeps monsters from using invisibilty spells and hiding */ 455 /* this keeps monsters from using invisibilty spells and hiding */
456 456
457 if (QUERY_FLAG (op, FLAG_MAKE_INVIS)) 457 if (QUERY_FLAG (op, FLAG_MAKE_INVIS))
458 { 458 {
463 { 463 {
464 new_draw_info (NDI_UNIQUE, 0, op, "Your attempt to hide breaks the invisibility spell!"); 464 new_draw_info (NDI_UNIQUE, 0, op, "Your attempt to hide breaks the invisibility spell!");
465 make_visible (op); 465 make_visible (op);
466 } 466 }
467 467
468 if (op->invisible > (50 * skill->level)) 468 if (op->invisible > 50 * skill->level)
469 { 469 {
470 new_draw_info (NDI_UNIQUE, 0, op, "You are as hidden as you can get."); 470 new_draw_info (NDI_UNIQUE, 0, op, "You are as hidden as you can get.");
471 return 0; 471 return 0;
472 } 472 }
473 473
475 { 475 {
476 new_draw_info (NDI_UNIQUE, 0, op, "You hide in the shadows."); 476 new_draw_info (NDI_UNIQUE, 0, op, "You hide in the shadows.");
477 update_object (op, UP_OBJ_FACE); 477 update_object (op, UP_OBJ_FACE);
478 return calc_skill_exp (op, NULL, skill); 478 return calc_skill_exp (op, NULL, skill);
479 } 479 }
480
480 new_draw_info (NDI_UNIQUE, 0, op, "You fail to conceal yourself."); 481 new_draw_info (NDI_UNIQUE, 0, op, "You fail to conceal yourself.");
481 return 0; 482 return 0;
482} 483}
483
484 484
485/* stop_jump() - End of jump. Clear flags, restore the map, and 485/* stop_jump() - End of jump. Clear flags, restore the map, and
486 * freeze the jumper a while to simulate the exhaustion 486 * freeze the jumper a while to simulate the exhaustion
487 * of jumping. 487 * of jumping.
488 */ 488 */
1195 return; 1195 return;
1196 } 1196 }
1197 else 1197 else
1198 { 1198 {
1199 for (tmp = pl->inv; tmp; tmp = tmp->below) 1199 for (tmp = pl->inv; tmp; tmp = tmp->below)
1200 if (((tmp->type == ARMOUR && skill->level < 12) 1200 if (((tmp->type == ARMOUR && skill->level < 12)
1201 || (tmp->type == HELMET && skill->level < 10) 1201 || (tmp->type == HELMET && skill->level < 10)
1202 || (tmp->type == SHIELD && skill->level < 6) 1202 || (tmp->type == SHIELD && skill->level < 6)
1203 || (tmp->type == BOOTS && skill->level < 4) || (tmp->type == GLOVES && skill->level < 2)) && QUERY_FLAG (tmp, FLAG_APPLIED)) 1203 || (tmp->type == BOOTS && skill->level < 4)
1204 || (tmp->type == GLOVES && skill->level < 2))
1205 && QUERY_FLAG (tmp, FLAG_APPLIED))
1204 { 1206 {
1205 new_draw_info (NDI_UNIQUE, 0, pl, "You can't concentrate while wearing so much armour!\n"); 1207 new_draw_info (NDI_UNIQUE, 0, pl, "You can't concentrate while wearing so much armour!\n");
1206 return; 1208 return;
1207 } 1209 }
1208 } 1210 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines