aboutsummaryrefslogtreecommitdiffstats
path: root/src/base
diff options
context:
space:
mode:
authork-m_schindler <k-m_schindler@b956fd51-792f-4845-bead-9b4dfca2ff2c>2016-01-02 00:43:45 +0000
committerk-m_schindler <k-m_schindler@b956fd51-792f-4845-bead-9b4dfca2ff2c>2016-01-02 00:43:45 +0000
commit81105dec41773cbb503ab071e6819bcd4703f845 (patch)
tree333706837eedc28c383f94f35334cb3a8786981a /src/base
parenta258171e190e67b1a4025994ee96a972cba7ae1f (diff)
downloadusdx-81105dec41773cbb503ab071e6819bcd4703f845.tar.gz
usdx-81105dec41773cbb503ab071e6819bcd4703f845.tar.xz
usdx-81105dec41773cbb503ab071e6819bcd4703f845.zip
first changes to party mode
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@3167 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'src/base')
-rw-r--r--src/base/UParty.pas74
-rw-r--r--src/base/USong.pas2
2 files changed, 67 insertions, 9 deletions
diff --git a/src/base/UParty.pas b/src/base/UParty.pas
index bc485dca..cbdaf08d 100644
--- a/src/base/UParty.pas
+++ b/src/base/UParty.pas
@@ -108,7 +108,6 @@ type
TPartyGame = class
private
- bPartyGame: boolean; //< are we playing party or standard mode
CurRound: Integer; //< indicates which of the elements of Rounds is played next (at the moment)
bPartyStarted: Boolean;
@@ -126,12 +125,16 @@ type
procedure SetRankingByScore;
public
+ bPartyGame: boolean; //< are we playing party or standard mode
+
//Teams: TTeamInfo;
Rounds: array of TParty_Round; //< holds info which modes are played in this party game (if started)
Teams: array of TParty_TeamInfo; //< holds info of teams playing in current round (private for easy manipulation of lua functions)
Modes: array of TParty_ModeInfo; //< holds info of registred party modes
+ SungPartySongs: array of integer;
+
property CurrentRound: Integer read CurRound;
constructor Create;
@@ -206,13 +209,17 @@ type
the index stands for the placing,
team is the team number (in the team array)
rank is correct rank if some teams have the
- same score.
+ same score.
}
function GetTeamRanking: AParty_TeamRanking;
{ returns a string like "Team 1 (and Team 2) win" }
function GetWinnerString(Round: integer): UTF8String;
+ procedure SaveSungPartySong(ID: integer);
+{ add when Duet is ready
+ function SongNotSungAndNotDuet(ID, N_DuetSongs: integer): boolean;
+}
destructor Destroy; override;
end;
@@ -239,7 +246,7 @@ const
PR_First = 1;
PR_Second = 2;
PR_Third = 3;
-
+
StandardModus = 0; //Modus Id that will be played in non-party mode
var
@@ -288,6 +295,8 @@ begin
// clear times played
for I := 0 to High(TimesPlayed) do
TimesPlayed[I] := 0;
+
+ SetLength(SungPartySongs, 0);
end;
{ private: some intelligent randomnes for plugins }
@@ -821,7 +830,7 @@ begin
// we set screen song to party mode
// plugin should not have to do this if it
// don't want default procedure to be executed
- ScreenSong.Mode := smPartyMode;
+ ScreenSong.Mode := smPartyClassic; // may need to be commented off
with Modes[Rounds[CurRound].Mode] do
ExecuteDefault := (CallLua(Parent, Functions.BeforeSongSelect));
@@ -873,6 +882,13 @@ begin
else
ExecuteDefault := true;
+ //set correct playersplay
+ if (bPartyGame) then
+ PlayersPlay := Length(Teams);
+{ add when Tournament is ready
+ if (ScreenSong.Mode = smPartyTournament) then
+ PlayersPlay := 2;
+}
// execute default function:
if ExecuteDefault then
begin
@@ -884,10 +900,6 @@ begin
sing screen is shown, or it should be called
by plugin if it wants to define a custom
singscreen start up. }
-
- //set correct playersplay
- if (bPartyGame) then
- PlayersPlay := Length(Teams);
end;
end;
@@ -933,7 +945,16 @@ begin
// display party score screen
Display.FadeTo(@ScreenPartyScore)
else //display standard score screen
+{ add when Tournament is ready
+ begin
+ if (ScreenSong.Mode = smPartyTournament) then
+ Display.FadeTo(@ScreenPartyTournamentWin)
+ else
+}
Display.FadeTo(@ScreenScore);
+{ add when Tournament is ready
+ end;
+}
end;
end;
@@ -1023,4 +1044,41 @@ begin
Result := Language.Translate('PARTY_NOBODY');
end;
+procedure TPartyGame.SaveSungPartySong(ID: integer);
+begin
+ SetLength(SungPartySongs, Length(SungPartySongs) + 1);
+ SungPartySongs[High(SungPartySongs)] := ID;
+end;
+{ add when Duet is ready
+function TPartyGame.SongNotSungAndNotDuet(ID, N_DuetSongs: integer): boolean;
+var
+ I: integer;
+ Sung: boolean;
+begin
+ Sung := false;
+
+ if (CatSongs.Song[ID].isDuet) then
+ begin
+ Result := false;
+ Exit;
+ end;
+
+ for I := 0 to High(SungPartySongs) do
+ begin
+ if (SungPartySongs[I] = ID) then
+ Sung := true;
+ end;
+
+ if (Sung) then
+ begin
+ if (Songs.SongList.Count - High(Party.SungPartySongs) - N_DuetSongs <= 1) then
+ Result := true
+ else
+ Result := false
+ end
+ else
+ Result := true;
+
+end;
+}
end.
diff --git a/src/base/USong.pas b/src/base/USong.pas
index 1dda2825..92d3f82d 100644
--- a/src/base/USong.pas
+++ b/src/base/USong.pas
@@ -64,7 +64,7 @@ uses
type
- TSingMode = ( smNormal, smPartyMode, smPlaylistRandom, smMedley );
+ TSingMode = ( smNormal, smPartyClassic, smPartyFree, smPartyChallenge, smPartyTournament, smJukebox, smPlaylistRandom , smMedley );
TMedleySource = ( msNone, msCalculated, msTag );