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

@@ -319,13 +319,13 @@
"q1": "1. What clan does your character belong to ? (p. 41)", "q1": "1. What clan does your character belong to ? (p. 41)",
"status": "Status", "status": "Status",
"q2": "2. What family does your character belong to ? (p. 49)", "q2": "2. What family does your character belong to ? (p. 49)",
"money": "Starting wealth in Koku :", "money": "Starting wealth in Koku",
"glory": "Glory :" "glory": "Glory"
}, },
"part2": { "part2": {
"title": "Part II: Role and School", "title": "Part II: Role and School",
"q3": "3. What is your characters school, and what roles does that school fall into ? (p. 56)", "q3": "3. What is your characters school, and what roles does that school fall into ? (p. 56)",
"school": "School :", "school": "School",
"role": "Roles", "role": "Roles",
"honor": "Honor", "honor": "Honor",
"access": "Technique types available", "access": "Technique types available",
@@ -372,8 +372,9 @@
"q17": "17. How would your characters parents describe them ? (p. 95)", "q17": "17. How would your characters parents describe them ? (p. 95)",
"q18": "18. Who was your character named to honor ? (p. 95)", "q18": "18. Who was your character named to honor ? (p. 95)",
"d10r1": "D10 Result (1/2)", "d10r1": "D10 Result (1/2)",
"d10r1_choice": "1st D10 Effect",
"d10r2": "D10 Result (2/2)", "d10r2": "D10 Result (2/2)",
"d10r2_choice": "2nd D10 Effect:", "d10r2_choice": "2nd D10 Effect",
"q19": "19. What is your characters personal name ? (p. 95)" "q19": "19. What is your characters personal name ? (p. 95)"
}, },
"part7": { "part7": {

View File

@@ -319,13 +319,13 @@
"q1": "1. What clan does your character belong to ? (p. 41)", "q1": "1. What clan does your character belong to ? (p. 41)",
"status": "Status", "status": "Status",
"q2": "2. What family does your character belong to ? (p. 49)", "q2": "2. What family does your character belong to ? (p. 49)",
"money": "Starting wealth in Koku :", "money": "Starting wealth in Koku",
"glory": "Glory :" "glory": "Glory"
}, },
"part2": { "part2": {
"title": "Part II: Role and School", "title": "Part II: Role and School",
"q3": "3. What is your characters school, and what roles does that school fall into ? (p. 56)", "q3": "3. What is your characters school, and what roles does that school fall into ? (p. 56)",
"school": "School :", "school": "School",
"role": "Roles", "role": "Roles",
"honor": "Honor", "honor": "Honor",
"access": "Technique types available", "access": "Technique types available",
@@ -372,8 +372,9 @@
"q17": "17. How would your characters parents describe them ? (p. 95)", "q17": "17. How would your characters parents describe them ? (p. 95)",
"q18": "18. Who was your character named to honor ? (p. 95)", "q18": "18. Who was your character named to honor ? (p. 95)",
"d10r1": "D10 Result (1/2)", "d10r1": "D10 Result (1/2)",
"d10r1_choice": "1st D10 Effect",
"d10r2": "D10 Result (2/2)", "d10r2": "D10 Result (2/2)",
"d10r2_choice": "2nd D10 Effect:", "d10r2_choice": "2nd D10 Effect",
"q19": "19. What is your characters personal name ? (p. 95)" "q19": "19. What is your characters personal name ? (p. 95)"
}, },
"part7": { "part7": {
@@ -382,7 +383,7 @@
"summary": "Summary", "summary": "Summary",
"generchar": "Generate the character", "generchar": "Generate the character",
"generchar_disclaimer": "Warning, this will erase character's current datas !", "generchar_disclaimer": "Warning, this will erase character's current datas !",
"generchar_errors": "Correct the errors before continuing !" "generchar_errors": "Clear errors before continuing !"
} }
} }
} }

View File

