protected void CheckBulletLife(RaycastHit2D hit, int i)
    {
        float bulletLife = bullets[i].remainingLifetime -= bullets[i].remainingLifetime * percentageOfHits / 100;

        if (bulletLife <= 0 && leaveDecal) // check if it's the last hit and leave a decal
        {
            currentDecal.PlaceDecal(hit, bullets[i].velocity);
        }
        bullets[i].remainingLifetime -= bullets[i].remainingLifetime * percentageOfHits / 100;
    }
Beispiel #2
0
    public void DoDamage(_EnemyController enemyHit, int i)
    {
        // check damage type and enemy resistance
        int tempDmg = damage;

        CheckDmg(enemyHit, tempDmg);
        perfPool[i].numberOfHits--;
        // apply decal if needed
        if (perfPool[i].numberOfHits <= 0 && leaveDecal)
        {
            currentDecal.PlaceDecal(perfPool[i].bullet.transform, enemyHit);
        }

        enemyHit.enemyOwnership = playerNumber;
        enemyHit.currentLife   -= tempDmg;
        enemyHit.gotHit         = true;
        GMController.instance.TensionThresholdCheck(GMController.instance.tensionStats.enemyHitPoints); //add tension
    }