import { RdDCarac } from "../rdd-carac.js"
import { RollPartCheckbox } from "./roll-part-checkbox.mjs"

const MORAL = "moral"

export class RollPartMoral extends RollPartCheckbox {

  get code() { return MORAL }

  visible(rollData) {
    return RdDCarac.isVolonte(rollData.current.carac.key) && this.getCheckboxValue(rollData) != 0
  }

  getCheckboxLabel(rollData) { return "Moral" }
  getCheckboxValue(rollData) { return rollData.active.actor.getMoralTotal() }
}
