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.68 by root, Sat Oct 17 21:40:38 2009 UTC vs.
Revision 1.71 by root, Sat Nov 7 13:58:01 2009 UTC

49 return -1; 49 return -1;
50 } 50 }
51 51
52 /* ADJUSTMENTS */ 52 /* ADJUSTMENTS */
53 53
54 /* Its harder to steal from hostile beings! */ 54 /* It's harder to steal from hostile beings! */
55 if (!QUERY_FLAG (victim, FLAG_UNAGGRESSIVE)) 55 if (!QUERY_FLAG (victim, FLAG_UNAGGRESSIVE))
56 roll = roll / 2; 56 roll = roll / 2;
57 57
58 /* Easier to steal from sleeping beings, or if the thief is 58 /* Easier to steal from sleeping beings, or if the thief is
59 * unseen */ 59 * unseen */
659} 659}
660 660
661/* Helper function for do_skill_ident, so that we can loop 661/* Helper function for do_skill_ident, so that we can loop
662 * over inventory AND objects on the ground conveniently. 662 * over inventory AND objects on the ground conveniently.
663 */ 663 */
664int 664static int
665do_skill_ident2 (object *tmp, object *pl, int obj_class, object *skill) 665do_skill_ident2 (object *tmp, object *pl, int obj_class, object *skill)
666{ 666{
667 int success = 0, chance; 667 int success = 0, chance;
668 int skill_value = skill->level * pl->stats.Int ? pl->stats.Int : 10; 668 int skill_value = skill->level * pl->stats.Int ? pl->stats.Int : 10;
669 669
1072 mflags = get_map_flags (m, &m, x, y, &x, &y); 1072 mflags = get_map_flags (m, &m, x, y, &x, &y);
1073 if (mflags & P_OUT_OF_MAP) 1073 if (mflags & P_OUT_OF_MAP)
1074 continue; 1074 continue;
1075 1075
1076 /* Check everything in the square for trapness */ 1076 /* Check everything in the square for trapness */
1077 for (tmp = GET_MAP_OB (m, x, y); tmp != NULL; tmp = tmp->above) 1077 for (tmp = GET_MAP_OB (m, x, y); tmp; tmp = tmp->above)
1078 { 1078 {
1079 /* And now we'd better do an inventory traversal of each 1079 /* And now we'd better do an inventory traversal of each
1080 * of these objects inventory. Like above, only 1080 * of these objects inventory. Like above, only
1081 * do this for interesting objects. 1081 * do this for interesting objects.
1082 */ 1082 */
1083 1083
1084 if (tmp->type != PLAYER && !QUERY_FLAG (tmp, FLAG_MONSTER)) 1084 if (tmp->type != PLAYER && !QUERY_FLAG (tmp, FLAG_MONSTER))
1085 { 1085 {
1086 for (tmp2 = tmp->inv; tmp2 != NULL; tmp2 = tmp2->below) 1086 for (tmp2 = tmp->inv; tmp2; tmp2 = tmp2->below)
1087 if ((tmp2->type == RUNE || tmp2->type == TRAP) && tmp2->stats.Cha <= 1) 1087 if ((tmp2->type == RUNE || tmp2->type == TRAP) && tmp2->stats.Cha <= 1)
1088 { 1088 {
1089 trap_show (tmp2, tmp); 1089 trap_show (tmp2, tmp);
1090
1090 if (trap_disarm (op, tmp2, 1, skill) && (!tmp2->owner || tmp2->owner->type != PLAYER)) 1091 if (trap_disarm (op, tmp2, 1, skill) && (!tmp2->owner || tmp2->owner->type != PLAYER))
1091 { 1092 {
1092 tmp->stats.exp = tmp->stats.Cha * tmp->level; 1093 tmp->stats.exp = tmp->stats.Cha * tmp->level;
1093 success += calc_skill_exp (op, tmp2, skill); 1094 success += calc_skill_exp (op, tmp2, skill);
1094 } 1095 }
1095 } 1096 }
1096 } 1097 }
1098
1097 if ((tmp->type == RUNE || tmp->type == TRAP) && tmp->stats.Cha <= 1) 1099 if ((tmp->type == RUNE || tmp->type == TRAP) && tmp->stats.Cha <= 1)
1098 { 1100 {
1099 trap_show (tmp, tmp); 1101 trap_show (tmp, tmp);
1100 1102
1101 if (trap_disarm (op, tmp, 1, skill) && (!tmp->owner || tmp->owner->type != PLAYER)) 1103 if (trap_disarm (op, tmp, 1, skill) && (!tmp->owner || tmp->owner->type != PLAYER))

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines