20Q added step18 status, honor and glory for modifier

This commit is contained in:
Vlyan
2021-01-04 22:24:31 +01:00
parent e05426e567
commit 4977b029ec
9 changed files with 87 additions and 58 deletions

View File

@@ -123,16 +123,7 @@ export class BaseSheetL5r5e extends ActorSheet {
e.type === "technique" && e.data.data.technique_type === item.data.data.technique_type
)
) {
new Dialog({
title: game.i18n.localize("l5r5e.techniques.title"),
content: game.i18n.localize("l5r5e.techniques.only_one"),
buttons: {
ok: {
label: game.i18n.localize("l5r5e.global.ok"),
icon: '<i class="fas fa-check"></i>',
},
},
}).render(true);
ui.notifications.info(game.i18n.localize("l5r5e.techniques.only_one"));
return;
}
@@ -143,16 +134,7 @@ export class BaseSheetL5r5e extends ActorSheet {
} else {
// Check if technique is allowed for this character
if (!game.user.isGM && !this.actor.data.data.techniques[item.data.data.technique_type]) {
new Dialog({
title: game.i18n.localize("l5r5e.techniques.title"),
content: game.i18n.localize("l5r5e.techniques.not_allowed"),
buttons: {
ok: {
label: game.i18n.localize("l5r5e.global.ok"),
icon: '<i class="fas fa-check"></i>',
},
},
}).render(true);
ui.notifications.info(game.i18n.localize("l5r5e.techniques.not_allowed"));
return;
}

View File

@@ -37,7 +37,7 @@ export class TwentyQuestionsDialog extends FormApplication {
classes: ["l5r5e", "twenty-questions-dialog"],
template: CONFIG.l5r5e.paths.templates + "actors/twenty-questions-dialog.html",
title: game.i18n.localize("l5r5e.twenty_questions.title"),
width: 600,
width: 700,
height: 800,
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "part0" }],
resizable: true,
@@ -237,7 +237,7 @@ export class TwentyQuestionsDialog extends FormApplication {
}
} else if (!this.object.data.step3.allowed_techniques?.[item.data.data.technique_type]) {
// Tech not allowed
console.warn("This technique is not allowed for your character", item.data.data.technique_type);
ui.notifications.info(game.i18n.localize("l5r5e.techniques.not_allowed"));
return;
}
break;

View File

@@ -149,6 +149,9 @@ export class TwentyQuestions {
heritage_1: null,
heritage_2: null,
heritage_item: [],
heritage_add_honor: 0,
heritage_add_glory: 0,
heritage_add_status: 0,
},
step19: {
firstname: "",
@@ -213,6 +216,18 @@ export class TwentyQuestions {
const actorDatas = actor.data.data;
const formData = this.data;
const status = parseInt(formData.step1.social_status) + parseInt(formData.step18.heritage_add_status);
const glory =
parseInt(formData.step2.social_glory) +
parseInt(formData.step7.social_add_glory) +
parseInt(formData.step18.heritage_add_glory);
const honor =
parseInt(formData.step3.social_honor) +
parseInt(formData.step8.social_add_honor) +
parseInt(formData.step18.heritage_add_honor);
// Update the actor
actorDatas.zeni = Math.floor(formData.step2.wealth * 50);
actorDatas.identity = {
@@ -225,9 +240,9 @@ export class TwentyQuestions {
actorDatas.social = {
...actorDatas.social,
status: formData.step1.social_status,
glory: formData.step2.social_glory,
honor: formData.step3.social_honor,
status: status,
glory: glory,
honor: honor,
giri: formData.step5.social_giri,
ninjo: formData.step6.social_ninjo,
};
@@ -298,6 +313,9 @@ export class TwentyQuestions {
summary: {
rings: [],
skills: [],
status: 0,
glory: 0,
honor: 0,
},
};
@@ -332,6 +350,18 @@ export class TwentyQuestions {
return a.localeCompare(b);
});
out.summary.status = parseInt(this.data.step1.social_status) + parseInt(this.data.step18.heritage_add_status);
out.summary.glory =
parseInt(this.data.step2.social_glory) +
parseInt(this.data.step7.social_add_glory) +
parseInt(this.data.step18.heritage_add_glory);
out.summary.honor =
parseInt(this.data.step3.social_honor) +
parseInt(this.data.step8.social_add_honor) +
parseInt(this.data.step18.heritage_add_honor);
return out;
}