From 81105dec41773cbb503ab071e6819bcd4703f845 Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Sat, 2 Jan 2016 00:43:45 +0000 Subject: first changes to party mode git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@3167 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/base/UParty.pas | 74 +++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 66 insertions(+), 8 deletions(-) (limited to 'src/base/UParty.pas') 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. -- cgit v1.2.3