Register

FoundryVTT Automated Polymorpher

An Add-on Module for Foundry Virtual Tabletop

Author: 4535992 Project Source: Project URL Versions 10 - 10 (Verified 10) Last Updated 1 year, 10 months ago

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.

gif hud

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:

  1. Inside the Foundry "Configuration and Setup" screen, click "Add-on Modules"
  2. Click "Install Module"
  3. In the "Manifest URL" field, paste the following url: https://raw.githubusercontent.com/p4535992/foundryvtt-automated-polymorpher/master/src/module.json
  4. Click 'Install' and wait for installation to complete
  5. 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

gif

Open any character sheet, in the header of the window you will see the polymorphers button

image

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:

image

Then you interact with the standard panel of the Polymorph (if the system is dnd5e)

image

 

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:

the actions on the hud button are of two types left click and right click.

hud

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

ReturnsPromise.<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

ReturnsPromise.<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}]);

Categories

Available Versions

  1. Version 1.1.12

    1 year, 10 months ago
    Foundry Version 10 - 10 (Verified 10) Manifest URL Read Notes
  2. Version 1.1.7

    Foundry Version 10 - 10 (Verified 10) Manifest URL Read Notes
  3. Version 1.1.6

    Foundry Version 10 - 10 (Verified 10) Manifest URL Read Notes
  4. Version 1.1.4

    Foundry Version 10 - 10 (Verified 10) Manifest URL Read Notes
  5. Version 1.1.3

    Foundry Version 10 - 10 (Verified 10) Manifest URL Read Notes
  6. Version 1.1.1

    Foundry Version 10 - 10 (Verified 10) Manifest URL Read Notes
  7. Version 1.0.43

    Foundry Version 9 - 10 (Verified 9) Manifest URL Read Notes
  8. Version 1.0.42

    Foundry Version 9 - 10 (Verified 9) Manifest URL Read Notes
  9. Version 1.0.39

    Foundry Version 9 - 10 (Verified 9) Manifest URL Read Notes
  10. Version 1.0.37

    Foundry Version 9 - 10 (Verified 9) Manifest URL Read Notes
  11. Version 1.0.35

    Foundry Version 9 - 10 (Verified 9) Manifest URL Read Notes
  12. Version 1.0.33

    Foundry Version 9 - 10 (Verified 9) Manifest URL Read Notes
  13. Version 1.0.24

    Foundry Version 9 - 10 (Verified 9) Manifest URL Read Notes
  14. Version 1.0.21

    Foundry Version 9 - 10 (Verified 9) Manifest URL Read Notes
  15. Version 1.0.20

    Foundry Version 9 - 10 (Verified 9) Manifest URL Read Notes
  16. Version 1.0.16

    Foundry Version 9 - 10 (Verified 9) Manifest URL Read Notes
  17. Version 1.0.14

    Foundry Version 9 - 10 (Verified 9) Manifest URL Read Notes
  18. Version 1.0.3

    Foundry Version 9 - 10 (Verified 9) Manifest URL Read Notes