Skip to content

Commit 015a57d

Browse files
committed
Cleanup new reno safe scripts, ref #105
1 parent aa9a691 commit 015a57d

File tree

4 files changed

+105
-131
lines changed

4 files changed

+105
-131
lines changed

scripts_src/newreno/niabissf.ssl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ procedure use_obj_on_p_proc;
3636

3737
#define LVAR_Flags (0)
3838

39-
#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))))
40-
4139
variable prev_node;
4240
import variable angela_bishop_safe_obj;
4341
import variable bishop_roof_guard_obj;

scripts_src/newreno/nimrbsf.ssl

Lines changed: 81 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -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

108106
variable explosion_tile;
109107
import variable mr_bishop_obj;
@@ -182,7 +180,7 @@ procedure description_p_proc begin
182180
end
183181

184182
procedure 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;
202200
end
203201

204202
procedure pickup_p_proc begin
205-
variable send_warning := false;
203+
variable send_warning := false;
206204
check_safe_tamper(send_warning)
207205
end
208206

209207
procedure 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;
221219
end
222220

223221
procedure 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;
267259
end
268260

269261
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;
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
367355
end

scripts_src/newreno/nimrsbsf.ssl

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ procedure use_obj_on_p_proc;
4545
end \
4646
set_lvar_bit_on(LVAR_Flags, found_compartment_bit)
4747

48-
#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))))
49-
5048
variable prev_node;
5149
import variable mrs_bishop_safe_obj;
5250
import variable bishop_roof_guard_obj;
@@ -134,24 +132,15 @@ variable the_roll;
134132
gfade_out(ONE_GAME_SECOND);
135133
game_time_advance(15 * ONE_GAME_MINUTE);
136134
the_roll := roll_vs_skill(dude_obj, SKILL_LOCKPICK, 0);
137-
/*if (is_success(the_roll)) then begin
135+
if (is_success(the_roll)) then begin
136+
display_mstr(150);
137+
obj_unlock(self_obj);
138138
end else if ((random(1,100) <= dude_luck) and (is_critical(the_roll) == false)) then begin
139139
display_mstr(160);
140140
obj_unlock(self_obj);
141141
end else begin
142142
display_mstr(170 + (has_skill(source_obj,SKILL_LOCKPICK) < 50));
143-
end*/
144-
//edit by killap
145-
if (is_success(the_roll)) then begin
146-
display_mstr(150);
147-
obj_unlock(self_obj);
148-
end else if ((random(1,100) <= dude_luck) and (is_critical(the_roll) == false)) then begin
149-
display_mstr(160);
150-
obj_unlock(self_obj);
151-
end else begin
152-
display_mstr(170 + (has_skill(source_obj,SKILL_LOCKPICK) < 50));
153143
end
154-
//end edit by killap
155144
gfade_in(ONE_GAME_SECOND);
156145
end
157146
end else if (action_being_used == SKILL_STEAL) then begin

scripts_src/newreno/niowrisf.ssl

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ procedure damage_p_proc;
8181
end \
8282
end \
8383
end
84-
#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))))
8584

8685
variable prev_node;
8786
import variable new_reno_orville_wright_obj;
@@ -120,7 +119,7 @@ procedure description_p_proc begin
120119
end
121120

122121
procedure damage_p_proc begin
123-
variable set_off;
122+
variable set_off;
124123
if (target_obj != 0) then begin
125124
if (weapon_dmg_type(target_obj) == DMG_explosion) then begin
126125
set_off := true;
@@ -141,18 +140,18 @@ variable set_off;
141140
end
142141

143142
procedure pickup_p_proc begin
144-
variable send_warning := false;
143+
variable send_warning := false;
145144
check_safe_tamper(send_warning)
146145
end
147146

148147
procedure use_p_proc begin
149-
variable send_warning := false;
148+
variable send_warning := false;
150149
check_safe_tamper(send_warning)
151150
end
152151

153152
procedure use_skill_on_p_proc begin
154-
variable send_warning := false;
155-
variable the_roll;
153+
variable send_warning := false;
154+
variable the_roll;
156155
check_safe_tamper(send_warning)
157156
if (send_warning == false) then begin
158157
if (obj_is_locked(self_obj)) then begin
@@ -183,24 +182,24 @@ variable the_roll;
183182
end else if (action_being_used == SKILL_TRAPS) then begin
184183
script_overrides;
185184
gfade_out(ONE_GAME_MINUTE);
186-
game_time_advance(15 * ONE_GAME_MINUTE);
187-
if (get_boomw(boomw_none)) then begin
188-
the_roll := roll_vs_skill(dude_obj,SKILL_TRAPS,-50);
189-
if (is_success(the_roll)) then begin
190-
set_boomw(boomw_disarmed);
191-
display_mstr(180 + found_trap);
192-
end else if ((is_success(roll_vs_skill(dude_obj,SKILL_TRAPS,-10))) and (found_trap == false)) then begin
193-
set_found_trap;
194-
display_mstr(190);
195-
end else if ((is_critical(the_roll)) and (found_trap)) then begin
196-
display_mstr(181);
197-
set_boomw(boomw_disarmed); //added by killap
198-
end else begin
199-
display_mstr(200 + found_trap);
200-
end
185+
game_time_advance(15 * ONE_GAME_MINUTE);
186+
if (get_boomw(boomw_none)) then begin
187+
the_roll := roll_vs_skill(dude_obj,SKILL_TRAPS,-50);
188+
if (is_success(the_roll)) then begin
189+
set_boomw(boomw_disarmed);
190+
display_mstr(180 + found_trap);
191+
end else if ((is_success(roll_vs_skill(dude_obj,SKILL_TRAPS,-10))) and (found_trap == false)) then begin
192+
set_found_trap;
193+
display_mstr(190);
194+
end else if ((is_critical(the_roll)) and (found_trap)) then begin
195+
display_mstr(181);
196+
set_boomw(boomw_disarmed); //added by killap
201197
end else begin
202-
display_mstr(200);
198+
display_mstr(200 + found_trap);
203199
end
200+
end else begin
201+
display_mstr(200);
202+
end
204203
gfade_in(ONE_GAME_MINUTE);
205204
end
206205
end

0 commit comments

Comments
 (0)