diff --git a/assets/ui/cartouche_01.webp b/assets/ui/cartouche_01.webp new file mode 100644 index 0000000..f80903e Binary files /dev/null and b/assets/ui/cartouche_01.webp differ diff --git a/assets/ui/coin_bas_gauche_01.webp b/assets/ui/coin_bas_gauche_01.webp new file mode 100644 index 0000000..7d2ed17 Binary files /dev/null and b/assets/ui/coin_bas_gauche_01.webp differ diff --git a/assets/ui/coin_haut_gauche_01.webp b/assets/ui/coin_haut_gauche_01.webp new file mode 100644 index 0000000..dbaca7e Binary files /dev/null and b/assets/ui/coin_haut_gauche_01.webp differ diff --git a/assets/ui/fiche_background_back_01.webp b/assets/ui/fiche_background_back_01.webp new file mode 100644 index 0000000..ba4e000 Binary files /dev/null and b/assets/ui/fiche_background_back_01.webp differ diff --git a/assets/ui/fiche_background_interieur_01.webp b/assets/ui/fiche_background_interieur_01.webp new file mode 100644 index 0000000..11a1490 Binary files /dev/null and b/assets/ui/fiche_background_interieur_01.webp differ diff --git a/assets/ui/fiche_background_interieur_02.webp b/assets/ui/fiche_background_interieur_02.webp new file mode 100644 index 0000000..ede663c Binary files /dev/null and b/assets/ui/fiche_background_interieur_02.webp differ diff --git a/assets/ui/fiche_background_interieur_03.webp b/assets/ui/fiche_background_interieur_03.webp new file mode 100644 index 0000000..835dcd5 Binary files /dev/null and b/assets/ui/fiche_background_interieur_03.webp differ diff --git a/assets/ui/fiche_background_interieur_04.webp b/assets/ui/fiche_background_interieur_04.webp new file mode 100644 index 0000000..c8f9f27 Binary files /dev/null and b/assets/ui/fiche_background_interieur_04.webp differ diff --git a/assets/ui/fiche_background_simple_01.webp b/assets/ui/fiche_background_simple_01.webp new file mode 100644 index 0000000..b2b87c5 Binary files /dev/null and b/assets/ui/fiche_background_simple_01.webp differ diff --git a/assets/ui/fiche_portrait_01.webp b/assets/ui/fiche_portrait_01.webp new file mode 100644 index 0000000..39123f4 Binary files /dev/null and b/assets/ui/fiche_portrait_01.webp differ diff --git a/assets/ui/logo_main_01.webp b/assets/ui/logo_main_01.webp new file mode 100644 index 0000000..761374e Binary files /dev/null and b/assets/ui/logo_main_01.webp differ diff --git a/assets/ui/wallpaper_foundry2.webp b/assets/ui/wallpaper_foundry2.webp new file mode 100644 index 0000000..cec4101 Binary files /dev/null and b/assets/ui/wallpaper_foundry2.webp differ diff --git a/assets/ui/wallpaper_foundry3.webp b/assets/ui/wallpaper_foundry3.webp new file mode 100644 index 0000000..f1380fc Binary files /dev/null and b/assets/ui/wallpaper_foundry3.webp differ diff --git a/assets/ui/wallpaper_foundry4.webp b/assets/ui/wallpaper_foundry4.webp new file mode 100644 index 0000000..4800823 Binary files /dev/null and b/assets/ui/wallpaper_foundry4.webp differ diff --git a/assets/ui/wallpaper_foundry5.webp b/assets/ui/wallpaper_foundry5.webp new file mode 100644 index 0000000..354e11e Binary files /dev/null and b/assets/ui/wallpaper_foundry5.webp differ diff --git a/assets/ui/wallpaper_foundry6.webp b/assets/ui/wallpaper_foundry6.webp new file mode 100644 index 0000000..031ac58 Binary files /dev/null and b/assets/ui/wallpaper_foundry6.webp differ diff --git a/modules/heritiers-automation.js b/modules/heritiers-automation.js new file mode 100644 index 0000000..4188037 --- /dev/null +++ b/modules/heritiers-automation.js @@ -0,0 +1,52 @@ +/* -------------------------------------------- */ + +import { HeritiersUtility } from "./heritiers-utility.js"; +import "./xregexp-all.js"; + +const __level1Expr = '(?[a-z]+):(?[a-zA-Z]+)\\((?[a-zA-Z0-9\\.]+)\\)\\s+(?[\\d]+)\\s*{*(?[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} + } + +} \ No newline at end of file diff --git a/packs/competences.db b/packs/competences.db new file mode 100644 index 0000000..e69de29