shape-change #33
@ -638,11 +638,18 @@ class ShapeChangeEffect extends TargetedPowerEffect {
|
|||||||
this.increasedDuration = (!!this.inputs[this.inputIndex + 1])
|
this.increasedDuration = (!!this.inputs[this.inputIndex + 1])
|
||||||
this.actor = shim.actors.get(this.actorId)
|
this.actor = shim.actors.get(this.actorId)
|
||||||
this.icon = this.targets[0].document.texture.src
|
this.icon = this.targets[0].document.texture.src
|
||||||
const targetActor = shim.actors.get(this.targets[0].actor.id)
|
const targetActor = this.targets[0].actor
|
||||||
this.protoDoc = await this.actor.getTokenDocument()
|
this.protoDoc = await this.actor.getTokenDocument()
|
||||||
this.spawnOptions = {
|
this.spawnOptions = {
|
||||||
controllingActor: this.targets[0].actor,
|
controllingActor: this.targets[0].actor,
|
||||||
duplicates: 1,
|
duplicates: 1,
|
||||||
|
updateOpts: {
|
||||||
|
embedded: {
|
||||||
|
Item: {
|
||||||
|
renderSheet: null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
crosshairs: {
|
crosshairs: {
|
||||||
rememberControlled: true
|
rememberControlled: true
|
||||||
}
|
}
|
||||||
@ -678,7 +685,9 @@ class ShapeChangeEffect extends TargetedPowerEffect {
|
|||||||
},
|
},
|
||||||
token: {
|
token: {
|
||||||
actorLink: false,
|
actorLink: false,
|
||||||
name: `${this.targets[0].name} (${this.protoDoc.name} form) `
|
name: `${this.targets[0].name} (${this.protoDoc.name} form) `,
|
||||||
|
elevation: this.targets[0].document.elevation,
|
||||||
|
disposition: this.targets[0].document.disposition
|
||||||
},
|
},
|
||||||
embedded: { ActiveEffect: {}, Item: {} }
|
embedded: { ActiveEffect: {}, Item: {} }
|
||||||
}
|
}
|
||||||
@ -704,13 +713,18 @@ class ShapeChangeEffect extends TargetedPowerEffect {
|
|||||||
log('protoDoc', this.protoDoc)
|
log('protoDoc', this.protoDoc)
|
||||||
log('spawnOptions', this.spawnOptions)
|
log('spawnOptions', this.spawnOptions)
|
||||||
log('spawnMutation', this.spawnMutation)
|
log('spawnMutation', this.spawnMutation)
|
||||||
await shim.warpgateSpawnAt(
|
const newTokenId = (await shim.warpgateSpawnAt(
|
||||||
this.targets[0].center,
|
this.targets[0].center,
|
||||||
this.protoDoc,
|
this.protoDoc,
|
||||||
this.spawnMutation,
|
this.spawnMutation,
|
||||||
{},
|
{},
|
||||||
this.spawnOptions
|
this.spawnOptions
|
||||||
)
|
))[0]
|
||||||
|
if (!this.targets[0].document.hidden) {
|
||||||
|
await this.targets[0].toggleVisibility()
|
||||||
|
}
|
||||||
|
await this.targets[0].document.setFlag('swade-mb-helpers', 'shapeChange.to', newTokenId)
|
||||||
|
await this.targets[0].document.update({ x: 0, y: 0 })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -866,6 +880,13 @@ class SummonEffect extends PowerEffect {
|
|||||||
this.spawnOptions = {
|
this.spawnOptions = {
|
||||||
controllingActor: this.token.actor,
|
controllingActor: this.token.actor,
|
||||||
duplicates: this.number,
|
duplicates: this.number,
|
||||||
|
updateOpts: {
|
||||||
|
embedded: {
|
||||||
|
Item: {
|
||||||
|
renderSheet: null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
crosshairs: {
|
crosshairs: {
|
||||||
icon: this.icon,
|
icon: this.icon,
|
||||||
label: `Summon ${this.actor.name}`,
|
label: `Summon ${this.actor.name}`,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user