… | |
… | |
1053 | } |
1053 | } |
1054 | |
1054 | |
1055 | /* remove_trap() - This skill will disarm any previously discovered trap |
1055 | /* remove_trap() - This skill will disarm any previously discovered trap |
1056 | * the algorithm is based (almost totally) on the old command_disarm() - b.t. |
1056 | * the algorithm is based (almost totally) on the old command_disarm() - b.t. |
1057 | */ |
1057 | */ |
1058 | |
|
|
1059 | int |
1058 | int |
1060 | remove_trap (object *op, int dir, object *skill) |
1059 | remove_trap (object *op, int dir, object *skill) |
1061 | { |
1060 | { |
1062 | object *tmp, *tmp2; |
1061 | object *tmp, *tmp2; |
1063 | int i, success = 0, mflags; |
1062 | int i, success = 0, mflags; |
… | |
… | |
1096 | } |
1095 | } |
1097 | } |
1096 | } |
1098 | if ((tmp->type == RUNE || tmp->type == TRAP) && tmp->stats.Cha <= 1) |
1097 | if ((tmp->type == RUNE || tmp->type == TRAP) && tmp->stats.Cha <= 1) |
1099 | { |
1098 | { |
1100 | trap_show (tmp, tmp); |
1099 | trap_show (tmp, tmp); |
|
|
1100 | |
1101 | if (trap_disarm (op, tmp, 1, skill) && (!tmp->owner || tmp->owner->type != PLAYER)) |
1101 | if (trap_disarm (op, tmp, 1, skill) && (!tmp->owner || tmp->owner->type != PLAYER)) |
1102 | { |
1102 | { |
1103 | tmp->stats.exp = tmp->stats.Cha * tmp->level; |
1103 | tmp->stats.exp = tmp->stats.Cha * tmp->level; |
1104 | success += calc_skill_exp (op, tmp, skill); |
1104 | success += calc_skill_exp (op, tmp, skill); |
1105 | } |
1105 | } |
… | |
… | |
1131 | /* Check all objects - we could stop at floor objects, |
1131 | /* Check all objects - we could stop at floor objects, |
1132 | * but if someone buries an altar, I don't see a problem with |
1132 | * but if someone buries an altar, I don't see a problem with |
1133 | * going through all the objects, and it shouldn't be much slower |
1133 | * going through all the objects, and it shouldn't be much slower |
1134 | * than extra checks on object attributes. |
1134 | * than extra checks on object attributes. |
1135 | */ |
1135 | */ |
1136 | for (tmp = pl->below; tmp != NULL; tmp = tmp->below) |
1136 | for (tmp = pl->below; tmp; tmp = tmp->below) |
1137 | { |
1137 | { |
1138 | /* Only if the altar actually belongs to someone do you get special benefits */ |
1138 | /* Only if the altar actually belongs to someone do you get special benefits */ |
1139 | if (tmp && tmp->type == HOLY_ALTAR && tmp->other_arch) |
1139 | if (tmp && tmp->type == HOLY_ALTAR && tmp->other_arch) |
1140 | { |
1140 | { |
1141 | sprintf (buf, "You pray over the %s.", &tmp->name); |
1141 | sprintf (buf, "You pray over the %s.", &tmp->name); |