@@ -319,13 +319,13 @@
"q1": "1. A quel clan appartient votre personnage ? (p. 41)", "q1": "1. A quel clan appartient votre personnage ? (p. 41)",
"status": "Statut", "status": "Statut",
"q2": "2. A quelle famille appartient votre personnage ? (p. 49)", "q2": "2. A quelle famille appartient votre personnage ? (p. 49)",
"money": "Fortune de départ en Koku :", "money": "Fortune de départ en Koku",
"glory": "Gloire :" "glory": "Gloire"
}, },
"part2": { "part2": {
"title": "Partie II: Rôle et École", "title": "Partie II: Rôle et École",
"q3": "3. Quelle est l'École votre personnage, et quel rôle remplit-elle ? (p. 56)", "q3": "3. Quelle est l'École votre personnage, et quel rôle remplit-elle ? (p. 56)",
"school": "École :", "school": "École",
"role": "Rôles", "role": "Rôles",
"honor": "Honneur", "honor": "Honneur",
"access": "Types de techniques accessibles", "access": "Types de techniques accessibles",
@@ -337,9 +337,9 @@
"part3": { "part3": {
"title": "Partie III: Honneur et Gloire", "title": "Partie III: Honneur et Gloire",
"q5": "5. Qui est le seigneur de votre personnage et quel est le devoir de votre personnage envers lui ? (p. 88)", "q5": "5. Qui est le seigneur de votre personnage et quel est le devoir de votre personnage envers lui ? (p. 88)",
"choose_giri": "Choisissez un giri:", "choose_giri": "Choisissez un giri",
"q6": "6. Que désire votre personnage, et en quoi ce désir risque-t-il de lempêcher daccomplir son devoir ? (p. 90)", "q6": "6. Que désire votre personnage, et en quoi ce désir risque-t-il de lempêcher daccomplir son devoir ? (p. 90)",
"choose_ninjo": "Choisissez un ninjō:", "choose_ninjo": "Choisissez un ninjō",
"q7": "7. Quelle relation votre personnage entretient-il avec son clan ? (p. 91)", "q7": "7. Quelle relation votre personnage entretient-il avec son clan ? (p. 91)",
"increase_glory": "Augmentation de la gloire (+5)", "increase_glory": "Augmentation de la gloire (+5)",
"q8": "8. Que pense votre personnage du bushido ? (p. 91)", "q8": "8. Que pense votre personnage du bushido ? (p. 91)",
@@ -372,8 +372,9 @@
"q17": "17. Comment les parents de votre personnage le décriraient-ils ? (p. 95)", "q17": "17. Comment les parents de votre personnage le décriraient-ils ? (p. 95)",
"q18": "18. En lhonneur de qui votre personnage a-t-il été prénommé ? (p. 95)", "q18": "18. En lhonneur de qui votre personnage a-t-il été prénommé ? (p. 95)",
"d10r1": "Résultat du 1er D10", "d10r1": "Résultat du 1er D10",
"d10r1_choice": "Effet du 1er D10",
"d10r2": "Résultat du 2eme D10", "d10r2": "Résultat du 2eme D10",
"d10r2_choice": "Effet du 2ème D10:", "d10r2_choice": "Effet du 2ème D10",
"q19": "19. Quel est le prénom de votre personnage ? (p. 95)" "q19": "19. Quel est le prénom de votre personnage ? (p. 95)"
}, },
"part7": { "part7": {

View File

@@ -123,16 +123,7 @@ export class BaseSheetL5r5e extends ActorSheet {
e.type === "technique" && e.data.data.technique_type === item.data.data.technique_type e.type === "technique" && e.data.data.technique_type === item.data.data.technique_type
) )
) { ) {
new Dialog({ ui.notifications.info(game.i18n.localize("l5r5e.techniques.only_one"));
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);
return; return;
} }
@@ -143,16 +134,7 @@ export class BaseSheetL5r5e extends ActorSheet {
} else { } else {
// Check if technique is allowed for this character // Check if technique is allowed for this character
if (!game.user.isGM && !this.actor.data.data.techniques[item.data.data.technique_type]) { if (!game.user.isGM && !this.actor.data.data.techniques[item.data.data.technique_type]) {
new Dialog({ ui.notifications.info(game.i18n.localize("l5r5e.techniques.not_allowed"));
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);
return; return;
} }

View File

@@ -37,7 +37,7 @@ export class TwentyQuestionsDialog extends FormApplication {
classes: ["l5r5e", "twenty-questions-dialog"], classes: ["l5r5e", "twenty-questions-dialog"],
template: CONFIG.l5r5e.paths.templates + "actors/twenty-questions-dialog.html", template: CONFIG.l5r5e.paths.templates + "actors/twenty-questions-dialog.html",
title: game.i18n.localize("l5r5e.twenty_questions.title"), title: game.i18n.localize("l5r5e.twenty_questions.title"),
width: 600, width: 700,
height: 800, height: 800,
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "part0" }], tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "part0" }],
resizable: true, resizable: true,
@@ -237,7 +237,7 @@ export class TwentyQuestionsDialog extends FormApplication {
} }
} else if (!this.object.data.step3.allowed_techniques?.[item.data.data.technique_type]) { } else if (!this.object.data.step3.allowed_techniques?.[item.data.data.technique_type]) {
// Tech not allowed // 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; return;
} }
break; break;

