Fix for rounded vigilance (now ceil instead of floor)

Fix for symbol replaced once
Added 20Q 2nd die skill or tech/item...
This commit is contained in:
Vlyan
2021-01-03 18:12:54 +01:00
parent 791a98eb3c
commit bafa0fb995
12 changed files with 77 additions and 26 deletions

View File

@@ -253,8 +253,8 @@
"composuretip": "(Earth + Water) x2", "composuretip": "(Earth + Water) x2",
"focus": "Focus", "focus": "Focus",
"focustip": "Air + Fire", "focustip": "Air + Fire",
"vigilante": "Vigilante", "vigilance": "Vigilante",
"vigilantetip": "(Air + Water) /2", "vigilancetip": "(Air + Water) /2",
"voidpoints": "Void Points", "voidpoints": "Void Points",
"fatigue": "Fatigue", "fatigue": "Fatigue",
"strife": "Strife" "strife": "Strife"
@@ -371,6 +371,7 @@
"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)",
"d10r2": "D10 Result (2/2)", "d10r2": "D10 Result (2/2)",
"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

@@ -253,8 +253,8 @@
"composuretip": "(Tierra + Agua) x2", "composuretip": "(Tierra + Agua) x2",
"focus": "Concentración", "focus": "Concentración",
"focustip": "Aire + Fuego", "focustip": "Aire + Fuego",
"vigilante": "Alerta", "vigilance": "Alerta",
"vigilantetip": "(Aire + Agua) /2", "vigilancetip": "(Aire + Agua) /2",
"voidpoints": "P. Vacío", "voidpoints": "P. Vacío",
"fatigue": "Fatiga", "fatigue": "Fatiga",
"strife": "Conflicto" "strife": "Conflicto"
@@ -371,6 +371,7 @@
"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)",
"d10r2": "D10 Result (2/2)", "d10r2": "D10 Result (2/2)",
"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

@@ -253,8 +253,8 @@
"composuretip": "(Terre + Eau) x2", "composuretip": "(Terre + Eau) x2",
"focus": "Attention", "focus": "Attention",
"focustip": "Air + Feu", "focustip": "Air + Feu",
"vigilante": "Vigilance", "vigilance": "Vigilance",
"vigilantetip": "(Air + Eau) /2", "vigilancetip": "(Air + Eau) /2",
"voidpoints": "Points de Vide", "voidpoints": "Points de Vide",
"fatigue": "Fatigue", "fatigue": "Fatigue",
"strife": "Conflit" "strife": "Conflit"
@@ -371,6 +371,7 @@
"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",
"d10r2": "Résultat du 2eme D10", "d10r2": "Résultat du 2eme 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

