Index: SevenSigns.java =================================================================== --- SevenSigns.java (revision 645) +++ SevenSigns.java (working copy) @@ -1062,6 +1062,19 @@ } /** + * Adds the specified number of festival points to the specified cabal. + * Called only when it's the first time the score is gain. + * + * @param cabal + * @param amount + */ + public void addNewFestivalScore(int cabal, int amount) + { + if (cabal == CABAL_DUSK) _duskFestivalScore += amount; + else _dawnFestivalScore += amount; + } + + /** * Send info on the current Seven Signs period to the specified player. * * @param player @@ -1365,6 +1378,8 @@ _log.info("SevenSigns: The " + getCabalName(_previousWinner) + " have won the competition with " + getCurrentScore(_previousWinner) + " points!"); break; case PERIOD_SEAL_VALIDATION: // Reset for New Cycle + + _currentCycle++; //should be here, because function resetFestivalData use this var, moved here from the end of the case // Ensure a cycle restart when this period ends. _activePeriod = PERIOD_COMP_RECRUITING; @@ -1380,13 +1395,20 @@ // NOTE: A full update of Festival data in the database is also performed. SevenSignsFestival.getInstance().resetFestivalData(false); - _dawnStoneScore = 0; - _duskStoneScore = 0; + switch (_previousWinner) //only the winner have his stone score set to 0 + { + case CABAL_DAWN: + _dawnStoneScore = 0; + break; + case CABAL_DUSK: + _duskStoneScore = 0; + break; + } _dawnFestivalScore = 0; _duskFestivalScore = 0; - _currentCycle++; + //_currentCycle++; break; } Index: SevenSignsFestival.java =================================================================== --- SevenSignsFestival.java (revision 645) +++ SevenSignsFestival.java (working copy) @@ -1492,8 +1492,10 @@ { // If the current score is greater than that for the other cabal, // then they already have the points from this festival. - if (thisCabalHighScore > otherCabalHighScore) - return false; + //if (thisCabalHighScore > otherCabalHighScore) + // return false; + //possibility for same cabal to save a new score in the same festival + //i don't know if it's retail like ... partyMembers = new FastList(); List prevParticipants = getPreviousParticipants(oracle, festivalId); @@ -1514,10 +1516,16 @@ // Only add the score to the cabal's overall if it's higher than the other cabal's score. if (offeringScore > otherCabalHighScore) { + int bestScore = Math.max (currDawnHighScore,currDuskHighScore); int contribPoints = FESTIVAL_LEVEL_SCORES[festivalId]; - // Give this cabal the festival points, while deducting them from the other. - SevenSigns.getInstance().addFestivalScore(oracle, contribPoints); + //bestScore == 0, then it's the first for all cabal that the score is gain from this festival + //It's the first time the score is gain for this festival, so give to this cabal the festival points and don't deduct points from other cabal + if (bestScore == 0) SevenSigns.getInstance().addNewFestivalScore(oracle, contribPoints); + //bestScore == otherCabalHighScore, then the other cabal have the score, but the cabal have more points so, need to be deduct from the other + else if (bestScore == otherCabalHighScore) // Give this cabal the festival points, while deducting them from the other. + SevenSigns.getInstance().addFestivalScore(oracle, contribPoints); + //else bestScore is from this cabal so no need to add score //if (Config.DEBUG) _log.info("SevenSignsFestival: This is the highest score overall so far for the " + getFestivalName(festivalId) + " festival!");