Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1099 lines
36 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================
  6. #include "cbase.h"
  7. #ifdef CLIENT_DLL
  8. #include "achievementmgr.h"
  9. #include "baseachievement.h"
  10. #include "tf_hud_statpanel.h"
  11. #include "c_tf_team.h"
  12. #include "c_tf_player.h"
  13. #include "c_tf_playerresource.h"
  14. #include "tf_gamerules.h"
  15. #include "achievements_tf.h"
  16. #include "c_obj_sentrygun.h"
  17. //======================================================================================================================================
  18. // ENGINEER ACHIEVEMENT PACK
  19. //======================================================================================================================================
  20. //----------------------------------------------------------------------------------------------------------------
  21. // Use a revenge crit to kill the player that destroyed your sentry.
  22. //----------------------------------------------------------------------------------------------------------------
  23. class CAchievementTFEngineer_RevengeCritForSentryKiller : public CBaseTFAchievement
  24. {
  25. protected:
  26. CBaseEntity* m_pSentryKiller;
  27. public:
  28. DECLARE_CLASS( CAchievementTFEngineer_RevengeCritForSentryKiller, CBaseAchievement );
  29. virtual void Init()
  30. {
  31. SetFlags( ACH_SAVE_GLOBAL | ACH_LISTEN_KILL_EVENTS );
  32. ListenForGameEvent( "object_destroyed" );
  33. ResetTracking();
  34. }
  35. virtual void ListenForEvents()
  36. {
  37. ListenForGameEvent( "object_destroyed" );
  38. ResetTracking();
  39. }
  40. virtual void Event_EntityKilled( CBaseEntity *pVictim, CBaseEntity *pAttacker, CBaseEntity *pInflictor, IGameEvent *event )
  41. {
  42. if ( !m_pSentryKiller || !pVictim || !pAttacker )
  43. return;
  44. // if the local player has killed the thing that killed it's sentry,
  45. // give the achievement
  46. if ( pAttacker == C_BasePlayer::GetLocalPlayer() &&
  47. pVictim == m_pSentryKiller &&
  48. event->GetInt( "customkill" ) == TF_DMG_CUSTOM_SHOTGUN_REVENGE_CRIT )
  49. {
  50. AwardAchievement();
  51. }
  52. }
  53. virtual void FireGameEvent_Internal( IGameEvent *event )
  54. {
  55. C_TFPlayer *pLocalPlayer = C_TFPlayer::GetLocalTFPlayer();
  56. if ( !pLocalPlayer )
  57. return;
  58. // if the object getting killed is the local player's sentry gun,
  59. // store away who the killer was
  60. if ( FStrEq( event->GetName(), "object_destroyed" ) )
  61. {
  62. int iObject = event->GetInt( "objecttype" );
  63. if ( iObject == OBJ_SENTRYGUN )
  64. {
  65. int iEngineerIdx = engine->GetPlayerForUserID( event->GetInt( "userid" ) );
  66. CBaseEntity *pOwner = UTIL_PlayerByIndex( iEngineerIdx );
  67. if ( pOwner == pLocalPlayer )
  68. {
  69. int iAttackerIdx = engine->GetPlayerForUserID( event->GetInt( "attacker" ) );
  70. CBaseEntity *pKiller = UTIL_PlayerByIndex( iAttackerIdx );
  71. if ( pKiller != NULL )
  72. {
  73. m_pSentryKiller = pKiller;
  74. }
  75. }
  76. }
  77. }
  78. }
  79. void ResetTracking()
  80. {
  81. m_pSentryKiller = NULL;
  82. }
  83. };
  84. DECLARE_ACHIEVEMENT( CAchievementTFEngineer_RevengeCritForSentryKiller, ACHIEVEMENT_TF_ENGINEER_REVENGE_CRIT_SENTRY_KILLER, "TF_ENGINEER_REVENGE_CRIT_SENTRY_KILLER", 5 );
  85. //----------------------------------------------------------------------------------------------------------------
  86. // Kill X enemies outside the normal sentry gun range using manual control.
  87. //----------------------------------------------------------------------------------------------------------------
  88. class CAchievementTFEngineer_ManualSentryKillsBeyondRange : public CBaseTFAchievement
  89. {
  90. public:
  91. DECLARE_CLASS( CAchievementTFEngineer_ManualSentryKillsBeyondRange, CBaseAchievement );
  92. virtual void Init()
  93. {
  94. SetFlags( ACH_SAVE_GLOBAL );
  95. SetGoal( 10 );
  96. SetStoreProgressInSteam( true );
  97. }
  98. // server awards this achievement, no other code within achievement necessary
  99. };
  100. DECLARE_ACHIEVEMENT( CAchievementTFEngineer_ManualSentryKillsBeyondRange, ACHIEVEMENT_TF_ENGINEER_MANUAL_SENTRY_KILLS_BEYOND_RANGE, "TF_ENGINEER_MANUAL_SENTRY_KILLS_BEYOND_RANGE", 5 );
  101. //----------------------------------------------------------------------------------------------------------------
  102. // Have a manual sentry absorb X amount of damage during the course of its life.
  103. //----------------------------------------------------------------------------------------------------------------
  104. class CAchievementTFEngineer_ManualSentryAbsorbDamage : public CBaseTFAchievement
  105. {
  106. public:
  107. DECLARE_CLASS( CAchievementTFEngineer_ManualSentryAbsorbDamage, CBaseAchievement );
  108. virtual void Init()
  109. {
  110. SetFlags( ACH_SAVE_GLOBAL );
  111. SetGoal( 1 );
  112. }
  113. // server awards this achievement, no other code within achievement necessary
  114. };
  115. DECLARE_ACHIEVEMENT( CAchievementTFEngineer_ManualSentryAbsorbDamage, ACHIEVEMENT_TF_ENGINEER_MANUAL_SENTRY_ABSORB_DMG, "TF_ENGINEER_MANUAL_SENTRY_ABSORB_DMG", 5 );
  116. //----------------------------------------------------------------------------------------------------------------
  117. // Help a teammate build a structure.
  118. //----------------------------------------------------------------------------------------------------------------
  119. class CAchievementTFEngineer_HelpTeammateBuildStructure : public CBaseTFAchievement
  120. {
  121. public:
  122. DECLARE_CLASS( CAchievementTFEngineer_HelpTeammateBuildStructure, CBaseAchievement );
  123. virtual void Init()
  124. {
  125. SetFlags( ACH_SAVE_GLOBAL );
  126. SetGoal( 1 );
  127. }
  128. // server awards this achievement, no other code within achievement necessary
  129. };
  130. DECLARE_ACHIEVEMENT( CAchievementTFEngineer_HelpTeammateBuildStructure, ACHIEVEMENT_TF_ENGINEER_HELP_BUILD_STRUCTURE, "TF_ENGINEER_HELP_BUILD_STRUCTURE", 5 );
  131. //----------------------------------------------------------------------------------------------------------------
  132. // Shotgun kill an enemy recently damaged by your sentry gun
  133. //----------------------------------------------------------------------------------------------------------------
  134. class CAchievementTFEngineer_ShotgunKillPreviousSentryTarget : public CBaseTFAchievement
  135. {
  136. public:
  137. DECLARE_CLASS( CAchievementTFEngineer_ShotgunKillPreviousSentryTarget, CBaseAchievement );
  138. virtual void Init()
  139. {
  140. SetFlags( ACH_SAVE_GLOBAL );
  141. SetGoal( 1 );
  142. }
  143. // server awards this achievement, no other code within achievement necessary
  144. };
  145. DECLARE_ACHIEVEMENT( CAchievementTFEngineer_ShotgunKillPreviousSentryTarget, ACHIEVEMENT_TF_ENGINEER_SHOTGUN_KILL_PREV_SENTRY_TARGET, "TF_ENGINEER_SHOTGUN_KILL_PREV_SENTRY_TARGET", 5 );
  146. //----------------------------------------------------------------------------------------------------------------
  147. // Have your sentry kill the enemy that just killed you within X seconds.
  148. //----------------------------------------------------------------------------------------------------------------
  149. class CAchievementTFEngineer_SentryAvengesYou : public CBaseTFAchievement
  150. {
  151. protected:
  152. CBaseEntity* m_pPlayerKiller;
  153. float m_flPlayerDeathStartTime;
  154. public:
  155. DECLARE_CLASS( CAchievementTFEngineer_SentryAvengesYou, CBaseAchievement );
  156. virtual void Init()
  157. {
  158. SetFlags( ACH_SAVE_GLOBAL | ACH_LISTEN_KILL_EVENTS );
  159. ListenForGameEvent( "object_destroyed" );
  160. ResetTracking();
  161. }
  162. virtual void ListenForEvents()
  163. {
  164. ListenForGameEvent( "object_destroyed" );
  165. ResetTracking();
  166. }
  167. virtual void Event_EntityKilled( CBaseEntity *pVictim, CBaseEntity *pAttacker, CBaseEntity *pInflictor, IGameEvent *event )
  168. {
  169. if ( !pVictim || !pAttacker || pVictim == pAttacker )
  170. return;
  171. C_TFPlayer *pLocalPlayer = C_TFPlayer::GetLocalTFPlayer();
  172. if ( !pLocalPlayer )
  173. return;
  174. static const float kRevengeTimeLimit = 10.0f;
  175. // if the local player has been killed (by someone else), keep track of the killer
  176. if ( pVictim == pLocalPlayer )
  177. {
  178. // I was killed by my own sentry while testing, so I figure I meant as well put this check in
  179. if ( pLocalPlayer->GetTeam() == pAttacker->GetTeam() )
  180. {
  181. ResetTracking();
  182. return;
  183. }
  184. m_flPlayerDeathStartTime = gpGlobals->curtime;
  185. m_pPlayerKiller = pAttacker;
  186. }
  187. // if the sentry gun killed the player's killer within 10 seconds of the player's death, award the achievement
  188. else if ( pVictim == m_pPlayerKiller && m_flPlayerDeathStartTime != 0.0f && (gpGlobals->curtime - m_flPlayerDeathStartTime) < kRevengeTimeLimit )
  189. {
  190. int nInflictorEntIndex = event->GetInt( "inflictor_entindex" );
  191. C_BaseEntity *pRealInflictor = ClientEntityList().GetEnt( nInflictorEntIndex );
  192. C_ObjectSentrygun *pSentry = dynamic_cast< C_ObjectSentrygun * >( pRealInflictor );
  193. C_TFProjectile_SentryRocket *pSentryRocket = dynamic_cast< C_TFProjectile_SentryRocket * >( pRealInflictor );
  194. if ( ( pSentry && pSentry->GetOwner() == pLocalPlayer ) ||
  195. ( pSentryRocket && pSentryRocket->GetOwnerEntity() == pLocalPlayer ) )
  196. {
  197. ResetTracking();
  198. AwardAchievement();
  199. }
  200. }
  201. }
  202. virtual void FireGameEvent_Internal( IGameEvent *event )
  203. {
  204. C_TFPlayer *pLocalPlayer = C_TFPlayer::GetLocalTFPlayer();
  205. if ( !pLocalPlayer )
  206. return;
  207. // if the object getting killed is the local player's sentry gun,
  208. // reset tracking
  209. if ( FStrEq( event->GetName(), "object_destroyed" ) )
  210. {
  211. int iObject = event->GetInt( "objecttype" );
  212. if ( iObject == OBJ_SENTRYGUN )
  213. {
  214. int iEngineerIdx = engine->GetPlayerForUserID( event->GetInt( "userid" ) );
  215. CBaseEntity *pOwner = UTIL_PlayerByIndex( iEngineerIdx );
  216. if ( pOwner == pLocalPlayer )
  217. {
  218. ResetTracking();
  219. }
  220. }
  221. }
  222. }
  223. void ResetTracking()
  224. {
  225. m_pPlayerKiller = NULL;
  226. m_flPlayerDeathStartTime = 0.0f;
  227. }
  228. };
  229. DECLARE_ACHIEVEMENT( CAchievementTFEngineer_SentryAvengesYou, ACHIEVEMENT_TF_ENGINEER_SENTRY_AVENGES_YOU, "TF_ENGINEER_SENTRY_AVENGES_YOU", 5 );
  230. //----------------------------------------------------------------------------------------------------------------
  231. // Shotgun kill an enemy recently damaged by your sentry gun
  232. //----------------------------------------------------------------------------------------------------------------
  233. class CAchievementTFEngineer_RepairRecentlyDamagedSentryWhileBeingHealed : public CBaseTFAchievement
  234. {
  235. public:
  236. DECLARE_CLASS( CAchievementTFEngineer_RepairRecentlyDamagedSentryWhileBeingHealed, CBaseAchievement );
  237. virtual void Init()
  238. {
  239. SetFlags( ACH_SAVE_GLOBAL );
  240. SetGoal( 1 );
  241. }
  242. // server awards this achievement, no other code within achievement necessary
  243. };
  244. DECLARE_ACHIEVEMENT( CAchievementTFEngineer_RepairRecentlyDamagedSentryWhileBeingHealed, ACHIEVEMENT_TF_ENGINEER_REPAIR_SENTRY_W_MEDIC, "TF_ENGINEER_REPAIR_SENTRY_W_MEDIC", 5 );
  245. //----------------------------------------------------------------------------------------------------------------
  246. // Get X sentry kills on players capturing a point
  247. //----------------------------------------------------------------------------------------------------------------
  248. class CAchievementTFEngineer_SentryKillPlayersCapturingPoint : public CBaseTFAchievement
  249. {
  250. public:
  251. DECLARE_CLASS( CAchievementTFEngineer_SentryKillPlayersCapturingPoint, CBaseAchievement );
  252. virtual void Init()
  253. {
  254. SetFlags( ACH_SAVE_GLOBAL );
  255. SetGoal( 25 );
  256. SetStoreProgressInSteam( true );
  257. }
  258. // server awards this achievement, no other code within achievement necessary
  259. };
  260. DECLARE_ACHIEVEMENT( CAchievementTFEngineer_SentryKillPlayersCapturingPoint, ACHIEVEMENT_TF_ENGINEER_SENTRY_KILL_CAPS, "TF_ENGINEER_SENTRY_KILL_CAPS", 5 );
  261. //----------------------------------------------------------------------------------------------------------------
  262. // Destroy X sappers on buildings that you do not own
  263. //----------------------------------------------------------------------------------------------------------------
  264. class CAchievementTFEngineer_DestroySappersOnNonOwnedBuildings : public CBaseTFAchievement
  265. {
  266. public:
  267. DECLARE_CLASS( CAchievementTFEngineer_DestroySappersOnNonOwnedBuildings, CBaseAchievement );
  268. virtual void Init()
  269. {
  270. SetFlags( ACH_SAVE_GLOBAL );
  271. SetGoal( 25 );
  272. SetStoreProgressInSteam( true );
  273. }
  274. // server awards this achievement, no other code within achievement necessary
  275. };
  276. DECLARE_ACHIEVEMENT( CAchievementTFEngineer_DestroySappersOnNonOwnedBuildings, ACHIEVEMENT_TF_ENGINEER_DESTROY_SAPPERS, "TF_ENGINEER_DESTROY_SAPPERS", 5 );
  277. //----------------------------------------------------------------------------------------------------------------
  278. // Reload X rounds done to a sentry under manual control by another Engineer. (could be health / metal / something)
  279. //----------------------------------------------------------------------------------------------------------------
  280. class CAchievementTFEngineer_HelpManualSentry : public CBaseTFAchievement
  281. {
  282. public:
  283. DECLARE_CLASS( CAchievementTFEngineer_HelpManualSentry, CBaseAchievement );
  284. virtual void Init()
  285. {
  286. SetFlags( ACH_SAVE_GLOBAL );
  287. SetGoal( 50 );
  288. SetStoreProgressInSteam( true );
  289. }
  290. // server awards this achievement, no other code within achievement necessary
  291. };
  292. DECLARE_ACHIEVEMENT( CAchievementTFEngineer_HelpManualSentry, ACHIEVEMENT_TF_ENGINEER_HELP_MANUAL_SENTRY, "TF_ENGINEER_HELP_MANUAL_SENTRY", 5 );
  293. //----------------------------------------------------------------------------------------------------------------
  294. class CAchievementTFEngineer_RevengeCritLife : public CBaseTFAchievement
  295. {
  296. void Init()
  297. {
  298. SetFlags( ACH_SAVE_GLOBAL | ACH_LISTEN_PLAYER_KILL_ENEMY_EVENTS );
  299. ListenForGameEvent( "teamplay_round_active" );
  300. ListenForGameEvent( "localplayer_respawn" );
  301. ResetTracking();
  302. }
  303. void FireGameEvent_Internal( IGameEvent *event )
  304. {
  305. if ( FStrEq( event->GetName(), "teamplay_round_active" ) ||
  306. FStrEq( event->GetName(), "localplayer_respawn" ) )
  307. {
  308. ResetTracking();
  309. }
  310. }
  311. virtual void Event_EntityKilled( CBaseEntity *pVictim, CBaseEntity *pAttacker, CBaseEntity *pInflictor, IGameEvent *event )
  312. {
  313. int customdmg = event->GetInt( "customkill" );
  314. if ( customdmg == TF_DMG_CUSTOM_SHOTGUN_REVENGE_CRIT )
  315. {
  316. m_iKills++;
  317. if ( m_iKills >= 3 )
  318. {
  319. AwardAchievement();
  320. }
  321. }
  322. }
  323. void ResetTracking()
  324. {
  325. m_iKills = 0;
  326. }
  327. private:
  328. int m_iKills;
  329. };
  330. DECLARE_ACHIEVEMENT( CAchievementTFEngineer_RevengeCritLife, ACHIEVEMENT_TF_ENGINEER_REVENGE_CRIT_LIFE, "TF_ENGINEER_REVENGE_CRIT_LIFE", 5 );
  331. //----------------------------------------------------------------------------------------------------------------
  332. class CAchievementTFEngineer_TeleportGrind : public CBaseTFAchievement
  333. {
  334. void Init()
  335. {
  336. SetFlags( ACH_SAVE_GLOBAL );
  337. SetGoal( 100 );
  338. SetStoreProgressInSteam( true );
  339. }
  340. virtual void ListenForEvents( void )
  341. {
  342. ListenForGameEvent( "player_teleported" );
  343. }
  344. void FireGameEvent_Internal( IGameEvent *event )
  345. {
  346. const char *pszEventName = event->GetName();
  347. if ( FStrEq( pszEventName, "player_teleported" ) )
  348. {
  349. int userid = event->GetInt( "userid" );
  350. int builderid = event->GetInt( "builderid" );
  351. float dist = event->GetFloat( "dist" );
  352. C_TFPlayer *pLocalPlayer = C_TFPlayer::GetLocalTFPlayer();
  353. if ( pLocalPlayer && pLocalPlayer->GetUserID() == builderid && pLocalPlayer->GetUserID() != userid && dist > 1200 )
  354. {
  355. IncrementCount();
  356. }
  357. }
  358. }
  359. };
  360. DECLARE_ACHIEVEMENT( CAchievementTFEngineer_TeleportGrind, ACHIEVEMENT_TF_ENGINEER_TELEPORT_GRIND, "TF_ENGINEER_TELEPORT_GRIND", 5 );
  361. //----------------------------------------------------------------------------------------------------------------
  362. class CAchievemeentTFEngineer_DispenserExtinguish : public CBaseTFAchievement
  363. {
  364. void Init()
  365. {
  366. SetFlags( ACH_SAVE_GLOBAL );
  367. SetGoal( 20 );
  368. SetStoreProgressInSteam( true );
  369. }
  370. virtual void ListenForEvents( void )
  371. {
  372. ListenForGameEvent( "player_extinguished" );
  373. }
  374. void FireGameEvent_Internal( IGameEvent *event )
  375. {
  376. const char *pszEventName = event->GetName();
  377. if ( FStrEq( pszEventName, "player_extinguished" ) )
  378. {
  379. int victimid = event->GetInt( "victim" );
  380. int healerid = event->GetInt( "healer" );
  381. C_TFPlayer *pLocalPlayer = C_TFPlayer::GetLocalTFPlayer();
  382. if ( pLocalPlayer && pLocalPlayer->entindex() == healerid && pLocalPlayer->entindex() != victimid && pLocalPlayer->IsPlayerClass( TF_CLASS_ENGINEER ) )
  383. {
  384. IncrementCount();
  385. }
  386. }
  387. }
  388. };
  389. DECLARE_ACHIEVEMENT( CAchievemeentTFEngineer_DispenserExtinguish, ACHIEVEMENT_TF_ENGINEER_DISPENSER_EXTINGUISH, "TF_ENGINEER_DISPENSER_EXTINGUISH", 5 );
  390. //----------------------------------------------------------------------------------------------------------------
  391. class CAchievementTFEngineer_ManualCloakedSpyKill : public CBaseTFAchievement
  392. {
  393. void Init()
  394. {
  395. SetFlags( ACH_SAVE_GLOBAL | ACH_LISTEN_PLAYER_KILL_ENEMY_EVENTS );
  396. SetGoal( 3 );
  397. SetStoreProgressInSteam( true );
  398. }
  399. virtual void Event_EntityKilled( CBaseEntity *pVictim, CBaseEntity *pAttacker, CBaseEntity *pInflictor, IGameEvent *event )
  400. {
  401. CTFPlayer *pTFVictim = ToTFPlayer( pVictim );
  402. if ( !pTFVictim )
  403. return;
  404. CTFPlayer *pLocalPlayer = ToTFPlayer( C_TFPlayer::GetLocalPlayer() );
  405. if ( !pLocalPlayer )
  406. return;
  407. if ( pTFVictim && pTFVictim->IsPlayerClass( TF_CLASS_SPY ) && pTFVictim->m_Shared.InCond( TF_COND_STEALTHED ) )
  408. {
  409. int customdmg = event->GetInt( "customkill" );
  410. if ( customdmg == TF_DMG_CUSTOM_PLAYER_SENTRY )
  411. {
  412. IncrementCount();
  413. }
  414. }
  415. }
  416. };
  417. DECLARE_ACHIEVEMENT( CAchievementTFEngineer_ManualCloakedSpyKill, ACHIEVEMENT_TF_ENGINEER_MANUAL_CLOAKED_SPY_KILL, "TF_ENGINEER_MANUAL_CLOAKED_SPY_KILL", 5 );
  418. //----------------------------------------------------------------------------------------------------------------
  419. class CAchievementTFEngineer_UpgradeBuildings : public CBaseTFAchievement
  420. {
  421. void Init()
  422. {
  423. SetFlags( ACH_SAVE_GLOBAL );
  424. SetGoal( 50 );
  425. SetStoreProgressInSteam( true );
  426. }
  427. virtual void ListenForEvents( void )
  428. {
  429. ListenForGameEvent( "player_upgradedobject" );
  430. }
  431. void FireGameEvent_Internal( IGameEvent *event )
  432. {
  433. const char *pszEventName = event->GetName();
  434. if ( FStrEq( pszEventName, "player_upgradedobject" ) )
  435. {
  436. int userid = event->GetInt( "userid" );
  437. bool isbuilder = event->GetInt( "isbuilder" );
  438. CBasePlayer *pPlayer = UTIL_PlayerByUserId( userid );
  439. if ( pPlayer == C_TFPlayer::GetLocalPlayer() && !isbuilder )
  440. {
  441. IncrementCount();
  442. }
  443. }
  444. }
  445. };
  446. DECLARE_ACHIEVEMENT( CAchievementTFEngineer_UpgradeBuildings, ACHIEVEMENT_TF_ENGINEER_UPGRADE_BUILDINGS, "TF_ENGINEER_UPGRADE_BUILDINGS", 5 );
  447. //----------------------------------------------------------------------------------------------------------------
  448. class CAchievementTFEngineer_SentryKillLifetimeGrind : public CBaseTFAchievement
  449. {
  450. void Init()
  451. {
  452. SetFlags( ACH_SAVE_GLOBAL | ACH_LISTEN_PLAYER_KILL_ENEMY_EVENTS );
  453. SetGoal( 5000 );
  454. SetStoreProgressInSteam( true );
  455. }
  456. virtual void Event_EntityKilled( CBaseEntity *pVictim, CBaseEntity *pAttacker, CBaseEntity *pInflictor, IGameEvent *event )
  457. {
  458. CTFPlayer *pLocalPlayer = ToTFPlayer( C_TFPlayer::GetLocalPlayer() );
  459. if ( pAttacker != pLocalPlayer )
  460. return;
  461. const char* killer_weapon_name = event->GetString( "weapon" );
  462. if ( ( 0 == Q_strcmp( killer_weapon_name, "tf_projectile_sentryrocket" ) ) ||
  463. ( 0 == Q_strncmp( killer_weapon_name, "obj_sentrygun", 13 ) ) ||
  464. ( 0 == Q_strcmp( killer_weapon_name, "wrangler_kill" ) ) ||
  465. ( 0 == Q_strcmp( killer_weapon_name, "obj_minisentry" ) ) )
  466. {
  467. IncrementCount();
  468. }
  469. }
  470. };
  471. DECLARE_ACHIEVEMENT( CAchievementTFEngineer_SentryKillLifetimeGrind, ACHIEVEMENT_TF_ENGINEER_SENTRY_KILL_LIFETIME_GRIND, "TF_ENGINEER_SENTRY_KILL_LIFETIME_GRIND", 5 );
  472. //----------------------------------------------------------------------------------------------------------------
  473. class CAchievementTFEngineer_DispenserHealGroup : public CBaseTFAchievement
  474. {
  475. void Init()
  476. {
  477. SetFlags( ACH_SAVE_GLOBAL );
  478. SetGoal( 1 );
  479. }
  480. // server awards this achievement, no other code within achievement necessary
  481. };
  482. DECLARE_ACHIEVEMENT( CAchievementTFEngineer_DispenserHealGroup, ACHIEVEMENT_TF_ENGINEER_DISPENSER_HEAL_GROUP, "TF_ENGINEER_DISPENSER_HEAL_GROUP", 5 );
  483. //----------------------------------------------------------------------------------------------------------------
  484. class CAchievementTFEngineer_WasteMetalGrind : public CBaseTFAchievement
  485. {
  486. void Init()
  487. {
  488. SetFlags( ACH_SAVE_GLOBAL );
  489. SetGoal( 10000 );
  490. SetStoreProgressInSteam( true );
  491. }
  492. // server awards this achievement, no other code within achievement necessary
  493. };
  494. DECLARE_ACHIEVEMENT( CAchievementTFEngineer_WasteMetalGrind, ACHIEVEMENT_TF_ENGINEER_WASTE_METAL_GRIND, "TF_ENGINEER_WASTE_METAL_GRIND", 5 );
  495. //----------------------------------------------------------------------------------------------------------------
  496. class CAchievementTFEngineer_KillFlagCarriers : public CBaseTFAchievement
  497. {
  498. void Init()
  499. {
  500. SetFlags( ACH_SAVE_GLOBAL | ACH_LISTEN_PLAYER_KILL_ENEMY_EVENTS );
  501. SetGoal( 20 );
  502. SetStoreProgressInSteam( true );
  503. }
  504. virtual void Event_EntityKilled( CBaseEntity *pVictim, CBaseEntity *pAttacker, CBaseEntity *pInflictor, IGameEvent *event )
  505. {
  506. CTFPlayer *pTFVictim = ToTFPlayer( pVictim );
  507. if ( pTFVictim && pTFVictim != pAttacker && pTFVictim->HasTheFlag() )
  508. {
  509. IncrementCount();
  510. }
  511. }
  512. };
  513. DECLARE_ACHIEVEMENT( CAchievementTFEngineer_KillFlagCarriers, ACHIEVEMENT_TF_ENGINEER_KILL_FLAG_CARRIERS, "TF_ENGINEER_KILL_FLAG_CARRIERS", 5 );
  514. //----------------------------------------------------------------------------------------------------------------
  515. class CAchievementTFEngineer_KillDisguisedSpy : public CBaseTFAchievement
  516. {
  517. void Init()
  518. {
  519. SetFlags( ACH_SAVE_GLOBAL | ACH_LISTEN_PLAYER_KILL_ENEMY_EVENTS );
  520. }
  521. virtual void Event_EntityKilled( CBaseEntity *pVictim, CBaseEntity *pAttacker, CBaseEntity *pInflictor, IGameEvent *event )
  522. {
  523. CTFPlayer *pTFVictim = ToTFPlayer( pVictim );
  524. if ( !pTFVictim )
  525. return;
  526. CTFPlayer *pLocalPlayer = ToTFPlayer( C_TFPlayer::GetLocalPlayer() );
  527. if ( !pLocalPlayer )
  528. return;
  529. if ( pTFVictim && pTFVictim->IsPlayerClass( TF_CLASS_SPY ) &&
  530. pTFVictim->m_Shared.InCond( TF_COND_DISGUISED ) &&
  531. event->GetInt( "weaponid" ) == TF_WEAPON_WRENCH )
  532. {
  533. AwardAchievement();
  534. }
  535. }
  536. };
  537. DECLARE_ACHIEVEMENT( CAchievementTFEngineer_KillDisguisedSpy, ACHIEVEMENT_TF_ENGINEER_KILL_DISGUISED_SPY, "TF_ENGINEER_KILL_DISGUISED_SPY", 5 );
  538. //----------------------------------------------------------------------------------------------------------------
  539. class CAchievementTFEngineer_FreezeTaunt : public CBaseTFAchievement
  540. {
  541. void Init()
  542. {
  543. SetFlags( ACH_SAVE_GLOBAL );
  544. SetGoal( 1 );
  545. }
  546. // Give opponents freezecams of you taunting
  547. // server awards this achievement, no other code within achievement necessary
  548. };
  549. DECLARE_ACHIEVEMENT( CAchievementTFEngineer_FreezeTaunt, ACHIEVEMENT_TF_ENGINEER_FREEZECAM_TAUNT, "TF_ENGINEER_FREEZECAM_TAUNT", 5 );
  550. //----------------------------------------------------------------------------------------------------------------
  551. class CAchievementTFEngineer_FreezeWithSentry : public CBaseTFAchievement
  552. {
  553. void Init()
  554. {
  555. SetFlags( ACH_SAVE_GLOBAL );
  556. SetGoal( 1 );
  557. }
  558. // Give opponents freezecams of you w/ your sentry
  559. // server awards this achievement, no other code within achievement necessary
  560. };
  561. DECLARE_ACHIEVEMENT( CAchievementTFEngineer_FreezeWithSentry, ACHIEVEMENT_TF_ENGINEER_FREEZECAM_SENTRY, "TF_ENGINEER_FREEZECAM_SENTRY", 5 );
  562. //----------------------------------------------------------------------------------------------------------------
  563. class CAchievementTFEngineer_KillSpyTwoSappers : public CBaseTFAchievement
  564. {
  565. void Init()
  566. {
  567. SetFlags( ACH_SAVE_GLOBAL | ACH_LISTEN_PLAYER_KILL_ENEMY_EVENTS );
  568. ListenForGameEvent( "teamplay_round_active" );
  569. ListenForGameEvent( "localplayer_respawn" );
  570. ListenForGameEvent( "object_destroyed" );
  571. ResetTracking();
  572. }
  573. void FireGameEvent_Internal( IGameEvent *event )
  574. {
  575. if ( FStrEq( event->GetName(), "teamplay_round_active" ) ||
  576. FStrEq( event->GetName(), "localplayer_respawn" ) )
  577. {
  578. ResetTracking();
  579. }
  580. else if ( FStrEq( event->GetName(), "object_destroyed" ) )
  581. {
  582. CTFPlayer *pLocalPlayer = ToTFPlayer( C_TFPlayer::GetLocalPlayer() );
  583. if ( !pLocalPlayer )
  584. return;
  585. if ( event->GetInt( "objecttype" ) == OBJ_ATTACHMENT_SAPPER &&
  586. event->GetInt( "attacker" ) == pLocalPlayer->GetUserID() )
  587. {
  588. SetTime();
  589. m_iSapperCount++;
  590. CheckCompletion();
  591. }
  592. }
  593. }
  594. void ResetTracking()
  595. {
  596. m_iDeadSpyID = -1;
  597. m_flStartTime = -1;
  598. m_iSapperCount = 0;
  599. }
  600. void SetTime()
  601. {
  602. if ( gpGlobals->curtime - m_flStartTime > 10 )
  603. {
  604. // The player took too long.
  605. ResetTracking();
  606. }
  607. if ( m_flStartTime == -1 )
  608. {
  609. // Start the timer over now.
  610. m_flStartTime = gpGlobals->curtime;
  611. }
  612. }
  613. void CheckCompletion()
  614. {
  615. int iSpyIdx = engine->GetPlayerForUserID( m_iDeadSpyID );
  616. CTFPlayer *pSpy = dynamic_cast<CTFPlayer*>( UTIL_PlayerByIndex( iSpyIdx ) );
  617. if ( !pSpy )
  618. return;
  619. if ( m_iSapperCount < 2 )
  620. return;
  621. AwardAchievement();
  622. }
  623. virtual void Event_EntityKilled( CBaseEntity *pVictim, CBaseEntity *pAttacker, CBaseEntity *pInflictor, IGameEvent *event )
  624. {
  625. CTFPlayer *pTFVictim = ToTFPlayer( pVictim );
  626. if ( !pTFVictim )
  627. return;
  628. CTFPlayer *pLocalPlayer = ToTFPlayer( C_TFPlayer::GetLocalPlayer() );
  629. if ( !pLocalPlayer )
  630. return;
  631. if ( pTFVictim && pTFVictim->IsPlayerClass( TF_CLASS_SPY ) )
  632. {
  633. SetTime();
  634. m_iDeadSpyID = pTFVictim->GetUserID();
  635. CheckCompletion();
  636. }
  637. }
  638. float m_flStartTime;
  639. int m_iDeadSpyID;
  640. int m_iSapperCount;
  641. };
  642. DECLARE_ACHIEVEMENT( CAchievementTFEngineer_KillSpyTwoSappers, ACHIEVEMENT_TF_ENGINEER_KILL_SPY_TWO_SAPPERS, "TF_ENGINEER_KILL_SPY_TWO_SAPPERS", 5 );
  643. //----------------------------------------------------------------------------------------------------------------
  644. class CAchievementTFEngineer_RemoveSapperLongDist : public CBaseTFAchievement
  645. {
  646. void Init()
  647. {
  648. SetFlags( ACH_SAVE_GLOBAL );
  649. ListenForGameEvent( "object_destroyed" );
  650. ListenForGameEvent( "player_sapped_object" );
  651. ResetTracking();
  652. }
  653. void ResetTracking()
  654. {
  655. iSapperIndex = -1;
  656. }
  657. void FireGameEvent_Internal( IGameEvent *event )
  658. {
  659. CTFPlayer *pLocalPlayer = ToTFPlayer( C_TFPlayer::GetLocalPlayer() );
  660. if ( !pLocalPlayer )
  661. return;
  662. if ( FStrEq( event->GetName(), "player_sapped_object" ) )
  663. {
  664. if ( pLocalPlayer->GetUserID() == event->GetInt( "ownerid" ) )
  665. {
  666. m_vecStart = pLocalPlayer->GetAbsOrigin();
  667. iSapperIndex = event->GetInt( "sapperid" );
  668. }
  669. }
  670. else if ( FStrEq( event->GetName(), "object_destroyed" ) )
  671. {
  672. if ( event->GetInt( "objecttype" ) == OBJ_ATTACHMENT_SAPPER &&
  673. event->GetInt( "attacker" ) == pLocalPlayer->GetUserID() &&
  674. event->GetInt( "index" ) == iSapperIndex )
  675. {
  676. float flDist = pLocalPlayer->GetAbsOrigin().DistTo( m_vecStart );
  677. if ( flDist > 700 )
  678. {
  679. AwardAchievement();
  680. }
  681. }
  682. }
  683. }
  684. Vector m_vecStart;
  685. int iSapperIndex;
  686. };
  687. DECLARE_ACHIEVEMENT( CAchievementTFEngineer_RemoveSapperLongDist, ACHIEVEMENT_TF_ENGINEER_REMOVE_SAPPER_LONG_DIST, "TF_ENGINEER_REMOVE_SAPPER_LONG_DIST", 5 );
  688. //----------------------------------------------------------------------------------------------------------------
  689. class CAchievementTFEngineer_TauntKill : public CBaseTFAchievement
  690. {
  691. void Init()
  692. {
  693. SetFlags( ACH_SAVE_GLOBAL | ACH_LISTEN_PLAYER_KILL_ENEMY_EVENTS | ACH_FILTER_ATTACKER_IS_PLAYER );
  694. SetGoal( 1 );
  695. }
  696. virtual void Event_EntityKilled( CBaseEntity *pVictim, CBaseEntity *pAttacker, CBaseEntity *pInflictor, IGameEvent *event )
  697. {
  698. int iEvent = event->GetInt( "customkill" );
  699. if ( ( iEvent == TF_DMG_CUSTOM_TAUNTATK_ENGINEER_GUITAR_SMASH ) || ( iEvent == TF_DMG_CUSTOM_TAUNTATK_ALLCLASS_GUITAR_RIFF ) )
  700. {
  701. IncrementCount();
  702. }
  703. }
  704. };
  705. DECLARE_ACHIEVEMENT( CAchievementTFEngineer_TauntKill, ACHIEVEMENT_TF_ENGINEER_TAUNT_KILL, "TF_ENGINEER_TAUNT_KILL", 5 );
  706. //----------------------------------------------------------------------------------------------------------------
  707. class CAchievementTFEngineer_DestroyStickies : public CBaseTFAchievement
  708. {
  709. void Init()
  710. {
  711. SetFlags( ACH_SAVE_GLOBAL );
  712. SetGoal( 50 );
  713. SetStoreProgressInSteam( true );
  714. }
  715. // server awards this achievement, no other code within achievement necessary
  716. };
  717. DECLARE_ACHIEVEMENT( CAchievementTFEngineer_DestroyStickies, ACHIEVEMENT_TF_ENGINEER_DESTROY_STICKIES, "TF_ENGINEER_DESTROY_STICKIES", 5 );
  718. //----------------------------------------------------------------------------------------------------------------
  719. class CAchievementTFEngineer_KillSnipersSentry : public CBaseTFAchievement
  720. {
  721. void Init()
  722. {
  723. SetFlags( ACH_SAVE_GLOBAL | ACH_LISTEN_PLAYER_KILL_ENEMY_EVENTS );
  724. SetGoal( 10 );
  725. SetStoreProgressInSteam( true );
  726. }
  727. virtual void Event_EntityKilled( CBaseEntity *pVictim, CBaseEntity *pAttacker, CBaseEntity *pInflictor, IGameEvent *event )
  728. {
  729. CTFPlayer *pTFVictim = ToTFPlayer( pVictim );
  730. if ( !pTFVictim )
  731. return;
  732. CTFPlayer *pLocalPlayer = ToTFPlayer( C_TFPlayer::GetLocalPlayer() );
  733. if ( !pLocalPlayer )
  734. return;
  735. if ( pTFVictim && pTFVictim->IsPlayerClass( TF_CLASS_SNIPER ) &&
  736. event->GetInt( "customkill" ) == TF_DMG_CUSTOM_PLAYER_SENTRY )
  737. {
  738. IncrementCount();
  739. }
  740. }
  741. };
  742. DECLARE_ACHIEVEMENT( CAchievementTFEngineer_KillSnipersSentry, ACHIEVEMENT_TF_ENGINEER_KILL_SNIPERS_SENTRY, "TF_ENGINEER_KILL_SNIPERS_SENTRY", 5 );
  743. //----------------------------------------------------------------------------------------------------------------
  744. class CAchievementTFEngineer_KillSentryWithSentry : public CBaseTFAchievement
  745. {
  746. void Init()
  747. {
  748. SetFlags( ACH_SAVE_GLOBAL );
  749. ListenForGameEvent( "object_destroyed" );
  750. }
  751. void FireGameEvent_Internal( IGameEvent *event )
  752. {
  753. CTFPlayer *pLocalPlayer = ToTFPlayer( C_TFPlayer::GetLocalPlayer() );
  754. if ( !pLocalPlayer )
  755. return;
  756. if ( FStrEq( event->GetName(), "object_destroyed" ) )
  757. {
  758. const char* weaponstr = event->GetString( "weapon" );
  759. if ( event->GetInt( "objecttype" ) == OBJ_SENTRYGUN &&
  760. event->GetInt( "attacker" ) == pLocalPlayer->GetUserID() &&
  761. FStrEq( weaponstr, "wrangler_kill" ) )
  762. {
  763. AwardAchievement();
  764. }
  765. }
  766. }
  767. };
  768. DECLARE_ACHIEVEMENT( CAchievementTFEngineer_KillSentryWithSentry, ACHIEVEMENT_TF_ENGINEER_KILL_SENTRY_WITH_SENTRY, "TF_ENGINEER_KILL_SENTRY_WITH_SENTRY", 5 );
  769. //----------------------------------------------------------------------------------------------------------------
  770. class CAchievementTFEngineer_MoveSentryGetKill : public CBaseTFAchievement
  771. {
  772. void Init()
  773. {
  774. SetFlags( ACH_SAVE_GLOBAL );
  775. SetGoal( 1 );
  776. }
  777. // server awards this achievement, no other code within achievement necessary
  778. };
  779. DECLARE_ACHIEVEMENT( CAchievementTFEngineer_MoveSentryGetKill, ACHIEVEMENT_TF_ENGINEER_MOVE_SENTRY_GET_KILL, "TF_ENGINEER_MOVE_SENTRY_GET_KILL", 5 );
  780. //----------------------------------------------------------------------------------------------------------------
  781. class CAchievementTFEngineer_BuildingCarry : public CBaseTFAchievement
  782. {
  783. void Init()
  784. {
  785. SetFlags( ACH_SAVE_GLOBAL );
  786. SetGoal( 1000 );
  787. SetStoreProgressInSteam( true );
  788. }
  789. virtual void ListenForEvents( void )
  790. {
  791. ListenForGameEvent( "player_death" );
  792. }
  793. void FireGameEvent_Internal( IGameEvent *event )
  794. {
  795. const char *pszEventName = event->GetName();
  796. CTFPlayer *pLocalPlayer = ToTFPlayer( C_TFPlayer::GetLocalPlayer() );
  797. if ( !pLocalPlayer )
  798. return;
  799. // Achievement for carrying buildings ...
  800. bool bUpdate = false;
  801. if ( FStrEq( pszEventName, "player_death" ) )
  802. {
  803. int iVictimID = event->GetInt( "userid" );
  804. if ( pLocalPlayer && (iVictimID == pLocalPlayer->GetUserID()) )
  805. {
  806. bUpdate = true;
  807. }
  808. }
  809. else if ( FStrEq( pszEventName, "teamplay_round_win" ) )
  810. {
  811. bUpdate = true;
  812. }
  813. if ( bUpdate )
  814. {
  815. float fMeters = pLocalPlayer->GetMetersRan();
  816. IncrementCount( ceil( fMeters ) );
  817. }
  818. }
  819. };
  820. DECLARE_ACHIEVEMENT( CAchievementTFEngineer_BuildingCarry, ACHIEVEMENT_TF_ENGINEER_BUILDING_CARRY, "TF_ENGINEER_BUILDING_CARRY", 5 );
  821. //----------------------------------------------------------------------------------------------------------------
  822. class CAchievementTFEngineer_KillAssist : public CBaseTFAchievement
  823. {
  824. void Init()
  825. {
  826. SetFlags( ACH_SAVE_GLOBAL );
  827. SetGoal( 10 );
  828. SetStoreProgressInSteam( true );
  829. }
  830. virtual void ListenForEvents()
  831. {
  832. ListenForGameEvent( "player_death" );
  833. }
  834. void FireGameEvent_Internal( IGameEvent *event )
  835. {
  836. if ( FStrEq( event->GetName(), "player_death" ) )
  837. {
  838. int iAttackerIndex = engine->GetPlayerForUserID( event->GetInt( "attacker" ) );
  839. if ( iAttackerIndex == 0 )
  840. return;
  841. CTFPlayer *pAttacker = ToTFPlayer( UTIL_PlayerByIndex( iAttackerIndex ) );
  842. if ( !pAttacker )
  843. return;
  844. int iAssisterIndex = engine->GetPlayerForUserID( event->GetInt( "assister" ) );
  845. if ( iAssisterIndex == 0 )
  846. return;
  847. CTFPlayer *pAssister = ToTFPlayer( UTIL_PlayerByIndex( iAssisterIndex ) );
  848. if ( !pAssister )
  849. return;
  850. // A sentry gun must have been the killing weapon.
  851. const char* killer_weapon_name = event->GetString( "weapon" );
  852. if ( ( 0 == Q_strcmp( killer_weapon_name, "tf_projectile_sentryrocket" ) ) ||
  853. ( 0 == Q_strncmp( killer_weapon_name, "obj_sentrygun", 13 ) ) ||
  854. ( 0 == Q_strcmp( killer_weapon_name, "wrangler_kill" ) ) ||
  855. ( 0 == Q_strcmp( killer_weapon_name, "obj_minisentry" ) ) )
  856. {
  857. if ( pAttacker == C_BasePlayer::GetLocalPlayer() && pAssister->IsPlayerClass( TF_CLASS_ENGINEER ) )
  858. {
  859. // We are the attacker and the assist is from a engineer.
  860. IncrementCount();
  861. return;
  862. }
  863. if ( pAssister == C_BasePlayer::GetLocalPlayer() && pAttacker->IsPlayerClass( TF_CLASS_ENGINEER ) )
  864. {
  865. // We are the assister and the kill is from a engineer.
  866. IncrementCount();
  867. return;
  868. }
  869. }
  870. }
  871. }
  872. };
  873. DECLARE_ACHIEVEMENT( CAchievementTFEngineer_KillAssist, ACHIEVEMENT_TF_ENGINEER_KILL_ASSIST, "TF_ENGINEER_KILL_ASSIST", 5 );
  874. //----------------------------------------------------------------------------------------------------------------
  875. class CAchievementTFEngineer_DispenserHealGrind : public CBaseTFAchievement
  876. {
  877. void Init()
  878. {
  879. SetFlags( ACH_SAVE_GLOBAL );
  880. SetGoal( 100000 );
  881. SetStoreProgressInSteam( true );
  882. }
  883. // server awards this achievement, no other code within achievement necessary
  884. };
  885. DECLARE_ACHIEVEMENT( CAchievementTFEngineer_DispenserHealGrind, ACHIEVEMENT_TF_ENGINEER_DISPENSER_HEAL_GRIND, "TF_ENGINEER_DISPENSER_HEAL_GRIND", 5 );
  886. //----------------------------------------------------------------------------------------------------------------
  887. class CAchievementTFEngineer_RepairTeamGrind : public CBaseTFAchievement
  888. {
  889. void Init()
  890. {
  891. SetFlags( ACH_SAVE_GLOBAL );
  892. SetGoal( 50000 );
  893. SetStoreProgressInSteam( true );
  894. }
  895. // server awards this achievement, no other code within achievement necessary
  896. };
  897. DECLARE_ACHIEVEMENT( CAchievementTFEngineer_RepairTeamGrind, ACHIEVEMENT_TF_ENGINEER_REPAIR_TEAM_GRIND, "TF_ENGINEER_REPAIR_TEAM_GRIND", 5 );
  898. //----------------------------------------------------------------------------------------------------------------
  899. class CAchievementTFEngineer_TankDamage : public CBaseTFAchievement
  900. {
  901. void Init()
  902. {
  903. SetFlags( ACH_SAVE_GLOBAL );
  904. SetGoal( 1 );
  905. }
  906. // server awards this achievement, no other code within achievement necessary
  907. };
  908. DECLARE_ACHIEVEMENT( CAchievementTFEngineer_TankDamage, ACHIEVEMENT_TF_ENGINEER_TANK_DAMAGE, "TF_ENGINEER_TANK_DAMAGE", 5 );
  909. //----------------------------------------------------------------------------------------------------------------
  910. class CAchievementTFEngineer_HeavyAssist : public CBaseTFAchievement
  911. {
  912. void Init()
  913. {
  914. SetFlags( ACH_SAVE_GLOBAL );
  915. SetGoal( 1 );
  916. }
  917. // server awards this achievement, no other code within achievement necessary
  918. };
  919. DECLARE_ACHIEVEMENT( CAchievementTFEngineer_HeavyAssist, ACHIEVEMENT_TF_ENGINEER_HEAVY_ASSIST, "TF_ENGINEER_HEAVY_ASSIST", 5 );
  920. //----------------------------------------------------------------------------------------------------------------
  921. class CAchievementTFEngineer_AchieveProgress1 : public CAchievement_AchievedCount
  922. {
  923. public:
  924. DECLARE_CLASS( CAchievementTFEngineer_AchieveProgress1, CAchievement_AchievedCount );
  925. void Init()
  926. {
  927. BaseClass::Init();
  928. SetAchievementsRequired( 5, ACHIEVEMENT_TF_ENGINEER_START_RANGE, ACHIEVEMENT_TF_ENGINEER_END_RANGE );
  929. }
  930. };
  931. DECLARE_ACHIEVEMENT( CAchievementTFEngineer_AchieveProgress1, ACHIEVEMENT_TF_ENGINEER_ACHIEVE_PROGRESS1, "TF_ENGINEER_ACHIEVE_PROGRESS1", 5 );
  932. //----------------------------------------------------------------------------------------------------------------
  933. class CAchievementTFEngineer_AchieveProgress2 : public CAchievement_AchievedCount
  934. {
  935. public:
  936. DECLARE_CLASS( CAchievementTFEngineer_AchieveProgress2, CAchievement_AchievedCount );
  937. void Init()
  938. {
  939. BaseClass::Init();
  940. SetAchievementsRequired( 11, ACHIEVEMENT_TF_ENGINEER_START_RANGE, ACHIEVEMENT_TF_ENGINEER_END_RANGE );
  941. }
  942. };
  943. DECLARE_ACHIEVEMENT( CAchievementTFEngineer_AchieveProgress2, ACHIEVEMENT_TF_ENGINEER_ACHIEVE_PROGRESS2, "TF_ENGINEER_ACHIEVE_PROGRESS2", 5 );
  944. //----------------------------------------------------------------------------------------------------------------
  945. class CAchievementTFEngineer_AchieveProgress3 : public CAchievement_AchievedCount
  946. {
  947. public:
  948. DECLARE_CLASS( CAchievementTFEngineer_AchieveProgress3, CAchievement_AchievedCount );
  949. void Init()
  950. {
  951. BaseClass::Init();
  952. SetAchievementsRequired( 17, ACHIEVEMENT_TF_ENGINEER_START_RANGE, ACHIEVEMENT_TF_ENGINEER_END_RANGE );
  953. }
  954. };
  955. DECLARE_ACHIEVEMENT( CAchievementTFEngineer_AchieveProgress3, ACHIEVEMENT_TF_ENGINEER_ACHIEVE_PROGRESS3, "TF_ENGINEER_ACHIEVE_PROGRESS3", 5 );
  956. #endif // CLIENT_DLL