aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code
diff options
context:
space:
mode:
authorwhiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-04-21 17:42:22 +0000
committerwhiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-04-21 17:42:22 +0000
commite7e9d945a53b293516c4a248abb042872759ba1d (patch)
tree5617e7aec3b43a1ec42c0a4ba5bfbb8179002bbf /Game/Code
parent3c106109e17a62c0d6c3620fc290a90410cae84c (diff)
downloadusdx-e7e9d945a53b293516c4a248abb042872759ba1d.tar.gz
usdx-e7e9d945a53b293516c4a248abb042872759ba1d.tar.xz
usdx-e7e9d945a53b293516c4a248abb042872759ba1d.zip
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
Diffstat (limited to '')
-rw-r--r--Game/Code/Classes/UParty.pas43
-rw-r--r--Game/Code/Screens/UScreenPartyNewRound.pas1
2 files changed, 40 insertions, 4 deletions
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);