aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code
diff options
context:
space:
mode:
Diffstat (limited to 'Game/Code')
-rw-r--r--Game/Code/Classes/UMain.pas72
-rw-r--r--Game/Code/Screens/UScreenScore.pas2
-rw-r--r--Game/Code/Screens/UScreenSing.pas25
-rw-r--r--Game/Code/Screens/UScreenSong.pas16
-rw-r--r--Game/Code/Screens/UScreenSongMenu.pas39
-rw-r--r--Game/Code/UltraStar.dpr2
6 files changed, 136 insertions, 20 deletions
diff --git a/Game/Code/Classes/UMain.pas b/Game/Code/Classes/UMain.pas
index bc3ac1b0..347f92bc 100644
--- a/Game/Code/Classes/UMain.pas
+++ b/Game/Code/Classes/UMain.pas
@@ -96,6 +96,7 @@ var
// gracz i jego nuty
Player: array of TPlayer;
+ MeanPlayer: TPLayer;
PlayersPlay: integer;
PlaylistMedley: TMedleyPlaylist;
@@ -112,6 +113,7 @@ procedure NewNote(P: integer; Sender: TScreenSing); // detect note
function GetMidBeat(Time: real): real;
function GetTimeFromBeat(Beat: integer): real;
procedure ClearScores(PlayerNum: integer);
+procedure ClearMeanScore();
implementation
uses USongs, Math, UCommandLine, UVideo, UWebCam;
@@ -627,26 +629,56 @@ begin
begin
// add points without LineBonus
case Czesci[P].Czesc[S].Nuta[Pet].Wartosc of
- 1: Player[CP].Score := Player[CP].Score + 10000 / Czesci[P].Wartosc *
+ 1: begin
+ Player[CP].Score := Player[CP].Score + 10000 / Czesci[P].Wartosc *
Czesci[P].Czesc[S].Nuta[Pet].Wartosc;
- 2: Player[CP].ScoreGolden := Player[CP].ScoreGolden + 10000 / Czesci[P].Wartosc *
+ MeanPlayer.Score := MeanPlayer.Score + (10000 / Czesci[P].Wartosc *
+ Czesci[P].Czesc[S].Nuta[Pet].Wartosc) / PlayersPlay;
+ end;
+ 2: begin
+ Player[CP].ScoreGolden := Player[CP].ScoreGolden + 10000 / Czesci[P].Wartosc *
Czesci[P].Czesc[S].Nuta[Pet].Wartosc;
+ MeanPlayer.ScoreGolden := MeanPlayer.ScoreGolden + (10000 / Czesci[P].Wartosc *
+ Czesci[P].Czesc[S].Nuta[Pet].Wartosc) / PlayersPlay;
+ end;
end;
end else
begin
// add points with Line Bonus
case Czesci[P].Czesc[S].Nuta[Pet].Wartosc of
- 1: Player[CP].Score := Player[CP].Score + 9000 / Czesci[P].Wartosc *
+ 1: begin
+ Player[CP].Score := Player[CP].Score + 9000 / Czesci[P].Wartosc *
Czesci[P].Czesc[S].Nuta[Pet].Wartosc;
- 2: Player[CP].ScoreGolden := Player[CP].ScoreGolden + 9000 / Czesci[P].Wartosc *
+ MeanPlayer.Score := MeanPlayer.Score + (9000 / Czesci[P].Wartosc *
+ Czesci[P].Czesc[S].Nuta[Pet].Wartosc) / PlayersPlay;
+ end;
+ 2: begin
+ Player[CP].ScoreGolden := Player[CP].ScoreGolden + 9000 / Czesci[P].Wartosc *
Czesci[P].Czesc[S].Nuta[Pet].Wartosc;
+ MeanPlayer.ScoreGolden := MeanPlayer.ScoreGolden + (9000 / Czesci[P].Wartosc *
+ Czesci[P].Czesc[S].Nuta[Pet].Wartosc) / PlayersPlay;
+ end;
end;
end;
- Player[CP].ScoreI := Floor(Player[CP].Score / 10) * 10;
- Player[CP].ScoreGoldenI := Floor(Player[CP].ScoreGolden / 10) * 10;
+ MeanPlayer.ScoreI := Floor(MeanPlayer.Score / 10) * 10;
+ MeanPlayer.ScoreGoldenI := Floor(MeanPlayer.ScoreGolden / 10) * 10;
- Player[CP].ScoreTotalI := Player[CP].ScoreI + Player[CP].ScoreGoldenI + Player[CP].ScoreLineI;
+ MeanPlayer.ScoreTotalI := MeanPlayer.ScoreI + MeanPlayer.ScoreGoldenI + MeanPlayer.ScoreLineI;
+
+ if ScreenSong.SingTogether then
+ begin
+ Player[CP].ScoreI := MeanPlayer.ScoreI;
+ Player[CP].ScoreGoldenI := MeanPlayer.ScoreGoldenI;
+
+ Player[CP].ScoreTotalI := MeanPlayer.ScoreTotalI;
+ end else
+ begin
+ Player[CP].ScoreI := Floor(Player[CP].Score / 10) * 10;
+ Player[CP].ScoreGoldenI := Floor(Player[CP].ScoreGolden / 10) * 10;
+
+ Player[CP].ScoreTotalI := Player[CP].ScoreI + Player[CP].ScoreGoldenI + Player[CP].ScoreLineI;
+ end;
end;
end; // operowanie
end;
@@ -943,7 +975,6 @@ begin
Player[PlayerNum].ScoreGoldenI := 0;
Player[PlayerNum].ScoreTotalI := 0;
-
//SingBar Mod
Player[PlayerNum].ScoreLast := 0;
Player[PlayerNum].ScorePercent := 50;// Sets to 50% when song starts
@@ -955,10 +986,29 @@ begin
//PhrasenBonus - Line Bonus Mod
Player[PlayerNum].LineBonus_Visible := False; //Hide Line Bonus
Player[PlayerNum].LineBonus_Alpha := 0;
- //Player[PlayerNum].LineBonus_TargetX := 70 + PlayerNum*500; //will be done by onShow
- //Player[PlayerNum].LineBonus_TargetY := 30; //will be done by onShow
- //PhrasenBonus - Line Bonus Mod End
+end;
+
+procedure ClearMeanScore();
+begin
+ MeanPlayer.Score := 0;
+ MeanPlayer.ScoreI := 0;
+ MeanPlayer.ScoreLine := 0;
+ MeanPlayer.ScoreLineI := 0;
+ MeanPlayer.ScoreGolden := 0;
+ MeanPlayer.ScoreGoldenI := 0;
+ MeanPlayer.ScoreTotalI := 0;
+ //SingBar Mod
+ MeanPlayer.ScoreLast := 0;
+ MeanPlayer.ScorePercent := 50;// Sets to 50% when song starts
+ MeanPlayer.ScorePercentTarget := 50;// Sets to 50% when song starts
+ //end SingBar Mod
+
+ MeanPlayer.ScoreMax := 9990;
+
+ //PhrasenBonus - Line Bonus Mod
+ MeanPlayer.LineBonus_Visible := False; //Hide Line Bonus
+ MeanPlayer.LineBonus_Alpha := 0;
end;
end.
diff --git a/Game/Code/Screens/UScreenScore.pas b/Game/Code/Screens/UScreenScore.pas
index 149541a2..05983f6e 100644
--- a/Game/Code/Screens/UScreenScore.pas
+++ b/Game/Code/Screens/UScreenScore.pas
@@ -130,7 +130,7 @@ begin
Music.VoicesClose;
FadeTo(@ScreenPartyNewRoundM2);
- end else if (ScreenSong.Mode <> smMedley) and not AktSong.isDuet then
+ end else if (ScreenSong.Mode <> smMedley) and not AktSong.isDuet and not ScreenSong.SingTogether then
FadeTo(@ScreenTop)
else
begin
diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas
index 4d1b918c..9ea55e95 100644
--- a/Game/Code/Screens/UScreenSing.pas
+++ b/Game/Code/Screens/UScreenSing.pas
@@ -1560,6 +1560,8 @@ begin
for P := 0 to High(Player) do
ClearScores(P);
+ ClearMeanScore();
+
// fill texts
LyricMain[0].AddCzesc(0, 0);
LyricMain[0].Selected := -1;
@@ -2293,6 +2295,8 @@ begin
end else if(ScreenSong.Mode = smNormal) then
begin
singmode := 'Normal';
+ if ScreenSong.SingTogether then
+ singmode := singmode + ' (Sing together)';
if AktSong.isDuet then
singmode := singmode + ' (Duet)';
end;
@@ -2496,12 +2500,29 @@ begin
//PhrasenBonus give Points
if (Length(Czesci[CP].Czesc) - NumEmptySentences[CP])>0 then
+ begin
Player[I].ScoreLine := Player[I].ScoreLine +
(1000 / (Length(Czesci[CP].Czesc) - NumEmptySentences[CP]) * A / 8);
- Player[I].ScoreLineI := Round(Player[I].ScoreLine / 10) * 10;
+ MeanPlayer.ScoreLine := MeanPlayer.ScoreLine +
+ (1000 / (Length(Czesci[CP].Czesc) - NumEmptySentences[CP]) * A / 8);
+ end;
+
+ MeanPlayer.ScoreLineI := Round(MeanPlayer.ScoreLine / 10) * 10;
//Update Total Score
- Player[I].ScoreTotalI := Player[I].ScoreI + Player[I].ScoreGoldenI + Player[I].ScoreLineI;
+ MeanPlayer.ScoreTotalI := MeanPlayer.ScoreI + MeanPlayer.ScoreGoldenI + MeanPlayer.ScoreLineI;
+
+ if ScreenSong.SingTogether then
+ begin
+ Player[I].ScoreLineI := MeanPlayer.ScoreLineI;
+ //Update Total Score
+ Player[I].ScoreTotalI := MeanPlayer.ScoreTotalI;
+ end else
+ begin
+ Player[I].ScoreLineI := Round(Player[I].ScoreLine / 10) * 10;
+ //Update Total Score
+ Player[I].ScoreTotalI := Player[I].ScoreI + Player[I].ScoreGoldenI + Player[I].ScoreLineI;
+ end;
//Color
Case Floor(A) of
diff --git a/Game/Code/Screens/UScreenSong.pas b/Game/Code/Screens/UScreenSong.pas
index aa3c2bf9..aab46786 100644
--- a/Game/Code/Screens/UScreenSong.pas
+++ b/Game/Code/Screens/UScreenSong.pas
@@ -119,7 +119,8 @@ type
PartyPlayed: array of integer; //played in Party Classic
MedleyPlayed: array of integer; //played in Challenge or Classic Medley-mode
- SungToEnd: boolean; //Song was sung to the end?
+ SungToEnd: boolean; //Song was sung to the end?
+ SingTogether: boolean; //Calc mean score
//party Statics (Joker)
StaticTeam1Joker1: Cardinal;
@@ -774,8 +775,16 @@ begin
CatSongs.Selected := Interaction;
//Do the Action that is specified in Ini
case Ini.OnSongClick of
- 0: StartSong;
- 1: SelectPlayers;
+ 0: begin
+ if (SDL_ModState = KMOD_LCTRL) then
+ SingTogether := true;
+ StartSong;
+ end;
+ 1: begin
+ if (SDL_ModState = KMOD_LCTRL) then
+ SingTogether := true;
+ SelectPlayers;
+ end;
2:begin
if (TargetVidVis = full) then
begin
@@ -2024,6 +2033,7 @@ begin
FadeOut := false;
SungToEnd := false;
+ SingTogether := false;
if Mode = smMedley then
Mode := smNormal;
diff --git a/Game/Code/Screens/UScreenSongMenu.pas b/Game/Code/Screens/UScreenSongMenu.pas
index e209a176..98e8a49c 100644
--- a/Game/Code/Screens/UScreenSongMenu.pas
+++ b/Game/Code/Screens/UScreenSongMenu.pas
@@ -26,6 +26,7 @@ const
SM_Main = 1;
SM_Song = 8 or 1;
+ SM_Song_Play = 8 or 2;
SM_Medley = 16 or 1;
@@ -359,6 +360,22 @@ begin
Button[3].Text[0].Text := Language.Translate('SONG_MENU_EDIT');
end;
+ SM_Song_Play:
+ begin
+ ID := 'ID_032';
+ CurMenu := sMenu;
+ Text[0].Text := Language.Translate('SONG_MENU_PLAY');
+
+ Button[0].Visible := True;
+ Button[1].Visible := not CatSongs.Song[ScreenSong.Interaction].isDuet;
+ Button[2].Visible := False;
+ Button[3].Visible := False;
+ SelectsS[0].Visible := False;
+
+ Button[0].Text[0].Text := Language.Translate('SONG_MENU_PLAY');
+ Button[1].Text[0].Text := Language.Translate('SONG_MENU_PLAY_TOGETHER');
+ end;
+
SM_Medley:
begin
ID := 'ID_032';
@@ -629,8 +646,7 @@ begin
Case Interaction of
0: //Button 1
begin
- ScreenSong.StartSong;
- Visible := False;
+ MenuShow(SM_Song_Play);
end;
1: //Button 2
@@ -659,6 +675,25 @@ begin
end;
end;
+ SM_Song_Play:
+ begin
+ Case Interaction of
+ 0: //Button 1
+ begin
+ ScreenSong.StartSong;
+ Visible := False;
+ end;
+
+ 1: //Button 2
+ begin
+ //Select New Players then Sing:
+ ScreenSong.SingTogether := true;
+ ScreenSong.StartSong;
+ Visible := False;
+ end;
+ end;
+ end;
+
SM_Medley:
begin
Case Interaction of
diff --git a/Game/Code/UltraStar.dpr b/Game/Code/UltraStar.dpr
index 21cbb978..65b57829 100644
--- a/Game/Code/UltraStar.dpr
+++ b/Game/Code/UltraStar.dpr
@@ -123,7 +123,7 @@ uses
const
VersionName = 'UltraStar Deluxe Challenge, Medley & Duet Edition';
- VersionNumber = 'r9.17';
+ VersionNumber = 'r9.19';
var
WndTitle: string;