Compare commits

...

2 Commits
v1.0.3 ... main

Author SHA1 Message Date
93fa0caa29 macros/kalikke.js 2024-06-22 12:04:35 -05:00
0e7066608d asset updates 2024-03-11 21:34:37 -05:00
10 changed files with 74 additions and 6 deletions

BIN
assets/art/old_sycamore_totm.webp (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/maps/companions/Ekundayo/rough_hills.webp (Stored with Git LFS) Executable file

Binary file not shown.

BIN
assets/maps/greenbelt/fangberry_thicket.webp (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/tokens/npcs/greenbelt/Chief_Sootscale.Avatar.webp (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/tokens/npcs/greenbelt/Chief_Sootscale.Token..webp (Stored with Git LFS) Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
assets/tokens/npcs/greenbelt/Tartuk.Avatar.webp (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/tokens/npcs/greenbelt/Tartuk.Token.webp (Stored with Git LFS) Normal file

Binary file not shown.

53
macros/kalikke.js Normal file
View File

@ -0,0 +1,53 @@
const forms = [
{
token: 'modules/mb-pfsw-kingmaker/assets/tokens/npcs/companions/kanerah.Token.webp',
avatar: 'modules/mb-pfsw-kingmaker/assets/tokens/npcs/companions/kanerah.Avatar.webp',
name: 'Kanerah',
formName: 'Kanerah Form',
formItem: null,
}, {
token: 'modules/mb-pfsw-kingmaker/assets/tokens/npcs/companions/kalikke.Token.webp',
avatar: 'modules/mb-pfsw-kingmaker/assets/tokens/npcs/companions/kalikke.Avatar.webp',
name: 'Kalikke',
formName: 'Kalikke Form',
formItem: null
}
]
const actorUUID = 'Actor.vfyKGZVNAuWnBPSU'
const EQUIPPED = CONFIG.SWADE.CONST.EQUIP_STATE.EQUIPPED
const STORED = CONFIG.SWADE.CONST.EQUIP_STATE.STORED
async function main() {
if (token.actor.uuid !== actorUUID) {
ui.notifications.error("Incorrect token selected")
return
}
let activeForm = 0
for (let idx = 0; idx < forms.length; idx++) {
const form = forms[idx]
form.formItem = token.actor.items.find(i => i.name === form.formName)
if (form.formItem.system.equipStatus === EQUIPPED) {
activeForm = idx
}
form.formItem.update({'system.equipStatus': STORED})
}
activeForm = (activeForm + 1) % forms.length
const itemMods = {'system.equipStatus': EQUIPPED}
const tokenMods = {
name: forms[activeForm].name,
'texture.src': forms[activeForm].token
}
const actorMods = {
name: forms[activeForm].name,
img: forms[activeForm].avatar,
}
await token.document.update(tokenMods)
await token.actor.update(actorMods)
await forms[activeForm].formItem.update(itemMods)
await token.actor.prototypeToken.update(tokenMods)
}
main()