Working on 0.8.x

- NPC with all ring on strengths/weaknesses (CSS TODO).
- Removed Custom tech "Links" as they are in fact "Bonds" and need more work.
This commit is contained in:
Vlyan
2021-05-04 19:19:11 +02:00
parent 209c22996a
commit 0bef6afc66
12 changed files with 45 additions and 46 deletions

View File

@@ -1,11 +1,11 @@
# Changelog # Changelog
## 1.3.0 - Foundry 0.8.x compatibility ## 1.3.0 - Foundry 0.8.x compatibility
- Updated the System to the new version of Foundry VTT (a lot of things broke) - Updated the System to the new version of Foundry VTT (a lot of things broke).
- RnK button is now black in chat if no actions left in roll. - RnK button is now black in chat if no actions left in roll.
- NPC can now have strengths/weaknesses with all rings.
## 1.2.2 - Before the Change - Added an optional "Specificity" technique type to serve as a catch-all (by request).
- Added some custom technique's types by request: Link & Specificity - Fix rnkMessage not passing on actor object for NPCs (thanks to Bragma).
- Added Mantis Clan compendium entries - Added Mantis Clan compendium entries
- Fixed the "Crescent Moon Style" technique rank from 4 to 2 - Fixed the "Crescent Moon Style" technique rank from 4 to 2

View File

