forked from public/foundryvtt-reve-de-dragon
Fix: animaux
- état général corrigé - ajout de blessure, mise à jour endurance, ... - calcul du malus d'état général - ajustement des jets selon points de vie perdus
This commit is contained in:
41
module/actor/base-actor-sang-sheet.js
Normal file
41
module/actor/base-actor-sang-sheet.js
Normal file
@ -0,0 +1,41 @@
|
||||
import { ChatUtility } from "../chat-utility.js";
|
||||
import { RdDItemBlessure } from "../item/blessure.js";
|
||||
import { RdDBaseActorReveSheet } from "./base-actor-reve-sheet.js";
|
||||
|
||||
/* -------------------------------------------- */
|
||||
/**
|
||||
* Extend the basic ActorSheet with some very simple modifications
|
||||
* @extends {ActorSheet}
|
||||
*/
|
||||
export class RdDBaseActorSangSheet extends RdDBaseActorReveSheet {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
/** @override */
|
||||
activateListeners(html) {
|
||||
super.activateListeners(html);
|
||||
|
||||
// Everything below here is only needed if the sheet is editable
|
||||
if (!this.options.editable) return;
|
||||
|
||||
this.html.find('.creer-blessure-legere').click(async event => RdDItemBlessure.createBlessure(this.actor, 2));
|
||||
this.html.find('.creer-blessure-grave').click(async event => RdDItemBlessure.createBlessure(this.actor, 4));
|
||||
this.html.find('.creer-blessure-critique').click(async event => RdDItemBlessure.createBlessure(this.actor, 6));
|
||||
|
||||
this.html.find('.jet-vie').click(async event => this.actor.jetDeVie())
|
||||
this.html.find('.jet-endurance').click(async event => await this.jetEndurance())
|
||||
|
||||
this.html.find('.vie-plus').click(async event => this.actor.santeIncDec("vie", 1))
|
||||
this.html.find('.vie-moins').click(async event => this.actor.santeIncDec("vie", -1))
|
||||
}
|
||||
|
||||
async jetEndurance() {
|
||||
const endurance = this.actor.getEnduranceActuelle()
|
||||
const result = await this.actor.jetEndurance(endurance);
|
||||
ChatMessage.create({
|
||||
content: `Jet d'Endurance : ${result.jetEndurance} / ${endurance}
|
||||
<br>${this.actor.name} a ${result.sonne ? 'échoué' : 'réussi'} son Jet d'Endurance ${result.sonne ? 'et devient Sonné' : ''}`,
|
||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(this.actor.name)
|
||||
});
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user