Skip to content

Commit

Permalink
Fix poolballs, add bingo goal for sinking pool balls, add bingo goal for
Browse files Browse the repository at this point in the history
visiting DuClare bedrooms
  • Loading branch information
theastropath committed Jun 24, 2023
1 parent 8c23b16 commit 492c0fd
Show file tree
Hide file tree
Showing 3 changed files with 102 additions and 0 deletions.
64 changes: 64 additions & 0 deletions DXRModules/DeusEx/Classes/DXREvents.uc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -156,6 +158,8 @@ function SetWatchFlags() {
case "02_NYC_BAR":
WatchFlag('JockSecondStory');
WatchFlag('LeoToTheBar');
WatchFlag('PlayPool');
SetPoolBallHeight();
break;
case "02_NYC_FREECLINIC":
WatchFlag('BoughtClinicPlan');
Expand Down Expand Up @@ -210,6 +214,7 @@ function SetWatchFlags() {
break;
case "03_NYC_AIRFIELDHELIBASE":
WatchFlag('HelicopterBaseAmbrosia');
WatchFlag('PlayPool');
break;
case "03_NYC_HANGAR":
RewatchFlag('747Ambrosia');
Expand All @@ -233,6 +238,8 @@ function SetWatchFlags() {
break;
case "04_NYC_BAR":
WatchFlag('LeoToTheBar');
WatchFlag('PlayPool');
SetPoolBallHeight();
break;
case "04_NYC_HOTEL":
WatchFlag('GaveRentonGun');
Expand Down Expand Up @@ -342,6 +349,7 @@ function SetWatchFlags() {
WatchFlag('M07ChenSecondGive_Played');
WatchFlag('LDDPRussPaid');
WatchFlag('LeoToTheBar');
WatchFlag('PlayPool');

foreach AllActors(class'Hooker1', h) {
if(h.BindName == "ClubMercedes")
Expand All @@ -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');
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -568,6 +586,8 @@ function SetWatchFlags() {
break;
case "10_PARIS_CHATEAU":
WatchFlag('ChateauInComputerRoom');
WatchFlag('ChateauInBethsRoom');
WatchFlag('ChateauInNicolettesRoom');
break;
case "11_PARIS_CATHEDRAL":
WatchFlag('GuntherKillswitch');
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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]) ) {
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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")
Expand Down
20 changes: 20 additions & 0 deletions DXRModules/DeusEx/Classes/DXRReplaceActors.uc
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -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;
Expand Down
18 changes: 18 additions & 0 deletions DXRando/DeusEx/Classes/Poolball.uc
Original file line number Diff line number Diff line change
@@ -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;
}
}

0 comments on commit 492c0fd

Please sign in to comment.