Skip to content

Commit

Permalink
Fix DEN_Slavers encounter: slaves will fight back if attacked, and PC…
Browse files Browse the repository at this point in the history
… slaver attacking slaves will provoke other slavers. Ref #105.
  • Loading branch information
burner1024 committed Apr 12, 2024
1 parent 8d07d3a commit 0ab126c
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
scripts_dir: scripts_src
dialog_dir: data/text/english/dialog
worldmap_path: data/data/worldmap.txt
worldmap_script_sets: 258,259 622,1129 623,1129, 493,785
worldmap_script_sets: 258,259 622,1129 623,1129, 493,785, 508,628

- uses: devopsx/gha-ubuntu-i386-fix@master

Expand Down
8 changes: 1 addition & 7 deletions data/data/worldmap.txt
Original file line number Diff line number Diff line change
Expand Up @@ -497,19 +497,13 @@ type_01=Dead, pid:16777221
position=Surrounding, Spacing:3

[Encounter: DEN_Slavers]
type_00=ratio:20%, pid:16777433, Item:18(wielded), Item:(0-10)41, Item:40, Script:508 ; Male Slaver w/ Desert Eagle and Stimpak
type_00=ratio:20%, pid:16777433, Item:18(wielded), Item:(0-10)41, Item:40, Script:508 ; Male Slaver w/ Desert Eagle and Stimpak
type_01=ratio:20%, pid:16777434, Item:9(wielded), Item:(0-10)41, Item:40, Script:508 ; Female Slaver w/ Springer Rifle and Stimpak
type_02=ratio:20%, pid:16777233, Script:628 ; Cute Female Slave
type_03=ratio:20%, pid:16777238, Script:628 ; Strong Male Slave
type_04=ratio:10%, pid:16777243, Script:628 ; Generic Female Slave
type_05=ratio:10%, pid:16777244, Script:628 ; Generic Male Slave
;position=Surrounding
;position=straight_line, spacing:1
;position=straight_line, spacing:2
;position=double_line, spacing:1
position=wedge, spacing:2
;position=cone, spacing:2
;position=huddle, spacing:1

[Encounter: DEN_Slave_Run]
type_00=ratio:50%, pid:16777433, Item:5(wielded), Item:(0-10)41, Script:627 ; Male Slaver w/ Club
Expand Down
2 changes: 1 addition & 1 deletion data/scripts/scripts.lst
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ ECBandit.int ; Random Encounter Bandit # local_vars=0
ECRobber.int ; Random Encounter Robber # local_vars=0
ECHiwymn.int ; Random Encounter Highwaymen # local_vars=0
ECSlvRun.int ; Random Encounter Slavers on a Slave Run # local_vars=0
ECSlave.int ; Random Encounter Slaves # local_vars=0
ECSlave.int ; Random Encounter Slaves # local_vars=7
ECRavPty.int ; Random Encounter Rave Party # local_vars=10
ECMantis.int ; Random Encounter Mantis # local_vars=0
ECBrahmn.int ; Random Encounter Brahmin # local_vars=0
Expand Down
43 changes: 40 additions & 3 deletions scripts_src/rndenctr/ecslave.ssl
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
Copyright 1998-2003 Interplay Entertainment Corp. All rights reserved.
*/

/* Random Encounter scripts. These will be filled in more once they
have been designed.
/*
Random Encounter slave. Usually with slavers around.
*/


Expand All @@ -14,13 +14,50 @@

#include "../headers/command.h"

#define LVAR_Hostile (5)
#define LVAR_Personal_Enemy (6)

procedure start;
procedure talk_p_proc;
procedure slaves_attacked;

procedure start begin
set_self_team(TEAM_RND_SLAVE);
set_self_ai(AI_SLAVE);
end

procedure talk_p_proc begin
floater(random(100,104));
floater(random(100, 104));
end

procedure critter_p_proc begin
if (local_var(LVAR_Hostile) == 2) and self_can_see_dude then begin
call slaves_attacked;
set_local_var(LVAR_Hostile, 1);
attack(dude_obj);
end
end

// slavers protect their merchandise
procedure slaves_attacked begin
variable who;
foreach who in list_as_array(LIST_CRITTERS) begin
if get_team(who) == TEAM_RND_SLAVER then set_team(who, TEAM_RND_SLAVE);
end
end

procedure damage_p_proc begin
if source_obj == dude_obj then begin
set_local_var(LVAR_Personal_Enemy, 1);
end
end

procedure pickup_p_proc begin
if source_obj == dude_obj then begin
set_local_var(LVAR_Hostile, 2);
end
end

procedure destroy_p_proc begin
inc_good_critter
end

0 comments on commit 0ab126c

Please sign in to comment.