From: <z-...@us...> - 2008-01-29 10:47:50
|
Revision: 7692 http://armagetronad.svn.sourceforge.net/armagetronad/?rev=7692&view=rev Author: z-man Date: 2008-01-29 02:47:51 -0800 (Tue, 29 Jan 2008) Log Message: ----------- FORTRESS_HELD_SCORE now also applied on zones that vanish for lack of enemy contact. Modified Paths: -------------- armagetronad/branches/0.2.8/armagetronad/src/tron/gWinZone.cpp armagetronad/branches/0.2.8/armagetronad/src/tron/gWinZone.h Modified: armagetronad/branches/0.2.8/armagetronad/src/tron/gWinZone.cpp =================================================================== --- armagetronad/branches/0.2.8/armagetronad/src/tron/gWinZone.cpp 2008-01-29 08:44:38 UTC (rev 7691) +++ armagetronad/branches/0.2.8/armagetronad/src/tron/gWinZone.cpp 2008-01-29 10:47:51 UTC (rev 7692) @@ -740,6 +740,8 @@ } } +static int sg_onSurviveScore = 0; +static tSettingItem< int > sg_onSurviveConquestScoreConfig( "FORTRESS_HELD_SCORE", sg_onSurviveScore ); // ******************************************************************************* // * @@ -815,7 +817,17 @@ if ( sg_conquestDecayRate < 0 ) { if ( team ) - sn_ConsoleOut( tOutput( "$zone_collapse_harmless", team->Name() ) ); + { + if ( sg_onSurviveScore != 0 ) + { + // give player the survive score bonus right now, they deserve it + ZoneWasHeld(); + } + else + { + sn_ConsoleOut( tOutput( "$zone_collapse_harmless", team->Name() ) ); + } + } conquered_ = 1.0; } } @@ -1091,20 +1103,16 @@ } } -static int sg_onSurviveScore = 0; -static tSettingItem< int > sg_onSurviveConquestScoreConfig( "FORTRESS_HELD_SCORE", sg_onSurviveScore ); - - // ******************************************************************************* // * -// * OnRoundEnd +// * ZoneWasHeld // * // ******************************************************************************* //! //! // ******************************************************************************* -void gBaseZoneHack::OnRoundEnd( void ) +void gBaseZoneHack::ZoneWasHeld( void ) { // survived? if ( currentState_ == State_Safe ) @@ -1114,11 +1122,31 @@ { team->AddScore( sg_onSurviveScore, tOutput("$player_win_held_fortress"), tOutput("$player_lose_held_fortress") ); } + + currentState_ = State_Conquering; } } // ******************************************************************************* // * +// * OnRoundEnd +// * +// ******************************************************************************* +//! +//! +// ******************************************************************************* + +void gBaseZoneHack::OnRoundEnd( void ) +{ + // survived? + if ( currentState_ == State_Safe ) + { + ZoneWasHeld(); + } +} + +// ******************************************************************************* +// * // * OnEnter // * // ******************************************************************************* Modified: armagetronad/branches/0.2.8/armagetronad/src/tron/gWinZone.h =================================================================== --- armagetronad/branches/0.2.8/armagetronad/src/tron/gWinZone.h 2008-01-29 08:44:38 UTC (rev 7691) +++ armagetronad/branches/0.2.8/armagetronad/src/tron/gWinZone.h 2008-01-29 10:47:51 UTC (rev 7692) @@ -172,6 +172,8 @@ virtual void CheckSurvivor(); //!< checks for the only surviving zone virtual void OnRoundEnd(); //!< called on the end of the round + void ZoneWasHeld(); //!< call when the zone was held as long as possible with the set game rules + static void CountZonesOfTeam( eGrid const * grid, eTeam * otherTeam, int & count, gBaseZoneHack * & farthest ); //!< counts the zones belonging to the given team. REAL conquered_; //!< conquest status; zero if it is free, 1 if it has been completely conquered by the enemy This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |