Xp not in curriculum are now rounded up (down before)

No more automation in stats for Npc (these cheaters !)
20Q Pushed the step3 item's limit to 20 (10 previous)
Gm Tool no longer stuck the escape key process
This commit is contained in:
Vlyan
2021-01-19 12:10:04 +01:00
parent 23db7ed2c2
commit 71a3af85dd
7 changed files with 47 additions and 29 deletions

View File

@@ -16,6 +16,8 @@
- Added a visual indicator for equipped / readied - Added a visual indicator for equipped / readied
- Now only equipped armor / weapon will show in conflict tab, and all armors/weapons now show in inventory tab - Now only equipped armor / weapon will show in conflict tab, and all armors/weapons now show in inventory tab
- Xp not in curriculum are now rounded up (down before) - Xp not in curriculum are now rounded up (down before)
- No more automation in stats for Npc (these cheaters !)
- 20Q Pushed the step3 item's limit to 20 (10 previous)
## 1.0.0 - First public release ## 1.0.0 - First public release
- Removed the 0ds if no skill point - Removed the 0ds if no skill point

View File

@@ -76,22 +76,22 @@ export class ActorL5r5e extends Actor {
if (["character", "npc"].includes(this.data.type)) { if (["character", "npc"].includes(this.data.type)) {
const data = this.data.data; const data = this.data.data;
data.endurance = (Number(data.rings.earth) + Number(data.rings.fire)) * 2; // No automation for npc as they cheat in stats
data.composure = (Number(data.rings.earth) + Number(data.rings.water)) * 2; if (this.data.type === "character") {
data.focus = Number(data.rings.air) + Number(data.rings.fire); data.endurance = (Number(data.rings.earth) + Number(data.rings.fire)) * 2;
data.composure = (Number(data.rings.earth) + Number(data.rings.water)) * 2;
// Attributes bars data.focus = Number(data.rings.air) + Number(data.rings.fire);
data.void_points.max = data.rings.void;
data.fatigue.max = data.endurance;
data.strife.max = data.composure;
// if compromise, vigilance = 1
if (data.strife.value > data.strife.max) {
data.vigilance = 1;
} else {
data.vigilance = Math.ceil((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.fatigue.max = data.endurance;
data.strife.max = data.composure;
data.void_points.max = data.rings.void;
// if compromise, vigilance = 1
data.is_compromised = data.strife.value > data.strife.max;
// Make sure void points are never greater than max // Make sure void points are never greater than max
if (data.void_points.value > data.void_points.max) { if (data.void_points.value > data.void_points.max) {
data.void_points.value = data.void_points.max; data.void_points.value = data.void_points.max;

View File

@@ -59,7 +59,7 @@ export class CombatL5r5e extends Combat {
if (combatant.actor.data.type === "npc" && combatant.actor.data.data.type === "minion") { if (combatant.actor.data.type === "npc" && combatant.actor.data.data.type === "minion") {
// Minion NPCs can generate initiative value without a check, using their focus or vigilance attribute // Minion NPCs can generate initiative value without a check, using their focus or vigilance attribute
initiative = cfg.prepared.minion ? data.focus : data.vigilance; initiative = cfg.prepared.minion ? data.focus : data.is_compromised ? 1 : data.vigilance;
} else { } else {
// PC and Adversary // PC and Adversary
const isPc = combatant.actor.data.type === "character"; const isPc = combatant.actor.data.type === "character";
@@ -69,7 +69,7 @@ export class CombatL5r5e extends Combat {
if (isPrepared === "null") { if (isPrepared === "null") {
isPrepared = data.prepared; isPrepared = data.prepared;
} }
initiative = isPrepared ? data.focus : data.vigilance; initiative = isPrepared ? data.focus : data.is_compromised ? 1 : data.vigilance;
// Roll formula // Roll formula
if (!formula) { if (!formula) {

View File

@@ -48,7 +48,15 @@ export class GmToolsDialog extends FormApplication {
* @override * @override
*/ */
close() { close() {
// nothing ! // TODO better implementation needed : see KeyboardManager._onEscape(event, up, modifiers)
// This windows is always open, so esc key si stuck at step 2 : Object.keys(ui.windows).length > 0
// Case 3 (GM) - release controlled objects
if (canvas?.ready && game.user.isGM && Object.keys(canvas.activeLayer._controlled).length) {
canvas.activeLayer.releaseAll();
} else {
// Case 4 - toggle the main menu
ui.menu.toggle();
}
} }
/** /**

View File

@@ -2,7 +2,7 @@
<li class="endurance-content"> <li class="endurance-content">
<label class="attribute-label"> <label class="attribute-label">
<strong>{{ localize 'l5r5e.attributes.endurance' }}</strong> <strong>{{ localize 'l5r5e.attributes.endurance' }}</strong>
<input class="centered-input" type="text" name="data.endurance" value="{{data.endurance}}" data-dtype="Number" disabled/> <input class="centered-input" type="number" name="data.endurance" value="{{data.endurance}}" data-dtype="Number" disabled/>
</label> </label>
<label class="attribute-label"> <label class="attribute-label">
<strong>{{ localize 'l5r5e.attributes.fatigue' }}</strong> <strong>{{ localize 'l5r5e.attributes.fatigue' }}</strong>
@@ -13,7 +13,7 @@
<li class="composure-content"> <li class="composure-content">
<label class="attribute-label"> <label class="attribute-label">
<strong>{{ localize 'l5r5e.attributes.composure' }}</strong> <strong>{{ localize 'l5r5e.attributes.composure' }}</strong>
<input class="centered-input" type="text" name="data.composure" value="{{data.composure}}" data-dtype="Number" disabled/> <input class="centered-input" type="number" name="data.composure" value="{{data.composure}}" data-dtype="Number" disabled/>
</label> </label>
<label class="attribute-label"> <label class="attribute-label">
<strong>{{ localize 'l5r5e.attributes.strife' }}</strong> <strong>{{ localize 'l5r5e.attributes.strife' }}</strong>
@@ -24,14 +24,18 @@
<li class="focus-content"> <li class="focus-content">
<label class="attribute-label"> <label class="attribute-label">
<strong>{{ localize 'l5r5e.attributes.focus' }}</strong> <strong>{{ localize 'l5r5e.attributes.focus' }}</strong>
<input class="centered-input" type="text" name="data.focus" value="{{data.focus}}" data-dtype="Number" disabled/> <input class="centered-input" type="number" name="data.focus" value="{{data.focus}}" data-dtype="Number" disabled/>
</label> </label>
<p class="item-description"> {{ localize 'l5r5e.attributes.focustip' }}</p> <p class="item-description"> {{ localize 'l5r5e.attributes.focustip' }}</p>
</li> </li>
<li class="vigilance-content {{#ifCond data.strife.value '>' data.strife.max}}compromised{{/ifCond}}"> <li class="vigilance-content {{#if data.is_compromised}}compromised{{/if}}">
<label class="attribute-label"> <label class="attribute-label">
<strong>{{ localize 'l5r5e.attributes.vigilance' }}</strong> <strong>{{ localize 'l5r5e.attributes.vigilance' }}</strong>
<input class="centered-input" type="text" name="data.vigilance" value="{{data.vigilance}}" data-dtype="Number" disabled/> {{#if data.is_compromised}}
<input class="centered-input" type="number" value="1" disabled/>
{{else}}
<input class="centered-input" type="number" name="data.vigilance" value="{{data.vigilance}}" data-dtype="Number" disabled/>
{{/if}}
</label> </label>
<p class="item-description"> {{ localize 'l5r5e.attributes.vigilancetip' }}</p> <p class="item-description"> {{ localize 'l5r5e.attributes.vigilancetip' }}</p>
</li> </li>
@@ -39,7 +43,7 @@
<label class="attribute-label"> <label class="attribute-label">
<strong>{{ localize 'l5r5e.attributes.voidpoints' }}</strong> <strong>{{ localize 'l5r5e.attributes.voidpoints' }}</strong>
<input class="centered-input select-on-focus" type="number" name="data.void_points.value" value="{{data.void_points.value}}" data-dtype="Number" placeholder="0" min="0" max="{{data.void_points.max}}"/> <input class="centered-input select-on-focus" type="number" name="data.void_points.value" value="{{data.void_points.value}}" data-dtype="Number" placeholder="0" min="0" max="{{data.void_points.max}}"/>
<input class="centered-input" type="text" name="data.void_points.max" value="{{data.void_points.max}}" data-dtype="Number" disabled/> <input class="centered-input" type="number" name="data.void_points.max" value="{{data.void_points.max}}" data-dtype="Number" disabled/>
</label> </label>
</li> </li>
</ul> </ul>

View File

@@ -2,7 +2,7 @@
<li class="endurance-content"> <li class="endurance-content">
<label class="attribute-label"> <label class="attribute-label">
<strong>{{ localize 'l5r5e.attributes.endurance' }}</strong> <strong>{{ localize 'l5r5e.attributes.endurance' }}</strong>
<input class="centered-input" type="text" name="data.endurance" value="{{data.endurance}}" data-dtype="Number" disabled/> <input class="centered-input" type="number" name="data.endurance" value="{{data.endurance}}" data-dtype="Number" min="0" placeholder="0"/>
</label> </label>
<label class="attribute-label"> <label class="attribute-label">
<strong>{{ localize 'l5r5e.attributes.fatigue' }}</strong> <strong>{{ localize 'l5r5e.attributes.fatigue' }}</strong>
@@ -13,7 +13,7 @@
<li class="composure-content"> <li class="composure-content">
<label class="attribute-label"> <label class="attribute-label">
<strong>{{ localize 'l5r5e.attributes.composure' }}</strong> <strong>{{ localize 'l5r5e.attributes.composure' }}</strong>
<input class="centered-input" type="text" name="data.composure" value="{{data.composure}}" data-dtype="Number" disabled/> <input class="centered-input" type="number" name="data.composure" value="{{data.composure}}" data-dtype="Number" min="0" placeholder="0"/>
</label> </label>
<label class="attribute-label"> <label class="attribute-label">
<strong>{{ localize 'l5r5e.attributes.strife' }}</strong> <strong>{{ localize 'l5r5e.attributes.strife' }}</strong>
@@ -24,14 +24,18 @@
<li class="focus-content"> <li class="focus-content">
<label class="attribute-label"> <label class="attribute-label">
<strong>{{ localize 'l5r5e.attributes.focus' }}</strong> <strong>{{ localize 'l5r5e.attributes.focus' }}</strong>
<input class="centered-input" type="text" name="data.focus" value="{{data.focus}}" data-dtype="Number" disabled/> <input class="centered-input" type="number" name="data.focus" value="{{data.focus}}" data-dtype="Number" min="0" placeholder="0"/>
</label> </label>
<p class="item-description"> {{ localize 'l5r5e.attributes.focustip' }}</p> <p class="item-description"> {{ localize 'l5r5e.attributes.focustip' }}</p>
</li> </li>
<li class="vigilance-content {{#ifCond data.strife.value '>' data.strife.max}}compromised{{/ifCond}}"> <li class="vigilance-content {{#if data.is_compromised}}compromised{{/if}}">
<label class="attribute-label"> <label class="attribute-label">
<strong>{{ localize 'l5r5e.attributes.vigilance' }}</strong> <strong>{{ localize 'l5r5e.attributes.vigilance' }}</strong>
<input class="centered-input" type="text" name="data.vigilance" value="{{data.vigilance}}" data-dtype="Number" disabled/> {{#if data.is_compromised}}
<input class="centered-input" type="number" value="1" disabled/>
{{else}}
<input class="centered-input" type="number" name="data.vigilance" value="{{data.vigilance}}" data-dtype="Number" min="0" placeholder="0"/>
{{/if}}
</label> </label>
<p class="item-description"> {{ localize 'l5r5e.attributes.vigilancetip' }}</p> <p class="item-description"> {{ localize 'l5r5e.attributes.vigilancetip' }}</p>
</li> </li>
@@ -39,7 +43,7 @@
<label class="attribute-label"> <label class="attribute-label">
<strong>{{ localize 'l5r5e.attributes.voidpoints' }}</strong> <strong>{{ localize 'l5r5e.attributes.voidpoints' }}</strong>
<input class="centered-input select-on-focus" type="number" name="data.void_points.value" value="{{data.void_points.value}}" data-dtype="Number" placeholder="0" min="0" max="{{data.void_points.max}}"/> <input class="centered-input select-on-focus" type="number" name="data.void_points.value" value="{{data.void_points.value}}" data-dtype="Number" placeholder="0" min="0" max="{{data.void_points.max}}"/>
<input class="centered-input" type="text" name="data.void_points.max" value="{{data.void_points.max}}" data-dtype="Number" disabled/> <input class="centered-input" type="number" name="data.void_points.max" value="{{data.void_points.max}}" data-dtype="Number" disabled/>
</label> </label>
</li> </li>
</ul> </ul>

View File

@@ -236,7 +236,7 @@
</td> </td>
<td class="fifty"> <td class="fifty">
{{localize 'l5r5e.twenty_questions.part2.outfit'}} {{localize 'l5r5e.twenty_questions.part2.outfit'}}
{{> 'systems/l5r5e/templates/actors/character/twenty-questions-item.html' itemsList=cache.step3.equipment stepName='step3.equipment' itemType='items' hideDndAt=10 }} {{> 'systems/l5r5e/templates/actors/character/twenty-questions-item.html' itemsList=cache.step3.equipment stepName='step3.equipment' itemType='items' hideDndAt=20 }}
</td> </td>
</tr> </tr>
</table> </table>