Exemple #1
0
 public void OnHit(BallBehaviour _ball, Vector3 _impactVector, PawnController _thrower, float _damages, DamageSource _source, Vector3 _bumpModificators = default)
 {
     if (_source == DamageSource.Ball)
     {
         EnergyManager.IncreaseEnergy(BossSettings.GetDatas().staggerSettings.energyGainedOnHit);
     }
 }
Exemple #2
0
 // Update is called once per frame
 void Update()
 {
     if (GivePlayerEnergy && pawnCount > 0)
     {
         EnergyManager.IncreaseEnergy(Time.deltaTime);
     }
 }
Exemple #3
0
 public void FallOnGround()
 {
     destroyed = true;
     foreach (BossLeg leg in legs)
     {
         leg.RemoveExplosionFX();
     }
     bossExplosionFX = FeedbackManager.SendFeedback("event.BossFallOnGround", this).GetVFX();
     EnergyManager.IncreaseEnergy(1f);
     StartCoroutine(Stagger_C());
 }
Exemple #4
0
 public void OnHit(BallBehaviour _ball, Vector3 _impactVector, PawnController _thrower, float _damages, DamageSource _source, Vector3 _bumpModificators = default)
 {
     if (_ball != null)
     {
         InflictDamage(_damages, 1f);
         FeedbackManager.SendFeedback("event.BallHittingEnemy", this, _ball.transform.position, _impactVector, _impactVector);
         EnergyManager.IncreaseEnergy(0.2f);
         if (_source == DamageSource.Dunk)
         {
             InflictDamage(_damages, 1.5f);
         }
     }
 }
Exemple #5
0
    public virtual void OnHit(BallBehaviour _ball, Vector3 _impactVector, PawnController _thrower, float _damages, DamageSource _source, Vector3 _bumpModificators = default(Vector3))
    {
        transform.DOShakeScale(1f, 1f).OnComplete(ResetScale);
        hitCount_access++;

        if (_source != DamageSource.Dunk)
        {
            EnergyManager.IncreaseEnergy(0.2f);
        }
        maxHealth--;
        if (maxHealth <= 0)
        {
            Destroy(gameObject);
        }

        //Fonctions utile
        //_ball.Bounce();
        //_ball.Attract();
        //_ball.CancelMovement();   <- Stop completely the ball
        //_ball.ChangeState();
        //_ball.MultiplySpeed();   <- Multiply speed by a coef
        //_ball.ChangeMaxDistance();  <- Changing max distance of ball by X will stop it after travelling X meters
        //_ball.Explode();  <- Spawns an FX
    }
Exemple #6
0
    public virtual void OnHit(BallBehaviour _ball, Vector3 _impactVector, PawnController _thrower, float _damages, DamageSource _source, Vector3 _bumpModificators = default(Vector3))
    {
        damageAfterBump = 0;
        Vector3 i_normalizedImpactVector;

        LockManager.UnlockTarget(this.transform);

        switch (_source)
        {
        case DamageSource.Dunk:
            Analytics.CustomEvent("DamageWithDunk", new Dictionary <string, object> {
                { "Zone", GameManager.GetCurrentZoneName() },
            });

            if (isBumpable)
            {
                if (enemyType == EnemyTypes.RedBarrel)
                {
                    EnemyRedBarrel i_selfRef = GetComponent <EnemyRedBarrel>();
                    i_selfRef.willExplode = false;
                }

                damageAfterBump          = _damages;
                i_normalizedImpactVector = new Vector3(_impactVector.x, 0, _impactVector.z);

                BumpMe(i_normalizedImpactVector.normalized, BumpForce.Force2);
            }
            else
            {
                Damage(_damages);
            }
            break;

        case DamageSource.RedBarrelExplosion:
            if (isBumpable && enemyType != EnemyTypes.RedBarrel)
            {
                damageAfterBump          = _damages;
                i_normalizedImpactVector = new Vector3(_impactVector.x, 0, _impactVector.z);
                BumpMe(i_normalizedImpactVector.normalized, BumpForce.Force2);
            }
            else
            {
                Damage(_damages);
            }
            break;

        case DamageSource.Ball:
            Upgrade passLevel = AbilityManager.GetAbilityLevel(ConcernedAbility.Pass);
            if ((int)passLevel > 0 && GetHealth() / GetMaxHealth() <= AbilityManager.instance.level1PassDamageTreshold)
            {
                _damages = _damages * AbilityManager.instance.level1PassDamageMultiplier;
                FeedbackManager.SendFeedback("event.PassUpgradedShot", this, _ball.transform.position, _impactVector, _impactVector);
            }
            Analytics.CustomEvent("DamageWithBall", new Dictionary <string, object> {
                { "Zone", GameManager.GetCurrentZoneName() },
            });

            animator.SetTrigger("HitTrigger");
            FeedbackManager.SendFeedback("event.BallHittingEnemy", this, _ball.transform.position, _impactVector, _impactVector);
            EnergyManager.IncreaseEnergy(energyGainedOnHit);

            Damage(_damages);
            break;

        case DamageSource.PerfectReceptionExplosion:
            Damage(_damages);
            FeedbackManager.SendFeedback("event.BallHittingEnemy", this, _ball.transform.position, _impactVector, _impactVector);

            BallDatas bd = _ball.GetCurrentBallDatas();
            float     ballChargePercent = (_ball.GetCurrentDamageModifier() - 1) / (bd.maxDamageModifierOnPerfectReception - 1);

            // Bump or push depending on Ball charge value
            if (ballChargePercent >= bd.minimalChargeForBump)
            {
                BumpMe(_impactVector.normalized, BumpForce.Force1);
            }
            else if (ballChargePercent >= bd.minimalChargeForHeavyPush)
            {
                Push(PushType.Heavy, _impactVector.normalized, PushForce.Force1);
            }
            else if (ballChargePercent >= bd.minimalChargeForLightPush)
            {
                Push(PushType.Light, _impactVector.normalized, PushForce.Force1);
            }


            break;

        case DamageSource.Laser:
            Damage(_damages);
            break;

        case DamageSource.ReviveExplosion:
            Push(PushType.Heavy, _impactVector, PushForce.Force2);
            break;

        case DamageSource.DeathExplosion:
            Push(PushType.Heavy, _impactVector, PushForce.Force2);
            break;

        case DamageSource.SpawnImpact:
            Push(PushType.Light, _impactVector, PushForce.Force1);
            break;
        }
    }
Exemple #7
0
 public void ChargeEnergy()
 {
     EnergyManager.IncreaseEnergy(1);
 }
Exemple #8
0
 public void OnHit(BallBehaviour _ball, Vector3 _impactVector, PawnController _thrower, float _damages, DamageSource _source, Vector3 _bumpModificators = default(Vector3))
 {
     FXManager.InstantiateFX(puzzleData.charging, Vector3.up * 2, true, Vector3.forward, Vector3.one * 3, transform);
     MomentumManager.IncreaseMomentum(puzzleData.nbMomentumChargedByCharger);
     EnergyManager.IncreaseEnergy(chargeAmount);
 }