diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 13af901b11..539bc43e3a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,8 +16,14 @@ jobs: - name: ShellCheck uses: ludeeus/action-shellcheck@master - - name: Run tests - run: ./extra/tests.sh + - name: Fallout tests + uses: BGforgeNet/fallout-tests@main + with: + scripts_h: scripts_src/headers/scripts.h + scripts_lst: data/scripts/scripts.lst + scripts_dir: scripts_src + dialog_dir: data/text/english/dialog + worldmap_path: false - name: Install wine uses: devopsx/gha-ubuntu-i386-fix@master diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 991a1c0caf..6b001f6f1f 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -13,8 +13,14 @@ jobs: - name: ShellCheck uses: ludeeus/action-shellcheck@master - - name: Run tests - run: ./extra/tests.sh + - name: Fallout tests + uses: BGforgeNet/fallout-tests@main + with: + scripts_h: scripts_src/headers/scripts.h + scripts_lst: data/scripts/scripts.lst + scripts_dir: scripts_src + dialog_dir: data/text/english/dialog + worldmap_path: false - name: Poify/Unpoify test uses: BGforgeNet/msg2po@master diff --git a/data/data/worldmap.txt b/data/data/worldmap.txt index 347bd04654..82a166e42f 100644 --- a/data/data/worldmap.txt +++ b/data/data/worldmap.txt @@ -368,9 +368,10 @@ type_00=ratio:10%, pid:16777424, Item:273, Item:4, Item:(0-10)41, Script:765 type_01=ratio:10%, pid:16777424, Item:273, Item:4, Item:(0-10)41, Script:770 ; Nomad Shaman type_02=ratio:40%, pid:16777424, Item:49, Item:284, Item:7, Item:(0-10)41, Script:622 ; Male Nomad w/ Antidote, Meat Jerky, and Spear type_03=ratio:40%, pid:16777426, Item:273, Item:4, Item:(0-10)41, Script:622 ; Female Nomad w/ Healing Powder and Knife -type_04=pid:16777226, If (Rand(10%)), Script:203 ; Brahmin -type_05=pid:16777226, If (Rand(15%)), Script:203 ; Brahmin +type_02=pid:16777268, If (Rand(10%)), Script:1129 ; Male Orphan +type_03=pid:16777269, If (Rand(15%)), Script:1129 ; Female Orphan position=cone, spacing:2 +team_num=129 ; TEAM_RND_NOMAD ;765 - chief ;770 - shaman @@ -418,10 +419,11 @@ type_01=ratio:33%, pid:16777283, Item:21(wielded), Script:623 ; Strong Peasant type_02=ratio:15%, pid:16777279, Item:320, Script:623 ; Weak Peasant Male w/ Sharpened Pole type_03=ratio:15%, pid:16777280, Item:4, Script:623 ; Weak Peasant Female w/ Knife type_04=ratio:4%, pid:16777270, Script:623 ; Male Loser - killap - adult male proto, so why child script? -type_05=pid:16777269, Script:1129 ; Female Child -type_06=pid:16777268, Script:1129 ; Male Child - killap - no longer uses adult proto with child script +type_05=pid:16777269, Script:1129 ; Female Child +type_06=pid:16777268, Script:1129 ; Male Child - killap - no longer uses adult proto with child script type_07=Dead, pid:16777298 ; Dead Dog position=Surrounding, Spacing:6, Distance:7 +team_num=131 ; TEAM_RND_HOMELESS [Encounter: KLA_Farmers] type_00=ratio:67%, pid:16777281, Item:9, Item:(0-3)71, Item:(0-10)41, Script:493 ; Average Peasant Male w/ 10mm SMG and Fruit @@ -429,12 +431,7 @@ type_01=ratio:25%, pid:16777282, Item:299, Item:(1-2)71, Item:(0-10)41, Script:4 type_02=ratio:4%, pid:16777269, Item:71, Script:785 ; Female Child w/ Fruit type_03=ratio:4%, pid:16777268, Script:785 ; Male Child -killap - no longer uses adult proto with child script type_04=Dead, pid:16777298 ; Dead Dog -;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 +team_num=183 ; TEAM_RND_FARMER position=huddle, spacing:1 [Encounter: KLA_Golden_Geckos] @@ -506,19 +503,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 @@ -2910,9 +2901,9 @@ enc_08=Chance:15%,Enc:(2-4) Bounty_Hunter_Low AMBUSH Player, If(Global(0) < -500 enc_09=Chance:15%,Enc:(2-4) Bounty_Hunter_Low_Mid AMBUSH Player, If(Global(0) < -500) And If(Player(Level) > 6) And If(Player(Level) < 13) enc_10=Chance:15%,Enc:(2-4) Bounty_Hunter_High_Mid AMBUSH Player, If(Global(0) < -500) And If(Player(Level) > 12) And If(Player(Level) < 19) enc_11=Chance:15%,Enc:(2-5) Bounty_Hunter_High AMBUSH Player, If(Global(0) < -500) And If(Player(Level) > 18) -enc_11=Chance:10%,Enc:(4-7) Morton_Brother, If(Global(386) > 0) And If(Global(386) < 6) -enc_12=Chance:5%,Counter:1,Special,Map:Special Bridge Encounter,Enc:Special1, If(Player(Level) > 9) And If(Global(605) < 1) -enc_13=Chance:3%,Counter:1,Special,Map:Special Holy Encounter 2,Enc:Special1, If(Global(614) > 0) And If(Global(606) < 1) +enc_12=Chance:10%,Enc:(4-7) Morton_Brother, If(Global(386) > 0) And If(Global(386) < 6) +enc_13=Chance:5%,Counter:1,Special,Map:Special Bridge Encounter,Enc:Special1, If(Player(Level) > 9) And If(Global(605) < 1) +enc_14=Chance:3%,Counter:1,Special,Map:Special Holy Encounter 2,Enc:Special1, If(Global(614) > 0) And If(Global(606) < 1) [Encounter Table 69] lookup_name=Wild6_D ; Area between New Reno and NCR diff --git a/data/scripts/scripts.lst b/data/scripts/scripts.lst index 4f6b4d470f..15ad7bc9e2 100644 --- a/data/scripts/scripts.lst +++ b/data/scripts/scripts.lst @@ -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 @@ -713,7 +713,7 @@ NiJulBox.int ; New Reno Jules Shop Inventory Box # local_vars=2 niEldBox.int ; New Reno Eldridge Shop Box # local_vars=2 niEldBx2.int ; New Reno Eldridge Shop Box (For Made Men) # local_vars=2 RndHoly2.int ; Map script for Holy Knights 2 # local_vars=0 -ECVorRat.int ; Vorpal Rat for Holy Knights 2 # local_vars=0 +ECVorRat.int ; Vorpal Rat for Holy Knights 2 # local_vars=8 ECpdog.int ; Paraih dog he joins your party. # local_vars=12 Ccdrill.int ; Drill Seargant in Colusa/Nevarro # local_vars=17 Ccguard.int ; Guard in Colusa/Nevarro # local_vars=12 diff --git a/scripts_src/headers/scripts.h b/scripts_src/headers/scripts.h index 6e3cb0cdcc..95f25a3146 100644 --- a/scripts_src/headers/scripts.h +++ b/scripts_src/headers/scripts.h @@ -275,7 +275,7 @@ #define SCRIPT_ECRAIDER (256) // ECRaider.int ; Random Encounter Raider #define SCRIPT_ECPEASNT (257) // ECPeasnt.int ; Random Encounter Peasant #define SCRIPT_ECMRCHNT (258) // ECMrchnt.int ; Random Encounter Merchant -#define SCRIPT_ECGUARD (259) // ECGuard.int ; Random Encounter Gaurd +#define SCRIPT_ECGUARD (259) // ECGuard.int ; Random Encounter Guard #define SCRIPT_SCRAWPAT (260) // SCRawpat.int ; Rawhide patrons at NCR Entrance #define SCRIPT_WTELFLR2 (261) // WTElFlr2.int ; Electric Floor on Level 2 Sierra Base #define SCRIPT_WTPLTRP0 (262) // WTPlTrp0.int ; Plasma Trap for Sierra Base(-30) @@ -786,7 +786,7 @@ #define SCRIPT_ECCRAZY (767) // ECCrazy.int ; Crazies from Random Encounter #define SCRIPT_ECCLMJMP (768) // ECClmJmp.int ; Random Encounter Claim Jumpers #define SCRIPT_ECCANBAL (769) // ECCanbal.int ; Random Encounter Cannibals -#define SCRIPT_ECNOMSHA (770) // ECNomsha.int ; Random Encounter Nomad Shamon +#define SCRIPT_ECNOMSHA (770) // ECNomsha.int ; Random Encounter Nomad Shaman #define SCRIPT_ECMARADR (771) // ECMaradr.int ; Random Encounter Marauder #define SCRIPT_ECROGUE (772) // ECRogue.int ; Random Encounter Rogue #define SCRIPT_ECHERMIT (773) // ECHermit.int ; Random Encounter Hermit @@ -905,7 +905,7 @@ #define SCRIPT_SSEMIEN1 (886) // SSEmiEn1.int ; Ncr emitters for ncr entrance on map 1 #define SCRIPT_QIBSTDR1 (887) // QIBstDr1.int ; Blast Door for Reactor Off to remain closed #define SCRIPT_QIBSTDR2 (888) // QIBstDr2.int ; Blast Door for Reactor On to remain closed -#define SCRIPT_VIDARBOX (889) // VIDarBox.int ; Vault City Darrow Shop Box +#define SCRIPT_VIDARBOX (889) // VIDarBox.int ; Vault City Darrow Shop Box #define SCRIPT_HSCRLDR (890) // HSCrlDr.int ; Jail cell door for Broken Hills #define SCRIPT_ECTLKMUT (891) // ecTlkMut.int ; Military Base Conversation Mutants #define SCRIPT_FCCHEMST (892) // FCChemst.int ; Chemist in San Francisco diff --git a/scripts_src/klamath/kcmaida.ssl b/scripts_src/klamath/kcmaida.ssl index 1e5c98c5c5..76e2bddd22 100644 --- a/scripts_src/klamath/kcmaida.ssl +++ b/scripts_src/klamath/kcmaida.ssl @@ -357,7 +357,7 @@ procedure Node912 begin end procedure Node920 begin - NMessage(890); + NMessage(234); call Node009; end diff --git a/scripts_src/main/nhmyron.ssl b/scripts_src/main/nhmyron.ssl index e4674bcfa8..02f08a10aa 100644 --- a/scripts_src/main/nhmyron.ssl +++ b/scripts_src/main/nhmyron.ssl @@ -69,7 +69,6 @@ procedure Node021; procedure Node022; procedure Node023; procedure Node024; -procedure Node024a; procedure Node025; procedure Node026; procedure Node101; @@ -947,9 +946,6 @@ end procedure Node024 begin floater_rand(590, 595); end -procedure Node024a begin - floater_rand(596, 599); -end procedure Node025 begin floater(600); end diff --git a/scripts_src/rndenctr/ecslave.ssl b/scripts_src/rndenctr/ecslave.ssl index fac1a68434..e6358ee10e 100644 --- a/scripts_src/rndenctr/ecslave.ssl +++ b/scripts_src/rndenctr/ecslave.ssl @@ -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. */ @@ -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