#Ikabodo's crafting conundrum
1 messages · Page 1 of 1 (latest)
Thanks freeze.
It's actually kinda strange that it doesn't count expertise there. Maybe it does it later when actually rolling.
there is a multiplier in prof which probably is used in a later moment
it is probably only reading the basevalue here
is @prof not the same as actor.data.data.attributes.prof?
not on the item
Since it's for display purposes only, you want the correct number immediately though.
so max(actor's prof, item's prof)
I'm just digging through the 5e code trying to figure out where they get the text in the dialog
rollToolCheck(options={}) {
if ( this.type !== "tool" ) throw new Error("Wrong item type!");
// Prepare roll data
const rollData = this.getRollData();
const abl = this.data.data.ability;
const parts = ["@mod"];
const title = `${this.name} - ${game.i18n.localize("DND5E.ToolCheck")}`;
// Add proficiency
if ( this.data.data.prof?.hasProficiency ) {
parts.push("@prof");
rollData.prof = this.data.data.prof.term;
}
// Add tool bonuses
if ( this.data.data.bonus ) {
parts.push("@toolBonus");
rollData.toolBonus = Roll.replaceFormulaData(this.data.data.bonus, rollData);
}
// Add ability-specific check bonus
if ( getProperty(rollData, `abilities.${abl}.bonuses.check`) ) {
const checkBonusKey = `${abl}CheckBonus`;
parts.push(`@${checkBonusKey}`);
const checkBonus = getProperty(rollData, `abilities.${abl}.bonuses.check`);
rollData[checkBonusKey] = Roll.replaceFormulaData(checkBonus, rollData);
}
// Add global actor bonus
const bonuses = getProperty(this.actor.data.data, "bonuses.abilities") || {};
if ( bonuses.check ) {
parts.push("@checkBonus");
rollData.checkBonus = Roll.replaceFormulaData(bonuses.check, rollData);
}
// Compose the roll data
const rollConfig = mergeObject({
parts: parts,
data: rollData,
title: title,
speaker: ChatMessage.getSpeaker({actor: this.actor}),
flavor: title,
dialogOptions: {
width: 400,
top: options.event ? options.event.clientY - 80 : null,
left: window.innerWidth - 710
},
chooseModifier: true,
halflingLucky: this.actor.getFlag("dnd5e", "halflingLucky" ) || false,
reliableTalent: (this.data.data.proficient >= 1) && this.actor.getFlag("dnd5e", "reliableTalent"),
messageData: {"flags.dnd5e.roll": {type: "tool", itemId: this.id }}
}, options);
rollConfig.event = options.event;
}
``` what it does
but then it does return d20Roll(rollConfig);, but it does not look like d20Roll is an exposed function we can use
this.data.data.prof.term is where it happens perhaps?
That is definitely a 12 on a 20th level character with tool expertise.
I'd just rip that code and the whole d20-roll.js if you want to be comprehensive
but yeah i think even just employing item.rollToolCheck() is a good move for you Ikabodo, perhaps you can roll it without a message and use it for the formula and out come
nevermind, dnd5e does expose game.dnd5e.dice.d20Roll
x = await item.rollToolCheck({ability: 'int', fastForward: true, chatMessage: false});
formula = x.formula;
excellent
And you'd just throw the chosen ability (abbreviated) into the rollToolCheck. Which was the initial question, wasn't it. 😅
I can confirm that Jack of All Trades does not work tho. It's also not in the code above.
need to set half prof on the item
Ah true, of course.
I think maybe you add half prof rounded down to the check here instead
I can't find a way to do through the character sheet though
It's in the item directly. Manually.
Oddly that is not automatic when you add a tool to a character when you have Jack.
I'd hate to be a dnd5e system developer. That system is a mess of abilities
The E in 5E is for 'edge cases'.