Skip to content

Commit ff9b9fe

Browse files
committed
- Replaced temp with local variable in Kyle script + more cleanup.
1 parent e29dba6 commit ff9b9fe

File tree

1 file changed

+39
-41
lines changed
  • Fallout2/Fallout1in2/Mapper/source/scripts/07bos

1 file changed

+39
-41
lines changed

Fallout2/Fallout1in2/Mapper/source/scripts/07bos/KYLE.ssl

+39-41
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,11 @@ procedure gotopart;
5959
procedure smalltalk;
6060

6161
#define LVAR_Herebefore (4)
62+
#define LVAR_KnowsName (5)
6263

63-
variable known;
6464
variable Only_Once := 1;
6565
variable tmp_hostile;
66-
variable radx;
6766
variable ccount;
68-
variable loot;
6967
variable stuff;
7068

7169
procedure start begin
@@ -120,6 +118,43 @@ procedure talk_p_proc begin
120118
end
121119
end
122120

121+
procedure combat begin
122+
tmp_hostile := 1;
123+
end
124+
125+
procedure critter_p_proc begin
126+
if REP_ENEMY_BOS then begin
127+
tmp_hostile := 1;
128+
end
129+
if (tile_distance_objs(self_obj, dude_obj) > 12) then begin
130+
tmp_hostile := 0;
131+
end
132+
if (tmp_hostile) then begin
133+
set_global_var(GVAR_ENEMY_BROTHERHOOD, 1);
134+
tmp_hostile := 0;
135+
attack(dude_obj);
136+
end
137+
end
138+
139+
procedure pickup_p_proc begin
140+
if source_is_dude then begin
141+
tmp_hostile := 1;
142+
end
143+
end
144+
145+
procedure destroy_p_proc begin
146+
set_global_var(GVAR_ENEMY_BROTHERHOOD, 1);
147+
inc_good_critter
148+
end
149+
150+
procedure look_at_p_proc begin
151+
script_overrides;
152+
if (local_var(LVAR_KnowsName)) then
153+
display_msg(mstr(100));
154+
else
155+
display_msg(mstr(101));
156+
end
157+
123158
procedure goto01 begin
124159
Reply(102);
125160
NLowOption(103, goto02);
@@ -201,7 +236,7 @@ procedure goto12 begin
201236
end
202237

203238
procedure goto13 begin
204-
known := 1;
239+
set_local_var(LVAR_KnowsName, 1);
205240
Reply(137);
206241
NOption(138, goto02, 4);
207242
BOption(139, goto04, 4);
@@ -314,43 +349,6 @@ procedure gotopart begin
314349
set_global_var(GVAR_BROTHER_BUILD_POWER_ARMOR, 1);
315350
end
316351

317-
procedure combat begin
318-
tmp_hostile := 1;
319-
end
320-
321-
procedure critter_p_proc begin
322-
if REP_ENEMY_BOS then begin
323-
tmp_hostile := 1;
324-
end
325-
if (tile_distance_objs(self_obj, dude_obj) > 12) then begin
326-
tmp_hostile := 0;
327-
end
328-
if (tmp_hostile) then begin
329-
set_global_var(GVAR_ENEMY_BROTHERHOOD, 1);
330-
tmp_hostile := 0;
331-
attack(dude_obj);
332-
end
333-
end
334-
335-
procedure pickup_p_proc begin
336-
if source_is_dude then begin
337-
tmp_hostile := 1;
338-
end
339-
end
340-
341-
procedure destroy_p_proc begin
342-
set_global_var(GVAR_ENEMY_BROTHERHOOD, 1);
343-
inc_good_critter
344-
end
345-
346-
procedure look_at_p_proc begin
347-
script_overrides;
348-
if (known) then
349-
display_msg(mstr(100));
350-
else
351-
display_msg(mstr(101));
352-
end
353-
354352
procedure smalltalk begin
355353
ccount := ccount + 1;
356354
if (ccount < 6) then begin

0 commit comments

Comments
 (0)