5E - adding entries to rRoll (odd behavior)
Hey all!
So, I'm trying to clean up my Improved Critical extension and update some things...partly as a coding exercise, and partly to consolidate things. Anyway, the extension creates wrappers around modDamage and onDamageRoll to modify the results of the roll and I'd like to add fields to rRoll.clauses and rRoll.aDice to make it easier for some updates I am playing around with.
Long story short, adding fields seems to work like you'd expect - I can do things like
Code:
rRoll.clauses[1].bIsSpecialCritClause = false
and it works fine..."bIsSpecialCritClause" is added and is carried all the way through the processing. However, through testing, I found that if the name of the field is less than 12 characters long, it doesn't add it. For example,
Code:
rRoll.clauses[1].bIsModified = false
does not add "bIsModified", but
Code:
rRoll.clauses[1].bIsModified1 = false
does.
This leads me to believe that maybe this isn't a reliable way to add fields to rRoll.
Is it? And if not, what is the preferred method?
Thanks a ton!
Jeff.