Skip to content

Commit

Permalink
Sync with UPU: tests and fixes, ref BGforgeNet/Fallout2_Unofficial_Pa…
Browse files Browse the repository at this point in the history
  • Loading branch information
burner1024 committed Apr 20, 2024
1 parent ce728a5 commit 2ce30ed
Show file tree
Hide file tree
Showing 8 changed files with 73 additions and 37 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
31 changes: 11 additions & 20 deletions data/data/worldmap.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

This comment has been minimized.

Copy link
@phobos2077

phobos2077 May 1, 2024

This looks like a mistake. type_02 and type_03 appear duplicated.

This comment has been minimized.

Copy link
@burner1024

burner1024 May 1, 2024

Author Member

Yes, fixed. That's one of the things that worldmap tests will catch once enabled.

position=cone, spacing:2
team_num=129 ; TEAM_RND_NOMAD
;765 - chief
;770 - shaman

Expand Down Expand Up @@ -418,23 +419,19 @@ 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
type_01=ratio:25%, pid:16777282, Item:299, Item:(1-2)71, Item:(0-10)41, Script:493 ; Average Peasant Female w/ Hunting Rifle and Fruit
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]
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions 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 Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions scripts_src/headers/scripts.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion scripts_src/klamath/kcmaida.ssl
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ procedure Node912 begin
end

procedure Node920 begin
NMessage(890);
NMessage(234);
call Node009;
end

Expand Down
4 changes: 0 additions & 4 deletions scripts_src/main/nhmyron.ssl
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ procedure Node021;
procedure Node022;
procedure Node023;
procedure Node024;
procedure Node024a;
procedure Node025;
procedure Node026;
procedure Node101;
Expand Down Expand Up @@ -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
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 2ce30ed

Please sign in to comment.