Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

[Script] Fantasy Craft (2nd printing) - Standard character token management

1384666165

Edited 1384666485
Here is an attempt to automate the damage against Standard Characters for Fantasy Craft (2nd printing), by Crafty Games. This is an enhancement and nearly complete re-write of my previous script. The Damage Save portion has been separated into a function so it can be called not only from the on(change:token) portion, but also from the !DoDamage portion, and any future new functionality. I have employed some assumptions in order to make this work. It is completely stand-alone and self-contained - other than Roll20 itself, of course. ASSUMPTIONS ---------------------- Whether the attack hits or not is not determined by this script Damage amount to apply is not taken care of by this script (i.e. Damage Reduction, Resistance, Extra Stress Damage, etc) Default colors for the bars/circles (this isn't required for script operation, just for my documentation) You don't use the CHOSEN_STATUS for anything other meaning (yellow, by default) You don't use the three circles/bars for anything else on Standard Characters A character sheet or journal is not required for this functionality, nor are any attributes, abilities, or other macros SETUP ---------- Use the CHOSEN_STATUS variable to choose the status that will be used to designate token as a Standard Character. Use the Green circle (bar1) as the Damage Save modifier. Use the Blue circle (bar2) as the tough NPC Quality grade. ( leave blank for regular, set to "1" for tough I, "2" for tough II, etc. ) IN-PLAY ------------ Use the Red circle (bar3) to manually track accumulated damage, if desired. CHAT COMMANDS ----------------------------- ! DoDamage x Applies x damage to all selected Standard Character tokens. Only tokens with the CHOSEN_STATUS are effected. Any selected tokens without the CHOSEN_STATUS are skipped. ! ResetStd [ x ] [ y ] [ force ] Sets the Accumulated Damage to zero for all selected Standard Character tokens. Sets the Damage Save Bonus to x or zero if omitted for all selected Standard Character tokens. Sets the Tough Grade to y or zero if omitted for all selected Standard Character tokens. By default, only effects Standard Character tokens. If the force option is used (it must be the last argument), this turns on the CHOSEN_STATUS for any selected token that does not already have it - effectively making it a Standard Character token. PSEUDOCODE ----------------------- Listen for changes to a token Check to see if the token is a Standard Character Get the current and previous Accumulated Damage values If the current damage is greater than previous, it took damage (ignore changes to other values, heals, etc) Determine the Damage Save DC based on current damage Roll save against DC using Damage Save Bonus If save is successful, do nothing (SuperGoblin!) If save is failed, either decrement a non-zero tough grade and reset damage, or make it dead. <a href="https://gist.github.com/lifer4700/7509041" rel="nofollow">https://gist.github.com/lifer4700/7509041</a>
Revision 5 of the gist is a working version. Previous versions would receive errors at runtime due to the script trying to process msg.selected as an array of objects, and also not filtering the list of selected objects to only pay attention to "tokens". Rev 5 works as advertised - if you have a lower version, replace it!
My plan for mine is to have script roll but I make determination if result is truly a success.
Exactly. That's how mine works now. Since I can't get the "d20Pro" fudge interface (which is really awesome, btw) this is the next best thing. I have 'campaign' macros where the player selects their token and presses "Unarmed-Attack", "Edged-Attack", "Bow-Attack", etc. that does the Attack Check based on their BAB, STR/DEX, and Proficiency. Then each player's journal I have written the damage macros for their weapons. It's worked very well so far. Those macros combined with this API script give me just about everything I need at these levels. (the characters are only level 1, so stances, tricks, and abilities are at a minimum) I'm looking at playing around with an automatic "Phalanx Fighting" macro. Having it detect token movement, and dropping the "bolt-shield" status on any adjacent ally, removing it when they move away.
1384750650

Edited 1384750701
Unless you're talking about the damage saves, of course... that's the whole reason why I wrote this was to completely automate that. 8) After all, they're just Standards... designed simply to be in the way, and occasionally case a bit of damage to the PCs.