Advertisement
Guest User

Effet visuel de vol sous Foundry (nécessite FXMaster)

a guest
Apr 14th, 2023
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // wrap code into async function
  2. let flightFunc = async function() {
  3.  
  4.    const tokens = canvas.tokens.controlled;
  5.  
  6.    for (const token of tokens){
  7.        if (token.TMFXhasFilterId("flight") || token.TMFXhasFilterId("UnderShadow")) {
  8.            await token.TMFXdeleteFilters("flight"); await token.TMFXdeleteFilters("UnderShadow");
  9.        } else {
  10.            let params =
  11. [{
  12.         filterType: "transform",
  13.         filterId: "flight",
  14.         padding: 10,
  15.         animated:
  16.         {
  17.             translationX:
  18.             {
  19.                 animType: "sinOscillation",
  20.                 val1: -0.025,
  21.                 val2: +0.025,
  22.                 loopDuration: 3500,
  23.             },
  24.             translationY:
  25.             {
  26.                 animType: "cosOscillation",
  27.                 val1: -0.025,
  28.                 val2: +0.025,
  29.                 loopDuration: 3500,
  30.             }
  31.         }
  32. },
  33. {
  34.     filterType: "shadow",
  35.     filterId: "UnderShadow",
  36.     rotation: 55,
  37.     blur: 1,
  38.     quality: 5,
  39.     distance: 20,
  40.     alpha: 0.5,
  41.     padding: 10,
  42.     shadowOnly: false,
  43.     color: 0x000000,
  44.     zOrder: 6000,
  45.  
  46. }];
  47.            await token.TMFXaddUpdateFilters(params);
  48.        }
  49.    }
  50. };
  51. // call wrapped function
  52. flightFunc();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement