add spiritual weapon summon

This commit is contained in:
Mike Bloy 2024-02-13 22:29:48 -06:00
parent 6b5b1195ab
commit a3733fa4cc
18 changed files with 237 additions and 34 deletions

View File

@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [2.4.1] 2024-02-13
### Added
- Added support for SWPF Smite's Spiritual Weapon (from the APG)
## [2.4.0] 2024-02-11 ## [2.4.0] 2024-02-11
### Added ### Added

View File

@ -1,7 +1,7 @@
{ {
"id": "swade-mb-helpers", "id": "swade-mb-helpers",
"title": "SWADE Helpers (MB)", "title": "SWADE Helpers (MB)",
"version": "2.4.0", "version": "2.4.1",
"description": "Mike's collection of swade helpers", "description": "Mike's collection of swade helpers",
"authors": [ "authors": [
{ {

Binary file not shown.

View File

@ -1,5 +1,5 @@
2024/02/11-16:18:00.323096 7fc271fbd700 Delete type=3 #1 2024/02/13-22:26:01.851241 7f4532ffd700 Delete type=3 #1
2024/02/11-16:18:00.326138 7fc270d42700 Level-0 table #5: started 2024/02/13-22:26:01.853425 7f45327fc700 Level-0 table #5: started
2024/02/11-16:18:00.332530 7fc270d42700 Level-0 table #5: 15710 bytes OK 2024/02/13-22:26:01.856531 7f45327fc700 Level-0 table #5: 17250 bytes OK
2024/02/11-16:18:00.339263 7fc270d42700 Delete type=0 #3 2024/02/13-22:26:01.859327 7f45327fc700 Delete type=0 #3
2024/02/11-16:18:00.339399 7fc270d42700 Manual compaction at level-0 from '!folders!0nDRFmMBs5DBJU9M' @ 72057594037927935 : 1 .. '!items.effects!RC1Nz6iph8wPPK1B.g9W5hJisq3MsCpZW' @ 0 : 0; will stop at (end) 2024/02/13-22:26:01.859433 7f45327fc700 Manual compaction at level-0 from '!folders!0nDRFmMBs5DBJU9M' @ 72057594037927935 : 1 .. '!items.effects!RC1Nz6iph8wPPK1B.g9W5hJisq3MsCpZW' @ 0 : 0; will stop at (end)

Binary file not shown.

View File

@ -0,0 +1,67 @@
{
"name": "Smite",
"type": "action",
"folder": "0nDRFmMBs5DBJU9M",
"_id": "jGOCDAjMQ3uDOhvn",
"img": "icons/weapons/hammers/hammer-double-glowing-yellow.webp",
"system": {
"description": "",
"notes": "",
"source": "",
"swid": "smite",
"additionalStats": {},
"favorite": false,
"category": "Power Action",
"templates": {
"cone": false,
"stream": false,
"small": false,
"medium": false,
"large": false
},
"actions": {
"trait": "",
"traitMod": "",
"dmgMod": "",
"additional": {
"E4Pbzvi0": {
"name": "Effect",
"type": "macro",
"dice": null,
"resourcesUsed": null,
"modifier": "",
"override": "",
"uuid": "Compendium.swade-mb-helpers.helper-macros.Macro.AjuA11hQ48UJNwlH",
"macroActor": "self",
"isHeavyWeapon": false
},
"eLBgU6O6": {
"name": "Spiritual Weapon",
"type": "macro",
"override": "",
"modifier": "",
"dice": null,
"resourcesUsed": null,
"uuid": "Compendium.swade-mb-helpers.helper-macros.Macro.JzzC728WBjbE7qUP",
"macroActor": "self"
}
}
}
},
"effects": [],
"sort": 0,
"ownership": {
"default": 0,
"sVoCvBU1knmXzoYe": 3
},
"flags": {},
"_stats": {
"systemId": "swade",
"systemVersion": "3.2.5",
"coreVersion": "11.315",
"createdTime": 1707874199713,
"modifiedTime": 1707874294558,
"lastModifiedBy": "sVoCvBU1knmXzoYe"
},
"_key": "!items!jGOCDAjMQ3uDOhvn"
}

View File

@ -1,5 +1,5 @@
2024/02/11-16:18:01.489576 7f2daffff700 Delete type=3 #1 2024/02/13-22:26:02.541354 7fece27fc700 Delete type=3 #1
2024/02/11-16:18:01.491957 7f2daeffd700 Level-0 table #5: started 2024/02/13-22:26:02.543479 7fece1ffb700 Level-0 table #5: started
2024/02/11-16:18:01.496159 7f2daeffd700 Level-0 table #5: 6787 bytes OK 2024/02/13-22:26:02.546505 7fece1ffb700 Level-0 table #5: 6787 bytes OK
2024/02/11-16:18:01.500429 7f2daeffd700 Delete type=0 #3 2024/02/13-22:26:02.549208 7fece1ffb700 Delete type=0 #3
2024/02/11-16:18:01.500570 7f2daeffd700 Manual compaction at level-0 from '!items!JWyBQe4tnOYljFAF' @ 72057594037927935 : 1 .. '!items!tWWSfEMmLmws6Yb1' @ 0 : 0; will stop at (end) 2024/02/13-22:26:02.549329 7fece1ffb700 Manual compaction at level-0 from '!items!JWyBQe4tnOYljFAF' @ 72057594037927935 : 1 .. '!items!tWWSfEMmLmws6Yb1' @ 0 : 0; will stop at (end)

View File

@ -1,5 +1,5 @@
2024/02/11-16:18:02.043785 7f58057be700 Delete type=3 #1 2024/02/13-22:26:03.160929 7fc96e7bf700 Delete type=3 #1
2024/02/11-16:18:02.046489 7f5803d42700 Level-0 table #5: started 2024/02/13-22:26:03.163338 7fc6cffff700 Level-0 table #5: started
2024/02/11-16:18:02.049544 7f5803d42700 Level-0 table #5: 1751 bytes OK 2024/02/13-22:26:03.166145 7fc6cffff700 Level-0 table #5: 1751 bytes OK
2024/02/11-16:18:02.052736 7f5803d42700 Delete type=0 #3 2024/02/13-22:26:03.169061 7fc6cffff700 Delete type=0 #3
2024/02/11-16:18:02.052843 7f5803d42700 Manual compaction at level-0 from '!actors!U5v4gFHquo0Y1SAq' @ 72057594037927935 : 1 .. '!actors!U5v4gFHquo0Y1SAq' @ 0 : 0; will stop at (end) 2024/02/13-22:26:03.169185 7fc6cffff700 Manual compaction at level-0 from '!actors!U5v4gFHquo0Y1SAq' @ 72057594037927935 : 1 .. '!actors!U5v4gFHquo0Y1SAq' @ 0 : 0; will stop at (end)

Binary file not shown.

View File

@ -1,5 +1,5 @@
2024/02/11-16:18:02.642184 7fcfc77fe700 Delete type=3 #1 2024/02/13-22:26:03.793278 7f9d24fbc700 Delete type=3 #1
2024/02/11-16:18:02.644770 7fcfc5d82700 Level-0 table #5: started 2024/02/13-22:26:03.795568 7f9a87fff700 Level-0 table #5: started
2024/02/11-16:18:02.650970 7fcfc5d82700 Level-0 table #5: 21634 bytes OK 2024/02/13-22:26:03.798917 7f9a87fff700 Level-0 table #5: 21261 bytes OK
2024/02/11-16:18:02.657857 7fcfc5d82700 Delete type=0 #3 2024/02/13-22:26:03.801661 7f9a87fff700 Delete type=0 #3
2024/02/11-16:18:02.658018 7fcfc5d82700 Manual compaction at level-0 from '!folders!A3iVDJD2cTuTLpBu' @ 72057594037927935 : 1 .. '!macros!wU2mAUnw3RW9qMT8' @ 0 : 0; will stop at (end) 2024/02/13-22:26:03.801767 7f9a87fff700 Manual compaction at level-0 from '!folders!A3iVDJD2cTuTLpBu' @ 72057594037927935 : 1 .. '!macros!wU2mAUnw3RW9qMT8' @ 0 : 0; will stop at (end)

Binary file not shown.

View File

@ -0,0 +1,25 @@
{
"folder": "hIbrWxg1nDutCSwt",
"name": "Smite - Spiritual Weapon",
"type": "script",
"_id": "JzzC728WBjbE7qUP",
"author": "sVoCvBU1knmXzoYe",
"img": "icons/weapons/hammers/hammer-double-glowing-yellow.webp",
"scope": "global",
"command": "game.modules.get('swade-mb-helpers').api.powerEffects({\n token,\n targets: game.user.targets,\n name: 'spiritual-weapon'\n})",
"sort": 0,
"ownership": {
"default": 0,
"sVoCvBU1knmXzoYe": 3
},
"flags": {},
"_stats": {
"systemId": "swade",
"systemVersion": "3.2.5",
"coreVersion": "11.315",
"createdTime": 1707874116560,
"modifiedTime": 1707875900366,
"lastModifiedBy": "sVoCvBU1knmXzoYe"
},
"_key": "!macros!JzzC728WBjbE7qUP"
}

Binary file not shown.

View File

@ -1,5 +1,5 @@
2024/02/11-16:18:03.450233 7f2b77fff700 Delete type=3 #1 2024/02/13-22:26:04.506008 7fa4f87bc700 Delete type=3 #1
2024/02/11-16:18:03.453241 7f2b767fc700 Level-0 table #5: started 2024/02/13-22:26:04.508224 7fa4f7d40700 Level-0 table #5: started
2024/02/11-16:18:03.478614 7f2b767fc700 Level-0 table #5: 17541 bytes OK 2024/02/13-22:26:04.511458 7fa4f7d40700 Level-0 table #5: 17816 bytes OK
2024/02/11-16:18:03.487798 7f2b767fc700 Delete type=0 #3 2024/02/13-22:26:04.514232 7fa4f7d40700 Delete type=0 #3
2024/02/11-16:18:03.487939 7f2b767fc700 Manual compaction at level-0 from '!journal!HbtPlHNFO1L6RVj0' @ 72057594037927935 : 1 .. '!journal.pages!w4TImRTAiNiqDWeL.vQhO6BVdKZOubTUQ' @ 0 : 0; will stop at (end) 2024/02/13-22:26:04.514334 7fa4f7d40700 Manual compaction at level-0 from '!journal!HbtPlHNFO1L6RVj0' @ 72057594037927935 : 1 .. '!journal.pages!w4TImRTAiNiqDWeL.vQhO6BVdKZOubTUQ' @ 0 : 0; will stop at (end)

Binary file not shown.

File diff suppressed because one or more lines are too long

View File

@ -1378,6 +1378,110 @@ class SummonAllyEffect extends SummonEffect {
} }
} }
class SpiritualWeaponEffect extends SummonEffect {
get name () {
return 'Spiritual Weapon'
}
async prepMenu () {
await super.prepMenu()
this.menuData.buttons = [
this.menuData.buttons[0],
{ label: 'Apply with Raise', value: 'raise' },
this.menuData.buttons[1]
]
this.menuData.inputs.pop()
this.menuData.inputs.pop()
this.menuData.inputs[this.menuData.inputs.length - 1].label = 'Weapon to summon'
const arcaneSkills = this.token.actor.items
.filter(i => i.type === 'skill').filter(s => (
s.system.swid === 'faith' ||
s.system.swid === 'spellcasting' ||
s.system.swid === 'performance')).map(s => {
return {
value: s.system.swid,
html: s.name
}
})
this.menuData.inputs.push(
{ type: 'select', label: 'Arcane Skill', options: arcaneSkills }
)
}
async prepResult () {
this.raise = (this.buttons === 'raise')
this.actorId = this.inputs[this.inputIndex]
this.arcaneSkillSwid = this.inputs[this.inputIndex + 1]
this.actor = shim.actors.get(this.actorId)
this.icon = 'icons/weapons/hammers/hammer-double-glowing-yellow.webp'
this.protoDoc = await this.actor.getTokenDocument()
this.spawnOptions = {
controllingActor: this.token.actor,
duplicates: 1,
updateOpts: {
embedded: {
Item: { renderSheet: null }
}
},
crosshairs: {
icon: this.icon,
label: `Summon ${this.actor.name}`,
drawOutline: true,
rememberControlled: true
}
}
this.spawnMutation = {
actor: {
name: `${this.token.name}'s ${this.actor.name}`,
system: {
wildcard: this.token.actor.system.wildcard,
attributes: {
spirit: {
die: {
sides: this.token.actor.system.attributes.spirit.die.sides,
modifier: this.token.actor.system.attributes.spirit.die.modifier
},
'wild-die': {
sides: this.token.actor.system.attributes.spirit['wild-die'].sides
}
}
}
}
},
token: {
actorLink: false,
name: `${this.token.name}'s ${this.protoDoc.name}`,
disposition: this.token.document.disposition,
sight: { enabled: false }
},
embedded: { ActiveEffect: {}, Item: {} }
}
const weaponItemId = this.actor.items.find(i =>
i.type === 'weapon' && i.system.swid === 'spiritual-weapon').id
const weaponDoc = this.actor.getEmbeddedDocument('Item', weaponItemId).clone()
const arcaneSkill = this.token.actor.items.find(i => i.type === 'skill' && i.system.swid === this.arcaneSkillSwid)
const arcaneDoc = this.token.actor.getEmbeddedDocument('Item', arcaneSkill.id).clone()
this.spawnMutation.embedded.Item[weaponDoc.name] = {
system: {
damage: '@spi+d4',
actions: {
trait: arcaneDoc.name
}
}
}
// weaponDoc.system.actions.trait = arcaneDoc.name
if (this.raise) {
this.spawnMutation.embedded.Item[weaponDoc.name].system.damage = '@spi+d6'
// weaponDoc.system.damage = '@spi+d6'
}
this.spawnMutation.embedded.Item[arcaneDoc.name] = arcaneDoc
// this.spawnMutation.embedded.Item[weaponDoc.name] = weaponDoc
for (const effectDocument of this.effectDocs) {
this.spawnMutation.embedded.ActiveEffect[effectDocument.name] = effectDocument
}
}
}
class SummonAnimalEffect extends SummonEffect { class SummonAnimalEffect extends SummonEffect {
get name () { get name () {
return 'Summon Animal' return 'Summon Animal'
@ -1597,6 +1701,7 @@ const PowerClasses = {
slothspeed: SlothSpeedEffect, slothspeed: SlothSpeedEffect,
smite: SmiteEffect, smite: SmiteEffect,
speed: SlothSpeedEffect, speed: SlothSpeedEffect,
'spiritual-weapon': SpiritualWeaponEffect,
'summon ally': SummonAllyEffect, 'summon ally': SummonAllyEffect,
'summon-ally': SummonAllyEffect, 'summon-ally': SummonAllyEffect,
'summon animal': SummonAnimalEffect, 'summon animal': SummonAnimalEffect,

View File

@ -73,12 +73,12 @@ export async function preDamageRollModifiers (actor, item, roll, modifiers, opti
const target = targets[0] const target = targets[0]
_addArcaneModifiers(target, modifiers) _addArcaneModifiers(target, modifiers)
const weaknesses = target.actor.items.filter( const weaknesses = target.actor.items.filter(
i => i.type === 'ability' && i.system.swid.toLowerCase().includes('weakness')) i => i.type === 'ability' && i.system.swid.toLowerCase().includes('environmental-weakness'))
if (weaknesses.length > 0) { if (weaknesses.length > 0) {
modifiers.push(...weaknesses.map(i => { return { label: i.name, value: '+4', ignore: true } })) modifiers.push(...weaknesses.map(i => { return { label: i.name, value: '+4', ignore: true } }))
} }
const resistances = target.actor.items.filter( const resistances = target.actor.items.filter(
i => i.type === 'ability' && i.system.swid.toLowerCase().includes('resistance')) i => i.type === 'ability' && i.system.swid.toLowerCase().includes('environmental-resistance'))
if (resistances.length > 0) { if (resistances.length > 0) {
modifiers.push(...resistances.map(i => { return { label: i.name, value: '-4', ignore: true } })) modifiers.push(...resistances.map(i => { return { label: i.name, value: '-4', ignore: true } }))
} }