From 14a892e627a375334a02381351f139d94ad7ecf3 Mon Sep 17 00:00:00 2001 From: ダカマ Date: Mon, 2 Jun 2025 13:08:46 +0200 Subject: First dump --- tgscripts/fvtt-Macro-weapon-select.json | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 tgscripts/fvtt-Macro-weapon-select.json (limited to 'tgscripts/fvtt-Macro-weapon-select.json') diff --git a/tgscripts/fvtt-Macro-weapon-select.json b/tgscripts/fvtt-Macro-weapon-select.json new file mode 100644 index 0000000..4db9192 --- /dev/null +++ b/tgscripts/fvtt-Macro-weapon-select.json @@ -0,0 +1,24 @@ +{ + "name": "Weapon-Select", + "type": "script", + "scope": "global", + "author": "3r8Uo5wkrb6EqEZc", + "img": "icons/svg/dice-target.svg", + "command": "let applyWeaponChanges = false;\nlet applyFistChanges = false;\nconst his = game.actors.getName(\"Hisui\");\n\nlet style = '

'\n\nlet message = style + 'Weapon Select

\\n

Hisui is using ';\n\n\n\nnew Dialog({\n title : `Improvised Weapon Select`,\n content : `\n \n \n `,\n buttons : {\n weapon : {\n icon : \"\",\n label : `Equip Weapon`,\n callback : () => { applyWeaponChanges = true; applyFistChanges = false; }\n },\n fists : {\n icon : \"\",\n label : `Equip Hands`,\n callback : () => { applyWeaponChanges = false; applyFistChanges = true; }\n },\n cancel : {\n icon : \"\",\n label : `Cancel`,\n callback : () => { applyWeaponChanges = false; applyFistChanges = false; }\n }\n },\n default : \"weapon\",\n close : html => {\n if (applyWeaponChanges || applyFistChanges) {\n if(applyWeaponChanges) {\n let die = ( html.find('[name=\"dice\"]')[0].value || \"d8\" );\n let hand = ( html.find('[name=\"attackmod\"]')[0].value || \"1h\" );\n let mod = ( hand == \"2h\" ) ? (his.data.data.abilities.str.mod - his.data.data.abilities.dex.mod) : 0; \n\n his.system.attributes.weapon.melee.dice = die;\n his.system.attributes.attackMod.value = mod;\n\n his.update({'system.attributes.weapon.melee.dualwield' : (hand == \"1h\") ? 'true' : 'false' });\n\n message += 'a '+ ( hand == \"1h\" ? 'one-handed ' : 'two-handed ') + 'weapon with a ' + die + ' damage die.

';\n\n \n } else {\n his.system.attributes.attackMod.value = 0;\n his.update({'system.attributes.weapon.melee.dualwield' : 'true' });\n \n message += 'her bare hands.

'\n }\n\n his.update({'system.resources.spendable.custom2.current' : (applyWeaponChanges == true) ? 1 : 0});\n\n ChatMessage.create({\n user: game.user._id,\n speaker: ChatMessage.getSpeaker({token: actor}),\n content: message\n });\n\n\n }\n }\n }).render(true);", + "flags": { + "exportSource": { + "world": "valoran", + "system": "archmage", + "coreVersion": "10.291", + "systemVersion": "1.23.1" + } + }, + "_stats": { + "systemId": "archmage", + "systemVersion": "1.23.1", + "coreVersion": "10.291", + "createdTime": 1670059784200, + "modifiedTime": 1670152580815, + "lastModifiedBy": "3r8Uo5wkrb6EqEZc" + } +} \ No newline at end of file -- cgit v1.2.3