The mathematics AKA the mechanics of a tabletop game are DIRECTLY transferrable from paper to code. I know cus I can do it. There is literally no dice roll system that cannot be translated from a pen and paper system to code, it is very very easy to do in fact. The computer was literally invented to do this.

The caveats that are problematic are additional homebrew mechanics that change ^^^^^^^^^ these linear (cause and effect) calculations. They have cascade effects though the linear probability system that is 5e in a nut shell. Adding another dice roll for an AoE that isn't supposed to be there can change 5 other dice rolls trying to calculate the effect of "something else". This in turn makes a "misses" "hits" and makes another 6 saving throws that prevent concentration or sneak etc. Even linear probability can become extremely complex given enough variables.

My point being the mathmatics of 5e are set in stone, there is no wiggle room. Why? Because adding extra dice rolls changes the outcome of gameplay so drastically it becomes another system. Larian actually know this and have moved it closer to 5e as such. Larian can add new spells, weapons, armors, monsters and lore for all I care as long as they all follow the tried and tested 1+1=2.

Every class in 5e Phb is balanced around these numbers. Change one thing in the formula and Clerics become pointless, wizards become demi-gods, rouges become useless. Throwing a healing potion in the mouth of your mate 50 foot away is the same a a cleric casting a spell for the same purpose. Hding as a bonus action is a rouge skill not a wizard skill. All these little (not little) things take away from the tactical, straegic, class and difficulty of the game. It makes it cheezy in fact.

The DM does not change "the laws of physics" they add flavor. This being "would firing a lightning bolt into water while other are standing in it electrocute them?" sure of course, then lets do that then. Can I throw a 200kg barrel of "stuff" 60 feet with my 18kg halfling wizard with 6 STR? Urrrm no mate. <<<< this is the job of the DM (Larian).