anvil-vtt / BrokenCompass

A Broken Compass game system for FoundryVTT.
MIT License
4 stars 7 forks source link

Modification system.js #66

Closed cyberdwarf1664 closed 1 year ago

cyberdwarf1664 commented 1 year ago

Hello again, I propose you a modification of the system.js in order to use the foundry coin instead of 1d2 for the Luck Coin.. This is the most beautiful effect with a module like dice so nice !

Teh2 changes in the first line are in bold and Italic :

const t=await new Roll("1dc").roll(),a=t.terms[0]&&t.terms[0].results?t.terms[0].results:[],s={user:game.user?._id,speaker:ChatMessage.getSpeaker({actor:this.actor}),type:CONST.CHAT_MESSAGE_TYPES.ROLL,sound:CONFIG.sounds.dice,roll:t,rollMode:game.settings.get("core","rollMode"),content:""};await ChatMessage.create(s),a.length&&a[0].result<1&&this.actor.update({"data.luck.coins":n-1})}

Thanks

PatrickBauer commented 1 year ago

Thank you, changed that code and released a new version. You made your life a bit harder by looking at the compiled version of the code. The roll you looked for is in this file, which is a lot easier to read: https://github.com/anvil-vtt/BrokenCompass/blob/main/src/module/actor/sheets/BCActorSheet.js :)