@@ -82,7 +82,6 @@ procedure use_obj_on_p_proc;
8282 set_bishop_dead \
8383 inc_evil_critter \
8484 set_family_crushed(family_bishop) \
85- /*move_to(mr_bishop_obj, tile_num_in_direction(self_tile, 2, 1), self_elevation);*/ \
8685 end \
8786 explosion(self_tile, self_elevation, 60); \
8887 end \
@@ -103,7 +102,6 @@ procedure use_obj_on_p_proc;
103102 end \
104103 end \
105104 end
106- #define open_chance ((5 * (get_iq(source_obj) >= 7)) + (5 * ((has_skill(source_obj, SKILL_LOCKPICK) >= 50) or (is_success(roll_vs_skill(dude_obj,SKILL_LOCKPICK,0))))) + (5 * ((get_luck(source_obj) == 9) or (get_perception(source_obj) == 9) or (is_success(do_check(source_obj, STAT_lu, 0))))) + (25 * ((get_luck(source_obj) == 10) or (get_perception(source_obj) == 10))))
107105
108106variable explosion_tile;
109107import variable mr_bishop_obj;
@@ -182,7 +180,7 @@ procedure description_p_proc begin
182180end
183181
184182procedure damage_p_proc begin
185- variable set_off := false;
183+ variable set_off := false;
186184 ndebug("safe damage_p_proc");
187185 if (target_obj != 0) then begin
188186 if (weapon_dmg_type(target_obj) == DMG_explosion) then begin
@@ -202,12 +200,12 @@ variable set_off := false;
202200end
203201
204202procedure pickup_p_proc begin
205- variable send_warning := false;
203+ variable send_warning := false;
206204 check_safe_tamper(send_warning)
207205end
208206
209207procedure use_p_proc begin
210- variable send_warning := false;
208+ variable send_warning := false;
211209 set_mr_bishop_safe(mr_bishop_safe_touched);
212210 check_safe_tamper(send_warning)
213211 if (obj_is_locked(self_obj)) then begin
@@ -221,7 +219,7 @@ variable send_warning := false;
221219end
222220
223221procedure use_obj_on_p_proc begin
224- variable the_roll;
222+ variable the_roll;
225223 if (obj_is_open(self_obj) == false) then begin
226224 if ((obj_pid(obj_being_used_with) == PID_DYNAMITE) or (obj_pid(obj_being_used_with) == PID_PLASTIC_EXPLOSIVES)) then begin
227225 script_overrides;
@@ -247,15 +245,9 @@ variable the_roll;
247245 set_local_var(LVAR_Trap_Type, obj_pid(obj_being_used_with));
248246 rm_obj_from_inven(dude_obj,obj_being_used_with); //added by killap
249247 destroy_object(obj_being_used_with);
250- // set_boomw(boomw_trapped);
251248 set_boomw(boomw_none);
252249 script_overrides;
253250 display_mstr(280);
254- /* end else if (is_critical(the_roll)) then begin
255- set_local_var(LVAR_Trap_Type, obj_pid(obj_being_used_with));
256- destroy_object(obj_being_used_with);
257- set_boomw(boomw_none);
258- set_boomw(boomw_boom);*/
259251 end else if (source_obj == dude_obj) then begin
260252 display_mstr(270);
261253 end else begin
@@ -267,101 +259,97 @@ variable the_roll;
267259end
268260
269261procedure use_skill_on_p_proc begin
270- variable send_warning := false;
271- variable the_roll;
272- script_overrides;
262+ variable send_warning := false;
263+ variable the_roll;
264+ script_overrides;
273265 check_safe_tamper(send_warning)
274266 if (send_warning == false) then begin
275- // if (obj_is_locked(self_obj)) then begin
276- if (action_being_used == SKILL_LOCKPICK) then begin
267+ if (action_being_used == SKILL_LOCKPICK) then begin
268+ script_overrides;
269+ if (trap_on_safe) then begin
277270 script_overrides;
278- if (trap_on_safe) then begin
279- script_overrides;
280- if ((is_success(roll_vs_skill(dude_obj,SKILL_TRAPS,-10))) or (found_trap)) then begin
281- display_mstr(120 + found_trap);
282- set_found_trap;
283- end else begin
284- set_boomw(boomw_boom);
285- end
271+ if ((is_success(roll_vs_skill(dude_obj,SKILL_TRAPS,-10))) or (found_trap)) then begin
272+ display_mstr(120 + found_trap);
273+ set_found_trap;
286274 end else begin
287- script_overrides;
288- the_roll := roll_vs_skill(dude_obj, SKILL_LOCKPICK, 0);
289- gfade_out(ONE_GAME_MINUTE);
290- if (mr_bishop_safe(mr_bishop_safe_know) == false) then begin
291- game_time_advance(15 * ONE_GAME_MINUTE);
292- end
293- if ((is_success(the_roll)) or (mr_bishop_safe(mr_bishop_safe_know))) then begin
294- display_mstr(150);
295- obj_unlock(self_obj);
296- end else if ((random(1,100) <= dude_luck) and (is_critical(the_roll) == false)) then begin
297- display_mstr(160);
298- obj_unlock(self_obj);
299- end else begin
300- display_mstr(170 + (has_skill(source_obj,SKILL_LOCKPICK) < 50));
301- end
302- gfade_in(ONE_GAME_MINUTE);
275+ set_boomw(boomw_boom);
303276 end
304- end else if (action_being_used == SKILL_TRAPS) then begin
305- ndebug("action_being_used == SKILL_TRAPS");
306- gfade_out(ONE_GAME_MINUTE);
277+ end else begin
307278 script_overrides;
308- game_time_advance(15 * ONE_GAME_MINUTE);
309- if (trap_on_safe) then begin
310- script_overrides;
311- ndebug("trap_on_safe");
312- the_roll := roll_vs_skill(dude_obj,SKILL_TRAPS,-25);
313- if (is_success(the_roll)) then begin
314- ndebug("should disarm safe");
315- set_boomw(boomw_disarmed);
316- display_mstr(180 + found_trap);
317- end else if ((is_success(roll_vs_skill(dude_obj,SKILL_TRAPS,-10))) and (found_trap == false)) then begin
318- ndebug("detect trap");
319- set_found_trap;
320- display_mstr(190);
321- end else if (is_critical(the_roll)) then begin
322- ndebug("traps critical fail");
323- display_mstr(290 + found_trap);
324- set_boomw(boomw_boom);
325- end else begin
326- ndebug("fell through on traps");
327- display_mstr(200 + found_trap);
328- end
279+ the_roll := roll_vs_skill(dude_obj, SKILL_LOCKPICK, 0);
280+ gfade_out(ONE_GAME_MINUTE);
281+ if (mr_bishop_safe(mr_bishop_safe_know) == false) then begin
282+ game_time_advance(15 * ONE_GAME_MINUTE);
283+ end
284+ if ((is_success(the_roll)) or (mr_bishop_safe(mr_bishop_safe_know))) then begin
285+ display_mstr(150);
286+ obj_unlock(self_obj);
287+ end else if ((random(1,100) <= dude_luck) and (is_critical(the_roll) == false)) then begin
288+ display_mstr(160);
289+ obj_unlock(self_obj);
329290 end else begin
330- ndebug("trap_on_safe == false");
331- display_mstr(200);
291+ display_mstr(170 + (has_skill(source_obj,SKILL_LOCKPICK) < 50));
332292 end
333293 gfade_in(ONE_GAME_MINUTE);
334- end else if (action_being_used == SKILL_STEAL) then begin
294+ end
295+ end else if (action_being_used == SKILL_TRAPS) then begin
296+ ndebug("action_being_used == SKILL_TRAPS");
297+ gfade_out(ONE_GAME_MINUTE);
298+ script_overrides;
299+ game_time_advance(15 * ONE_GAME_MINUTE);
300+ if (trap_on_safe) then begin
301+ script_overrides;
302+ ndebug("trap_on_safe");
303+ the_roll := roll_vs_skill(dude_obj,SKILL_TRAPS,-25);
304+ if (is_success(the_roll)) then begin
305+ ndebug("should disarm safe");
306+ set_boomw(boomw_disarmed);
307+ display_mstr(180 + found_trap);
308+ end else if ((is_success(roll_vs_skill(dude_obj,SKILL_TRAPS,-10))) and (found_trap == false)) then begin
309+ ndebug("detect trap");
310+ set_found_trap;
311+ display_mstr(190);
312+ end else if (is_critical(the_roll)) then begin
313+ ndebug("traps critical fail");
314+ display_mstr(290 + found_trap);
315+ set_boomw(boomw_boom);
316+ end else begin
317+ ndebug("fell through on traps");
318+ display_mstr(200 + found_trap);
319+ end
320+ end else begin
321+ ndebug("trap_on_safe == false");
322+ display_mstr(200);
323+ end
324+ gfade_in(ONE_GAME_MINUTE);
325+ end else if (action_being_used == SKILL_STEAL) then begin
326+ script_overrides;
327+ end else if (action_being_used == SKILL_REPAIR) then begin
328+ script_overrides;
329+ if (obj_is_open(self_obj) == false) then begin
335330 script_overrides;
336- end else if (action_being_used == SKILL_REPAIR) then begin
337- // if (trap_safe) then begin //killap's fix: changed from (trap_safe)
331+ if (has_skill(source_obj, SKILL_REPAIR) > 75) then begin
338332 script_overrides;
339- if (obj_is_open(self_obj) == false) then begin
340- script_overrides;
341- if (has_skill(source_obj, SKILL_REPAIR) > 75) then begin
333+ if (get_boomw(boomw_trapped)) then begin
334+ display_mstr(231);
335+ end else if (trap_on_safe) then begin
336+ gfade_out(ONE_GAME_MINUTE);
337+ game_time_advance(30 * ONE_GAME_MINUTE);
342338 script_overrides;
343- if (get_boomw(boomw_trapped)) then begin
344- display_mstr(231);
345- end else if (trap_on_safe) then begin
346- gfade_out(ONE_GAME_MINUTE);
347- game_time_advance(30 * ONE_GAME_MINUTE);
348- script_overrides;
349- display_mstr(230);
350- set_boomw(boomw_trapped);
351- gfade_in(ONE_GAME_MINUTE);
352- end else begin
353- display_mstr(220);
354- end
355- end else if (source_obj == dude_obj) then begin
356- display_mstr(240);
357- end else begin
358- display_msg(obj_name(source_obj) + mstr(241));
359- end
339+ display_mstr(230);
340+ set_boomw(boomw_trapped);
341+ gfade_in(ONE_GAME_MINUTE);
360342 end else begin
361- display_mstr(250 );
343+ display_mstr(220 );
362344 end
363- // end
345+ end else if (source_obj == dude_obj) then begin
346+ display_mstr(240);
347+ end else begin
348+ display_msg(obj_name(source_obj) + mstr(241));
349+ end
350+ end else begin
351+ display_mstr(250);
364352 end
365- // end
353+ end
366354 end
367355end
0 commit comments