public float GetTargetHealth(EnemyHeros playerHeros, int additionalTime) { if (playerHeros.Player.IsVisible) { return(playerHeros.Player.Health); } var predictedhealth = playerHeros.Player.Health + playerHeros.Player.HPRegenRate * ((Environment.TickCount - playerHeros.LastSeen + additionalTime) / 1000f); return(predictedhealth > playerHeros.Player.MaxHealth ? playerHeros.Player.MaxHealth : predictedhealth); }
public float GetTargetHealth(EnemyHeros playerHeros, int additionalTime) { if (playerHeros.Player.IsVisible) return playerHeros.Player.Health; var predictedhealth = playerHeros.Player.Health + playerHeros.Player.HPRegenRate * ((Environment.TickCount - playerHeros.LastSeen + additionalTime) / 1000f); return predictedhealth > playerHeros.Player.MaxHealth ? playerHeros.Player.MaxHealth : predictedhealth; }