@@ -82,7 +82,6 @@ procedure use_obj_on_p_proc;
82
82
set_bishop_dead \
83
83
inc_evil_critter \
84
84
set_family_crushed(family_bishop) \
85
- /*move_to(mr_bishop_obj, tile_num_in_direction(self_tile, 2, 1), self_elevation);*/ \
86
85
end \
87
86
explosion(self_tile, self_elevation, 60); \
88
87
end \
@@ -103,7 +102,6 @@ procedure use_obj_on_p_proc;
103
102
end \
104
103
end \
105
104
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))))
107
105
108
106
variable explosion_tile;
109
107
import variable mr_bishop_obj;
@@ -182,7 +180,7 @@ procedure description_p_proc begin
182
180
end
183
181
184
182
procedure damage_p_proc begin
185
- variable set_off := false;
183
+ variable set_off := false;
186
184
ndebug("safe damage_p_proc");
187
185
if (target_obj != 0) then begin
188
186
if (weapon_dmg_type(target_obj) == DMG_explosion) then begin
@@ -202,12 +200,12 @@ variable set_off := false;
202
200
end
203
201
204
202
procedure pickup_p_proc begin
205
- variable send_warning := false;
203
+ variable send_warning := false;
206
204
check_safe_tamper(send_warning)
207
205
end
208
206
209
207
procedure use_p_proc begin
210
- variable send_warning := false;
208
+ variable send_warning := false;
211
209
set_mr_bishop_safe(mr_bishop_safe_touched);
212
210
check_safe_tamper(send_warning)
213
211
if (obj_is_locked(self_obj)) then begin
@@ -221,7 +219,7 @@ variable send_warning := false;
221
219
end
222
220
223
221
procedure use_obj_on_p_proc begin
224
- variable the_roll;
222
+ variable the_roll;
225
223
if (obj_is_open(self_obj) == false) then begin
226
224
if ((obj_pid(obj_being_used_with) == PID_DYNAMITE) or (obj_pid(obj_being_used_with) == PID_PLASTIC_EXPLOSIVES)) then begin
227
225
script_overrides;
@@ -247,15 +245,9 @@ variable the_roll;
247
245
set_local_var(LVAR_Trap_Type, obj_pid(obj_being_used_with));
248
246
rm_obj_from_inven(dude_obj,obj_being_used_with); //added by killap
249
247
destroy_object(obj_being_used_with);
250
- // set_boomw(boomw_trapped);
251
248
set_boomw(boomw_none);
252
249
script_overrides;
253
250
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);*/
259
251
end else if (source_obj == dude_obj) then begin
260
252
display_mstr(270);
261
253
end else begin
@@ -267,101 +259,97 @@ variable the_roll;
267
259
end
268
260
269
261
procedure 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;
273
265
check_safe_tamper(send_warning)
274
266
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
277
270
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;
286
274
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);
303
276
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
307
278
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);
329
290
end else begin
330
- ndebug("trap_on_safe == false");
331
- display_mstr(200);
291
+ display_mstr(170 + (has_skill(source_obj,SKILL_LOCKPICK) < 50));
332
292
end
333
293
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
335
330
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
338
332
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);
342
338
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);
360
342
end else begin
361
- display_mstr(250 );
343
+ display_mstr(220 );
362
344
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);
364
352
end
365
- // end
353
+ end
366
354
end
367
355
end
0 commit comments