FoundryVTT Automated Polymorpher
A user interface to manage the polymorph feature of Dnd5e with summoning animations.
Note: This is module is inspired from the wonderful work done by theRipper93 with its automated-evocations module. If you want to support more modules of this kind, I invite you to go and support his patreon
Should work with all system supported from the warpgate module "mutate" function, but for now the module is only used and tested with the Dnd5e system and the polymorph mechanism.
NOTE this module work very well with this other module Automated Evocations (Variant Fork)
Known issue/Limitation (Details on the github project)
How contribute to your own multisystem
I don't have time for check every system attributes and skill need help from the community for accomplish this, every system file has a method called `
async prepareDataFromTransformOptions(
originalActorData: ActorData,
targetActorData: ActorData,
sourceEffects: any[],
targetActorImages: string[],
transformOptions: TransformOptionsGeneric,
):Promise<any>
where usually as common values i use these:
const targetActorImages = await targetActor.getTokenImages();
const sourceEffects = sourceToken.actor ? sourceToken.actor.effects : sourceToken.data.effects;
const transformOptions = {
keepPhysical = false;
keepMental = false;
keepSaves = false;
keepSkills = false;
mergeSaves = false;
mergeSkills = false;
keepClass = false;
keepFeats = false;
keepSpells = false;
keepItems = false;
keepBio = false;
keepVision = false;
keepSelf = false;
removeAE = false;
keepAEOnlyOriginNotEquipment = false;
transformTokens = true;
explicitName = '';
}
These settings should customized
Installation
It's always easiest to install modules from the in game add-on browser.
To install this module manually:
- Inside the Foundry "Configuration and Setup" screen, click "Add-on Modules"
- Click "Install Module"
- In the "Manifest URL" field, paste the following url:
https://raw.githubusercontent.com/p4535992/foundryvtt-automated-polymorpher/master/src/module.json
- Click 'Install' and wait for installation to complete
- Don't forget to enable the module in game using the "Manage Module" button
sequencer
This module uses the sequencer library. It is a hard dependency.
warpgate
This module uses the warpgate library. It is a mandatory dependency and it is recommended for the best experience and compatibility with other modules.
socketlib
This module uses the socketlib library for wrapping core methods. It is a hard dependency and it is recommended for the best experience and compatibility with other modules.
advanced-macros (optional)
This module uses the advanced-macros library. It is a optional dependency and it is recommended for the best experience and compatibility with other modules.
NOTE: you need this only for the custom macro feature, i don't suggest it is much easier to create the actors and set them up, with the drag and drop but it's up to you
Features
Token configuration panel
Open any character sheet, in the header of the window you will see the polymorphers button
Upon opening you will be welcomed by a window, from here you can drag and drop actor into it to add them.
After adding actor to the window you will have some options:
- To mutate click on the actor image
- The dropdown will let you chose the summoning animation
Then you interact with the standard panel of the Polymorph (if the system is dnd5e)
Token HUD fast click
An interface in the hud layer now allows you to speed up the transformations during a fight in a very intuitive way to manage the transformations there are three modes, at the level of the individual actor:
- Random: the next transformation is randomly taken from the list of transformations associated with the actor
- Ordered: the next transformation is taken according to the order of the list of transformations associated with the actor
- No random, No orderder: the standard method shows the configuration panel that you would have by clicking on the header sheet button
the actions on the hud button are of two types left click and right click.
- Left click activates the transformation event
- Right click reverts the transformation and returns to the original shape.
NOTE: you can't have both ordered and random
API
async game.modules.get('automated-polymorpher').api.invokePolymorpherManager(sourceTokenIdOrName: string, removePolymorpher = false, ordered = false, random = false, animationExternal:{ sequence:Sequence, timeToWait:number }|undefined = undefined) ⇒ Promise.<void>
Invoke the polymorpher manager feature from macro
Returns: Promise.<void>
- A empty promise
Param | Type | Description | Default |
---|---|---|---|
sourceTokenIdOrName | string |
The id or the name of the token (not the actor) | undefined |
removePolymorpher | boolean |
This action should revert the polymorpher if the current token is polymorphed | false |
ordered | boolean |
The 'ordered' feature is enabled for this polymorphing | false |
random | boolean |
The 'random' feature is enabled for this polymorphing | 0 |
explicitName | string |
The explicit name to assign to the target actor |
|
animationExternal | { sequence:Sequence, timeToWait:number } |
Advanced: Use your personal sequence animation and the time needed to wait before the polymorph action, checkout the Sequencer module for more information | undefined |
NOTE: If both 'random' and 'ordered' are false the standard dialog will be rendered.
Examples:
game.modules.get('automated-polymorpher').api.invokePolymorpherManager('Zruggig Widebrain')
game.modules.get('automated-polymorpher').api.invokePolymorpherManager('Zruggig Widebrain', true)
game.modules.get('automated-polymorpher').api.invokePolymorpherManager('Zruggig Widebrain', false, false)
game.modules.get('automated-polymorpher').api.invokePolymorpherManager('Zruggig Widebrain', false, false, false)
let sequence = new Sequence()
.effect()
.file("modules/animated-spell-effects-cartoon/spell-effects/cartoon/electricity/electrivity_blast_CIRCLE.webm")
.atLocation(tokenD)
.scale(0.35)
.wait(1000)
.effect()
.file("modules/animated-spell-effects-cartoon/spell-effects/cartoon/electricity/lightning_bolt_RECTANGLE_05.webm")
.atLocation(tokenD)
.reachTowards({
x: tokenD.center.x + canvas.grid.size*5,
y: tokenD.center.y
})
.wait(100)
.animation()
.on(tokenD)
.teleportTo({
x: tokenD.x + canvas.grid.size*5,
y: tokenD.y
})
.waitUntilFinished()
.effect()
.file("modules/animated-spell-effects-cartoon/spell-effects/cartoon/electricity/electric_ball_CIRCLE_06.webm")
.atLocation(tokenD)
.scale(0.5)
game.modules.get('automated-polymorpher').api.invokePolymorpherManager('Zruggig Widebrain', false, false, false, { sequence: sequence, timeToWait 1100})
async game.modules.get('automated-polymorpher').api.invokePolymorpherManagerFromActor(sourceActorIdOrName: string, removePolymorpher = false, ordered = false, random = false, animationExternal:{ sequence:Sequence, timeToWait:number }|undefined = undefined) ⇒ Promise.<void>
Invoke the polymorpher manager feature from macro
Returns: Promise.<void>
- A empty promise
Param | Type | Description | Default |
---|---|---|---|
sourceActorIdOrName | string |
The id or the name of the actor (not the token) | undefined |
removePolymorpher | boolean |
This action should revert the polymorpher if the current token is polymorphed | false |
ordered | boolean |
The 'ordered' feature is enabled for this polymorphing | false |
random | boolean |
The 'random' feature is enabled for this polymorphing | 0 |
explicitName | string |
The explicit name to assign to the target actor |
|
animationExternal | { sequence:Sequence, timeToWait:number } |
Advanced: Use your personal sequence animation and the time needed to wait before the polymorph action, checkout the Sequencer module for more information | undefined |
NOTE: If both 'random' and 'ordered' are false the standard dialog will be rendered.
Examples:
game.modules.get('automated-polymorpher').api.invokePolymorpherManagerFromActor('Zruggig Widebrain')
game.modules.get('automated-polymorpher').api.invokePolymorpherManagerFromActor('Zruggig Widebrain', true)
game.modules.get('automated-polymorpher').api.invokePolymorpherManagerFromActor('Zruggig Widebrain', false, false)
game.modules.get('automated-polymorpher').api.invokePolymorpherManagerFromActor('Zruggig Widebrain', false, false, false)
let sequence = new Sequence()
.effect()
.file("modules/animated-spell-effects-cartoon/spell-effects/cartoon/electricity/electrivity_blast_CIRCLE.webm")
.atLocation(tokenD)
.scale(0.35)
.wait(1000)
.effect()
.file("modules/animated-spell-effects-cartoon/spell-effects/cartoon/electricity/lightning_bolt_RECTANGLE_05.webm")
.atLocation(tokenD)
.reachTowards({
x: tokenD.center.x + canvas.grid.size*5,
y: tokenD.center.y
})
.wait(100)
.animation()
.on(tokenD)
.teleportTo({
x: tokenD.x + canvas.grid.size*5,
y: tokenD.y
})
.waitUntilFinished()
.effect()
.file("modules/animated-spell-effects-cartoon/spell-effects/cartoon/electricity/electric_ball_CIRCLE_06.webm")
.atLocation(tokenD)
.scale(0.5)
game.modules.get('automated-polymorpher').api.invokePolymorpherManagerFromActor('Zruggig Widebrain', false, false, false, { sequence: sequence, timeToWait 1100})
Macro to clean up flags on token and actor
async game.modules.get('automated-polymorpher').api.cleanUpTokenSelected() ⇒ Promise.<void>
Examples:
game.modules.get('automated-polymorpher').api.cleanUpTokenSelected()
Integration with socketLib
let sequence = new Sequence()
.effect()
.file("modules/animated-spell-effects-cartoon/spell-effects/cartoon/electricity/electrivity_blast_CIRCLE.webm")
.atLocation(tokenD)
.scale(0.35)
.wait(1000)
.effect()
.file("modules/animated-spell-effects-cartoon/spell-effects/cartoon/electricity/lightning_bolt_RECTANGLE_05.webm")
.atLocation(tokenD)
.reachTowards({
x: tokenD.center.x + canvas.grid.size*5,
y: tokenD.center.y
})
.wait(100)
.animation()
.on(tokenD)
.teleportTo({
x: tokenD.x + canvas.grid.size*5,
y: tokenD.y
})
.waitUntilFinished()
.effect()
.file("modules/animated-spell-effects-cartoon/spell-effects/cartoon/electricity/electric_ball_CIRCLE_06.webm")
.atLocation(tokenD)
.scale(0.5)
game.modules.get('automated-polymorpher').socket.executeAsGM('invokePolymorpherManager',['Zruggig Widebrain', false, false, false, { sequence: sequence, timeToWait 1100}]);