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

[Help] Please help me remove certain things from this BloodSpatter script I found.

Hello! I use the script pasted below for some bloodspatter effects on the table top. I love it, but I want to remove two things from it: 1) The token bleeding when moving. 2) The add/removal of bloodied status (red marker) and the dead status (I use deathtracker for that). Can someone knowledgeable please assist me? Thanks in advance. /Jonathan var BloodSpatter = { &nbsp; version: '0.1.0', &nbsp; wiki: '<a href="https://wiki.roll20.net/Script:Blood_And_Honor:_Automatic_blood_spatter,_pooling_and_trail_effects" rel="nofollow">https://wiki.roll20.net/Script:Blood_And_Honor:_Automatic_blood_spatter,_pooling_and_trail_effects</a>', &nbsp; hpBar: 3, //1, 2, or 3 &nbsp; hpCountUp: false, &nbsp; baseSize: 0.75, &nbsp; // This will make it so only the GM can use the !clearblood command. Change to "true" if you want to check for authorization. &nbsp; onlyAllowGMtoRunCommands: true, &nbsp; // YOU MUST ADD YOUR OWN SPATTERS AND POOLS TO YOUR LIBRARY AND GET THE IMAGE LINK VIA YOUR WEB BROWSER. FOLLOW THE INSTRUCTIONS HERE: <a href="https://wiki.roll20.net/API:Objects#imgsrc_and_avatar_property_restrictions" rel="nofollow">https://wiki.roll20.net/API:Objects#imgsrc_and_avatar_property_restrictions</a> &nbsp; // You can add as many as you'd like to either category. Spatters are also used for blood trails. &nbsp; spatters: [ &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; 'src': '<a href="https://s3.amazonaws.com/files.d20.io/images/86040622/kntrdwmT7E_asCLoSo38rg/thumb.png?156270999155" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/86040622/kntrdwmT7E_asCLoSo38rg/thumb.png?156270999155</a>', &nbsp; &nbsp; &nbsp; 'width': 96, &nbsp; &nbsp; &nbsp; 'height': 104 &nbsp; &nbsp; }, &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; 'src': '<a href="https://s3.amazonaws.com/files.d20.io/images/86042246/RKLIrOrXh7eESvBjDb15kA/thumb.png?156271153255" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/86042246/RKLIrOrXh7eESvBjDb15kA/thumb.png?156271153255</a>', &nbsp; &nbsp; &nbsp; 'width': 200, &nbsp; &nbsp; &nbsp; 'height': 112 &nbsp; &nbsp; }, &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; 'src': '<a href="https://s3.amazonaws.com/files.d20.io/images/86040917/fzE81KGho_Bzk2nZPhvA_w/thumb.png?156271029655" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/86040917/fzE81KGho_Bzk2nZPhvA_w/thumb.png?156271029655</a>', &nbsp; &nbsp; &nbsp; 'width': 178, &nbsp; &nbsp; &nbsp; 'height': 178 &nbsp; &nbsp; }, &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; 'src': '<a href="https://s3.amazonaws.com/files.d20.io/images/86042512/gQ2GFcu62CnEAXINv-lPiw/thumb.png?156271179655" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/86042512/gQ2GFcu62CnEAXINv-lPiw/thumb.png?156271179655</a>', &nbsp; &nbsp; &nbsp; 'width': 200, &nbsp; &nbsp; &nbsp; 'height': 119 &nbsp; &nbsp; }, &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; 'src': '<a href="https://s3.amazonaws.com/files.d20.io/images/86040722/m3oJPc6wfbXY1xeqO6DKug/thumb.png?156271010655" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/86040722/m3oJPc6wfbXY1xeqO6DKug/thumb.png?156271010655</a>', &nbsp; &nbsp; &nbsp; 'width': 200, &nbsp; &nbsp; &nbsp; 'height': 79 &nbsp; &nbsp; }, &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; 'src': '<a href="https://s3.amazonaws.com/files.d20.io/images/87795629/mpepRx5X87-iBDssX8cAcw/thumb.png?15644354035" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/87795629/mpepRx5X87-iBDssX8cAcw/thumb.png?15644354035</a>', &nbsp; &nbsp; &nbsp; 'width': 200, &nbsp; &nbsp; &nbsp; 'height': 88 &nbsp; &nbsp; }, &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; 'src': '<a href="https://s3.amazonaws.com/files.d20.io/images/87797800/ufbDcqE7vljUGLNVnSgLCA/thumb.png?15644372515" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/87797800/ufbDcqE7vljUGLNVnSgLCA/thumb.png?15644372515</a>', &nbsp; &nbsp; &nbsp; 'width': 200, &nbsp; &nbsp; &nbsp; 'height': 100 &nbsp; &nbsp; }, &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; 'src': '<a href="https://s3.amazonaws.com/files.d20.io/images/87797798/n-oZmFsY8cI4e5DtLOZ70Q/thumb.png?15644372525" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/87797798/n-oZmFsY8cI4e5DtLOZ70Q/thumb.png?15644372525</a>', &nbsp; &nbsp; &nbsp; 'width': 200, &nbsp; &nbsp; &nbsp; 'height': 139 &nbsp; &nbsp; }, &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; 'src': '<a href="https://s3.amazonaws.com/files.d20.io/images/87797792/lW2MylE7hd5RqVRJiI4QIg/thumb.png?15644372525" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/87797792/lW2MylE7hd5RqVRJiI4QIg/thumb.png?15644372525</a>', &nbsp; &nbsp; &nbsp; 'width': 200, &nbsp; &nbsp; &nbsp; 'height': 89 &nbsp; &nbsp; }, &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; 'src': '<a href="https://s3.amazonaws.com/files.d20.io/images/87797807/E8f_U488zRLnPsGNofWriw/thumb.png?15644372525" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/87797807/E8f_U488zRLnPsGNofWriw/thumb.png?15644372525</a>', &nbsp; &nbsp; &nbsp; 'width': 200, &nbsp; &nbsp; &nbsp; 'height': 99 &nbsp; &nbsp; }, &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; 'src': '<a href="https://s3.amazonaws.com/files.d20.io/images/87797796/WIN9AUYqT7BqWfHwqklW-Q/thumb.png?15644372525" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/87797796/WIN9AUYqT7BqWfHwqklW-Q/thumb.png?15644372525</a>', &nbsp; &nbsp; &nbsp; 'width': 200, &nbsp; &nbsp; &nbsp; 'height': 193 &nbsp; &nbsp; }, &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; 'src': '<a href="https://s3.amazonaws.com/files.d20.io/images/87797794/ytHbFezu7N419bYcBfLKmQ/thumb.png?15644372525" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/87797794/ytHbFezu7N419bYcBfLKmQ/thumb.png?15644372525</a>', &nbsp; &nbsp; &nbsp; 'width': 200, &nbsp; &nbsp; &nbsp; 'height': 100 &nbsp; &nbsp; }, &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; 'src': '<a href="https://s3.amazonaws.com/files.d20.io/images/87797797/f1LMeYhZjByw7N2peOXjfA/thumb.png?15644372525" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/87797797/f1LMeYhZjByw7N2peOXjfA/thumb.png?15644372525</a>', &nbsp; &nbsp; &nbsp; 'width': 200, &nbsp; &nbsp; &nbsp; 'height': 46 &nbsp; &nbsp; }, &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; 'src': '<a href="https://s3.amazonaws.com/files.d20.io/images/87797803/uzqRNhuBBGJpO_VQxOx-kg/thumb.png?15644372525" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/87797803/uzqRNhuBBGJpO_VQxOx-kg/thumb.png?15644372525</a>', &nbsp; &nbsp; &nbsp; 'width': 200, &nbsp; &nbsp; &nbsp; 'height': 130 &nbsp; &nbsp; }, &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; 'src': '<a href="https://s3.amazonaws.com/files.d20.io/images/87797791/faWz-10xcrR3GxabmofAzQ/thumb.png?15644372525" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/87797791/faWz-10xcrR3GxabmofAzQ/thumb.png?15644372525</a>', &nbsp; &nbsp; &nbsp; 'width': 200, &nbsp; &nbsp; &nbsp; 'height': 35 &nbsp; &nbsp; }, &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; 'src': '<a href="https://s3.amazonaws.com/files.d20.io/images/87797801/Vm63oDZC4DChlwCxp3wn4A/thumb.png?15644372525" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/87797801/Vm63oDZC4DChlwCxp3wn4A/thumb.png?15644372525</a>', &nbsp; &nbsp; &nbsp; 'width': 200, &nbsp; &nbsp; &nbsp; 'height': 72 &nbsp; &nbsp; }, &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; 'src': '<a href="https://s3.amazonaws.com/files.d20.io/images/87797805/ka3o-nH_rIwtTQV0zyPVzA/thumb.png?15644372525" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/87797805/ka3o-nH_rIwtTQV0zyPVzA/thumb.png?15644372525</a>', &nbsp; &nbsp; &nbsp; 'width': 200, &nbsp; &nbsp; &nbsp; 'height': 31 &nbsp; &nbsp; }, &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; 'src': '<a href="https://s3.amazonaws.com/files.d20.io/images/87797795/j5y1kU96v26IRYJW2t6Exg/thumb.png?15644372525" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/87797795/j5y1kU96v26IRYJW2t6Exg/thumb.png?15644372525</a>', &nbsp; &nbsp; &nbsp; 'width': 200, &nbsp; &nbsp; &nbsp; 'height': 40 &nbsp; &nbsp; }, &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; 'src': '<a href="https://s3.amazonaws.com/files.d20.io/images/87797793/utvrNGRZvAYNwFS46CMIQA/thumb.png?15644372525" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/87797793/utvrNGRZvAYNwFS46CMIQA/thumb.png?15644372525</a>', &nbsp; &nbsp; &nbsp; 'width': 200, &nbsp; &nbsp; &nbsp; 'height': 134 &nbsp; &nbsp; }, &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; 'src': '<a href="https://s3.amazonaws.com/files.d20.io/images/87797799/MPGUexAkAOO_BMhiWnHCcg/thumb.png?15644372525" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/87797799/MPGUexAkAOO_BMhiWnHCcg/thumb.png?15644372525</a>', &nbsp; &nbsp; &nbsp; 'width': 200, &nbsp; &nbsp; &nbsp; 'height': 83 &nbsp; &nbsp; }, &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; 'src': '<a href="https://s3.amazonaws.com/files.d20.io/images/87797802/vhs3j0Gg36-qY-1qQK-lUg/thumb.png?15644372535" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/87797802/vhs3j0Gg36-qY-1qQK-lUg/thumb.png?15644372535</a>', &nbsp; &nbsp; &nbsp; 'width': 200, &nbsp; &nbsp; &nbsp; 'height': 179 &nbsp; &nbsp; }, &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; 'src': '<a href="https://s3.amazonaws.com/files.d20.io/images/87797790/kfgZSml_CHHFCtc-j-X-2g/thumb.png?15644372525" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/87797790/kfgZSml_CHHFCtc-j-X-2g/thumb.png?15644372525</a>', &nbsp; &nbsp; &nbsp; 'width': 200, &nbsp; &nbsp; &nbsp; 'height': 182 &nbsp; &nbsp; }, &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; 'src': '<a href="https://s3.amazonaws.com/files.d20.io/images/87797806/D6g4p_z6FEoJIG4tQC7TNg/thumb.png?15644372525" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/87797806/D6g4p_z6FEoJIG4tQC7TNg/thumb.png?15644372525</a>', &nbsp; &nbsp; &nbsp; 'width': 200, &nbsp; &nbsp; &nbsp; 'height': 51 &nbsp; &nbsp; }, &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; 'src': '<a href="https://s3.amazonaws.com/files.d20.io/images/87797804/oVdr4eCKtZJoUx0Sfqq58g/thumb.png?15644372525" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/87797804/oVdr4eCKtZJoUx0Sfqq58g/thumb.png?15644372525</a>', &nbsp; &nbsp; &nbsp; 'width': 200, &nbsp; &nbsp; &nbsp; 'height': 146 &nbsp; &nbsp; } &nbsp; ], &nbsp; pools: [ &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; 'src': '<a href="https://s3.amazonaws.com/files.d20.io/images/86042455/jIqkxZR4bzM1mRfmf2Gmxg/thumb.png?156271174055" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/86042455/jIqkxZR4bzM1mRfmf2Gmxg/thumb.png?156271174055</a>', &nbsp; &nbsp; &nbsp; 'width': 200, &nbsp; &nbsp; &nbsp; 'height': 156 &nbsp; &nbsp; }, &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; 'src': '<a href="https://s3.amazonaws.com/files.d20.io/images/86042523/GrpUCc8Prkjtf7yhu9WegQ/thumb.png?156271181555" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/86042523/GrpUCc8Prkjtf7yhu9WegQ/thumb.png?156271181555</a>', &nbsp; &nbsp; &nbsp; 'width': 200, &nbsp; &nbsp; &nbsp; 'height': 184 &nbsp; &nbsp; }, &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; 'src': '<a href="https://s3.amazonaws.com/files.d20.io/images/86042312/RsFVBn0upnteA-_Yf-0gKw/thumb.png?156271158955" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/86042312/RsFVBn0upnteA-_Yf-0gKw/thumb.png?156271158955</a>', &nbsp; &nbsp; &nbsp; 'width': 200, &nbsp; &nbsp; &nbsp; 'height': 198 &nbsp; &nbsp; }, &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; 'src': '<a href="https://s3.amazonaws.com/files.d20.io/images/86040427/boOltezyis15YuwGjgqENg/thumb.png?1562709827555" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/86040427/boOltezyis15YuwGjgqENg/thumb.png?1562709827555</a>', &nbsp; &nbsp; &nbsp; 'width': 191, &nbsp; &nbsp; &nbsp; 'height': 200 &nbsp; &nbsp; }, &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; 'src': '<a href="https://s3.amazonaws.com/files.d20.io/images/86042428/xbBfoxsYO0mctCQY07dwcg/thumb.png?156271171655" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/86042428/xbBfoxsYO0mctCQY07dwcg/thumb.png?156271171655</a>', &nbsp; &nbsp; &nbsp; 'width': 200, &nbsp; &nbsp; &nbsp; 'height': 157 &nbsp; &nbsp; }, &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; 'src': '<a href="https://s3.amazonaws.com/files.d20.io/images/86040961/Onx-zQg2UCxGumFUKi65gw/thumb.png?156271034455" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/86040961/Onx-zQg2UCxGumFUKi65gw/thumb.png?156271034455</a>', &nbsp; &nbsp; &nbsp; 'width': 200, &nbsp; &nbsp; &nbsp; 'height': 184 &nbsp; &nbsp; }, &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; 'src': '<a href="https://s3.amazonaws.com/files.d20.io/images/87798418/Z7LbD9JnZyPexv7ZPzXmQw/thumb.png?15644378445" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/87798418/Z7LbD9JnZyPexv7ZPzXmQw/thumb.png?15644378445</a>', &nbsp; &nbsp; &nbsp; 'width': 200, &nbsp; &nbsp; &nbsp; 'height': 77 &nbsp; &nbsp; }, &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; 'src': '<a href="https://s3.amazonaws.com/files.d20.io/images/87798421/n_UfMRVWg3FxGvE8hE6-eg/thumb.png?15644378445" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/87798421/n_UfMRVWg3FxGvE8hE6-eg/thumb.png?15644378445</a>', &nbsp; &nbsp; &nbsp; 'width': 200, &nbsp; &nbsp; &nbsp; 'height': 128 &nbsp; &nbsp; }, &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; 'src': '<a href="https://s3.amazonaws.com/files.d20.io/images/87798422/9goDoMdrhif3tCiL1cF46w/thumb.png?15644378445" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/87798422/9goDoMdrhif3tCiL1cF46w/thumb.png?15644378445</a>', &nbsp; &nbsp; &nbsp; 'width': 180, &nbsp; &nbsp; &nbsp; 'height': 200 &nbsp; &nbsp; }, &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; 'src': '<a href="https://s3.amazonaws.com/files.d20.io/images/87798417/_62dV02KoJWVYTIBKTpqLQ/thumb.png?15644378445" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/87798417/_62dV02KoJWVYTIBKTpqLQ/thumb.png?15644378445</a>', &nbsp; &nbsp; &nbsp; 'width': 200, &nbsp; &nbsp; &nbsp; 'height': 161 &nbsp; &nbsp; }, &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; 'src': '<a href="https://s3.amazonaws.com/files.d20.io/images/87798416/ALi8x_YTEVrDPZhcIfLIzA/thumb.png?15644378445" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/87798416/ALi8x_YTEVrDPZhcIfLIzA/thumb.png?15644378445</a>', &nbsp; &nbsp; &nbsp; 'width': 200, &nbsp; &nbsp; &nbsp; 'height': 173 &nbsp; &nbsp; }, &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; 'src': '<a href="https://s3.amazonaws.com/files.d20.io/images/87798420/wzMqQfQ3FcBXpj6_qfr-iA/thumb.png?15644378445" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/87798420/wzMqQfQ3FcBXpj6_qfr-iA/thumb.png?15644378445</a>', &nbsp; &nbsp; &nbsp; 'width': 200, &nbsp; &nbsp; &nbsp; 'height': 196 &nbsp; &nbsp; }, &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; 'src': '<a href="https://s3.amazonaws.com/files.d20.io/images/87798415/d_mE41iA1iOcXn_NtcuIoA/thumb.png?15644378455" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/87798415/d_mE41iA1iOcXn_NtcuIoA/thumb.png?15644378455</a>', &nbsp; &nbsp; &nbsp; 'width': 200, &nbsp; &nbsp; &nbsp; 'height': 200 &nbsp; &nbsp; }, &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; 'src': '<a href="https://s3.amazonaws.com/files.d20.io/images/87798419/zKKy4ojsBQ3PIeUbN_v0Eg/thumb.png?15644378455" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/87798419/zKKy4ojsBQ3PIeUbN_v0Eg/thumb.png?15644378455</a>', &nbsp; &nbsp; &nbsp; 'width': 200, &nbsp; &nbsp; &nbsp; 'height': 155 &nbsp; &nbsp; }, &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; 'src': '<a href="https://s3.amazonaws.com/files.d20.io/images/87798423/4uiV4Xg7XLYjOhj9YkJMwQ/thumb.png?15644378455" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/87798423/4uiV4Xg7XLYjOhj9YkJMwQ/thumb.png?15644378455</a>', &nbsp; &nbsp; &nbsp; 'width': 181, &nbsp; &nbsp; &nbsp; 'height': 200 &nbsp; &nbsp; } &nbsp; ], &nbsp; chooseBlood: function (type) { &nbsp; &nbsp; if (type === 'spatter') { &nbsp; &nbsp; &nbsp; return BloodSpatter.spatters[randomInteger(BloodSpatter.spatters.length) - 1]; &nbsp; &nbsp; } &nbsp; &nbsp; if (type === 'pool') { &nbsp; &nbsp; &nbsp; return BloodSpatter.pools[randomInteger(BloodSpatter.pools.length) - 1]; &nbsp; &nbsp; } &nbsp; }, &nbsp; getOffset: function () { &nbsp; &nbsp; return Math.random() &lt; 0.5 ? 1 : -1; &nbsp; }, &nbsp; bloodColor: function (gmnotes) { &nbsp; &nbsp; if (gmnotes.indexOf('bloodcolor_purple') !== -1) { &nbsp; &nbsp; &nbsp; return '#0000ff'; &nbsp; &nbsp; } else if (gmnotes.indexOf('bloodcolor_blue') !== -1) { &nbsp; &nbsp; &nbsp; return '#00ffff'; &nbsp; &nbsp; } else if (gmnotes.indexOf('bloodcolor_orange') !== -1) { &nbsp; &nbsp; &nbsp; return '#ffff00'; &nbsp; &nbsp; } else { &nbsp; &nbsp; &nbsp; return 'transparent'; &nbsp; &nbsp; } &nbsp; }, &nbsp; createBlood: function (token, multiplier, bloodType) { &nbsp; &nbsp; var pages = _.union([Campaign().get('playerpageid')], _.values(Campaign().get('playerspecificpages'))); &nbsp; &nbsp; var dropBlood = _.contains(pages, token.get('pageid')); &nbsp; &nbsp; var gmNotes = token.get('gmnotes'); &nbsp; &nbsp; if (!dropBlood || token.get('layer') !== 'objects' || gmNotes.indexOf('noblood') !== -1) { &nbsp; &nbsp; &nbsp; return; &nbsp; &nbsp; } &nbsp; &nbsp; var size = Math.floor(BloodSpatter.getTokenSize(token) * multiplier); &nbsp; &nbsp; var bloodImage = BloodSpatter.chooseBlood(bloodType); &nbsp; &nbsp; var bloodTokenSource = bloodImage; &nbsp; &nbsp; var bloodTokenWidth = size * multiplier; &nbsp; &nbsp; var bloodTokenHeight = size * multiplier; &nbsp; &nbsp; if (bloodImage !== null &amp;&amp; typeof(bloodImage) === 'object') { &nbsp; &nbsp; &nbsp; bloodTokenSource = bloodImage.src; &nbsp; &nbsp; &nbsp; var bloodImageAspectRatio = bloodImage.width / bloodImage.height; &nbsp; &nbsp; &nbsp; var widthRatioMultiplier = 1; &nbsp; &nbsp; &nbsp; var heightRatioMultiplier = 1; &nbsp; &nbsp; &nbsp; if (bloodImageAspectRatio &lt; 1) { &nbsp; &nbsp; &nbsp; &nbsp; widthRatioMultiplier = bloodImageAspectRatio; &nbsp; &nbsp; &nbsp; } else if (bloodImageAspectRatio &gt; 1) { &nbsp; &nbsp; &nbsp; &nbsp; heightRatioMultiplier = bloodImage.height / bloodImage.width; &nbsp; &nbsp; &nbsp; } &nbsp; &nbsp; &nbsp; bloodTokenWidth = bloodTokenWidth * widthRatioMultiplier; &nbsp; &nbsp; &nbsp; bloodTokenHeight = bloodTokenHeight * heightRatioMultiplier; &nbsp; &nbsp; } &nbsp; &nbsp; var widthIncrement = bloodTokenWidth * 0.1; &nbsp; &nbsp; var widthIncrementTotal = widthIncrement; &nbsp; &nbsp; var heightIncrement = bloodTokenHeight * 0.1; &nbsp; &nbsp; var heightIncrementTotal = heightIncrement; &nbsp; &nbsp; var spatterToken = BloodSpatter.fixedCreateObj('graphic', { &nbsp; &nbsp; &nbsp; pageid: token.get('_pageid'), &nbsp; &nbsp; &nbsp; imgsrc: bloodTokenSource, &nbsp; &nbsp; &nbsp; tint_color: BloodSpatter.bloodColor(gmNotes), &nbsp; &nbsp; &nbsp; gmnotes: 'blood', &nbsp; &nbsp; &nbsp; top: token.get('top') + (randomInteger(Math.floor(size / 2)) * BloodSpatter.getOffset()), &nbsp; &nbsp; &nbsp; left: token.get('left') + (randomInteger(Math.floor(size / 2)) * BloodSpatter.getOffset()), &nbsp; &nbsp; &nbsp; width: widthIncrement, &nbsp; &nbsp; &nbsp; height: heightIncrement, &nbsp; &nbsp; &nbsp; rotation: randomInteger(360) - 1, &nbsp; &nbsp; &nbsp; layer: 'map' &nbsp; &nbsp; }); &nbsp; &nbsp; toFront(spatterToken); &nbsp; &nbsp; (function splatterEnlargeFunction(count) { &nbsp; &nbsp; &nbsp; if (count &lt; 10) { &nbsp; &nbsp; &nbsp; &nbsp; setTimeout(function () { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; widthIncrementTotal += widthIncrement; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; heightIncrementTotal += heightIncrement; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; spatterToken.set({ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; width: widthIncrementTotal, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; height: heightIncrementTotal &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; splatterEnlargeFunction(count + 1); &nbsp; &nbsp; &nbsp; &nbsp; }, 30); &nbsp; &nbsp; &nbsp; } &nbsp; &nbsp; })(0); &nbsp; }, &nbsp; getTokenSize: function (token) { &nbsp; &nbsp; return (token.get('height') + token.get('width')) / 2; //average the height and the width &nbsp; }, &nbsp; timeout: 0, &nbsp; increaseTimeout: function () { &nbsp; &nbsp; BloodSpatter.timeout += 4; &nbsp; &nbsp; BloodSpatter.watchTimeout(); &nbsp; }, &nbsp; interval: null, &nbsp; watchTimeout: function () { &nbsp; &nbsp; if (BloodSpatter.interval === null) { &nbsp; &nbsp; &nbsp; BloodSpatter.interval = setInterval(function () { &nbsp; &nbsp; &nbsp; &nbsp; if (BloodSpatter.timeout &gt; 0) { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; BloodSpatter.timeout--; &nbsp; &nbsp; &nbsp; &nbsp; } else { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; clearInterval(BloodSpatter.interval); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; BloodSpatter.interval = null; &nbsp; &nbsp; &nbsp; &nbsp; } &nbsp; &nbsp; &nbsp; }, 2000); &nbsp; &nbsp; } &nbsp; }, &nbsp; fixedCreateObj: function () { &nbsp; &nbsp; return function () { &nbsp; &nbsp; &nbsp; var obj = createObj.apply(this, arguments); &nbsp; &nbsp; &nbsp; if (obj &amp;&amp; !obj.fbpath) { &nbsp; &nbsp; &nbsp; &nbsp; obj.fbpath = obj.changed._fbpath.replace(/([^\/]*\/){4}/, '/'); &nbsp; &nbsp; &nbsp; } &nbsp; &nbsp; &nbsp; return obj; &nbsp; &nbsp; }; &nbsp; }(), &nbsp; tokenHPChanged: function (token, maxHealth, currentHealth, damageTaken) { &nbsp; &nbsp; if (maxHealth === '') { &nbsp; &nbsp; &nbsp; return; &nbsp; &nbsp; } &nbsp; &nbsp; var percentOfHpLost = damageTaken / maxHealth; &nbsp; &nbsp; var damageMultiplier = BloodSpatter.baseSize + percentOfHpLost; &nbsp; &nbsp; if ((!BloodSpatter.hpCountUp &amp;&amp; currentHealth &lt;= maxHealth / 2) || (BloodSpatter.hpCountUp &amp;&amp; currentHealth &gt;= maxHealth / 2)) { &nbsp; &nbsp; &nbsp; token.set({ &nbsp; &nbsp; &nbsp; &nbsp; status_red: true &nbsp; &nbsp; &nbsp; }); &nbsp; &nbsp; &nbsp; // Create spatter near token if "bloodied". Chance of spatter depends on severity of damage &nbsp; &nbsp; &nbsp; if (damageTaken &gt; 0 &amp;&amp; currentHealth &gt; 0 &amp;&amp; ( (!BloodSpatter.hpCountUp &amp;&amp; currentHealth &lt; randomInteger(maxHealth)) || (BloodSpatter.hpCountUp &amp;&amp; currentHealth &gt; randomInteger(maxHealth)) )) { &nbsp; &nbsp; &nbsp; &nbsp; BloodSpatter.createBlood(token, damageMultiplier, 'spatter'); &nbsp; &nbsp; &nbsp; } &nbsp; &nbsp; } else { &nbsp; &nbsp; &nbsp; token.set({ &nbsp; &nbsp; &nbsp; &nbsp; status_red: false &nbsp; &nbsp; &nbsp; }); &nbsp; &nbsp; } &nbsp; &nbsp; if ((!BloodSpatter.hpCountUp &amp;&amp; currentHealth &lt;= 0) || (BloodSpatter.hpCountUp &amp;&amp; currentHealth &gt;= maxHealth)) { &nbsp; &nbsp; &nbsp; token.set({ &nbsp; &nbsp; &nbsp; &nbsp; status_dead: true &nbsp; &nbsp; &nbsp; }); &nbsp; &nbsp; &nbsp; // Create pool near token if health drops below 1. &nbsp; &nbsp; &nbsp; if (damageTaken &gt; 0) { &nbsp; &nbsp; &nbsp; &nbsp; BloodSpatter.createBlood(token, damageMultiplier, 'pool'); &nbsp; &nbsp; &nbsp; } &nbsp; &nbsp; } else { &nbsp; &nbsp; &nbsp; token.set({ &nbsp; &nbsp; &nbsp; &nbsp; status_dead: false &nbsp; &nbsp; &nbsp; }); &nbsp; &nbsp; } &nbsp; } }; on('ready', function () { &nbsp; on('change:graphic:bar' + BloodSpatter.hpBar + '_value', function (token, prev) { &nbsp; &nbsp; var maxHealth = token.get('bar' + BloodSpatter.hpBar + '_max'); &nbsp; &nbsp; var currentHealth = token.get('bar' + BloodSpatter.hpBar + '_value'); &nbsp; &nbsp; var previousHealth = prev['bar' + BloodSpatter.hpBar + '_value']; &nbsp; &nbsp; var damageTaken; &nbsp; &nbsp; if (!BloodSpatter.hpCountUp) { &nbsp; &nbsp; &nbsp; damageTaken = previousHealth - currentHealth; &nbsp; &nbsp; } else { &nbsp; &nbsp; &nbsp; damageTaken = currentHealth - previousHealth; &nbsp; &nbsp; } &nbsp; &nbsp; BloodSpatter.tokenHPChanged(token, maxHealth, currentHealth, damageTaken); &nbsp; }); &nbsp; //Make blood trails, chance goes up depending on how injured a token is &nbsp; on('change:graphic:lastmove', function (token) { &nbsp; &nbsp; var maxHealth = token.get('bar' + BloodSpatter.hpBar + '_max'); &nbsp; &nbsp; if (maxHealth === '' || BloodSpatter.timeout !== 0) { &nbsp; &nbsp; &nbsp; return; &nbsp; &nbsp; } &nbsp; &nbsp; var currentHealth = token.get('bar' + BloodSpatter.hpBar + '_value'); &nbsp; &nbsp; var healthLost = maxHealth - currentHealth; &nbsp; &nbsp; var percentOfHpLost = healthLost / maxHealth; &nbsp; &nbsp; var damageMultiplier = (BloodSpatter.baseSize / 2) + percentOfHpLost; &nbsp; &nbsp; if ((!BloodSpatter.hpCountUp &amp;&amp; currentHealth &lt;= maxHealth / 2 &amp;&amp; currentHealth &lt; randomInteger(maxHealth)) || (BloodSpatter.hpCountUp &amp;&amp; currentHealth &gt;= maxHealth / 2 &amp;&amp; currentHealth &gt; randomInteger(maxHealth))) { &nbsp; &nbsp; &nbsp; BloodSpatter.createBlood(token, damageMultiplier, 'spatter'); &nbsp; &nbsp; &nbsp; BloodSpatter.increaseTimeout(); &nbsp; &nbsp; } &nbsp; }); &nbsp; on('chat:message', function (msg) { &nbsp; &nbsp; if (msg.type === 'api' &amp;&amp; (msg.content.indexOf('!clearblood') !== -1 || msg.content.indexOf('!clear blood') !== -1)) { &nbsp; &nbsp; &nbsp; if (BloodSpatter.onlyAllowGMtoRunCommands &amp;&amp; !playerIsGM(msg.playerid)) { &nbsp; &nbsp; &nbsp; &nbsp; sendChat(msg.who, '/w ' + msg.who + ' You are not authorized to use that command!'); &nbsp; &nbsp; &nbsp; &nbsp; return; &nbsp; &nbsp; &nbsp; } else { &nbsp; &nbsp; &nbsp; &nbsp; var objects = filterObjs(function (obj) { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (obj.get('type') === 'graphic' &amp;&amp; obj.get('gmnotes') === 'blood') { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return true; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } else { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return false; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } &nbsp; &nbsp; &nbsp; &nbsp; }); &nbsp; &nbsp; &nbsp; &nbsp; _.each(objects, function (obj) { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; obj.remove(); &nbsp; &nbsp; &nbsp; &nbsp; }); &nbsp; &nbsp; &nbsp; } &nbsp; &nbsp; } &nbsp; }); });
1565710749
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
You'd remove this bit of code for request #1: on('change:graphic:lastmove', function (token) { &nbsp; &nbsp; var maxHealth = token.get('bar' + BloodSpatter.hpBar + '_max'); &nbsp; &nbsp; if (maxHealth === '' || BloodSpatter.timeout !== 0) { &nbsp; &nbsp; &nbsp; return; &nbsp; &nbsp; } &nbsp; &nbsp; var currentHealth = token.get('bar' + BloodSpatter.hpBar + '_value'); &nbsp; &nbsp; var healthLost = maxHealth - currentHealth; &nbsp; &nbsp; var percentOfHpLost = healthLost / maxHealth; &nbsp; &nbsp; var damageMultiplier = (BloodSpatter.baseSize / 2) + percentOfHpLost; &nbsp; &nbsp; if ((!BloodSpatter.hpCountUp &amp;&amp; currentHealth &lt;= maxHealth / 2 &amp;&amp; currentHealth &lt; randomInteger(maxHealth)) || (BloodSpatter.hpCountUp &amp;&amp; currentHealth &gt;= maxHealth / 2 &amp;&amp; currentHealth &gt; randomInteger(maxHealth))) { &nbsp; &nbsp; &nbsp; BloodSpatter.createBlood(token, damageMultiplier, 'spatter'); &nbsp; &nbsp; &nbsp; BloodSpatter.increaseTimeout(); &nbsp; &nbsp; } }); For number 2, you'd need to remove the setting of red and dead to true from this section: if ((!BloodSpatter.hpCountUp &amp;&amp; currentHealth &lt;= maxHealth / 2) || (BloodSpatter.hpCountUp &amp;&amp; currentHealth &gt;= maxHealth / 2)) { &nbsp; &nbsp; &nbsp; token.set({ &nbsp; &nbsp; &nbsp; &nbsp; status_red: true &nbsp; &nbsp; &nbsp; }); &nbsp; &nbsp; &nbsp; // Create spatter near token if "bloodied". Chance of spatter depends on severity of damage &nbsp; &nbsp; &nbsp; if (damageTaken &gt; 0 &amp;&amp; currentHealth &gt; 0 &amp;&amp; ( (!BloodSpatter.hpCountUp &amp;&amp; currentHealth &lt; randomInteger(maxHealth)) || (BloodSpatter.hpCountUp &amp;&amp; currentHealth &gt; randomInteger(maxHealth)) )) { &nbsp; &nbsp; &nbsp; &nbsp; BloodSpatter.createBlood(token, damageMultiplier, 'spatter'); &nbsp; &nbsp; &nbsp; } &nbsp; &nbsp; } else { &nbsp; &nbsp; &nbsp; token.set({ &nbsp; &nbsp; &nbsp; &nbsp; status_red: false &nbsp; &nbsp; &nbsp; }); &nbsp; &nbsp; } &nbsp; &nbsp; if ((!BloodSpatter.hpCountUp &amp;&amp; currentHealth &lt;= 0) || (BloodSpatter.hpCountUp &amp;&amp; currentHealth &gt;= maxHealth)) { &nbsp; &nbsp; &nbsp; token.set({ &nbsp; &nbsp; &nbsp; &nbsp; status_dead: true &nbsp; &nbsp; &nbsp; }); From the way the codes pasted, I'm not quite sure where the various ifs end/begin, but you could probably also remove a good bit of that code.
Thank you so much Scott! /Jonathan