mirror of
https://github.com/migatu/vtt_work.git
synced 2026-07-14 21:38:39 +00:00
ASaa
This commit is contained in:
@@ -3,3 +3,6 @@
|
||||
{"_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=>`<option>${n}</option>`).join(''); const content=`<p>Choose items to add (Ctrl/Cmd+Click):</p><select id=it multiple size=12 style='width:100%'>${opts}</select>`; 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=`<p>Primary: <input type=checkbox id=p ${g.primaryActive?'checked':''}></p><p>Reserve: <input type=checkbox id=r ${g.reserveActive?'checked':''}></p>`; 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}}
|
||||
|
||||
Reference in New Issue
Block a user