2023-11-24 02:17:20 +01:00
|
|
|
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));
|
|
|
|
|
2024-01-28 20:41:00 +01:00
|
|
|
this.html.find('.subir-blessure-contusion').click(async event => RdDItemBlessure.applyFullBlessure(this.actor, 2));
|
|
|
|
this.html.find('.subir-blessure-legere').click(async event => RdDItemBlessure.applyFullBlessure(this.actor, 2));
|
|
|
|
this.html.find('.subir-blessure-grave').click(async event => RdDItemBlessure.applyFullBlessure(this.actor, 4));
|
|
|
|
this.html.find('.subir-blessure-critique').click(async event => RdDItemBlessure.applyFullBlessure(this.actor, 6));
|
|
|
|
|
2023-11-24 02:17:20 +01:00
|
|
|
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é' : ''}`,
|
2024-10-16 23:18:15 +02:00
|
|
|
whisper: ChatUtility.getOwners(this.actor)
|
|
|
|
})
|
2023-11-24 02:17:20 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|