View File

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

File diff suppressed because one or more lines are too long

View File

@@ -23,7 +23,7 @@ body {
} }
&.twenty-questions-dialog { &.twenty-questions-dialog {
.window-content { .window-content {
background: url(https://localhost:30000/systems/l5r5e/assets/imgs/bg20Q.webp) no-repeat; background: url("../assets/imgs/bg20Q.webp") no-repeat;
background-size: cover; background-size: cover;
} }
} }

View File

@@ -527,15 +527,33 @@
</label> </label>
</td> </td>
</tr> </tr>
</table>
<table>
<tr> <tr>
<td colspan="3"> <td>
{{localize 'l5r5e.twenty_questions.part6.d10r1_choice'}}
</td>
<td>
{{localize 'l5r5e.twenty_questions.part6.d10r2_choice'}} {{localize 'l5r5e.twenty_questions.part6.d10r2_choice'}}
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="third"> <td>
<label>
{{localize 'l5r5e.twenty_questions.part1.status'}}
<input type="number" name="step18.heritage_add_status" min="-100" max="100" value="{{data.step18.heritage_add_status}}"
data-dtype="Number" placeholder="0">
</label>
<label>
{{localize 'l5r5e.twenty_questions.part1.glory'}}
<input type="number" name="step18.heritage_add_glory" min="-100" max="100" value="{{data.step18.heritage_add_glory}}"
data-dtype="Number" placeholder="0">
</label>
<label>
{{localize 'l5r5e.twenty_questions.part2.honor'}}
<input type="number" name="step18.heritage_add_honor" min="-100" max="100" value="{{data.step18.heritage_add_honor}}"
data-dtype="Number" placeholder="0">
</label>
</td>
<td>
<label> <label>
{{localize 'l5r5e.twenty_questions.increase_skill1'}} {{localize 'l5r5e.twenty_questions.increase_skill1'}}
<select name="step18.skill" class="skill-select"> <select name="step18.skill" class="skill-select">
@@ -551,11 +569,7 @@
{{/select}} {{/select}}
</select> </select>
</label> </label>
</td>
<td class="or">
{{localize 'l5r5e.twenty_questions.or'}}
</td>
<td class="">
{{> 'systems/l5r5e/templates/actors/character/twenty-questions-item.html' itemsList=cache.step18.heritage_item stepName='step18.heritage_item' itemType='items' hideDndAt=1 }} {{> 'systems/l5r5e/templates/actors/character/twenty-questions-item.html' itemsList=cache.step18.heritage_item stepName='step18.heritage_item' itemType='items' hideDndAt=1 }}
</td> </td>
</tr> </tr>
@@ -597,13 +611,13 @@
</td> </td>
<td> <td>
{{localize 'l5r5e.twenty_questions.part1.status'}} {{localize 'l5r5e.twenty_questions.part1.status'}}
{{data.step1.social_status}} {{summary.summary.status}}
{{localize 'l5r5e.twenty_questions.part1.glory'}} {{localize 'l5r5e.twenty_questions.part1.glory'}}
{{data.step2.social_glory}} {{#if data.step7.social_add_glory}} + {{data.step7.social_add_glory}}{{/if}} {{summary.summary.glory}}
{{localize 'l5r5e.twenty_questions.part2.honor'}} {{localize 'l5r5e.twenty_questions.part2.honor'}}
{{data.step3.social_honor}} {{#if data.step8.social_add_honor}} + {{data.step8.social_add_honor}}{{/if}} {{summary.summary.honor}}
{{localize 'l5r5e.twenty_questions.part1.money'}} {{localize 'l5r5e.twenty_questions.part1.money'}}
{{data.step2.wealth}} {{data.step2.wealth}}