Exemplo n.º 1
0
        private void PrepareFields(Player player)
        {
            PlayerStatsSnapshot playerStatsSnapshot = new PlayerStatsSnapshot(player);

            this._hpSegmentsCount = (int)((double)playerStatsSnapshot.LifeMax / (double)playerStatsSnapshot.LifePerSegment);
            this._mpSegmentsCount = (int)((double)playerStatsSnapshot.ManaMax / (double)playerStatsSnapshot.ManaPerSegment);
            this._maxSegmentCount = 20;
            this._hpFruitCount    = playerStatsSnapshot.LifeFruitCount;
            this._hpPercent       = (float)playerStatsSnapshot.Life / (float)playerStatsSnapshot.LifeMax;
            this._mpPercent       = (float)playerStatsSnapshot.Mana / (float)playerStatsSnapshot.ManaMax;
        }
Exemplo n.º 2
0
        private void PrepareFields(Player player)
        {
            PlayerStatsSnapshot playerStatsSnapshot = new PlayerStatsSnapshot(player);

            this._playerLifeFruitCount  = playerStatsSnapshot.LifeFruitCount;
            this._lifePerHeart          = playerStatsSnapshot.LifePerSegment;
            this._currentPlayerLife     = (float)playerStatsSnapshot.Life;
            this._manaPerStar           = playerStatsSnapshot.ManaPerSegment;
            this._heartCountRow1        = Utils.Clamp <int>((int)((double)playerStatsSnapshot.LifeMax / (double)this._lifePerHeart), 0, 10);
            this._heartCountRow2        = Utils.Clamp <int>((int)((double)(playerStatsSnapshot.LifeMax - 200) / (double)this._lifePerHeart), 0, 10);
            this._lastHeartFillingIndex = (int)((double)playerStatsSnapshot.Life / (double)this._lifePerHeart);
            this._lastHeartPanelIndex   = this._heartCountRow1 + this._heartCountRow2 - 1;
            this._starCount             = (int)((double)playerStatsSnapshot.ManaMax / (double)this._manaPerStar);
            this._currentPlayerMana     = (float)playerStatsSnapshot.Mana;
            this._lastStarFillingIndex  = (int)((double)this._currentPlayerMana / (double)this._manaPerStar);
        }
        private void PrepareFields(Player player)
        {
            PlayerStatsSnapshot playerStatsSnapshot = new PlayerStatsSnapshot(player);

            _playerLifeFruitCount = playerStatsSnapshot.LifeFruitCount;
            _lifePerHeart         = playerStatsSnapshot.LifePerSegment;
            _currentPlayerLife    = playerStatsSnapshot.Life;
            _manaPerStar          = playerStatsSnapshot.ManaPerSegment;
            _heartCountRow1       = Utils.Clamp((int)((float)playerStatsSnapshot.LifeMax / _lifePerHeart), 0, 10);
            _heartCountRow2       = Utils.Clamp((int)((float)(playerStatsSnapshot.LifeMax - 200) / _lifePerHeart), 0, 10);
            int num = (_lastHeartFillingIndex = (int)((float)playerStatsSnapshot.Life / _lifePerHeart));

            _lastHeartPanelIndex  = _heartCountRow1 + _heartCountRow2 - 1;
            _starCount            = (int)((float)playerStatsSnapshot.ManaMax / _manaPerStar);
            _currentPlayerMana    = playerStatsSnapshot.Mana;
            _lastStarFillingIndex = (int)(_currentPlayerMana / _manaPerStar);
        }