tab on 20q and Hide rank 0 (initial) on progession
This commit is contained in:
@@ -73,10 +73,14 @@ export class CharacterSheetL5r5e extends BaseSheetL5r5e {
|
|||||||
xp = Math.floor(xp / 2);
|
xp = Math.floor(xp / 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
const rank = Math.max(0, item.data.bought_at_rank - 1);
|
const rank = Math.max(0, item.data.bought_at_rank);
|
||||||
|
if (rank < 1) {
|
||||||
|
// Ignore starting comp/items
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (!adv[rank]) {
|
if (!adv[rank]) {
|
||||||
adv[rank] = {
|
adv[rank] = {
|
||||||
rank: rank + 1,
|
rank: rank,
|
||||||
spent: 0,
|
spent: 0,
|
||||||
goal: CONFIG.l5r5e.xp.costPerRank[rank] || null,
|
goal: CONFIG.l5r5e.xp.costPerRank[rank] || null,
|
||||||
list: [],
|
list: [],
|
||||||
|
|||||||
@@ -33,7 +33,8 @@ export class TwentyQuestionsDialog extends FormApplication {
|
|||||||
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: 600,
|
||||||
height: 600,
|
height: 800,
|
||||||
|
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "part1" }],
|
||||||
resizable: true,
|
resizable: true,
|
||||||
closeOnSubmit: false,
|
closeOnSubmit: false,
|
||||||
submitOnClose: false,
|
submitOnClose: false,
|
||||||
|
|||||||
@@ -209,10 +209,10 @@ export class TwentyQuestions {
|
|||||||
* Fill a actor data from this object
|
* Fill a actor data from this object
|
||||||
*/
|
*/
|
||||||
async toActor(actor, itemsCache) {
|
async toActor(actor, itemsCache) {
|
||||||
const actorDatas = duplicate(actor.data.data);
|
const actorDatas = actor.data.data;
|
||||||
const formData = this.data;
|
const formData = this.data;
|
||||||
|
|
||||||
// Update the actor real datas
|
// Update the actor
|
||||||
actorDatas.zeni = Math.floor(formData.step2.wealth * 50);
|
actorDatas.zeni = Math.floor(formData.step2.wealth * 50);
|
||||||
actorDatas.identity = {
|
actorDatas.identity = {
|
||||||
...actorDatas.identity,
|
...actorDatas.identity,
|
||||||
@@ -268,24 +268,24 @@ export class TwentyQuestions {
|
|||||||
await actor.deleteEmbeddedEntity("OwnedItem", deleteIds);
|
await actor.deleteEmbeddedEntity("OwnedItem", deleteIds);
|
||||||
|
|
||||||
// Add items in 20Q to actor
|
// Add items in 20Q to actor
|
||||||
Object.values(itemsCache).forEach((types) => {
|
for (const types of Object.values(itemsCache)) {
|
||||||
types.forEach((item) => {
|
for (const item of types) {
|
||||||
const itemData = duplicate(item.data);
|
const itemData = duplicate(item.data);
|
||||||
if (itemData.data?.bought_at_rank) {
|
if (itemData.data?.bought_at_rank) {
|
||||||
itemData.data.bought_at_rank = 0;
|
itemData.data.bought_at_rank = 0;
|
||||||
}
|
}
|
||||||
actor.createEmbeddedEntity("OwnedItem", itemData);
|
if (itemData.data?.xp_spent) {
|
||||||
});
|
itemData.data.xp_spent = 0;
|
||||||
});
|
}
|
||||||
|
await actor.createEmbeddedEntity("OwnedItem", itemData);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Update actor
|
// Update actor
|
||||||
actor.update({
|
await actor.update({
|
||||||
name: (formData.step2.family + " " + formData.step19.firstname).trim(),
|
name: (formData.step2.family + " " + formData.step19.firstname).trim(),
|
||||||
data: diffObject(actor.data.data, actorDatas),
|
data: actor.data.data,
|
||||||
});
|
});
|
||||||
|
|
||||||
// TODO Tmp
|
|
||||||
// console.log(actor);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ L5R5E.paths = {
|
|||||||
L5R5E.stances = ["earth", "air", "water", "fire", "void"];
|
L5R5E.stances = ["earth", "air", "water", "fire", "void"];
|
||||||
L5R5E.techniques = ["kata", "kiho", "invocation", "ritual", "shuji", "maho", "ninjutsu"];
|
L5R5E.techniques = ["kata", "kiho", "invocation", "ritual", "shuji", "maho", "ninjutsu"];
|
||||||
L5R5E.xp = {
|
L5R5E.xp = {
|
||||||
costPerRank: [20, 24, 32, 44, 60],
|
costPerRank: [0, 20, 24, 32, 44, 60],
|
||||||
ringCostMultiplier: 3,
|
ringCostMultiplier: 3,
|
||||||
skillCostMultiplier: 2,
|
skillCostMultiplier: 2,
|
||||||
techniqueCost: 3,
|
techniqueCost: 3,
|
||||||
|
|||||||
@@ -7,11 +7,22 @@
|
|||||||
<h1>{{localize 'l5r5e.twenty_questions.title'}}</h1>
|
<h1>{{localize 'l5r5e.twenty_questions.title'}}</h1>
|
||||||
<div>
|
<div>
|
||||||
{{localize 'l5r5e.twenty_questions.intro'}}
|
{{localize 'l5r5e.twenty_questions.intro'}}
|
||||||
|
<br>
|
||||||
<br><i> {{localize 'l5r5e.twenty_questions.section'}}</i>
|
<br><i> {{localize 'l5r5e.twenty_questions.section'}}</i>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<section class="sheet-body">
|
||||||
|
<nav class="sheet-tabs tabs" data-group="primary">
|
||||||
|
<a class="item" data-tab="part1">I</a>
|
||||||
|
<a class="item" data-tab="part2">II</a>
|
||||||
|
<a class="item" data-tab="part3">III</a>
|
||||||
|
<a class="item" data-tab="part4">IV</a>
|
||||||
|
<a class="item" data-tab="part5">V</a>
|
||||||
|
<a class="item" data-tab="part6">VI</a>
|
||||||
|
<a class="item" data-tab="part7">VII</a>
|
||||||
|
</nav>
|
||||||
|
<article class="tab parts part1" data-group="primary" data-tab="part1">
|
||||||
<h2>{{localize 'l5r5e.twenty_questions.part1.title'}}</h2>
|
<h2>{{localize 'l5r5e.twenty_questions.part1.title'}}</h2>
|
||||||
<div class="parts part1">
|
|
||||||
<div>
|
<div>
|
||||||
<label>
|
<label>
|
||||||
<h3>{{localize 'l5r5e.twenty_questions.part1.q1'}}</h3>
|
<h3>{{localize 'l5r5e.twenty_questions.part1.q1'}}</h3>
|
||||||
@@ -134,10 +145,9 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</article>
|
||||||
|
<article class="tab parts part2" data-group="primary" data-tab="part2">
|
||||||
<h2>{{localize 'l5r5e.twenty_questions.part2.title'}}</h2>
|
<h2>{{localize 'l5r5e.twenty_questions.part2.title'}}</h2>
|
||||||
<div class="parts part2">
|
|
||||||
<div>
|
<div>
|
||||||
<h3>{{localize 'l5r5e.twenty_questions.part2.q3'}}</h3>
|
<h3>{{localize 'l5r5e.twenty_questions.part2.q3'}}</h3>
|
||||||
|
|
||||||
@@ -301,10 +311,9 @@
|
|||||||
</select>
|
</select>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</article>
|
||||||
|
<article class="tab parts part3" data-group="primary" data-tab="part3">
|
||||||
<h2>{{localize 'l5r5e.twenty_questions.part3.title'}}</h2>
|
<h2>{{localize 'l5r5e.twenty_questions.part3.title'}}</h2>
|
||||||
<div class="parts part3">
|
|
||||||
<div>
|
<div>
|
||||||
<h3>{{localize 'l5r5e.twenty_questions.part3.q5'}}</h3>
|
<h3>{{localize 'l5r5e.twenty_questions.part3.q5'}}</h3>
|
||||||
|
|
||||||
@@ -402,10 +411,9 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</article>
|
||||||
|
<article class="tab parts part4" data-group="primary" data-tab="part4">
|
||||||
<h2>{{localize 'l5r5e.twenty_questions.part4.title'}}</h2>
|
<h2>{{localize 'l5r5e.twenty_questions.part4.title'}}</h2>
|
||||||
<div class="parts part4">
|
|
||||||
<div>
|
<div>
|
||||||
<label>
|
<label>
|
||||||
<h3>{{localize 'l5r5e.twenty_questions.part4.q9'}}</h3>
|
<h3>{{localize 'l5r5e.twenty_questions.part4.q9'}}</h3>
|
||||||
@@ -495,10 +503,9 @@
|
|||||||
<br>
|
<br>
|
||||||
{{> 'systems/l5r5e/templates/actors/character/twenty-questions-item.html' itemsList=cache.step13.disadvantage stepName='step13.disadvantage' itemType='peculiarities' hideDndAt=1 }}
|
{{> 'systems/l5r5e/templates/actors/character/twenty-questions-item.html' itemsList=cache.step13.disadvantage stepName='step13.disadvantage' itemType='peculiarities' hideDndAt=1 }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</article>
|
||||||
|
<article class="tab parts part5" data-group="primary" data-tab="part5">
|
||||||
<h2>{{localize 'l5r5e.twenty_questions.part5.title'}}</h2>
|
<h2>{{localize 'l5r5e.twenty_questions.part5.title'}}</h2>
|
||||||
<div class="parts part5">
|
|
||||||
<div>
|
<div>
|
||||||
<label>
|
<label>
|
||||||
<h3>{{localize 'l5r5e.twenty_questions.part5.q14'}}</h3>
|
<h3>{{localize 'l5r5e.twenty_questions.part5.q14'}}</h3>
|
||||||
@@ -531,10 +538,9 @@
|
|||||||
{{> 'systems/l5r5e/templates/actors/character/twenty-questions-item.html' itemsList=cache.step16.item stepName='step16.item' itemType='items' hideDndAt=1 }}
|
{{> 'systems/l5r5e/templates/actors/character/twenty-questions-item.html' itemsList=cache.step16.item stepName='step16.item' itemType='items' hideDndAt=1 }}
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</article>
|
||||||
|
<article class="tab parts part6" data-group="primary" data-tab="part6">
|
||||||
<h2>{{localize 'l5r5e.twenty_questions.part6.title'}}</h2>
|
<h2>{{localize 'l5r5e.twenty_questions.part6.title'}}</h2>
|
||||||
<div class="parts part6">
|
|
||||||
<div>
|
<div>
|
||||||
<label>
|
<label>
|
||||||
<h3>{{localize 'l5r5e.twenty_questions.part6.q17'}}</h3>
|
<h3>{{localize 'l5r5e.twenty_questions.part6.q17'}}</h3>
|
||||||
@@ -598,19 +604,15 @@
|
|||||||
<textarea name="step19.firstname">{{data.step19.firstname}}</textarea>
|
<textarea name="step19.firstname">{{data.step19.firstname}}</textarea>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</article>
|
||||||
|
<article class="tab parts part7" data-group="primary" data-tab="part7">
|
||||||
<h2>{{localize 'l5r5e.twenty_questions.part7.title'}}</h2>
|
<h2>{{localize 'l5r5e.twenty_questions.part7.title'}}</h2>
|
||||||
<div class="parts part7">
|
|
||||||
<div>
|
<div>
|
||||||
<label>
|
<label>
|
||||||
<h3>{{localize 'l5r5e.twenty_questions.part7.q20'}}</h3>
|
<h3>{{localize 'l5r5e.twenty_questions.part7.q20'}}</h3>
|
||||||
<textarea name="step20.death">{{data.step20.death}}</textarea>
|
<textarea name="step20.death">{{data.step20.death}}</textarea>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
{{#if hasErrors}}
|
{{#if hasErrors}}
|
||||||
corriger les erreurs pour poursuivre !
|
corriger les erreurs pour poursuivre !
|
||||||
@@ -625,4 +627,8 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
</article>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
Reference in New Issue
Block a user