Initial import
BIN
assets/ui/cartouche_01.webp
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
assets/ui/coin_bas_gauche_01.webp
Normal file
After Width: | Height: | Size: 80 KiB |
BIN
assets/ui/coin_haut_gauche_01.webp
Normal file
After Width: | Height: | Size: 71 KiB |
BIN
assets/ui/fiche_background_back_01.webp
Normal file
After Width: | Height: | Size: 254 KiB |
BIN
assets/ui/fiche_background_interieur_01.webp
Normal file
After Width: | Height: | Size: 182 KiB |
BIN
assets/ui/fiche_background_interieur_02.webp
Normal file
After Width: | Height: | Size: 182 KiB |
BIN
assets/ui/fiche_background_interieur_03.webp
Normal file
After Width: | Height: | Size: 184 KiB |
BIN
assets/ui/fiche_background_interieur_04.webp
Normal file
After Width: | Height: | Size: 179 KiB |
BIN
assets/ui/fiche_background_simple_01.webp
Normal file
After Width: | Height: | Size: 50 KiB |
BIN
assets/ui/fiche_portrait_01.webp
Normal file
After Width: | Height: | Size: 24 KiB |
BIN
assets/ui/logo_main_01.webp
Normal file
After Width: | Height: | Size: 102 KiB |
BIN
assets/ui/wallpaper_foundry2.webp
Normal file
After Width: | Height: | Size: 346 KiB |
BIN
assets/ui/wallpaper_foundry3.webp
Normal file
After Width: | Height: | Size: 332 KiB |
BIN
assets/ui/wallpaper_foundry4.webp
Normal file
After Width: | Height: | Size: 199 KiB |
BIN
assets/ui/wallpaper_foundry5.webp
Normal file
After Width: | Height: | Size: 201 KiB |
BIN
assets/ui/wallpaper_foundry6.webp
Normal file
After Width: | Height: | Size: 371 KiB |
52
modules/heritiers-automation.js
Normal file
@ -0,0 +1,52 @@
|
||||
/* -------------------------------------------- */
|
||||
|
||||
import { HeritiersUtility } from "./heritiers-utility.js";
|
||||
import "./xregexp-all.js";
|
||||
|
||||
const __level1Expr = '(?<effectType>[a-z]+):(?<objectType>[a-zA-Z]+)\\((?<objectName>[a-zA-Z0-9\\.]+)\\)\\s+(?<modifierValue>[\\d]+)\\s*{*(?<modifierLabel>[a-zA-Zàéè\\s]*)}*'
|
||||
const __effectTypes = {modifier: 1, cost: 1, provide: 1}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
export class HeritiersAutomation {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static init() {
|
||||
this.__objectTypes = { }
|
||||
|
||||
Object.entries(game.data.model.Actor).forEach(kv => {
|
||||
this.__objectTypes[kv[0]] = duplicate(kv[1])
|
||||
})
|
||||
Object.entries(game.data.model.Item).forEach(kv => {
|
||||
this.__objectTypes[kv[0]] = duplicate(kv[1])
|
||||
})
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static processAutomations(event, item, actor) {
|
||||
//console.log("We have", event, item, actor)
|
||||
if ( !item.system.isautomated || item.system.automations.length == 0 ) {
|
||||
return {isValid: true}
|
||||
}
|
||||
let relevantAutomations = item.system.automations.filter( auto => auto.eventtype == event)
|
||||
if ( !relevantAutomations || relevantAutomations.length == 0) {
|
||||
return {isValid: true}
|
||||
}
|
||||
|
||||
let validTab = []
|
||||
for(let auto of relevantAutomations) {
|
||||
if ( event == "on-drop") {
|
||||
validTab.push( actor.checkAttributOrCompetenceLevel( auto.competence, auto.minLevel) )
|
||||
}
|
||||
}
|
||||
|
||||
// Post process validation array
|
||||
for (let ret of validTab) {
|
||||
if ( !ret.isValid) {
|
||||
return ret
|
||||
}
|
||||
}
|
||||
|
||||
return {isValid: true}
|
||||
}
|
||||
|
||||
}
|