@@ -79,7 +79,7 @@ export class ActorL5r5e extends Actor {
data.endurance = (Number(data.rings.earth) + Number(data.rings.fire)) * 2; data.endurance = (Number(data.rings.earth) + Number(data.rings.fire)) * 2;
data.composure = (Number(data.rings.earth) + Number(data.rings.water)) * 2; data.composure = (Number(data.rings.earth) + Number(data.rings.water)) * 2;
data.focus = Number(data.rings.air) + Number(data.rings.fire); data.focus = Number(data.rings.air) + Number(data.rings.fire);
data.vigilante = Math.floor((Number(data.rings.air) + Number(data.rings.water)) / 2); data.vigilance = Math.ceil((Number(data.rings.air) + Number(data.rings.water)) / 2);
// Attributes bars // Attributes bars
data.void_points.max = data.rings.void; data.void_points.max = data.rings.void;

View File

@@ -193,13 +193,20 @@ export class TwentyQuestionsDialog extends FormApplication {
console.warn("event stepKey is undefined"); console.warn("event stepKey is undefined");
return; return;
} }
try { try {
// Get item // Get item
const item = await game.l5r5e.HelpersL5r5e.getDragnDropTargetObject(event); const item = await game.l5r5e.HelpersL5r5e.getDragnDropTargetObject(event);
if (item.entity !== "Item" || !item) {
console.warn("forbidden item for this drop zone", type, item.data.type);
return;
}
// Specific step18_heritage, all item/tech allowed
if (stepKey === "step18.heritage_item") {
type = item.data.type;
}
if ( if (
item.entity !== "Item" ||
!item ||
(type !== "item" && item.data.type !== type) || (type !== "item" && item.data.type !== type) ||
(type === "item" && !["item", "weapon", "armor"].includes(item.data.type)) (type === "item" && !["item", "weapon", "armor"].includes(item.data.type))
) { ) {

View File

@@ -23,6 +23,7 @@ export class TwentyQuestions {
"step8.skill", "step8.skill",
"step13.skill", "step13.skill",
"step17.skill", "step17.skill",
"step18.skill",
]; ];
/** /**
@@ -40,6 +41,7 @@ export class TwentyQuestions {
"step13.disadvantage", "step13.disadvantage",
"step14.special_features", "step14.special_features",
"step16.item", "step16.item",
"step18.heritage_item",
]; ];
/** /**
@@ -146,6 +148,7 @@ export class TwentyQuestions {
heritage_name: "", heritage_name: "",
heritage_1: null, heritage_1: null,
heritage_2: null, heritage_2: null,
heritage_item: [],
}, },
step19: { step19: {
firstname: "", firstname: "",

View File

@@ -149,11 +149,21 @@ export class HelpersL5r5e {
static convertSymbols(text, toSymbol) { static convertSymbols(text, toSymbol) {
CONFIG.l5r5e.symbols.forEach((cfg, tag) => { CONFIG.l5r5e.symbols.forEach((cfg, tag) => {
if (toSymbol) { if (toSymbol) {
text = text.replace(tag, `<i class="${cfg.class}" title="${game.i18n.localize(cfg.label)}"></i>`); text = text.replace(
new RegExp(HelpersL5r5e.escapeRegExp(tag), "gi"),
`<i class="${cfg.class}" title="${game.i18n.localize(cfg.label)}"></i>`
);
} else { } else {
text = text.replace(new RegExp(`<i class="${cfg.class}" title="[^"]*"></i>`, "gi"), tag); text = text.replace(new RegExp(`<i class="${cfg.class}" title="[^"]*"></i>`, "gi"), tag);
} }
}); });
return text; return text;
} }
/**
* Escape Regx characters
*/
static escapeRegExp(str) {
return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
}
} }

View File

@@ -141,11 +141,6 @@
"lang": "es", "lang": "es",
"name": "Spanish (Spain)", "name": "Spanish (Spain)",
"path": "lang/es-es.json" "path": "lang/es-es.json"
},
{
"lang": "pt-br",
"name": "Português (Brasil)",
"path": "lang/pt-br.json"
} }
], ],
"url": "https://gitlab.com/teaml5r/l5r5e", "url": "https://gitlab.com/teaml5r/l5r5e",

View File

