This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Hooks.on("combatTurnChange", async (encounter) => { | |
if (encounter.combatant.isOwner) { | |
encounter.combatant.actor.itemTypes.weapon | |
.filter((item) => item.system.temporary && item.system.quantity === 0) | |
.forEach((item) => item.delete()); | |
} | |
}); | |
ui.notifications.info("Created Clear Temporary Items Hook"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (!actor || !item) { | |
return; | |
} | |
const versatileVial = await fromUuid( | |
"Compendium.pf2e.equipment-srd.Item.ljT5pe8D7rudJqus" | |
); | |
const createdItem = await actor.createEmbeddedDocuments("Item", [ | |
versatileVial, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const actor = canvas.tokens.controlled[0]?.actor; | |
const targetActor = game.user.targets.first()?.actor; | |
if (!actor || !targetActor || game.user.targets.size !== 1) { | |
return ui.notifications.warn("Please select one actor and one target"); | |
} | |
if (!actor.isOfType("character")) { | |
return ui.notifications.warn("Controlled actor must be a player-character"); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @param {ActorPF2e} actor | |
* @param {string} slug | |
* @returns {boolean} | |
*/ | |
function checkFeat(actor, slug) { | |
return actor.itemTypes.feat.some((feat) => feat.slug === slug); | |
} | |
/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let cumulativeDelta = 0; | |
Hooks.on("updateWorldTime", (worldTime, delta) => { | |
if (game.combat || !game.user.character) { | |
cumulativeDelta = 0; | |
return; | |
} | |
if (delta < 0) { | |
cumulativeDelta = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"customPackID": "04c6fc20-3deb-4e41-a278-a6bcb9ecad6c", | |
"customPackName": "Impossible Class Playtest v2.0", | |
"listCustomEquipment": [ | |
{ | |
"databaseID": 1, | |
"uniqueIdentiier": "227bc591-0b9f-4832-baa5-36885e450524", | |
"category": 8, | |
"name": "Aiuen, the Elf-gate Key", | |
"itemLevel": 17, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Get DamageRoll */ | |
const DamageRoll = CONFIG.Dice.rolls.find((R) => R.name === "DamageRoll"); | |
async function applyChanges(token, $html) { | |
const mod = parseInt($html.find('[name="modifier"]').val()) || 0; | |
const requestedProf = parseInt($html.find('[name="dc-type"]')[0].value) || 1; | |
const skill = token.actor.skills["crafting"]; | |
if (!skill?.proficient) { | |
ui.notifications.warn(`${token.actor.name} is not trained in Crafting.`); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[wasm_bindgen(js_name = drawQuad)] | |
pub fn draw_quad(&self, gl: WebGl2RenderingContext) { | |
let current_program: WebGlProgram = gl.get_parameter(WebGl2RenderingContext::CURRENT_PROGRAM).unwrap().into(); | |
let target_texture = gl.create_texture().unwrap(); | |
gl.bind_texture(WebGl2RenderingContext::TEXTURE_2D, Some(&target_texture)); | |
let _ = gl.tex_image_2d_with_i32_and_i32_and_i32_and_format_and_type_and_opt_u8_array( | |
WebGl2RenderingContext::TEXTURE_2D, | |
0, | |
WebGl2RenderingContext::RGBA as i32, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[derive(Clone, Copy, Debug)] | |
pub struct Point { | |
pub x: f64, | |
pub y: f64, | |
} | |
impl Point { | |
pub fn new(x: f64, y: f64) -> Self { | |
Self { x, y } | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"key": "ItemAlteration", | |
"itemType": "armor", | |
"mode": "override", | |
"predicate": [ | |
"item:equipped" | |
], | |
"property": "ac-bonus", | |
"value": 3 | |
} |