public Attack EnemyCreateAttack(EnemyStatsController attackerStats, PlayerStatsController defenderStats, Vector2 hitBackForce) { float coreDamage = attackerStats.GetCurrentDamage(); coreDamage += Random.Range(plusDamage.x, plusDamage.y); coreDamage -= defenderStats.GetDefenceStat(); bool isCritical = Random.value < criticalChange; if (isCritical) { coreDamage += criticalMultiplier; } return(new Attack((int)coreDamage, isCritical, hitBackForce)); }