Skip to content

Commit 668c2c4

Browse files
committed
Replaced restock_fix macro with sfall's unsigned integer comparison
Added wipe_inventory support to Trader Bill in Abbey.
1 parent 720acd6 commit 668c2c4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+168
-184
lines changed

scripts_src/abbey/abbilbox.ssl

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
/* Include Files */
2323
#define SCRIPT_REALNAME "abbilbox"
2424
#include "../headers/define.h"
25+
#include "../sfall/lib.math.h"
2526

2627
#define NAME SCRIPT_ABBILBOX
2728

@@ -79,12 +80,8 @@ procedure map_enter_p_proc begin
7980
set_local_var(LVAR_Trapped,TRAPPED_STATUS);
8081
end
8182

82-
if (((game_time) < 0) and (local_var(LVAR_Restock_Time_Fix) == 0)) then begin
83-
set_local_var(LVAR_Restock_Time, game_time - 1);
84-
set_local_var(LVAR_Restock_Time_Fix, 1);
85-
end
86-
87-
if (local_var(LVAR_Restock_Time) < game_time) then begin
83+
if (unsigned_int_compare(local_var(LVAR_Restock_Time), game_time) < 0) then begin
84+
variable tmp_box := move_quest_items();
8885
check_restock_item(PID_BOTTLE_CAPS, 150, 225, 100)
8986
check_restock_item(PID_LEATHER_ARMOR, 1, 1, 100)
9087
check_restock_item(PID_HEALING_POWDER, 2, 4, 100)
@@ -102,6 +99,7 @@ procedure map_enter_p_proc begin
10299
check_restock_item(PID_FIRST_AID_KIT, 0, 1, 100)
103100
check_restock_item(PID_SPEAR, 1, 1, 100)
104101
check_restock_item(PID_FLARE, 1, 3, 100)
102+
call restore_critical_items(tmp_box);
105103
set_local_var(LVAR_Restock_Time, (10 * ONE_GAME_DAY) + game_time);
106104
end
107105

scripts_src/brokhill/hidocbox.ssl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#define SCRIPT_REALNAME "hidocbox"
2424
#include "../headers/define.h"
2525
#include "../headers/broken1.h"
26+
#include "../sfall/lib.math.h"
2627

2728
#define NAME SCRIPT_HIDOCBOX
2829

@@ -53,8 +54,7 @@ procedure map_enter_p_proc begin
5354

5455
broken_hills_doc_box := self_obj;
5556
if (is_loading_game == false) then begin
56-
restock_fix
57-
if (local_var(LVAR_Restock_Time) < game_time) then begin
57+
if (unsigned_int_compare(local_var(LVAR_Restock_Time), game_time) < 0) then begin
5858
variable tmp_box := move_quest_items();
5959
check_restock_item(PID_BOTTLE_CAPS, 200, 750, 100)
6060
check_restock_item(PID_FIRST_AID_KIT, 0, 1, 25)

scripts_src/brokhill/hijacbox.ssl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#define SCRIPT_REALNAME "hijacbox"
2424
#include "../headers/define.h"
2525
#include "../headers/broken1.h"
26+
#include "../sfall/lib.math.h"
2627

2728
#define NAME SCRIPT_HIJACBOX
2829

@@ -46,8 +47,7 @@ end
4647
procedure map_enter_p_proc begin
4748
broken_hills_jacob_box := self_obj;
4849
if (is_loading_game == false) then begin
49-
restock_fix
50-
if (local_var(LVAR_Restock_Time) < game_time) then begin
50+
if (unsigned_int_compare(local_var(LVAR_Restock_Time), game_time) < 0) then begin
5151
variable tmp_box := move_quest_items();
5252
check_restock_item(PID_BOTTLE_CAPS, 200, 1250, 100)
5353
check_restock_item(PID_BUFFOUT, 0, 3, 25)

scripts_src/brokhill/hilbox.ssl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#define SCRIPT_REALNAME "hilbox"
2424
#include "../headers/define.h"
2525
#include "../headers/broken1.h"
26+
#include "../sfall/lib.math.h"
2627

2728
#define NAME SCRIPT_HILBOX
2829

@@ -48,8 +49,7 @@ procedure map_enter_p_proc begin
4849
broken_hills_liz_box := self_obj;
4950
if (is_loading_game == false) then begin
5051
if (map_var(MVAR_Liz_Dead) == 0) then begin
51-
restock_fix
52-
if (local_var(LVAR_Restock_Time) < game_time) then begin
52+
if (unsigned_int_compare(local_var(LVAR_Restock_Time), game_time) < 0) then begin
5353
variable tmp_box := move_quest_items();
5454
check_restock_item(PID_BOTTLE_CAPS, 100, 300, 100)
5555
check_restock_item(PID_ROPE, 1, 5, 100)

scripts_src/brokhill/hioutbox.ssl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#define SCRIPT_REALNAME "hioutbox"
2424
#include "../headers/define.h"
2525
#include "../headers/broken1.h"
26+
#include "../sfall/lib.math.h"
2627

2728
#define NAME SCRIPT_HIOUTBOX
2829

