18 lines
		
	
	
		
			614 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			18 lines
		
	
	
		
			614 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
import { RDD_CONFIG } from "../constants.js"
 | 
						|
import { RdDCarac } from "../rdd-carac.js"
 | 
						|
import { RollPartCheckbox } from "./roll-part-checkbox.mjs"
 | 
						|
 | 
						|
const SURENC = "surenc"
 | 
						|
 | 
						|
export class RollPartSurEnc extends RollPartCheckbox {
 | 
						|
 | 
						|
  get code() { return SURENC }
 | 
						|
 | 
						|
  visible(rollData) {
 | 
						|
    return RdDCarac.isActionPhysique(rollData.current.carac.key) && rollData.active.actor.isSurenc()
 | 
						|
  }
 | 
						|
  getCheckboxIcon(rollData) { return `<img src="${RDD_CONFIG.icons.surenc}">` }
 | 
						|
  getCheckboxLabel(rollData) { return "Sur-enc." }
 | 
						|
  getCheckboxValue(rollData) { return rollData.active.actor.computeMalusSurEncombrement() }
 | 
						|
}
 |