Added shortcut for initiative rolls on conflict Tab (character only)

This commit is contained in:
Vlyan
2020-12-29 17:18:57 +01:00
parent e98bf67680
commit 301be94075
13 changed files with 65 additions and 18 deletions

View File

@@ -245,6 +245,13 @@
"firetip": "If you succeed, +1 bonus success per Strife symbol.", "firetip": "If you succeed, +1 bonus success per Strife symbol.",
"watertip": "Perform a second action on your turn that does not require a check or share a type with first action.", "watertip": "Perform a second action on your turn that does not require a check or share a type with first action.",
"voidtip": "You do not receive strife from Strife symbols on checks." "voidtip": "You do not receive strife from Strife symbols on checks."
},
"initiative": {
"title": "Initiative",
"intrigue": "Intrigue",
"duel": "Duel",
"skirmish": "Skirmish",
"mass_battle": "Mass Battle"
} }
}, },
"advancements": { "advancements": {

View File

@@ -245,6 +245,13 @@
"firetip": "Si tienes éxito, +1 éxito adicional por cada símbolo de Conflicto.", "firetip": "Si tienes éxito, +1 éxito adicional por cada símbolo de Conflicto.",
"watertip": "Efectúa una segunda acción durante tu turno que no requiera tirada ni comparta tipo con tu primera acción.", "watertip": "Efectúa una segunda acción durante tu turno que no requiera tirada ni comparta tipo con tu primera acción.",
"voidtip": "No acumulas Conflicto de los símbolos de Conflicto de tus tiradas." "voidtip": "No acumulas Conflicto de los símbolos de Conflicto de tus tiradas."
},
"initiative": {
"title": "Initiative",
"intrigue": "Intrigue",
"duel": "Duel",
"skirmish": "Skirmish",
"mass_battle": "Mass Battle"
} }
}, },
"advancements": { "advancements": {

View File

@@ -245,6 +245,13 @@
"firetip": "Lorsque vous réussissez un test, chaque Conflit obtenu sur vos dés gardés compte comme un succès bonus.", "firetip": "Lorsque vous réussissez un test, chaque Conflit obtenu sur vos dés gardés compte comme un succès bonus.",
"watertip": "Pendant votre tour, vous pouvez effectuer une action supplémentaire qui ne nécessite pas de test, et dont le type est différent de l'action que vous avez déjà effectuée à ce tour.", "watertip": "Pendant votre tour, vous pouvez effectuer une action supplémentaire qui ne nécessite pas de test, et dont le type est différent de l'action que vous avez déjà effectuée à ce tour.",
"voidtip": "Tant que vous êtes dans cette posture, vous ne subissez aucun point de Conflit en cas de Conflit." "voidtip": "Tant que vous êtes dans cette posture, vous ne subissez aucun point de Conflit en cas de Conflit."
},
"initiative": {
"title": "Initiative",
"intrigue": "Intrigue",
"duel": "Duel",
"skirmish": "Escarmouche",
"mass_battle": "Bataille rangée"
} }
}, },
"advancements": { "advancements": {

View File

@@ -140,11 +140,12 @@ export class BaseSheetL5r5e extends ActorSheet {
} }
// *** Dice event on Skills clic *** // *** Dice event on Skills clic ***
html.find(".skill-name").on("click", (event) => { html.find(".dice-picker").on("click", (event) => {
const li = $(event.currentTarget).parents(".skill"); const li = $(event.currentTarget);
new game.l5r5e.DicePickerDialog({ new game.l5r5e.DicePickerDialog({
skillId: li.data("skill"), skillId: li.data("skill") || null,
skillCatId: li.data("skillcat"), skillCatId: li.data("skillcat") || null,
difficulty: li.data("diff") || 2,
actor: this.actor, actor: this.actor,
}).render(true); }).render(true);
}); });

View File

@@ -1,10 +1,9 @@
import { RollL5r5e } from "./roll.js";
/** /**
* L5R Dice picker dialog * L5R Dice picker dialog
* @extends {FormApplication} * @extends {FormApplication}
*/ */
import { L5R5E } from "../config.js";
import { RollL5r5e } from "./roll.js";
export class DicePickerDialog extends FormApplication { export class DicePickerDialog extends FormApplication {
/** /**
* Current Actor * Current Actor
@@ -161,12 +160,12 @@ export class DicePickerDialog extends FormApplication {
name: "", name: "",
}; };
this.skillCatId = L5R5E.skills.get(skillId); this.skillCatId = CONFIG.l5r5e.skills.get(skillId);
} }
/** /**
* Set and load skill's required data from actor and skillCatId * Set and load skill's required data from actor and skillCatId
* @param skillId * @param skillCatId
*/ */
set skillCatId(skillCatId) { set skillCatId(skillCatId) {
if (!skillCatId) { if (!skillCatId) {

View File

@@ -1,4 +1,3 @@
import { L5R5E } from "../config.js";
import { L5rBaseDie } from "./dietype/l5r-base-die.js"; import { L5rBaseDie } from "./dietype/l5r-base-die.js";
/** /**

File diff suppressed because one or more lines are too long

View File

@@ -20,6 +20,25 @@
} }
} }
} }
.initiative {
&-wrapper {
display: block;
flex: 100%;
text-align: center;
}
button {
width: 22%;
margin: 0 0.25rem 0.25rem;
padding: 0 0.5rem;
color: #5a6e5a;
background: rgba(255, 255, 255, 0.5);
border: 1px solid #5a6e5a;
border-radius: 1rem;
}
button:focus {
box-shadow: none;
}
}
} }
&.item, &.item,
.technique, .technique,

View File

@@ -43,10 +43,9 @@
{{!-- Conflict Tab --}} {{!-- Conflict Tab --}}
<article class="tab conflict" data-group="primary" data-tab="conflict"> <article class="tab conflict" data-group="primary" data-tab="conflict">
{{> 'systems/l5r5e/templates/actors/character/conflict.html' }} {{> 'systems/l5r5e/templates/actors/character/conflict.html' }}
{{> 'systems/l5r5e/templates/items/weapon/weapons.html' }}
{{> 'systems/l5r5e/templates/items/armor/armors.html' }}
</article> </article>
{{!-- Inventory Tab --}}
<article class="tab inventory" data-group="primary" data-tab="inventory"> <article class="tab inventory" data-group="primary" data-tab="inventory">
{{> 'systems/l5r5e/templates/items/item/items.html' }} {{> 'systems/l5r5e/templates/items/item/items.html' }}
</article> </article>

View File

@@ -1,3 +1,10 @@
<fieldset class="initiative initiative-wrapper">
<legend class="section-header">{{ localize 'l5r5e.conflict.initiative.title' }}</legend>
<button class="initiative dice-picker" data-skill="sentiment" data-diff="1">{{ localize 'l5r5e.conflict.initiative.intrigue'}}</button>
<button class="initiative dice-picker" data-skill="meditation" data-diff="1">{{ localize 'l5r5e.conflict.initiative.duel'}}</button>
<button class="initiative dice-picker" data-skill="tactics" data-diff="1">{{ localize 'l5r5e.conflict.initiative.skirmish'}}</button>
<button class="initiative dice-picker" data-skill="command" data-diff="1">{{ localize 'l5r5e.conflict.initiative.mass_battle'}}</button>
</fieldset>
<fieldset class="stances-content flexrow"> <fieldset class="stances-content flexrow">
<legend class="section-header">{{ localize 'l5r5e.conflict.stance' }}</legend> <legend class="section-header">{{ localize 'l5r5e.conflict.stance' }}</legend>
<ul class="item-list"> <ul class="item-list">
@@ -6,3 +13,5 @@
{{/each}} {{/each}}
</ul> </ul>
</fieldset> </fieldset>
{{> 'systems/l5r5e/templates/items/weapon/weapons.html' }}
{{> 'systems/l5r5e/templates/items/armor/armors.html' }}

View File

@@ -1,6 +1,6 @@
<li class="skill skill-wrapper" data-skill="{{skillId}}"> <li class="skill skill-wrapper">
<label class="skill-content"> <label class="skill-content">
<span class="skill-name attribute-label rollable">{{ localizeSkill categoryId skillId }}</span> <span class="dice-picker attribute-label rollable" data-skill="{{skillId}}">{{ localizeSkill categoryId skillId }}</span>
<input <input
class="centered-input select-on-focus" class="centered-input select-on-focus"
type="number" type="number"

View File

@@ -1,7 +1,7 @@
<ul class="npc-skill">{{!-- Skills --}} <ul class="npc-skill">{{!-- Skills --}}
{{#each data.skills as |skillValue skillCatId|}} {{#each data.skills as |skillValue skillCatId|}}
<li class="skill skill-wrapper" data-skillcat="{{skillCatId}}"> <li class="skill skill-wrapper">
<label class="skill-name"> <label class="dice-picker" data-skillcat="{{skillCatId}}">
{{localizeSkill skillCatId "title"}} {{localizeSkill skillCatId "title"}}
</label> </label>
<input class="centered-input select-on-focus" id="skill_{{skillCatId}}" type="number" name="data.skills.{{skillCatId}}" value="{{skillValue}}" data-dtype="Number" min="0" max="9" placeholder="0"/> <input class="centered-input select-on-focus" id="skill_{{skillCatId}}" type="number" name="data.skills.{{skillCatId}}" value="{{skillValue}}" data-dtype="Number" min="0" max="9" placeholder="0"/>

View File

@@ -28,7 +28,7 @@
{{#ifCond item.data.advancement_type '==' 'skill' }} {{#ifCond item.data.advancement_type '==' 'skill' }}
<select name="data.skill" id="advancement_skill"> <select name="data.skill" id="advancement_skill">
<option value="none">{{localize 'l5r5e.twenty_questions.choosef'}}</option> <option value="">{{localize 'l5r5e.twenty_questions.choosef'}}</option>
{{#select item.data.skill}} {{#select item.data.skill}}
{{#each item.data.skillsList as |skills catId|}} {{#each item.data.skillsList as |skills catId|}}
<optgroup label="{{localizeSkill catId 'title'}}"> <optgroup label="{{localizeSkill catId 'title'}}">