So playing Heroes and attempting to crunch some numbers has got me thinking; Obviously damage is normally calculated by processing Atk - Def or Mag - Res (disregarding Critical Hits), but how does the Weapon Triangle and Effective Damage (for example, Bows vs Fliers) factor into this? Is a set amount of damage added to the equation, or are one of the equation's stats modified before running the calculation? Heroes may be anomalous for the fact it's a mobile spin off game, but I couldn't figure what exactly is being done in Heroes for, say, Anna to get 2 damage against a Lance Knight, even though her Attack is 16 and the Knight's Defence is 17.
Help me out here, the nerdy side of me needs to know this (there's just something satisfying about crunching numbers manually, y'know?).