From e7e9d945a53b293516c4a248abb042872759ba1d Mon Sep 17 00:00:00 2001 From: whiteshark0 Date: Sat, 21 Apr 2007 17:42:22 +0000 Subject: Fixed some Bugs in Party Mode Fixed TeamScores are not Reseted Added SBGW to MenuSelectSlide3 to Fit the Menu a little bit More. Need much Work to be Perfect git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@126 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Classes/UParty.pas | 43 +++++++++++++++++++++++++++--- Game/Code/Screens/UScreenPartyNewRound.pas | 1 - 2 files changed, 40 insertions(+), 4 deletions(-) (limited to 'Game/Code') diff --git a/Game/Code/Classes/UParty.pas b/Game/Code/Classes/UParty.pas index e5252f82..946aca77 100644 --- a/Game/Code/Classes/UParty.pas +++ b/Game/Code/Classes/UParty.pas @@ -116,6 +116,7 @@ begin TeamMode := False; end; Teams.Teaminfo[I].Joker := Round(NumRounds*0.7); + Teams.Teaminfo[I].Score := 0; end; //Fill Plugin Array @@ -149,10 +150,46 @@ end; //---------- function TParty_Session.GetRandomPlayer(Team: Byte): Byte; var - I, J: Integer; + I, R: Integer; lowestTP: Byte; + NumPwithLTP: Byte; begin - //Get lowest TimesPlayed + LowestTP := high(Byte); + NumPwithLTP := 0; + + //Search for Players that have not often played yet + For I := 0 to Teams.Teaminfo[Team].NumPlayers-1 do + begin + if (Teams.Teaminfo[Team].Playerinfo[I].TimesPlayed < lowestTP) then + begin + lowestTP := Teams.Teaminfo[Team].Playerinfo[I].TimesPlayed; + NumPwithLTP := 1; + end + else if (Teams.Teaminfo[Team].Playerinfo[I].TimesPlayed = lowestTP) then + begin + Inc(NumPwithLTP); + end; + end; + + //Create Random No + R := Random(NumPwithLTP); + + //Search for Random Player + For I := 0 to Teams.Teaminfo[Team].NumPlayers-1 do + begin + if Teams.Teaminfo[Team].Playerinfo[I].TimesPlayed = lowestTP then + begin + //Player Found + if (R = 0) then + begin + Result := I; + Break; + end; + + Dec(R); + end; + end; + {//Get lowest TimesPlayed lowestTP := high(Byte); J := -1; for I := 0 to Teams.Teaminfo[Team].NumPlayers-1 do @@ -174,7 +211,7 @@ begin Result := Random(Teams.Teaminfo[Team].NumPlayers); until (Teams.Teaminfo[Team].Playerinfo[Result].TimesPlayed = lowestTP) else //Else Select the one with lowest TP - Result:= J; + Result:= J;} end; //---------- diff --git a/Game/Code/Screens/UScreenPartyNewRound.pas b/Game/Code/Screens/UScreenPartyNewRound.pas index c8c0febc..b268e04f 100644 --- a/Game/Code/Screens/UScreenPartyNewRound.pas +++ b/Game/Code/Screens/UScreenPartyNewRound.pas @@ -177,7 +177,6 @@ var I: Integer; begin PartySession.StartRound; - Log.LogError(InttoStr(Length(DllMan.Plugins))); //Set Visibility of Round Infos I := Length(PartySession.Rounds); -- cgit v1.2.3