Skip to content

Instantly share code, notes, and snippets.

@lslavkov
Created October 23, 2022 17:53
Show Gist options
  • Select an option

  • Save lslavkov/c094dfbabf222f9af0a360c83d06a8d2 to your computer and use it in GitHub Desktop.

Select an option

Save lslavkov/c094dfbabf222f9af0a360c83d06a8d2 to your computer and use it in GitHub Desktop.
FoundryVTT usefull macros
let dialogEditor = new Dialog({
title: `LightPicker`,
buttons: {
none: {
label: `None`,
callback: () => {
token.document.update({light:{ dim: 0, bright: 0, color: "#000000", alpha: 0, angle: 360, animation:{ type: "none", speed: 5, intensity: 5}}});
dialogEditor.render(true);
}
},
torch: {
label: `Torch`,
callback: () => {
token.document.update({light:{ dim: 40, bright : 20, color : "#ff830f", alpha: 0.5, angle: 360, animation:{ type: "torch", speed: 5, intensity: 5}}});
dialogEditor.render(true);
}
},
lamp: {
label: `Lamp`,
callback: () => {
token.document.update({light:{ dim: 45, bright : 15, color : "#ffa200", alpha: 0.5, angle: 360, animation:{ type: "torch", speed: 3, intensity: 3}}});
dialogEditor.render(true);
}
},
bullseye: {
label: `BullseyeLantern`,
callback: () => {
token.document.update({light:{ dim: 120, bright : 60, color : "#ffa200", alpha: 0.5, angle: 45, animation:{ type: "torch", speed: 3, intensity: 3}}});
dialogEditor.render(true);
}
},
hoodedOpen: {
label: `HoodedLantern(O)`,
callback: () => {
token.document.update({light:{ dim: 60, bright : 30, color : "#ffa200", alpha: 0.5, angle: 360, animation:{ type: "torch", speed: 3, intensity: 3}}});
dialogEditor.render(true);
}
},
hoodedClosed: {
label: `HoodedLantern(C)`,
callback: () => {
token.document.update({light:{ dim: 5, bright : 0, color : "#ffa200", alpha: 0.5, angle: 360, animation:{ type: "torch", speed: 3, intensity: 3}}});
dialogEditor.render(true);
}
},
lightcantrip: {
label: `LightCantrip`,
callback: () => {
token.document.update({light:{ dim: 40, bright : 20, color : "#fffab8", alpha: 0.5, angle: 360, animation:{ type: "torch", speed: 2, intensity: 1}}});
dialogEditor.render(true);
}
},
moontouched: {
label: `MoonTouched`,
callback: () => {
token.document.update({light:{ dim: 30, bright : 15, color : "#38c0f3", alpha: 0.5, angle: 360, animation:{ type: "torch", speed: 1, intensity: 1}}});
dialogEditor.render(true);
}
},
sunlight: {
label: `SunLight`,
callback: () => {
token.document.update({light:{ dim: 60, bright : 30, color : "#fff45c", alpha: 0.6, angle: 360, animation:{ type: "torch", speed: 1, intensity: 5}}});
dialogEditor.render(true);
}
},
close: {
icon: "<i class='fas fa-tick'></i>",
label: `Exit`
},
},
default: "close",
close: () => {}
});
dialogEditor.render(true)
let dialogEditor = new Dialog({
title: `AuraPicker`,
buttons: {
none: {
label: `None`,
callback: () => {
token.document.update({light:{ dim: 0, bright: 0, color: "#000000", alpha: 0, animation:{ type: "none", speed: 5, intensity: 5}}});
dialogEditor.render(true);
}
},
sphere10: {
label: `Sphere10`,
callback: () => {
token.document.update({light:{ dim: 10, bright : 5, color : "#e1c8ff", alpha: 0.5, angle: 360, animation:{ type: "emanation", speed: 5, intensity: 7}}});
dialogEditor.render(true);
}
},
sphere30: {
label: `Sphere30`,
callback: () => {
token.document.update({light:{ dim: 30, bright : 15, color : "#e1c8ff", alpha: 0.5, angle: 360, animation:{ type: "emanation", speed: 5, intensity: 7}}});
dialogEditor.render(true);
}
},
sphere60: {
label: `Sphere60`,
callback: () => {
token.document.update({light:{ dim: 60, bright : 30, color : "#e1c8ff", alpha: 0.5, angle: 360, animation:{ type: "emanation", speed: 5, intensity: 7}}});
dialogEditor.render(true);
}
},
sphere80: {
label: `Sphere80`,
callback: () => {
token.document.update({light:{ dim: 80, bright : 40, color : "#e1c8ff", alpha: 0.5, angle: 360, animation:{ type: "emanation", speed: 5, intensity: 7}}});
dialogEditor.render(true);
}
},
sphere100: {
label: `Sphere100`,
callback: () => {
token.document.update({light:{ dim: 100, bright : 50, color : "#e1c8ff", alpha: 0.5, angle: 360, animation:{ type: "emanation", speed: 5, intensity: 7}}});
dialogEditor.render(true);
}
},
cone10: {
label: `Cone10`,
callback: () => {
token.document.update({light:{ dim: 10, bright : 5, color : "#e1c8ff", alpha: 0.5, angle: 45, animation:{ type: "emanation", speed: 5, intensity: 7}}});
dialogEditor.render(true);
}
},
cone30: {
label: `Cone30`,
callback: () => {
token.document.update({light:{ dim: 30, bright : 15, color : "#e1c8ff", alpha: 0.5, angle: 45, animation:{ type: "emanation", speed: 5, intensity: 7}}});
dialogEditor.render(true);
}
},
cone60: {
label: `Cone60`,
callback: () => {
token.document.update({light:{ dim: 60, bright : 30, color : "#e1c8ff", alpha: 0.5, angle: 45, animation:{ type: "emanation", speed: 5, intensity: 7}}});
dialogEditor.render(true);
}
},
cone80: {
label: `Cone80`,
callback: () => {
token.document.update({light:{ dim: 80, bright : 40, color : "#e1c8ff", alpha: 0.5, angle: 45, animation:{ type: "emanation", speed: 5, intensity: 7}}});
dialogEditor.render(true);
}
},
cone100: {
label: `Cone100`,
callback: () => {
token.document.update({light:{ dim: 100, bright : 50, color : "#e1c8ff", alpha: 0.5, angle: 45, animation:{ type: "emanation", speed: 5, intensity: 7}}});
dialogEditor.render(true);
}
},
close: {
icon: "<i class='fas fa-tick'></i>",
label: `Exit`
},
},
default: "close",
close: () => {}
});
dialogEditor.render(true)
let dialogEditor = new Dialog({
title: `SizePicker`,
buttons: {
tiny: {
label: `Tiny`,
callback: () => {
token.document.update({"width": 1});
token.document.update({"height": 1});
token.document.update({"scale": 0.65});
dialogEditor.render(true);
}
},
small: {
label: `Small`,
callback: () => {
token.document.update({"width": 1});
token.document.update({"height": 1});
token.document.update({"scale": 0.75});
dialogEditor.render(true);
}
},
medium: {
label: `Medium`,
callback: () => {
token.document.update({"width": 1});
token.document.update({"height": 1});
token.document.update({"scale": 1});
dialogEditor.render(true);
}
},
large: {
label: `Large`,
callback: () => {
token.document.update({"width": 2});
token.document.update({"height": 2});
token.document.update({"scale": 1});
dialogEditor.render(true);
}
},
huge: {
label: `Huge`,
callback: () => {
token.document.update({"width": 3});
token.document.update({"height": 3});
token.document.update({"scale": 1});
dialogEditor.render(true);
}
},
gargantuan: {
label: `Gargantuan`,
callback: () => {
token.document.update({"width": 4});
token.document.update({"height": 4});
token.document.update({"scale": 1});
dialogEditor.render(true);
}
},
colossal: {
label: `Colossal`,
callback: () => {
token.document.update({"width": 5});
token.document.update({"height": 5});
token.document.update({"scale": 1});
dialogEditor.render(true);
}
},
close: {
icon: "<i class='fas fa-tick'></i>",
label: `Exit`
},
},
default: "close",
close: () => {}
});
dialogEditor.render(true)
let dialogEditor = new Dialog({
title: `VisionPicker`,
buttons: {
none: {
label: `Normal`,
callback: () => {
token.document.update({"dimSight": 0, "brightSight": 0, "vision":true,});
dialogEditor.render(true);
}
},
darkvision30: {
label: `DV 30`,
callback: () => {
token.document.update({"dimSight": 30, "brightSight": 0, "vision":true,});
dialogEditor.render(true);
}
},
darkvision60: {
label: `DV 60`,
callback: () => {
token.document.update({"dimSight": 60, "brightSight": 0, "vision":true,});
dialogEditor.render(true);
}
},
darkvision80: {
label: `DV 80`,
callback: () => {
token.document.update({"dimSight": 80, "brightSight": 0, "vision":true,});
dialogEditor.render(true);
}
},
darkvision120: {
label: `DV 120`,
callback: () => {
token.document.update({"dimSight": 120, "brightSight": 0, "vision":true,});
dialogEditor.render(true);
}
},
darkvision150: {
label: `DV 150`,
callback: () => {
token.document.update({"dimSight": 150, "brightSight": 0, "vision":true,});
dialogEditor.render(true);
}
},
darkvision180: {
label: `DV 180`,
callback: () => {
token.document.update({"dimSight": 180, "brightSight": 0, "vision":true,});
dialogEditor.render(true);
}
},
blind: {
label: `Blinded`,
callback: () => {
token.document.update({"dimSight": 0, "brightSight": 0, "vision":false,});
dialogEditor.render(true);
}
},
devilsight: {
label: `Devils Sight`,
callback: () => {
token.document.update({"dimSight": 0, "brightSight": 120, "vision":true,});
dialogEditor.render(true);
}
},
close: {
icon: "<i class='fas fa-tick'></i>",
label: `Exit`
},
},
default: "close",
close: () => {}
});
dialogEditor.render(true)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment