{"_id": "a68969a2ac5a2855", "name": "Import Voidships", "type": "script", "img": "icons/svg/sword.svg", "command": "game.wgVoidshipsMacros.importVoidships();", "scope": "global", "author": null, "ownership": {"default": 2}} {"_id": "72e2ff46870f2723", "name": "Create Voidship Crit Table (d66)", "type": "script", "img": "icons/svg/d20-black.svg", "command": "game.wgVoidshipsMacros.createCritTable();", "scope": "global", "author": null, "ownership": {"default": 2}} {"_id": "9c4931885b529b9c", "name": "Apply Voidship Hit", "type": "script", "img": "icons/svg/splash.svg", "command": "game.wgVoidshipsMacros.applyHit();", "scope": "global", "author": null, "ownership": {"default": 2}} {"_id": "473e9b2b97086116", "name": "Recharge Void Shields", "type": "script", "img": "icons/svg/regen.svg", "command": "game.wgVoidshipsMacros.rechargeShields();", "scope": "global", "author": null, "ownership": {"default": 2}} {"_id": "dfd9ef292fb3774f", "name": "Set Void Shields", "type": "script", "img": "icons/svg/aura.svg", "command": "game.wgVoidshipsMacros.setShields();", "scope": "global", "author": null, "ownership": {"default": 2}} {"_id":"mcr000000000001","name":"Add Gear to Selected Voidship","type":"script","img":"icons/svg/plus.svg","command":"(async ()=>{const a=canvas.tokens.controlled[0]?.actor; if(!a) return ui.notifications.warn('Select a voidship token.'); const pack=game.packs.get('wg-voidships-builder.wg-voidship-items'); if(!pack) return ui.notifications.error('Items pack not found.'); const index=await pack.getIndex(); const names=index.map(e=>e.name).sort(); const opts=names.map(n=>``).join(''); const content=`

Choose items to add (Ctrl/Cmd+Click):

`; new Dialog({title:'Add Gear', content, buttons:{ok:{label:'Add',callback:async html=>{const sel=[...html[0].querySelector('#it').selectedOptions].map(o=>o.value); const docs=await pack.getDocuments({name:{$in:sel}}); const data=docs.map(d=>d.toObject()); await a.createEmbeddedDocuments('Item', data); ui.notifications.info(`Added ${sel.length} item(s) to ${a.name}.`);}}}}).render(true);})();","scope":"global","author":null,"ownership":{"default":2}} {"_id":"mcr000000000002","name":"Remove All Gear (Selected)","type":"script","img":"icons/svg/trash.svg","command":"(async()=>{const a=canvas.tokens.controlled[0]?.actor; if(!a) return ui.notifications.warn('Select a voidship token.'); const ids=a.items.filter(i=>['gear','weapon'].includes(i.type)).map(i=>i.id); if(!ids.length) return ui.notifications.info('No gear/weapon items to remove.'); await a.deleteEmbeddedDocuments('Item', ids); ui.notifications.info(`Removed ${ids.length} items from ${a.name}.`);})();","scope":"global","author":null,"ownership":{"default":2}} {"_id":"mcr000000000003","name":"Toggle Geller (Primary/Reserve)","type":"script","img":"icons/svg/aura.svg","command":"(async()=>{const a=canvas.tokens.controlled[0]?.actor; if(!a) return ui.notifications.warn('Select a voidship token.'); const g=a.getFlag('wg-voidships','geller')||{primaryActive:false,reserveActive:false}; const content=`

Primary:

Reserve:

`; new Dialog({title:'Geller Fields',content,buttons:{ok:{label:'Set',callback:async html=>{const p=html[0].querySelector('#p').checked; const r=html[0].querySelector('#r').checked; await a.setFlag('wg-voidships','geller',{primaryActive:p,reserveActive:r}); ChatMessage.create({content:`${a.name}: Geller Primary ${p?'ON':'OFF'} / Reserve ${r?'ON':'OFF'}`});}}}}).render(true);})();","scope":"global","author":null,"ownership":{"default":2}}