@@ -46,8 +47,7 @@ end
4647
procedure map_enter_p_proc begin
4748
broken_hills_outfitter_box := self_obj;
4849
if (is_loading_game == false) then begin
49-
restock_fix
50-
if (local_var(LVAR_Restock_Time) < game_time) then begin
50+
if (unsigned_int_compare(local_var(LVAR_Restock_Time), game_time) < 0) then begin
5151
variable tmp_box := move_quest_items();
5252
check_restock_item(PID_BOTTLE_CAPS, 100, 500, 100)
5353
check_restock_item(PID_223_FMJ, 0, 3, 25)

scripts_src/den/dcdealer.ssl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include "../headers/define.h"
44
#include "../headers/den.h"
55
#include "../headers/denres1.h"
6+
#include "../sfall/lib.math.h"
67

78
#define NAME SCRIPT_DCDEALER
89

@@ -147,8 +148,7 @@ procedure map_enter_p_proc begin
147148
dealer := 1;
148149

149150
if (dealer and is_loading_game == false) then begin
150-
restock_fix
151-
if (local_var(LVAR_Restock_Time) < game_time) then begin
151+
if (unsigned_int_compare(local_var(LVAR_Restock_Time), game_time) < 0) then begin
152152
check_restock_item(PID_JET, 2, 5, 100)
153153
check_restock_item(PID_BUFFOUT, 0, 1, 100)
154154
check_restock_item(PID_STIMPAK, 2, 3, 100)

scripts_src/den/diflibox.ssl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright 1998-2003 Interplay Entertainment Corp. All rights reserved.
2+
Copyright 1998-2003 Interplay Entertainment Corp. All rights reserved.
33
*/
44

55
/*
@@ -18,6 +18,7 @@
1818
/* Include Files */
1919
#define SCRIPT_REALNAME "diflibox"
2020
#include "../headers/define.h"
21+
#include "../sfall/lib.math.h"
2122

2223
#define NAME SCRIPT_DIFLIBOX
2324

@@ -40,8 +41,7 @@ procedure map_enter_p_proc begin
4041
/* Set up the door state when the player first enters the map */
4142
den_flick_box_obj := self_obj;
4243
if (is_loading_game == false) then begin
43-
restock_fix
44-
if (local_var(LVAR_Restock_Time) < game_time) then begin
44+
if (unsigned_int_compare(local_var(LVAR_Restock_Time), game_time) < 0) then begin
4545
variable tmp_box := move_quest_items();
4646
self_caps_adjust(random(55, 61) - self_caps);
4747
check_restock_item(PID_JET, 0, 1, 100)

scripts_src/den/diflkbox.ssl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
/* Include Files */
2222
#define SCRIPT_REALNAME "diflkbox"
2323
#include "../headers/define.h"
24+
#include "../sfall/lib.math.h"
2425

2526
#define NAME SCRIPT_DIFLKBOX
2627

@@ -62,8 +63,7 @@ procedure map_enter_p_proc begin
6263
set_local_var(LVAR_Trapped,TRAPPED_STATUS);
6364
end
6465

65-
restock_fix
66-
if (local_var(LVAR_Restock_Time) < game_time) then begin
66+
if (unsigned_int_compare(local_var(LVAR_Restock_Time), game_time) < 0) then begin
6767
variable tmp_box := move_quest_items();
6868
check_restock_item(PID_BOTTLE_CAPS, 148, 3512, 100)
6969
check_restock_item(PID_LEATHER_ARMOR, 1, 1, 80)

scripts_src/den/dimetbox.ssl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
/* Include Files */
1919
#define SCRIPT_REALNAME "dimetbox"
2020
#include "../headers/define.h"
21+
#include "../sfall/lib.math.h"
2122

2223
#define NAME SCRIPT_DIMETBOX
2324

@@ -46,8 +47,7 @@ procedure map_enter_p_proc begin
4647
/* Set up the door state when the player first enters the map */
4748
den_metzger_box_obj := self_obj;
4849
if (is_loading_game == false) then begin
49-
restock_fix
50-
if (local_var(LVAR_Restock_Time) < game_time) then begin
50+
if (unsigned_int_compare(local_var(LVAR_Restock_Time), game_time) < 0) then begin
5151
if (gave_metzger_party_stuff) then begin
5252
off_gave_metzger_party_stuff;
5353
the_box_to_kill := create_object(PID_FOOTLOCKER_CLEAN_RIGHT, 0, 0);

scripts_src/den/dimombox.ssl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
/* Include Files */
1919
#define SCRIPT_REALNAME "dimombox"
2020
#include "../headers/define.h"
21+
#include "../sfall/lib.math.h"
2122

2223
#define NAME SCRIPT_DIMOMBOX
2324

@@ -39,8 +40,7 @@ procedure map_enter_p_proc begin
3940
/* Set up the door state when the player first enters the map */
4041
den_mom_box_obj := self_obj;
4142
if (is_loading_game == false) then begin
42-
restock_fix
43-
if (local_var(LVAR_Restock_Time) < game_time) then begin
43+
if (unsigned_int_compare(local_var(LVAR_Restock_Time), game_time) < 0) then begin
4444
variable tmp_box := move_quest_items();
4545
self_caps_adjust(random(110, 125) - self_caps);
4646
check_restock_item(PID_STIMPAK, 0, 2, 90)

0 commit comments

Comments
 (0)