@@ -16,7 +16,7 @@
}, },
"CustomTechniques": { "CustomTechniques": {
"Title": "Use custom techniques", "Title": "Use custom techniques",
"Hint": "Add 'Link' and 'Specificity' techniques types." "Hint": "Add 'Specificity' technique type to serve as a catch-all."
} }
}, },
"ACTOR": { "ACTOR": {

View File

@@ -16,7 +16,7 @@
}, },
"CustomTechniques": { "CustomTechniques": {
"Title": "Use custom techniques", "Title": "Use custom techniques",
"Hint": "Add 'Link' and 'Specificity' techniques types." "Hint": "Add 'Specificity' technique type to serve as a catch-all."
} }
}, },
"ACTOR": { "ACTOR": {

View File

@@ -16,7 +16,7 @@
}, },
"CustomTechniques": { "CustomTechniques": {
"Title": "Utiliser les techniques personnalisées", "Title": "Utiliser les techniques personnalisées",
"Hint": "Ajoute les types de technique 'Lien' et 'Particularités'." "Hint": "Ajoute un type de technique 'Particularités' pour servir de fourre-tout."
} }
}, },
"ACTOR": { "ACTOR": {
@@ -175,7 +175,6 @@
"ninjutsu": "Ninjutsu", "ninjutsu": "Ninjutsu",
"school_ability": "Capacité d'école", "school_ability": "Capacité d'école",
"mastery_ability": "Capacité de maîtrise", "mastery_ability": "Capacité de maîtrise",
"link": "Liens",
"specificity": "Particularités" "specificity": "Particularités"
}, },
"peculiarities": { "peculiarities": {

View File

@@ -349,7 +349,13 @@ export class BaseSheetL5r5e extends ActorSheet {
case "technique": { case "technique": {
// If technique, select the current type // If technique, select the current type
const techType = $(event.currentTarget).data("tech-type"); const techType = $(event.currentTarget).data("tech-type");
if ([...CONFIG.l5r5e.techniques, ...CONFIG.l5r5e.techniques_school].includes(techType)) { if (
[
...CONFIG.l5r5e.techniques,
...CONFIG.l5r5e.techniques_school,
...CONFIG.l5r5e.techniques_custom,
].includes(techType)
) {
item.data.data.technique_type = techType; item.data.data.technique_type = techType;
item.data.img = `${CONFIG.l5r5e.paths.assets}icons/techs/${techType}.svg`; item.data.img = `${CONFIG.l5r5e.paths.assets}icons/techs/${techType}.svg`;
} }

View File

@@ -82,8 +82,7 @@ export class TwentyQuestions {
shuji: false, shuji: false,
maho: false, maho: false,
ninjutsu: false, ninjutsu: false,
link: false, specificity: true,
specificity: false,
}, },
techniques: [], techniques: [],
school_ability: [], school_ability: [],

View File

@@ -8,7 +8,7 @@ L5R5E.paths = {
L5R5E.money = [50, 10]; L5R5E.money = [50, 10];
L5R5E.stances = ["earth", "air", "water", "fire", "void"]; L5R5E.stances = ["earth", "air", "water", "fire", "void"];
L5R5E.techniques = ["kata", "kiho", "inversion", "invocation", "ritual", "shuji", "maho", "ninjutsu"]; L5R5E.techniques = ["kata", "kiho", "inversion", "invocation", "ritual", "shuji", "maho", "ninjutsu"];
L5R5E.techniques_custom = ["link", "specificity"]; L5R5E.techniques_custom = ["specificity"];
L5R5E.techniques_school = ["school_ability", "mastery_ability"]; L5R5E.techniques_school = ["school_ability", "mastery_ability"];
L5R5E.xp = { L5R5E.xp = {

View File

@@ -45,10 +45,7 @@ export class HelpersL5r5e {
* Get Techniques for List / Select * Get Techniques for List / Select
*/ */
static getTechniquesList() { static getTechniquesList() {
return [ return CONFIG.l5r5e.techniques.map((e) => ({
...CONFIG.l5r5e.techniques,
...(game.settings.get("l5r5e", "techniques-customs") ? CONFIG.l5r5e.techniques_custom : []),
].map((e) => ({
id: e, id: e,
label: game.i18n.localize(`l5r5e.techniques.${e}`), label: game.i18n.localize(`l5r5e.techniques.${e}`),
})); }));

View File

@@ -19,8 +19,11 @@ export class TechniqueSheetL5r5e extends ItemSheetL5r5e {
async getData() { async getData() {
const sheetData = await super.getData(); const sheetData = await super.getData();
// Add "school ability" and "mastery ability" // Add "school ability", "mastery ability" and customs if active
CONFIG.l5r5e.techniques_school.forEach((e) => { [
...CONFIG.l5r5e.techniques_school,
...(game.settings.get("l5r5e", "techniques-customs") ? CONFIG.l5r5e.techniques_custom : []),
].forEach((e) => {
sheetData.data.techniquesList.push({ sheetData.data.techniquesList.push({
id: e, id: e,
label: game.i18n.localize(`l5r5e.techniques.${e}`), label: game.i18n.localize(`l5r5e.techniques.${e}`),

View File

@@ -183,6 +183,8 @@ export class MigrationL5r5e {
const updateData = {}; const updateData = {};
const actorData = actor.data; const actorData = actor.data;
console.log(actorData); // TODO TMP data.data ? à vérifier
// ***** Start of 1.1.0 ***** // ***** Start of 1.1.0 *****
// Add "Prepared" in actor // Add "Prepared" in actor
if (actorData.prepared === undefined) { if (actorData.prepared === undefined) {
@@ -202,6 +204,16 @@ export class MigrationL5r5e {
} }
// ***** End of 1.1.0 ***** // ***** End of 1.1.0 *****
// ***** Start of 1.3.0 *****
// NPC have now more thant a Strength and a Weakness
if (actor.type === "npc" && actorData.rings_affinities) {
updateData["data.rings_affinities." + actorData.rings_affinities.strength.ring] =
actorData.rings_affinities.strength.value;
updateData["data.rings_affinities." + actorData.rings_affinities.weakness.ring] =
actorData.rings_affinities.weakness.value;
}
// ***** End of 1.3.0 *****
return updateData; return updateData;
} }

View File

@@ -103,8 +103,7 @@
"shuji": false, "shuji": false,
"maho": false, "maho": false,
"ninjutsu": false, "ninjutsu": false,
"link": false, "specificity": true
"specificity": false
} }
} }
}, },
@@ -124,14 +123,11 @@
"social": 0 "social": 0
}, },
"rings_affinities": { "rings_affinities": {
"strength": { "earth": 0,
"ring": "fire", "air": 0,
"value": 2 "water": 0,
}, "fire": 0,
"weakness": { "void": 0
"ring": "water",
"value": -2
}
}, },
"skills": { "skills": {
"artisan": 0, "artisan": 0,

View File

@@ -18,24 +18,11 @@
</label> </label>
</li> </li>
<li class="affinities"> <li class="affinities">
{{!-- Strength --}} {{!-- Strength & Weakness --}}
<select class="attribute-dtype" name="data.rings_affinities.strength.ring"> {{#each data.stances as |stance|}}
{{#select data.data.rings_affinities.strength.ring}} <i class="i_{{stance}}" title="{{localizeRing stance}}"></i>
{{#each data.stances as |stance|}} <input class="centered-input select-on-focus" type="number" name="data.rings_affinities.{{stance}}" value="{{lookup ../data.data.rings_affinities stance}}" data-dtype="Number" min="-9" max="9" placeholder="0"/>
<option value="{{stance}}">{{localizeRing stance}}</option> {{/each}}
{{/each}}
{{/select}}
</select>
<input class="centered-input select-on-focus" type="number" name="data.rings_affinities.strength.value" value="{{data.data.rings_affinities.strength.value}}" data-dtype="Number" min="1" max="9" placeholder="0"/>
{{!-- Weakness --}}
<select class="attribute-dtype" name="data.rings_affinities.weakness.ring">
{{#select data.data.rings_affinities.weakness.ring}}
{{#each data.stances as |stance|}}
<option value="{{stance}}">{{localizeRing stance}}</option>
{{/each}}
{{/select}}
</select>
<input class="centered-input select-on-focus" type="number" name="data.rings_affinities.weakness.value" value="{{data.data.rings_affinities.weakness.value}}" data-dtype="Number" min="-9" max="-1" placeholder="0"/>
{{!-- Attitude --}} {{!-- Attitude --}}
<label class="attitude"> <label class="attitude">
<input type="text" name="data.attitude" value="{{data.data.attitude}}" data-dtype="String" placeholder=""/> <input type="text" name="data.attitude" value="{{data.data.attitude}}" data-dtype="String" placeholder=""/>