From 44f53ae73531b0570aef1ac1adf47a146c114a49 Mon Sep 17 00:00:00 2001 From: brunzelchen Date: Sat, 5 Jun 2010 12:25:04 +0000 Subject: - code cosmetics in UDraw - fixed singbar calculation of P2 in duet mode - fixed handling of duet highscores git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/1.0.1 Challenge MOD@2445 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Classes/UDraw.pas | 36 +++++--- Game/Code/Screens/UScreenSing.pas | 177 ++++++++++++++++++++------------------ Game/Code/Screens/UScreenSong.pas | 2 +- 3 files changed, 117 insertions(+), 98 deletions(-) diff --git a/Game/Code/Classes/UDraw.pas b/Game/Code/Classes/UDraw.pas index fece85fc..94142bc7 100644 --- a/Game/Code/Classes/UDraw.pas +++ b/Game/Code/Classes/UDraw.pas @@ -750,27 +750,33 @@ begin //SingBar Mod //modded again to make it moveable: it's working, so why try harder - else if Ini.Oscilloscope = 2 then begin + else if Ini.Oscilloscope = 2 then + begin A := GetTickCount div 33; - if A <> Tickold then begin + if A <> Tickold then + begin Tickold := A; - for E := 0 to (PlayersPlay - 1) do begin //Set new Pos + Alpha + for E := 0 to (PlayersPlay - 1) do + begin //Set new Pos + Alpha I := Player[E].ScorePercentTarget - Player[E].ScorePercent; if I > 0 then Inc(Player[E].ScorePercent) else if I < 0 then Dec(Player[E].ScorePercent); end; //for end; //if - if PlayersPlay = 1 then begin + if PlayersPlay = 1 then + begin //SingDrawSingbar( 75 + 10*ScreenX, 95, 100, 8, Player[0].ScorePercent); SingDrawSingbar(Theme.Sing.StaticP1SingBar.x, Theme.Sing.StaticP1SingBar.y, Theme.Sing.StaticP1SingBar.w, Theme.Sing.StaticP1SingBar.h , Player[0].ScorePercent); end; - if PlayersPlay = 2 then begin + if PlayersPlay = 2 then + begin //SingDrawSingbar( 75 + 10*ScreenX, 95, 100, 8, Player[0].ScorePercent); //SingDrawSingbar(620 + 10*ScreenX, 95, 100, 8, Player[1].ScorePercent); SingDrawSingbar(Theme.Sing.StaticP1TwoPSingBar.x, Theme.Sing.StaticP1TwoPSingBar.y, Theme.Sing.StaticP1TwoPSingBar.w, Theme.Sing.StaticP1TwoPSingBar.h , Player[0].ScorePercent); SingDrawSingbar(Theme.Sing.StaticP2RSingBar.x, Theme.Sing.StaticP2RSingBar.y, Theme.Sing.StaticP2RSingBar.w, Theme.Sing.StaticP2RSingBar.h , Player[1].ScorePercent); end; - if PlayersPlay = 3 then begin + if PlayersPlay = 3 then + begin //SingDrawSingbar( 75 + 10*ScreenX, 95, 100, 8, Player[0].ScorePercent); //SingDrawSingbar(370 + 10*ScreenX, 95, 100, 8, Player[1].ScorePercent); //SingDrawSingbar(670 + 10*ScreenX, 95, 100, 8, Player[2].ScorePercent); @@ -778,22 +784,27 @@ begin SingDrawSingbar(Theme.Sing.StaticP2MSingBar.x, Theme.Sing.StaticP2MSingBar.y, Theme.Sing.StaticP2MSingBar.w, Theme.Sing.StaticP2MSingBar.h , Player[1].ScorePercent); SingDrawSingbar(Theme.Sing.StaticP3SingBar.x, Theme.Sing.StaticP3SingBar.y, Theme.Sing.StaticP3SingBar.w, Theme.Sing.StaticP3SingBar.h , Player[2].ScorePercent); end; - if PlayersPlay = 4 then begin - if ScreenAct = 1 then begin + if PlayersPlay = 4 then + begin + if ScreenAct = 1 then + begin //SingDrawSingbar( 75 + 10*ScreenX, 95, 100, 8, Player[0].ScorePercent); //SingDrawSingbar(620 + 10*ScreenX, 95, 100, 8, Player[1].ScorePercent); SingDrawSingbar(Theme.Sing.StaticP1TwoPSingBar.x, Theme.Sing.StaticP1TwoPSingBar.y, Theme.Sing.StaticP1TwoPSingBar.w, Theme.Sing.StaticP1TwoPSingBar.h , Player[0].ScorePercent); SingDrawSingbar(Theme.Sing.StaticP2RSingBar.x, Theme.Sing.StaticP2RSingBar.y, Theme.Sing.StaticP2RSingBar.w, Theme.Sing.StaticP2RSingBar.h , Player[1].ScorePercent); end; - if ScreenAct = 2 then begin + if ScreenAct = 2 then + begin //SingDrawSingbar( 75 + 10*ScreenX, 95, 100, 8, Player[2].ScorePercent); //SingDrawSingbar(620 + 10*ScreenX, 95, 100, 8, Player[3].ScorePercent); SingDrawSingbar(Theme.Sing.StaticP1TwoPSingBar.x, Theme.Sing.StaticP1TwoPSingBar.y, Theme.Sing.StaticP1TwoPSingBar.w, Theme.Sing.StaticP1TwoPSingBar.h , Player[2].ScorePercent); SingDrawSingbar(Theme.Sing.StaticP2RSingBar.x, Theme.Sing.StaticP2RSingBar.y, Theme.Sing.StaticP2RSingBar.w, Theme.Sing.StaticP2RSingBar.h , Player[3].ScorePercent); end; end; - if PlayersPlay = 6 then begin - if ScreenAct = 1 then begin + if PlayersPlay = 6 then + begin + if ScreenAct = 1 then + begin //SingDrawSingbar( 75 + 10*ScreenX, 95, 100, 8, Player[0].ScorePercent); //SingDrawSingbar(370 + 10*ScreenX, 95, 100, 8, Player[1].ScorePercent); //SingDrawSingbar(670 + 10*ScreenX, 95, 100, 8, Player[2].ScorePercent); @@ -801,7 +812,8 @@ begin SingDrawSingbar(Theme.Sing.StaticP2MSingBar.x, Theme.Sing.StaticP2MSingBar.y, Theme.Sing.StaticP2MSingBar.w, Theme.Sing.StaticP2MSingBar.h , Player[1].ScorePercent); SingDrawSingbar(Theme.Sing.StaticP3SingBar.x, Theme.Sing.StaticP3SingBar.y, Theme.Sing.StaticP3SingBar.w, Theme.Sing.StaticP3SingBar.h , Player[2].ScorePercent); end; - if ScreenAct = 2 then begin + if ScreenAct = 2 then + begin //SingDrawSingbar( 75 + 10*ScreenX, 95, 100, 8, Player[3].ScorePercent); //SingDrawSingbar(370 + 10*ScreenX, 95, 100, 8, Player[4].ScorePercent); //SingDrawSingbar(670 + 10*ScreenX, 95, 100, 8, Player[5].ScorePercent); diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index 9fba0ba0..fb242285 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -1209,15 +1209,19 @@ begin if Sec < 10 then Text[TextTimeText].Text := Text[TextTimeText].Text + '0'; Text[TextTimeText].Text := Text[TextTimeText].Text + IntToStr(Sec); - lastLine := Length(Czesci[0].Czesc)-1; - lastWord := Length(Czesci[0].Czesc[lastLine].Nuta)-1; - - if (lastLine>=0) and (lastWord>=0) then + if not AktSong.isDuet then begin - if (Czas.AktBeat>(Czesci[0].Czesc[lastLine].Nuta[lastWord].Start+ - Czesci[0].Czesc[lastLine].Nuta[lastWord].Dlugosc)) then - ScreenSong.SungToEnd := true; - end; + lastLine := Length(Czesci[0].Czesc)-1; + lastWord := Length(Czesci[0].Czesc[lastLine].Nuta)-1; + + if (lastLine>=0) and (lastWord>=0) then + begin + if (Czas.AktBeat>(Czesci[0].Czesc[lastLine].Nuta[lastWord].Start+ + Czesci[0].Czesc[lastLine].Nuta[lastWord].Dlugosc)) then + ScreenSong.SungToEnd := true; + end; + end else + ScreenSong.SungToEnd := false; //do not save duet stats TODO: how to save duet stats? // for medley-mode: CurTime := Czas.Teraz; @@ -1664,91 +1668,94 @@ begin if not AktSong.isDuet or (I mod 2 = CP) then begin - A := Player[I].Score + Player[I].ScoreGolden - Player[I].ScoreLast + 2; + A := Player[I].Score + Player[I].ScoreGolden - Player[I].ScoreLast + 2; - //SingBar Mod - If (Czesci[CP].Czesc[S].TotalNotes>0) then - begin - Player[I].ScorePercentTarget := Player[I].ScorePercentTarget + - floor(A / (B * Czesci[0].Czesc[S].TotalNotes / Czesci[CP].Wartosc) * 40 - 26); - if Player[I].ScorePercentTarget < 0 then Player[I].ScorePercentTarget := 0; - if Player[I].ScorePercentTarget > 99 then Player[I].ScorePercentTarget := 99; - //end Singbar Mod - end; + //SingBar Mod + If (Czesci[CP].Czesc[S].TotalNotes>0) then + begin + Player[I].ScorePercentTarget := Player[I].ScorePercentTarget + + floor(A / (B * Czesci[CP].Czesc[S].TotalNotes / Czesci[CP].Wartosc) * 40 - 26); + if Player[I].ScorePercentTarget < 0 then Player[I].ScorePercentTarget := 0; + if Player[I].ScorePercentTarget > 99 then Player[I].ScorePercentTarget := 99; + //end Singbar Mod + end; - //PhrasenBonus - Line Bonus Mod + //PhrasenBonus - Line Bonus Mod - //Generate Steps 0 to 8 - A := Floor(A / (B * Czesci[CP].Czesc[S].TotalNotes / Czesci[CP].Wartosc) * 8); + //Generate Steps 0 to 8 + A := Floor(A / (B * Czesci[CP].Czesc[S].TotalNotes / Czesci[CP].Wartosc) * 8); - If (Ini.LineBonus > 0) then - begin - //Generate Text - if A >= 8 then - Player[I].LineBonus_Text := Theme.Sing.LineBonusText[8] - else - Player[I].LineBonus_Text := Theme.Sing.LineBonusText[Floor(A)]; - - //PhrasenBonus give Points - Player[I].ScoreLine := Player[I].ScoreLine + - (1000 / (Length(Czesci[CP].Czesc) - NumEmptySentences[I mod 2]) * A / 8); - Player[I].ScoreLineI := Round(Player[I].ScoreLine / 10) * 10; - //Update Total Score - Player[I].ScoreTotalI := Player[I].ScoreI + Player[I].ScoreGoldenI + Player[I].ScoreLineI; - - //Color - Case Floor(A) of - 0: begin - Player[I].LineBonus_Color.R := 1; - Player[I].LineBonus_Color.G := 0; - Player[I].LineBonus_Color.B := 0; - end; - 1..3: begin - Player[I].LineBonus_Color.R := 1; - Player[I].LineBonus_Color.G := (A * 0.25); - Player[I].LineBonus_Color.B := 0; - end; - 4: begin - Player[I].LineBonus_Color.R := 1; - Player[I].LineBonus_Color.G := 1; - Player[I].LineBonus_Color.B := 0; - end; - 5..7: begin - Player[I].LineBonus_Color.R := 1-((a-4)*0.25); - Player[I].LineBonus_Color.G := 1; - Player[I].LineBonus_Color.B := 0; - end; - 8: begin - Player[I].LineBonus_Color.R := 0; - Player[I].LineBonus_Color.G := 1; - Player[I].LineBonus_Color.B := 0; - end; - End; //Case - //Player[I].LineBonus_Color.B := 0; - //Player[I].LineBonus_Color.R := (8-A)/8; - //Player[I].LineBonus_Color.G := A/10; - - Player[I].LineBonus_PosX := Player[I].LineBonus_StartX; - Player[I].LineBonus_PosY := Player[I].LineBonus_StartY; - Player[I].LineBonus_Alpha := 0.92; - Player[I].LineBonus_Visible := True; - Player[I].LineBonus_Age := 1; - end; + If (Ini.LineBonus > 0) then + begin + //Generate Text + if A >= 8 then + Player[I].LineBonus_Text := Theme.Sing.LineBonusText[8] + else + Player[I].LineBonus_Text := Theme.Sing.LineBonusText[Floor(A)]; + + //PhrasenBonus give Points + Player[I].ScoreLine := Player[I].ScoreLine + + (1000 / (Length(Czesci[CP].Czesc) - NumEmptySentences[I mod 2]) * A / 8); + Player[I].ScoreLineI := Round(Player[I].ScoreLine / 10) * 10; + //Update Total Score + Player[I].ScoreTotalI := Player[I].ScoreI + Player[I].ScoreGoldenI + Player[I].ScoreLineI; + + //Color + Case Floor(A) of + 0: begin + Player[I].LineBonus_Color.R := 1; + Player[I].LineBonus_Color.G := 0; + Player[I].LineBonus_Color.B := 0; + end; + 1..3: begin + Player[I].LineBonus_Color.R := 1; + Player[I].LineBonus_Color.G := (A * 0.25); + Player[I].LineBonus_Color.B := 0; + end; + 4: begin + Player[I].LineBonus_Color.R := 1; + Player[I].LineBonus_Color.G := 1; + Player[I].LineBonus_Color.B := 0; + end; + 5..7: begin + Player[I].LineBonus_Color.R := 1-((a-4)*0.25); + Player[I].LineBonus_Color.G := 1; + Player[I].LineBonus_Color.B := 0; + end; + 8: begin + Player[I].LineBonus_Color.R := 0; + Player[I].LineBonus_Color.G := 1; + Player[I].LineBonus_Color.B := 0; + end; + End; //Case + //Player[I].LineBonus_Color.B := 0; + //Player[I].LineBonus_Color.R := (8-A)/8; + //Player[I].LineBonus_Color.G := A/10; + + Player[I].LineBonus_PosX := Player[I].LineBonus_StartX; + Player[I].LineBonus_PosY := Player[I].LineBonus_StartY; + Player[I].LineBonus_Alpha := 0.92; + Player[I].LineBonus_Visible := True; + Player[I].LineBonus_Age := 1; + end; + + //PhrasenBonus - Line Bonus Mod End// } - //PhrasenBonus - Line Bonus Mod End// } + //PerfectLineTwinkle Mod (effect) Pt.1 + If (Ini.EffectSing=1) then + begin + if A >= 8 then Player[I].LastSentencePerfect := True + else Player[I].LastSentencePerfect := False; + end; + //PerfectLineTwinkle Mod end - //PerfectLineTwinkle Mod (effect) Pt.1 - If (Ini.EffectSing=1) then + //Refresh LastScore + Player[I].ScoreLast := Player[I].Score + Player[I].ScoreGolden; + end else begin - if A >= 8 then Player[I].LastSentencePerfect := True - else Player[I].LastSentencePerfect := False; + Player[I].LineBonus_Visible := false; + Player[I].LastSentencePerfect := False; end; - //PerfectLineTwinkle Mod end - - //Refresh LastScore - Player[I].ScoreLast := Player[I].Score + Player[I].ScoreGolden; - end else - Player[I].LineBonus_Visible := false; end; //PerfectLineTwinkle Mod (effect) Pt.2 diff --git a/Game/Code/Screens/UScreenSong.pas b/Game/Code/Screens/UScreenSong.pas index d7ba5619..8f3b227d 100644 --- a/Game/Code/Screens/UScreenSong.pas +++ b/Game/Code/Screens/UScreenSong.pas @@ -2693,7 +2693,7 @@ begin Music.PlayChange; ChangeMusic; SetScroll4; - end else + end else if (Ini.ShuffleTime>0) then WaitHandler.change_time := WaitHandler.change_time + TimeSkip; end; -- cgit v1.2.3