Whenever an attack roll is a critical hit (a nat 20 on the d20 to hit), calculate damage as the maximum possible value (taking the highest face value on all damage dice), add all modifiers (including extra damage from non-weapon features, such as Rogue's Sneak Attack or the damage dealt by a Dragon Slayer sword), and double the final amount.