Compare commits
11 Commits
foundryvtt
...
foundryvtt
Author | SHA1 | Date | |
---|---|---|---|
928a60f092 | |||
e5c2f52b0e | |||
f9391523f8 | |||
55434762f4 | |||
5e6ffc7846 | |||
3344e20936 | |||
5a66e4e741 | |||
d329724d63 | |||
8a5405c9f5 | |||
ea992aae46 | |||
0bfcfec58f |
@ -26,7 +26,7 @@ import { DialogConsommer } from "./dialog-item-consommer.js";
|
||||
import { DialogFabriquerPotion } from "./dialog-fabriquer-potion.js";
|
||||
import { RollDataAjustements } from "./rolldata-ajustements.js";
|
||||
import { RdDPossession } from "./rdd-possession.js";
|
||||
import { ENTITE_INCARNE, ENTITE_NONINCARNE, SHOW_DICE, SYSTEM_RDD, SYSTEM_SOCKET_ID } from "./constants.js";
|
||||
import { ENTITE_INCARNE, ENTITE_NONINCARNE, SHOW_DICE, SYSTEM_RDD, SYSTEM_SOCKET_ID } from "./constants.js";
|
||||
import { RdDConfirm } from "./rdd-confirm.js";
|
||||
import { DialogValidationEncaissement } from "./dialog-validation-encaissement.js";
|
||||
import { RdDRencontre } from "./item/rencontre.js";
|
||||
@ -521,16 +521,17 @@ export class RdDActor extends RdDBaseActor {
|
||||
/* -------------------------------------------- */
|
||||
async _recuperationBlessures(message, isMaladeEmpoisonne) {
|
||||
const timestamp = game.system.rdd.calendrier.getTimestamp()
|
||||
const blessures = this.filterItems(it => it.gravite > 0, 'blessure').sort(Misc.ascending(it => it.system.gravite))
|
||||
const blessures = this.filterItems(it => it.system.gravite > 0, 'blessure').sort(Misc.ascending(it => it.system.gravite))
|
||||
|
||||
Promise.all(blessures.map(b => b.recuperationBlessure({
|
||||
await Promise.all(blessures.map(b => b.recuperationBlessure({
|
||||
actor: this,
|
||||
timestamp,
|
||||
message,
|
||||
isMaladeEmpoisonne,
|
||||
blessures
|
||||
})));
|
||||
await this.supprimerBlessures(filterToDelete);
|
||||
|
||||
await this.supprimerBlessures(it => it.system.gravite <= 0);
|
||||
}
|
||||
|
||||
async supprimerBlessures(filterToDelete) {
|
||||
@ -548,7 +549,7 @@ export class RdDActor extends RdDBaseActor {
|
||||
}
|
||||
let vieManquante = tData.sante.vie.max - tData.sante.vie.value;
|
||||
if (vieManquante > 0) {
|
||||
let rolled = await this.jetRecuperationConstitution(bonusSoins, message)
|
||||
let rolled = await this.jetRecuperationConstitution(0, message)
|
||||
if (!isMaladeEmpoisonne && rolled.isSuccess) {
|
||||
const gain = Math.min(rolled.isPart ? 2 : 1, vieManquante);
|
||||
message.content += " -- récupération de vie: " + gain;
|
||||
@ -566,7 +567,7 @@ export class RdDActor extends RdDBaseActor {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async jetRecuperationConstitution(bonusSoins, message = undefined) {
|
||||
let difficulte = Misc.toInt(bonusSoins) + Math.min(0, this.system.sante.vie.value - this.system.sante.vie.max);
|
||||
let difficulte = Math.min(0, this.system.sante.vie.value - this.system.sante.vie.max) + bonusSoins + this.system.sante.bonusPotion;
|
||||
let rolled = await RdDResolutionTable.roll(this.system.carac.constitution.value, difficulte);
|
||||
if (message) {
|
||||
message.content = await renderTemplate("systems/foundryvtt-reve-de-dragon/templates/roll/explain.hbs", {
|
||||
@ -1532,7 +1533,7 @@ export class RdDActor extends RdDBaseActor {
|
||||
_computeEnduranceMax() {
|
||||
const diffVie = this.system.sante.vie.max - this.system.sante.vie.value;
|
||||
const maxEndVie = this.system.sante.endurance.max - (diffVie * 2);
|
||||
const nbGraves = this.countBlessures(it => it.isGraves()) > 0
|
||||
const nbGraves = this.countBlessures(it => it.isGrave()) > 0
|
||||
const nbCritiques = this.countBlessures(it => it.isCritique()) > 0
|
||||
const maxEndGraves = Math.floor(this.system.sante.endurance.max / (2 * nbGraves));
|
||||
const maxEndCritiques = nbCritiques > 0 ? 1 : this.system.sante.endurance.max;
|
||||
@ -2204,12 +2205,13 @@ export class RdDActor extends RdDBaseActor {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async rollCarac(caracName, jetResistance = undefined) {
|
||||
let selectedCarac = this.getCaracByName(caracName)
|
||||
await this._openRollDialog({
|
||||
name: 'jet-' + caracName,
|
||||
label: 'Jet ' + Grammar.apostrophe('de', rollData.selectedCarac.label),
|
||||
label: 'Jet ' + Grammar.apostrophe('de', selectedCarac.label),
|
||||
template: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-carac.html',
|
||||
rollData: {
|
||||
selectedCarac: this.getCaracByName(caracName),
|
||||
selectedCarac: selectedCarac,
|
||||
competences: this.itemTypes['competence'],
|
||||
jetResistance: jetResistance ? caracName : undefined
|
||||
},
|
||||
@ -3526,7 +3528,7 @@ export class RdDActor extends RdDBaseActor {
|
||||
/* -------------------------------------------- */
|
||||
async buildPotionGuerisonList(pointsGuerison) {
|
||||
const pointsGuerisonInitial = pointsGuerison;
|
||||
const blessures = this.filterItems(it => it.isLegere() || it.isGrave() || it.isCritique()).sort(Misc.descending(it => it.system.gravite))
|
||||
const blessures = this.filterItems(it => it.system.gravite > 0, 'blessure').sort(Misc.descending(it => it.system.gravite))
|
||||
const ids = []
|
||||
const guerisonData = { list: [], pointsConsommes: 0 }
|
||||
for (let blessure of blessures) {
|
||||
@ -3565,7 +3567,7 @@ export class RdDActor extends RdDBaseActor {
|
||||
}
|
||||
}
|
||||
if (!potionData.system.magique || potionData.rolled.isSuccess) {
|
||||
await this.setBonusPotionSoin(potionData.system.herbeBonus);
|
||||
await this.setBonusPotionSoin(potionData.system.herbebonus);
|
||||
}
|
||||
ChatMessage.create({
|
||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(this.name),
|
||||
@ -3574,7 +3576,7 @@ export class RdDActor extends RdDBaseActor {
|
||||
}
|
||||
|
||||
async setBonusPotionSoin(bonus) {
|
||||
await this.update({ 'sante.bonusPotion': bonus });
|
||||
await this.update({ 'system.sante.bonusPotion': bonus });
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -3602,7 +3604,7 @@ export class RdDActor extends RdDBaseActor {
|
||||
}
|
||||
}
|
||||
if (!potionData.system.magique || potionData.rolled.isSuccess) {
|
||||
this.bonusRepos = potionData.system.herbeBonus;
|
||||
this.bonusRepos = potionData.system.herbebonus;
|
||||
}
|
||||
ChatMessage.create({
|
||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(this.name),
|
||||
|
@ -89,30 +89,34 @@ export class RdDItemBlessure extends RdDItem {
|
||||
|
||||
async recuperationBlessure({ actor, timestamp, message, isMaladeEmpoisonne, blessures }) {
|
||||
if (this.parent != actor || actor == undefined) {
|
||||
return;
|
||||
return
|
||||
}
|
||||
if (new RdDTimestamp(this.system.fin).isAfterIndexDate(timestamp)) {
|
||||
if (new RdDTimestamp(this.system.temporel.fin).compare(timestamp) > 0) {
|
||||
// attente periode
|
||||
return
|
||||
}
|
||||
if (this.system.gravite > 0) {
|
||||
const update = { premierssoins: { bonus: 0 }, soinscomplets: { bonus: 0 } }
|
||||
const update = { system: { premierssoins: { bonus: 0 }, soinscomplets: { bonus: 0 } } }
|
||||
const gravite = this.system.gravite;
|
||||
const graviteMoindre = gravite - 2;
|
||||
const moindres = blessures.filter(it => it.system.gravite == graviteMoindre, 'blessures').length
|
||||
const labelGravite = RdDItemBlessure.getLabelGravite(gravite);
|
||||
const labelGravite = this.getLabelGravite();
|
||||
|
||||
let rolled = await actor.jetRecuperationConstitution(Misc.toInt(this.system.soinscomplets.bonus) + actor.system.sante.bonusPotion, message);
|
||||
let rolled = await actor.jetRecuperationConstitution(this.system.soinscomplets.bonus, message);
|
||||
|
||||
if (rolled.isETotal) {
|
||||
message.content += ` -- une blessure ${labelGravite} s'infecte (temps de guérison augmenté de ${definition.facteur} jours, perte de vie)`;
|
||||
mergeObject(update, { fin: { indexDate: timestamp.addJours(gravite).indexDate } });
|
||||
message.content += ` -- une blessure ${labelGravite} s'infecte (temps de guérison augmenté de ${gravite} jours, perte de vie)`;
|
||||
await actor.santeIncDec("vie", -1);
|
||||
mergeObject(update, {
|
||||
system: { fin: { indexDate: timestamp.addJours(gravite).indexDate } }
|
||||
});
|
||||
}
|
||||
else {
|
||||
if (!isMaladeEmpoisonne && rolled.isSuccess && this.peutRetrograder(graviteMoindre, moindres)) {
|
||||
message.content += ` -- une blessure ${labelGravite} cicatrise`;
|
||||
mergeObject(update, { gravite: graviteMoindre, fin: { indexDate: timestamp.addJours(graviteMoindre).indexDate } });
|
||||
mergeObject(update, {
|
||||
system: { gravite: graviteMoindre, fin: { indexDate: timestamp.addJours(graviteMoindre).indexDate } }
|
||||
});
|
||||
}
|
||||
else {
|
||||
message.content += ` -- une blessure ${labelGravite} reste stable`;
|
||||
|
@ -1295,7 +1295,7 @@ export class RdDCombat {
|
||||
blessuresStatus: actor.computeResumeBlessure(),
|
||||
SConst: actor.getSConst(),
|
||||
actorId: actor.id,
|
||||
isGrave: actor.countBlessures(it => it.isGraves()) > 0,
|
||||
isGrave: actor.countBlessures(it => it.isGrave()) > 0,
|
||||
isCritique: actor.countBlessures(it => it.isCritique()) > 0
|
||||
}
|
||||
|
||||
|
@ -252,7 +252,7 @@ export class RdDTimestamp {
|
||||
get heure() { return Math.floor(this.indexMinute / RDD_MINUTES_PAR_HEURES) }
|
||||
get minute() { return this.indexMinute % RDD_MINUTES_PAR_HEURES }
|
||||
get round() { return ROUNDS_PAR_MINUTE * (this.indexMinute - Math.floor(this.indexMinute)) }
|
||||
get angleHeure() { return this.indexMinute / RDD_MINUTES_PAR_JOUR * 360 - 60 }
|
||||
get angleHeure() { return this.indexMinute / RDD_MINUTES_PAR_JOUR * 360 - 45 }
|
||||
get angleMinute() { return this.indexMinute / RDD_MINUTES_PAR_HEURES * 360 + 45}
|
||||
|
||||
formatDate() {
|
||||
|
@ -1,8 +1,8 @@
|
||||
{
|
||||
"id": "foundryvtt-reve-de-dragon",
|
||||
"title": "Rêve de Dragon",
|
||||
"version": "10.7.0",
|
||||
"download": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/archive/foundryvtt-reve-de-dragon-10.7.0.zip",
|
||||
"version": "10.7.3",
|
||||
"download": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/archive/foundryvtt-reve-de-dragon-10.7.3.zip",
|
||||
"manifest": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/raw/v10/system.json",
|
||||
"compatibility": {
|
||||
"minimum": "10",
|
||||
@ -379,4 +379,4 @@
|
||||
"flags": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
@ -11,7 +11,9 @@
|
||||
<span class="flexrow">
|
||||
<input type="checkbox" class="blessure-premierssoins-done" name="blessure.{{id}}.premierssoins.done" {{#if system.premierssoins.done}}checked{{/if}}/>
|
||||
{{#if system.premierssoins.done}}
|
||||
{{#unless system.soinscomplets.done}}
|
||||
<input type="text" class="blessure-premierssoins-bonus number-x2" name="blessure.{{id}}.premierssoins.bonus" data-dtype="number" value="{{system.premierssoins.bonus}}"/>
|
||||
{{/unless}}
|
||||
{{else}}
|
||||
<label>{{system.premierssoins.tache}} / {{system.gravite}}</label>
|
||||
{{/if}}
|
||||
|
@ -28,7 +28,9 @@
|
||||
<input class="attribute-value" type="checkbox" name="premierssoins-done" {{#if system.premierssoins.done}}checked{{/if}}/>
|
||||
</label>
|
||||
{{#if system.premierssoins.done}}
|
||||
{{#unless system.soinscomplets.done}}
|
||||
<input class="attribute-value number-x" type="text" name="system.premierssoins.bonus" value="{{system.premierssoins.bonus}}" data-dtype="Number"/>
|
||||
{{/unless}}
|
||||
{{else}}
|
||||
<label for="system.premierssoins.tache">Points de tâches</label>
|
||||
<input class="attribute-value number-x" type="text" name="system.premierssoins.tache" value="{{system.premierssoins.tache}}" data-dtype="Number"/>
|
||||
|
Reference in New Issue
Block a user