From 492c0fdb7a6ac01682a208538542caa07be08f2a Mon Sep 17 00:00:00 2001 From: "theastropath@gmail.com" Date: Fri, 23 Jun 2023 23:44:21 -0400 Subject: [PATCH] Fix poolballs, add bingo goal for sinking pool balls, add bingo goal for visiting DuClare bedrooms --- DXRModules/DeusEx/Classes/DXREvents.uc | 64 +++++++++++++++++++ DXRModules/DeusEx/Classes/DXRReplaceActors.uc | 20 ++++++ DXRando/DeusEx/Classes/Poolball.uc | 18 ++++++ 3 files changed, 102 insertions(+) create mode 100644 DXRando/DeusEx/Classes/Poolball.uc diff --git a/DXRModules/DeusEx/Classes/DXREvents.uc b/DXRModules/DeusEx/Classes/DXREvents.uc index 379fb5dbb..50d0b1407 100644 --- a/DXRModules/DeusEx/Classes/DXREvents.uc +++ b/DXRModules/DeusEx/Classes/DXREvents.uc @@ -6,6 +6,7 @@ var int num_watchflags; var int bingo_win_countdown; var name rewatchflags[8]; var int num_rewatchflags; +var float PoolBallHeight; struct BingoOption { var string event, desc; @@ -84,6 +85,7 @@ function SetWatchFlags() { local LowerClassMale lcm; local Greasel g; local DamageTrigger dt; + local #var(prefix)Poolball ball; local int i; switch(dxr.localURL) { @@ -156,6 +158,8 @@ function SetWatchFlags() { case "02_NYC_BAR": WatchFlag('JockSecondStory'); WatchFlag('LeoToTheBar'); + WatchFlag('PlayPool'); + SetPoolBallHeight(); break; case "02_NYC_FREECLINIC": WatchFlag('BoughtClinicPlan'); @@ -210,6 +214,7 @@ function SetWatchFlags() { break; case "03_NYC_AIRFIELDHELIBASE": WatchFlag('HelicopterBaseAmbrosia'); + WatchFlag('PlayPool'); break; case "03_NYC_HANGAR": RewatchFlag('747Ambrosia'); @@ -233,6 +238,8 @@ function SetWatchFlags() { break; case "04_NYC_BAR": WatchFlag('LeoToTheBar'); + WatchFlag('PlayPool'); + SetPoolBallHeight(); break; case "04_NYC_HOTEL": WatchFlag('GaveRentonGun'); @@ -342,6 +349,7 @@ function SetWatchFlags() { WatchFlag('M07ChenSecondGive_Played'); WatchFlag('LDDPRussPaid'); WatchFlag('LeoToTheBar'); + WatchFlag('PlayPool'); foreach AllActors(class'Hooker1', h) { if(h.BindName == "ClubMercedes") @@ -358,6 +366,14 @@ function SetWatchFlags() { bt = class'BingoTrigger'.static.Create(self,'LuckyMoneyFreezer',vectm(-1615,-2960,-343),200,40); + foreach AllActors(class'#var(prefix)Poolball',ball){ + if (ball.Region.Zone.ZoneGroundFriction>1){ + ball.Destroy(); //There's at least one ball outside of the table. Just destroy it for simplicity + } + } + + SetPoolBallHeight(); + break; case "06_HONGKONG_WANCHAI_STREET": WatchFlag('M06PaidJunkie'); @@ -477,6 +493,8 @@ function SetWatchFlags() { break; case "08_NYC_BAR": WatchFlag('LeoToTheBar'); + WatchFlag('PlayPool'); + SetPoolBallHeight(); break; case "08_NYC_HOTEL": bt = class'BingoTrigger'.static.Create(self,'TonThirdFloor',vectm(-630,-1955,424),150,40); @@ -568,6 +586,8 @@ function SetWatchFlags() { break; case "10_PARIS_CHATEAU": WatchFlag('ChateauInComputerRoom'); + WatchFlag('ChateauInBethsRoom'); + WatchFlag('ChateauInNicolettesRoom'); break; case "11_PARIS_CATHEDRAL": WatchFlag('GuntherKillswitch'); @@ -678,6 +698,10 @@ function SetWatchFlags() { dxm.Event = 'blast_door_flag'; } break; + case "15_AREA51_ENTRANCE": + WatchFlag('PlayPool'); + SetPoolBallHeight(); + break; case "15_AREA51_FINAL": foreach AllActors(class'BookOpen', book) { if (book.textTag == '15_Book01'){ //This copy of Jacob's Shadow is also in _BUNKER and _ENTRANCE @@ -857,6 +881,32 @@ simulated function bool LeoToTheBar() return False; } +simulated function bool AllPoolBallsSunk() +{ + local #var(prefix)Poolball ball; + + foreach AllActors(class'#var(prefix)Poolball',ball){ + if (ball.Location.Z > PoolBallHeight){ + return False; + } + } + return True; +} + +simulated function SetPoolBallHeight() +{ + local #var(prefix)Poolball ball; + PoolBallHeight = 9999; + + foreach AllActors(class'#var(prefix)Poolball',ball){ + if (ball.Location.Z < PoolBallHeight){ + PoolBallHeight = ball.Location.Z; + } + } + + PoolBallHeight -= 1; +} + simulated function bool WatchGuntherKillSwitch() { local GuntherHermann gunther; @@ -903,6 +953,15 @@ simulated function Timer() _MarkBingo("GuntherHermann_Dead"); continue; } + } else if( watchflags[i] == 'PlayPool' ) { + if (AllPoolBallsSunk()){ + SendFlagEvent(watchflags[i]); + num_watchflags--; + watchflags[i] = watchflags[num_watchflags]; + watchflags[num_watchflags]=''; + i--; + continue; + } } if( dxr.flagbase.GetBool(watchflags[i]) ) { @@ -1775,6 +1834,9 @@ function string RemapBingoEvent(string eventname) case "Fish_ClassDead": case "Fish2_ClassDead": return "GoneFishing"; + case "ChateauInBethsRoom": + case "ChateauInNicolettesRoom": + return "DuClareBedrooms"; default: return eventname; } @@ -2148,6 +2210,8 @@ defaultproperties bingo_options(190)=(event="GoneFishing",desc="Kill %s fish",max=10) bingo_options(191)=(event="FordSchick_Dead",desc="Kill Ford Schick",max=1,missions=276) bingo_options(192)=(event="ChateauInComputerRoom",desc="Find Beth's secret routing station",max=1,missions=1024) + bingo_options(193)=(event="DuClareBedrooms",desc="Visit both bedrooms in the DuClare Chateau",max=2,missions=1024) + bingo_options(194)=(event="PlayPool",desc="Sink all the pool balls %s times",max=3,missions=33116) mutually_exclusive(0)=(e1="PaulDenton_Dead",e2="SavedPaul") mutually_exclusive(1)=(e1="JockBlewUp",e2="GotHelicopterInfo") diff --git a/DXRModules/DeusEx/Classes/DXRReplaceActors.uc b/DXRModules/DeusEx/Classes/DXRReplaceActors.uc index 2099aabbf..d49d4fc48 100644 --- a/DXRModules/DeusEx/Classes/DXRReplaceActors.uc +++ b/DXRModules/DeusEx/Classes/DXRReplaceActors.uc @@ -52,6 +52,9 @@ function ReplaceActors() else if( #var(prefix)MissionIntro(a) != None ) { ReplaceMissionIntro(#var(prefix)MissionIntro(a)); } + else if( #var(prefix)Poolball(a) != None ) { + ReplacePoolball(#var(prefix)Poolball(a)); + } #ifdef gmdx else if( WeaponGEPGun(a) != None ) { ReplaceGepGun(WeaponGEPGun(a)); @@ -216,6 +219,23 @@ function ReplaceWaterCooler(#var(prefix)WaterCooler a) a.Destroy(); } +function ReplacePoolball(#var(prefix)Poolball a) +{ + local DXRPoolball n; + n = DXRPoolball(SpawnReplacement(a, class'DXRPoolball')); + if(n == None) + return; + + n.SkinColor = a.SkinColor; + n.Skin = a.Skin; + // probably doesn't need this since it's all defaults + //ReplaceDecoration(a, n); +#ifdef hx + n.PrecessorName = a.PrecessorName; +#endif + a.Destroy(); +} + function ReplaceToilet(#var(prefix)Toilet a) { local DXRToilet n; diff --git a/DXRando/DeusEx/Classes/Poolball.uc b/DXRando/DeusEx/Classes/Poolball.uc new file mode 100644 index 000000000..45d5fe5f8 --- /dev/null +++ b/DXRando/DeusEx/Classes/Poolball.uc @@ -0,0 +1,18 @@ +class DXRPoolball injects #var(prefix)Poolball; + + +function Bump(actor Other) +{ + local Vector HitNormal; + + //Vanilla had logic for making sure this only happened once within a 0.2 second limit + //Presumably faster machines make that 0.02 timer pointless and I guess the balls were + //hitting each other really fast or something? I dunno man. + if (Other.IsA('#var(prefix)Poolball')) + { + PlaySound(sound'PoolballClack', SLOT_None); + HitNormal = Normal(Location - Other.Location); + Velocity = (HitNormal * VSize(Other.Velocity)) / 1.01; + Velocity.Z = 0; + } +}