Beispiel #1
0
        public void BulletCollisionNotification(object bullet, bool isFreezingBullet)
        {
            if (_playerState == PlayerState.PlayerDisabled)
            {
                return;
            }

            bool isPlayerBullet = !(bullet is EnemyBullet);

            if (!isPlayerBullet)
            {
                float damageAmount = ((Bullet)bullet).GetBulletDamage();
                _playerHealthSetter.SubtractHealth(damageAmount);
                _playerHeartScaleBlinker.StartScaleBlinking();

                PlayerModifierSoulsManager.instance.DecrementSouls(playerHitSoulsDecrementCount);
            }
        }
Beispiel #2
0
        // Event Function from Bullet Collision
        public void BulletCollisionNotification(object bullet, bool isFreezingBullet)
        {
            bool isPLayerBullet = !(bullet is EnemyBullet);

            if (isPLayerBullet)
            {
                float damageAmount = ((Bullet)bullet).GetBulletDamage();
                _bossBodyHealthSetter.SubtractHealth(damageAmount);
            }
        }
        // Event Function from Bullet Collision
        public void BulletCollisionNotification(object bullet, bool isFreezingBullet)
        {
            if (_armDestructionActive)
            {
                return;
            }

            bool isPLayerBullet = !(bullet is EnemyBullet);

            if (isPLayerBullet)
            {
                float damageAmount = ((Bullet)bullet).GetBulletDamage();
                _healthSetter.SubtractHealth(damageAmount);
            }
        }
Beispiel #4
0
        // Event Function from Bullet Collision
        public void BulletCollisionNotification(object bullet, bool isFreezingBullet)
        {
            bool isPlayerBullet = !(bullet is EnemyBullet);

            if (isPlayerBullet)
            {
                EmitOnHostileOnPlayerAttack();

                float damageAmount = ((Bullet)bullet).GetBulletDamage();
                _enemyHealthSetter.SubtractHealth(damageAmount);
            }

            if (isFreezingBullet)
            {
                float randomNumber = (float)GD.Randf();
                if (randomNumber < enemyFreezeRatio)
                {
                    FreezeEnemy(enemyFreezeTime);
                }
            }
        }