@@ -72,7 +72,7 @@
"endurance": 0, "endurance": 0,
"composure": 0, "composure": 0,
"focus": 0, "focus": 0,
"vigilante": 0, "vigilance": 0,
"void_points": { "void_points": {
"max": 1, "max": 1,
"value": 0 "value": 0

View File

@@ -28,12 +28,12 @@
</label> </label>
<p class="item-description"> {{ localize 'l5r5e.attributes.focustip' }}</p> <p class="item-description"> {{ localize 'l5r5e.attributes.focustip' }}</p>
</li> </li>
<li class="vigilante-content"> <li class="vigilance-content">
<label class="attribute-label"> <label class="attribute-label">
<strong>{{ localize 'l5r5e.attributes.vigilante' }}</strong> <strong>{{ localize 'l5r5e.attributes.vigilance' }}</strong>
<input class="centered-input" type="text" name="data.vigilante" value="{{data.vigilante}}" data-dtype="Number" disabled/> <input class="centered-input" type="text" name="data.vigilance" value="{{data.vigilance}}" data-dtype="Number" disabled/>
</label> </label>
<p class="item-description"> {{ localize 'l5r5e.attributes.vigilantetip' }}</p> <p class="item-description"> {{ localize 'l5r5e.attributes.vigilancetip' }}</p>
</li> </li>
<li class="void-content"> <li class="void-content">
<label class="attribute-label"> <label class="attribute-label">

View File

@@ -28,12 +28,12 @@
</label> </label>
<p class="item-description"> {{ localize 'l5r5e.attributes.focustip' }}</p> <p class="item-description"> {{ localize 'l5r5e.attributes.focustip' }}</p>
</li> </li>
<li class="vigilante-content"> <li class="vigilance-content">
<label class="attribute-label"> <label class="attribute-label">
<strong>{{ localize 'l5r5e.attributes.vigilante' }}</strong> <strong>{{ localize 'l5r5e.attributes.vigilante' }}</strong>
<input class="centered-input" type="text" name="data.vigilante" value="{{data.vigilante}}" data-dtype="Number" disabled/> <input class="centered-input" type="text" name="data.vigilance" value="{{data.vigilance}}" data-dtype="Number" disabled/>
</label> </label>
<p class="item-description"> {{ localize 'l5r5e.attributes.vigilantetip' }}</p> <p class="item-description"> {{ localize 'l5r5e.attributes.vigilancetip' }}</p>
</li> </li>
<li class="void-content"> <li class="void-content">
<label class="attribute-label"> <label class="attribute-label">

View File

@@ -578,7 +578,7 @@
<label> <label>
{{localize 'l5r5e.twenty_questions.part6.d10r1'}} {{localize 'l5r5e.twenty_questions.part6.d10r1'}}
<a class="inline-roll roll" title="1d10" data-mode="roll" <a class="inline-roll roll" title="1d10" data-mode="roll"
data-flavor="{{localize 'l5r5e.twenty_questions.d10r1'}}" data-formula="1d10" data-step="step18.heritage_1"> data-flavor="{{localize 'l5r5e.twenty_questions.part6.d10r1'}}" data-formula="1d10" data-step="step18.heritage_1">
<i class="fas fa-dice-d20"></i> 1d10 <i class="fas fa-dice-d20"></i> 1d10
</a> </a>
<br> <br>
@@ -589,7 +589,7 @@
<label> <label>
{{localize 'l5r5e.twenty_questions.part6.d10r2'}} {{localize 'l5r5e.twenty_questions.part6.d10r2'}}
<a class="inline-roll roll" title="1d10" data-mode="roll" <a class="inline-roll roll" title="1d10" data-mode="roll"
data-flavor="{{localize 'l5r5e.twenty_questions.d10r2'}}" data-formula="1d10" data-step="step18.heritage_2"> data-flavor="{{localize 'l5r5e.twenty_questions.part6.d10r2'}}" data-formula="1d10" data-step="step18.heritage_2">
<i class="fas fa-dice-d20"></i> 1d10 <i class="fas fa-dice-d20"></i> 1d10
</a> </a>
<br> <br>
@@ -598,6 +598,39 @@
</td> </td>
</tr> </tr>
</table> </table>
<table>
<tr>
<td colspan="3">
{{localize 'l5r5e.twenty_questions.part6.d10r2_choice'}}
</td>
</tr>
<tr>
<td class="third">
<label>
{{localize 'l5r5e.twenty_questions.increase_skill1'}}
<br>
<select name="step18.skill" class="skill-select">
{{#select data.step18.skill}}
<option value="none">{{localize 'l5r5e.twenty_questions.choose_one_skill'}}</option>
{{#each skillsList as |skills catId|}}
<optgroup label="{{localizeSkill catId 'title'}}">
{{#each skills as |obj|}}
<option value="{{obj.id}}">{{obj.label}}</option>
{{/each}}
</optgroup>
{{/each}}
{{/select}}
</select>
</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 }}
</td>
</tr>
</table>
</div> </div>
<div> <div>