Merge branch 'master-blessures' into 'master'

Amélioration des blessures #173

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!216
This commit is contained in:
Leratier Bretonnien 2021-04-28 07:42:18 +00:00
commit b7c816129b
8 changed files with 131 additions and 194 deletions

View File

@ -116,6 +116,13 @@ export class Misc {
return Misc.data(it)?.data ?? {}
}
static connectedGMOrUser(ownerId = undefined) {
if (ownerId && game.user.id == ownerId){
return ownerId;
}
return (game.user.isGM ? game.user.id : game.users.entities.find(u => u.isGM && u.active)?.id) ?? game.user.id;
}
static isElectedUser() {
return game.user.id == Misc.connectedGMOrUser();
}

View File

@ -101,6 +101,8 @@ export class RdDUtility {
'systems/foundryvtt-reve-de-dragon/templates/actor-entite-sheet.html',
'systems/foundryvtt-reve-de-dragon/templates/actor-vehicule-sheet.html',
'systems/foundryvtt-reve-de-dragon/templates/actor-sheet-competence-partial.html',
'systems/foundryvtt-reve-de-dragon/templates/actor-liste-blessures-partial.html',
'systems/foundryvtt-reve-de-dragon/templates/actor-blessure-partial.html',
//Items
'systems/foundryvtt-reve-de-dragon/templates/item-competence-sheet.html',
'systems/foundryvtt-reve-de-dragon/templates/item-competencecreature-sheet.html',

View File

@ -365,6 +365,20 @@ table {border: 1px solid #7a7971;}
border-bottom: 1px solid #BBB;
}
.blessure-inactive{
color:rgba(150, 150, 150, 0.4)
}
.blessure-active-legere{
color:rgba(60, 60, 60, 0.9);
text-shadow: rgba(60, 60, 60, 0.7);
}
.blessure-active-grave{
color:rgba(218, 126, 21, 0.9);
}
.blessure-active-critique{
color:rgba(173, 36, 26, 0.9);
}
.foundryvtt-reve-de-dragon .items-list .item .item-image {
-webkit-box-flex: 0;
-ms-flex: 0 0 24px;
@ -627,6 +641,23 @@ ul, li {
padding: 0.125rem;
flex: 1 1 5rem;
}
.table-row {
margin: 0.125rem;
padding: 0.125rem;
flex: 1 1 5rem;
}
.alterne-row > .row-item:hover {
background: rgba(100, 100, 50, 0.25);
}
.alterne-row > .row-item:nth-child(even) {
background: rgba(80, 60, 0, 0.10);
}
.alterne-row > .row-item:nth-child(odd) {
background: rgb(160, 130, 100, 0.05);
}
.item-display-show {
display: block;
}

View File

@ -0,0 +1,24 @@
<tr class="table-row alterne-row item" data-blessure-type="{{gravite}}" data-attribute={{key}} data-blessure-index="{{key}}" >
<td class="item-control blessure-control" title="Blessure {{title}}" data-blessure-active="{{bless.active}}">
{{#if bless.active}}
<i class="fas fa-skull-crossbones blessure-active-{{gravite}}"></i>
{{!-- <i class="fas fa-first-aid"></i> --}}
{{!-- <i class="fas fa-plus-square"></i> --}}
{{else}}
{{!-- <i class="fas fa-genderless"></i> --}}
<i class="fas fa-skull-crossbones blessure-inactive"></i>
{{/if}}
</td>
<td>
<input class="blessures-soins" type="text" name='localisation' data-dtype="String" value="{{bless.loc}}"/>
</td>
<td>
<input class="blessures-soins" type="text" name='premiers_soins' data-dtype="number" value="{{bless.premiers_soins}}"/>
</td>
<td>
<input class="blessures-soins" type="text" name='soins_complets' data-dtype="number" value="{{bless.soins_complets}}"/>
</td>
<td>
<input class="blessures-soins" type="text" name='jours' data-dtype="number" value="{{bless.jours}}"/>
</td>
</tr>

View File

@ -139,62 +139,8 @@
{{!-- blessures Tab --}}
<div class="tab blessures" data-group="primary" data-tab="blessures" style="height:200px">
<span class="blessures-title">Blessures Légeres :</span>
<div class="blessure-data alterne-list">
{{#each data.blessures.legeres.liste as |bless key|}}
<li class="item flexrow blessure-data list-item" data-blessure-type="legere" data-attribute={{key}}
data-blessure-index="{{key}}">
<a class="item-control blessure-control" title="Blessure Légère"
data-blessure-active="{{bless.active}}">{{#if bless.active}}<i class="fas fa-circle"></i>{{else}}<i
class="fas fa-genderless"></i>{{/if}}</a>
Premiers soins <input class="blessures-soins" type="text" name='premiers_soins' data-dtype="number"
value="{{this.premiers_soins}}" /> -
Soins complets <input class="blessures-soins" type="text" name='soins_complets' data-dtype="number"
value="{{this.soins_complets}}" /> -
Jours <input class="blessures-soins" type="text" name='jours' data-dtype="number" value="{{this.jours}}" />
-
Loc. <input class="blessures-soins" type="text" name='localisation' data-dtype="String"
value="{{this.loc}}" />
</li>
{{/each}}
</div>
<span class="blessures-title">Blessures Graves :</span>
<div class="blessure-data alterne-list">
{{#each data.blessures.graves.liste as |bless key|}}
<li class="item flexrow list-item" data-blessure-type="grave" data-attribute={{key}} data-blessure-index="{{key}}">
<a class="item-control blessure-control" title="Blessure Grave"
data-blessure-active="{{bless.active}}">{{#if bless.active}}<i class="fas fa-circle"></i>{{else}}<i
class="fas fa-genderless"></i>{{/if}}</a>
Premiers soins <input class="blessures-soins" type="text" name="premiers_soins" data-dtype="number"
value="{{bless.premiers_soins}}" /> -
Soins complets <input class="blessures-soins" type="text" name="soins_complets" data-dtype="number"
value="{{bless.soins_complets}}" /> -
Jours <input class="blessures-soins" type="text" name="jours" data-dtype="number" value="{{bless.jours}}" />
-
Loc. <input class="blessures-soins" type="text" name="localisation" data-dtype="String"
value="{{bless.loc}}" />
</li>
{{/each}}
</div>
<span class="blessures-title">Blessure Critique :</span>
<div class="blessure-data alterne-list">
{{#each data.blessures.critiques.liste as |bless key|}}
<li class="item flexrow list-item" data-blessure-type="critique" data-attribute={{key}} data-blessure-index="{{key}}">
<a class="item-control blessure-control" title="Blessure Critique"
data-blessure-active="{{bless.active}}">{{#if bless.active}}<i class="fas fa-circle"></i>{{else}}<i
class="fas fa-genderless"></i>{{/if}}</a>
Premiers soins <input class="blessures-soins" type="text" name="premiers_soins" data-dtype="number"
value="{{bless.premiers_soins}}" /> -
Soins complets <input class="blessures-soins" type="text" name="soins_complets" data-dtype="number"
value="{{bless.soins_complets}}" /> -
Jours <input class="blessures-soins" type="text" name="jours" data-dtype="number" value="{{bless.jours}}" />
-
Loc. <input class="blessures-soins" type="text" name="localisation" data-dtype="String"
value="{{bless.loc}}" />
</li>
</li>
{{/each}}
</div>
{{!-- Liste de blessures --}}
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-liste-blessures-partial.html" this}}
</div>
{{!-- Equipment Tab --}}

View File

@ -0,0 +1,26 @@
<h3>Blessures:</h3>
<table class="table-container" role="table">
<thead>
<tr class="competence-header competence-title competence-label" >
<th></th>
<th>Localisation</th>
<th>Premiers soins</th>
<th>Soins complets</th>
<th>Age (jours)</th>
</tr>
</thead>
<tbody>
<tr class="table-row alterne-row" ><td/><td colspan="4">Légères</td></tr>
{{#each data.blessures.legeres.liste as |bless key|}}
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-blessure-partial.html" bless=bless key=key gravite="legere" title="Légère"}}
{{/each}}
<tr class="table-row alterne-row"><td/><td colspan="4">Graves</td></tr>
{{#each data.blessures.graves.liste as |bless key|}}
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-blessure-partial.html" bless=bless key=key gravite="grave" title="Grave"}}
{{/each}}
<tr class="table-row alterne-row"><td/><td colspan="4">Critiques</td></tr>
{{#each data.blessures.critiques.liste as |bless key|}}
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-blessure-partial.html" bless=bless key=key gravite="critique" title="Critique"}}
{{/each}}
</tbody>
</table>

View File

@ -365,107 +365,8 @@
</li>
</ul>
<hr>
{{!-- Liste de blessures --}}
<h3 class="blessures-title">Blessures:</h3>
<div class="flex-group-left flexcol competence-column">
<h4 class="blessures-title">Légères:</h4>
<ul class="blessure-data flexrow alterne-list blessures-list">
{{#each data.blessures.legeres.liste as |bless key|}}
<li class="item flexrow blessure-data list-item" data-blessure-type="legere" data-attribute={{key}} data-blessure-index="{{key}}">
<ul>
<li class="item-control blessure-control" title="Blessure Légère" data-blessure-active="{{bless.active}}">
{{#if bless.active}}
<i class="fas fa-circle"></i>
{{else}}
<i class="fas fa-genderless"></i>
{{/if}}
</li>
<li>
Premiers soins
<input class="blessures-soins" type="text" name='premiers_soins' data-dtype="number" value="{{bless.premiers_soins}}"/>
</li>
<li>
Soins complets
<input class="blessures-soins" type="text" name='soins_complets' data-dtype="number" value="{{bless.soins_complets}}"/>
</li>
<li>
Jours
<input class="blessures-soins" type="text" name='jours' data-dtype="number" value="{{bless.jours}}"/>
</li>
<li>
Loc.
<input class="blessures-soins" type="text" name='localisation' data-dtype="String" value="{{bless.loc}}"/>
</li>
</ul>
</li>
{{/each}}
</ul>
<h4 class="blessures-title">Graves :</h4>
<ul class="flexrow alterne-list blessures-list">
{{#each data.blessures.graves.liste as |bless key|}}
<li class="item flexrow list-item" data-blessure-type="grave" data-attribute={{key}} data-blessure-index="{{key}}" >
<ul>
<li class="item-control blessure-control" title="Blessure Grave" data-blessure-active="{{bless.active}}">
{{#if bless.active}}
<i class="fas fa-circle"></i>
{{else}}
<i class="fas fa-genderless"></i>
{{/if}}
</li>
<li>
Premiers soins
<input class="blessures-soins" type="text" name='premiers_soins' data-dtype="number" value="{{bless.premiers_soins}}"/>
</li>
<li>
Soins complets
<input class="blessures-soins" type="text" name='soins_complets' data-dtype="number" value="{{bless.soins_complets}}"/>
</li>
<li>
Jours
<input class="blessures-soins" type="text" name='jours' data-dtype="number" value="{{bless.jours}}"/>
</li>
<li>
Loc.
<input class="blessures-soins" type="text" name='localisation' data-dtype="String" value="{{bless.loc}}"/>
</li>
</ul>
</li>
{{/each}}
</ul>
<h4 class="blessures-title">Critique :</h4>
<ul class="flexrow alterne-list blessures-list">
{{#each data.blessures.critiques.liste as |bless key|}}
<li class="item list-item flexrow" data-blessure-type="critique" data-attribute={{key}} data-blessure-index="{{key}}" >
<ul>
<li class="flex-group-center item-control blessure-control" title="Blessure Critique" data-blessure-active="{{bless.active}}">
{{#if bless.active}}
<i class="fas fa-circle"></i>
{{else}}
<i class="fas fa-genderless"></i>
{{/if}}
</li>
<li>
Premiers soins
<input class="blessures-soins" type="text" name='premiers_soins' data-dtype="number" value="{{bless.premiers_soins}}"/>
</li>
<li>
Soins complets
<input class="blessures-soins" type="text" name='soins_complets' data-dtype="number" value="{{bless.soins_complets}}"/>
</li>
<li>
Jours
<input class="blessures-soins" type="text" name='jours' data-dtype="number" value="{{bless.jours}}"/>
</li>
<li>
Loc.
<input class="blessures-soins" type="text" name='localisation' data-dtype="String" value="{{bless.loc}}"/>
</li>
</ul>
</li>
{{/each}}
</ul>
</div>
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-liste-blessures-partial.html" this}}
</div>
{{!-- Connaissances Tab --}}

View File

@ -16,7 +16,7 @@
</span>
</h4>
<div>
Je d'encaissement de {{roll.total}}
Jet d'encaissement de {{roll.total}}
{{#unless (eq armure 0)}}, l'armure a protègé de {{armure}} {{#unless (eq penetration 0)}}(pénétration de {{penetration}})
{{/unless}}
{{/unless}}, total: <span class="rdd-roll-echec">{{total}}</span>