public void SendAttack(CombatHandler enemyHandler) { if (readyToAttack) { comboCounter++; OnHitTarget?.Invoke(); enemyHandler.ReceiveAttack(combatInfo, transform.position.x); readyToAttack = false; } }
protected override void SetUpDamageData(DamageData damageData) { base.SetUpDamageData(damageData); damageData.Direction = DirectFire; damageData.OnHitEnemy += (e) => OnHitTarget?.Invoke(e); damageData.OnHitToDieEnemy += (Enemy enemy) => { OnKilledTarget?.Invoke(enemy); }; damageData.AddDamageOrigin(PlayerTakeBuff.GetValue(BuffRegister.TypeBuff.IncreaseDamageByValue)); damageData.AddDamagePercentOrigin(PlayerTakeBuff.GetValue(BuffRegister.TypeBuff.IncreaseDamageByPercent)); damageData.AddDamageCritByPercent(PlayerTakeBuff.GetValue(BuffRegister.TypeBuff.IncreaseDamageCritByPercent)); damageData.AddDecrease(UnityEngine.Random.Range(-1, 2)); OnSetUpDamageToAttack?.Invoke(damageData); }