Skip to content

Commit

Permalink
Add piano bingo goals
Browse files Browse the repository at this point in the history
  • Loading branch information
theastropath committed Jun 24, 2023
1 parent 450a06a commit afb6f04
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
6 changes: 6 additions & 0 deletions DXRModules/DeusEx/Classes/DXREvents.uc
Original file line number Diff line number Diff line change
Expand Up @@ -2213,6 +2213,9 @@ defaultproperties
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)
bingo_options(195)=(event="FireExtinguisher_Activated",desc="Use %s fire extinguishers",max=10)
bingo_options(196)=(event="PianoSongPlayed",desc="Play %s different songs on the piano",max=5,missions=64)
bingo_options(197)=(event="PianoSong0Played",desc="Play the theme song on the piano",max=1,missions=64)
bingo_options(198)=(event="PianoSong7Played",desc="Stauf Says...",max=1,missions=64)

mutually_exclusive(0)=(e1="PaulDenton_Dead",e2="SavedPaul")
mutually_exclusive(1)=(e1="JockBlewUp",e2="GotHelicopterInfo")
Expand All @@ -2235,6 +2238,9 @@ defaultproperties
mutually_exclusive(18)=(e1="AnnaNavarre_DeadM5",e2="AnnaNavarre_DeadM3")
mutually_exclusive(19)=(e1="AnnaNavarre_DeadM5",e2="AnnaNavarre_DeadM4")
mutually_exclusive(20)=(e1="VialAmbrosia_Activated",e2="GaveDowdAmbrosia")
mutually_exclusive(21)=(e1="AllPianoSongsPlayed",e2="PianoSong0Played")
mutually_exclusive(22)=(e1="AllPianoSongsPlayed",e2="PianoSong7Played")
mutually_exclusive(23)=(e1="PianoSong0Played",e2="PianoSong7Played")

bingo_win_countdown=-1
}
24 changes: 24 additions & 0 deletions DXRando/DeusEx/Classes/WHPiano.uc
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
class DXRPiano injects #var(prefix)WHPiano;

var int SongPlayed[16];
var DXRando dxr;

function bool ValidSong(int i)
{
if (i==1 || i==2 || i==6){
return False;
}

return True;
}

function Frob(actor Frobber, Inventory frobWith)
{
local int rnd;
Expand All @@ -16,6 +28,10 @@ function Frob(actor Frobber, Inventory frobWith)
return;
#endif

if (dxr==None){
foreach AllActors(class'DXRando', dxr) {break;}
}

rnd = Rand(16); //make sure this matches the number of sounds below
switch(rnd){
case 0:
Expand Down Expand Up @@ -101,6 +117,14 @@ function Frob(actor Frobber, Inventory frobWith)
return;
}

if (SongPlayed[rnd]==0){
SongPlayed[rnd]=1;
class'DXREvents'.static.MarkBingo(dxr,"PianoSong"$rnd$"Played");
if (ValidSong(rnd)){
class'DXREvents'.static.MarkBingo(dxr,"PianoSongPlayed");
}
}

PlaySound(SelectedSound, SLOT_Misc,5.0,, 500);
duration += 0.5;

Expand Down

0 comments on commit afb6f04

Please sign in to comment.