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:
@@ -79,7 +79,7 @@ export class ActorL5r5e extends Actor {
|
||||
data.endurance = (Number(data.rings.earth) + Number(data.rings.fire)) * 2;
|
||||
data.composure = (Number(data.rings.earth) + Number(data.rings.water)) * 2;
|
||||
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
|
||||
data.void_points.max = data.rings.void;
|
||||
|
||||
@@ -193,13 +193,20 @@ export class TwentyQuestionsDialog extends FormApplication {
|
||||
console.warn("event stepKey is undefined");
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
// Get item
|
||||
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 (
|
||||
item.entity !== "Item" ||
|
||||
!item ||
|
||||
(type !== "item" && item.data.type !== type) ||
|
||||
(type === "item" && !["item", "weapon", "armor"].includes(item.data.type))
|
||||
) {
|
||||
|
||||
@@ -23,6 +23,7 @@ export class TwentyQuestions {
|
||||
"step8.skill",
|
||||
"step13.skill",
|
||||
"step17.skill",
|
||||
"step18.skill",
|
||||
];
|
||||
|
||||
/**
|
||||
@@ -40,6 +41,7 @@ export class TwentyQuestions {
|
||||
"step13.disadvantage",
|
||||
"step14.special_features",
|
||||
"step16.item",
|
||||
"step18.heritage_item",
|
||||
];
|
||||
|
||||
/**
|
||||
@@ -146,6 +148,7 @@ export class TwentyQuestions {
|
||||
heritage_name: "",
|
||||
heritage_1: null,
|
||||
heritage_2: null,
|
||||
heritage_item: [],
|
||||
},
|
||||
step19: {
|
||||
firstname: "",
|
||||
|
||||
@@ -149,11 +149,21 @@ export class HelpersL5r5e {
|
||||
static convertSymbols(text, toSymbol) {
|
||||
CONFIG.l5r5e.symbols.forEach((cfg, tag) => {
|
||||
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 {
|
||||
text = text.replace(new RegExp(`<i class="${cfg.class}" title="[^"]*"></i>`, "gi"), tag);
|
||||
}
|
||||
});
|
||||
return text;
|
||||
}
|
||||
|
||||
/**
|
||||
* Escape Regx characters
|
||||
*/
|
||||
static escapeRegExp(str) {
|
||||
return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user