protected override IEnumerator ShootBasicAttack(Unit target) { SetupBeforeAttackDelay(target); yield return(delayAttack); isShootingPassiveShot = true; if (!empoweringAbilityWasActiveOnBasicAttackCast) { empoweringAbilityWasActiveOnBasicAttackCast = unit.BuffManager.IsAffectedByBuff(basicAttackEmpoweringAbility.AbilityBuffs[0]); } SetupAfterAttackDelay(target, basicAttackPrefab); if (empoweringAbilityWasActiveOnBasicAttackCast) { empoweringAbilityWasActiveOnBasicAttackCast = false; basicAttackEmpoweringAbility.AbilityBuffs[0].ConsumeBuff(unit); yield return(delayPassiveShot); ProjectileUnitTargeted projectile2 = (Instantiate(empoweredBasicAttackPrefab, transform.position, transform.rotation)).GetComponent <ProjectileUnitTargeted>(); projectile2.transform.LookAt(target.transform); projectile2.ShootProjectile(unit.Team, target, speed, AttackIsCritical.CheckIfAttackIsCritical(unit.StatsManager.CriticalStrikeChance.GetTotal())); projectile2.OnAbilityEffectHit += PassiveBasicAttackHit; } isShootingPassiveShot = false; shootBasicAttackCoroutine = null; }
protected void SetupAfterAttackDelay(Unit target, GameObject basicAttackPrefab) { BasicAttackCycle.LockBasicAttack(); AttackIsInQueue = false; ((Champion)unit).OrientationManager.StopTargetRotation(); ProjectileUnitTargeted projectile = (Instantiate(basicAttackPrefab, transform.position, transform.rotation)).GetComponent <ProjectileUnitTargeted>(); projectile.ShootProjectile(unit.Team, target, speed, AttackIsCritical.CheckIfAttackIsCritical(unit.StatsManager.CriticalStrikeChance.GetTotal())); if (empoweringAbilityWasActiveOnBasicAttackCast) { projectile.OnAbilityEffectHit += BasicAttackHit; } else { projectile.OnAbilityEffectHit += base.BasicAttackHit; } }
protected virtual IEnumerator ShootBasicAttack(Unit target) { ((Champion)unit).OrientationManager.RotateCharacterUntilReachedTarget(target.transform, true, true); yield return(delayAttack); BasicAttackCycle.LockBasicAttack(); AttackIsInQueue = false; ((Champion)unit).OrientationManager.StopTargetRotation(); ProjectileUnitTargeted projectile = (Instantiate(basicAttackPrefab, transform.position, transform.rotation)).GetComponent <ProjectileUnitTargeted>(); projectile.ShootProjectile(unit.Team, target, speed, AttackIsCritical.CheckIfAttackIsCritical(unit.StatsManager.CriticalStrikeChance.GetTotal()), unit.StatusManager.IsBlinded()); projectile.OnAbilityEffectHit += BasicAttackHit; if (unit is Character) { ((Champion)unit).OnAttackEffectsManager.ApplyOnAttackEffectsToUnitHit(target); } shootBasicAttackCoroutine = null; }
protected override void OnAbilityEffectHit(AbilityEffect projectile, Unit unitHit, bool isACriticalStrike, bool willMiss) { base.OnAbilityEffectHit(projectile, unitHit, isACriticalStrike, willMiss); Unit nextUnit = FindTargetBehindUnitHit(unitHit); if (nextUnit) { bool secondHitIsACriticalStrike; if (unitHit.StatsManager.Health.IsDead()) { secondHitIsACriticalStrike = true; } else { secondHitIsACriticalStrike = AttackIsCritical.CheckIfAttackIsCritical(champion.StatsManager.CriticalStrikeChance.GetTotal()); } ProjectileUnitTargeted projectile2 = (Instantiate(projectilePrefab, unitHit.transform.position, transform.rotation)).GetComponent <ProjectileUnitTargeted>(); projectile2.transform.LookAt(nextUnit.transform.position); projectile2.ShootProjectile(champion.Team, nextUnit, speed, secondHitIsACriticalStrike); projectile2.OnAbilityEffectHit += base.OnAbilityEffectHit; } }