Gestion des maladies/poisons
This commit is contained in:
parent
21ad671ac7
commit
36be368dfd
@ -3382,6 +3382,8 @@ export class RdDActor extends Actor {
|
|||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
_setBlessure(blessure, encaissement) {
|
_setBlessure(blessure, encaissement) {
|
||||||
blessure.active = true;
|
blessure.active = true;
|
||||||
|
blessure.premiers_soins = -1;
|
||||||
|
blessure.soins_complets = -1;
|
||||||
blessure.loc = encaissement.locName;
|
blessure.loc = encaissement.locName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -229,12 +229,13 @@ export class RdDItem extends Item {
|
|||||||
ChatMessage.create(RdDUtility.chatDataSetup(html));
|
ChatMessage.create(RdDUtility.chatDataSetup(html));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------------- */
|
||||||
getProprietes() {
|
getProprietes() {
|
||||||
return this[`_${Misc.data(this).type}ChatData`]();
|
return this[`_${Misc.data(this).type}ChatData`]();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async postItem() {
|
async postItem( modeOverride ) {
|
||||||
console.log(this);
|
console.log(this);
|
||||||
let chatData = duplicate(Misc.data(this));
|
let chatData = duplicate(Misc.data(this));
|
||||||
const properties = this.getProprietes();
|
const properties = this.getProprietes();
|
||||||
@ -317,7 +318,7 @@ export class RdDItem extends Item {
|
|||||||
});
|
});
|
||||||
|
|
||||||
renderTemplate('systems/foundryvtt-reve-de-dragon/templates/post-item.html', chatData).then(html => {
|
renderTemplate('systems/foundryvtt-reve-de-dragon/templates/post-item.html', chatData).then(html => {
|
||||||
let chatOptions = RdDUtility.chatDataSetup(html);
|
let chatOptions = RdDUtility.chatDataSetup(html, modeOverride);
|
||||||
ChatMessage.create(chatOptions)
|
ChatMessage.create(chatOptions)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -558,5 +559,43 @@ export class RdDItem extends Item {
|
|||||||
]
|
]
|
||||||
return properties;
|
return properties;
|
||||||
}
|
}
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
_maladieChatData() {
|
||||||
|
const tplData = Misc.templateData(this);
|
||||||
|
let properties
|
||||||
|
if (tplData.identifie) {
|
||||||
|
properties = [
|
||||||
|
`<b>Malignité</b>: ${tplData.malignite}`,
|
||||||
|
`<b>Périodicité</b>: ${tplData.periodicite}`,
|
||||||
|
`<b>Dommages</b>: ${tplData.dommages}`
|
||||||
|
]
|
||||||
|
if (tplData.remedesconnus) {
|
||||||
|
properties.push(`<b>Remedes</b>: ${tplData.remedes}` )
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
properties = [
|
||||||
|
`<b>Inconnue</b>` ]
|
||||||
|
}
|
||||||
|
return properties;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
_poisonChatData() {
|
||||||
|
return this._maladieChatData();
|
||||||
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
_gemmeChatData() {
|
||||||
|
const tplData = Misc.templateData(this);
|
||||||
|
let properties = [
|
||||||
|
`<b>Pureté</b>: ${tplData.purete}`,
|
||||||
|
`<b>Taille</b>: ${tplData.taille}`,
|
||||||
|
`<b>Inertie</b>: ${tplData.inertie}`,
|
||||||
|
`<b>Enchantabilité</b>: ${tplData.enchantabilite}`,
|
||||||
|
`<b>Prix</b>: ${tplData.cout}`,
|
||||||
|
]
|
||||||
|
return properties;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -227,7 +227,13 @@ export class RdDCalendrier extends Application {
|
|||||||
if (actor.type == 'personnage') {
|
if (actor.type == 'personnage') {
|
||||||
let maladies = actor.filterItems( item => (item.type == 'maladie' || item.type == 'poison') && item.data.periodicite.toLowerCase().includes(periode) );
|
let maladies = actor.filterItems( item => (item.type == 'maladie' || item.type == 'poison') && item.data.periodicite.toLowerCase().includes(periode) );
|
||||||
for (let maladie of maladies) {
|
for (let maladie of maladies) {
|
||||||
ChatMessage.create({ content: `${actor.name} souffre de ${maladie.name} (${maladie.type}): vérifiez que les effets ne se sont pas aggravés !` });
|
if ( maladie.data.identifie) {
|
||||||
|
ChatMessage.create({ content: `${actor.name} souffre de ${maladie.name} (${maladie.type}): vérifiez que les effets ne se sont pas aggravés !` });
|
||||||
|
} else {
|
||||||
|
ChatMessage.create({ content: `${actor.name} souffre d'un mal inconnu (${maladie.type}): vérifiez que les effets ne se sont pas aggravés !` });
|
||||||
|
}
|
||||||
|
let itemMaladie = actor.getObjet(maladie.id)
|
||||||
|
itemMaladie.postItem( 'gmroll');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
"name": "foundryvtt-reve-de-dragon",
|
"name": "foundryvtt-reve-de-dragon",
|
||||||
"title": "Rêve de Dragon",
|
"title": "Rêve de Dragon",
|
||||||
"description": "Rêve de Dragon RPG for FoundryVTT",
|
"description": "Rêve de Dragon RPG for FoundryVTT",
|
||||||
"version": "1.5.16",
|
"version": "1.5.17",
|
||||||
"manifestPlusVersion": "1.0.0",
|
"manifestPlusVersion": "1.0.0",
|
||||||
"minimumCoreVersion": "0.8.0",
|
"minimumCoreVersion": "0.8.0",
|
||||||
"compatibleCoreVersion": "0.8.9",
|
"compatibleCoreVersion": "0.8.9",
|
||||||
|
@ -2,12 +2,21 @@
|
|||||||
<header class="sheet-header">
|
<header class="sheet-header">
|
||||||
<img class="profile-img" src="{{img}}" data-edit="img" title="{{name}}"/>
|
<img class="profile-img" src="{{img}}" data-edit="img" title="{{name}}"/>
|
||||||
<div class="header-fields">
|
<div class="header-fields">
|
||||||
|
{{#if (or isGM data.identifie)}}
|
||||||
<h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name"/></h1>
|
<h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name"/></h1>
|
||||||
</div>
|
{{else}}
|
||||||
|
<h1 class="charname">Inconnue</h1>
|
||||||
|
{{/if}}
|
||||||
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
{{!-- Sheet Body --}}
|
{{!-- Sheet Body --}}
|
||||||
<section class="sheet-body">
|
<section class="sheet-body">
|
||||||
|
{{#if (or isGM data.identifie)}}
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="xp">Identifiée ? </label>
|
||||||
|
<input class="attribute-value" type="checkbox" name="data.identifie" {{#if data.identifie}}checked{{/if}}/>
|
||||||
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="xp">Malignité </label>
|
<label for="xp">Malignité </label>
|
||||||
<input class="attribute-value" type="text" name="data.malignite" value="{{data.malignite}}" data-dtype="Number"/>
|
<input class="attribute-value" type="text" name="data.malignite" value="{{data.malignite}}" data-dtype="Number"/>
|
||||||
@ -20,10 +29,17 @@
|
|||||||
<label for="xp">Dommages</label>
|
<label for="xp">Dommages</label>
|
||||||
<input class="attribute-value" type="text" name="data.dommages" value="{{data.dommages}}" data-dtype="String"/>
|
<input class="attribute-value" type="text" name="data.dommages" value="{{data.dommages}}" data-dtype="String"/>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="xp">Remedes Connus ? </label>
|
||||||
|
<input class="attribute-value" type="checkbox" name="data.remedesconnus" {{#if data.remedesconnus}}checked{{/if}}/>
|
||||||
|
</div>
|
||||||
|
{{#if (or isGM data.remedesconnus)}}
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="xp">Remèdes </label>
|
<label for="xp">Remèdes </label>
|
||||||
<input class="attribute-value" type="text" name="data.remedes" value="{{data.remedes}}" data-dtype="String"/>
|
<input class="attribute-value" type="text" name="data.remedes" value="{{data.remedes}}" data-dtype="String"/>
|
||||||
</div>
|
</div>
|
||||||
|
{{/if}}
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}}
|
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}}
|
||||||
|
|
||||||
|
@ -1,32 +1,48 @@
|
|||||||
<form class="{{cssClass}}" autocomplete="off">
|
<form class="{{cssClass}}" autocomplete="off">
|
||||||
<header class="sheet-header">
|
<header class="sheet-header">
|
||||||
<img class="profile-img" src="{{img}}" data-edit="img" title="{{name}}"/>
|
<img class="profile-img" src="{{img}}" data-edit="img" title="{{name}}"/>
|
||||||
<div class="header-fields">
|
<div class="header-fields">
|
||||||
<h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name"/></h1>
|
{{#if (or isGM data.identifie)}}
|
||||||
|
<h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name"/></h1>
|
||||||
|
{{else}}
|
||||||
|
<h1 class="charname">Inconnue</h1>
|
||||||
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
{{!-- Sheet Body --}}
|
{{!-- Sheet Body --}}
|
||||||
<section class="sheet-body">
|
<section class="sheet-body">
|
||||||
<div class="form-group">
|
{{#if (or isGM data.identifie)}}
|
||||||
<label for="xp">Malignité </label>
|
<div class="form-group">
|
||||||
<input class="attribute-value" type="text" name="data.malignite" value="{{data.malignite}}" data-dtype="Number"/>
|
<label for="xp">Identifiée ? </label>
|
||||||
</div>
|
<input class="attribute-value" type="checkbox" name="data.identifie" {{#if data.identifie}}checked{{/if}}/>
|
||||||
<div class="form-group">
|
</div>
|
||||||
<label for="xp">Périodicité</label>
|
<div class="form-group">
|
||||||
<input class="attribute-value" type="text" name="data.periodicite" value="{{data.periodicite}}" data-dtype="String"/>
|
<label for="xp">Malignité </label>
|
||||||
</div>
|
<input class="attribute-value" type="text" name="data.malignite" value="{{data.malignite}}" data-dtype="Number"/>
|
||||||
<div class="form-group">
|
</div>
|
||||||
<label for="xp">Dommages</label>
|
<div class="form-group">
|
||||||
<input class="attribute-value" type="text" name="data.dommages" value="{{data.dommages}}" data-dtype="String"/>
|
<label for="xp">Périodicité</label>
|
||||||
</div>
|
<input class="attribute-value" type="text" name="data.periodicite" value="{{data.periodicite}}" data-dtype="String"/>
|
||||||
<div class="form-group">
|
</div>
|
||||||
<label for="xp">Remèdes </label>
|
<div class="form-group">
|
||||||
<input class="attribute-value" type="text" name="data.remedes" value="{{data.remedes}}" data-dtype="String"/>
|
<label for="xp">Dommages</label>
|
||||||
</div>
|
<input class="attribute-value" type="text" name="data.dommages" value="{{data.dommages}}" data-dtype="String"/>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="xp">Remedes Connus ? </label>
|
||||||
|
<input class="attribute-value" type="checkbox" name="data.remedesconnus" {{#if data.remedesconnus}}checked{{/if}}/>
|
||||||
|
</div>
|
||||||
|
{{#if (or isGM data.remedesconnus)}}
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="xp">Remèdes </label>
|
||||||
|
<input class="attribute-value" type="text" name="data.remedes" value="{{data.remedes}}" data-dtype="String"/>
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}}
|
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}}
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
Loading…
Reference in New Issue
Block a user