Compare commits

..

No commits in common. "bade6e62c0942617bec16551ab6be31736c00176" and "5076df7f376574814f37075802e6d20da05d1056" have entirely different histories.

View File

@ -323,7 +323,7 @@ UIModules_Chrono::SetTimeOffset(Player, SpecificOffset);
declare netwrite Integer Net_RoyalRounds_CheckpointUI_TotalNbSegments for Teams[0]; declare netwrite Integer Net_RoyalRounds_CheckpointUI_TotalNbSegments for Teams[0];
declare Integer[Text] CustomTimes for This = []; declare Integer[Text] CustomTimes for This = [];
declare Integer[Text][Integer] CurrentRanking for This = []; // CurrentRanking[Segment][AccountId][Time] declare Integer[Text][Integer] CurrentRanking for This = []; // CurrentRanking[Segment][AccountId][Time]
CurrentRanking[0] = []; // Init white section CurrentRanking[0] = Integer[Text]; // Init white section
declare Boolean IsStartRound = True; declare Boolean IsStartRound = True;
// Reset players for the race // Reset players for the race
@ -349,7 +349,8 @@ IsStartRound = False;
***Match_PlayLoop*** ***Match_PlayLoop***
*** ***
// Manage race events // Manage race events
foreach (Event in Race::GetPendingEvents()) { declare RacePendingEvents = Race::GetPendingEvents();
foreach (Event in RacePendingEvents) {
if (Event.Type == Events::C_Type_SkipOutro && C_DisableSkipOutro) { if (Event.Type == Events::C_Type_SkipOutro && C_DisableSkipOutro) {
Race::InvalidEvent(Event); Race::InvalidEvent(Event);
} else { } else {
@ -362,7 +363,7 @@ foreach (Event in Race::GetPendingEvents()) {
declare Integer CurrentSegment for Event.Player.Score = -1; declare Integer CurrentSegment for Event.Player.Score = -1;
Log::Log("""[RacePendingEvents] Player {{{Event.Player.User.Name }}} end the segment {{{CurrentSegment}}} at {{{Event.Player.StartTime - StartTime + Event.RaceTime}}}"""); Log::Log("""[RacePendingEvents] Player {{{Event.Player.User.Name }}} end the segment {{{CurrentSegment}}} at {{{Event.Player.StartTime - StartTime + Event.RaceTime}}}""");
if (CurrentRanking.existskey(CurrentSegment-1)) CurrentRanking[CurrentSegment-1].removekey(Event.Player.User.WebServicesUserId) ; if (CurrentRanking.existskey(CurrentSegment-1)) CurrentRanking[CurrentSegment-1].removekey(Event.Player.User.WebServicesUserId) ;
if (!CurrentRanking.existskey(CurrentSegment)) CurrentRanking[CurrentSegment] = []; if (!CurrentRanking.existskey(CurrentSegment)) CurrentRanking[CurrentSegment] = Integer[Text];
CurrentRanking[CurrentSegment][Event.Player.User.WebServicesUserId] = Event.Player.StartTime - StartTime + Event.RaceTime; CurrentRanking[CurrentSegment][Event.Player.User.WebServicesUserId] = Event.Player.StartTime - StartTime + Event.RaceTime;
// Update Ranking of the current players // Update Ranking of the current players
@ -384,7 +385,7 @@ foreach (Event in Race::GetPendingEvents()) {
Net_RoyalRounds_CheckpointUI_CurrentNbSegments = CurrentSegment; Net_RoyalRounds_CheckpointUI_CurrentNbSegments = CurrentSegment;
if (CurrentSegment < S_SegmentsPerRound) { // TODO Try to keep CP diff a the bottom of the screen if (CurrentSegment < S_SegmentsPerRound) { // TODO Try to keep CP diff a the bottom of the screen
declare Boolean ModeRounds_CanSpawn for Event.Player.Score = Rounds_Settings_CanSpawnDefault; declare ModeRounds_CanSpawn for Event.Player.Score = Rounds_Settings_CanSpawnDefault;
ModeRounds_CanSpawn = True; ModeRounds_CanSpawn = True;
CurrentSegment = CurrentSegment + 1; CurrentSegment = CurrentSegment + 1;
Race::StopSkipScoresTable(Event.Player); Race::StopSkipScoresTable(Event.Player);
@ -412,6 +413,7 @@ foreach (Event in Race::GetPendingEvents()) {
CurrentSegment = CurrentSegment - 1; CurrentSegment = CurrentSegment - 1;
} }
if (UpdateRankingTimer == 0) UpdateRankingTimer = Now + 1000; if (UpdateRankingTimer == 0) UpdateRankingTimer = Now + 1000;
declare Boolean ModeRounds_CanSpawn for Event.Player.Score = Rounds_Settings_CanSpawnDefault;
} }
} }
} }
@ -636,7 +638,8 @@ Integer GetFinishTimeout(Integer _FinishTimeout) {
if (_Player != Null) { if (_Player != Null) {
declare Integer CurrentSegment for _Player.Score; declare Integer CurrentSegment for _Player.Score;
CustomTimes[_Player.User.WebServicesUserId] = CurrentRanking[CurrentSegment][_Player.User.WebServicesUserId]; CustomTimes[_Player.User.WebServicesUserId] = CurrentRanking[CurrentSegment][_Player.User.WebServicesUserId];
} else if (!S_StrictPointDistribution) { } else {
if (!S_StrictPointDistribution) {
CustomTimes.clear(); CustomTimes.clear();
CurrentRanking = CurrentRanking.sortkeyreverse(); CurrentRanking = CurrentRanking.sortkeyreverse();
declare Integer LastTimeFromThePreviousSegment = 0; declare Integer LastTimeFromThePreviousSegment = 0;
@ -651,6 +654,7 @@ Integer GetFinishTimeout(Integer _FinishTimeout) {
} }
} }
} }
}
declare Integer BonusForFinishers = 0; declare Integer BonusForFinishers = 0;
if (S_FinisherBonusBase > 0 && S_FinisherBonusNumber > 0 && CurrentRanking.existskey(S_SegmentsPerRound)) { if (S_FinisherBonusBase > 0 && S_FinisherBonusNumber > 0 && CurrentRanking.existskey(S_SegmentsPerRound)) {
@ -674,7 +678,7 @@ Integer GetFinishTimeout(Integer _FinishTimeout) {
Points = PointsRepartition[PointsRepartition.count - 1]; Points = PointsRepartition[PointsRepartition.count - 1];
} }
declare Integer CurrentSegment for Player.Score; declare Integer CurrentSegment for Player.Score;
if (CurrentSegment == S_SegmentsPerRound && Scores::GetPlayerPrevRaceTime(Player.Score) > 0) { if (CurrentSegment == S_SegmentsPerRound) {
Points += BonusForFinishers; Points += BonusForFinishers;
} }
Scores::SetPlayerRoundPoints(Player.Score, Points); Scores::SetPlayerRoundPoints(Player.Score, Points);