I'm creating a Google spreadsheet that contains every spell in the TTRPG game, D&D. Each spell has different effects, some of which include damage. The damage isn't a flat amount but scales based on level (a bit oversimplified but it's enough). Because it's not a flat amount and scales differently for each spell, I can't include numbers in the row or use some formula that I expect to work for everything as there will be hundreds of exceptions.
My initial idea was to have a column in each row that's effectively its own custom function that takes a level input and can return whatever it needs to for that spell. Something akin to the following in JavaScript:
const spells = [ { spell: 'Fireball', damage: function(level) { return 'some value' }, },]As far as I know, however, this isn't possible. Am I correct in my assumption or is there a way to do something like this that I'm not aware of?
To get ahead of a possible suggestion, I cannot create custom functions within Google Sheets as I'd need to be able to reference the function with a string, and there are over 500 spells so it's not exactly a feasible option either.