Beispiel #1
0
        private void SetBossMaxHealth()
        {
            BossArmController.ArmStatus leftArmStatus   = _leftArmController.GetArmStatus();
            BossArmController.ArmStatus rightArmStatus  = _rightArmController.GetArmStatus();
            BossArmController.ArmStatus topArmStatus    = _topArmController.GetArmStatus();
            BossArmController.ArmStatus bottomArmStatus = _bottomArmController.GetArmStatus();

            BossBodyController.BodyStatus bodyStatus = _bodyController.GetBodyStatus();

            float totalMaxHealth = leftArmStatus.firstArmMaxHealth + leftArmStatus.secondArmMaxHealth;

            totalMaxHealth += (rightArmStatus.firstArmMaxHealth + rightArmStatus.secondArmMaxHealth);
            totalMaxHealth += (topArmStatus.firstArmMaxHealth + topArmStatus.secondArmMaxHealth);
            totalMaxHealth += (bottomArmStatus.firstArmMaxHealth + bottomArmStatus.secondArmMaxHealth);
            totalMaxHealth += bodyStatus.bodyMaxHealth;

            GD.Print($"Max Boss Health: {totalMaxHealth}");

            _bossTotalHealthSetter.SetMaxHealth(totalMaxHealth);
        }
Beispiel #2
0
        public void HandleSacrificialItemInfluence(PlayerModifierTypes.SacrificialItemInfo sacrificialItemInfo)
        {
            switch (sacrificialItemInfo.sacrificialItem)
            {
            case PlayerModifierTypes.SacrificialItem.SpeedSacrificeHealthBoost:
            {
                float speedLossAmount = _currentMovementSpeed * sacrificialItemInfo.reducedPercent / 100;
                _currentMovementSpeed -= speedLossAmount;

                float maxHealthIncrease = _playerHealthSetter.GetMaxHealth() * sacrificialItemInfo.increasedPercent / 100;
                _playerHealthSetter.SetMaxHealth(_playerHealthSetter.GetMaxHealth() + maxHealthIncrease);
            }
            break;

            case PlayerModifierTypes.SacrificialItem.SpeedSacrificeDamageIncrease:
            {
                float speedLossAmount = _currentMovementSpeed * sacrificialItemInfo.reducedPercent / 100;
                _currentMovementSpeed -= speedLossAmount;

                _playerShooting.AddToDamageDifferencePercent(sacrificialItemInfo.increasedPercent);
            }
            break;

            case PlayerModifierTypes.SacrificialItem.HealthSacrificeDamageIncrease:
            {
                float healthLossAmount = _playerHealthSetter.GetMaxHealth() * sacrificialItemInfo.reducedPercent / 100;
                _playerHealthSetter.SetMaxHealth(_playerHealthSetter.GetMaxHealth() - healthLossAmount);

                _playerShooting.AddToDamageDifferencePercent(sacrificialItemInfo.increasedPercent);
            }
            break;

            case PlayerModifierTypes.SacrificialItem.ShootTimeSacrificeDamageIncrease:
            {
                _playerShooting.SetCurrentShootingDelay(sacrificialItemInfo.reducedPercent / 100.0f);
                _playerShooting.AddToDamageDifferencePercent(sacrificialItemInfo.increasedPercent);
            }
            break;

            case PlayerModifierTypes.SacrificialItem.HealthSacrificeSpeedIncrease:
            {
                float healthLossAmount = _playerHealthSetter.GetMaxHealth() * sacrificialItemInfo.reducedPercent / 100;
                _playerHealthSetter.SetMaxHealth(_playerHealthSetter.GetMaxHealth() - healthLossAmount);

                float speedIncrease = _currentMovementSpeed * sacrificialItemInfo.increasedPercent / 100;
                _currentMovementSpeed += speedIncrease;
            }
            break;

            case PlayerModifierTypes.SacrificialItem.SpeedSacrificeShieldTimeIncrease:
            {
                float speedLossAmount = _currentMovementSpeed * sacrificialItemInfo.reducedPercent / 100;
                _currentMovementSpeed -= speedLossAmount;

                _playerShieldController.IncrementShieldTimerByPercent(sacrificialItemInfo.increasedPercent);
            }
            break;

            case PlayerModifierTypes.SacrificialItem.HealthSacrificeShieldTimeIncrease:
            {
                float healthLossAmount = _playerHealthSetter.GetMaxHealth() * sacrificialItemInfo.reducedPercent / 100;
                _playerHealthSetter.SetMaxHealth(_playerHealthSetter.GetMaxHealth() - healthLossAmount);

                _playerShieldController.IncrementShieldTimerByPercent(sacrificialItemInfo.increasedPercent);
            }
            break;

            case PlayerModifierTypes.SacrificialItem.ShieldTimeSacrificeHealthBoost:
            {
                _playerShieldController.DecrementShieldTimerByPercent(sacrificialItemInfo.reducedPercent);

                float maxHealthIncrease = _playerHealthSetter.GetMaxHealth() * sacrificialItemInfo.increasedPercent / 100;
                _playerHealthSetter.SetMaxHealth(_playerHealthSetter.GetMaxHealth() + maxHealthIncrease);
            }
            break;

            case PlayerModifierTypes.SacrificialItem.ShieldTimeSacrificeSpeedIncrease:
            {
                _playerShieldController.DecrementShieldTimerByPercent(sacrificialItemInfo.reducedPercent);

                float speedIncrease = _currentMovementSpeed * sacrificialItemInfo.increasedPercent / 100;
                _currentMovementSpeed += speedIncrease;
            }
            break;

            default:
                throw new ArgumentOutOfRangeException(nameof(sacrificialItemInfo.sacrificialItem), sacrificialItemInfo.sacrificialItem, null);
            }
        }