Add spells and alchemy

This commit is contained in:
2022-01-23 09:25:09 +01:00
parent 5eb059a2fa
commit aeb7739879
28 changed files with 696 additions and 71 deletions

View File

@ -12,6 +12,9 @@
<a class="item" data-tab="actions">{{localize "BOL.ui.tab.actions"}}</a>
<a class="item" data-tab="features">{{localize "BOL.ui.tab.features"}}</a>
<a class="item" data-tab="equipment">{{localize "BOL.ui.tab.equipment"}}</a>
{{#if (or isSorcerer isAlchemist)}}
<a class="item" data-tab="spellalchemy">{{localize "BOL.ui.tab.spellalchemy"}}</a>
{{/if}}
<a class="item" data-tab="description">{{localize "BOL.ui.tab.description"}}</a>
</nav>
{{!-- Sheet Body --}}
@ -26,6 +29,13 @@
<div class="tab features" data-group="primary" data-tab="features">
{{> "systems/bol/templates/actor/parts/tabs/actor-features.hbs"}}
</div>
{{#if (or isSorcerer isAlchemist)}}
<div class="tab features" data-group="primary" data-tab="spellalchemy">
{{> "systems/bol/templates/actor/parts/tabs/actor-spellalchemy.hbs"}}
</div>
{{/if}}
<div class="tab equipment" data-group="primary" data-tab="equipment">
{{> "systems/bol/templates/actor/parts/tabs/actor-equipment.hbs"}}
</div>

View File

@ -0,0 +1,65 @@
<!--SORTS-->
{{#if isSorcerer}}
<ol class="items-list">
<li class="item flexrow item-header">
<div class="item-name flex4 left">{{localize "BOL.ui.spells"}}</div>
<div class="item-field flex2 center">{{localize "BOL.ui.circle"}}</div>
<div class="item-field flex1 center">{{localize "BOL.ui.difficulty"}}</div>
<div class="item-field flex1 right"></div>
</li>
{{#each spells as |item id|}}
<li class="item flexrow" data-item-id="{{item._id}}">
<h4 class="item-name flex4 left">
<div class="item-image"><img src="{{item.img}}" title="{{item.name}}"/></div>
<a class="rollable" data-roll-type="spell">{{item.name}}</a>
</h4>
<div class="item-field flex1 center">
<span class="item-field">{{item.data.properties.circle}}</span>
</div>
<div class="item-field flex1 center">
<span class="item-field">{{item.data.properties.difficulty}}</span>
</div>
<div class="item-field flex1 right">
<a class="item-control item-edit" title="{{localize "BOL.ui.edit"}}"><i class="fas fa-square"></i></a>
<a class="item-control item-delete" title="{{localize "BOL.ui.delete"}}"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ol>
{{/if}}
{{#if isAlchemist}}
<ol class="items-list">
<li class="item flexrow item-header">
<div class="item-name flex4 left">{{localize "BOL.ui.alchemy"}}</div>
<div class="item-field flex2 center">{{localize "BOL.ui.type"}}</div>
<div class="item-field flex1 center">{{localize "BOL.ui.difficulty"}}</div>
<div class="item-field flex1 center">{{localize "BOL.ui.advance"}}</div>
<div class="item-field flex1 right"></div>
</li>
{{#each alchemy as |item id|}}
<li class="item flexrow" data-item-id="{{item._id}}">
<h4 class="item-name flex4 left">
<div class="item-image"><img src="{{item.img}}" title="{{item.name}}"/></div>
<a class="rollable" data-roll-type="alchemy">{{item.name}}</a>
</h4>
<div class="item-field flex1 center">
<span class="item-field">{{localize (concat "BOL.alchemyItem." item.data.properties.alchemytype)}}</span>
</div>
<div class="item-field flex1 center">
<span class="item-field">{{item.data.properties.difficulty}}</span>
</div>
<div class="item-field flex1 center">
<span class="item-field">{{item.data.properties.pccurrent}} / {{item.data.properties.pccost}}</span>
</div>
<div class="item-field flex1 center">
<a class="inc-dec-btns-alchemy"><i class="fas fa-plus-square"></i></a>
</div>
<div class="item-field flex1 right">
<a class="item-control item-edit" title="{{localize "BOL.ui.edit"}}"><i class="fas fa-square"></i></a>
<a class="item-control item-delete" title="{{localize "BOL.ui.delete"}}"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ol>
{{/if}}

View File

@ -24,6 +24,8 @@
<hr/>
<div class="resources flexrow">
{{#each resources as |resource id|}}
{{#if (eq resource.key "alchemypoints")}}
{{#if @root.isAlchemist}}
<div class="resource stat flex1 flex-group-center">
<label class="stat-label">{{localize label}}</label><br/>
<input class="stat-value" type="text" name="data.resources.{{key}}.value" value="{{numberFormat value decimals=0 sign=false}}" data-dtype="Number"/>
@ -34,5 +36,18 @@
{{/if}}
<input class="stat-max" type="text" name="data.resources.{{key}}.max" value="{{numberFormat max decimals=0 sign=false}}" data-dtype="Number"/>
</div>
{{/if}}
{{else}}
<div class="resource stat flex1 flex-group-center">
<label class="stat-label">{{localize label}}</label><br/>
<input class="stat-value" type="text" name="data.resources.{{key}}.value" value="{{numberFormat value decimals=0 sign=false}}" data-dtype="Number"/>
{{#if (eq @root.data.type 'player')}}
{{#if (exists bonus)}}
<span class="flexrow"><label class="stat-max">Bonus:</label><input class="stat-max" type="text" name="data.resources.{{key}}.bonus" value="{{numberFormat bonus decimals=0 sign=false}}" data-dtype="Number"/></span>
{{/if}}
{{/if}}
<input class="stat-max" type="text" name="data.resources.{{key}}.max" value="{{numberFormat max decimals=0 sign=false}}" data-dtype="Number"/>
</div>
{{/if}}
{{/each}}
</div>

View File

@ -0,0 +1,11 @@
<h4><strong>Préparation Alchimique : {{alchemy.name}}</strong></h4>
<h4><strong>Points de Création Investis : {{pcCostCurrent}}</strong></h4>
{{#if isSuccess}}
La préparation alchimique a été réalisée avec succès !
<br>Créez l'item ou l'effet correspondant dans votre Inventaire.
<br>L'avancement dans la préparation a été remis à 0.
{{else}}
La préparation alchimique a échouée !
<br>L'avancement dans la préparation a été remis à 0.
{{/if}}

View File

@ -1,5 +1,5 @@
<img class="chat-icon" src="{{weapon.img}}" alt="{{weapon.name}}"/>
<h3><strong>Dommages de {{weapon.name}} : {{damageRoll.total}}</strong>
<h3><strong>Dommages de {{weapon.name}} : {{damageRoll.total}}</strong></h3>
{{#if target}}
<div id="{{applyId}}">

View File

@ -20,6 +20,12 @@
{{#if (and isSuccess weapon)}}
{{> "systems/bol/templates/chat/rolls/attack-damage-card.hbs"}}
{{/if}}
{{#if (and isSuccess spell)}}
{{> "systems/bol/templates/chat/rolls/spell-roll-card.hbs"}}
{{/if}}
{{#if alchemy}}
{{> "systems/bol/templates/chat/rolls/alchemy-roll-card.hbs"}}
{{/if}}
{{#if reroll}}
<button class="chat-button button hero-reroll" data-roll-id=="{{rollId}}" data-actor-id="{{actor.id}}">Relancer (1 P. Heroisme)</button>

View File

@ -0,0 +1,4 @@
<h4><strong>Sort : {{spell.name}}</strong></h4>
<h4><strong>Cout en Points de Pouvoir : {{ppCost}}</strong></h4>
<h4><strong>Points de Pouvoir restants : {{sub ppCurrent ppCost}}</strong></h4>

View File

@ -0,0 +1,38 @@
<form class="{{cssClass}}" autocomplete="off">
{{!-- Sheet Header --}}
<header class="sheet-header">
<div class="row flexrow table-header">
<div class="flex1 center">
<h3>{{localize 'BOL.ui.makeAlchemy'}}</h3>
</div>
</div>
</header>
{{> "systems/bol/templates/dialogs/attribute-roll-part.hbs"}}
{{> "systems/bol/templates/dialogs/adv-roll-part.hbs"}}
{{> "systems/bol/templates/dialogs/mod-roll-part.hbs"}}
<div class="flexrow" style="margin-bottom: 1px;">
<div class="flex1 center bg-darkred">
<label for="mod">{{localize 'BOL.ui.alchemistRank'}}</label>
</div>
<div class="flex1 center cell">{{careerBonus}}</div>
</div>
<div class="flexrow" style="margin-bottom: 1px;">
<div class="flex1 center bg-darkred">
<label for="mod">{{localize 'BOL.ui.alchemyCostTotal'}}</label>
</div>
<div class="flex1 center cell" id="pccost">{{pcCost}}</div>
</div>
<div class="flexrow" style="margin-bottom: 1px;">
<div class="flex1 center bg-darkred">
<label for="mod">{{localize 'BOL.ui.alchemyCurrent'}}</label>
</div>
<div class="flex1 center cell" id="pccostcurrent">{{pcCostCurrent}}</div>
</div>
</form>

View File

@ -5,6 +5,7 @@
<div class="flex1 center cell">
<select name="mod" id="mod" value="{{mod}}">
{{#select mod}}
<option value="4">Inmanquable (+4)</option>
<option value="2">Trés Facile (+2)</option>
<option value="1">Facile (+1)</option>
<option value="0">Moyenne (0)</option>
@ -13,6 +14,8 @@
<option value="-4">Très Difficile (-4)</option>
<option value="-6">Impossible (-6)</option>
<option value="-8">Héroïque (-8)</option>
<option value="-10">Mythique (-10)</option>
<option value="-12">Divine (-12)</option>
{{/select}}
</select>
</div>

View File

@ -0,0 +1,66 @@
<form class="{{cssClass}}" autocomplete="off">
{{!-- Sheet Header --}}
<header class="sheet-header">
<div class="row flexrow table-header">
<div class="flex1 center">
<h3>{{localize 'BOL.ui.focusSpell'}}</h3>
</div>
</div>
</header>
{{> "systems/bol/templates/dialogs/attribute-roll-part.hbs"}}
{{> "systems/bol/templates/dialogs/adv-roll-part.hbs"}}
{{> "systems/bol/templates/dialogs/mod-roll-part.hbs"}}
<div class="flexrow" style="margin-bottom: 1px;">
<div class="flex1 center bg-darkred">
<label for="mod">{{localize 'BOL.ui.sorcererRank'}}</label>
</div>
<div class="flex1 center cell">{{careerBonus}}</div>
</div>
<div class="flexrow" style="margin-bottom: 1px;">
<div class="flex1 center bg-darkred">
<label for="mod">{{localize 'BOL.ui.ppcost'}}</label>
</div>
<div class="flex1 center cell" id="ppcost">{{ppCost}}</div>
</div>
<div class="flexrow" style="margin-bottom: 1px;">
<div class="flex1 center bg-darkred">
<label for="mod">{{localize 'BOL.ui.ppAvailable'}}</label>
</div>
<div class="flex1 center cell">{{ppCurrent}}</div>
</div>
<div class="flexrow" style="margin-bottom: 1px;">
<div class="flex1 center bg-darkred">
<label for="mod">{{localize 'BOL.ui.mandatoryconditions'}}</label>
</div>
<div class="flex1 center cell">
{{#each spell.data.data.properties.mandatoryconditions as | cond idx|}}
{{#if (lt idx @root.spell.data.data.properties.nbmandatoryconditions)}}
<label for="mod">{{cond}}</label>
{{/if}}
{{/each}}
</div>
</div>
<div class="flexrow" style="margin-bottom: 1px;">
<div class="flex1 center bg-darkred">
<label for="mod">{{localize 'BOL.ui.optionnalconditions'}}</label>
</div>
<div class="flex1 center cell">
<select class="flex1" name="optcond" id="optcond" data-type="String" multiple>
{{#each spell.data.data.properties.optionnalconditions as | cond idx|}}
{{#if (lt idx @root.spell.data.data.properties.nboptionnalconditions)}}
<option value="{{idx}}">{{cond}}</option>
{{/if}}
{{/each}}
</select>
</div>
</div>
</form>

View File

@ -3,3 +3,15 @@
<label class="property-label">{{localize "BOL.ui.rank"}}</label>
<input type="text" name="data.rank" value="{{data.rank}}" data-dtype="Number"/>
</div>
<div class="property flexrow">
<label class="property-label">{{localize "BOL.ui.isSorcerer"}}</label>
<input class="field-value" type="checkbox" name="data.properties.sorcerer" {{checked data.properties.sorcerer}}>
</div>
<div class="property flexrow">
<label class="property-label">{{localize "BOL.ui.isAlchemist"}}</label>
<input class="field-value" type="checkbox" name="data.properties.alchemist" {{checked data.properties.alchemist}}>
</div>
<div class="property flexrow">
<label class="property-label">{{localize "BOL.ui.isPriest"}}</label>
<input class="field-value" type="checkbox" name="data.properties.priest" {{checked data.properties.priest}}>
</div>

View File

@ -23,3 +23,6 @@
{{#if (eq data.category "spell")}}
{{> "systems/bol/templates/item/parts/properties/item/spell-properties.hbs"}}
{{/if}}
{{#if (eq data.category "alchemy")}}
{{> "systems/bol/templates/item/parts/properties/item/alchemy-properties.hbs"}}
{{/if}}

View File

@ -0,0 +1,39 @@
<h3 class="form-header">{{localize "BOL.ui.alchemyProperties"}}</h3>
<div class="property flexrow">
<label class="property-label">{{localize "BOL.ui.alchemyType"}}</label>
<select class="field-value" name="data.properties.alchemytype" data-dtype="String">
{{#select data.properties.alchemytype}}
{{#each config.alchemyType as |value id|}}
<option value="{{id}}">{{localize value}}</option>
{{/each}}
{{/select}}
</select>
</div>
<div class="property flexrow">
<label class="property-label">{{localize "BOL.ui.difficulty"}}</label>
<select name="data.properties.difficulty" value="{{data.properties.difficulty}}">
{{#select data.properties.difficulty}}
<option value="2">Trés Facile (+2)</option>
<option value="1">Facile (+1)</option>
<option value="0">Moyenne (0)</option>
<option value="-1">Ardue (-1)</option>
<option value="-2">Difficile (-2)</option>
<option value="-4">Très Difficile (-4)</option>
<option value="-6">Impossible (-6)</option>
<option value="-8">Héroïque (-8)</option>
{{/select}}
</select>
</div>
<div class="property flexrow">
<label class="property-label">{{localize "BOL.ui.pccost"}}</label>
<input class="field-value" type="text" name="data.properties.pccost" value="{{data.properties.pccost}}" data-dtype="Number"/>
</div>
<div class="property flexrow">
<label class="property-label">{{localize "BOL.ui.pcnow"}}</label>
<input class="field-value" type="text" name="data.properties.pccurrent" value="{{data.properties.pccurrent}}" data-dtype="Number"/>
</div>

View File

@ -1,27 +1,97 @@
<h3 class="form-header">{{localize "BOL.ui.spellProperties"}}</h3>
<div class="form-group">
<div class="form-fields center">
<div class="property flexrow">
<label class="property-label">{{localize "BOL.ui.circle"}}</label>
<select class="field-value" name="data.properties.circle" data-dtype="Number">
{{#select data.properties.circle}}
{{#each config.spellType as |value id|}}
<option value="{{id}}">{{localize value}}</option>
{{/each}}
{{/select}}
</select>
</div>
<div class="property flexrow">
<label class="property-label">{{localize "BOL.ui.difficulty"}}</label>
<input class="field-value" type="text" name="data.properties.difficulty" value="{{data.properties.difficulty}}" data-dtype="Number"/>
</div>
</div>
<select name="data.properties.difficulty" value="{{data.properties.difficulty}}">
{{#select data.properties.difficulty}}
<option value="2">Trés Facile (+2)</option>
<option value="1">Facile (+1)</option>
<option value="0">Moyenne (0)</option>
<option value="-1">Ardue (-1)</option>
<option value="-2">Difficile (-2)</option>
<option value="-4">Très Difficile (-4)</option>
<option value="-6">Impossible (-6)</option>
<option value="-8">Héroïque (-8)</option>
{{/select}}
</select>
</div>
<div class="form-group">
<div class="form-fields center">
<label class="property-label">{{localize "BOL.ui.duration"}}</label>
<input class="field-value" type="text" name="data.properties.duration" value="{{data.properties.duration}}" data-dtype="String"/>
</div>
</div>
<div class="property flexrow">
<label class="property-label">{{localize "BOL.ui.ppcost"}}</label>
<input class="field-value" type="text" name="data.properties.ppcost" value="{{data.properties.ppcost}}" data-dtype="Number"/>
</div>
<div class="form-group">
<div class="form-fields center">
<label class="checkbox">
<input class="field-value" type="checkbox" name="data.properties.spellkeep" {{checked data.properties.spellkeep}}> {{localize "BOL.ui.spellkeep"}}
</label>
</div>
<div class="property flexrow">
<label class="property-label">{{localize "BOL.ui.duration"}}</label>
<input class="field-value" type="text" name="data.properties.duration" value="{{data.properties.duration}}" data-dtype="String"/>
</div>
<div class="property flexrow">
<label class="property-label">{{localize "BOL.ui.mandatoryconditions"}}</label>
<select class="field-value" name="data.properties.nbmandatoryconditions" data-dtype="Number">
{{#select data.properties.nbmandatoryconditions}}
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
{{/select}}
</select>
</div>
{{#each data.properties.mandatoryconditions as |cond idx|}}
{{#if (lt idx @root.data.properties.nbmandatoryconditions)}}
<div class="property flexrow">
<label class="property-label">{{localize "BOL.ui.mandatoryconditions"}} {{add idx 1}}</label>
<input class="field-value" type="text" name="data.properties.mandatoryconditions.{{idx}}" value="{{cond}}" data-dtype="String"/>
</div>
{{/if}}
{{/each}}
<div class="property flexrow">
<label class="property-label">{{localize "BOL.ui.optionnalconditions"}}</label>
<select class="field-value" name="data.properties.nboptionnalconditions" data-dtype="Number">
{{#select data.properties.nboptionnalconditions}}
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
{{/select}}
</select>
</div>
{{#each data.properties.optionnalconditions as |cond idx|}}
{{#if (lt idx @root.data.properties.nboptionnalconditions)}}
<div class="property flexrow">
<label class="property-label">{{localize "BOL.ui.optionnalconditions"}} {{add idx 1}}</label>
<input class="field-value" type="text" name="data.properties.optionnalconditions.{{idx}}" value="{{cond}}" data-dtype="String"/>
</div>
{{/if}}
{{/each}}
<div class="property flexrow">
<div class="form-fields center">
<label class="checkbox">
<input class="field-value" type="checkbox" name="data.properties.concentrate" {{checked data.properties.concentrate}}> {{localize "BOL.ui.concentrate"}}
</label>
</div>
</div>
<label class="checkbox">
<input class="field-value" type="checkbox" name="data.properties.spellkeep" {{checked data.properties.spellkeep}}> {{localize "BOL.ui.spellkeep"}}
</label>
</div>
<div class="form-fields center">
<label class="checkbox">
<input class="field-value" type="checkbox" name="data.properties.concentrate" {{checked data.properties.concentrate}}> {{localize "BOL.ui.concentrate"}}
</label>
</div>
</div>