Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 'Other Enhancements' in EffortDialog #219

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"NUMENERA.effort.title": "Effort",
"NUMENERA.effort.againstTaskLevel": "against task level",
"NUMENERA.effort.failAutomatically": "Automatic Failure",
"NUMENERA.effort.other": "Other Enhancements",
"NUMENERA.effort.other": "Assets",
"NUMENERA.effort.confirmUnspentTitle": "Confirm: Unspent Points",
"NUMENERA.effort.confirmUnspent": "You have unspent points are your pools are not full yet. Do you really want to exit? These points will be lost.",
"NUMENERA.effort.cost": "Cost",
Expand Down Expand Up @@ -111,7 +111,7 @@

"NUMENERA.pcActorSheet.tab.skills": "Skills",
"NUMENERA.pcActorSheet.tab.abilities": "Abilities",
"NUMENERA.pcActorSheet.tab.cyphers": "Cyphers",
"NUMENERA.pcActorSheet.tab.cyphers": "Numenera",
"NUMENERA.pcActorSheet.tab.strange": "Strange",
"NUMENERA.pcActorSheet.tab.recursion": "Recursions",
"NUMENERA.pcActorSheet.tab.equipment": "Equipment",
Expand Down
17 changes: 11 additions & 6 deletions module/actor/NumeneraPCActor.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,15 @@ export class NumeneraPCActor extends Actor {

rollData.ability = ability;
rollData.enhancements = enhancements;

const roll = rollData.getRoll();
roll.roll();

let flavor = game.i18n.localize("NUMENERA.rolling") + " " + skill.data.data.name;

const mods = []; //any roll modifier goes here: effort, skill level, etc.

switch (skill.data.data.skillLevel) {
switch (Number(skill.data.data.skillLevel)) {
case 2:
mods.push("specialized");
break;
Expand All @@ -166,7 +166,7 @@ export class NumeneraPCActor extends Actor {
roll.toMessage({
speaker: ChatMessage.getSpeaker(),
messageData: RollData.rollText(roll),
flavor,
flavor: flavor,
},
{
rollMode: rollData.rollMode,
Expand All @@ -184,7 +184,7 @@ export class NumeneraPCActor extends Actor {
* @memberof NumeneraPCActor
*/
async rollAttribute(attribute, rollData = null) {
if (rollData === null && useAlternateButtonBehavior()) {
if (rollData === null && useAlternateButtonBehavior()) {
const dialog = new EffortDialog(this, { stat: attribute });
await dialog.init();
return dialog.render(true);
Expand All @@ -199,7 +199,12 @@ export class NumeneraPCActor extends Actor {
//Need to modify the deep property since skill.name is a getter
skill.data.data.name = attribute.replace(/^\w/, (c) => c.toUpperCase()); //capitalized

return this.rollSkill(skill, rollData);
let assets = 0;
if (rollData) {
assets = rollData.assets;
}

return this.rollSkill(skill, rollData, null, assets);
}

/**
Expand Down Expand Up @@ -694,4 +699,4 @@ export class NumeneraPCActor extends Actor {

return updatedItems;
}
}
}
7 changes: 4 additions & 3 deletions module/apps/EffortDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ export class EffortDialog extends FormApplication {
this.close();
return;
}

const data = super.getData();

data.stats = NUMENERA.stats;
Expand Down Expand Up @@ -419,6 +419,7 @@ export class EffortDialog extends FormApplication {
rollData.taskLevel = this.finalLevel;
rollData.rollMode = this.object.rollMode;
rollData.damageTrackPenalty = this.object.actor.data.data.damageTrack;
rollData.assets = this.object.assets;

if (this.object.skill) {
let skill = this.object.skill;
Expand All @@ -427,7 +428,7 @@ export class EffortDialog extends FormApplication {
if (skill._id)
skill = this.object.actor.items.get(this.object.skill.id);

actor.rollSkill(skill, rollData, this.object.ability);
actor.rollSkill(skill, rollData, this.object.ability, this.object.assets);
}
else {
await actor.rollAttribute(shortStat, rollData);
Expand Down Expand Up @@ -555,4 +556,4 @@ export class EffortDialog extends FormApplication {
//Re-render the form since it's not provided for free in FormApplications
this.render();
}
}
}