class repl_KFSStats extends KFSteamStatsAndAchievements;


// unlock DLC weapons
// ROEngine.KFSteamStatsAndAchievements
simulated event OnStatsAndAchievementsReady()
{
  local int i;

  GetStatInt(DamageHealedStat, SteamNameStat[KFSTAT_DamageHealed]);
  SavedDamageHealedStat = DamageHealedStat.Value;
  PCOwner.ServerInitializeSteamStatInt(KFSTAT_DamageHealed, DamageHealedStat.Value);

  GetStatInt(WeldingPointsStat, SteamNameStat[KFSTAT_WeldingPoints]);
  SavedWeldingPointsStat = WeldingPointsStat.Value;
  PCOwner.ServerInitializeSteamStatInt(KFSTAT_WeldingPoints, WeldingPointsStat.Value);

  GetStatInt(ShotgunDamageStat, SteamNameStat[KFSTAT_ShotgunDamage]);
  SavedShotgunDamageStat = ShotgunDamageStat.Value;
  PCOwner.ServerInitializeSteamStatInt(KFSTAT_ShotgunDamage, ShotgunDamageStat.Value);

  GetStatInt(HeadshotKillsStat, SteamNameStat[KFSTAT_HeadshotKills]);
  SavedHeadshotKillsStat = HeadshotKillsStat.Value;
  PCOwner.ServerInitializeSteamStatInt(KFSTAT_HeadshotKills, HeadshotKillsStat.Value);

  GetStatInt(StalkerKillsStat, SteamNameStat[KFSTAT_StalkerKills]);
  SavedStalkerKillsStat = StalkerKillsStat.Value;
  PCOwner.ServerInitializeSteamStatInt(KFSTAT_StalkerKills, StalkerKillsStat.Value);

  GetStatInt(BullpupDamageStat, SteamNameStat[KFSTAT_BullpupDamage]);
  SavedBullpupDamageStat = BullpupDamageStat.Value;
  PCOwner.ServerInitializeSteamStatInt(KFSTAT_BullpupDamage, BullpupDamageStat.Value);

  GetStatInt(MeleeDamageStat, SteamNameStat[KFSTAT_MeleeDamage]);
  SavedMeleeDamageStat = MeleeDamageStat.Value;
  PCOwner.ServerInitializeSteamStatInt(KFSTAT_MeleeDamage, MeleeDamageStat.Value);

  GetStatInt(FlameThrowerDamageStat, SteamNameStat[KFSTAT_FlameThrowerDamage]);
  SavedFlameThrowerDamageStat = FlameThrowerDamageStat.Value;
  PCOwner.ServerInitializeSteamStatInt(KFSTAT_FlameThrowerDamage, FlameThrowerDamageStat.Value);

  GetStatInt(ExplosivesDamageStat, SteamNameStat[KFSTAT_ExplosivesDamage]);
  SavedExplosivesDamageStat = ExplosivesDamageStat.Value;
  PCOwner.ServerInitializeSteamStatInt(KFSTAT_ExplosivesDamage, ExplosivesDamageStat.Value);

  GetStatInt(SelfHealsStat, SteamNameStat[KFSTAT_SelfHeals]);
  SavedSelfHealsStat = SelfHealsStat.Value;
  PCOwner.ServerInitializeSteamStatInt(KFSTAT_SelfHeals, SelfHealsStat.Value);

  GetStatInt(SoleSurvivorWavesStat, SteamNameStat[KFSTAT_SoleSurvivorWaves]);
  SavedSoleSurvivorWavesStat = SoleSurvivorWavesStat.Value;
  PCOwner.ServerInitializeSteamStatInt(KFSTAT_SoleSurvivorWaves, SoleSurvivorWavesStat.Value);

  GetStatInt(CashDonatedStat, SteamNameStat[KFSTAT_CashDonated]);
  SavedCashDonatedStat = CashDonatedStat.Value;
  PCOwner.ServerInitializeSteamStatInt(KFSTAT_CashDonated, CashDonatedStat.Value);

  GetStatInt(FeedingKillsStat, SteamNameStat[KFSTAT_FeedingKills]);
  SavedFeedingKillsStat = FeedingKillsStat.Value;
  PCOwner.ServerInitializeSteamStatInt(KFSTAT_FeedingKills, FeedingKillsStat.Value);

  GetStatInt(BurningCrossbowKillsStat, SteamNameStat[KFSTAT_BurningCrossbowKills]);
  SavedBurningCrossbowKillsStat = BurningCrossbowKillsStat.Value;
  PCOwner.ServerInitializeSteamStatInt(KFSTAT_BurningCrossbowKills, BurningCrossbowKillsStat.Value);

  GetStatInt(GibbedFleshpoundsStat, SteamNameStat[KFSTAT_GibbedFleshpounds]);
  SavedGibbedFleshpoundsStat = GibbedFleshpoundsStat.Value;
  PCOwner.ServerInitializeSteamStatInt(KFSTAT_GibbedFleshpounds, GibbedFleshpoundsStat.Value);

  GetStatInt(StalkersKilledWithExplosivesStat, SteamNameStat[KFSTAT_StalkersKilledWithExplosives]);
  SavedStalkersKilledWithExplosivesStat = StalkersKilledWithExplosivesStat.Value;
  PCOwner.ServerInitializeSteamStatInt(KFSTAT_StalkersKilledWithExplosives, StalkersKilledWithExplosivesStat.Value);

  GetStatInt(GibbedEnemiesStat, SteamNameStat[KFSTAT_GibbedEnemies]);
  SavedGibbedEnemiesStat = GibbedEnemiesStat.Value;
  PCOwner.ServerInitializeSteamStatInt(KFSTAT_GibbedEnemies, GibbedEnemiesStat.Value);

  GetStatInt(SirensKilledWithExplosivesStat, SteamNameStat[KFSTAT_SirensKilledWithExplosives]);
  SavedSirensKilledWithExplosivesStat = SirensKilledWithExplosivesStat.Value;
  PCOwner.ServerInitializeSteamStatInt(KFSTAT_SirensKilledWithExplosives, SirensKilledWithExplosivesStat.Value);

  GetStatInt(BloatKillsStat, SteamNameStat[KFSTAT_BloatKills]);
  SavedBloatKillsStat = BloatKillsStat.Value;
  PCOwner.ServerInitializeSteamStatInt(KFSTAT_BloatKills, BloatKillsStat.Value);

  GetStatFloat(TotalZedTimeStat, SteamNameStat[KFSTAT_TotalZedTime]);
  SavedTotalZedTimeStat = TotalZedTimeStat.Value;
  PCOwner.ServerInitializeSteamStatFloat(KFSTAT_TotalZedTime, TotalZedTimeStat.Value);

  GetStatInt(SirenKillsStat, SteamNameStat[KFSTAT_SirenKills]);
  SavedSirenKillsStat = SirenKillsStat.Value;
  PCOwner.ServerInitializeSteamStatInt(KFSTAT_SirenKills, SirenKillsStat.Value);

  GetStatInt(KillsStat, SteamNameStat[KFSTAT_Kills]);
  SavedKillsStat = KillsStat.Value;
  PCOwner.ServerInitializeSteamStatInt(KFSTAT_Kills, KillsStat.Value);

  GetStatInt(DemolitionsPipebombKillsStat, SteamNameStat[KFSTAT_DemolitionsPipebombKills]);
  SavedDemolitionsPipebombKillsStat = DemolitionsPipebombKillsStat.Value;
  PCOwner.ServerInitializeSteamStatInt(KFSTAT_DemolitionsPipebombKills, DemolitionsPipebombKillsStat.Value);

  GetStatInt(EnemiesGibbedWithM79, SteamNameStat[KFSTAT_EnemiesGibbedWithM79]);
  SavedEnemiesGibbedWithM79 = EnemiesGibbedWithM79.Value;
  PCOwner.ServerInitializeSteamStatInt(KFSTAT_EnemiesGibbedWithM79, EnemiesGibbedWithM79.Value);

  GetStatInt(EnemiesKilledWithSCAR, SteamNameStat[KFSTAT_EnemiesKilledWithSCAR]);
  SavedEnemiesKilledWithSCAR = EnemiesKilledWithSCAR.Value;
  PCOwner.ServerInitializeSteamStatInt(KFSTAT_EnemiesKilledWithSCAR, EnemiesKilledWithSCAR.Value);

  GetStatInt(TeammatesHealedWithMP7, SteamNameStat[KFSTAT_TeammatesHealedWithMP7]);
  SavedTeammatesHealedWithMP7 = TeammatesHealedWithMP7.Value;
  PCOwner.ServerInitializeSteamStatInt(KFSTAT_TeammatesHealedWithMP7, TeammatesHealedWithMP7.Value);

  GetStatInt(FleshpoundsKilledWithAA12, SteamNameStat[KFSTAT_FleshpoundsKilledWithAA12]);
  SavedFleshpoundsKilledWithAA12 = FleshpoundsKilledWithAA12.Value;
  PCOwner.ServerInitializeSteamStatInt(KFSTAT_FleshpoundsKilledWithAA12, FleshpoundsKilledWithAA12.Value);

  GetStatInt(CrawlersKilledInMidair, SteamNameStat[KFSTAT_CrawlersKilledInMidair]);
  SavedCrawlersKilledInMidair = CrawlersKilledInMidair.Value;
  PCOwner.ServerInitializeSteamStatInt(KFSTAT_CrawlersKilledInMidair, CrawlersKilledInMidair.Value);

  GetStatInt(Mac10BurnDamage, SteamNameStat[KFSTAT_Mac10BurnDamage]);
  SavedMac10BurnDamage = Mac10BurnDamage.Value;
  PCOwner.ServerInitializeSteamStatInt(KFSTAT_Mac10BurnDamage, Mac10BurnDamage.Value);

  GetStatInt(DroppedTier3Weapons, SteamNameStat[KFSTAT_DroppedTier3Weapons]);
  SavedDroppedTier3Weapons = DroppedTier3Weapons.Value;
  PCOwner.ServerInitializeSteamStatInt(KFSTAT_DroppedTier3Weapons, DroppedTier3Weapons.Value);

  GetStatInt(HalloweenKills, SteamNameStat[KFSTAT_HalloweenKills]);
  SavedHalloweenKills = HalloweenKills.Value;
  PCOwner.ServerInitializeSteamStatInt(KFSTAT_HalloweenKills, HalloweenKills.Value);

  GetStatInt(HalloweenScrakeKills, SteamNameStat[KFSTAT_HalloweenScrakeKills]);
  SavedHalloweenScrakeKills = HalloweenScrakeKills.Value;
  PCOwner.ServerInitializeSteamStatInt(KFSTAT_HalloweenScrakeKills, HalloweenScrakeKills.Value);

  GetStatInt(XMasHusksKilledWithHuskCannon, SteamNameStat[KFSTAT_XMasHusksKilledWithHuskCannon]);
  SavedXMasHusksKilledWithHuskCannon = XMasHusksKilledWithHuskCannon.Value;
  PCOwner.ServerInitializeSteamStatInt(KFSTAT_XMasHusksKilledWithHuskCannon, XMasHusksKilledWithHuskCannon.Value);

  GetStatInt(XMasPointsHealedWithMP5, SteamNameStat[KFSTAT_XMasPointsHealedWithMP5]);
  SavedXMasPointsHealedWithMP5 = XMasPointsHealedWithMP5.Value;
  PCOwner.ServerInitializeSteamStatInt(KFSTAT_XMasPointsHealedWithMP5, XMasPointsHealedWithMP5.Value);

  GetStatInt(EnemiesKilledWithFNFal, SteamNameStat[KFSTAT_EnemiesKilledWithFNFal]);
  SavedEnemiesKilledWithFNFal = EnemiesKilledWithFNFal.Value;
  PCOwner.ServerInitializeSteamStatInt(KFSTAT_EnemiesKilledWithFNFal, EnemiesKilledWithFNFal.Value);

  GetStatInt(EnemiesKilledWithBullpup, SteamNameStat[KFSTAT_EnemiesKilledWithBullpup]);
  SavedEnemiesKilledWithBullpup = EnemiesKilledWithBullpup.Value;
  PCOwner.ServerInitializeSteamStatInt(KFSTAT_EnemiesKilledWithBullpup, EnemiesKilledWithBullpup.Value);

  GetStatInt(ZedSetFireWithTrenchOnHillbilly, SteamNameStat[KFSTAT_EnemiesKilledWithTrenchOnHillbilly]);
  SavedZedSetFireWithTrenchOnHillbilly = ZedSetFireWithTrenchOnHillbilly.Value;
  PCOwner.ServerInitializeSteamStatInt(KFSTAT_EnemiesKilledWithTrenchOnHillbilly, ZedSetFireWithTrenchOnHillbilly.Value);

  GetStatInt(ZedKilledDuringHillbilly, SteamNameStat[KFSTAT_EnemiesKilledDuringHillbilly]);
  SavedZedKilledDuringHillbilly = ZedKilledDuringHillbilly.Value;
  PCOwner.ServerInitializeSteamStatInt(KFSTAT_EnemiesKilledDuringHillbilly, ZedKilledDuringHillbilly.Value);

  GetStatInt(HillbillyAchievementsCompleted, SteamNameStat[KFSTAT_HillbillyAchievementsCompleted]);
  SavedHillbillyAchievementsCompleted = HillbillyAchievementsCompleted.Value;
  PCOwner.ServerInitializeSteamStatInt(KFSTAT_HillbillyAchievementsCompleted, HillbillyAchievementsCompleted.Value);

  GetStatInt(Stat46, SteamNameStat[KFSTAT_Stat46]);
  PCOwner.ServerInitializeSteamStatInt(KFSTAT_Stat46, Stat46.Value);
  GetEventCommand();

  GetStatInt(FleshPoundsKilledWithAxe, SteamNameStat[KFSTAT_FleshPoundsKilledWithAxe]);
  PCOwner.ServerInitializeSteamStatInt(KFSTAT_FleshPoundsKilledWithAxe, FleshPoundsKilledWithAxe.Value);

  GetStatInt(ZedsKilledWhileAirborne, SteamNameStat[KFSTAT_ZedsKilledWhileAirborne]);
  PCOwner.ServerInitializeSteamStatInt(KFSTAT_ZedsKilledWhileAirborne, ZedsKilledWhileAirborne.Value);

  GetStatInt(ZEDSKilledWhileZapped, SteamNameStat[KFSTAT_ZEDSKilledWhileZapped]);
  PCOwner.ServerInitializeSteamStatInt(KFSTAT_ZEDSKilledWhileZapped, ZEDSKilledWhileZapped.Value);


  EnemiesKilledWithMKB42NoReload = 0;
  StalkersKilledWithNail = 0;
  HillbillyCrawlerKills = 0;
  HillbillysKilledIn10Secs = 0;
  HillbillySKilledIn10SecsTime = 0;
  HillbillyGorefastsOnFire = 0;
  HuskAndZedOneShotTotalKills = 0;
  HuskAndZedOneShotZedKills = 0;
  ZedsKilledInZedTime = 0;
  HeadShottedMonsters.Remove( 0, HeadShottedMonsters.Length );
  SpeciesKilledWithBile.Remove( 0, SpeciesKilledWithBile.Length );

  // EDITED!!! DLC UNLOCK
  InitStatInt(OwnedWeaponDLC, 4095);
  PCOwner.ServerInitializeSteamStatInt(200, 4095);

  // InitStatInt(OwnedWeaponDLC, GetOwnedWeaponDLC());
  // PCOwner.ServerInitializeSteamStatInt(KFSTAT_OwnedWeaponDLC, OwnedWeaponDLC.Value);

  // Check which Perks are available on Client
  InitializePerks();
  CheckMedicPerks(false);
  CheckSupportPerks(false);
  CheckSharpshooterPerks(false);
  CheckCommandoPerks(false);
  CheckBerserkerPerks(false);
  CheckFirebugPerks(false);
  CheckDemolitionsPerks(false);

  // Achievements[i].bCompleted = byte(GetAchievementCompleted(Achievements[i].SteamName));

  // use these functions to call out to the server to make sure the servers know if the achievements
  // have been gotten or not
  GetAchievementCompleted(Achievements[131].SteamName);
  GetAchievementCompleted(Achievements[155].SteamName);
  GetAchievementCompleted(Achievements[162].SteamName);
  GetAchievementCompleted(Achievements[193].SteamName);
  GetAchievementCompleted(Achievements[202].SteamName);
  GetAchievementCompleted(Achievements[208].SteamName);

  for (i = 0; i < Achievements.Length; i++)
  {
    Achievements[i].bCompleted = byte(GetAchievementCompleted(Achievements[i].SteamName));
    GetAchievementDescription(Achievements[i].SteamName, Achievements[i].DisplayName, Achievements[i].Description);
  }

  CheckHillbillyAchievementsCompleted();

  UpdateAchievementProgress();

  super(SteamStatsAndAchievementsBase).OnStatsAndAchievementsReady();
}

defaultproperties
{
}
