diff --git a/README.md b/README.md index cf7c343..49e8980 100644 --- a/README.md +++ b/README.md @@ -34,11 +34,11 @@ I would love support from the community! I am open to any feedback, whether its # Me You can reach me on discord: @Lumenita -If you wish to support what I do: https://ko-fi.com/luminitatv +If you wish to support the systema & what I do: https://ko-fi.com/luminitatv # Modules If there are any difficulties with modules, I can attempt to fix whatever problem there is if its within my ability to do so. -If you end up using a module called Drag Ruler, for the Speed Attribute put 'actor.system.fullmove' & and Dash Multiplier to 0.25 +If you end up using a module called Drag Ruler, for the Speed Attribute put 'actor.system.movement.fullMove' & and Dash Multiplier to 0.25 # Character Sheet ![characterSheet](https://github.com/Lumenita/abfalter/assets/61290963/3dff4b59-e2bc-4f00-8f46-dd4dbdf01f06) diff --git a/css/abfalter.css b/css/abfalter.css index 8f341bd..9ba846b 100644 --- a/css/abfalter.css +++ b/css/abfalter.css @@ -5505,21 +5505,28 @@ h6 { display: flex; justify-content: center; } -.secondarychatmsg > div:nth-of-type(2) { +.secondarychatmsg > div:not(:nth-of-type(1)) { display: flex; justify-content: space-between; +} +.secondarychatmsg > div:nth-last-of-type(2) { border-image: url(../img/border.png) 10 stretch; border-top: 5px solid black; border-bottom: 5px solid black; margin-top: 3px; margin-bottom: 3px; } -.secondarychatmsg > div:nth-of-type(2) > span:nth-of-type(1) { +.secondarychatmsg > div:not(:nth-of-type(1)) > span:nth-of-type(1) { padding-left: 10%; } -.secondarychatmsg > div:nth-of-type(2) > span:nth-of-type(2) { +.secondarychatmsg > div:not(:nth-of-type(1)) > span:nth-of-type(2) { padding-right: 10%; } +.fumbleSeverity { + padding: 0 10%; + display: flex; + justify-content: space-between; +} .openRollMod, .fumblerollmod { height: 25px; @@ -5652,14 +5659,53 @@ h6 { white-space: pre-wrap; } - - - - - - - - +/* + *************** + --------------- + Changelog + --------------- + *************** +*/ +.changelogHeader > div { + display: flex; + justify-content: flex-end; +} +.changelogHeader > div > span { + font-size: 14px; + color: var(--boxColor); +} +.changelog > h5 { + justify-content: start; + font-size: 35px; + border-bottom: 1px solid var(--boxColor); +} +.changelogSection { + padding: 15px 0 0 0; +} +.changelogSection > h6 { + justify-content: start; + font-size: 25px; +} +.changelogSection > span { + display: flex; + padding: 7px 0; +} +.changelogList > h5 { + justify-content: start; + font-size: 17px; +} +.changelogButtons { + display: flex; + justify-content: space-evenly; +} +.changelogButtons > button { + width: 45%; + padding: 0px; + margin: 0px; + border-radius: 0px; + border: 0px; + border: 1px solid var(--boxColor); +} /* *************** --------------- @@ -5677,6 +5723,7 @@ h6 { position: fixed; bottom: 75px; left: 200px; + visibility: hidden; } .customActionBar .macros { display: flex; diff --git a/module/abfalter.js b/module/abfalter.js index 31ad318..6ad132f 100644 --- a/module/abfalter.js +++ b/module/abfalter.js @@ -9,7 +9,8 @@ import abfalterCharacterSheet from "./actor/abfalterCharacterSheet.js"; import { registerCustomMacros } from "./autoCombat/registerCustomMacros.js"; import { customMacroBar } from "./autoCombat/customMacroBar.js"; import { abfalterSettings } from "./utilities/abfalterSettings.js"; -import { migrateWorld } from "./utilities/migration.js"; +import { handleMigrations } from "./utilities/migration.js"; +import { handleChangelog } from "./utilities/changelog.js"; import { abfalterSettingsKeys } from "./utilities/abfalterSettings.js"; import abfalterEffectConfig from "./helpers/abfalterEffectConfig.js"; @@ -53,52 +54,34 @@ Hooks.once('ready', () => { }); Hooks.once("ready", function () { - if (!game.user.isGM) { - return; + return } - - const currentVersion = game.settings.get("abfalter", "systemMigrationVersion"); - const NEEDS_MIGRATION_VERSION = "1.4.0"; - - console.log(currentVersion); - - const needsMigration = !currentVersion || foundry.utils.isNewerVersion(NEEDS_MIGRATION_VERSION, currentVersion); - - console.log(needsMigration); - - - if (needsMigration) { - migrateWorld(); + if (game.settings.get("abfalter", "systemChangeLog") === false) { + handleChangelog(); } + handleMigrations(); }) +Handlebars.registerHelper('ifEquals', function (arg1, arg2, options) { + return (arg1 == arg2) ? options.fn(this) : options.inverse(this); +}); + Hooks.once('setup', function () { // Set active effect keys-labels abfalterEffectConfig.initializeChangeKeys(); - }) -Handlebars.registerHelper('ifEquals', function (arg1, arg2, options) { - return (arg1 == arg2) ? options.fn(this) : options.inverse(this); -}); - +//@TODO Hooks.on('createActiveEffect', async (activeEffect, _, userId) => { let activeType = "attack"; const arr = [{ activeType }]; await activeEffect.setFlag('abfalter', 'data.changes', arr); }) -/* -const _preLocalizationRegistrations = {}; - -function preLocalize(configKeyPath, { key, keys = [], sort = false } = {}) { - if (key) keys.unshift(key); - _preLocalizationRegistrations[configKeyPath] = { keys, sort }; -}*/ - - - +/** + * Data Models from here on + */ function makeIntField(init = 0, max, min) { return new foundry.data.fields.NumberField({ required: true, @@ -128,29 +111,33 @@ function makeHtmlField(init = '') { }) } - class actorDataModel extends foundry.abstract.DataModel { static defineSchema() { const type = 'character'; return { - system: new foundry.data.fields.SchemaField({ //move out of system to info @CHANGE + lp: valueMaxAbility(), + shield: valueMaxAbility(), + unifiedKi: valueMaxAbility(), + psychicPoint: valueMaxAbility(), + innatePowerKi: valueMaxAbility(), + info: new foundry.data.fields.SchemaField({ + race: makeStringField(), + class: makeStringField(), + gender: makeStringField(), + height: makeStringField(), + weight: makeStringField(), + size: makeStringField(), + age: makeStringField(), + appearance: makeStringField(), + notesOne: makeStringField(), + notesTwo: makeStringField(), + destiny: makeIntField(), + gnosis: makeIntField(), bio: makeHtmlField() }), - race: makeStringField(), //bundle all the info together @CHANGE - class: makeStringField(), - gender: makeStringField(), - height: makeStringField(), - weight: makeStringField(), - size: makeStringField(), - age: makeStringField(), - appearance: makeStringField(), - experience: makeIntField(), //bundle info partial break - notesOne: makeStringField(), //bundle all info cont @CHANGE - notesTwo: makeStringField(), - destiny: makeIntField(), - gnosis: makeIntField(), //bundle info end levelinfo: new foundry.data.fields.SchemaField({ + experience: makeIntField(), levelmod: makeIntField(), levelmodBonus: makeIntField(), presencemod: makeIntField(), @@ -158,6 +145,18 @@ class actorDataModel extends foundry.abstract.DataModel { dpmod: makeIntField(), dpmodBonus: makeIntField() }), + aamField: new foundry.data.fields.SchemaField({ + base: makeIntField(), + boon: makeIntField(), + crit: makeIntField(), + bonus: makeIntField() + }), + otherStats: new foundry.data.fields.SchemaField({ + itemPresence: makeIntField(), + damageBarrier: makeIntField(), + dmgRdc: makeIntField(), + artPresence: makeIntField() + }), rollRange: new foundry.data.fields.SchemaField({ base: makeIntField(90), spec: makeIntField(), @@ -190,7 +189,10 @@ class actorDataModel extends foundry.abstract.DataModel { armorHelmet: makeBoolField(), spellPath: makeBoolField(), spell: makeBoolField(), + invocation: makeBoolField(), + incarnation: makeBoolField(), turnMaint: makeBoolField(), + dailyMaint: makeBoolField(), elan: makeBoolField(), class: makeBoolField(), secondary: makeBoolField(), @@ -238,15 +240,12 @@ class actorDataModel extends foundry.abstract.DataModel { monsterdisadvVis: makeBoolField(), monsterdefVis: makeBoolField(), monsterdivineVis: makeBoolField(), - monsterTab: makeBoolField(), - effectTab: makeBoolField() + monsterTab: makeBoolField(true), + effectTab: makeBoolField(), + psychicDodgeStatus: makeBoolField(), + psychicModuleStatus: makeBoolField(), }), - lp: valueMaxAbility(), - shield: valueMaxAbility(), - unifiedKi: valueMaxAbility(), - psychicPoint: valueMaxAbility(), - innatePowerKi: valueMaxAbility(), - stats: new foundry.data.fields.SchemaField({ //rename stats to characteristics && toLowercase @CHANGE + stats: new foundry.data.fields.SchemaField({ Agility: characteristics(), Constitution: characteristics(), Strength: characteristics(), @@ -256,7 +255,7 @@ class actorDataModel extends foundry.abstract.DataModel { Power: characteristics(), Willpower: characteristics() }), - resistances: new foundry.data.fields.SchemaField({ //to lowercase @CHANGE + resistances: new foundry.data.fields.SchemaField({ Physical: resistances(), Disease: resistances(), Poison: resistances(), @@ -292,31 +291,18 @@ class actorDataModel extends foundry.abstract.DataModel { value: makeIntField(), bonus: makeIntField() }), - combatstats: new foundry.data.fields.SchemaField({ //organize @CHANGE - atkbase: makeIntField(), - atkspecial: makeIntField(), - atktemp: makeIntField(), - atkbonus: makeIntField(), - atkStatus: makeBoolField(), - blkbase: makeIntField(), - blkspecial: makeIntField(), - blktemp: makeIntField(), - blkbonus: makeIntField(), - blkStatus: makeBoolField(), - dodbase: makeIntField(), - dodspecial: makeIntField(), - dodtemp: makeIntField(), - dodbonus: makeIntField(), - dodStatus: makeBoolField() + combatValues: new foundry.data.fields.SchemaField({ + attack: combatValues(), + block: combatValues(), + dodge: combatValues() }), initiative: new foundry.data.fields.SchemaField({ status: makeBoolField(), - name: makeStringField(), //useless - delete @CHANGE spec: makeIntField(), bonus: makeIntField() }), - secondary: new foundry.data.fields.SchemaField({ - main: new foundry.data.fields.SchemaField({ + secondaryFields: new foundry.data.fields.SchemaField({ + category: new foundry.data.fields.SchemaField({ athletics: makeBoolField(), social: makeBoolField(), perceptive: makeBoolField(), @@ -325,78 +311,86 @@ class actorDataModel extends foundry.abstract.DataModel { subterfuge: makeBoolField(), creative: makeBoolField() }), - acrobatics: secondaryAbilities(), - athleticism: secondaryAbilities(), - climb: secondaryAbilities(), - jump: secondaryAbilities(), - ride: secondaryAbilities(), - swim: secondaryAbilities(), - etiquette: secondaryAbilities(), - intimidate: secondaryAbilities(), - leadership: secondaryAbilities(), - persuasion: secondaryAbilities(), - streetwise: secondaryAbilities(), - style: secondaryAbilities(), - trading: secondaryAbilities(), - notice: secondaryAbilities(), - search: secondaryAbilities(), - track: secondaryAbilities(), - animals: secondaryAbilities(), - appraisal: secondaryAbilities(), - architecture: secondaryAbilities(), - herballore: secondaryAbilities(), - history: secondaryAbilities(), - law: secondaryAbilities(), - magicappr: secondaryAbilities(), - medicine: secondaryAbilities(), - memorize: secondaryAbilities(), - navigation: secondaryAbilities(), - occult: secondaryAbilities(), - science: secondaryAbilities(), - tactics: secondaryAbilities(), - composure: secondaryAbilities(), - featsofstr: secondaryAbilities(), - withstpain: secondaryAbilities(), - disguise: secondaryAbilities(), - hide: secondaryAbilities(), - lockpicking: secondaryAbilities(), - poisons: secondaryAbilities(), - stealth: secondaryAbilities(), - theft: secondaryAbilities(), - traplore: secondaryAbilities(), - alchemy: secondaryAbilities(), - animism: secondaryAbilities(), - art: secondaryAbilities(), - dance: secondaryAbilities(), - forging: secondaryAbilities(), - jewelry: secondaryAbilities(), - music: secondaryAbilities(), - runes: secondaryAbilities(), - ritualcalig: secondaryAbilities(), - slofhand: secondaryAbilities(), - tailoring: secondaryAbilities(), - piloting: secondaryAbilities(), - cooking: secondaryAbilities(), - technomagic: secondaryAbilities(), - toymaking: secondaryAbilities(), - kidetection: secondaryAbilities(), - kiconceal: secondaryAbilities() - }), - aam: makeIntField(), //bundle all aam together @CHANGE - aamBoon: makeIntField(), - aamCrit: makeIntField(), - aamOther: makeIntField(), - aamBonus: makeIntField(), - aamStatus: makeBoolField(), //bundle aam end + athletics: new foundry.data.fields.SchemaField({ + acrobatics: secondaryAbilities(game.i18n.localize('abfalter.generalTab.acrobatic'), game.i18n.localize('abfalter.basicInfo.agi'), 'physical', true), + athleticism: secondaryAbilities(game.i18n.localize('abfalter.generalTab.athleticism'), game.i18n.localize('abfalter.basicInfo.agi'), 'physical', true), + climb: secondaryAbilities(game.i18n.localize('abfalter.generalTab.climb'), game.i18n.localize('abfalter.basicInfo.agi'), 'physical', true), + jump: secondaryAbilities(game.i18n.localize('abfalter.generalTab.jump'), game.i18n.localize('abfalter.basicInfo.str'), 'physical', true), + piloting: secondaryAbilities(game.i18n.localize('abfalter.generalTab.piloting'), game.i18n.localize('abfalter.basicInfo.dex'), 'physical', true), + ride: secondaryAbilities(game.i18n.localize('abfalter.generalTab.ride'), game.i18n.localize('abfalter.basicInfo.agi'), 'physical', true), + swim: secondaryAbilities(game.i18n.localize('abfalter.generalTab.swim'), game.i18n.localize('abfalter.basicInfo.agi'), 'physical', true) + }), + social: new foundry.data.fields.SchemaField({ + etiquette: secondaryAbilities(game.i18n.localize('abfalter.generalTab.etiquette'), game.i18n.localize('abfalter.basicInfo.int'), 'mental', false), + intimidate: secondaryAbilities(game.i18n.localize('abfalter.generalTab.intimidate'), game.i18n.localize('abfalter.basicInfo.wp'), 'mental', false), + leadership: secondaryAbilities(game.i18n.localize('abfalter.generalTab.leadership'), game.i18n.localize('abfalter.basicInfo.pow'), 'mental', false), + persuasion: secondaryAbilities(game.i18n.localize('abfalter.generalTab.persuasion'), game.i18n.localize('abfalter.basicInfo.int'), 'mental', false), + streetwise: secondaryAbilities(game.i18n.localize('abfalter.generalTab.streetwise'), game.i18n.localize('abfalter.basicInfo.int'), 'mental', false), + style: secondaryAbilities(game.i18n.localize('abfalter.generalTab.style'), game.i18n.localize('abfalter.basicInfo.pow'), 'mental', false), + trading: secondaryAbilities(game.i18n.localize('abfalter.generalTab.trading'), game.i18n.localize('abfalter.basicInfo.int'), 'mental', false) + }), + perceptive: new foundry.data.fields.SchemaField({ + kidetection: secondaryAbilities(game.i18n.localize('abfalter.kiTab.kiDetection'), game.i18n.localize('abfalter.basicInfo.per'), 'mental', false), + notice: secondaryAbilities(game.i18n.localize('abfalter.generalTab.notice'), game.i18n.localize('abfalter.basicInfo.per'), 'mental', false), + search: secondaryAbilities(game.i18n.localize('abfalter.generalTab.search'), game.i18n.localize('abfalter.basicInfo.per'), 'mental', false), + track: secondaryAbilities(game.i18n.localize('abfalter.generalTab.track'), game.i18n.localize('abfalter.basicInfo.per'), 'mental', false) + }), + intellectual: new foundry.data.fields.SchemaField({ + animals: secondaryAbilities(game.i18n.localize('abfalter.generalTab.animals'), game.i18n.localize('abfalter.basicInfo.int'), 'mental', false), + appraisal: secondaryAbilities(game.i18n.localize('abfalter.generalTab.appraisal'), game.i18n.localize('abfalter.basicInfo.int'), 'mental', false), + architecture: secondaryAbilities(game.i18n.localize('abfalter.generalTab.architecture'), game.i18n.localize('abfalter.basicInfo.int'), 'mental', false), + herballore: secondaryAbilities(game.i18n.localize('abfalter.generalTab.herballore'), game.i18n.localize('abfalter.basicInfo.int'), 'mental', false), + history: secondaryAbilities(game.i18n.localize('abfalter.generalTab.history'), game.i18n.localize('abfalter.basicInfo.int'), 'mental', false), + law: secondaryAbilities(game.i18n.localize('abfalter.generalTab.law'), game.i18n.localize('abfalter.basicInfo.int'), 'mental', false), + magicappr: secondaryAbilities(game.i18n.localize('abfalter.generalTab.magicAppr'), game.i18n.localize('abfalter.basicInfo.pow'), 'mental', false), + medicine: secondaryAbilities(game.i18n.localize('abfalter.generalTab.medicine'), game.i18n.localize('abfalter.basicInfo.int'), 'mental', false), + memorize: secondaryAbilities(game.i18n.localize('abfalter.generalTab.memorize'), game.i18n.localize('abfalter.basicInfo.int'), 'mental', false), + navigation: secondaryAbilities(game.i18n.localize('abfalter.generalTab.navigation'), game.i18n.localize('abfalter.basicInfo.int'), 'mental', false), + occult: secondaryAbilities(game.i18n.localize('abfalter.generalTab.occult'), game.i18n.localize('abfalter.basicInfo.int'), 'mental', false), + science: secondaryAbilities(game.i18n.localize('abfalter.generalTab.science'), game.i18n.localize('abfalter.basicInfo.int'), 'mental', false), + tactics: secondaryAbilities(game.i18n.localize('abfalter.generalTab.tactics'), game.i18n.localize('abfalter.basicInfo.int'), 'mental', false), + technomagic: secondaryAbilities(game.i18n.localize('abfalter.generalTab.technomagic'), game.i18n.localize('abfalter.basicInfo.int'), 'mental', false) + }), + vigor: new foundry.data.fields.SchemaField({ + composure: secondaryAbilities(game.i18n.localize('abfalter.generalTab.composure'), game.i18n.localize('abfalter.basicInfo.wp'), 'mental', false), + featsofstr: secondaryAbilities(game.i18n.localize('abfalter.generalTab.featsOfStr'), game.i18n.localize('abfalter.basicInfo.str'), 'mental', true), + withstpain: secondaryAbilities(game.i18n.localize('abfalter.generalTab.withstPain'), game.i18n.localize('abfalter.basicInfo.wp'), 'mental', false) + }), + subterfuge: new foundry.data.fields.SchemaField({ + disguise: secondaryAbilities(game.i18n.localize('abfalter.generalTab.disguise'), game.i18n.localize('abfalter.basicInfo.dex'), 'physical', false), + hide: secondaryAbilities(game.i18n.localize('abfalter.generalTab.hide'), game.i18n.localize('abfalter.basicInfo.per'), 'mental', true), + kiconceal: secondaryAbilities(game.i18n.localize('abfalter.kiTab.kiConceal'), game.i18n.localize('abfalter.basicInfo.per'), 'mental', false), + lockpicking: secondaryAbilities(game.i18n.localize('abfalter.generalTab.lockpicking'), game.i18n.localize('abfalter.basicInfo.dex'), 'physical', false), + poisons: secondaryAbilities(game.i18n.localize('abfalter.generalTab.poisons'), game.i18n.localize('abfalter.basicInfo.int'), 'mental', false), + stealth: secondaryAbilities(game.i18n.localize('abfalter.generalTab.stealth'), game.i18n.localize('abfalter.basicInfo.agi'), 'physical', true), + theft: secondaryAbilities(game.i18n.localize('abfalter.generalTab.theft'), game.i18n.localize('abfalter.basicInfo.dex'), 'physical', false), + traplore: secondaryAbilities(game.i18n.localize('abfalter.generalTab.traplore'), game.i18n.localize('abfalter.basicInfo.dex'), 'physical', false) + }), + creative: new foundry.data.fields.SchemaField({ + alchemy: secondaryAbilities(game.i18n.localize('abfalter.generalTab.alchemy'), game.i18n.localize('abfalter.basicInfo.int'), 'mental', false), + animism: secondaryAbilities(game.i18n.localize('abfalter.generalTab.animism'), game.i18n.localize('abfalter.basicInfo.pow'), 'mental', false), + art: secondaryAbilities(game.i18n.localize('abfalter.generalTab.art'), game.i18n.localize('abfalter.basicInfo.pow'), 'mental', false), + cooking: secondaryAbilities(game.i18n.localize('abfalter.generalTab.cooking'), game.i18n.localize('abfalter.basicInfo.pow'), 'mental', false), + dance: secondaryAbilities(game.i18n.localize('abfalter.generalTab.dance'), game.i18n.localize('abfalter.basicInfo.agi'), 'physical', true), + forging: secondaryAbilities(game.i18n.localize('abfalter.generalTab.forging'), game.i18n.localize('abfalter.basicInfo.dex'), 'physical', false), + jewelry: secondaryAbilities(game.i18n.localize('abfalter.generalTab.jewelry'), game.i18n.localize('abfalter.basicInfo.dex'), 'physical', false), + toymaking: secondaryAbilities(game.i18n.localize('abfalter.generalTab.toymaking'), game.i18n.localize('abfalter.basicInfo.pow'), 'mental', false), + music: secondaryAbilities(game.i18n.localize('abfalter.generalTab.music'), game.i18n.localize('abfalter.basicInfo.pow'), 'mental', false), + runes: secondaryAbilities(game.i18n.localize('abfalter.generalTab.runes'), game.i18n.localize('abfalter.basicInfo.dex'), 'physical', false), + ritualcalig: secondaryAbilities(game.i18n.localize('abfalter.generalTab.ritualCal'), game.i18n.localize('abfalter.basicInfo.dex'), 'physical', false), + slofhand: secondaryAbilities(game.i18n.localize('abfalter.generalTab.soh'), game.i18n.localize('abfalter.basicInfo.dex'), 'physical', false), + tailoring: secondaryAbilities(game.i18n.localize('abfalter.generalTab.tailoring'), game.i18n.localize('abfalter.basicInfo.dex'), 'physical', false) + }) + }), monsterChar: new foundry.data.fields.SchemaField({ - agi: monsterCharacteristics("physical"), - con: monsterCharacteristics("physical"), - str: monsterCharacteristics("physical"), - dex: monsterCharacteristics("physical"), - per: monsterCharacteristics("mental"), - int: monsterCharacteristics("mental"), - pow: monsterCharacteristics("mental"), - wp: monsterCharacteristics("mental") + agi: monsterCharacteristics("physical", game.i18n.localize('abfalter.basicInfo.agi')), + con: monsterCharacteristics("physical", game.i18n.localize('abfalter.basicInfo.con')), + str: monsterCharacteristics("physical", game.i18n.localize('abfalter.basicInfo.str')), + dex: monsterCharacteristics("physical", game.i18n.localize('abfalter.basicInfo.dex')), + per: monsterCharacteristics("mental", game.i18n.localize('abfalter.basicInfo.per')), + int: monsterCharacteristics("mental", game.i18n.localize('abfalter.basicInfo.int')), + pow: monsterCharacteristics("mental", game.i18n.localize('abfalter.basicInfo.pow')), + wp: monsterCharacteristics("mental", game.i18n.localize('abfalter.basicInfo.wp')) }), monsterStats: new foundry.data.fields.SchemaField({ hpDp: makeIntField() @@ -455,6 +449,8 @@ class actorDataModel extends foundry.abstract.DataModel { banish: summoningAbiities() }), metaMagic: new foundry.data.fields.SchemaField({ + derived: new foundry.data.fields.SchemaField({ + }), info: makeStringField(), cost: makeIntField(), extraCost: makeIntField(), @@ -614,7 +610,7 @@ class actorDataModel extends foundry.abstract.DataModel { mult: makeIntField(), mult2: makeIntField(), descNum: makeIntField(), - desc: makeStringField(), //html field? + desc: makeStringField(), multOption: makeStringField("str"), multOption2: makeStringField("none"), bonus: makeIntField(), @@ -670,23 +666,23 @@ class actorDataModel extends foundry.abstract.DataModel { dragonSeal: makeIntField(), dragonDoor: makeIntField() }), - wearArmor: new foundry.data.fields.SchemaField({ - base: makeIntField(), - spec: makeIntField(), - temp: makeIntField(), - bonus: makeIntField() + armor: new foundry.data.fields.SchemaField({ + wearArmor: new foundry.data.fields.SchemaField({ + base: makeIntField(), + spec: makeIntField(), + temp: makeIntField(), + bonus: makeIntField() + }), + body: new foundry.data.fields.SchemaField({ + }), + helmet: new foundry.data.fields.SchemaField({ + }) }), currency: new foundry.data.fields.SchemaField({ copper: makeIntField(), silver: makeIntField(), gold: makeIntField() }), - otherStats: new foundry.data.fields.SchemaField({ - itemPresence: makeIntField(), - damageBarrier: makeIntField(), - dmgRdc: makeIntField(), - artPresence: makeIntField() - }), ppoint: new foundry.data.fields.SchemaField({ base: makeIntField(), spec: makeIntField(), @@ -716,6 +712,117 @@ class actorDataModel extends foundry.abstract.DataModel { innateSlots: makeIntField(), status: makeBoolField() }), + //@OLD Deprecated since 1.4.2 + secondary: new foundry.data.fields.SchemaField({ + main: new foundry.data.fields.SchemaField({ + athletics: makeBoolField(), + social: makeBoolField(), + perceptive: makeBoolField(), + intellectual: makeBoolField(), + vigor: makeBoolField(), + subterfuge: makeBoolField(), + creative: makeBoolField() + }), + acrobatics: secondaryAbility(), + athleticism: secondaryAbility(), + climb: secondaryAbility(), + jump: secondaryAbility(), + ride: secondaryAbility(), + swim: secondaryAbility(), + etiquette: secondaryAbility(), + intimidate: secondaryAbility(), + leadership: secondaryAbility(), + persuasion: secondaryAbility(), + streetwise: secondaryAbility(), + style: secondaryAbility(), + trading: secondaryAbility(), + notice: secondaryAbility(), + search: secondaryAbility(), + track: secondaryAbility(), + animals: secondaryAbility(), + appraisal: secondaryAbility(), + architecture: secondaryAbility(), + herballore: secondaryAbility(), + history: secondaryAbility(), + law: secondaryAbility(), + magicappr: secondaryAbility(), + medicine: secondaryAbility(), + memorize: secondaryAbility(), + navigation: secondaryAbility(), + occult: secondaryAbility(), + science: secondaryAbility(), + tactics: secondaryAbility(), + composure: secondaryAbility(), + featsofstr: secondaryAbility(), + withstpain: secondaryAbility(), + disguise: secondaryAbility(), + hide: secondaryAbility(), + lockpicking: secondaryAbility(), + poisons: secondaryAbility(), + stealth: secondaryAbility(), + theft: secondaryAbility(), + traplore: secondaryAbility(), + alchemy: secondaryAbility(), + animism: secondaryAbility(), + art: secondaryAbility(), + dance: secondaryAbility(), + forging: secondaryAbility(), + jewelry: secondaryAbility(), + music: secondaryAbility(), + runes: secondaryAbility(), + ritualcalig: secondaryAbility(), + slofhand: secondaryAbility(), + tailoring: secondaryAbility(), + cooking: secondaryAbility(), + technomagic: secondaryAbility(), + toymaking: secondaryAbility(), + kidetection: secondaryAbility(), + kiconceal: secondaryAbility(), + piloting: secondaryAbility() + }), + combatstats: new foundry.data.fields.SchemaField({ + atkbase: makeIntField(), + atkspecial: makeIntField(), + atktemp: makeIntField(), + atkbonus: makeIntField(), + atkStatus: makeBoolField(), + blkbase: makeIntField(), + blkspecial: makeIntField(), + blktemp: makeIntField(), + blkbonus: makeIntField(), + blkStatus: makeBoolField(), + dodbase: makeIntField(), + dodspecial: makeIntField(), + dodtemp: makeIntField(), + dodbonus: makeIntField(), + dodStatus: makeBoolField() + }), + wearArmor: new foundry.data.fields.SchemaField({ + base: makeIntField(), + spec: makeIntField(), + temp: makeIntField(), + bonus: makeIntField() + }), + race: makeStringField(), + class: makeStringField(), + gender: makeStringField(), + height: makeStringField(), + weight: makeStringField(), + size: makeStringField(), + age: makeStringField(), + appearance: makeStringField(), + experience: makeIntField(), + notesOne: makeStringField(), + notesTwo: makeStringField(), + destiny: makeIntField(), + gnosis: makeIntField(), + system: new foundry.data.fields.SchemaField({ + bio: makeHtmlField() + }), + aam: makeIntField(), + aamBoon: makeIntField(), + aamCrit: makeIntField(), + aamBonus: makeIntField() } } @@ -746,6 +853,16 @@ function characteristics() { }) } +function combatValues() { + return new foundry.data.fields.SchemaField({ + base: makeIntField(), + special: makeIntField(), + temp: makeIntField(), + status: makeBoolField(), + bonus: makeIntField() + }) +} + function resistances() { return new foundry.data.fields.SchemaField({ mod: makeIntField(), @@ -753,7 +870,7 @@ function resistances() { }) } -function secondaryAbilities() { +function secondaryAbilities(label, mod, type, armor) { return new foundry.data.fields.SchemaField({ base: makeIntField(), spec: makeIntField(), @@ -761,16 +878,21 @@ function secondaryAbilities() { nat: makeIntField(), natural: makeIntField(), bonus: makeIntField(), + label: makeStringField(label), + modifier: makeStringField(mod), + type: makeStringField(type), + armorPen: makeBoolField(armor), fav: makeBoolField(), status: makeBoolField() }) } -function monsterCharacteristics(type) { +function monsterCharacteristics(type, name) { return new foundry.data.fields.SchemaField({ base: makeIntField(), additional: makeIntField(), - type: makeStringField(type) + type: makeStringField(type), + name: makeStringField(name) }) } @@ -818,4 +940,18 @@ function kiSealAbilities() { mastery: makeBoolField(), mastery2: makeBoolField() }) +} + +//@OLD Deprecated since 1.4.2 +function secondaryAbility() { + return new foundry.data.fields.SchemaField({ + base: makeIntField(), + spec: makeIntField(), + temp: makeIntField(-30), + nat: makeIntField(), + natural: makeIntField(), + bonus: makeIntField(), + fav: makeBoolField(), + status: makeBoolField() + }) } \ No newline at end of file diff --git a/module/actor/abfalterActor.js b/module/actor/abfalterActor.js index 3d4e22c..b6d8eef 100644 --- a/module/actor/abfalterActor.js +++ b/module/actor/abfalterActor.js @@ -12,90 +12,62 @@ export default class abfalterActor extends Actor { const system = this.system; //Global Settings - system.spiritSettings = game.settings.get('abfalter', abfalterSettingsKeys.Spirit_Damage); - system.fumbleSettings = game.settings.get('abfalter', abfalterSettingsKeys.Corrected_Fumble); - system.useMeters = game.settings.get('abfalter', abfalterSettingsKeys.Use_Meters); + system.other.spiritSettings = game.settings.get('abfalter', abfalterSettingsKeys.Spirit_Damage); + system.other.fumbleSettings = game.settings.get('abfalter', abfalterSettingsKeys.Corrected_Fumble); + system.other.useMeters = game.settings.get('abfalter', abfalterSettingsKeys.Use_Meters); //All Action Mod - system.aamFinal = system.aam + system.aamBoon + system.aamCrit; + system.aamField.final = system.aamField.base + system.aamField.boon + system.aamField.crit; //Main Characteristics & Dragon Seals - system.aamFinal += system.arsMagnus.dragonSeal * 5 || 0; + system.aamField.final += system.arsMagnus.dragonSeal * 5 || 0; //Monster Powers Prep for (let [key, atr] of Object.entries(system.monsterChar)) { - switch (key) { - case "agi": - atr.name = game.i18n.localize('abfalter.basicInfo.agi'); - break; - case "con": - atr.name = game.i18n.localize('abfalter.basicInfo.con'); - break; - case "str": - atr.name = game.i18n.localize('abfalter.basicInfo.str'); - break; - case "dex": - atr.name = game.i18n.localize('abfalter.basicInfo.dex'); - break; - case "per": - atr.name = game.i18n.localize('abfalter.basicInfo.per'); - break; - case "int": - atr.name = game.i18n.localize('abfalter.basicInfo.int'); - break; - case "pow": - atr.name = game.i18n.localize('abfalter.basicInfo.pow'); - break; - case "wp": - atr.name = game.i18n.localize('abfalter.basicInfo.wp'); - break; - default: - break; - } switch (atr.base) { - case "1": + case 1: atr.costBase = 1; break; - case "2": + case 2: atr.costBase = 2; break; - case "3": + case 3: atr.costBase = 3; break; - case "4": + case 4: atr.costBase = 4; break; - case "5": + case 5: atr.costBase = 5; break; - case "6": + case 6: atr.costBase = 6; break; - case "7": + case 7: atr.costBase = 7; break; - case "8": + case 8: atr.costBase = 8; break; - case "9": + case 9: atr.costBase = 10; break; - case "10": + case 10: atr.costBase = 15; break; - case "11": + case 11: atr.costBase = 20; break; - case "12": + case 12: atr.costBase = 30; break; - case "13": + case 13: atr.costBase = 40; break; - case "14": + case 14: atr.costBase = 50; break; - case "15": + case 15: atr.costBase = 60; break; default: @@ -106,90 +78,90 @@ export default class abfalterActor extends Actor { atr.charBaseCostTotal = Math.floor(atr.costBase + atr.costAdditional); atr.charBaseTotal = Math.floor(~~atr.base + ~~atr.additional); } - system.monsterCharCombCost = Math.floor(system.monsterChar.agi.charBaseCostTotal + system.monsterChar.con.charBaseCostTotal + system.monsterChar.str.charBaseCostTotal + + system.monsterStats.charCombinedCost = Math.floor(system.monsterChar.agi.charBaseCostTotal + system.monsterChar.con.charBaseCostTotal + system.monsterChar.str.charBaseCostTotal + system.monsterChar.dex.charBaseCostTotal + system.monsterChar.per.charBaseCostTotal + system.monsterChar.int.charBaseCostTotal + system.monsterChar.pow.charBaseCostTotal + system.monsterChar.wp.charBaseCostTotal); //Size Base Values - if (system.size >= 9 && system.size <= 22) { + if (system.info.size >= 9 && system.info.size <= 22) { system.initiative.sizeBase = 20; system.movement.sizeBase = 0; system.lifepoints.hpMult = 5; - system.monsterArmor = 3; - system.monsterPhysicalDmg = 10; - system.monsterNaturalDmg = 40; - system.monsterActionArea = "0"; - system.monsterNatBreak = 0; - system.monsternatFort = 12; - } else if (system.size >= 1 && system.size <= 3) { + system.monsterStats.armor = 3; + system.monsterStats.physDmg = 10; + system.monsterStats.naturalDmg = 40; + system.monsterStats.actionArea = "0"; + system.monsterStats.natBreak = 0; + system.monsterStats.fort = 12; + } else if (system.info.size >= 1 && system.info.size <= 3) { system.initiative.sizeBase = 40; system.movement.sizeBase = -4; system.lifepoints.hpMult = 1; - system.monsterArmor = 1; - system.monsterPhysicalDmg = 5; - system.monsterNaturalDmg = 20; - system.monsterActionArea = "0"; - system.monsterNatBreak = -4; - system.monsternatFort = 4; - } else if (system.size >= 4 && system.size <= 8) { + system.monsterStats.armor = 1; + system.monsterStats.physDmg = 5; + system.monsterStats.naturalDmg = 20; + system.monsterStats.actionArea = "0"; + system.monsterStats.natBreak = -4; + system.monsterStats.fort = 4; + } else if (system.info.size >= 4 && system.info.size <= 8) { system.initiative.sizeBase = 30; system.movement.sizeBase = -2; system.lifepoints.hpMult = 2; - system.monsterArmor = 2; - system.monsterPhysicalDmg = 10; - system.monsterNaturalDmg = 30; - system.monsterActionArea = "0"; - system.monsterNatBreak = -2; - system.monsternatFort = 8; - } else if (system.size >= 23 && system.size <= 24) { + system.monsterStats.armor = 2; + system.monsterStats.physDmg = 10; + system.monsterStats.naturalDmg = 30; + system.monsterStats.actionArea = "0"; + system.monsterStats.natBreak = -2; + system.monsterStats.fort = 8; + } else if (system.info.size >= 23 && system.info.size <= 24) { system.initiative.sizeBase = 10; system.movement.sizeBase = 0; system.lifepoints.hpMult = 5; - system.monsterArmor = 4; - system.monsterPhysicalDmg = 20; - system.monsterNaturalDmg = 60; - system.monsterActionArea = "0"; - system.monsterNatBreak = 4; - system.monsternatFort = 16; - } else if (system.size >= 25 && system.size <= 28) { + system.monsterStats.armor = 4; + system.monsterStats.physDmg = 20; + system.monsterStats.naturalDmg = 60; + system.monsterStats.actionArea = "0"; + system.monsterStats.natBreak = 4; + system.monsterStats.fort = 16; + } else if (system.info.size >= 25 && system.info.size <= 28) { system.initiative.sizeBase = 0; system.movement.sizeBase = 1; system.lifepoints.hpMult = 10; - system.monsterArmor = 6; - system.monsterPhysicalDmg = 30; - system.monsterNaturalDmg = 100; - system.monsterActionArea = "5ft / 1.5m"; - system.monsterNatBreak = 8; - system.monsternatFort = 20; - } else if (system.size >= 29 && system.size <= 33) { + system.monsterStats.armor = 6; + system.monsterStats.physDmg = 30; + system.monsterStats.naturalDmg = 100; + system.monsterStats.actionArea = "5ft / 1.5m"; + system.monsterStats.natBreak = 8; + system.monsterStats.fort = 20; + } else if (system.info.size >= 29 && system.info.size <= 33) { system.initiative.sizeBase = -10; system.movement.sizeBase = 2; system.lifepoints.hpMult = 15; - system.monsterArmor = 8; - system.monsterPhysicalDmg = 40; - system.monsterNaturalDmg = 120; - system.monsterActionArea = "15ft / 4.5m"; - system.monsterNatBreak = 12; - system.monsternatFort = 28; - } else if (system.size >= 34) { + system.monsterStats.armor = 8; + system.monsterStats.physDmg = 40; + system.monsterStats.naturalDmg = 120; + system.monsterStats.actionArea = "15ft / 4.5m"; + system.monsterStats.natBreak = 12; + system.monsterStats.fort = 28; + } else if (system.info.size >= 34) { system.initiative.sizeBase = -20; system.movement.sizeBase = 3; system.lifepoints.hpMult = 20; - system.monsterArmor = 10; - system.monsterPhysicalDmg = 60; - system.monsterNaturalDmg = 140; - system.monsterActionArea = "60ft / 18m"; - system.monsterNatBreak = 16; - system.monsternatFort = 34; + system.monsterStats.armor = 10; + system.monsterStats.physDmg = 60; + system.monsterStats.naturalDmg = 140; + system.monsterStats.actionArea = "60ft / 18m"; + system.monsterStats.natBreak = 16; + system.monsterStats.fort = 34; } else { system.initiative.sizeBase = 0; system.movement.sizeBase = 0; system.lifepoints.hpMult = 0; - system.monsterArmor = 0; - system.monsterPhysicalDmg = 0; - system.monsterNaturalDmg = 0; - system.monsterActionArea = "N/A"; - system.monsterNatBreak = 0; - system.monsternatFort = 0; + system.monsterStats.armor = 0; + system.monsterStats.physDmg = 0; + system.monsterStats.naturalDmg = 0; + system.monsterStats.actionArea = "N/A"; + system.monsterStats.natBreak = 0; + system.monsterStats.fort = 0; } //Main Char Calc @@ -215,294 +187,294 @@ export default class abfalterActor extends Actor { system.stats.Perception.final += system.arsMagnus.dragonDoor || 0; //MetaMagic Capstones - system.doubleDamageDesc = game.i18n.localize('abfalter.metaMagic.doubleDmgDesc'); - system.highMagicDesc = game.i18n.localize('abfalter.metaMagic.highMagicDesc'); - system.natMaintDesc = game.i18n.localize('abfalter.metaMagic.natMaintDesc'); - system.unlimitedZeonDesc = game.i18n.localize('abfalter.metaMagic.unlimitedZeonDesc'); + system.metaMagic.derived.doubleDamageDesc = game.i18n.localize('abfalter.metaMagic.doubleDmgDesc'); + system.metaMagic.derived.highMagicDesc = game.i18n.localize('abfalter.metaMagic.highMagicDesc'); + system.metaMagic.derived.natMaintDesc = game.i18n.localize('abfalter.metaMagic.natMaintDesc'); + system.metaMagic.derived.unlimitedZeonDesc = game.i18n.localize('abfalter.metaMagic.unlimitedZeonDesc'); //MetaMagic Desc Arcane Warfare //empowered shields if (!system.metaMagic.empShield.bought && !system.metaMagic.empShield2.bought) { - system.empShields = false; - system.empShieldsDesc = ""; + system.metaMagic.derived.empShields = false; + system.metaMagic.derived.empShieldsDesc = ""; } else if (system.metaMagic.empShield.bought && system.metaMagic.empShield2.bought) { - system.empShields = true; - system.empShieldsDesc = game.i18n.localize('abfalter.metaMagic.empShieldDesc2'); + system.metaMagic.derived.empShields = true; + system.metaMagic.derived.empShieldsDesc = game.i18n.localize('abfalter.metaMagic.empShieldDesc2'); } else { - system.empShields = true; - system.empShieldsDesc = game.i18n.localize('abfalter.metaMagic.empShieldDesc1'); + system.metaMagic.derived.empShields = true; + system.metaMagic.derived.empShieldsDesc = game.i18n.localize('abfalter.metaMagic.empShieldDesc1'); } //mystic accuracy if (!system.metaMagic.mysticAcc.bought && !system.metaMagic.mysticAcc2.bought) { - system.mysticAccu = false; - system.mysticAccuDesc = ""; + system.metaMagic.derived.mysticAccu = false; + system.metaMagic.derived.mysticAccuDesc = ""; } else if (system.metaMagic.mysticAcc.bought && system.metaMagic.mysticAcc2.bought) { - system.mysticAccu = true; - system.mysticAccuDesc = game.i18n.localize('abfalter.metaMagic.mysticAccuDesc2'); + system.metaMagic.derived.mysticAccu = true; + system.metaMagic.derived.mysticAccuDesc = game.i18n.localize('abfalter.metaMagic.mysticAccuDesc2'); } else { - system.mysticAccu = true; - system.mysticAccuDesc = game.i18n.localize('abfalter.metaMagic.mysticAccuDesc1'); + system.metaMagic.derived.mysticAccu = true; + system.metaMagic.derived.mysticAccuDesc = game.i18n.localize('abfalter.metaMagic.mysticAccuDesc1'); } //increased destruction if (!system.metaMagic.incDestro.bought && !system.metaMagic.incDestro2.bought) { - system.incDestruction = false; - system.incDestructionDesc = ""; + system.metaMagic.derived.incDestruction = false; + system.metaMagic.derived.incDestructionDesc = ""; } else if (system.metaMagic.incDestro.bought && system.metaMagic.incDestro2.bought) { - system.incDestruction = true; - system.incDestructionDesc = game.i18n.localize('abfalter.metaMagic.incDestroDesc2'); + system.metaMagic.derived.incDestruction = true; + system.metaMagic.derived.incDestructionDesc = game.i18n.localize('abfalter.metaMagic.incDestroDesc2'); } else { - system.incDestruction = true; - system.incDestructionDesc = game.i18n.localize('abfalter.metaMagic.incDestroDesc1'); + system.metaMagic.derived.incDestruction = true; + system.metaMagic.derived.incDestructionDesc = game.i18n.localize('abfalter.metaMagic.incDestroDesc1'); } //expanded area if (!system.metaMagic.expArea.bought && !system.metaMagic.expArea2.bought) { - system.expandArea = false; - system.expandAreaDesc = ""; + system.metaMagic.derived.expandArea = false; + system.metaMagic.derived.expandAreaDesc = ""; } else if (system.metaMagic.expArea.bought && system.metaMagic.expArea2.bought) { - system.expandArea = true; - system.expandAreaDesc = game.i18n.localize('abfalter.metaMagic.expAreaDesc2'); + system.metaMagic.derived.expandArea = true; + system.metaMagic.derived.expandAreaDesc = game.i18n.localize('abfalter.metaMagic.expAreaDesc2'); } else { - system.expandArea = true; - system.expandAreaDesc = game.i18n.localize('abfalter.metaMagic.expAreaDesc1'); + system.metaMagic.derived.expandArea = true; + system.metaMagic.derived.expandAreaDesc = game.i18n.localize('abfalter.metaMagic.expAreaDesc1'); } //remove protection if (!system.metaMagic.remProtection.bought && !system.metaMagic.remProtection2.bought && !system.metaMagic.remProtection3.bought) { - system.removeProtection = false; - system.removeProtectionDesc = ""; + system.metaMagic.derived.removeProtection = false; + system.metaMagic.derived.removeProtectionDesc = ""; } else if (system.metaMagic.remProtection.bought && system.metaMagic.remProtection2.bought && system.metaMagic.remProtection3.bought) { - system.removeProtection = true; - system.removeProtectionDesc = game.i18n.localize('abfalter.metaMagic.remProtectDesc3'); + system.metaMagic.derived.removeProtection = true; + system.metaMagic.derived.removeProtectionDesc = game.i18n.localize('abfalter.metaMagic.remProtectDesc3'); } else if ((system.metaMagic.remProtection.bought && system.metaMagic.remProtection2.bought) || (system.metaMagic.remProtection2.bought && system.metaMagic.remProtection3.bought) || (system.metaMagic.remProtection.bought && system.metaMagic.remProtection3.bought)) { - system.removeProtection = true; - system.removeProtectionDesc = game.i18n.localize('abfalter.metaMagic.remProtectDesc2'); + system.metaMagic.derived.removeProtection = true; + system.metaMagic.derived.removeProtectionDesc = game.i18n.localize('abfalter.metaMagic.remProtectDesc2'); } else { - system.removeProtection = true; - system.removeProtectionDesc = game.i18n.localize('abfalter.metaMagic.remProtectDesc1'); + system.metaMagic.derived.removeProtection = true; + system.metaMagic.derived.removeProtectionDesc = game.i18n.localize('abfalter.metaMagic.remProtectDesc1'); } //defensive expertise if (!system.metaMagic.defExper.bought && !system.metaMagic.defExper2.bought && !system.metaMagic.defExper3.bought) { - system.defenseExpertise = false; - system.defenseExpertiseDesc = ""; + system.metaMagic.derived.defenseExpertise = false; + system.metaMagic.derived.defenseExpertiseDesc = ""; } else if (system.metaMagic.defExper.bought && system.metaMagic.defExper2.bought && system.metaMagic.defExper3.bought) { - system.defenseExpertise = true; - system.defenseExpertiseDesc = game.i18n.localize('abfalter.metaMagic.defExperDesc3'); + system.metaMagic.derived.defenseExpertise = true; + system.metaMagic.derived.defenseExpertiseDesc = game.i18n.localize('abfalter.metaMagic.defExperDesc3'); } else if ((system.metaMagic.defExper.bought && system.metaMagic.defExper2.bought) || (system.metaMagic.defExper2.bought && system.metaMagic.defExper3.bought) || (system.metaMagic.defExper.bought && system.metaMagic.defExper3.bought)) { - system.defenseExpertise = true; - system.defenseExpertiseDesc = game.i18n.localize('abfalter.metaMagic.defExperDesc2'); + system.metaMagic.derived.defenseExpertise = true; + system.metaMagic.derived.defenseExpertiseDesc = game.i18n.localize('abfalter.metaMagic.defExperDesc2'); } else { - system.defenseExpertise = true; - system.defenseExpertiseDesc = game.i18n.localize('abfalter.metaMagic.defExperDesc1'); + system.metaMagic.derived.defenseExpertise = true; + system.metaMagic.derived.defenseExpertiseDesc = game.i18n.localize('abfalter.metaMagic.defExperDesc1'); } //offensive expertise if (!system.metaMagic.offExper.bought && !system.metaMagic.offExper2.bought && !system.metaMagic.offExper3.bought) { - system.offExpertise = false; - system.offExpertiseDesc = ""; + system.metaMagic.derived.offExpertise = false; + system.metaMagic.derived.offExpertiseDesc = ""; } else if (system.metaMagic.offExper.bought && system.metaMagic.offExper2.bought && system.metaMagic.offExper3.bought) { - system.offExpertise = true; - system.offExpertiseDesc = game.i18n.localize('abfalter.metaMagic.offExperDesc3'); + system.metaMagic.derived.offExpertise = true; + system.metaMagic.derived.offExpertiseDesc = game.i18n.localize('abfalter.metaMagic.offExperDesc3'); } else if ((system.metaMagic.offExper.bought && system.metaMagic.offExper2.bought) || (system.metaMagic.offExper2.bought && system.metaMagic.offExper3.bought) || (system.metaMagic.offExper.bought && system.metaMagic.offExper3.bought)) { - system.offExpertise = true; - system.offExpertiseDesc = game.i18n.localize('abfalter.metaMagic.offExperDesc2'); + system.metaMagic.derived.offExpertise = true; + system.metaMagic.derived.offExpertiseDesc = game.i18n.localize('abfalter.metaMagic.offExperDesc2'); } else { - system.offExpertise = true; - system.offExpertiseDesc = game.i18n.localize('abfalter.metaMagic.offExperDesc1'); + system.metaMagic.derived.offExpertise = true; + system.metaMagic.derived.offExpertiseDesc = game.i18n.localize('abfalter.metaMagic.offExperDesc1'); } //MetaMagic Desc Arcane Esoterica //secure defense - system.secureDefenseDesc = game.i18n.localize('abfalter.metaMagic.secDefenseDesc'); + system.metaMagic.derived.secureDefenseDesc = game.i18n.localize('abfalter.metaMagic.secDefenseDesc'); //life magic if (!system.metaMagic.lifeMagic.bought && !system.metaMagic.lifeMagic2.bought) { - system.lifeMagic = false; - system.lifeMagicDesc = ""; + system.metaMagic.derived.lifeMagic = false; + system.metaMagic.derived.lifeMagicDesc = ""; } else if (system.metaMagic.lifeMagic.bought && system.metaMagic.lifeMagic2.bought) { - system.lifeMagic = true; - system.lifeMagicDesc = game.i18n.localize('abfalter.metaMagic.lifeMagicDesc2'); + system.metaMagic.derived.lifeMagic = true; + system.metaMagic.derived.lifeMagicDesc = game.i18n.localize('abfalter.metaMagic.lifeMagicDesc2'); } else { - system.lifeMagic = true; - system.lifeMagicDesc = game.i18n.localize('abfalter.metaMagic.lifeMagicDesc1'); + system.metaMagic.derived.lifeMagic = true; + system.metaMagic.derived.lifeMagicDesc = game.i18n.localize('abfalter.metaMagic.lifeMagicDesc1'); } //feel magic - system.feelMagicDesc = game.i18n.localize('abfalter.metaMagic.feelMagicDesc'); + system.metaMagic.derived.feelMagicDesc = game.i18n.localize('abfalter.metaMagic.feelMagicDesc'); //hidden magic - system.hiddenMagicDesc = game.i18n.localize('abfalter.metaMagic.hiddenMagicDesc'); + system.metaMagic.derived.hiddenMagicDesc = game.i18n.localize('abfalter.metaMagic.hiddenMagicDesc'); //spiritual loop if (!system.metaMagic.spiritLoop.bought && !system.metaMagic.spiritLoop2.bought) { - system.spiritLoop = false; - system.spiritLoopDesc = ""; + system.metaMagic.derived.spiritLoop = false; + system.metaMagic.derived.spiritLoopDesc = ""; } else if (system.metaMagic.spiritLoop.bought && system.metaMagic.spiritLoop2.bought) { - system.spiritLoop = true; - system.spiritLoopDesc = game.i18n.localize('abfalter.metaMagic.spiritLoopDesc2'); + system.metaMagic.derived.spiritLoop = true; + system.metaMagic.derived.spiritLoopDesc = game.i18n.localize('abfalter.metaMagic.spiritLoopDesc2'); } else { - system.spiritLoop = true; - system.spiritLoopDesc = game.i18n.localize('abfalter.metaMagic.spiritLoopDesc1'); + system.metaMagic.derived.spiritLoop = true; + system.metaMagic.derived.spiritLoopDesc = game.i18n.localize('abfalter.metaMagic.spiritLoopDesc1'); } //control space - system.controlSpaceDesc = game.i18n.localize('abfalter.metaMagic.controlSpaceDesc'); + system.metaMagic.derived.controlSpaceDesc = game.i18n.localize('abfalter.metaMagic.controlSpaceDesc'); //energy control - system.eneControlDesc = game.i18n.localize('abfalter.metaMagic.eneControlDesc'); + system.metaMagic.derived.eneControlDesc = game.i18n.localize('abfalter.metaMagic.eneControlDesc'); //endure supernatural damage - system.endureDamageDesc = game.i18n.localize('abfalter.metaMagic.endureDamageDesc'); + system.metaMagic.derived.endureDamageDesc = game.i18n.localize('abfalter.metaMagic.endureDamageDesc'); //transfer magic - system.transferMagicDesc = game.i18n.localize('abfalter.metaMagic.transferMagicDesc'); + system.metaMagic.derived.transferMagicDesc = game.i18n.localize('abfalter.metaMagic.transferMagicDesc'); //force speed if (!system.metaMagic.forceSpeed.bought && !system.metaMagic.forceSpeed2.bought && !system.metaMagic.forceSpeed3.bought) { - system.forceSpeed = false; - system.forceSpeedDesc = ""; + system.metaMagic.derived.forceSpeed = false; + system.metaMagic.derived.forceSpeedDesc = ""; } else if (system.metaMagic.forceSpeed.bought && system.metaMagic.forceSpeed2.bought && system.metaMagic.forceSpeed3.bought) { - system.forceSpeed = true; - system.forceSpeedDesc = game.i18n.localize('abfalter.metaMagic.forceSpeed3'); + system.metaMagic.derived.forceSpeed = true; + system.metaMagic.derived.forceSpeedDesc = game.i18n.localize('abfalter.metaMagic.forceSpeed3'); } else if ((system.metaMagic.forceSpeed.bought && system.metaMagic.forceSpeed2.bought) || (system.metaMagic.forceSpeed2.bought && system.metaMagic.forceSpeed3.bought) || (system.metaMagic.forceSpeed.bought && system.metaMagic.forceSpeed3.bought)) { - system.forceSpeed = true; - system.forceSpeedDesc = game.i18n.localize('abfalter.metaMagic.forceSpeed2'); + system.metaMagic.derived.forceSpeed = true; + system.metaMagic.derived.forceSpeedDesc = game.i18n.localize('abfalter.metaMagic.forceSpeed2'); } else { - system.forceSpeed = true; - system.forceSpeedDesc = game.i18n.localize('abfalter.metaMagic.forceSpeed1'); + system.metaMagic.derived.forceSpeed = true; + system.metaMagic.derived.forceSpeedDesc = game.i18n.localize('abfalter.metaMagic.forceSpeed1'); } //double innate spells - system.doubleInnateDesc = game.i18n.localize('abfalter.metaMagic.doubleInnateDesc'); + system.metaMagic.derived.doubleInnateDesc = game.i18n.localize('abfalter.metaMagic.doubleInnateDesc'); //MetaMagic Desc Arcane Power //advanced zeon regen if (!system.metaMagic.advZeonRegen.bought && !system.metaMagic.advZeonRegen2.bought && !system.metaMagic.advZeonRegen3.bought) { - system.advnacedRegen = false; - system.advnacedRegenDesc = ""; + system.metaMagic.derived.advnacedRegen = false; + system.metaMagic.derived.advnacedRegenDesc = ""; } else if (system.metaMagic.advZeonRegen.bought && system.metaMagic.advZeonRegen2.bought && system.metaMagic.advZeonRegen3.bought) { - system.advnacedRegen = true; - system.advnacedRegenDesc = game.i18n.localize('abfalter.metaMagic.advZeonRegenDesc3'); + system.metaMagic.derived.advnacedRegen = true; + system.metaMagic.derived.advnacedRegenDesc = game.i18n.localize('abfalter.metaMagic.advZeonRegenDesc3'); } else if ((system.metaMagic.advZeonRegen.bought && system.metaMagic.advZeonRegen2.bought) || (system.metaMagic.advZeonRegen2.bought && system.metaMagic.advZeonRegen3.bought) || (system.metaMagic.advZeonRegen.bought && system.metaMagic.advZeonRegen3.bought)) { - system.advnacedRegen = true; - system.advnacedRegenDesc = game.i18n.localize('abfalter.metaMagic.advZeonRegenDesc2'); + system.metaMagic.derived.advnacedRegen = true; + system.metaMagic.derived.advnacedRegenDesc = game.i18n.localize('abfalter.metaMagic.advZeonRegenDesc2'); } else { - system.advnacedRegen = true; - system.advnacedRegenDesc = game.i18n.localize('abfalter.metaMagic.advZeonRegenDesc1'); + system.metaMagic.derived.advnacedRegen = true; + system.metaMagic.derived.advnacedRegenDesc = game.i18n.localize('abfalter.metaMagic.advZeonRegenDesc1'); } //avatar - system.avatarDesc = game.i18n.localize('abfalter.metaMagic.avatarDesc'); + system.metaMagic.derived.avatarDesc = game.i18n.localize('abfalter.metaMagic.avatarDesc'); //combined magic - system.combinedMagicDesc = game.i18n.localize('abfalter.metaMagic.combinedMagicDesc'); + system.metaMagic.derived.combinedMagicDesc = game.i18n.localize('abfalter.metaMagic.combinedMagicDesc'); //define magic projection - system.definedProjNumber = system.metaMagic.defMagicProj.bought + system.metaMagic.defMagicProj2.bought + system.metaMagic.defMagicProj3.bought + system.metaMagic.derived.definedProjNumber = system.metaMagic.defMagicProj.bought + system.metaMagic.defMagicProj2.bought + system.metaMagic.defMagicProj3.bought + system.metaMagic.defMagicProj4.bought + system.metaMagic.defMagicProj5.bought + system.metaMagic.defMagicProj6.bought + system.metaMagic.defMagicProj7.bought; - switch (system.definedProjNumber) { + switch (system.metaMagic.derived.definedProjNumber) { case 1: - system.defMagProjDesc = game.i18n.localize('abfalter.metaMagic.defMagProjDesc1'); - system.definedMagicProj = true; + system.metaMagic.derived.defMagProjDesc = game.i18n.localize('abfalter.metaMagic.defMagProjDesc1'); + system.metaMagic.derived.definedMagicProj = true; break; case 2: - system.defMagProjDesc = game.i18n.localize('abfalter.metaMagic.defMagProjDesc2'); - system.definedMagicProj = true; + system.metaMagic.derived.defMagProjDesc = game.i18n.localize('abfalter.metaMagic.defMagProjDesc2'); + system.metaMagic.derived.definedMagicProj = true; break; case 3: - system.defMagProjDesc = game.i18n.localize('abfalter.metaMagic.defMagProjDesc3'); - system.definedMagicProj = true; + system.metaMagic.derived.defMagProjDesc = game.i18n.localize('abfalter.metaMagic.defMagProjDesc3'); + system.metaMagic.derived.definedMagicProj = true; break; case 4: - system.defMagProjDesc = game.i18n.localize('abfalter.metaMagic.defMagProjDesc4'); - system.definedMagicProj = true; + system.metaMagic.derived.defMagProjDesc = game.i18n.localize('abfalter.metaMagic.defMagProjDesc4'); + system.metaMagic.derived.definedMagicProj = true; break; case 5: - system.defMagProjDesc = game.i18n.localize('abfalter.metaMagic.defMagProjDesc5'); - system.definedMagicProj = true; + system.metaMagic.derived.defMagProjDesc = game.i18n.localize('abfalter.metaMagic.defMagProjDesc5'); + system.metaMagic.derived.definedMagicProj = true; break; case 6: - system.defMagProjDesc = game.i18n.localize('abfalter.metaMagic.defMagProjDesc6'); - system.definedMagicProj = true; + system.metaMagic.derived.defMagProjDesc = game.i18n.localize('abfalter.metaMagic.defMagProjDesc6'); + system.metaMagic.derived.definedMagicProj = true; break; case 7: - system.defMagProjDesc = game.i18n.localize('abfalter.metaMagic.defMagProjDesc7'); - system.definedMagicProj = true; + system.metaMagic.derived.defMagProjDesc = game.i18n.localize('abfalter.metaMagic.defMagProjDesc7'); + system.metaMagic.derived.definedMagicProj = true; break; default: - system.defMagProjDesc = ""; - system.definedMagicProj = false; + system.metaMagic.derived.defMagProjDesc = ""; + system.metaMagic.derived.definedMagicProj = false; break; } //elevation - system.elevationDesc = game.i18n.localize('abfalter.metaMagic.elevationDesc'); + system.metaMagic.derived.elevationDesc = game.i18n.localize('abfalter.metaMagic.elevationDesc'); //exploit energy if (!system.metaMagic.exploitEne.bought && !system.metaMagic.exploitEne2.bought) { - system.exploitEnergy = false; - system.exploitEnergyDesc = ""; + system.metaMagic.derived.exploitEnergy = false; + system.metaMagic.derived.exploitEnergyDesc = ""; } else if (system.metaMagic.exploitEne.bought && system.metaMagic.exploitEne2.bought) { - system.exploitEnergy = true; - system.exploitEnergyDesc = game.i18n.localize('abfalter.metaMagic.exploitEneDesc2'); + system.metaMagic.derived.exploitEnergy = true; + system.metaMagic.derived.exploitEnergyDesc = game.i18n.localize('abfalter.metaMagic.exploitEneDesc2'); } else { - system.exploitEnergy = true; - system.exploitEnergyDesc = game.i18n.localize('abfalter.metaMagic.exploitEneDesc1'); + system.metaMagic.derived.exploitEnergy = true; + system.metaMagic.derived.exploitEnergyDesc = game.i18n.localize('abfalter.metaMagic.exploitEneDesc1'); } //persistent effects - system.persisEffectDesc = game.i18n.localize('abfalter.metaMagic.persisEffectDesc'); + system.metaMagic.derived.persisEffectDesc = game.i18n.localize('abfalter.metaMagic.persisEffectDesc'); //MetaMagic Desc Arcane Knowledge //mystic concentration - system.mysticConceDesc = game.i18n.localize('abfalter.metaMagic.mysticConceDesc'); + system.metaMagic.derived.mysticConceDesc = game.i18n.localize('abfalter.metaMagic.mysticConceDesc'); //mystic concentration if (!system.metaMagic.spellSpec80.bought && !system.metaMagic.spellSpec70.bought && !system.metaMagic.spellSpec60.bought && !system.metaMagic.spellSpec60x.bought && !system.metaMagic.spellSpec50.bought && !system.metaMagic.spellSpec30.bought && !system.metaMagic.spellSpec30x.bought) { - system.spellSpecialization = false; - system.spellSpecializationDesc = ""; + system.metaMagic.derived.spellSpecialization = false; + system.metaMagic.derived.spellSpecializationDesc = ""; } else if (system.metaMagic.spellSpec80.bought) { - system.spellSpecialization = true; - system.spellSpecializationDesc = game.i18n.localize('abfalter.metaMagic.spellSpec80Desc'); + system.metaMagic.derived.spellSpecialization = true; + system.metaMagic.derived.spellSpecializationDesc = game.i18n.localize('abfalter.metaMagic.spellSpec80Desc'); } else if (system.metaMagic.spellSpec70.bought) { - system.spellSpecialization = true; - system.spellSpecializationDesc = game.i18n.localize('abfalter.metaMagic.spellSpec70Desc'); + system.metaMagic.derived.spellSpecialization = true; + system.metaMagic.derived.spellSpecializationDesc = game.i18n.localize('abfalter.metaMagic.spellSpec70Desc'); } else if (system.metaMagic.spellSpec60.bought || system.metaMagic.spellSpec60x.bought) { - system.spellSpecialization = true; - system.spellSpecializationDesc = game.i18n.localize('abfalter.metaMagic.spellSpec60Desc'); + system.metaMagic.derived.spellSpecialization = true; + system.metaMagic.derived.spellSpecializationDesc = game.i18n.localize('abfalter.metaMagic.spellSpec60Desc'); } else if (system.metaMagic.spellSpec50.bought) { - system.spellSpecialization = true; - system.spellSpecializationDesc = game.i18n.localize('abfalter.metaMagic.spellSpec50Desc'); + system.metaMagic.derived.spellSpecialization = true; + system.metaMagic.derived.spellSpecializationDesc = game.i18n.localize('abfalter.metaMagic.spellSpec50Desc'); } else { - system.spellSpecialization = true; - system.spellSpecializationDesc = game.i18n.localize('abfalter.metaMagic.spellSpec30Desc'); + system.metaMagic.derived.spellSpecialization = true; + system.metaMagic.derived.spellSpecializationDesc = game.i18n.localize('abfalter.metaMagic.spellSpec30Desc'); } //pierce resistances if (!system.metaMagic.pierceRes.bought && !system.metaMagic.pierceRes2.bought) { - system.pierceRes = false; - system.pierceResDesc = ""; + system.metaMagic.derived.pierceRes = false; + system.metaMagic.derived.pierceResDesc = ""; } else if (system.metaMagic.pierceRes.bought && system.metaMagic.pierceRes2.bought) { - system.pierceRes = true; - system.pierceResDesc = game.i18n.localize('abfalter.metaMagic.pierceResDesc2'); + system.metaMagic.derived.pierceRes = true; + system.metaMagic.derived.pierceResDesc = game.i18n.localize('abfalter.metaMagic.pierceResDesc2'); } else { - system.pierceRes = true; - system.pierceResDesc = game.i18n.localize('abfalter.metaMagic.pierceResDesc1'); + system.metaMagic.derived.pierceRes = true; + system.metaMagic.derived.pierceResDesc = game.i18n.localize('abfalter.metaMagic.pierceResDesc1'); } //increase range if (!system.metaMagic.incRange.bought && !system.metaMagic.incRange2.bought) { - system.increRange = false; - system.increRangeDesc = ""; + system.metaMagic.derived.increRange = false; + system.metaMagic.derived.increRangeDesc = ""; } else if (system.metaMagic.incRange.bought && system.metaMagic.incRange2.bought) { - system.increRange = true; - system.increRangeDesc = game.i18n.localize('abfalter.metaMagic.increRangeDesc2'); + system.metaMagic.derived.increRange = true; + system.metaMagic.derived.increRangeDesc = game.i18n.localize('abfalter.metaMagic.increRangeDesc2'); } else { - system.increRange = true; - system.increRangeDesc = game.i18n.localize('abfalter.metaMagic.increRangeDesc1'); + system.metaMagic.derived.increRange = true; + system.metaMagic.derived.increRangeDesc = game.i18n.localize('abfalter.metaMagic.increRangeDesc1'); } //bind spells - system.bindSpellDesc = game.i18n.localize('abfalter.metaMagic.bindSpellDesc'); + system.metaMagic.derived.bindSpellDesc = game.i18n.localize('abfalter.metaMagic.bindSpellDesc'); //maximize spells - system.maxSpellsDesc = game.i18n.localize('abfalter.metaMagic.maxSpellsDesc'); + system.metaMagic.derived.maxSpellsDesc = game.i18n.localize('abfalter.metaMagic.maxSpellsDesc'); //double spells - system.doubleSpellDesc = game.i18n.localize('abfalter.metaMagic.doubleSpellDesc'); + system.metaMagic.derived.doubleSpellDesc = game.i18n.localize('abfalter.metaMagic.doubleSpellDesc'); //superior innate spell - system.supInnateDesc = game.i18n.localize('abfalter.metaMagic.supInnateDesc'); + system.metaMagic.derived.supInnateDesc = game.i18n.localize('abfalter.metaMagic.supInnateDesc'); //ML Calculation - system.metaCost = system.metaMagic.cost + system.metaMagic.extraCost; + system.metaMagic.totalCost = system.metaMagic.cost + system.metaMagic.extraCost; } @@ -514,7 +486,7 @@ export default class abfalterActor extends Actor { const system = this.system; const stats = system.stats; - system.aamFinal += system.aamBonus; + system.aamField.final += system.aamField.bonus || 0; for (let [key, stat] of Object.entries(system.stats)) { if (30 < stat.final) { @@ -598,7 +570,7 @@ export default class abfalterActor extends Actor { stat.mod = -40; } - stat.opposedfinal = Math.floor((stat.final + stat.opposed) + ~~(system.aamFinal / 20) + stat.opposedBonus); + stat.opposedfinal = Math.floor((stat.final + stat.opposed) + ~~(system.aamField.final / 20) + stat.opposedBonus); //Ki Pools if (stat != "Intelligence" && "Perception") { if (stat.final >= 1 && stat.final <= 9) { @@ -639,261 +611,261 @@ export default class abfalterActor extends Actor { case 8: case 9: case 10: - system.actionnumber = 1; + system.info.actionNumber = 1; break; case 11: case 12: case 13: case 14: - system.actionnumber = 2; + system.info.actionNumber = 2; break; case 15: case 16: case 17: case 18: case 19: - system.actionnumber = 3; + system.info.actionNumber = 3; break; case 20: case 21: case 22: - system.actionnumber = 4; + system.info.actionNumber = 4; break; case 23: case 24: case 25: - system.actionnumber = 5; + system.info.actionNumber = 5; break; case 26: case 27: case 28: - system.actionnumber = 6; + system.info.actionNumber = 6; break; case 29: case 30: case 31: - system.actionnumber = 8; + system.info.actionNumber = 8; break; default: - system.actionnumber = 10; + system.info.actionNumber = 10; break; } //Lifepoint Calculation - system.lpbase = Math.floor(25 + 10 * system.stats.Constitution.final + system.stats.Constitution.mod - Math.ceil((system.stats.Constitution.final - 1) / system.stats.Constitution.final) * 5); + system.lifepoints.base = Math.floor(25 + 10 * system.stats.Constitution.final + system.stats.Constitution.mod - Math.ceil((system.stats.Constitution.final - 1) / system.stats.Constitution.final) * 5); if (system.toggles.dmgRes == false) { - system.lp.max = Math.floor(system.lpbase + system.lifepoints.spec + system.lifepoints.temp + system.lifepoints.bonus + Math.ceil(system.lifepoints.multiple * system.stats.Constitution.final)); + system.lp.max = Math.floor(system.lifepoints.base + system.lifepoints.spec + system.lifepoints.temp + system.lifepoints.bonus + Math.ceil(system.lifepoints.multiple * system.stats.Constitution.final)); } else { if (system.monsterStats.hpDp == null) { system.monsterStats.hpDp = 0; } system.lifepoints.hpDmgRes = Math.floor(system.lifepoints.hpMult * system.monsterStats.hpDp); - system.lp.max = Math.floor(system.lpbase + system.lifepoints.spec + system.lifepoints.temp + system.lifepoints.hpDmgRes + system.lifepoints.bonus); + system.lp.max = Math.floor(system.lifepoints.base + system.lifepoints.spec + system.lifepoints.temp + system.lifepoints.hpDmgRes + system.lifepoints.bonus); } //Fatigue Calculation - system.fatiguebase = system.stats.Constitution.final; - system.fatigue.max = Math.floor(system.fatiguebase + system.fatigue.spec + system.fatigue.temp + system.fatigue.bonus); + system.fatigue.base = system.stats.Constitution.final; + system.fatigue.max = Math.floor(system.fatigue.base + system.fatigue.spec + system.fatigue.temp + system.fatigue.bonus); //Regeneration Calculation switch (system.stats.Constitution.final) { case 1: case 2: - system.regenbase = 0; + system.regeneration.base = 0; break; case 3: case 4: case 5: case 6: case 7: - system.regenbase = 1; + system.regeneration.base = 1; break; case 8: case 9: - system.regenbase = 2; + system.regeneration.base = 2; break; case 10: - system.regenbase = 3; + system.regeneration.base = 3; break; case 11: - system.regenbase = 4; + system.regeneration.base = 4; break; case 12: - system.regenbase = 5; + system.regeneration.base = 5; break; case 13: - system.regenbase = 6; + system.regeneration.base = 6; break; case 14: - system.regenbase = 7; + system.regeneration.base = 7; break; case 15: - system.regenbase = 8; + system.regeneration.base = 8; break; case 16: - system.regenbase = 9; + system.regeneration.base = 9; break; case 17: - system.regenbase = 10; + system.regeneration.base = 10; break; case 18: - system.regenbase = 11; + system.regeneration.base = 11; break; case 19: case 20: - system.regenbase = 12; + system.regeneration.base = 12; break; default: - system.regenbase = 0; + system.regeneration.base = 0; break; } if (system.stats.Constitution.final > 20) { - system.regenbase = 12; + system.regeneration.base = 12; } - system.regenfinal = Math.min(Math.floor(system.regenbase + system.regeneration.spec + system.regeneration.temp + system.regeneration.bonus), 20); - switch (system.regenfinal) { + system.regeneration.final = Math.min(Math.floor(system.regeneration.base + system.regeneration.spec + system.regeneration.temp + system.regeneration.bonus), 20); + switch (system.regeneration.final) { case 1: - system.resting = "10/" + game.i18n.localize('abfalter.basicInfo.day'); - system.notresting = "5/" + game.i18n.localize('abfalter.basicInfo.day'); - system.redpenalty = "-5/" + game.i18n.localize('abfalter.basicInfo.day'); - system.regenValue = 10; + system.regeneration.resting = "10/" + game.i18n.localize('abfalter.basicInfo.day'); + system.regeneration.notResting = "5/" + game.i18n.localize('abfalter.basicInfo.day'); + system.regeneration.penaltyReduction = "-5/" + game.i18n.localize('abfalter.basicInfo.day'); + system.regeneration.rawValue = 10; break; case 2: - system.resting = "20/" + game.i18n.localize('abfalter.basicInfo.day'); - system.notresting = "10/" + game.i18n.localize('abfalter.basicInfo.day'); - system.redpenalty = "-5/" + game.i18n.localize('abfalter.basicInfo.day'); - system.regenValue = 20; + system.regeneration.resting = "20/" + game.i18n.localize('abfalter.basicInfo.day'); + system.regeneration.notResting = "10/" + game.i18n.localize('abfalter.basicInfo.day'); + system.regeneration.penaltyReduction = "-5/" + game.i18n.localize('abfalter.basicInfo.day'); + system.regeneration.rawValue = 20; break; case 3: - system.resting = "30/" + game.i18n.localize('abfalter.basicInfo.day'); - system.notresting = "15/" + game.i18n.localize('abfalter.basicInfo.day'); - system.redpenalty = "-5/" + game.i18n.localize('abfalter.basicInfo.day'); - system.regenValue = 30; + system.regeneration.resting = "30/" + game.i18n.localize('abfalter.basicInfo.day'); + system.regeneration.notResting = "15/" + game.i18n.localize('abfalter.basicInfo.day'); + system.regeneration.penaltyReduction = "-5/" + game.i18n.localize('abfalter.basicInfo.day'); + system.regeneration.rawValue = 30; break; case 4: - system.resting = "40/" + game.i18n.localize('abfalter.basicInfo.day'); - system.notresting = "20/" + game.i18n.localize('abfalter.basicInfo.day'); - system.redpenalty = "-10/" + game.i18n.localize('abfalter.basicInfo.day'); - system.regenValue = 40; + system.regeneration.resting = "40/" + game.i18n.localize('abfalter.basicInfo.day'); + system.regeneration.notResting = "20/" + game.i18n.localize('abfalter.basicInfo.day'); + system.regeneration.penaltyReduction = "-10/" + game.i18n.localize('abfalter.basicInfo.day'); + system.regeneration.rawValue = 40; break; case 5: - system.resting = "50/" + game.i18n.localize('abfalter.basicInfo.day'); - system.notresting = "25/" + game.i18n.localize('abfalter.basicInfo.day'); - system.redpenalty = "-10/" + game.i18n.localize('abfalter.basicInfo.day'); - system.regenValue = 50; + system.regeneration.resting = "50/" + game.i18n.localize('abfalter.basicInfo.day'); + system.regeneration.notResting = "25/" + game.i18n.localize('abfalter.basicInfo.day'); + system.regeneration.penaltyReduction = "-10/" + game.i18n.localize('abfalter.basicInfo.day'); + system.regeneration.rawValue = 50; break; case 6: - system.resting = "75/" + game.i18n.localize('abfalter.basicInfo.day'); - system.notresting = "30/" + game.i18n.localize('abfalter.basicInfo.day'); - system.redpenalty = "-15/" + game.i18n.localize('abfalter.basicInfo.day'); - system.regenValue = 75; + system.regeneration.resting = "75/" + game.i18n.localize('abfalter.basicInfo.day'); + system.regeneration.notResting = "30/" + game.i18n.localize('abfalter.basicInfo.day'); + system.regeneration.penaltyReduction = "-15/" + game.i18n.localize('abfalter.basicInfo.day'); + system.regeneration.rawValue = 75; break; case 7: - system.resting = "100/" + game.i18n.localize('abfalter.basicInfo.day'); - system.notresting = "50/" + game.i18n.localize('abfalter.basicInfo.day'); - system.redpenalty = "-20/" + game.i18n.localize('abfalter.basicInfo.day'); - system.regenValue = 100; + system.regeneration.resting = "100/" + game.i18n.localize('abfalter.basicInfo.day'); + system.regeneration.notResting = "50/" + game.i18n.localize('abfalter.basicInfo.day'); + system.regeneration.penaltyReduction = "-20/" + game.i18n.localize('abfalter.basicInfo.day'); + system.regeneration.rawValue = 100; break; case 8: - system.resting = "250/" + game.i18n.localize('abfalter.basicInfo.day'); - system.notresting = "100/" + game.i18n.localize('abfalter.basicInfo.day'); - system.redpenalty = "-25/" + game.i18n.localize('abfalter.basicInfo.day'); - system.regenValue = 250; + system.regeneration.resting = "250/" + game.i18n.localize('abfalter.basicInfo.day'); + system.regeneration.notResting = "100/" + game.i18n.localize('abfalter.basicInfo.day'); + system.regeneration.penaltyReduction = "-25/" + game.i18n.localize('abfalter.basicInfo.day'); + system.regeneration.rawValue = 250; break; case 9: - system.resting = "500/" + game.i18n.localize('abfalter.basicInfo.day'); - system.notresting = "200/" + game.i18n.localize('abfalter.basicInfo.day'); - system.redpenalty = "-30/" + game.i18n.localize('abfalter.basicInfo.day'); - system.regenValue = 500; + system.regeneration.resting = "500/" + game.i18n.localize('abfalter.basicInfo.day'); + system.regeneration.notResting = "200/" + game.i18n.localize('abfalter.basicInfo.day'); + system.regeneration.penaltyReduction = "-30/" + game.i18n.localize('abfalter.basicInfo.day'); + system.regeneration.rawValue = 500; break; case 10: - system.resting = "1/" + game.i18n.localize('abfalter.basicInfo.minute'); - system.notresting = "N/A"; - system.redpenalty = "-40/" + game.i18n.localize('abfalter.basicInfo.day'); - system.regenValue = 1440; + system.regeneration.resting = "1/" + game.i18n.localize('abfalter.basicInfo.minute'); + system.regeneration.notResting = "N/A"; + system.regeneration.penaltyReduction = "-40/" + game.i18n.localize('abfalter.basicInfo.day'); + system.regeneration.rawValue = 1440; break; case 11: - system.resting = "2/" + game.i18n.localize('abfalter.basicInfo.minute'); - system.notresting = "N/A"; - system.redpenalty = "-50/" + game.i18n.localize('abfalter.basicInfo.day'); - system.regenValue = 2880; + system.regeneration.resting = "2/" + game.i18n.localize('abfalter.basicInfo.minute'); + system.regeneration.notResting = "N/A"; + system.regeneration.penaltyReduction = "-50/" + game.i18n.localize('abfalter.basicInfo.day'); + system.regeneration.rawValue = 2880; break; case 12: - system.resting = "5/" + game.i18n.localize('abfalter.basicInfo.minute'); - system.notresting = "N/A"; - system.redpenalty = "-5/" + game.i18n.localize('abfalter.basicInfo.hour'); - system.regenValue = 7200; + system.regeneration.resting = "5/" + game.i18n.localize('abfalter.basicInfo.minute'); + system.regeneration.notResting = "N/A"; + system.regeneration.penaltyReduction = "-5/" + game.i18n.localize('abfalter.basicInfo.hour'); + system.regeneration.rawValue = 7200; break; case 13: - system.resting = "10/" + game.i18n.localize('abfalter.basicInfo.minute'); - system.notresting = "N/A"; - system.redpenalty = "-10/" + game.i18n.localize('abfalter.basicInfo.hour'); - system.regenValue = 10000; + system.regeneration.resting = "10/" + game.i18n.localize('abfalter.basicInfo.minute'); + system.regeneration.notResting = "N/A"; + system.regeneration.penaltyReduction = "-10/" + game.i18n.localize('abfalter.basicInfo.hour'); + system.regeneration.rawValue = 10000; break; case 14: - system.resting = "1/" + game.i18n.localize('abfalter.magicTab.turn'); - system.notresting = "N/A"; - system.redpenalty = "-15/" + game.i18n.localize('abfalter.basicInfo.hour'); - system.regenValue = 20000; + system.regeneration.resting = "1/" + game.i18n.localize('abfalter.magicTab.turn'); + system.regeneration.notResting = "N/A"; + system.regeneration.penaltyReduction = "-15/" + game.i18n.localize('abfalter.basicInfo.hour'); + system.regeneration.rawValue = 20000; break; case 15: - system.resting = "5/" + game.i18n.localize('abfalter.magicTab.turn'); - system.notresting = "N/A"; - system.redpenalty = "-20/" + game.i18n.localize('abfalter.basicInfo.hour'); - system.regenValue = 50000; + system.regeneration.resting = "5/" + game.i18n.localize('abfalter.magicTab.turn'); + system.regeneration.notResting = "N/A"; + system.regeneration.penaltyReduction = "-20/" + game.i18n.localize('abfalter.basicInfo.hour'); + system.regeneration.rawValue = 50000; break; case 16: - system.resting = "10/" + game.i18n.localize('abfalter.magicTab.turn'); - system.notresting = "N/A"; - system.redpenalty = "-50/" + game.i18n.localize('abfalter.basicInfo.minute'); - system.regenValue = 100000; + system.regeneration.resting = "10/" + game.i18n.localize('abfalter.magicTab.turn'); + system.regeneration.notResting = "N/A"; + system.regeneration.penaltyReduction = "-50/" + game.i18n.localize('abfalter.basicInfo.minute'); + system.regeneration.rawValue = 100000; break; case 17: - system.resting = "25/" + game.i18n.localize('abfalter.magicTab.turn'); - system.notresting = "N/A"; - system.redpenalty = "-10/" + game.i18n.localize('abfalter.magicTab.turn'); - system.regenValue = 100000; + system.regeneration.resting = "25/" + game.i18n.localize('abfalter.magicTab.turn'); + system.regeneration.notResting = "N/A"; + system.regeneration.penaltyReduction = "-10/" + game.i18n.localize('abfalter.magicTab.turn'); + system.regeneration.rawValue = 100000; break; case 18: - system.resting = "50/" + game.i18n.localize('abfalter.magicTab.turn'); - system.notresting = "N/A"; - system.redpenalty = "-25/" + game.i18n.localize('abfalter.magicTab.turn'); - system.regenValue = 100000; + system.regeneration.resting = "50/" + game.i18n.localize('abfalter.magicTab.turn'); + system.regeneration.notResting = "N/A"; + system.regeneration.penaltyReduction = "-25/" + game.i18n.localize('abfalter.magicTab.turn'); + system.regeneration.rawValue = 100000; break; case 19: - system.resting = "100/" + game.i18n.localize('abfalter.magicTab.turn'); - system.notresting = "N/A"; - system.redpenalty = "All/" + game.i18n.localize('abfalter.magicTab.turn'); - system.regenValue = 100000; + system.regeneration.resting = "100/" + game.i18n.localize('abfalter.magicTab.turn'); + system.regeneration.notResting = "N/A"; + system.regeneration.penaltyReduction = "All/" + game.i18n.localize('abfalter.magicTab.turn'); + system.regeneration.rawValue = 100000; break; case 20: - system.resting = "200/" + game.i18n.localize('abfalter.magicTab.turn'); - system.notresting = "N/A"; - system.redpenalty = "All/" + game.i18n.localize('abfalter.magicTab.turn'); - system.regenValue = 100000; + system.regeneration.resting = "200/" + game.i18n.localize('abfalter.magicTab.turn'); + system.regeneration.notResting = "N/A"; + system.regeneration.penaltyReduction = "All/" + game.i18n.localize('abfalter.magicTab.turn'); + system.regeneration.rawValue = 100000; break; default: - system.resting = "0"; - system.notresting = "0"; - system.redpenalty = "0"; - system.regenValue = 0; + system.regeneration.resting = "0"; + system.regeneration.notResting = "0"; + system.regeneration.penaltyReduction = "0"; + system.regeneration.rawValue = 0; break; } //Initiative system.initiative.extraStats = Math.floor(system.stats.Dexterity.mod + system.stats.Agility.mod); - system.iniBase = Math.floor(system.stats.Dexterity.mod + system.stats.Agility.mod + system.initiative.sizeBase); - if (system.aamFinal < 0) { - system.iniBase = Math.floor(system.iniBase + ~~(system.aamFinal / 2)); + system.initiative.base = Math.floor(system.stats.Dexterity.mod + system.stats.Agility.mod + system.initiative.sizeBase); + if (system.aamField.final < 0) { + system.initiative.base = Math.floor(system.initiative.base + ~~(system.aamField.final / 2)); } //Ki Accumulation - system.kiPoolAgiAccumTot = Math.max(0, Math.floor(system.stats.Agility.kiPoolAccuBase + system.kiPool.agi.spec + system.kiPool.agi.temp + system.kiPool.agi.bonus + system.kiPool.agi.default + Math.min(0, ~~(system.aamFinal / 20)))); - system.kiPoolConAccumTot = Math.max(0, Math.floor(system.stats.Constitution.kiPoolAccuBase + system.kiPool.con.spec + system.kiPool.con.temp + system.kiPool.con.bonus + system.kiPool.con.default + Math.min(0, ~~(system.aamFinal / 20)))); - system.kiPoolDexAccumTot = Math.max(0, Math.floor(system.stats.Dexterity.kiPoolAccuBase + system.kiPool.dex.spec + system.kiPool.dex.temp + system.kiPool.dex.bonus + system.kiPool.dex.default + Math.min(0, ~~(system.aamFinal / 20)))); - system.kiPoolStrAccumTot = Math.max(0, Math.floor(system.stats.Strength.kiPoolAccuBase + system.kiPool.str.spec + system.kiPool.str.temp + system.kiPool.str.bonus + system.kiPool.str.default + Math.min(0, ~~(system.aamFinal / 20)))); - system.kiPoolPowAccumTot = Math.max(0, Math.floor(system.stats.Power.kiPoolAccuBase + system.kiPool.pow.spec + system.kiPool.pow.temp + system.kiPool.pow.bonus + system.kiPool.pow.default + Math.min(0, ~~(system.aamFinal / 20)))); - system.kiPoolWPAccumTot = Math.max(0, Math.floor(system.stats.Willpower.kiPoolAccuBase + system.kiPool.wp.spec + system.kiPool.wp.temp + system.kiPool.wp.bonus + system.kiPool.wp.default + Math.min(0, ~~(system.aamFinal / 20)))); + system.kiPool.agi.accumTot = Math.max(0, Math.floor(system.stats.Agility.kiPoolAccuBase + system.kiPool.agi.spec + system.kiPool.agi.temp + system.kiPool.agi.bonus + system.kiPool.agi.default + Math.min(0, ~~(system.aamField.final / 20)))); + system.kiPool.con.accumTot = Math.max(0, Math.floor(system.stats.Constitution.kiPoolAccuBase + system.kiPool.con.spec + system.kiPool.con.temp + system.kiPool.con.bonus + system.kiPool.con.default + Math.min(0, ~~(system.aamField.final / 20)))); + system.kiPool.dex.accumTot = Math.max(0, Math.floor(system.stats.Dexterity.kiPoolAccuBase + system.kiPool.dex.spec + system.kiPool.dex.temp + system.kiPool.dex.bonus + system.kiPool.dex.default + Math.min(0, ~~(system.aamField.final / 20)))); + system.kiPool.str.accumTot = Math.max(0, Math.floor(system.stats.Strength.kiPoolAccuBase + system.kiPool.str.spec + system.kiPool.str.temp + system.kiPool.str.bonus + system.kiPool.str.default + Math.min(0, ~~(system.aamField.final / 20)))); + system.kiPool.pow.accumTot = Math.max(0, Math.floor(system.stats.Power.kiPoolAccuBase + system.kiPool.pow.spec + system.kiPool.pow.temp + system.kiPool.pow.bonus + system.kiPool.pow.default + Math.min(0, ~~(system.aamField.final / 20)))); + system.kiPool.wp.accumTot = Math.max(0, Math.floor(system.stats.Willpower.kiPoolAccuBase + system.kiPool.wp.spec + system.kiPool.wp.temp + system.kiPool.wp.bonus + system.kiPool.wp.default + Math.min(0, ~~(system.aamField.final / 20)))); //Ki Pool if (system.toggles.innatePower == true) { @@ -927,481 +899,473 @@ export default class abfalterActor extends Actor { break; } } - - system.kiPoolAgiTot = Math.floor(system.stats.Agility.kiPoolBase + system.kiPool.agi.specMax + system.kiPool.agi.tempMax + system.kiPool.agi.bonusMax + system.kiPool.agi.defaultMax); - system.kiPoolConTot = Math.floor(system.stats.Constitution.kiPoolBase + system.kiPool.con.specMax + system.kiPool.con.tempMax + system.kiPool.dex.bonusMax + system.kiPool.con.defaultMax); - system.kiPoolDexTot = Math.floor(system.stats.Dexterity.kiPoolBase + system.kiPool.dex.specMax + system.kiPool.dex.tempMax + system.kiPool.dex.bonusMax + system.kiPool.dex.defaultMax); - system.kiPoolStrTot = Math.floor(system.stats.Strength.kiPoolBase + system.kiPool.str.specMax + system.kiPool.str.tempMax + system.kiPool.str.bonusMax + system.kiPool.str.defaultMax); - system.kiPoolPowTot = Math.floor(system.stats.Power.kiPoolBase + system.kiPool.pow.specMax + system.kiPool.pow.tempMax + system.kiPool.pow.bonusMax + system.kiPool.pow.defaultMax); - system.kiPoolWPTot = Math.floor(system.stats.Willpower.kiPoolBase + system.kiPool.wp.specMax + system.kiPool.wp.tempMax + system.kiPool.wp.bonusMax + system.kiPool.wp.defaultMax); + system.kiPool.agi.poolTot = Math.floor(system.stats.Agility.kiPoolBase + system.kiPool.agi.specMax + system.kiPool.agi.tempMax + system.kiPool.agi.bonusMax + system.kiPool.agi.defaultMax); + system.kiPool.con.poolTot = Math.floor(system.stats.Constitution.kiPoolBase + system.kiPool.con.specMax + system.kiPool.con.tempMax + system.kiPool.dex.bonusMax + system.kiPool.con.defaultMax); + system.kiPool.dex.poolTot = Math.floor(system.stats.Dexterity.kiPoolBase + system.kiPool.dex.specMax + system.kiPool.dex.tempMax + system.kiPool.dex.bonusMax + system.kiPool.dex.defaultMax); + system.kiPool.str.poolTot = Math.floor(system.stats.Strength.kiPoolBase + system.kiPool.str.specMax + system.kiPool.str.tempMax + system.kiPool.str.bonusMax + system.kiPool.str.defaultMax); + system.kiPool.pow.poolTot = Math.floor(system.stats.Power.kiPoolBase + system.kiPool.pow.specMax + system.kiPool.pow.tempMax + system.kiPool.pow.bonusMax + system.kiPool.pow.defaultMax); + system.kiPool.wp.poolTot = Math.floor(system.stats.Willpower.kiPoolBase + system.kiPool.wp.specMax + system.kiPool.wp.tempMax + system.kiPool.wp.bonusMax + system.kiPool.wp.defaultMax); if (system.toggles.unifiedPools == true) { if (system.toggles.innatePower == true) { switch (system.kiPool.innate.type) { case "AGI": - system.unifiedKi.max = Math.floor(system.kiPool.innate.bonus + system.kiPoolAgiTot); - system.kiPoolConTot = 0; - system.kiPoolDexTot = 0; - system.kiPoolStrTot = 0; - system.kiPoolPowTot = 0; - system.kiPoolWPTot = 0; + system.unifiedKi.max = Math.floor(system.kiPool.innate.bonus + system.kiPool.agi.poolTot); + system.kiPool.con.poolTot = 0; + system.kiPool.dex.poolTot = 0; + system.kiPool.str.poolTot = 0; + system.kiPool.pow.poolTot = 0; + system.kiPool.wp.poolTot = 0; system.innateAgi = true; break; case "CON": - system.unifiedKi.max = Math.floor(system.kiPool.innate.bonus + system.kiPoolConTot); - system.kiPoolAgiTot = 0; - system.kiPoolDexTot = 0; - system.kiPoolStrTot = 0; - system.kiPoolPowTot = 0; - system.kiPoolWPTot = 0; + system.unifiedKi.max = Math.floor(system.kiPool.innate.bonus + system.kiPool.con.poolTot); + system.kiPool.agi.poolTot = 0; + system.kiPool.dex.poolTot = 0; + system.kiPool.str.poolTot = 0; + system.kiPool.pow.poolTot = 0; + system.kiPool.wp.poolTot = 0; break; case "DEX": - system.unifiedKi.max = Math.floor(system.kiPool.innate.bonus + system.kiPoolDexTot); - system.kiPoolAgiTot = 0; - system.kiPoolConTot = 0; - system.kiPoolStrTot = 0; - system.kiPoolPowTot = 0; - system.kiPoolWPTot = 0; + system.unifiedKi.max = Math.floor(system.kiPool.innate.bonus + system.kiPool.dex.poolTot); + system.kiPool.agi.poolTot = 0; + system.kiPool.con.poolTot = 0; + system.kiPool.str.poolTot = 0; + system.kiPool.pow.poolTot = 0; + system.kiPool.wp.poolTot = 0; break; case "STR": - system.unifiedKi.max = Math.floor(system.kiPool.innate.bonus + system.kiPoolStrTot); - system.kiPoolAgiTot = 0; - system.kiPoolConTot = 0; - system.kiPoolDexTot = 0; - system.kiPoolPowTot = 0; - system.kiPoolWPTot = 0; + system.unifiedKi.max = Math.floor(system.kiPool.innate.bonus + system.kiPool.str.poolTot); + system.kiPool.agi.poolTot = 0; + system.kiPool.con.poolTot = 0; + system.kiPool.dex.poolTot = 0; + system.kiPool.pow.poolTot = 0; + system.kiPool.wp.poolTot = 0; break; case "POW": - system.unifiedKi.max = Math.floor(system.kiPool.innate.bonus + system.kiPoolPowTot); - system.kiPoolAgiTot = 0; - system.kiPoolConTot = 0; - system.kiPoolDexTot = 0; - system.kiPoolStrTot = 0; - system.kiPoolWPTot = 0; + system.unifiedKi.max = Math.floor(system.kiPool.innate.bonus + system.kiPool.pow.poolTot); + system.kiPool.agi.poolTot = 0; + system.kiPool.con.poolTot = 0; + system.kiPool.dex.poolTot = 0; + system.kiPool.str.poolTot = 0; + system.kiPool.wp.poolTot = 0; break; case "WP": - system.unifiedKi.max = Math.floor(system.kiPool.innate.bonus + system.kiPoolWPTot); - system.kiPoolAgiTot = 0; - system.kiPoolConTot = 0; - system.kiPoolDexTot = 0; - system.kiPoolStrTot = 0; - system.kiPoolPowTot = 0; + system.unifiedKi.max = Math.floor(system.kiPool.innate.bonus + system.kiPool.wp.poolTot); + system.kiPool.agi.poolTot = 0; + system.kiPool.con.poolTot = 0; + system.kiPool.dex.poolTot = 0; + system.kiPool.str.poolTot = 0; + system.kiPool.pow.poolTot = 0; break; default: system.kiPool.innate.tag = "Error"; break; } } else { - system.unifiedKi.max = Math.floor(system.kiPoolAgiTot + system.kiPoolConTot + system.kiPoolDexTot + system.kiPoolStrTot + system.kiPoolPowTot + system.kiPoolWPTot + system.kiPool.unifiedBonus); + system.unifiedKi.max = Math.floor(system.kiPool.agi.poolTot + system.kiPool.con.poolTot + system.kiPool.dex.poolTot + system.kiPool.str.poolTot + system.kiPool.pow.poolTot + system.kiPool.wp.poolTot + system.kiPool.unifiedBonus); } } //atk, blk, dodge - system.atkfinal = Math.floor(system.combatstats.atkbase + system.combatstats.atkspecial + system.combatstats.atktemp + system.combatstats.atkbonus + system.stats.Dexterity.mod + system.aamFinal); - system.blkfinal = Math.floor(system.combatstats.blkbase + system.combatstats.blkspecial + system.combatstats.blktemp + system.combatstats.blkbonus + system.stats.Dexterity.mod + system.aamFinal); - system.dodfinal = Math.floor(system.combatstats.dodbase + system.combatstats.dodspecial + system.combatstats.dodtemp + system.combatstats.dodbonus + system.stats.Agility.mod + system.aamFinal); + system.combatValues.attack.final = Math.floor(system.combatValues.attack.base + system.combatValues.attack.special + system.combatValues.attack.temp + system.combatValues.attack.bonus + system.stats.Dexterity.mod + system.aamField.final); + system.combatValues.block.final = Math.floor(system.combatValues.block.base + system.combatValues.block.special + system.combatValues.block.temp + system.combatValues.block.bonus + system.stats.Dexterity.mod + system.aamField.final); + system.combatValues.dodge.final = Math.floor(system.combatValues.dodge.base + system.combatValues.dodge.special + system.combatValues.dodge.temp + system.combatValues.dodge.bonus + system.stats.Agility.mod + system.aamField.final); //Magic Projection system.mproj.spec + system.mproj.temp - system.mprojfinal = Math.floor(system.mproj.base + system.stats.Dexterity.mod + system.aamFinal); - system.mprojfinaloff = Math.floor(system.mprojfinal + system.mproj.spec + system.mproj.temp + system.mproj.bonus + system.mproj.imbalance); - system.mprojfinaldef = Math.floor(system.mprojfinal + system.mproj.spec2 + system.mproj.temp2 + system.mproj.bonus2 - system.mproj.imbalance); + system.mproj.final = Math.floor(system.mproj.base + system.stats.Dexterity.mod + system.aamField.final); + system.mproj.finalOffensive = Math.floor(system.mproj.final + system.mproj.spec + system.mproj.temp + system.mproj.bonus + system.mproj.imbalance); + system.mproj.finalDefensive = Math.floor(system.mproj.final + system.mproj.spec2 + system.mproj.temp2 + system.mproj.bonus2 - system.mproj.imbalance); - system.mprojAtkModule = Math.floor(system.combatstats.atkbase + system.mproj.spec + system.mproj.temp + system.mproj.bonus + system.stats.Dexterity.mod + system.aamFinal); - system.mprojDefModule = Math.floor(system.combatstats.blkbase + system.mproj.spec2 + system.mproj.temp2 + system.mproj.bonus2 + system.stats.Dexterity.mod + system.aamFinal); - system.mprojDodModule = Math.floor(system.combatstats.dodbase + system.mproj.spec2 + system.mproj.temp2 + system.mproj.bonus2 + system.stats.Dexterity.mod + system.aamFinal); + system.mproj.atkModule = Math.floor(system.combatValues.attack.base + system.mproj.spec + system.mproj.temp + system.mproj.bonus + system.stats.Dexterity.mod + system.aamField.final); + system.mproj.defModule = Math.floor(system.combatValues.block.base + system.mproj.spec2 + system.mproj.temp2 + system.mproj.bonus2 + system.stats.Dexterity.mod + system.aamField.final); + system.mproj.dodModule = Math.floor(system.combatValues.dodge.base + system.mproj.spec2 + system.mproj.temp2 + system.mproj.bonus2 + system.stats.Dexterity.mod + system.aamField.final); // Psychic Potential if (system.stats.Willpower.final < 5) { - system.fromWP = 0; + system.ppotential.wpBase = 0; } else if (system.stats.Willpower.final >= 5 && system.stats.Willpower.final < 15) { - system.fromWP = Math.floor((system.stats.Willpower.final - 4) * 10); + system.ppotential.wpBase = Math.floor((system.stats.Willpower.final - 4) * 10); } else if (system.stats.Willpower.final >= 15) { - system.fromWP = Math.floor(((system.stats.Willpower.final - 14) * 20) + 100) + system.ppotential.wpBase = Math.floor(((system.stats.Willpower.final - 14) * 20) + 100) } - system.finalPotential = Math.floor(system.ppotential.base + system.fromWP + + system.ppotential.spent + system.ppotential.spec + system.ppotential.temp + system.ppotential.bonus); + system.ppotential.final = Math.floor(system.ppotential.base + system.ppotential.wpBase + + system.ppotential.spent + system.ppotential.spec + system.ppotential.temp + system.ppotential.bonus); switch (system.ppotential.spent) { - case "10": - system.ppotentialpp = 1; + case 10: + system.ppotential.fromPP = 1; break; - case "20": - system.ppotentialpp = 3; + case 20: + system.ppotential.fromPP = 3; break; - case "30": - system.ppotentialpp = 6; + case 30: + system.ppotential.fromPP = 6; break; - case "40": - system.ppotentialpp = 10; + case 40: + system.ppotential.fromPP = 10; break; - case "50": - system.ppotentialpp = 15; + case 50: + system.ppotential.fromPP = 15; break; - case "60": - system.ppotentialpp = 21; + case 60: + system.ppotential.fromPP = 21; break; - case "70": - system.ppotentialpp = 28; + case 70: + system.ppotential.fromPP = 28; break; - case "80": - system.ppotentialpp = 36; + case 80: + system.ppotential.fromPP = 36; break; - case "90": - system.ppotentialpp = 45; + case 90: + system.ppotential.fromPP = 45; break; - case "100": - system.ppotentialpp = 55; + case 100: + system.ppotential.fromPP = 55; break; default: - system.ppotentialpp = 0; + system.ppotential.fromPP = 0; break; } // Psychic Projection - system.pprojfinal = Math.floor(system.pproj.base + system.pproj.spec + system.pproj.temp + system.pproj.bonusBase + system.stats.Dexterity.mod + system.aamFinal); + system.pproj.final = Math.floor(system.pproj.base + system.pproj.spec + system.pproj.temp + system.pproj.bonusBase + system.stats.Dexterity.mod + system.aamField.final); - system.pprojAtkModule = Math.floor(system.combatstats.atkbase + system.pproj.spec + system.pproj.temp + system.pproj.bonus + system.stats.Dexterity.mod + system.aamFinal); - system.pprojDefModule = Math.floor(system.combatstats.blkbase + system.pproj.spec + system.pproj.temp + system.pproj.bonus2 + system.stats.Dexterity.mod + system.aamFinal); - system.pprojDodModule = Math.floor(system.combatstats.dodbase + system.pproj.spec + system.pproj.temp + system.pproj.bonus2 + system.stats.Dexterity.mod + system.aamFinal); + system.pproj.atkModule = Math.floor(system.combatValues.attack.base + system.pproj.spec + system.pproj.temp + system.pproj.bonus + system.stats.Dexterity.mod + system.aamField.final); + system.pproj.defModule = Math.floor(system.combatValues.block.base + system.pproj.spec + system.pproj.temp + system.pproj.bonus2 + system.stats.Dexterity.mod + system.aamField.final); + system.pproj.dodModule = Math.floor(system.combatValues.dodge.base + system.pproj.spec + system.pproj.temp + system.pproj.bonus2 + system.stats.Dexterity.mod + system.aamField.final); // Wear Armor - system.wearArmorFinal = Math.floor(system.wearArmor.base + system.wearArmor.spec + system.wearArmor.temp + system.wearArmor.bonus + system.stats.Strength.mod); - - - // Determine Item Values / Last used arr[123] 2 *Look at js map - const [level, lpbonus, ini, atk, dod, blk, weararm, mk, pp, zeon, summon, control, bind, banish, acro, - athle, climb, jump, ride, swim, etiq, intim, leader, persua, street, style, trading, notice, search, track, - animals, appra, archi, herb, hist, law, magicapr, medic, mem, navi, occ, science, tactic, comp, fos, - wstp, disg, hide, lock, poisn, stealth, theft, trapl, alche, anims, art, dance, forgi, jewel, music, - runes, ritcal, soh, tailoring, quantity, req, natPen, movePen, aCutMax, aCutTot, aImpMax, aImpTot, aThrMax, aThrTot, aHeatMax, - aHeatTot, aColdMax, aColdTot, aEleMax, aEleTot, aEneMax, aEneTot, aSptMax, aSptTot, ahReq, ahCutMax, ahCutTot, ahImpMax, ahImpTot, ahThrMax, - ahThrTot, ahHeatMax, ahHeatTot, ahColdMax, ahColdTot, ahEleMax, ahEleTot, ahEneMax, ahEneTot, ahSptMax, ahSptTot, perPen, usedpp, matrixpp, arsMk, - maMk, techMk, pathLvl, turnMaint, dayMaint, spellCost, wepNum, wepSpd, maKiAtk, maKiBlk, maKiDod, pilot, techmagic, cook, toy, - kiDect, kiCon, wepName, monsterCost] = this.items.reduce((arr, item) => { + system.armor.wearArmor.final = Math.floor(system.armor.wearArmor.base + system.armor.wearArmor.spec + system.armor.wearArmor.temp + system.armor.wearArmor.bonus + system.stats.Strength.mod); + + const classBonuses = { + level: 0, lpbonus: 0, ini: 0, atk: 0, dod: 0, blk: 0, weararm: 0, mk: 0, pp: 0, zeon: 0, summon: 0, control: 0, bind: 0, banish: 0, acro: 0, + athle: 0, climb: 0, jump: 0, ride: 0, swim: 0, etiq: 0, intim: 0, leader: 0, persua: 0, street: 0, style: 0, trading: 0, notice: 0, search: 0, track: 0, + animals: 0, appra: 0, archi: 0, herb: 0, hist: 0, law: 0, magicapr: 0, medic: 0, mem: 0, navi: 0, occ: 0, science: 0, tactic: 0, comp: 0, fos: 0, + wstp: 0, disg: 0, hide: 0, lock: 0, poisn: 0, stealth: 0, theft: 0, trapl: 0, alche: 0, anims: 0, art: 0, dance: 0, forgi: 0, jewel: 0, music: 0, + runes: 0, ritcal: 0, soh: 0, tailoring: 0, quantity: 0, req: 0, natPen: 0, movePen: 0, aCutMax: 0, aCutTot: 0, aImpMax: 0, aImpTot: 0, aThrMax: 0, aThrTot: 0, aHeatMax: 0, + aHeatTot: 0, aColdMax: 0, aColdTot: 0, aEleMax: 0, aEleTot: 0, aEneMax: 0, aEneTot: 0, aSptMax: 0, aSptTot: 0, ahReq: 0, ahCutMax: 0, ahCutTot: 0, ahImpMax: 0, ahImpTot: 0, ahThrMax: 0, + ahThrTot: 0, ahHeatMax: 0, ahHeatTot: 0, ahColdMax: 0, ahColdTot: 0, ahEleMax: 0, ahEleTot: 0, ahEneMax: 0, ahEneTot: 0, ahSptMax: 0, ahSptTot: 0, perPen: 0, usedpp: 0, matrixpp: 0, arsMk: 0, + maMk: 0, techMk: 0, pathLvl: 0, turnMaint: 0, dayMaint: 0, spellCost: 0, wepNum: 0, wepSpd: 0, maKiAtk: 0, maKiBlk: 0, maKiDod: 0, pilot: 0, techmagic: 0, cook: 0, toy: 0, + kiDect: 0, kiCon: 0, wepName: "", monsterCost: 0 + } + this.items.reduce((arr, item) => { if (item.type === "class") { const classLevels = parseInt(item.system.main.levels) || 0; - arr[0] += classLevels; - arr[1] += classLevels * (parseInt(item.system.main.lp) || 0); - arr[2] += classLevels * (parseInt(item.system.main.initiative) || 0); - arr[3] += classLevels * (parseInt(item.system.main.attack) || 0); - arr[4] += classLevels * (parseInt(item.system.main.dodge) || 0); - arr[5] += classLevels * (parseInt(item.system.main.block) || 0); - arr[6] += classLevels * (parseInt(item.system.main.weararmor) || 0); - arr[7] += classLevels * (parseInt(item.system.main.mk) || 0); - arr[8] += (parseInt(item.system.totalPP) || 0); - arr[9] += classLevels * (parseInt(item.system.main.zeon) || 0); - arr[10] += classLevels * (parseInt(item.system.main.summon) || 0); - arr[11] += classLevels * (parseInt(item.system.main.control) || 0); - arr[12] += classLevels * (parseInt(item.system.main.bind) || 0); - arr[13] += classLevels * (parseInt(item.system.main.banish) || 0); - arr[14] += classLevels * (parseInt(item.system.secondary.acro) || 0); - arr[15] += classLevels * (parseInt(item.system.secondary.athleticism) || 0); - arr[16] += classLevels * (parseInt(item.system.secondary.climb) || 0); - arr[17] += classLevels * (parseInt(item.system.secondary.jump) || 0); - arr[18] += classLevels * (parseInt(item.system.secondary.ride) || 0); - arr[19] += classLevels * (parseInt(item.system.secondary.swim) || 0); - arr[20] += classLevels * (parseInt(item.system.secondary.etiquette) || 0); - arr[21] += classLevels * (parseInt(item.system.secondary.intimidate) || 0); - arr[22] += classLevels * (parseInt(item.system.secondary.leadership) || 0); - arr[23] += classLevels * (parseInt(item.system.secondary.persuasion) || 0); - arr[24] += classLevels * (parseInt(item.system.secondary.streetwise) || 0); - arr[25] += classLevels * (parseInt(item.system.secondary.style) || 0); - arr[26] += classLevels * (parseInt(item.system.secondary.trading) || 0); - arr[27] += classLevels * (parseInt(item.system.secondary.notice) || 0); - arr[28] += classLevels * (parseInt(item.system.secondary.search) || 0); - arr[29] += classLevels * (parseInt(item.system.secondary.track) || 0); - arr[30] += classLevels * (parseInt(item.system.secondary.animals) || 0); - arr[31] += classLevels * (parseInt(item.system.secondary.appraisal) || 0); - arr[32] += classLevels * (parseInt(item.system.secondary.architecture) || 0); - arr[33] += classLevels * (parseInt(item.system.secondary.herballore) || 0); - arr[34] += classLevels * (parseInt(item.system.secondary.history) || 0); - arr[35] += classLevels * (parseInt(item.system.secondary.law) || 0); - arr[36] += classLevels * (parseInt(item.system.secondary.magicappr) || 0); - arr[37] += classLevels * (parseInt(item.system.secondary.medicine) || 0); - arr[38] += classLevels * (parseInt(item.system.secondary.memorize) || 0); - arr[39] += classLevels * (parseInt(item.system.secondary.navigation) || 0); - arr[40] += classLevels * (parseInt(item.system.secondary.occult) || 0); - arr[41] += classLevels * (parseInt(item.system.secondary.science) || 0); - arr[42] += classLevels * (parseInt(item.system.secondary.tactics) || 0); - arr[43] += classLevels * (parseInt(item.system.secondary.composure) || 0); - arr[44] += classLevels * (parseInt(item.system.secondary.featsofstr) || 0); - arr[45] += classLevels * (parseInt(item.system.secondary.withstpain) || 0); - arr[46] += classLevels * (parseInt(item.system.secondary.disguise) || 0); - arr[47] += classLevels * (parseInt(item.system.secondary.hide) || 0); - arr[48] += classLevels * (parseInt(item.system.secondary.lockpicking) || 0); - arr[49] += classLevels * (parseInt(item.system.secondary.poisons) || 0); - arr[50] += classLevels * (parseInt(item.system.secondary.stealth) || 0); - arr[51] += classLevels * (parseInt(item.system.secondary.theft) || 0); - arr[52] += classLevels * (parseInt(item.system.secondary.traplore) || 0); - arr[53] += classLevels * (parseInt(item.system.secondary.alchemy) || 0); - arr[54] += classLevels * (parseInt(item.system.secondary.animism) || 0); - arr[55] += classLevels * (parseInt(item.system.secondary.art) || 0); - arr[56] += classLevels * (parseInt(item.system.secondary.dance) || 0); - arr[57] += classLevels * (parseInt(item.system.secondary.forging) || 0); - arr[58] += classLevels * (parseInt(item.system.secondary.jewelry) || 0); - arr[59] += classLevels * (parseInt(item.system.secondary.music) || 0); - arr[60] += classLevels * (parseInt(item.system.secondary.runes) || 0); - arr[61] += classLevels * (parseInt(item.system.secondary.ritualcalig) || 0); - arr[62] += classLevels * (parseInt(item.system.secondary.slofhand) || 0); - arr[63] += classLevels * (parseInt(item.system.secondary.tailoring) || 0); - arr[116] += classLevels * (parseInt(item.system.secondary.piloting) || 0); - arr[117] += classLevels * (parseInt(item.system.secondary.technomagic) || 0); - arr[118] += classLevels * (parseInt(item.system.secondary.cooking) || 0); - arr[119] += classLevels * (parseInt(item.system.secondary.toymaking) || 0); - arr[120] += classLevels * (parseInt(item.system.secondary.kidetection) || 0); - arr[121] += classLevels * (parseInt(item.system.secondary.kiconceal) || 0); + classBonuses.level += classLevels; + classBonuses.lpbonus += classLevels * (parseInt(item.system.main.lp) || 0); + classBonuses.ini += classLevels * (parseInt(item.system.main.initiative) || 0); + classBonuses.atk += classLevels * (parseInt(item.system.main.attack) || 0); + classBonuses.dod += classLevels * (parseInt(item.system.main.dodge) || 0); + classBonuses.blk += classLevels * (parseInt(item.system.main.block) || 0); + classBonuses.weararm += classLevels * (parseInt(item.system.main.weararmor) || 0); + classBonuses.mk += classLevels * (parseInt(item.system.main.mk) || 0); + classBonuses.pp += (parseInt(item.system.totalPP) || 0); + classBonuses.zeon += classLevels * (parseInt(item.system.main.zeon) || 0); + classBonuses.summon += classLevels * (parseInt(item.system.main.summon) || 0); + classBonuses.control += classLevels * (parseInt(item.system.main.control) || 0); + classBonuses.bind += classLevels * (parseInt(item.system.main.bind) || 0); + classBonuses.banish += classLevels * (parseInt(item.system.main.banish) || 0); + classBonuses.acro += classLevels * (parseInt(item.system.secondary.acro) || 0); + classBonuses.athle += classLevels * (parseInt(item.system.secondary.athleticism) || 0); + classBonuses.climb += classLevels * (parseInt(item.system.secondary.climb) || 0); + classBonuses.jump += classLevels * (parseInt(item.system.secondary.jump) || 0); + classBonuses.pilot += classLevels * (parseInt(item.system.secondary.piloting) || 0); + classBonuses.ride += classLevels * (parseInt(item.system.secondary.ride) || 0); + classBonuses.swim += classLevels * (parseInt(item.system.secondary.swim) || 0); + classBonuses.etiq += classLevels * (parseInt(item.system.secondary.etiquette) || 0); + classBonuses.intim += classLevels * (parseInt(item.system.secondary.intimidate) || 0); + classBonuses.leader += classLevels * (parseInt(item.system.secondary.leadership) || 0); + classBonuses.persua += classLevels * (parseInt(item.system.secondary.persuasion) || 0); + classBonuses.street += classLevels * (parseInt(item.system.secondary.streetwise) || 0); + classBonuses.style += classLevels * (parseInt(item.system.secondary.style) || 0); + classBonuses.trading += classLevels * (parseInt(item.system.secondary.trading) || 0); + classBonuses.notice += classLevels * (parseInt(item.system.secondary.notice) || 0); + classBonuses.search += classLevels * (parseInt(item.system.secondary.search) || 0); + classBonuses.track += classLevels * (parseInt(item.system.secondary.track) || 0); + classBonuses.kiDect += classLevels * (parseInt(item.system.secondary.kidetection) || 0); + classBonuses.animals += classLevels * (parseInt(item.system.secondary.animals) || 0); + classBonuses.appra += classLevels * (parseInt(item.system.secondary.appraisal) || 0); + classBonuses.archi += classLevels * (parseInt(item.system.secondary.architecture) || 0); + classBonuses.herb += classLevels * (parseInt(item.system.secondary.herballore) || 0); + classBonuses.hist += classLevels * (parseInt(item.system.secondary.history) || 0); + classBonuses.law += classLevels * (parseInt(item.system.secondary.law) || 0); + classBonuses.magicapr += classLevels * (parseInt(item.system.secondary.magicappr) || 0); + classBonuses.medic += classLevels * (parseInt(item.system.secondary.medicine) || 0); + classBonuses.mem += classLevels * (parseInt(item.system.secondary.memorize) || 0); + classBonuses.navi += classLevels * (parseInt(item.system.secondary.navigation) || 0); + classBonuses.occ += classLevels * (parseInt(item.system.secondary.occult) || 0); + classBonuses.science += classLevels * (parseInt(item.system.secondary.science) || 0); + classBonuses.tactic += classLevels * (parseInt(item.system.secondary.tactics) || 0); + classBonuses.techmagic += classLevels * (parseInt(item.system.secondary.technomagic) || 0); + classBonuses.comp += classLevels * (parseInt(item.system.secondary.composure) || 0); + classBonuses.fos += classLevels * (parseInt(item.system.secondary.featsofstr) || 0); + classBonuses.wstp += classLevels * (parseInt(item.system.secondary.withstpain) || 0); + classBonuses.disg += classLevels * (parseInt(item.system.secondary.disguise) || 0); + classBonuses.hide += classLevels * (parseInt(item.system.secondary.hide) || 0); + classBonuses.lock += classLevels * (parseInt(item.system.secondary.lockpicking) || 0); + classBonuses.poisn += classLevels * (parseInt(item.system.secondary.poisons) || 0); + classBonuses.stealth += classLevels * (parseInt(item.system.secondary.stealth) || 0); + classBonuses.theft += classLevels * (parseInt(item.system.secondary.theft) || 0); + classBonuses.trapl += classLevels * (parseInt(item.system.secondary.traplore) || 0); + classBonuses.kiCon += classLevels * (parseInt(item.system.secondary.kiconceal) || 0); + classBonuses.alche += classLevels * (parseInt(item.system.secondary.alchemy) || 0); + classBonuses.anims += classLevels * (parseInt(item.system.secondary.animism) || 0); + classBonuses.art += classLevels * (parseInt(item.system.secondary.art) || 0); + classBonuses.cook += classLevels * (parseInt(item.system.secondary.cooking) || 0); + classBonuses.dance += classLevels * (parseInt(item.system.secondary.dance) || 0); + classBonuses.forgi += classLevels * (parseInt(item.system.secondary.forging) || 0); + classBonuses.jewel += classLevels * (parseInt(item.system.secondary.jewelry) || 0); + classBonuses.toy += classLevels * (parseInt(item.system.secondary.toymaking) || 0); + classBonuses.music += classLevels * (parseInt(item.system.secondary.music) || 0); + classBonuses.runes += classLevels * (parseInt(item.system.secondary.runes) || 0); + classBonuses.ritcal += classLevels * (parseInt(item.system.secondary.ritualcalig) || 0); + classBonuses.soh += classLevels * (parseInt(item.system.secondary.slofhand) || 0); + classBonuses.tailoring += classLevels * (parseInt(item.system.secondary.tailoring) || 0); } if (item.type === "armor") { if (item.system.equipped == true) { - arr[64] += parseInt(item.system.quantity) || 0; - arr[65] += parseInt(item.system.newRequirement) || 0; - arr[66] += parseInt(item.system.newNatPenalty) || 0; - arr[67] += parseInt(item.system.newMovePenalty) || 0; - if (arr[68] < item.system.AT.newCut) { - arr[68] = item.system.AT.newCut; + classBonuses.quantity += parseInt(item.system.quantity) || 0; + classBonuses.req += parseInt(item.system.newRequirement) || 0; + classBonuses.natPen += parseInt(item.system.newNatPenalty) || 0; + classBonuses.movePen += parseInt(item.system.newMovePenalty) || 0; + if (classBonuses.aCutMax < item.system.AT.newCut) { + classBonuses.aCutMax = item.system.AT.newCut; } - arr[69] += parseInt(item.system.AT.newCut / 2) || 0; - if (arr[70] < item.system.AT.newImp) { - arr[70] = item.system.AT.newImp; + classBonuses.aCutTot += parseInt(item.system.AT.newCut / 2) || 0; + if (classBonuses.aImpMax < item.system.AT.newImp) { + classBonuses.aImpMax = item.system.AT.newImp; } - arr[71] += parseInt(item.system.AT.newImp / 2) || 0; - if (arr[72] < item.system.AT.newThr) { - arr[72] = item.system.AT.newThr; + classBonuses.aImpTot += parseInt(item.system.AT.newImp / 2) || 0; + if (classBonuses.aThrMax < item.system.AT.newThr) { + classBonuses.aThrMax = item.system.AT.newThr; } - arr[73] += parseInt(item.system.AT.newThr / 2) || 0; - if (arr[74] < item.system.AT.newHeat) { - arr[74] = item.system.AT.newHeat; + classBonuses.aThrTot += parseInt(item.system.AT.newThr / 2) || 0; + if (classBonuses.aHeatMax < item.system.AT.newHeat) { + classBonuses.aHeatMax = item.system.AT.newHeat; } - arr[75] += parseInt(item.system.AT.newHeat / 2) || 0; - if (arr[76] < item.system.AT.newCold) { - arr[76] = item.system.AT.newCold; + classBonuses.aHeatTot += parseInt(item.system.AT.newHeat / 2) || 0; + if (classBonuses.aColdMax < item.system.AT.newCold) { + classBonuses.aColdMax = item.system.AT.newCold; } - arr[77] += parseInt(item.system.AT.newCold / 2) || 0; - if (arr[78] < item.system.AT.newEle) { - arr[78] = item.system.AT.newEle; + classBonuses.aColdTot += parseInt(item.system.AT.newCold / 2) || 0; + if (classBonuses.aEleMax < item.system.AT.newEle) { + classBonuses.aEleMax = item.system.AT.newEle; } - arr[79] += parseInt(item.system.AT.newEle / 2) || 0; - if (arr[80] < item.system.AT.newEne) { - arr[80] = item.system.AT.newEne; + classBonuses.aEleTot += parseInt(item.system.AT.newEle / 2) || 0; + if (classBonuses.aEneMax < item.system.AT.newEne) { + classBonuses.aEneMax = item.system.AT.newEne; } - arr[81] += parseInt(item.system.AT.newEne / 2) || 0; - if (arr[82] < item.system.AT.newSpt) { - arr[82] = item.system.AT.newSpt; + classBonuses.aEneTot += parseInt(item.system.AT.newEne / 2) || 0; + if (classBonuses.aSptMax < item.system.AT.newSpt) { + classBonuses.aSptMax = item.system.AT.newSpt; } - arr[83] += parseInt(item.system.AT.newSpt / 2) || 0; + classBonuses.aSptTot += parseInt(item.system.AT.newSpt / 2) || 0; } } if (item.type === "armorHelmet") { if (item.system.equipped == true) { - arr[84] += parseInt(item.system.newRequirement) || 0; - if (arr[85] < item.system.AT.newCut) { - arr[85] = item.system.AT.newCut; + classBonuses.ahReq += parseInt(item.system.newRequirement) || 0; + if (classBonuses.ahCutMax < item.system.AT.newCut) { + classBonuses.ahCutMax = item.system.AT.newCut; } - arr[86] += parseInt(item.system.AT.newCut / 2) || 0; - if (arr[87] < item.system.AT.newImp) { - arr[87] = item.system.AT.newImp; + classBonuses.ahCutTot += parseInt(item.system.AT.newCut / 2) || 0; + if (classBonuses.ahImpMax < item.system.AT.newImp) { + classBonuses.ahImpMax = item.system.AT.newImp; } - arr[88] += parseInt(item.system.AT.newImp / 2) || 0; - if (arr[89] < item.system.AT.newThr) { - arr[89] = item.system.AT.newThr; + classBonuses.ahImpTot += parseInt(item.system.AT.newImp / 2) || 0; + if (classBonuses.ahThrMax < item.system.AT.newThr) { + classBonuses.ahThrMax = item.system.AT.newThr; } - arr[90] += parseInt(item.system.AT.newThr / 2) || 0; - if (arr[91] < item.system.AT.newHeat) { - arr[91] = item.system.AT.newHeat; + classBonuses.ahThrTot += parseInt(item.system.AT.newThr / 2) || 0; + if (classBonuses.ahHeatMax < item.system.AT.newHeat) { + classBonuses.ahHeatMax = item.system.AT.newHeat; } - arr[92] += parseInt(item.system.AT.newHeat / 2) || 0; - if (arr[93] < item.system.AT.newCold) { - arr[93] = item.system.AT.newCold; + classBonuses.ahHeatTot += parseInt(item.system.AT.newHeat / 2) || 0; + if (classBonuses.ahColdMax < item.system.AT.newCold) { + classBonuses.ahColdMax = item.system.AT.newCold; } - arr[94] += parseInt(item.system.AT.newCold / 2) || 0; - if (arr[95] < item.system.AT.newEle) { - arr[95] = item.system.AT.newEle; + classBonuses.ahColdTot += parseInt(item.system.AT.newCold / 2) || 0; + if (classBonuses.ahEleMax < item.system.AT.newEle) { + classBonuses.ahEleMax = item.system.AT.newEle; } - arr[96] += parseInt(item.system.AT.newEle / 2) || 0; - if (arr[97] < item.system.AT.newEne) { - arr[97] = item.system.AT.newEne; + classBonuses.ahEleTot += parseInt(item.system.AT.newEle / 2) || 0; + if (classBonuses.ahEneMax < item.system.AT.newEne) { + classBonuses.ahEneMax = item.system.AT.newEne; } - arr[98] += parseInt(item.system.AT.newEne / 2) || 0; - if (arr[99] < item.system.AT.newSpt) { - arr[99] = item.system.AT.newSpt; + classBonuses.ahEneTot += parseInt(item.system.AT.newEne / 2) || 0; + if (classBonuses.ahSptMax < item.system.AT.newSpt) { + classBonuses.ahSptMax = item.system.AT.newSpt; } - arr[100] += parseInt(item.system.AT.newSpt / 2) || 0; - arr[101] += parseInt(item.system.newNatPenalty) || 0; + classBonuses.ahSptTot += parseInt(item.system.AT.newSpt / 2) || 0; + classBonuses.perPen += parseInt(item.system.newNatPenalty) || 0; } } if (item.type === "discipline") { - arr[102] += parseInt(item.system.quantity) || 0; + classBonuses.usedpp += parseInt(item.system.quantity) || 0; } if (item.type === "psychicMatrix") { - arr[102] += parseInt(item.system.quantity) || 0; + classBonuses.usedpp += parseInt(item.system.quantity) || 0; if (system.toggles.psychicStrengthening == true) { - arr[103] += parseInt(item.system.bonus / 20) || 0; + classBonuses.matrixpp += parseInt(item.system.bonus / 20) || 0; } else { - arr[103] += parseInt(item.system.bonus / 10) || 0; + classBonuses.matrixpp += parseInt(item.system.bonus / 10) || 0; } } if (item.type === "arsMagnus") { - arr[104] += parseInt(item.system.mk) || 0; + classBonuses.arsMk += parseInt(item.system.mk) || 0; } if (item.type === "martialArt") { - arr[105] += parseInt(item.system.mk) || 0; - arr[113] += parseInt(item.system.bonusAtk) || 0; - arr[114] += parseInt(item.system.bonusDef) || 0; - arr[115] += parseInt(item.system.bonusDod) || 0; + classBonuses.maMk += parseInt(item.system.mk) || 0; + classBonuses.maKiAtk += parseInt(item.system.bonusAtk) || 0; + classBonuses.maKiBlk += parseInt(item.system.bonusDef) || 0; + classBonuses.maKiDod += parseInt(item.system.bonusDod) || 0; } if (item.type === "kiTechnique") { - arr[106] += parseInt(item.system.mk) || 0; + classBonuses.techMk += parseInt(item.system.mk) || 0; } if (item.type === "spellPath") { - arr[107] += parseInt(item.system.level) || 0; + classBonuses.pathLvl += parseInt(item.system.level) || 0; } if (item.type === "turnMaint") { if (item.system.equipped == true) { - arr[108] += parseInt(item.system.zeon) || 0; + classBonuses.turnMaint += parseInt(item.system.zeon) || 0; } } if (item.type === "dailyMaint") { if (item.system.equipped == true) { - arr[109] += parseInt(item.system.zeon) || 0; + classBonuses.dayMaint += parseInt(item.system.zeon) || 0; } } if (item.type === "spell") { if (item.system.bought == "Single") { - arr[110] += parseInt(item.system.cost) || 0; + classBonuses.spellCost += parseInt(item.system.cost) || 0; } } if (item.type === "weapon") { if (item.system.equipped == true) { - arr[111] += 1; - if (arr[111] == 1) { - arr[112] = item.system.FinalWeaponSpeed; - arr[122] = item.name; - } else if (arr[112] > item.system.FinalWeaponSpeed) { - arr[112] = item.system.FinalWeaponSpeed; + classBonuses.wepNum += 1; + if (classBonuses.wepNum == 1) { + classBonuses.wepSpd = item.system.FinalWeaponSpeed; + classBonuses.wepName = item.name; + } else if (classBonuses.wepSpd > item.system.FinalWeaponSpeed) { + classBonuses.wepSpd = item.system.FinalWeaponSpeed; } } } if (item.type === "monsterPower") { - arr[123] += parseInt(item.system.cost) || 0; + classBonuses.monsterCost += parseInt(item.system.cost) || 0; } - return arr; - }, [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0]); - + }); //Stuff Xp, Presence, Next lvl Xp - system.level = level; //class Bonus - if (system.level == 0) { - system.dp = 400 + system.levelinfo.dpmod + system.levelinfo.dpmodBonus; + system.levelinfo.level = classBonuses.level; //class Bonus + if (system.levelinfo.level == 0) { + system.levelinfo.dp = 400 + system.levelinfo.dpmod + system.levelinfo.dpmodBonus; } else { - system.dp = Math.floor((system.level * 100) + 500 + system.levelinfo.dpmod + system.levelinfo.dpmodBonus); + system.levelinfo.dp = Math.floor((system.levelinfo.level * 100) + 500 + system.levelinfo.dpmod + system.levelinfo.dpmodBonus); } - system.presence = Math.floor((system.dp / 20) + system.levelinfo.presencemod + system.levelinfo.presencemodBonus); - system.nextlevel = Math.floor(((system.level + system.levelinfo.levelmod + system.levelinfo.levelmodBonus) * 25) + 75); + system.levelinfo.presence = Math.floor((system.levelinfo.dp / 20) + system.levelinfo.presencemod + system.levelinfo.presencemodBonus); + system.levelinfo.nextlevel = Math.floor(((system.levelinfo.level + system.levelinfo.levelmod + system.levelinfo.levelmodBonus) * 25) + 75); //Mk Calculations - system.mkBonus = mk; //Class Mk - system.kiThingMK = 0; //Ki Abilities Cost + system.mk.class = classBonuses.mk; //Class Mk + system.mk.kiAbilitiesCost = 0; //Ki Abilities Cost for (let [key, kiThing] of Object.entries(system.kiAbility)) { if (kiThing.status == true && kiThing.status2 == false) { - system.kiThingMK += kiThing.cost; + system.mk.kiAbilitiesCost += kiThing.cost; } else { - system.kiThingMK += 0; + system.mk.kiAbilitiesCost += 0; } } - system.kiSealMk = 0; //Minor & Major Seals Cost + system.mk.kiSealCost = 0; //Minor & Major Seals Cost for (let [key, kiSealStuff] of Object.entries(system.kiSeal.minor)) { if (kiSealStuff.mastery == true && kiSealStuff.mastery2 == false) { - system.kiSealMk += 30; + system.mk.kiSealCost += 30; } else { - system.kiSealMk += 0; + system.mk.kiSealCost += 0; } } for (let [key, kiSealStuff] of Object.entries(system.kiSeal.major)) { if (kiSealStuff.mastery == true && kiSealStuff.mastery2 == false) { - system.kiSealMk += 50; + system.mk.kiSealCost += 50; } else { - system.kiSealMk += 0; + system.mk.kiSealCost += 0; } } switch (system.limits.limitOne) { case "mors": - system.limitOneCost = 30; + system.mk.limitOneCost = 30; break; case "cenobus": - system.limitOneCost = 20; + system.mk.limitOneCost = 20; break; case "caelum": - system.limitOneCost = 15; + system.mk.limitOneCost = 15; break; case "agon": - system.limitOneCost = 20; + system.mk.limitOneCost = 20; break; case "custodium": - system.limitOneCost = 10; + system.mk.limitOneCost = 10; break; case "cruor": - system.limitOneCost = 10; + system.mk.limitOneCost = 10; break; case "terminus": - system.limitOneCost = 10; + system.mk.limitOneCost = 10; break; default: - system.limitOneCost = 0; + system.mk.limitOneCost = 0; break; } switch (system.limits.limitTwo) { case "mors": - system.limitTwoCost = 30; + system.mk.limitTwoCost = 30; break; case "cenobus": - system.limitTwoCost = 20; + system.mk.limitTwoCost = 20; break; case "caelum": - system.limitTwoCost = 15; + system.mk.limitTwoCost = 15; break; case "agon": - system.limitTwoCost = 20; + system.mk.limitTwoCost = 20; break; case "custodium": - system.limitTwoCost = 10; + system.mk.limitTwoCost = 10; break; case "cruor": - system.limitTwoCost = 10; + system.mk.limitTwoCost = 10; break; case "terminus": - system.limitTwoCost = 10; + system.mk.limitTwoCost = 10; break; default: - system.limitTwoCost = 0; + system.mk.limitTwoCost = 0; break; } - system.limitsMK = +system.limitOneCost + +system.limitTwoCost; //Limits Cost - system.arsMagMK = arsMk; //Ars Magnus Cost - system.mArtMk = maMk; //Martial Arts Bonus MK - system.kiTechMk = techMk; //Ki Technique Cost - system.mkFinal = Math.floor(system.mk.base + system.mk.temp + system.mk.spec + system.mk.bonus + system.mkBonus + system.mArtMk); //Total Final Mk - system.mkUsed = Math.floor(system.limitsMK + system.kiThingMK + system.kiSealMk + system.arsMagMK + system.kiTechMk); //Total Used Mk + system.mk.limitsTotalCost = +system.mk.limitOneCost + +system.mk.limitTwoCost; //Limits Cost + system.mk.arsMagCost = classBonuses.arsMk; //Ars Magnus Cost + system.mk.martialArtsCost = classBonuses.maMk; //Martial Arts Bonus MK + system.mk.kiTechCost = classBonuses.techMk; //Ki Technique Cost + system.mk.final = Math.floor(system.mk.base + system.mk.temp + system.mk.spec + system.mk.bonus + system.mk.class + system.mk.martialArtsCost); //Total Final Mk + system.mk.used = Math.floor(system.mk.limitsTotalCost + system.mk.kiAbilitiesCost + system.mk.kiSealCost + system.mk.arsMagCost + system.mk.kiTechCost); //Total Used Mk // Wear Armor - system.weararmorbonus = weararm; - system.wearArmorFinal += weararm; + system.armor.wearArmor.class = classBonuses.weararm; + system.armor.wearArmor.final += classBonuses.weararm; if (system.kiAbility.kiEnergyArmor.status == true) { //Energy armor add 2 energy AT for free - system.enArm = 2; + system.otherStats.enArm = 2; if (system.toggles.greaterEnergyArmor == true && system.kiAbility.kiArcaneArmor.status == false) { //Greater energy armor only if arcane is not bought - system.enArm = 4; + system.otherStats.enArm = 4; } else if (system.kiAbility.kiArcaneArmor.status == true) { - system.enArm = 4; + system.otherStats.enArm = 4; system.toggles.greaterEnergyArmor = false; if (system.toggles.arcaneEnergyArmor == true) { - system.enArm = 6; + system.otherStats.enArm = 6; } } } else { - system.enArm = 0; + system.otherStats.enArm = 0; } if (system.kiAbility.kiGreaterArmor.status == false) { system.toggles.greaterEnergyArmor = false; @@ -1410,50 +1374,50 @@ export default class abfalterActor extends Actor { system.toggles.arcaneEnergyArmor = false; } // Armor Final AT - system.aCutFinal = Math.floor((aCutTot - ~~(aCutMax / 2)) + aCutMax); - system.aImpFinal = Math.floor((aImpTot - ~~(aImpMax / 2)) + aImpMax); - system.aThrFinal = Math.floor((aThrTot - ~~(aThrMax / 2)) + aThrMax); - system.aHeatFinal = Math.floor((aHeatTot - ~~(aHeatMax / 2)) + aHeatMax); - system.aColdFinal = Math.floor((aColdTot - ~~(aColdMax / 2)) + aColdMax); - system.aEleFinal = Math.floor((aEleTot - ~~(aEleMax / 2)) + aEleMax); - system.aEneFinal = Math.floor((aEneTot - ~~(aEneMax / 2)) + aEneMax + system.enArm); - system.aSptFinal = Math.floor((aSptTot - ~~(aSptMax / 2)) + aSptMax); + system.armor.body.aCutFinal = Math.floor((classBonuses.aCutTot - ~~(classBonuses.aCutMax / 2)) + classBonuses.aCutMax); + system.armor.body.aImpFinal = Math.floor((classBonuses.aImpTot - ~~(classBonuses.aImpMax / 2)) + classBonuses.aImpMax); + system.armor.body.aThrFinal = Math.floor((classBonuses.aThrTot - ~~(classBonuses.aThrMax / 2)) + classBonuses.aThrMax); + system.armor.body.aHeatFinal = Math.floor((classBonuses.aHeatTot - ~~(classBonuses.aHeatMax / 2)) + classBonuses.aHeatMax); + system.armor.body.aColdFinal = Math.floor((classBonuses.aColdTot - ~~(classBonuses.aColdMax / 2)) + classBonuses.aColdMax); + system.armor.body.aEleFinal = Math.floor((classBonuses.aEleTot - ~~(classBonuses.aEleMax / 2)) + classBonuses.aEleMax); + system.armor.body.aEneFinal = Math.floor((classBonuses.aEneTot - ~~(classBonuses.aEneMax / 2)) + classBonuses.aEneMax + system.otherStats.enArm); + system.armor.body.aSptFinal = Math.floor((classBonuses.aSptTot - ~~(classBonuses.aSptMax / 2)) + classBonuses.aSptMax); // Helmet Final AT - system.ahCutFinal = Math.floor((ahCutTot - ~~(ahCutMax / 2)) + ahCutMax); - system.ahImpFinal = Math.floor((ahImpTot - ~~(ahImpMax / 2)) + ahImpMax); - system.ahThrFinal = Math.floor((ahThrTot - ~~(ahThrMax / 2)) + ahThrMax); - system.ahHeatFinal = Math.floor((ahHeatTot - ~~(ahHeatMax / 2)) + ahHeatMax); - system.ahColdFinal = Math.floor((ahColdTot - ~~(ahColdMax / 2)) + ahColdMax); - system.ahEleFinal = Math.floor((ahEleTot - ~~(ahEleMax / 2)) + ahEleMax); - system.ahEneFinal = Math.floor((ahEneTot - ~~(ahEneMax / 2)) + ahEneMax); - system.ahSptFinal = Math.floor((ahSptTot - ~~(ahSptMax / 2)) + ahSptMax); + system.armor.helmet.ahCutFinal = Math.floor((classBonuses.ahCutTot - ~~(classBonuses.ahCutMax / 2)) + classBonuses.ahCutMax); + system.armor.helmet.ahImpFinal = Math.floor((classBonuses.ahImpTot - ~~(classBonuses.ahImpMax / 2)) + classBonuses.ahImpMax); + system.armor.helmet.ahThrFinal = Math.floor((classBonuses.ahThrTot - ~~(classBonuses.ahThrMax / 2)) + classBonuses.ahThrMax); + system.armor.helmet.ahHeatFinal = Math.floor((classBonuses.ahHeatTot - ~~(classBonuses.ahHeatMax / 2)) + classBonuses.ahHeatMax); + system.armor.helmet.ahColdFinal = Math.floor((classBonuses.ahColdTot - ~~(classBonuses.ahColdMax / 2)) + classBonuses.ahColdMax); + system.armor.helmet.ahEleFinal = Math.floor((classBonuses.ahEleTot - ~~(classBonuses.ahEleMax / 2)) + classBonuses.ahEleMax); + system.armor.helmet.ahEneFinal = Math.floor((classBonuses.ahEneTot - ~~(classBonuses.ahEneMax / 2)) + classBonuses.ahEneMax); + system.armor.helmet.ahSptFinal = Math.floor((classBonuses.ahSptTot - ~~(classBonuses.ahSptMax / 2)) + classBonuses.ahSptMax); // Armor Stats - system.totalPerPen = perPen; - system.armorMod = Math.floor(system.wearArmorFinal - req); - if (natPen - system.armorMod < 0) { - system.totalNatPen = Math.max(0, Math.floor(((quantity - 1) * 20) + 0)); + system.armor.wearArmor.totalPerPen = classBonuses.perPen; + system.armor.wearArmor.mod = Math.floor(system.armor.wearArmor.final - classBonuses.req); + if (classBonuses.natPen - system.armor.wearArmor.mod < 0) { + system.armor.wearArmor.totalNatPen = Math.max(0, Math.floor(((classBonuses.quantity - 1) * 20) + 0)); } else { - system.totalNatPen = Math.max(0, Math.floor(((quantity - 1) * 20) + (natPen - system.armorMod))); + system.armor.wearArmor.totalNatPen = Math.max(0, Math.floor(((classBonuses.quantity - 1) * 20) + (classBonuses.natPen - system.armor.wearArmor.mod))); } - system.movePenMod = Math.max(0, Math.floor(system.armorMod / 50)); - if (movePen - system.movePenMod < 0) { - system.totalMovePen = -Math.floor(movePen + Math.max(0, system.totalNatPen / 50)); + system.armor.wearArmor.movePenMod = Math.max(0, Math.floor(system.armor.wearArmor.mod / 50)); + if (classBonuses.movePen - system.armor.wearArmor.movePenMod < 0) { + system.armor.wearArmor.totalMovePen = -Math.floor(classBonuses.movePen + Math.max(0, system.armor.wearArmor.totalNatPen / 50)); } else { - system.totalMovePen = -Math.floor(movePen + Math.max(0, system.totalNatPen / 50) - system.movePenMod); + system.armor.wearArmor.totalMovePen = -Math.floor(classBonuses.movePen + Math.max(0, system.armor.wearArmor.totalNatPen / 50) - system.armor.wearArmor.movePenMod); } //Resistances if (system.kiAbility.kiPhysDom.status == true) { //Physical Dominion adds 10 PhR - system.phrDom = 10; + system.otherStats.phrDom = 10; } else { - system.phrDom = 0; + system.otherStats.phrDom = 0; } if (system.kiAbility.nemiBodyEmpty.status == true) { //Physical Dominion adds 20 PhR - system.allEmpty = 20; + system.otherStats.allEmpty = 20; } else { - system.allEmpty = 0; + system.otherStats.allEmpty = 0; } for (let [key, res] of Object.entries(system.resistances)) { @@ -1461,27 +1425,27 @@ export default class abfalterActor extends Actor { case "Physical": res.name = game.i18n.localize('abfalter.sheet.physicalRes'); res.short = game.i18n.localize('abfalter.sheet.phr'); - res.final = Math.floor(system.presence + res.mod + stats.Constitution.mod + system.phrDom + system.allEmpty + res.bonus); + res.final = Math.floor(system.levelinfo.presence + res.mod + stats.Constitution.mod + system.otherStats.phrDom + system.otherStats.allEmpty + res.bonus); break; case "Disease": res.name = game.i18n.localize('abfalter.sheet.diseaseRes'); res.short = game.i18n.localize('abfalter.sheet.dr'); - res.final = Math.floor(system.presence + res.mod + stats.Constitution.mod + system.allEmpty + res.bonus); + res.final = Math.floor(system.levelinfo.presence + res.mod + stats.Constitution.mod + system.otherStats.allEmpty + res.bonus); break; case "Poison": res.name = game.i18n.localize('abfalter.sheet.poisonRes'); res.short = game.i18n.localize('abfalter.sheet.psnr'); - res.final = Math.floor(system.presence + res.mod + stats.Constitution.mod + system.allEmpty + res.bonus); + res.final = Math.floor(system.levelinfo.presence + res.mod + stats.Constitution.mod + system.otherStats.allEmpty + res.bonus); break; case "Magic": res.name = game.i18n.localize('abfalter.sheet.magicRes'); res.short = game.i18n.localize('abfalter.sheet.mr'); - res.final = Math.floor(system.presence + res.mod + stats.Power.mod + system.allEmpty + res.bonus); + res.final = Math.floor(system.levelinfo.presence + res.mod + stats.Power.mod + system.otherStats.allEmpty + res.bonus); break; case "Psychic": res.name = game.i18n.localize('abfalter.sheet.psychicRes'); res.short = game.i18n.localize('abfalter.sheet.psyr'); - res.final = Math.floor(system.presence + res.mod + stats.Willpower.mod + system.allEmpty + res.bonus); + res.final = Math.floor(system.levelinfo.presence + res.mod + stats.Willpower.mod + system.otherStats.allEmpty + res.bonus); break; default: break; @@ -1489,1136 +1453,767 @@ export default class abfalterActor extends Actor { } //Movement - system.finalmove = Math.floor(system.stats.Agility.final + system.movement.spec + system.movement.temp + system.movement.bonus + system.movement.sizeBase - system.movement.pen + Math.min(0, Math.ceil(system.aamFinal / 20)) + system.totalMovePen); - switch (system.finalmove) { + system.movement.final = Math.floor(system.stats.Agility.final + system.movement.spec + system.movement.temp + system.movement.bonus + system.movement.sizeBase - system.movement.pen + Math.min(0, Math.ceil(system.aamField.final / 20)) + system.armor.wearArmor.totalMovePen); + switch (system.movement.final) { case 1: - if (system.useMeters) { - system.fullmove = "<1 m."; - system.fourthmove = "<1 m."; - system.runningmove = "<1 m."; + if (system.other.useMeters) { + system.movement.fullMove = "<1 m."; + system.movement.fourthMove = "<1 m."; + system.movement.runningMove = "<1 m."; } else { - system.fullmove = "3 ft"; - system.fourthmove = "1 ft"; - system.runningmove = "N/A"; + system.movement.fullMove = "3 ft"; + system.movement.fourthMove = "1 ft"; + system.movement.runningMove = "N/A"; } break; case 2: - if (system.useMeters) { - system.fullmove = "4 m."; - system.fourthmove = "1 m."; - system.runningmove = "2 m."; + if (system.other.useMeters) { + system.movement.fullMove = "4 m."; + system.movement.fourthMove = "1 m."; + system.movement.runningMove = "2 m."; } else { - system.fullmove = "15 ft"; - system.fourthmove = "3 ft"; - system.runningmove = "7 ft"; + system.movement.fullMove = "15 ft"; + system.movement.fourthMove = "3 ft"; + system.movement.runningMove = "7 ft"; } break; case 3: - if (system.useMeters) { - system.fullmove = "8 m."; - system.fourthmove = "2 m."; - system.runningmove = "4 m."; + if (system.other.useMeters) { + system.movement.fullMove = "8 m."; + system.movement.fourthMove = "2 m."; + system.movement.runningMove = "4 m."; } else { - system.fullmove = "25 ft"; - system.fourthmove = "6 ft"; - system.runningmove = "12 ft"; + system.movement.fullMove = "25 ft"; + system.movement.fourthMove = "6 ft"; + system.movement.runningMove = "12 ft"; } break; case 4: - if (system.useMeters) { - system.fullmove = "15 m."; - system.fourthmove = "4 m."; - system.runningmove = "8 m."; + if (system.other.useMeters) { + system.movement.fullMove = "15 m."; + system.movement.fourthMove = "4 m."; + system.movement.runningMove = "8 m."; } else { - system.fullmove = "50 ft"; - system.fourthmove = "12 ft"; - system.runningmove = "15 ft"; + system.movement.fullMove = "50 ft"; + system.movement.fourthMove = "12 ft"; + system.movement.runningMove = "15 ft"; } break; case 5: - if (system.useMeters) { - system.fullmove = "20 m."; - system.fourthmove = "5 m."; - system.runningmove = "8 m."; + if (system.other.useMeters) { + system.movement.fullMove = "20 m."; + system.movement.fourthMove = "5 m."; + system.movement.runningMove = "8 m."; } else { - system.fullmove = "65 ft"; - system.fourthmove = "16 ft"; - system.runningmove = "25 ft"; + system.movement.fullMove = "65 ft"; + system.movement.fourthMove = "16 ft"; + system.movement.runningMove = "25 ft"; } break; case 6: - if (system.useMeters) { - system.fullmove = "22 m."; - system.fourthmove = "5 m."; - system.runningmove = "15 m."; + if (system.other.useMeters) { + system.movement.fullMove = "22 m."; + system.movement.fourthMove = "5 m."; + system.movement.runningMove = "15 m."; } else { - system.fullmove = "70 ft"; - system.fourthmove = "17 ft"; - system.runningmove = "50 ft"; + system.movement.fullMove = "70 ft"; + system.movement.fourthMove = "17 ft"; + system.movement.runningMove = "50 ft"; } break; case 7: - if (system.useMeters) { - system.fullmove = "25 m."; - system.fourthmove = "6 m."; - system.runningmove = "20 m."; + if (system.other.useMeters) { + system.movement.fullMove = "25 m."; + system.movement.fourthMove = "6 m."; + system.movement.runningMove = "20 m."; } else { - system.fullmove = "80 ft"; - system.fourthmove = "20 ft"; - system.runningmove = "65 ft"; + system.movement.fullMove = "80 ft"; + system.movement.fourthMove = "20 ft"; + system.movement.runningMove = "65 ft"; } break; case 8: - if (system.useMeters) { - system.fullmove = "28 m."; - system.fourthmove = "7 m."; - system.runningmove = "22 m."; + if (system.other.useMeters) { + system.movement.fullMove = "28 m."; + system.movement.fourthMove = "7 m."; + system.movement.runningMove = "22 m."; } else { - system.fullmove = "90 ft"; - system.fourthmove = "22 ft"; - system.runningmove = "70 ft"; + system.movement.fullMove = "90 ft"; + system.movement.fourthMove = "22 ft"; + system.movement.runningMove = "70 ft"; } break; case 9: - if (system.useMeters) { - system.fullmove = "32 m."; - system.fourthmove = "8 m."; - system.runningmove = "25 m."; + if (system.other.useMeters) { + system.movement.fullMove = "32 m."; + system.movement.fourthMove = "8 m."; + system.movement.runningMove = "25 m."; } else { - system.fullmove = "105 ft"; - system.fourthmove = "26 ft"; - system.runningmove = "80 ft"; + system.movement.fullMove = "105 ft"; + system.movement.fourthMove = "26 ft"; + system.movement.runningMove = "80 ft"; } break; case 10: - if (system.useMeters) { - system.fullmove = "35 m."; - system.fourthmove = "9 m."; - system.runningmove = "28 m."; + if (system.other.useMeters) { + system.movement.fullMove = "35 m."; + system.movement.fourthMove = "9 m."; + system.movement.runningMove = "28 m."; } else { - system.fullmove = "115 ft"; - system.fourthmove = "28 ft"; - system.runningmove = "90 ft"; + system.movement.fullMove = "115 ft"; + system.movement.fourthMove = "28 ft"; + system.movement.runningMove = "90 ft"; } break; case 11: - if (system.useMeters) { - system.fullmove = "40 m."; - system.fourthmove = "10 m."; - system.runningmove = "32 m."; + if (system.other.useMeters) { + system.movement.fullMove = "40 m."; + system.movement.fourthMove = "10 m."; + system.movement.runningMove = "32 m."; } else { - system.fullmove = "130 ft"; - system.fourthmove = "32 ft"; - system.runningmove = "105 ft"; + system.movement.fullMove = "130 ft"; + system.movement.fourthMove = "32 ft"; + system.movement.runningMove = "105 ft"; } break; case 12: - if (system.useMeters) { - system.fullmove = "50 m."; - system.fourthmove = "12 m."; - system.runningmove = "35 m."; + if (system.other.useMeters) { + system.movement.fullMove = "50 m."; + system.movement.fourthMove = "12 m."; + system.movement.runningMove = "35 m."; } else { - system.fullmove = "160 ft"; - system.fourthmove = "40 ft"; - system.runningmove = "115 ft"; + system.movement.fullMove = "160 ft"; + system.movement.fourthMove = "40 ft"; + system.movement.runningMove = "115 ft"; } break; case 13: - if (system.useMeters) { - system.fullmove = "80 m."; - system.fourthmove = "20 m."; - system.runningmove = "40 m."; + if (system.other.useMeters) { + system.movement.fullMove = "80 m."; + system.movement.fourthMove = "20 m."; + system.movement.runningMove = "40 m."; } else { - system.fullmove = "250 ft"; - system.fourthmove = "62 ft"; - system.runningmove = "130 ft"; + system.movement.fullMove = "250 ft"; + system.movement.fourthMove = "62 ft"; + system.movement.runningMove = "130 ft"; } break; case 14: - if (system.useMeters) { - system.fullmove = "150 m."; - system.fourthmove = "37 m."; - system.runningmove = "50 m."; + if (system.other.useMeters) { + system.movement.fullMove = "150 m."; + system.movement.fourthMove = "37 m."; + system.movement.runningMove = "50 m."; } else { - system.fullmove = "500 ft"; - system.fourthmove = "125 ft"; - system.runningmove = "160 ft"; + system.movement.fullMove = "500 ft"; + system.movement.fourthMove = "125 ft"; + system.movement.runningMove = "160 ft"; } break; case 15: - if (system.useMeters) { - system.fullmove = "250 m."; - system.fourthmove = "62 m."; - system.runningmove = "80 m."; + if (system.other.useMeters) { + system.movement.fullMove = "250 m."; + system.movement.fourthMove = "62 m."; + system.movement.runningMove = "80 m."; } else { - system.fullmove = "800 ft"; - system.fourthmove = "200 ft"; - system.runningmove = "250 ft"; + system.movement.fullMove = "800 ft"; + system.movement.fourthMove = "200 ft"; + system.movement.runningMove = "250 ft"; } break; case 16: - if (system.useMeters) { - system.fullmove = "500 m."; - system.fourthmove = "125 m."; - system.runningmove = "150 m."; + if (system.other.useMeters) { + system.movement.fullMove = "500 m."; + system.movement.fourthMove = "125 m."; + system.movement.runningMove = "150 m."; } else { - system.fullmove = "1500 ft"; - system.fourthmove = "375 ft"; - system.runningmove = "500 ft"; + system.movement.fullMove = "1500 ft"; + system.movement.fourthMove = "375 ft"; + system.movement.runningMove = "500 ft"; } break; case 17: - if (system.useMeters) { - system.fullmove = "1 Km."; - system.fourthmove = "250 m."; - system.runningmove = "500 m."; + if (system.other.useMeters) { + system.movement.fullMove = "1 Km."; + system.movement.fourthMove = "250 m."; + system.movement.runningMove = "500 m."; } else { - system.fullmove = "3000 ft"; - system.fourthmove = "750 ft"; - system.runningmove = "1500 ft"; + system.movement.fullMove = "3000 ft"; + system.movement.fourthMove = "750 ft"; + system.movement.runningMove = "1500 ft"; } break; case 18: - if (system.useMeters) { - system.fullmove = "5 Km."; - system.fourthmove = "1.2 Km."; - system.runningmove = "2.5 Km."; + if (system.other.useMeters) { + system.movement.fullMove = "5 Km."; + system.movement.fourthMove = "1.2 Km."; + system.movement.runningMove = "2.5 Km."; } else { - system.fullmove = "3 miles"; - system.fourthmove = "3960 ft"; - system.runningmove = "1.5 miles"; + system.movement.fullMove = "3 miles"; + system.movement.fourthMove = "3960 ft"; + system.movement.runningMove = "1.5 miles"; } break; case 19: - if (system.useMeters) { - system.fullmove = "25 Km."; - system.fourthmove = "6.2 Km."; - system.runningmove = "12.5 Km."; + if (system.other.useMeters) { + system.movement.fullMove = "25 Km."; + system.movement.fourthMove = "6.2 Km."; + system.movement.runningMove = "12.5 Km."; } else { - system.fullmove = "15 miles"; - system.fourthmove = "3.75 miles"; - system.runningmove = "7.5 miles"; + system.movement.fullMove = "15 miles"; + system.movement.fourthMove = "3.75 miles"; + system.movement.runningMove = "7.5 miles"; } break; case 20: - system.fullmove = game.i18n.localize('abfalter.basicInfo.special'); - system.fourthmove = game.i18n.localize('abfalter.basicInfo.special'); - system.runningmove = game.i18n.localize('abfalter.basicInfo.special'); + system.movement.fullMove = game.i18n.localize('abfalter.basicInfo.special'); + system.movement.fourthMove = game.i18n.localize('abfalter.basicInfo.special'); + system.movement.runningMove = game.i18n.localize('abfalter.basicInfo.special'); break; default: - system.fullmove = "0"; - system.fourthmove = "0"; - system.runningmove = "0"; + system.movement.fullMove = "0"; + system.movement.fourthMove = "0"; + system.movement.runningMove = "0"; break; } - if (system.finalmove > 20) { - system.fullmove = game.i18n.localize('abfalter.basicInfo.special'); - system.fourthmove = game.i18n.localize('abfalter.basicInfo.special'); - system.runningmove = game.i18n.localize('abfalter.basicInfo.special'); + if (system.movement.final > 20) { + system.movement.fullMove = game.i18n.localize('abfalter.basicInfo.special'); + system.movement.fourthMove = game.i18n.localize('abfalter.basicInfo.special'); + system.movement.runningMove = game.i18n.localize('abfalter.basicInfo.special'); } //Lifepoint Calculation - system.lpbonus = lpbonus; - system.lp.max += lpbonus; + system.lifepoints.class = classBonuses.lpbonus; + system.lp.max += classBonuses.lpbonus; // Attack, Block, & Dodge post class - system.attackbonus = atk + maKiAtk; - if (system.attackbonus > 50) { - system.attackbonus = 50; - } - system.atkfinal += system.attackbonus; - system.blockbonus = blk + maKiBlk; - if (system.blockbonus > 50) { - system.blockbonus = 50; - } - system.blkfinal += system.blockbonus; - system.dodgebonus = dod + maKiDod; - if (system.dodgebonus > 50) { - system.dodgebonus = 50; - } - system.dodfinal += system.dodgebonus; - - // Initiative - if (system.kiAbility.kiIncreaseSpd.status == true) { - system.KiBonusSpd = 10; - } else { - system.KiBonusSpd = 0; - } - system.inibonus = ini; - system.weaponNumber = wepNum; - system.weaponSpeed = wepSpd; - system.weaponName = wepName; - if (system.weaponNumber > 1 && system.weaponSpeed < 0) { - system.wepFinSpd = system.weaponSpeed - 20; - system.weaponName = game.i18n.localize('abfalter.basicInfo.multiWield'); - } else if (system.weaponNumber > 1 && system.weaponSpeed >= 0) { - system.wepFinSpd = system.weaponSpeed - 10; - system.weaponName = game.i18n.localize('abfalter.basicInfo.multiWield'); - } else if (system.weaponNumber == 0) { - system.wepFinSpd = 20; - system.weaponName = game.i18n.localize('abfalter.basicInfo.unarmed'); - } else { - system.wepFinSpd = system.weaponSpeed; - } - system.iniFinal = Math.floor(system.iniBase + system.inibonus + system.initiative.spec + system.initiative.bonus + system.KiBonusSpd + ~~system.wepFinSpd - system.totalNatPen); - - /* - Secondaries - */ - // Acrobatics system.totalNatPen - system.acrobaticsbonus = acro; - system.acrobaticsnat = Math.floor(stats.Agility.mod + system.secondary.acrobatics.natural + Math.ceil(system.secondary.acrobatics.nat * stats.Agility.mod)); - if (system.acrobaticsnat < 100) { - system.acrobaticsnatfinal = system.acrobaticsnat; - } else { - system.acrobaticsnatfinal = 100; + system.combatValues.attack.class = classBonuses.atk + classBonuses.maKiAtk; + if (system.combatValues.attack.class > 50) { + system.combatValues.attack.class = 50; } - system.acrofinal = Math.floor(system.secondary.acrobatics.bonus + system.secondary.acrobatics.temp + system.secondary.acrobatics.spec + system.secondary.acrobatics.base + system.acrobaticsbonus + system.acrobaticsnatfinal + system.aamFinal - system.totalNatPen); - - // Athelticism - system.athleticismbonus = athle; + system.combatValues.attack.final += system.combatValues.attack.class; - system.athleticismnat = Math.floor(stats.Agility.mod + system.secondary.athleticism.natural + Math.ceil(system.secondary.athleticism.nat * stats.Agility.mod)); - if (system.athleticismnat < 100) { - system.athleticismnatfinal = system.athleticismnat; - } else { - system.athleticismnatfinal = 100; + system.combatValues.block.class = classBonuses.blk + classBonuses.maKiBlk; + if (system.combatValues.block.class > 50) { + system.combatValues.block.class = 50; } - system.athleticismfinal = Math.floor(system.secondary.athleticism.bonus + system.secondary.athleticism.temp + system.secondary.athleticism.spec + system.secondary.athleticism.base + system.athleticismbonus + system.athleticismnatfinal + system.aamFinal - system.totalNatPen); + system.combatValues.block.final += system.combatValues.block.class; - // Climb - system.climbbonus = climb; - system.climbnat = Math.floor(stats.Agility.mod + system.secondary.climb.natural + Math.ceil(system.secondary.climb.nat * stats.Agility.mod)); - if (system.climbnat < 100) { - system.climbnatfinal = system.climbnat; - } else { - system.climbnatfinal = 100; - } - system.climbfinal = Math.floor(system.secondary.climb.bonus + system.secondary.climb.temp + system.secondary.climb.spec + system.secondary.climb.base + system.climbbonus + system.climbnatfinal + system.aamFinal - system.totalNatPen); - - // Jump - system.jumpbonus = jump; - system.jumpnat = Math.floor(stats.Strength.mod + system.secondary.jump.natural + Math.ceil(system.secondary.jump.nat * stats.Strength.mod)); - if (system.jumpnat < 100) { - system.jumpnatfinal = system.jumpnat; - } else { - system.jumpnatfinal = 100; - } - system.jumpfinal = Math.floor(system.secondary.jump.bonus + system.secondary.jump.temp + system.secondary.jump.spec + system.secondary.jump.base + system.jumpbonus + system.jumpnatfinal + system.aamFinal - system.totalNatPen); - - // Ride - system.ridebonus = ride; - system.ridenat = Math.floor(stats.Agility.mod + system.secondary.ride.natural + Math.ceil(system.secondary.ride.nat * stats.Agility.mod)); - if (system.ridenat < 100) { - system.ridenatfinal = system.ridenat; - } else { - system.ridenatfinal = 100; - } - system.ridefinal = Math.floor(system.secondary.ride.bonus + system.secondary.ride.temp + system.secondary.ride.spec + system.secondary.ride.base + system.ridebonus + system.ridenatfinal + system.aamFinal - system.totalNatPen); - - // Swim - system.swimbonus = swim; - system.swimnat = Math.floor(stats.Agility.mod + system.secondary.swim.natural + Math.ceil(system.secondary.swim.nat * stats.Agility.mod)); - if (system.swimnat < 100) { - system.swimnatfinal = system.swimnat; - } else { - system.swimnatfinal = 100; - } - system.swimfinal = Math.floor(system.secondary.swim.bonus + system.secondary.swim.temp + system.secondary.swim.spec + system.secondary.swim.base + system.swimbonus + system.swimnatfinal + system.aamFinal - system.totalNatPen); - - // etiquette - system.etiquettebonus = etiq; - system.etiquettenat = Math.floor(stats.Intelligence.mod + system.secondary.etiquette.natural + Math.ceil(system.secondary.etiquette.nat * stats.Intelligence.mod)); - if (system.etiquettenat < 100) { - system.etiquettenatfinal = system.etiquettenat; - } else { - system.etiquettenatfinal = 100; - } - system.etiquettefinal = Math.floor(system.secondary.etiquette.bonus + system.secondary.etiquette.temp + system.secondary.etiquette.spec + system.secondary.etiquette.base + system.etiquettebonus + system.etiquettenatfinal + system.aamFinal); - - // Intimidate - system.intimidatebonus = intim; - system.intimidatenat = Math.floor(stats.Willpower.mod + system.secondary.intimidate.natural + Math.ceil(system.secondary.intimidate.nat * stats.Willpower.mod)); - if (system.intimidatenat < 100) { - system.intimidatenatfinal = system.intimidatenat; - } else { - system.intimidatenatfinal = 100; + system.combatValues.dodge.class = classBonuses.dod + classBonuses.maKiDod; + if (system.combatValues.dodge.class > 50) { + system.combatValues.dodge.class = 50; } - system.intimidatefinal = Math.floor(system.secondary.intimidate.bonus + system.secondary.intimidate.temp + system.secondary.intimidate.spec + system.secondary.intimidate.base + system.intimidatebonus + system.intimidatenatfinal + system.aamFinal); + system.combatValues.dodge.final += system.combatValues.dodge.class; - // Leadership - system.leadershipbonus = leader; - system.leadershipnat = Math.floor(stats.Power.mod + system.secondary.leadership.natural + Math.ceil(system.secondary.leadership.nat * stats.Power.mod)); - if (system.leadershipnat < 100) { - system.leadershipnatfinal = system.leadershipnat; - } else { - system.leadershipnatfinal = 100; - } - system.leadershipfinal = Math.floor(system.secondary.leadership.bonus + system.secondary.leadership.temp + system.secondary.leadership.spec + system.secondary.leadership.base + system.leadershipbonus + system.leadershipnatfinal + system.aamFinal); - - // persuasion - system.persuasionbonus = persua; - system.persuasionnat = Math.floor(stats.Intelligence.mod + system.secondary.persuasion.natural + Math.ceil(system.secondary.persuasion.nat * stats.Intelligence.mod)); - if (system.persuasionnat < 100) { - system.persuasionnatfinal = system.persuasionnat; - } else { - system.persuasionnatfinal = 100; - } - system.persuasionfinal = Math.floor(system.secondary.persuasion.bonus + system.secondary.persuasion.temp + system.secondary.persuasion.spec + system.secondary.persuasion.base + system.persuasionbonus + system.persuasionnatfinal + system.aamFinal); - - // streetwise - system.streetwisebonus = street; - system.streetwisenat = Math.floor(stats.Intelligence.mod + system.secondary.streetwise.natural + Math.ceil(system.secondary.streetwise.nat * stats.Intelligence.mod)); - if (system.streetwisenat < 100) { - system.streetwisenatfinal = system.streetwisenat; - } else { - system.streetwisenatfinal = 100; - } - system.streetwisefinal = Math.floor(system.secondary.streetwise.bonus + system.secondary.streetwise.temp + system.secondary.streetwise.spec + system.secondary.streetwise.base + system.streetwisebonus + system.streetwisenatfinal + system.aamFinal); - - // style - system.stylebonus = style; - system.stylenat = Math.floor(stats.Power.mod + system.secondary.style.natural + Math.ceil(system.secondary.style.nat * stats.Power.mod)); - if (system.stylenat < 100) { - system.stylenatfinal = system.stylenat; - } else { - system.stylenatfinal = 100; - } - system.stylefinal = Math.floor(system.secondary.style.bonus + system.secondary.style.temp + system.secondary.style.spec + system.secondary.style.base + system.stylebonus + system.stylenatfinal + system.aamFinal); - - // trading - system.tradingbonus = trading; - system.tradingnat = Math.floor(stats.Intelligence.mod + system.secondary.trading.natural + Math.ceil(system.secondary.trading.nat * stats.Intelligence.mod)); - if (system.tradingnat < 100) { - system.tradingnatfinal = system.tradingnat; - } else { - system.tradingnatfinal = 100; - } - system.tradingfinal = Math.floor(system.secondary.trading.bonus + system.secondary.trading.temp + system.secondary.trading.spec + system.secondary.trading.base + system.tradingbonus + system.tradingnatfinal + system.aamFinal); - - // notice - system.noticebonus = notice; - system.noticenat = Math.floor(stats.Perception.mod + system.secondary.notice.natural + Math.ceil(system.secondary.notice.nat * stats.Perception.mod)); - if (system.noticenat < 100) { - system.noticenatfinal = system.noticenat; - } else { - system.noticenatfinal = 100; - } - system.noticefinal = Math.floor(system.secondary.notice.bonus + system.secondary.notice.temp + system.secondary.notice.spec + system.secondary.notice.base + system.noticebonus + system.noticenatfinal + system.aamFinal); - - // search - system.searchbonus = search; - system.searchnat = Math.floor(stats.Perception.mod + system.secondary.search.natural + Math.ceil(system.secondary.search.nat * stats.Perception.mod)); - if (system.searchnat < 100) { - system.searchnatfinal = system.searchnat; - } else { - system.searchnatfinal = 100; - } - system.searchfinal = Math.floor(system.secondary.search.bonus + system.secondary.search.temp + system.secondary.search.spec + system.secondary.search.base + system.searchbonus + system.searchnatfinal + system.aamFinal); - - // track - system.trackbonus = track; - system.tracknat = Math.floor(stats.Perception.mod + system.secondary.track.natural + Math.ceil(system.secondary.track.nat * stats.Perception.mod)); - if (system.tracknat < 100) { - system.tracknatfinal = system.tracknat; - } else { - system.tracknatfinal = 100; - } - system.trackfinal = Math.floor(system.secondary.track.bonus + system.secondary.track.temp + system.secondary.track.spec + system.secondary.track.base + system.trackbonus + system.tracknatfinal + system.aamFinal); - - // animals - system.animalsbonus = animals; - system.animalsnat = Math.floor(stats.Intelligence.mod + system.secondary.animals.natural + Math.ceil(system.secondary.animals.nat * stats.Intelligence.mod)); - if (system.animalsnat < 100) { - system.animalsnatfinal = system.animalsnat; - } else { - system.animalsnatfinal = 100; - } - system.animalsfinal = Math.floor(system.secondary.animals.bonus + system.secondary.animals.temp + system.secondary.animals.spec + system.secondary.animals.base + system.animalsbonus + system.animalsnatfinal + system.aamFinal); - - // appraisal - system.appraisalbonus = appra; - system.appraisalnat = Math.floor(stats.Intelligence.mod + system.secondary.appraisal.natural + Math.ceil(system.secondary.appraisal.nat * stats.Intelligence.mod)); - if (system.appraisalnat < 100) { - system.appraisalnatfinal = system.appraisalnat; - } else { - system.appraisalnatfinal = 100; - } - system.appraisalfinal = Math.floor(system.secondary.appraisal.bonus + system.secondary.appraisal.temp + system.secondary.appraisal.spec + system.secondary.appraisal.base + system.appraisalbonus + system.appraisalnatfinal + system.aamFinal); - - // architecture - system.architecturebonus = archi; - system.architecturenat = Math.floor(stats.Intelligence.mod + system.secondary.architecture.natural + Math.ceil(system.secondary.architecture.nat * stats.Intelligence.mod)); - if (system.architecturenat < 100) { - system.architecturenatfinal = system.architecturenat; - } else { - system.architecturenatfinal = 100; - } - system.architecturefinal = Math.floor(system.secondary.architecture.bonus + system.secondary.architecture.temp + system.secondary.architecture.spec + system.secondary.architecture.base + system.architecturebonus + system.architecturenatfinal + system.aamFinal); - - // herballore - system.herballorebonus = herb; - system.herballorenat = Math.floor(stats.Intelligence.mod + system.secondary.herballore.natural + Math.ceil(system.secondary.herballore.nat * stats.Intelligence.mod)); - if (system.herballorenat < 100) { - system.herballorenatfinal = system.herballorenat; - } else { - system.herballorenatfinal = 100; - } - system.herballorefinal = Math.floor(system.secondary.herballore.bonus + system.secondary.herballore.temp + system.secondary.herballore.spec + system.secondary.herballore.base + system.herballorebonus + system.herballorenatfinal + system.aamFinal); - - // history - system.historybonus = hist; - system.historynat = Math.floor(stats.Intelligence.mod + system.secondary.history.natural + Math.ceil(system.secondary.history.nat * stats.Intelligence.mod)); - if (system.historynat < 100) { - system.historynatfinal = system.historynat; - } else { - system.historynatfinal = 100; - } - system.historyfinal = Math.floor(system.secondary.history.bonus + system.secondary.history.temp + system.secondary.history.spec + system.secondary.history.base + system.historybonus + system.historynatfinal + system.aamFinal); - - // law - system.lawbonus = law; - system.lawnat = Math.floor(stats.Intelligence.mod + system.secondary.law.natural + Math.ceil(system.secondary.law.nat * stats.Intelligence.mod)); - if (system.lawnat < 100) { - system.lawnatfinal = system.lawnat; - } else { - system.lawnatfinal = 100; - } - system.lawfinal = Math.floor(system.secondary.law.bonus + system.secondary.law.temp + system.secondary.law.spec + system.secondary.law.base + system.lawbonus + system.lawnatfinal + system.aamFinal); - - // magicappr - system.magicapprbonus = magicapr; - system.magicapprnat = Math.floor(stats.Power.mod + system.secondary.magicappr.natural + Math.ceil(system.secondary.magicappr.nat * stats.Power.mod)); - if (system.magicapprnat < 100) { - system.magicapprnatfinal = system.magicapprnat; - } else { - system.magicapprnatfinal = 100; - } - system.magicapprfinal = Math.floor(system.secondary.magicappr.bonus + system.secondary.magicappr.temp + system.secondary.magicappr.spec + system.secondary.magicappr.base + system.magicapprbonus + system.magicapprnatfinal + system.aamFinal); - - // medicine - system.medicinebonus = medic; - system.medicinenat = Math.floor(stats.Intelligence.mod + system.secondary.medicine.natural + Math.ceil(system.secondary.medicine.nat * stats.Intelligence.mod)); - if (system.medicinenat < 100) { - system.medicinenatfinal = system.medicinenat; - } else { - system.medicinenatfinal = 100; - } - system.medicinefinal = Math.floor(system.secondary.medicine.bonus + system.secondary.medicine.temp + system.secondary.medicine.spec + system.secondary.medicine.base + system.medicinebonus + system.medicinenatfinal + system.aamFinal); - - // memorize - system.memorizebonus = mem; - system.memorizenat = Math.floor(stats.Intelligence.mod + system.secondary.memorize.natural + Math.ceil(system.secondary.memorize.nat * stats.Intelligence.mod)); - if (system.memorizenat < 100) { - system.memorizenatfinal = system.memorizenat; - } else { - system.memorizenatfinal = 100; - } - system.memorizefinal = Math.floor(system.secondary.memorize.bonus + system.secondary.memorize.temp + system.secondary.memorize.spec + system.secondary.memorize.base + system.memorizebonus + system.memorizenatfinal + system.aamFinal); - - // navigation - system.navigationbonus = navi; - system.navigationnat = Math.floor(stats.Intelligence.mod + system.secondary.navigation.natural + Math.ceil(system.secondary.navigation.nat * stats.Intelligence.mod)); - if (system.navigationnat < 100) { - system.navigationnatfinal = system.navigationnat; - } else { - system.navigationnatfinal = 100; - } - system.navigationfinal = Math.floor(system.secondary.navigation.bonus + system.secondary.navigation.temp + system.secondary.navigation.spec + system.secondary.navigation.base + system.navigationbonus + system.navigationnatfinal + system.aamFinal); - - // occult - system.occultbonus = occ; - system.occultnat = Math.floor(stats.Intelligence.mod + system.secondary.occult.natural + Math.ceil(system.secondary.occult.nat * stats.Intelligence.mod)); - if (system.occultnat < 100) { - system.occultnatfinal = system.occultnat; - } else { - system.occultnatfinal = 100; - } - system.occultfinal = Math.floor(system.secondary.occult.bonus + system.secondary.occult.temp + system.secondary.occult.spec + system.secondary.occult.base + system.occultbonus + system.occultnatfinal + system.aamFinal); - - // science - system.sciencebonus = science; - system.sciencenat = Math.floor(stats.Intelligence.mod + system.secondary.science.natural + Math.ceil(system.secondary.science.nat * stats.Intelligence.mod)); - if (system.sciencenat < 100) { - system.sciencenatfinal = system.sciencenat; - } else { - system.sciencenatfinal = 100; - } - system.sciencefinal = Math.floor(system.secondary.science.bonus + system.secondary.science.temp + system.secondary.science.spec + system.secondary.science.base + system.sciencebonus + system.sciencenatfinal + system.aamFinal); - - // tactics - system.tacticsbonus = tactic; - system.tacticsnat = Math.floor(stats.Intelligence.mod + system.secondary.tactics.natural + Math.ceil(system.secondary.tactics.nat * stats.Intelligence.mod)); - if (system.tacticsnat < 100) { - system.tacticsnatfinal = system.tacticsnat; - } else { - system.tacticsnatfinal = 100; - } - system.tacticsfinal = Math.floor(system.secondary.tactics.bonus + system.secondary.tactics.temp + system.secondary.tactics.spec + system.secondary.tactics.base + system.tacticsbonus + system.tacticsnatfinal + system.aamFinal); - - // composure - system.composurebonus = comp; - system.composurenat = Math.floor(stats.Willpower.mod + system.secondary.composure.natural + Math.ceil(system.secondary.composure.nat * stats.Willpower.mod)); - if (system.composurenat < 100) { - system.composurenatfinal = system.composurenat; - } else { - system.composurenatfinal = 100; - } - system.composurefinal = Math.floor(system.secondary.composure.bonus + system.secondary.composure.temp + system.secondary.composure.spec + system.secondary.composure.base + system.composurebonus + system.composurenatfinal + system.aamFinal); - - // featsofstr - system.featsofstrbonus = fos; - system.featsofstrnat = Math.floor(stats.Strength.mod + system.secondary.featsofstr.natural + Math.ceil(system.secondary.featsofstr.nat * stats.Strength.mod)); - if (system.featsofstrnat < 100) { - system.featsofstrnatfinal = system.featsofstrnat; - } else { - system.featsofstrnatfinal = 100; - } - system.featsofstrfinal = Math.floor(system.secondary.featsofstr.bonus + system.secondary.featsofstr.temp + system.secondary.featsofstr.spec + system.secondary.featsofstr.base + system.featsofstrbonus + system.featsofstrnatfinal + system.aamFinal - system.totalNatPen); - - // withstpain - system.withstpainbonus = wstp; - system.withstpainnat = Math.floor(stats.Willpower.mod + system.secondary.withstpain.natural + Math.ceil(system.secondary.withstpain.nat * stats.Willpower.mod)); - if (system.withstpainnat < 100) { - system.withstpainnatfinal = system.withstpainnat; - } else { - system.withstpainnatfinal = 100; - } - system.withstpainfinal = Math.floor(system.secondary.withstpain.bonus + system.secondary.withstpain.temp + system.secondary.withstpain.spec + system.secondary.withstpain.base + system.withstpainbonus + system.withstpainnatfinal + system.aamFinal); - - // disguise - system.disguisebonus = disg; - system.disguisenat = Math.floor(stats.Dexterity.mod + system.secondary.disguise.natural + Math.ceil(system.secondary.disguise.nat * stats.Dexterity.mod)); - if (system.disguisenat < 100) { - system.disguisenatfinal = system.disguisenat; - } else { - system.disguisenatfinal = 100; - } - system.disguisefinal = Math.floor(system.secondary.disguise.bonus + system.secondary.disguise.temp + system.secondary.disguise.spec + system.secondary.disguise.base + system.disguisebonus + system.disguisenatfinal + system.aamFinal); - - // hide - system.hidebonus = hide; - system.hidenat = Math.floor(stats.Perception.mod + system.secondary.hide.natural + Math.ceil(system.secondary.hide.nat * stats.Perception.mod)); - if (system.hidenat < 100) { - system.hidenatfinal = system.hidenat; - } else { - system.hidenatfinal = 100; - } - system.hidefinal = Math.floor(system.secondary.hide.bonus + system.secondary.hide.temp + system.secondary.hide.spec + system.secondary.hide.base + system.hidebonus + system.hidenatfinal + system.aamFinal - system.totalNatPen); - - // lockpicking - system.lockpickingbonus = lock; - system.lockpickingnat = Math.floor(stats.Dexterity.mod + system.secondary.lockpicking.natural + Math.ceil(system.secondary.lockpicking.nat * stats.Dexterity.mod)); - if (system.lockpickingnat < 100) { - system.lockpickingnatfinal = system.lockpickingnat; - } else { - system.lockpickingnatfinal = 100; - } - system.lockpickingfinal = Math.floor(system.secondary.lockpicking.bonus + system.secondary.lockpicking.temp + system.secondary.lockpicking.spec + system.secondary.lockpicking.base + system.lockpickingbonus + system.lockpickingnatfinal + system.aamFinal); - - // poisons - system.poisonsbonus = poisn; - system.poisonsnat = Math.floor(stats.Intelligence.mod + system.secondary.poisons.natural + Math.ceil(system.secondary.poisons.nat * stats.Intelligence.mod)); - if (system.poisonsnat < 100) { - system.poisonsnatfinal = system.poisonsnat; - } else { - system.poisonsnatfinal = 100; - } - system.poisonsfinal = Math.floor(system.secondary.poisons.bonus + system.secondary.poisons.temp + system.secondary.poisons.spec + system.secondary.poisons.base + system.poisonsbonus + system.poisonsnatfinal + system.aamFinal); - - // stealth - system.stealthbonus = stealth; - system.stealthnat = Math.floor(stats.Agility.mod + system.secondary.stealth.natural + Math.ceil(system.secondary.stealth.nat * stats.Agility.mod)); - if (system.stealthnat < 100) { - system.stealthnatfinal = system.stealthnat; - } else { - system.stealthnatfinal = 100; - } - system.stealthfinal = Math.floor(system.secondary.stealth.bonus + system.secondary.stealth.temp + system.secondary.stealth.spec + system.secondary.stealth.base + system.stealthbonus + system.stealthnatfinal + system.aamFinal - system.totalNatPen); - - // theft - system.theftbonus = theft; - system.theftnat = Math.floor(stats.Dexterity.mod + system.secondary.theft.natural + Math.ceil(system.secondary.theft.nat * stats.Dexterity.mod)); - if (system.theftnat < 100) { - system.theftnatfinal = system.theftnat; - } else { - system.theftnatfinal = 100; - } - system.theftfinal = Math.floor(system.secondary.theft.bonus + system.secondary.theft.temp + system.secondary.theft.spec + system.secondary.theft.base + system.theftbonus + system.theftnatfinal + system.aamFinal); - - // traplore - system.traplorebonus = trapl; - system.traplorenat = Math.floor(stats.Dexterity.mod + system.secondary.traplore.natural + Math.ceil(system.secondary.traplore.nat * stats.Dexterity.mod)); - if (system.traplorenat < 100) { - system.traplorenatfinal = system.traplorenat; - } else { - system.traplorenatfinal = 100; - } - system.traplorefinal = Math.floor(system.secondary.traplore.bonus + system.secondary.traplore.temp + system.secondary.traplore.spec + system.secondary.traplore.base + system.traplorebonus + system.traplorenatfinal + system.aamFinal); - - // alchemy - system.alchemybonus = alche; - system.alchemynat = Math.floor(stats.Intelligence.mod + system.secondary.alchemy.natural + Math.ceil(system.secondary.alchemy.nat * stats.Intelligence.mod)); - if (system.alchemynat < 100) { - system.alchemynatfinal = system.alchemynat; - } else { - system.alchemynatfinal = 100; - } - system.alchemyfinal = Math.floor(system.secondary.alchemy.bonus + system.secondary.alchemy.temp + system.secondary.alchemy.spec + system.secondary.alchemy.base + system.alchemybonus + system.alchemynatfinal + system.aamFinal); - - // animism - system.animismbonus = anims; - system.animismnat = Math.floor(stats.Power.mod + system.secondary.animism.natural + Math.ceil(system.secondary.animism.nat * stats.Power.mod)); - if (system.animismnat < 100) { - system.animismnatfinal = system.animismnat; - } else { - system.animismnatfinal = 100; - } - system.animismfinal = Math.floor(system.secondary.animism.bonus + system.secondary.animism.temp + system.secondary.animism.spec + system.secondary.animism.base + system.animismbonus + system.animismnatfinal + system.aamFinal); - - // art - system.artbonus = art; - system.artnat = Math.floor(stats.Power.mod + system.secondary.art.natural + Math.ceil(system.secondary.art.nat * stats.Power.mod)); - if (system.artnat < 100) { - system.artnatfinal = system.artnat; - } else { - system.artnatfinal = 100; - } - system.artfinal = Math.floor(system.secondary.art.bonus + system.secondary.art.temp + system.secondary.art.spec + system.secondary.art.base + system.artbonus + system.artnatfinal + system.aamFinal); - - // dance - system.dancebonus = dance; - system.dancenat = Math.floor(stats.Agility.mod + system.secondary.dance.natural + Math.ceil(system.secondary.dance.nat * stats.Agility.mod)); - if (system.dancenat < 100) { - system.dancenatfinal = system.dancenat; - } else { - system.dancenatfinal = 100; - } - system.dancefinal = Math.floor(system.secondary.dance.bonus + system.secondary.dance.temp + system.secondary.dance.spec + system.secondary.dance.base + system.dancebonus + system.dancenatfinal + system.aamFinal - system.totalNatPen); - - // forging - system.forgingbonus = forgi; - system.forgingnat = Math.floor(stats.Dexterity.mod + system.secondary.forging.natural + Math.ceil(system.secondary.forging.nat * stats.Dexterity.mod)); - if (system.forgingnat < 100) { - system.forgingnatfinal = system.forgingnat; - } else { - system.forgingnatfinal = 100; - } - system.forgingfinal = Math.floor(system.secondary.forging.bonus + system.secondary.forging.temp + system.secondary.forging.spec + system.secondary.forging.base + system.forgingbonus + system.forgingnatfinal + system.aamFinal); - - // jewelry - system.jewelrybonus = jewel; - system.jewelrynat = Math.floor(stats.Dexterity.mod + system.secondary.jewelry.natural + Math.ceil(system.secondary.jewelry.nat * stats.Dexterity.mod)); - if (system.jewelrynat < 100) { - system.jewelrynatfinal = system.jewelrynat; - } else { - system.jewelrynatfinal = 100; - } - system.jewelryfinal = Math.floor(system.secondary.jewelry.bonus + system.secondary.jewelry.temp + system.secondary.jewelry.spec + system.secondary.jewelry.base + system.jewelrybonus + system.jewelrynatfinal + system.aamFinal); - - // music - system.musicbonus = music; - system.musicnat = Math.floor(stats.Power.mod + system.secondary.music.natural + Math.ceil(system.secondary.music.nat * stats.Power.mod)); - if (system.musicnat < 100) { - system.musicnatfinal = system.musicnat; - } else { - system.musicnatfinal = 100; - } - system.musicfinal = Math.floor(system.secondary.music.bonus + system.secondary.music.temp + system.secondary.music.spec + system.secondary.music.base + system.musicbonus + system.musicnatfinal + system.aamFinal); - - // runes - system.runesbonus = runes; - system.runesnat = Math.floor(stats.Dexterity.mod + system.secondary.runes.natural + Math.ceil(system.secondary.runes.nat * stats.Dexterity.mod)); - if (system.runesnat < 100) { - system.runesnatfinal = system.runesnat; - } else { - system.runesnatfinal = 100; - } - system.runesfinal = Math.floor(system.secondary.runes.bonus + system.secondary.runes.temp + system.secondary.runes.spec + system.secondary.runes.base + system.runesbonus + system.runesnatfinal + system.aamFinal); - - // ritualcalig - system.ritualcaligbonus = ritcal; - system.ritualcalignat = Math.floor(stats.Dexterity.mod + system.secondary.ritualcalig.natural + Math.ceil(system.secondary.ritualcalig.nat * stats.Dexterity.mod)); - if (system.ritualcalignat < 100) { - system.ritualcalignatfinal = system.ritualcalignat; - } else { - system.ritualcalignatfinal = 100; - } - system.ritualcaligfinal = Math.floor(system.secondary.ritualcalig.bonus + system.secondary.ritualcalig.temp + system.secondary.ritualcalig.spec + system.secondary.ritualcalig.base + system.ritualcaligbonus + system.ritualcalignatfinal + system.aamFinal); - - // slofhand - system.slofhandbonus = soh; - system.slofhandnat = Math.floor(stats.Dexterity.mod + system.secondary.slofhand.natural + Math.ceil(system.secondary.slofhand.nat * stats.Dexterity.mod)); - if (system.slofhandnat < 100) { - system.slofhandnatfinal = system.slofhandnat; - } else { - system.slofhandnatfinal = 100; - } - system.slofhandfinal = Math.floor(system.secondary.slofhand.bonus + system.secondary.slofhand.temp + system.secondary.slofhand.spec + system.secondary.slofhand.base + system.slofhandbonus + system.slofhandnatfinal + system.aamFinal); - - // tailoring - system.tailoringbonus = tailoring; - system.tailoringnat = Math.floor(stats.Dexterity.mod + system.secondary.tailoring.natural + Math.ceil(system.secondary.tailoring.nat * stats.Dexterity.mod)); - if (system.tailoringnat < 100) { - system.tailoringnatfinal = system.tailoringnat; - } else { - system.tailoringnatfinal = 100; - } - system.tailoringfinal = Math.floor(system.secondary.tailoring.bonus + system.secondary.tailoring.temp + system.secondary.tailoring.spec + system.secondary.tailoring.base + system.tailoringbonus + system.tailoringnatfinal + system.aamFinal); - - // piloting - system.pilotingbonus = pilot; - system.pilotingnat = Math.floor(stats.Dexterity.mod + system.secondary.piloting.natural + Math.ceil(system.secondary.piloting.nat * stats.Dexterity.mod)); - if (system.pilotingnat < 100) { - system.pilotingnatfinal = system.pilotingnat; - } else { - system.pilotingnatfinal = 100; - } - system.pilotingfinal = Math.floor(system.secondary.piloting.bonus + system.secondary.piloting.temp + system.secondary.piloting.spec + system.secondary.piloting.base + system.pilotingbonus + system.pilotingnatfinal + system.aamFinal); - - // cooking - system.cookingbonus = cook; - system.cookingnat = Math.floor(stats.Power.mod + system.secondary.cooking.natural + Math.ceil(system.secondary.cooking.nat * stats.Power.mod)); - if (system.cookingnat < 100) { - system.cookingnatfinal = system.cookingnat; - } else { - system.cookingnatfinal = 100; - } - system.cookingfinal = Math.floor(system.secondary.cooking.bonus + system.secondary.cooking.temp + system.secondary.cooking.spec + system.secondary.cooking.base + system.cookingbonus + system.cookingnatfinal + system.aamFinal); - - // technomagic - system.technomagicbonus = techmagic; - system.technomagicnat = Math.floor(stats.Intelligence.mod + system.secondary.technomagic.natural + Math.ceil(system.secondary.technomagic.nat * stats.Intelligence.mod)); - if (system.technomagicnat < 100) { - system.technomagicnatfinal = system.technomagicnat; - } else { - system.technomagicnatfinal = 100; - } - system.technomagicfinal = Math.floor(system.secondary.technomagic.bonus + system.secondary.technomagic.temp + system.secondary.technomagic.spec + system.secondary.technomagic.base + system.technomagicbonus + system.technomagicnatfinal + system.aamFinal); - - //toymaking - system.toymakingbonus = toy; - system.toymakingnat = Math.floor(stats.Power.mod + system.secondary.toymaking.natural + Math.ceil(system.secondary.toymaking.nat * stats.Power.mod)); - if (system.toymakingnat < 100) { - system.toymakingnatfinal = system.toymakingnat; - } else { - system.toymakingnatfinal = 100; - } - system.toymakingfinal = Math.floor(system.secondary.toymaking.bonus + system.secondary.toymaking.temp + system.secondary.toymaking.spec + system.secondary.toymaking.base + system.toymakingbonus + system.toymakingnatfinal + system.aamFinal); - - - //kidetection system.kidetectionbase - system.noticeDection = Math.floor(system.secondary.notice.temp + system.secondary.notice.spec + system.secondary.notice.base + system.noticebonus + system.noticenatfinal); - system.kidetectionbase = Math.floor((system.noticeDection + system.mkFinal) / 2); - system.kidetectionbonus = kiDect; - system.kidetectionnat = Math.floor(stats.Perception.mod + system.secondary.kidetection.natural + Math.ceil(system.secondary.kidetection.nat * stats.Perception.mod)); - if (system.kidetectionnat < 100) { - system.kidetectionnatfinal = system.kidetectionnat; - } else { - system.kidetectionnatfinal = 100; - } - system.kidetectionfinal = Math.floor(system.secondary.kidetection.bonus + system.secondary.kidetection.temp + system.secondary.kidetection.spec + system.kidetectionbase + system.kidetectionbonus + system.kidetectionnatfinal + system.aamFinal); - - - //kicoceal - system.hideConceal = Math.floor(system.secondary.hide.temp + system.secondary.hide.spec + system.secondary.hide.base + system.hidebonus + system.hidenatfinal - system.totalNatPen); - system.kiconcealbase = Math.floor((system.hideConceal + system.mkFinal) / 2); - system.kiconcealbonus = kiCon; - system.kiconcealnat = Math.floor(stats.Perception.mod + system.secondary.kiconceal.natural + Math.ceil(system.secondary.kiconceal.nat * stats.Perception.mod)); - if (system.kiconcealnat < 100) { - system.kiconcealnatfinal = system.kiconcealnat; - } else { - system.kiconcealnatfinal = 100; - } - system.kiconcealfinal = Math.floor(system.secondary.kiconceal.bonus + system.secondary.kiconceal.temp + system.secondary.kiconceal.spec + system.kiconcealbase + system.kiconcealbonus + system.kiconcealnatfinal + system.aamFinal); - /* - * // z - system.znat = Math.floor(stats.x.mod + system.secondary.z.natural + Math.ceil(system.secondary.z.nat * stats.x.mod)); - if (system.znat < 100) { - system.znatfinal = system.znat; - } else { - system.znatfinal = 100; - } - system.zfinal = Math.floor(system.secondary.z.temp + system.secondary.z.spec + system.secondary.z.base + system.zbonus + system.znatfinal + system.aamFinal); - */ + // Initiative + if (system.kiAbility.kiIncreaseSpd.status == true) { + system.initiative.kiAbilityBonus = 10; + } else { + system.initiative.kiAbilityBonus = 0; + } + system.initiative.class = classBonuses.ini; + system.initiative.wepNumber = classBonuses.wepNum; + system.initiative.wepSpeed = classBonuses.wepSpd; + system.initiative.wepName = classBonuses.wepName; + if (system.initiative.wepNumber > 1 && system.initiative.wepSpeed < 0) { + system.initiative.wepFinalSpeed = system.initiative.wepSpeed - 20; + system.initiative.wepName = game.i18n.localize('abfalter.basicInfo.multiWield'); + } else if (system.initiative.wepNumber > 1 && system.initiative.wepSpeed >= 0) { + system.initiative.wepFinalSpeed = system.initiative.wepSpeed - 10; + system.initiative.wepName = game.i18n.localize('abfalter.basicInfo.multiWield'); + } else if (system.initiative.wepNumber == 0) { + system.initiative.wepFinalSpeed = 20; + system.initiative.wepName = game.i18n.localize('abfalter.basicInfo.unarmed'); + } else { + system.initiative.wepFinalSpeed = system.initiative.wepSpeed; + } + system.initiative.final = Math.floor(system.initiative.base + system.initiative.class + system.initiative.spec + system.initiative.bonus + system.initiative.kiAbilityBonus + ~~system.initiative.wepFinalSpeed - system.armor.wearArmor.totalNatPen); + + //@SECONDARIES + //Athletics Fields + system.secondaryFields.athletics.acrobatics.classBonus = classBonuses.acro; + system.secondaryFields.athletics.athleticism.classBonus = classBonuses.athle; + system.secondaryFields.athletics.climb.classBonus = classBonuses.climb; + system.secondaryFields.athletics.jump.classBonus = classBonuses.jump; + system.secondaryFields.athletics.piloting.classBonus = classBonuses.pilot; + system.secondaryFields.athletics.ride.classBonus = classBonuses.ride; + system.secondaryFields.athletics.swim.classBonus = classBonuses.swim; + for (let [key, sec] of Object.entries(system.secondaryFields.athletics)) { + sec.parentField = system.secondaryFields.category.athletics; + switch (sec.modifier) { + case "AGI": + sec.modValue = stats.Agility.mod; + break; + case "STR": + sec.modValue = stats.Strength.mod; + break; + case "DEX": + sec.modValue = stats.Dexterity.mod; + break; + } + sec.natTotal = Math.floor(sec.modValue + sec.natural + Math.ceil(sec.nat * sec.modValue)); + sec.natTotal = sec.natTotal < 100 ? sec.natTotal : 100; + sec.final = Math.floor(sec.base + sec.spec + sec.temp + sec.classBonus + sec.natTotal + sec.bonus + system.aamField.final - system.armor.wearArmor.totalNatPen); + }; + + //Social Fields + system.secondaryFields.social.etiquette.classBonus = classBonuses.etiq; + system.secondaryFields.social.intimidate.classBonus = classBonuses.intim; + system.secondaryFields.social.leadership.classBonus = classBonuses.leader; + system.secondaryFields.social.persuasion.classBonus = classBonuses.persua; + system.secondaryFields.social.streetwise.classBonus = classBonuses.street; + system.secondaryFields.social.style.classBonus = classBonuses.style; + system.secondaryFields.social.trading.classBonus = classBonuses.trading; + for (let [key, sec] of Object.entries(system.secondaryFields.social)) { + sec.parentField = system.secondaryFields.category.social; + switch (sec.modifier) { + case "INT": + sec.modValue = stats.Intelligence.mod; + break; + case "POW": + sec.modValue = stats.Power.mod; + break; + case "WP": + sec.modValue = stats.Willpower.mod; + break; + } + sec.natTotal = Math.floor(sec.modValue + sec.natural + Math.ceil(sec.nat * sec.modValue)); + sec.natTotal = sec.natTotal < 100 ? sec.natTotal : 100; + sec.final = Math.floor(sec.base + sec.spec + sec.temp + sec.classBonus + sec.natTotal + sec.bonus + system.aamField.final); + }; + + //Perceptive Fields + system.secondaryFields.perceptive.notice.classBonus = classBonuses.notice; + system.secondaryFields.perceptive.search.classBonus = classBonuses.search; + system.secondaryFields.perceptive.track.classBonus = classBonuses.track; + for (let [key, sec] of Object.entries(system.secondaryFields.perceptive)) { + if (key === 'kidetection') continue; + + sec.parentField = system.secondaryFields.category.perceptive; + switch (sec.modifier) { + case "PER": + sec.modValue = stats.Perception.mod; + break; + } + sec.natTotal = Math.floor(sec.modValue + sec.natural + Math.ceil(sec.nat * sec.modValue)); + sec.natTotal = sec.natTotal < 100 ? sec.natTotal : 100; + sec.final = Math.floor(sec.base + sec.spec + sec.temp + sec.classBonus + sec.natTotal + sec.bonus + system.aamField.final); + }; + //Ki Detection + system.secondaryFields.perceptive.kidetection.display = !system.kiAbility.kiDetection.status; + system.secondaryFields.perceptive.kidetection.classBonus = classBonuses.kiDect; + system.secondaryFields.perceptive.kidetection.baseNotice = Math.floor(system.secondaryFields.perceptive.notice.temp + system.secondaryFields.perceptive.notice.spec + + system.secondaryFields.perceptive.notice.base + system.secondaryFields.perceptive.notice.classBonus + system.secondaryFields.perceptive.notice.natTotal); + system.secondaryFields.perceptive.kidetection.parentField = system.secondaryFields.category.perceptive; + system.secondaryFields.perceptive.kidetection.modValue = stats.Perception.mod; + system.secondaryFields.perceptive.kidetection.natTotal = Math.floor(system.secondaryFields.perceptive.kidetection.modValue + system.secondaryFields.perceptive.kidetection.natural + Math.ceil(system.secondaryFields.perceptive.kidetection.nat * system.secondaryFields.perceptive.kidetection.modValue)); + system.secondaryFields.perceptive.kidetection.natTotal = system.secondaryFields.perceptive.kidetection.natTotal < 100 ? system.secondaryFields.perceptive.kidetection.natTotal : 100; + system.secondaryFields.perceptive.kidetection.final = Math.floor(system.secondaryFields.perceptive.kidetection.base + system.secondaryFields.perceptive.kidetection.spec + system.secondaryFields.perceptive.kidetection.temp + + system.secondaryFields.perceptive.kidetection.classBonus + system.secondaryFields.perceptive.kidetection.natTotal + system.secondaryFields.perceptive.kidetection.bonus + system.aamField.final); + + //Intellectual Fields + system.secondaryFields.intellectual.animals.classBonus = classBonuses.animals; + system.secondaryFields.intellectual.appraisal.classBonus = classBonuses.appra; + system.secondaryFields.intellectual.architecture.classBonus = classBonuses.archi; + system.secondaryFields.intellectual.herballore.classBonus = classBonuses.herb; + system.secondaryFields.intellectual.history.classBonus =classBonuses. hist; + system.secondaryFields.intellectual.law.classBonus = classBonuses.law; + system.secondaryFields.intellectual.magicappr.classBonus = classBonuses.magicapr; + system.secondaryFields.intellectual.medicine.classBonus = classBonuses.medic; + system.secondaryFields.intellectual.memorize.classBonus = classBonuses.mem; + system.secondaryFields.intellectual.navigation.classBonus = classBonuses.navi; + system.secondaryFields.intellectual.occult.classBonus = classBonuses.occ; + system.secondaryFields.intellectual.science.classBonus = classBonuses.science; + system.secondaryFields.intellectual.tactics.classBonus = classBonuses.tactic; + system.secondaryFields.intellectual.technomagic.classBonus = classBonuses.techmagic; + for (let [key, sec] of Object.entries(system.secondaryFields.intellectual)) { + sec.parentField = system.secondaryFields.category.intellectual; + switch (sec.modifier) { + case "INT": + sec.modValue = stats.Intelligence.mod; + break; + case "POW": + sec.modValue = stats.Power.mod; + break; + } + sec.natTotal = Math.floor(sec.modValue + sec.natural + Math.ceil(sec.nat * sec.modValue)); + sec.natTotal = sec.natTotal < 100 ? sec.natTotal : 100; + sec.final = Math.floor(sec.base + sec.spec + sec.temp + sec.classBonus + sec.natTotal + sec.bonus + system.aamField.final); + }; + + //Vigor Fields + system.secondaryFields.vigor.composure.classBonus = classBonuses.comp; + system.secondaryFields.vigor.featsofstr.classBonus = classBonuses.fos; + system.secondaryFields.vigor.withstpain.classBonus = classBonuses.wstp; + for (let [key, sec] of Object.entries(system.secondaryFields.vigor)) { + sec.parentField = system.secondaryFields.category.vigor; + switch (sec.modifier) { + case "WP": + sec.modValue = stats.Willpower.mod; + break; + case "STR": + sec.modValue = stats.Strength.mod; + break; + } + sec.natTotal = Math.floor(sec.modValue + sec.natural + Math.ceil(sec.nat * sec.modValue)); + sec.natTotal = sec.natTotal < 100 ? sec.natTotal : 100; + sec.final = Math.floor(sec.base + sec.spec + sec.temp + sec.classBonus + sec.natTotal + sec.bonus + system.aamField.final - (sec.armorPen ? system.armor.wearArmor.totalNatPen : 0)); + }; + + //Subterfuge Fields + system.secondaryFields.subterfuge.disguise.classBonus = classBonuses.disg; + system.secondaryFields.subterfuge.hide.classBonus = classBonuses.hide; + system.secondaryFields.subterfuge.lockpicking.classBonus = classBonuses.lock; + system.secondaryFields.subterfuge.poisons.classBonus = classBonuses.poisn; + system.secondaryFields.subterfuge.stealth.classBonus = classBonuses.stealth; + system.secondaryFields.subterfuge.theft.classBonus = classBonuses.theft; + system.secondaryFields.subterfuge.traplore.classBonus = classBonuses.trapl; + for (let [key, sec] of Object.entries(system.secondaryFields.subterfuge)) { + if (key === 'kiconceal') continue; + + sec.parentField = system.secondaryFields.category.subterfuge; + switch (sec.modifier) { + case "AGI": + sec.modValue = stats.Agility.mod; + break; + case "DEX": + sec.modValue = stats.Dexterity.mod; + break; + case "PER": + sec.modValue = stats.Perception.mod; + break; + case "INT": + sec.modValue = stats.Intelligence.mod; + break; + } + sec.natTotal = Math.floor(sec.modValue + sec.natural + Math.ceil(sec.nat * sec.modValue)); + sec.natTotal = sec.natTotal < 100 ? sec.natTotal : 100; + sec.final = Math.floor(sec.base + sec.spec + sec.temp + sec.classBonus + sec.natTotal + sec.bonus + system.aamField.final - (sec.armorPen ? system.armor.wearArmor.totalNatPen : 0)); + }; + //Ki Concealment + system.secondaryFields.subterfuge.kiconceal.display = !system.kiAbility.kiConceal.status; + system.secondaryFields.subterfuge.kiconceal.classBonus = classBonuses.kiCon; + system.secondaryFields.subterfuge.kiconceal.baseNotice = Math.floor(system.secondaryFields.subterfuge.hide.temp + system.secondaryFields.subterfuge.hide.spec + + system.secondaryFields.subterfuge.hide.base + system.secondaryFields.subterfuge.hide.classBonus + system.secondaryFields.subterfuge.hide.natTotal); + system.secondaryFields.subterfuge.kiconceal.parentField = system.secondaryFields.category.subterfuge; + system.secondaryFields.subterfuge.kiconceal.modValue = stats.Perception.mod; + system.secondaryFields.subterfuge.kiconceal.natTotal = Math.floor(system.secondaryFields.subterfuge.kiconceal.modValue + system.secondaryFields.subterfuge.kiconceal.natural + Math.ceil(system.secondaryFields.subterfuge.kiconceal.nat * system.secondaryFields.subterfuge.kiconceal.modValue)); + system.secondaryFields.subterfuge.kiconceal.natTotal = system.secondaryFields.subterfuge.kiconceal.natTotal < 100 ? system.secondaryFields.subterfuge.kiconceal.natTotal : 100; + system.secondaryFields.subterfuge.kiconceal.final = Math.floor(system.secondaryFields.subterfuge.kiconceal.base + system.secondaryFields.subterfuge.kiconceal.spec + system.secondaryFields.subterfuge.kiconceal.temp + + system.secondaryFields.subterfuge.kiconceal.classBonus + system.secondaryFields.subterfuge.kiconceal.natTotal + system.secondaryFields.subterfuge.kiconceal.bonus + system.aamField.final); + + //Creative Fields + system.secondaryFields.creative.alchemy.classBonus = classBonuses.alche; + system.secondaryFields.creative.animism.classBonus = classBonuses.anims; + system.secondaryFields.creative.art.classBonus = classBonuses.art; + system.secondaryFields.creative.cooking.classBonus = classBonuses.cook; + system.secondaryFields.creative.dance.classBonus = classBonuses.dance; + system.secondaryFields.creative.forging.classBonus = classBonuses.forgi; + system.secondaryFields.creative.jewelry.classBonus = classBonuses.jewel; + system.secondaryFields.creative.toymaking.classBonus = classBonuses.toy; + system.secondaryFields.creative.music.classBonus = classBonuses.music; + system.secondaryFields.creative.runes.classBonus = classBonuses.runes; + system.secondaryFields.creative.ritualcalig.classBonus = classBonuses.ritcal; + system.secondaryFields.creative.slofhand.classBonus = classBonuses.soh; + system.secondaryFields.creative.tailoring.classBonus = classBonuses.tailoring; + for (let [key, sec] of Object.entries(system.secondaryFields.creative)) { + sec.parentField = system.secondaryFields.category.creative; + switch (sec.modifier) { + case "AGI": + sec.modValue = stats.Agility.mod; + break; + case "DEX": + sec.modValue = stats.Dexterity.mod; + break; + case "INT": + sec.modValue = stats.Intelligence.mod; + break; + case "POW": + sec.modValue = stats.Power.mod; + break; + } + sec.natTotal = Math.floor(sec.modValue + sec.natural + Math.ceil(sec.nat * sec.modValue)); + sec.natTotal = sec.natTotal < 100 ? sec.natTotal : 100; + sec.final = Math.floor(sec.base + sec.spec + sec.temp + sec.classBonus + sec.natTotal + sec.bonus + system.aamField.final - (sec.armorPen ? system.armor.wearArmor.totalNatPen : 0)); + }; // Magic Accumulation & Zeon - system.turnMaintRemove = turnMaint; - system.dayMaintRemove = dayMaint; - system.zeonbonus = zeon; + system.zeon.turnMaint = classBonuses.turnMaint; + system.zeon.dailyMaint = classBonuses.dayMaint; + system.zeon.class = classBonuses.zeon; switch (system.stats.Power.final) { case 1: - system.maccupow = 0; - system.zeonpow = 5; + system.maccu.fromPow = 0; + system.zeon.fromPow = 5; break; case 2: - system.maccupow = 0; - system.zeonpow = 20; + system.maccu.fromPow = 0; + system.zeon.fromPow = 20; break; case 3: - system.maccupow = 0; - system.zeonpow = 40; + system.maccu.fromPow = 0; + system.zeon.fromPow = 40; break; case 4: - system.maccupow = 0; - system.zeonpow = 55; + system.maccu.fromPow = 0; + system.zeon.fromPow = 55; break; case 5: - system.maccupow = 5; - system.zeonpow = 70; + system.maccu.fromPow = 5; + system.zeon.fromPow = 70; break; case 6: - system.maccupow = 5; - system.zeonpow = 85; + system.maccu.fromPow = 5; + system.zeon.fromPow = 85; break; case 7: - system.maccupow = 5; - system.zeonpow = 95; + system.maccu.fromPow = 5; + system.zeon.fromPow = 95; break; case 8: - system.maccupow = 10; - system.zeonpow = 110; + system.maccu.fromPow = 10; + system.zeon.fromPow = 110; break; case 9: - system.maccupow = 10; - system.zeonpow = 120; + system.maccu.fromPow = 10; + system.zeon.fromPow = 120; break; case 10: - system.maccupow = 10; - system.zeonpow = 135; + system.maccu.fromPow = 10; + system.zeon.fromPow = 135; break; case 11: - system.maccupow = 10; - system.zeonpow = 150; + system.maccu.fromPow = 10; + system.zeon.fromPow = 150; break; case 12: - system.maccupow = 15; - system.zeonpow = 160; + system.maccu.fromPow = 15; + system.zeon.fromPow = 160; break; case 13: - system.maccupow = 15; - system.zeonpow = 175; + system.maccu.fromPow = 15; + system.zeon.fromPow = 175; break; case 14: - system.maccupow = 15; - system.zeonpow = 185; + system.maccu.fromPow = 15; + system.zeon.fromPow = 185; break; case 15: - system.maccupow = 20; - system.zeonpow = 200; + system.maccu.fromPow = 20; + system.zeon.fromPow = 200; break; case 16: - system.maccupow = 25; - system.zeonpow = 215; + system.maccu.fromPow = 25; + system.zeon.fromPow = 215; break; case 17: - system.maccupow = 25; - system.zeonpow = 225; + system.maccu.fromPow = 25; + system.zeon.fromPow = 225; break; case 18: - system.maccupow = 30; - system.zeonpow = 240; + system.maccu.fromPow = 30; + system.zeon.fromPow = 240; break; case 19: - system.maccupow = 30; - system.zeonpow = 250; + system.maccu.fromPow = 30; + system.zeon.fromPow = 250; break; case 20: - system.maccupow = 35; - system.zeonpow = 260; + system.maccu.fromPow = 35; + system.zeon.fromPow = 260; break; default: - system.zeonpow = 0; + system.zeon.fromPow = 0; break; } if (system.stats.Power.final > 20) { - system.maccupow = 35; - system.zeonpow = 260; + system.maccu.fromPow = 35; + system.zeon.fromPow = 260; } - system.maccufinal = Math.floor(system.maccu.base + system.maccupow + (system.maccu.mult * system.maccupow) + system.maccu.spec + system.maccu.bonus + system.maccu.temp); - system.maccuhalffinal = Math.floor(system.maccufinal / 2); - system.mregenfinal = Math.floor(((system.maccupow * system.mregen.regenmult) + system.mregen.spec + system.mregen.temp + system.mregen.bonus + system.maccufinal) * system.mregen.recoverymult); - system.zeon.max = Math.floor(system.zeon.base + system.zeonpow + system.zeonbonus + system.zeon.spec + system.zeon.temp + system.zeon.bonus); + system.maccu.finalFull = Math.floor(system.maccu.base + system.maccu.fromPow + (system.maccu.mult * system.maccu.fromPow) + system.maccu.spec + system.maccu.bonus + system.maccu.temp); + system.maccu.finalHalf = Math.floor(system.maccu.finalFull / 2); + system.mregen.final = Math.floor(((system.maccu.fromPow * system.mregen.regenmult) + system.mregen.spec + system.mregen.temp + system.mregen.bonus + system.maccu.finalFull) * system.mregen.recoverymult); + system.zeon.max = Math.floor(system.zeon.base + system.zeon.fromPow + system.zeon.class + system.zeon.spec + system.zeon.temp + system.zeon.bonus); // Innate Magic - if (system.maccufinal >= 10 && system.maccufinal <= 50) { - system.minnatefinal = Math.floor(system.zeon.minnate + 10); - } else if (system.maccufinal > 50 && system.maccufinal <= 70) { - system.minnatefinal = Math.floor(system.zeon.minnate + 20); - } else if (system.maccufinal > 70 && system.maccufinal <= 90) { - system.minnatefinal = Math.floor(system.zeon.minnate + 30); - } else if (system.maccufinal > 90 && system.maccufinal <= 110) { - system.minnatefinal = Math.floor(system.zeon.minnate + 40); - } else if (system.maccufinal > 110 && system.maccufinal <= 130) { - system.minnatefinal = Math.floor(system.zeon.minnate + 50); - } else if (system.maccufinal > 130 && system.maccufinal <= 150) { - system.minnatefinal = Math.floor(system.zeon.minnate + 60); - } else if (system.maccufinal > 150 && system.maccufinal <= 180) { - system.minnatefinal = Math.floor(system.zeon.minnate + 70); - } else if (system.maccufinal > 180 && system.maccufinal <= 200) { - system.minnatefinal = Math.floor(system.zeon.minnate + 80); - } else if (system.maccufinal > 200) { - system.minnatefinal = Math.floor(system.zeon.minnate + 90); - } else { - system.minnatefinal = system.zeon.minnate; + if (system.maccu.finalFull >= 10 && system.maccu.finalFull <= 50) { + system.zeon.minnateFinal = Math.floor(system.zeon.minnate + 10); + } else if (system.maccu.finalFull > 50 && system.maccu.finalFull <= 70) { + system.zeon.minnateFinal = Math.floor(system.zeon.minnate + 20); + } else if (system.maccu.finalFull > 70 && system.maccu.finalFull <= 90) { + system.zeon.minnateFinal = Math.floor(system.zeon.minnate + 30); + } else if (system.maccu.finalFull > 90 && system.maccu.finalFull <= 110) { + system.zeon.minnateFinal = Math.floor(system.zeon.minnate + 40); + } else if (system.maccu.finalFull > 110 && system.maccu.finalFull <= 130) { + system.zeon.minnateFinal = Math.floor(system.zeon.minnate + 50); + } else if (system.maccu.finalFull > 130 && system.maccu.finalFull <= 150) { + system.zeon.minnateFinal = Math.floor(system.zeon.minnate + 60); + } else if (system.maccu.finalFull > 150 && system.maccu.finalFull <= 180) { + system.zeon.minnateFinal = Math.floor(system.zeon.minnate + 70); + } else if (system.maccu.finalFull > 180 && system.maccu.finalFull <= 200) { + system.zeon.minnateFinal = Math.floor(system.zeon.minnate + 80); + } else if (system.maccu.finalFull > 200) { + system.zeon.minnateFinal = Math.floor(system.zeon.minnate + 90); + } else { + system.zeon.minnateFinal = system.zeon.minnate; } // Magic Levels switch (system.stats.Intelligence.final) { case 6: - system.mlevelint = 10; + system.mlevel.fromInt = 10; break; case 7: - system.mlevelint = 20; + system.mlevel.fromInt = 20; break; case 8: - system.mlevelint = 30; + system.mlevel.fromInt = 30; break; case 9: - system.mlevelint = 40; + system.mlevel.fromInt = 40; break; case 10: - system.mlevelint = 50; + system.mlevel.fromInt = 50; break; case 11: - system.mlevelint = 75; + system.mlevel.fromInt = 75; break; case 12: - system.mlevelint = 100; + system.mlevel.fromInt = 100; break; case 13: - system.mlevelint = 150; + system.mlevel.fromInt = 150; break; case 14: - system.mlevelint = 200; + system.mlevel.fromInt = 200; break; case 15: - system.mlevelint = 300; + system.mlevel.fromInt = 300; break; case 16: - system.mlevelint = 400; + system.mlevel.fromInt = 400; break; case 17: - system.mlevelint = 500; + system.mlevel.fromInt = 500; break; case 18: - system.mlevelint = 600; + system.mlevel.fromInt = 600; break; case 19: - system.mlevelint = 700; + system.mlevel.fromInt = 700; break; case 20: - system.mlevelint = 800; + system.mlevel.fromInt = 800; break; default: - system.mlevelint = 0; + system.mlevel.fromInt = 0; break; } if (system.stats.Intelligence.final > 20) { - system.mlevelint = 800; + system.mlevel.fromInt = 800; } - system.mlLevels = pathLvl; - system.spellLevels = spellCost; - system.mlevelfinal = Math.floor(system.mlevel.base + system.mlevel.spec + system.mlevel.temp + system.mlevel.bonus +system.mlevelint); - system.mlevelused = Math.floor(system.mlLevels + system.spellLevels + system.metaCost); + system.mlevel.pathCost = classBonuses.pathLvl; + system.mlevel.singleSpellCost = classBonuses.spellCost; + system.mlevel.final = Math.floor(system.mlevel.base + system.mlevel.spec + system.mlevel.temp + system.mlevel.bonus +system.mlevel.fromInt); + system.mlevel.used = Math.floor(system.mlevel.pathCost + system.mlevel.singleSpellCost + system.metaMagic.totalCost); // Summoning Abilities - system.summonbonus = summon; - system.controlbonus = control; - system.bindbonus = bind; - system.banishbonus = banish; - system.summonfinal = Math.floor(system.summoning.summon.base + system.summonbonus + system.summoning.summon.spec + system.summoning.summon.bonus + system.stats.Power.mod + Math.min(0, system.aamFinal)); - system.controlfinal = Math.floor(system.summoning.control.base + system.controlbonus + system.summoning.control.spec + system.summoning.control.bonus + system.stats.Willpower.mod + Math.min(0, system.aamFinal)); - system.bindfinal = Math.floor(system.summoning.bind.base + system.bindbonus + system.summoning.bind.spec + system.summoning.bind.bonus + system.stats.Power.mod + Math.min(0, system.aamFinal)); - system.banishfinal = Math.floor(system.summoning.banish.base + system.banishbonus + system.summoning.banish.spec + system.summoning.banish.bonus + system.stats.Power.mod + Math.min(0, system.aamFinal)); + system.summoning.summon.class = classBonuses.summon; + system.summoning.control.class = classBonuses.control; + system.summoning.bind.class = classBonuses.bind; + system.summoning.banish.class = classBonuses.banish; + system.summoning.summon.final = Math.floor(system.summoning.summon.base + system.summoning.summon.class + system.summoning.summon.spec + system.summoning.summon.bonus + system.stats.Power.mod + Math.min(0, system.aamField.final)); + system.summoning.control.final = Math.floor(system.summoning.control.base + system.summoning.control.class + system.summoning.control.spec + system.summoning.control.bonus + system.stats.Willpower.mod + Math.min(0, system.aamField.final)); + system.summoning.bind.final = Math.floor(system.summoning.bind.base + system.summoning.bind.class + system.summoning.bind.spec + system.summoning.bind.bonus + system.stats.Power.mod + Math.min(0, system.aamField.final)); + system.summoning.banish.final = Math.floor(system.summoning.banish.base + system.summoning.banish.class + system.summoning.banish.spec + system.summoning.banish.bonus + system.stats.Power.mod + Math.min(0, system.aamField.final)); //Unarmed switch (system.fistDamage.multOption) { case "agi": - system.unarmedDmgMult1 = Math.floor(system.fistDamage.mult * system.stats.Agility.mod); + system.fistDamage.dmgMult1 = Math.floor(system.fistDamage.mult * system.stats.Agility.mod); break; case "con": - system.unarmedDmgMult1 = Math.floor(system.fistDamage.mult * system.stats.Constitution.mod); + system.fistDamage.dmgMult1 = Math.floor(system.fistDamage.mult * system.stats.Constitution.mod); break; case "str": - system.unarmedDmgMult1 = Math.floor(system.fistDamage.mult * system.stats.Strength.mod); + system.fistDamage.dmgMult1 = Math.floor(system.fistDamage.mult * system.stats.Strength.mod); break; case "dex": - system.unarmedDmgMult1 = Math.floor(system.fistDamage.mult * system.stats.Dexterity.mod); + system.fistDamage.dmgMult1 = Math.floor(system.fistDamage.mult * system.stats.Dexterity.mod); break; case "per": - system.unarmedDmgMult1 = Math.floor(system.fistDamage.mult * system.stats.Perception.mod); + system.fistDamage.dmgMult1 = Math.floor(system.fistDamage.mult * system.stats.Perception.mod); break; case "int": - system.unarmedDmgMult1 = Math.floor(system.fistDamage.mult * system.stats.Intelligence.mod); + system.fistDamage.dmgMult1 = Math.floor(system.fistDamage.mult * system.stats.Intelligence.mod); break; case "pow": - system.unarmedDmgMult1 = Math.floor(system.fistDamage.mult * system.stats.Power.mod); + system.fistDamage.dmgMult1 = Math.floor(system.fistDamage.mult * system.stats.Power.mod); break; case "wp": - system.unarmedDmgMult1 = Math.floor(system.fistDamage.mult * system.stats.Willpower.mod); + system.fistDamage.dmgMult1 = Math.floor(system.fistDamage.mult * system.stats.Willpower.mod); break; case "str2": - system.unarmedDmgMult1 = Math.floor(system.fistDamage.mult * (system.stats.Strength.mod * 2)); + system.fistDamage.dmgMult1 = Math.floor(system.fistDamage.mult * (system.stats.Strength.mod * 2)); break; case "presence": - system.unarmedDmgMult1 = Math.floor(system.fistDamage.mult * ((system.presence * 2) + system.stats.Power.mod)); + system.fistDamage.dmgMult1 = Math.floor(system.fistDamage.mult * ((system.levelinfo.presence * 2) + system.stats.Power.mod)); break; default: - system.unarmedDmgMult1 = 0; + system.fistDamage.dmgMult1 = 0; break; } switch (system.fistDamage.multOption2) { case "agi": - system.unarmedDmgMult2 = Math.floor(system.fistDamage.mult2 * system.stats.Agility.mod); + system.fistDamage.dmgMult2 = Math.floor(system.fistDamage.mult2 * system.stats.Agility.mod); break; case "con": - system.unarmedDmgMult2 = Math.floor(system.fistDamage.mult2 * system.stats.Constitution.mod); + system.fistDamage.dmgMult2 = Math.floor(system.fistDamage.mult2 * system.stats.Constitution.mod); break; case "str": - system.unarmedDmgMult2 = Math.floor(system.fistDamage.mult2 * system.stats.Strength.mod); + system.fistDamage.dmgMult2 = Math.floor(system.fistDamage.mult2 * system.stats.Strength.mod); break; case "dex": - system.unarmedDmgMult2 = Math.floor(system.fistDamage.mult2 * system.stats.Dexterity.mod); + system.fistDamage.dmgMult2 = Math.floor(system.fistDamage.mult2 * system.stats.Dexterity.mod); break; case "per": - system.unarmedDmgMult2 = Math.floor(system.fistDamage.mult2 * system.stats.Perception.mod); + system.fistDamage.dmgMult2 = Math.floor(system.fistDamage.mult2 * system.stats.Perception.mod); break; case "int": - system.unarmedDmgMult2 = Math.floor(system.fistDamage.mult2 * system.stats.Intelligence.mod); + system.fistDamage.dmgMult2 = Math.floor(system.fistDamage.mult2 * system.stats.Intelligence.mod); break; case "pow": - system.unarmedDmgMult2 = Math.floor(system.fistDamage.mult2 * system.stats.Power.mod); + system.fistDamage.dmgMult2 = Math.floor(system.fistDamage.mult2 * system.stats.Power.mod); break; case "wp": - system.unarmedDmgMult2 = Math.floor(system.fistDamage.mult2 * system.stats.Willpower.mod); + system.fistDamage.dmgMult2 = Math.floor(system.fistDamage.mult2 * system.stats.Willpower.mod); break; case "str2": - system.unarmedDmgMult2 = Math.floor(system.fistDamage.mult2 * (system.stats.Strength.mod * 2)); + system.fistDamage.dmgMult2 = Math.floor(system.fistDamage.mult2 * (system.stats.Strength.mod * 2)); break; case "presence": - system.unarmedDmgMult2 = Math.floor(system.fistDamage.mult2 * ((system.presence * 2) + system.stats.Power.mod)); + system.fistDamage.dmgMult2 = Math.floor(system.fistDamage.mult2 * ((system.levelinfo.presence * 2) + system.stats.Power.mod)); break; default: - system.unarmedDmgMult2 = 0; + system.fistDamage.dmgMult2 = 0; break; } - system.unarmedDmgFinal = Math.floor(system.fistDamage.base + system.unarmedDmgMult1 + system.unarmedDmgMult2 + system.fistDamage.bonus); + system.fistDamage.final = Math.floor(system.fistDamage.base + system.fistDamage.dmgMult1 + system.fistDamage.dmgMult2 + system.fistDamage.bonus); // Psychic Points - system.ppbonus = pp; - system.finalpp = Math.floor(system.ppoint.base + system.ppoint.spec + system.ppoint.bonus + system.ppbonus); - system.innateSlotspp = Math.floor(system.other.innateSlots * 2); - system.psychicPoint.max = Math.floor(system.finalpp - (+usedpp + system.ppotentialpp + +matrixpp + system.innateSlotspp)); + system.ppoint.class = classBonuses.pp; + system.ppoint.final = Math.floor(system.ppoint.base + system.ppoint.spec + system.ppoint.bonus + system.ppoint.class); + system.ppoint.innateSlot = Math.floor(system.other.innateSlots * 2); + system.psychicPoint.max = Math.floor(system.ppoint.final - (+classBonuses.usedpp + system.ppotential.fromPP + +classBonuses.matrixpp + system.ppoint.innateSlot)); //Monster - system.monsterPowerCost = monsterCost; - system.monstTotDP = Math.floor(system.monsterCharCombCost + system.monsterPowerCost + system.monsterStats.hpDp); + system.monsterStats.powersCost = classBonuses.monsterCost; + system.monsterStats.totalDP = Math.floor(system.monsterStats.charCombinedCost + system.monsterStats.powersCost + system.monsterStats.hpDp); // Settings - system.openRangeFinal = Math.floor(system.rollRange.base - system.rollRange.spec - system.rollRange.temp - system.rollRange.bonus); - system.fumbleRangeFinal = Math.floor(system.fumleRange.base + system.fumleRange.spec + system.fumleRange.temp + system.fumleRange.bonus); + system.rollRange.final = Math.floor(system.rollRange.base - system.rollRange.spec - system.rollRange.temp - system.rollRange.bonus); + system.fumleRange.final = Math.floor(system.fumleRange.base + system.fumleRange.spec + system.fumleRange.temp + system.fumleRange.bonus); + console.log(this); // Reload Items to get Atk/Def this.items.reduce((arr, item) => { diff --git a/module/actor/abfalterCharacterSheet.js b/module/actor/abfalterCharacterSheet.js index fc13871..86dbe06 100644 --- a/module/actor/abfalterCharacterSheet.js +++ b/module/actor/abfalterCharacterSheet.js @@ -7,7 +7,7 @@ export default class abfalterCharacterSheet extends ActorSheet { static get defaultOptions() { return foundry.utils.mergeObject(super.defaultOptions, { classes: ["abfalter", "sheet", "actor"], - template: "systems/abfalter/templates/actor/actor-sheet.html", + template: "systems/abfalter/templates/actor/actor-sheet.hbs", width: 900, height: 950, tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "description" }] @@ -221,23 +221,23 @@ export default class abfalterCharacterSheet extends ActorSheet { this.document.update({ "system.zeon.value": Math.min(Math.floor(this.document.system.zeon.value + (value / 1)), max) }); }); html.find('.kiAccuHalf').click(ev => { - let value = this.document.system.kiPool.agi.current + Math.max(1, Math.floor(this.document.system.kiPoolAgiAccumTot / 2)); - let value2 = this.document.system.kiPool.con.current + Math.max(1, Math.floor(this.document.system.kiPoolConAccumTot / 2)); - let value3 = this.document.system.kiPool.dex.current + Math.max(1, Math.floor(this.document.system.kiPoolDexAccumTot / 2)); - let value4 = this.document.system.kiPool.str.current + Math.max(1, Math.floor(this.document.system.kiPoolStrAccumTot / 2)); - let value5 = this.document.system.kiPool.pow.current + Math.max(1, Math.floor(this.document.system.kiPoolPowAccumTot / 2)); - let value6 = this.document.system.kiPool.wp.current + Math.max(1, Math.floor(this.document.system.kiPoolWPAccumTot / 2)); + let value = this.document.system.kiPool.agi.current + Math.max(1, Math.floor(this.document.system.kiPool.agi.accumTot / 2)); + let value2 = this.document.system.kiPool.con.current + Math.max(1, Math.floor(this.document.system.kiPool.con.accumTot / 2)); + let value3 = this.document.system.kiPool.dex.current + Math.max(1, Math.floor(this.document.system.kiPool.dex.accumTot / 2)); + let value4 = this.document.system.kiPool.str.current + Math.max(1, Math.floor(this.document.system.kiPool.str.accumTot / 2)); + let value5 = this.document.system.kiPool.pow.current + Math.max(1, Math.floor(this.document.system.kiPool.pow.accumTot / 2)); + let value6 = this.document.system.kiPool.wp.current + Math.max(1, Math.floor(this.document.system.kiPool.wp.accumTot / 2)); this.document.update({ "system.kiPool.agi.current": value, "system.kiPool.con.current": value2, "system.kiPool.dex.current": value3, "system.kiPool.str.current": value4, "system.kiPool.pow.current": value5, "system.kiPool.wp.current": value6 }); }); html.find('.kiAccuFull').click(ev => { - let value = this.document.system.kiPool.agi.current + this.document.system.kiPoolAgiAccumTot; - let value2 = this.document.system.kiPool.con.current + this.document.system.kiPoolConAccumTot; - let value3 = this.document.system.kiPool.dex.current + this.document.system.kiPoolDexAccumTot; - let value4 = this.document.system.kiPool.str.current + this.document.system.kiPoolStrAccumTot; - let value5 = this.document.system.kiPool.pow.current + this.document.system.kiPoolPowAccumTot; - let value6 = this.document.system.kiPool.wp.current + this.document.system.kiPoolWPAccumTot; + let value = this.document.system.kiPool.agi.current + this.document.system.kiPool.agi.accumTot; + let value2 = this.document.system.kiPool.con.current + this.document.system.kiPool.con.accumTot; + let value3 = this.document.system.kiPool.dex.current + this.document.system.kiPool.dex.accumTot; + let value4 = this.document.system.kiPool.str.current + this.document.system.kiPool.str.accumTot; + let value5 = this.document.system.kiPool.pow.current + this.document.system.kiPool.pow.accumTot; + let value6 = this.document.system.kiPool.wp.current + this.document.system.kiPool.wp.accumTot; this.document.update({ "system.kiPool.agi.current": value, "system.kiPool.con.current": value2, "system.kiPool.dex.current": value3, "system.kiPool.str.current": value4, "system.kiPool.pow.current": value5, "system.kiPool.wp.current": value6 diff --git a/module/autoCombat/customMacroBar.js b/module/autoCombat/customMacroBar.js index ca0c962..de69683 100644 --- a/module/autoCombat/customMacroBar.js +++ b/module/autoCombat/customMacroBar.js @@ -4,14 +4,14 @@ import { templates } from "../utilities/templates.js"; const gmMacro = [ { macroSelectorId: '#sendAttack', - hotkey: e => e.ctrlKey && e.key === '1', + hotkey: e => e.ctrlKey && e.key === '0', fn: () => window.Websocket.sendAttack?.() } ]; const playerMacro = [ { macroSelectorId: '#sendAttackRequest', - hotkey: e => e.ctrlKey && e.key === '1', + hotkey: e => e.ctrlKey && e.key === '0', fn: () => window.Websocket.sendAttackRequest?.() } ]; diff --git a/module/combat.js b/module/combat.js index eae0d0a..2881045 100644 --- a/module/combat.js +++ b/module/combat.js @@ -19,7 +19,7 @@ export default class abfalterCombat extends Combat { const combatant = this.combatants.get(id); await super.rollInitiative(id, { - formula: `1d100 + ${combatant?.actor?.system.iniFinal} + ${mod}`, + formula: `1d100 + ${combatant?.actor?.system.initiative.final} + ${mod}`, updateTurn, messageOptions }); diff --git a/module/diceroller.js b/module/diceroller.js index 6cd2b16..9208dd6 100644 --- a/module/diceroller.js +++ b/module/diceroller.js @@ -38,7 +38,7 @@ export async function openModifierDialogue(actorData, finalValue, label, type, c case "potentialRoll": case "summoningRoll": case "combatRoll": - rollSecondary(html, actorData, finalValue, label); + abilityRoll(html, actorData, finalValue, label); break; case "weaponCombatRoll": rollCombatWeapon(html, actorData, finalValue, label, complex); @@ -96,9 +96,7 @@ export async function rollCharacteristic(html, actorData, finalValue, label) { ChatMessage.create(chatData); } - - -async function rollSecondary(html, actorData, finalValue, label) { +async function abilityRoll(html, actorData, finalValue, label) { let fatigueMod = parseInt(html.find('#fatiguemod').val()) || 0; let mod = parseInt(html.find('#modifiermod').val()) || 0; let fatigueFinal = Math.floor(fatigueMod * 15); @@ -107,19 +105,16 @@ async function rollSecondary(html, actorData, finalValue, label) { const rollResult = await new Roll(rollFormula, actorData).roll(); rollResult.rolledDice = rollResult.total - finalValue - fatigueFinal - mod; - let fumbleRange = actorData.system.fumbleRangeFinal; - - + let fumbleRange = actorData.system.fumleRange.final; if (finalValue > 199 && fumbleRange > 1) { fumbleRange -= 1; } - rollResult.color = ""; rollResult.fumbleLevel = 0; rollResult.fumble = false; rollResult.explode = false; rollResult.doubles = false; - rollResult.openRange = actorData.system.openRangeFinal; + rollResult.openRange = actorData.system.rollRange.final; if (rollResult.rolledDice <= fumbleRange) { rollResult.color = "fumbleRoll"; @@ -128,43 +123,36 @@ async function rollSecondary(html, actorData, finalValue, label) { rollResult.fumbleLevel += 15; fumbleRange--; } - } else if (rollResult.rolledDice >= actorData.system.openRangeFinal) { + } else if (rollResult.rolledDice >= actorData.system.rollRange.final) { rollResult.color = "openRoll"; rollResult.explode = true; } else { rollResult.color = "normalRoll"; } - if (actorData.system.rollRange.doubles == "true") { + if (actorData.system.rollRange.doubles === true) { rollResult.doubles = true; - switch (rollResult.rolledDice) { - case 11: - case 22: - case 22: - case 33: - case 44: - case 55: - case 66: - case 77: - case 88: - rollResult.color = "openRoll"; - rollResult.explode = true; - break; - default: - break; + let doubleValues = [11, 22, 33, 44, 55, 66, 77, 88]; + if (doubleValues.includes(rollResult.rolledDice)) { + rollResult.color = "openRoll"; + rollResult.explode = true; } } - const rollData = [rollResult.rolledDice, rollResult._total, rollResult.doubles, rollResult.openRange, label, rollResult.fumbleLevel]; - - const template = "systems/abfalter/templates/dialogues/secRoll.html" - const content = await renderTemplate(template, { rollResult: rollResult, label: label, actor: actorData }); + let num = 0; + const rollData = []; + rollData[0] = { + roll: rollResult.rolledDice, total: rollResult._total, doubles: rollResult.doubles, openRange: rollResult.openRange, label: label, fumbleLevel: rollResult.fumbleLevel, + fumble: rollResult.fumble, explode: rollResult.explode, result: rollResult.result, color: rollResult.color + }; + const template = "systems/abfalter/templates/dialogues/abilityRoll.hbs" + const content = await renderTemplate(template, { rollData: rollData, label: label, actor: actorData }); const chatData = { user: game.user.id, speaker: ChatMessage.getSpeaker({ actorData: actorData }), sound: CONFIG.sounds.dice, content: content, rolls: [rollResult], - flags: { rollData, actorData } + flags: { rollData, actorData, num } }; ChatMessage.applyRollMode(chatData, game.settings.get("core", "rollMode")); ChatMessage.create(chatData); @@ -179,26 +167,11 @@ async function rollCombatWeapon(html, actorData, finalValue, label, complex) { const rollResult = await new Roll(rollFormula, actorData).roll(); rollResult.rolledDice = rollResult.total - finalValue - fatigueFinal - mod; - let fumbleRange = actorData.system.fumbleRangeFinal; - - let mastery = 0; - switch (label) { - case "Attack": - mastery = actorData.system.atkfinal; - break; - case "Block": - mastery = actorData.system.blkfinal; - break; - case "Dodge": - mastery = actorData.system.dodfinal; - break; - default: - break; - } + let fumbleRange = actorData.system.fumleRange.final; if (complex == "true") { fumbleRange += 2; } - if (mastery > 199 && fumbleRange > 1) { + if (finalValue > 199 && fumbleRange > 1) { fumbleRange -= 1; } @@ -207,7 +180,7 @@ async function rollCombatWeapon(html, actorData, finalValue, label, complex) { rollResult.fumble = false; rollResult.explode = false; rollResult.doubles = false; - rollResult.openRange = actorData.system.openRangeFinal; + rollResult.openRange = actorData.system.rollRange.final; if (rollResult.rolledDice <= fumbleRange) { rollResult.color = "fumbleRoll"; @@ -216,50 +189,127 @@ async function rollCombatWeapon(html, actorData, finalValue, label, complex) { rollResult.fumbleLevel += 15; fumbleRange--; } - } else if (rollResult.rolledDice >= actorData.system.openRangeFinal) { + } else if (rollResult.rolledDice >= actorData.system.rollRange.final) { rollResult.color = "openRoll"; rollResult.explode = true; } else { rollResult.color = "normalRoll"; } - if (actorData.system.rollRange.doubles == "true") { + if (actorData.system.rollRange.doubles === true) { rollResult.doubles = true; - switch (rollResult.rolledDice) { - case 11: - case 22: - case 22: - case 33: - case 44: - case 55: - case 66: - case 77: - case 88: - rollResult.color = "openRoll" - rollResult.explode = true; - break; - default: - break; + let doubleValues = [11, 22, 33, 44, 55, 66, 77, 88]; + if (doubleValues.includes(rollResult.rolledDice)) { + rollResult.color = "openRoll"; + rollResult.explode = true; } } - - - const rollData = [rollResult.rolledDice, rollResult._total, rollResult.doubles, rollResult.openRange, label, rollResult.fumbleLevel]; - - const template = "systems/abfalter/templates/dialogues/secRoll.html" - const content = await renderTemplate(template, { rollResult: rollResult, label: label, actor: actorData }); + let num = 0; + const rollData = []; + rollData[0] = { + roll: rollResult.rolledDice, total: rollResult._total, doubles: rollResult.doubles, openRange: rollResult.openRange, label: label, fumbleLevel: rollResult.fumbleLevel, + fumble: rollResult.fumble, explode: rollResult.explode, result: rollResult.result, color: rollResult.color + }; + const template = "systems/abfalter/templates/dialogues/abilityRoll.hbs" + const content = await renderTemplate(template, { rollData: rollData, label: label, actor: actorData }); const chatData = { user: game.user.id, speaker: ChatMessage.getSpeaker({ actorData: actorData }), sound: CONFIG.sounds.dice, content: content, rolls: [rollResult], - flags: { rollData, actorData } + flags: { rollData, actorData, num } }; ChatMessage.applyRollMode(chatData, game.settings.get("core", "rollMode")); ChatMessage.create(chatData); } +export async function openRollFunction(msg) { + let actorData = msg.flags.actorData; + let num = msg.flags.num; + let oldData = msg.flags.rollData[num]; + let baseDice = "1d100"; + let rollFormula = `${baseDice} + ${oldData.total}` + let rollResult = await new Roll(rollFormula).roll(); + + rollResult.rolledDice = rollResult.total - oldData.total; + rollResult.openRange = oldData.openRange; + rollResult.color = "normalRoll"; + let isDouble = rollResult.rolledDice % 11 === 0 && rollResult.rolledDice <= 88; + if (rollResult.rolledDice > oldData.roll) { + + if (oldData.doubles === true) { + if (isDouble === true) { + rollResult.color = "openRoll"; + rollResult.explode = true; + } else if (rollResult.rolledDice >= rollResult.openRange) { + rollResult.color = "openRoll"; + rollResult.explode = true; + } + } else { + if (rollResult.rolledDice >= rollResult.openRange) { + rollResult.color = "openRoll"; + rollResult.explode = true; + } + } + } else { + rollResult.color = "normalRoll"; + } + + msg.flags.rollData[num] = { + roll: oldData.rolledDice, total: oldData.total, doubles: null, openRange: null, label: oldData.label, + explode: false, result: oldData.result, color: oldData.color + }; + num = num + 1; + msg.flags.rollData[num] = { + roll: rollResult.rolledDice, total: rollResult._total, doubles: oldData.doubles, openRange: oldData.openRange, label: oldData.label, + explode: rollResult.explode, result: rollResult.result, color: rollResult.color + }; + + const rollData = msg.flags.rollData; + const template = "systems/abfalter/templates/dialogues/abilityRoll.hbs" + const content = await renderTemplate(template, { rollData: msg.flags.rollData, actor: actorData }); + game.messages.get(msg._id).update({ + content: content, + flags: { rollData, num} + }); +} + +export async function fumbleRollFunction(msg) { + let fumbleSettings = game.settings.get('abfalter', abfalterSettingsKeys.Corrected_Fumble); + let actorData = msg.flags.actorData; + let num = msg.flags.num; + let oldData = msg.flags.rollData[num]; + + let baseDice = "1d100"; + let rollFormula = ``; + + if (fumbleSettings == true) { + rollFormula = `${oldData.total} - ${baseDice}`; + } else { + rollFormula = `${oldData.total} - ${baseDice} - ${oldData.fumbleLevel}`; + }; + let rollResult = await new Roll(rollFormula).roll(); + rollResult.rolledDice = rollResult.total - oldData.total; + + msg.flags.rollData[num] = { + roll: oldData.rolledDice, total: oldData.total, label: oldData.label, + explode: false, result: oldData.result, color: oldData.color, fumble: false + }; + num = num + 1; + msg.flags.rollData[num] = { + roll: rollResult.rolledDice, total: rollResult._total, label: oldData.label, + result: rollResult.result, color: oldData.color, showSeverity: true + }; + + const rollData = msg.flags.rollData; + const template = "systems/abfalter/templates/dialogues/abilityRoll.hbs" + const content = await renderTemplate(template, { rollData: msg.flags.rollData, actor: actorData }); + game.messages.get(msg._id).update({ + content: content, + flags: { rollData, num } + }); +} export async function rollResistance(html, actorData, finalValue, label) { @@ -295,8 +345,6 @@ export async function rollResistance(html, actorData, finalValue, label) { ChatMessage.create(chatData); } - - export async function rollBreakage(html, actorData, finalValue, label) { let mod = parseInt(html.find('#modifiermod').val()) || 0; @@ -315,84 +363,4 @@ export async function rollBreakage(html, actorData, finalValue, label) { }; ChatMessage.applyRollMode(chatData, game.settings.get("core", "rollMode")); ChatMessage.create(chatData); -} - - -export async function openRollFunction(msg) { - //flags.rollData: roll, total, doubles, openRange, label - let actorData = msg.flags.actorData; - - let baseDice = "1d100"; - let rollFormula = `${baseDice} + ${msg.flags.rollData[1]}` - let rollResult = await new Roll(rollFormula).roll(); - rollResult.rolledDice = rollResult.total - msg.flags.rollData[1]; - rollResult.openRange = msg.flags.rollData[3]; - rollResult.data.name = msg.speaker.alias; - - rollResult.color = "normalRoll"; - if (rollResult.rolledDice > msg.flags.rollData[0]) { - if (msg.flags.rollData[2] == "true") { - if (rollResult.rolledDice >= rollResult.openRange || rollResult.rolledDice == 11 || rollResult.rolledDice == 22 || - rollResult.rolledDice == 33 || rollResult.rolledDice == 44 || rollResult.rolledDice == 55 || rollResult.rolledDice == 66 || - rollResult.rolledDice == 77 || rollResult.rolledDice == 88) { - rollResult.color = "openRoll"; - rollResult.explode = true; - } - } else { - if (rollResult.rolledDice >= rollResult.openRange) { - rollResult.color = "openRoll"; - rollResult.explode = true; - } - } - } else { - rollResult.color = "normalRoll"; - } - - const rollData = [rollResult.rolledDice, rollResult._total, rollResult.doubles, rollResult.openRange, msg.flags.rollData[4]]; - - const template = "systems/abfalter/templates/dialogues/secRoll.html" - const content = await renderTemplate(template, { rollResult: rollResult, label: msg.flags.rollData[4], actor: actorData }); - const chatData = { - user: game.user.id, - speaker: ChatMessage.getSpeaker({ actorData: actorData }), - sound: CONFIG.sounds.dice, - content: content, - rolls: [rollResult], - flags: { rollData, actorData } - }; - ChatMessage.applyRollMode(chatData, game.settings.get("core", "rollMode")); - ChatMessage.create(chatData); -} - -export async function fumbleRollFunction(msg) { - //flags.rollData: roll, total, doubles, openRange, label, fumble - //total, fumble, label, name - let actorData = msg.flags.actorData; - let fumbleSettings = game.settings.get('abfalter', abfalterSettingsKeys.Corrected_Fumble); - - let baseDice = "1d100"; - let rollFormula = `` - - if (fumbleSettings == true) { - rollFormula = `${msg.flags.rollData[1]} - ${baseDice}` - - } else { - rollFormula = `${msg.flags.rollData[1]} - ${baseDice} - ${msg.flags.rollData[5]}` - }; - let rollResult = await new Roll(rollFormula).roll(); - rollResult.rolledDice = rollResult.total - msg.flags.rollData[1]; - rollResult.data.name = msg.speaker.alias; - - const template = "systems/abfalter/templates/dialogues/fumbleRoll.html" - const content = await renderTemplate(template, { rollResult: rollResult, label: msg.flags.rollData[4] }); - const chatData = { - user: game.user.id, - speaker: ChatMessage.getSpeaker({ actorData: actorData }), - sound: CONFIG.sounds.dice, - content: content, - rolls: [rollResult] - }; - ChatMessage.applyRollMode(chatData, game.settings.get("core", "rollMode")); - ChatMessage.create(chatData); -} - +} \ No newline at end of file diff --git a/module/helpers/abfalterEffectConfig.js b/module/helpers/abfalterEffectConfig.js index 12e0e9c..1bb5aa3 100644 --- a/module/helpers/abfalterEffectConfig.js +++ b/module/helpers/abfalterEffectConfig.js @@ -1,7 +1,7 @@ export default class abfalterEffectConfig extends ActiveEffectConfig { get template() { - return "systems/abfalter/templates/item/activeEffect-config.html" + return "systems/abfalter/templates/item/activeEffect-config.hbs" } async getData(options = {}) { @@ -14,23 +14,19 @@ export default class abfalterEffectConfig extends ActiveEffectConfig { activateListeners(html) { super.activateListeners(html); - - html.find(".activeTypes").change(this._categories.bind(this)); } - _categories(event) { - const dataset = event.currentTarget.dataset.value; - } + static initializeChangeKeys() { abfalterEffectConfig._availableChangeKeys = { //General Stats - 'system.combatstats.atkbonus': game.i18n.localize('abfalter.basicInfo.attack'), - 'system.combatstats.blkbonus': game.i18n.localize('abfalter.basicInfo.block'), - 'system.combatstats.dodbonus': game.i18n.localize('abfalter.basicInfo.dodge'), + 'system.combatValues.attack.bonus': game.i18n.localize('abfalter.basicInfo.attack'), + 'system.combatValues.block.bonus': game.i18n.localize('abfalter.basicInfo.block'), + 'system.combatValues.dodge.bonus': game.i18n.localize('abfalter.basicInfo.dodge'), 'system.initiative.bonus': game.i18n.localize('abfalter.generalTab.initiative'), - 'system.aamBonus': game.i18n.localize('abfalter.generalTab.aam'), + 'system.aamField.bonus': game.i18n.localize('abfalter.generalTab.aam'), 'system.stats.Agility.final':game.i18n.localize('abfalter.basicInfo.agility'), 'system.stats.Agility.opposedBonus': game.i18n.localize('abfalter.generalTab.opposed') + ' ' + game.i18n.localize('abfalter.basicInfo.agility'), 'system.stats.Constitution.final': game.i18n.localize('abfalter.basicInfo.consti'), @@ -56,64 +52,64 @@ export default class abfalterEffectConfig extends ActiveEffectConfig { 'system.regeneration.bonus': game.i18n.localize('abfalter.activeEffectChanges.healthRegen'), 'system.movement.bonus': game.i18n.localize('abfalter.generalTab.movement'), 'system.fatigue.bonus': game.i18n.localize('abfalter.generalTab.fatigue'), - 'system.wearArmor.bonus': game.i18n.localize('abfalter.armoryTab.wearArmor'), + 'system.armor.wearArmor.bonus': game.i18n.localize('abfalter.armoryTab.wearArmor'), //Secondaries - 'system.secondary.acrobatics.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.acrobatic'), - 'system.secondary.athleticism.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.athleticism'), - 'system.secondary.climb.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.climb'), - 'system.secondary.jump.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.jump'), - 'system.secondary.piloting.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.piloting'), - 'system.secondary.ride.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.ride'), - 'system.secondary.swim.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.swim'), - 'system.secondary.etiquette.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.etiquette'), - 'system.secondary.intimidate.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.intimidate'), - 'system.secondary.leadership.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.leadership'), - 'system.secondary.persuasion.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.persuasion'), - 'system.secondary.streetwise.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.streetwise'), - 'system.secondary.style.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.style'), - 'system.secondary.trading.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.trading'), - 'system.secondary.kidetection.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.kiTab.kiDetection'), - 'system.secondary.notice.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.notice'), - 'system.secondary.search.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.search'), - 'system.secondary.track.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.track'), - 'system.secondary.animals.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.animals'), - 'system.secondary.appraisal.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.appraisal'), - 'system.secondary.architecture.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.architecture'), - 'system.secondary.herballore.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.herballore'), - 'system.secondary.history.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.history'), - 'system.secondary.law.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.law'), - 'system.secondary.magicappr.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.magicAppr'), - 'system.secondary.medicine.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.medicine'), - 'system.secondary.memorize.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.memorize'), - 'system.secondary.navigation.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.navigation'), - 'system.secondary.occult.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.occult'), - 'system.secondary.science.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.science'), - 'system.secondary.tactics.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.tactics'), - 'system.secondary.technomagic.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.technomagic'), - 'system.secondary.composure.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.composure'), - 'system.secondary.featsofstr.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.featsOfStr'), - 'system.secondary.withstpain.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.withstPain'), - 'system.secondary.disguise.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.disguise'), - 'system.secondary.hide.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.hide'), - 'system.secondary.kiconceal.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.kiTab.kiConceal'), - 'system.secondary.lockpicking.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.lockpicking'), - 'system.secondary.poisons.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.poisons'), - 'system.secondary.stealth.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.stealth'), - 'system.secondary.theft.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.theft'), - 'system.secondary.traplore.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.traplore'), - 'system.secondary.alchemy.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.alchemy'), - 'system.secondary.animism.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.animism'), - 'system.secondary.art.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.art'), - 'system.secondary.cooking.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.cooking'), - 'system.secondary.dance.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.dance'), - 'system.secondary.forging.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.forging'), - 'system.secondary.jewelry.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.jewelry'), - 'system.secondary.toymaking.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.toymaking'), - 'system.secondary.music.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.music'), - 'system.secondary.runes.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.runes'), - 'system.secondary.ritualcalig.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.ritualCal'), - 'system.secondary.slofhand.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.soh'), - 'system.secondary.tailoring.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.tailoring'), + 'system.secondaryFields.athletics.acrobatics.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.acrobatic'), + 'system.secondaryFields.athletics.athleticism.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.athleticism'), + 'system.secondaryFields.athletics.climb.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.climb'), + 'system.secondaryFields.athletics.jump.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.jump'), + 'system.secondaryFields.athletics.piloting.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.piloting'), + 'system.secondaryFields.athletics.ride.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.ride'), + 'system.secondaryFields.athletics.swim.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.swim'), + 'system.secondaryFields.social.etiquette.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.etiquette'), + 'system.secondaryFields.social.intimidate.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.intimidate'), + 'system.secondaryFields.social.leadership.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.leadership'), + 'system.secondaryFields.social.persuasion.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.persuasion'), + 'system.secondaryFields.social.streetwise.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.streetwise'), + 'system.secondaryFields.social.style.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.style'), + 'system.secondaryFields.social.trading.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.trading'), + 'system.secondaryFields.perceptive.kidetection.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.kiTab.kiDetection'), + 'system.secondaryFields.perceptive.notice.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.notice'), + 'system.secondaryFields.perceptive.search.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.search'), + 'system.secondaryFields.perceptive.track.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.track'), + 'system.secondaryFields.intellectual.animals.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.animals'), + 'system.secondaryFields.intellectual.appraisal.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.appraisal'), + 'system.secondaryFields.intellectual.architecture.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.architecture'), + 'system.secondaryFields.intellectual.herballore.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.herballore'), + 'system.secondaryFields.intellectual.history.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.history'), + 'system.secondaryFields.intellectual.law.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.law'), + 'system.secondaryFields.intellectual.magicappr.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.magicAppr'), + 'system.secondaryFields.intellectual.medicine.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.medicine'), + 'system.secondaryFields.intellectual.memorize.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.memorize'), + 'system.secondaryFields.intellectual.navigation.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.navigation'), + 'system.secondaryFields.intellectual.occult.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.occult'), + 'system.secondaryFields.intellectual.science.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.science'), + 'system.secondaryFields.intellectual.tactics.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.tactics'), + 'system.secondaryFields.intellectual.technomagic.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.technomagic'), + 'system.secondaryFields.vigor.composure.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.composure'), + 'system.secondaryFields.vigor.featsofstr.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.featsOfStr'), + 'system.secondaryFields.vigor.withstpain.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.withstPain'), + 'system.secondaryFields.subterfuge.disguise.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.disguise'), + 'system.secondaryFields.subterfuge.hide.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.hide'), + 'system.secondaryFields.subterfuge.kiconceal.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.kiTab.kiConceal'), + 'system.secondaryFields.subterfuge.lockpicking.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.lockpicking'), + 'system.secondaryFields.subterfuge.poisons.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.poisons'), + 'system.secondaryFields.subterfuge.stealth.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.stealth'), + 'system.secondaryFields.subterfuge.theft.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.theft'), + 'system.secondaryFields.subterfuge.traplore.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.traplore'), + 'system.secondaryFields.creative.alchemy.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.alchemy'), + 'system.secondaryFields.creative.animism.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.animism'), + 'system.secondaryFields.creative.art.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.art'), + 'system.secondaryFields.creative.cooking.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.cooking'), + 'system.secondaryFields.creative.dance.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.dance'), + 'system.secondaryFields.creative.forging.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.forging'), + 'system.secondaryFields.creative.jewelry.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.jewelry'), + 'system.secondaryFields.creative.toymaking.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.toymaking'), + 'system.secondaryFields.creative.music.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.music'), + 'system.secondaryFields.creative.runes.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.runes'), + 'system.secondaryFields.creative.ritualcalig.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.ritualCal'), + 'system.secondaryFields.creative.slofhand.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.soh'), + 'system.secondaryFields.creative.tailoring.bonus': game.i18n.localize('abfalter.activeEffectChanges.secAbility') + ': ' + game.i18n.localize('abfalter.generalTab.tailoring'), //mystic 'system.mproj.bonus': game.i18n.localize('abfalter.magicTab.offensive1') + ' ' + game.i18n.localize('abfalter.magicTab.mproj'), 'system.mproj.bonus2': game.i18n.localize('abfalter.magicTab.defensive1') + ' ' + game.i18n.localize('abfalter.magicTab.mproj'), diff --git a/module/helpers/metaMagicSheet.js b/module/helpers/metaMagicSheet.js index d20f58b..75c0037 100644 --- a/module/helpers/metaMagicSheet.js +++ b/module/helpers/metaMagicSheet.js @@ -2,7 +2,7 @@ export class metaMagicSheet extends ActorSheet { static get defaultOptions() { return foundry.utils.mergeObject(super.defaultOptions, { classes: ["abfalter"], - template: "systems/abfalter/templates/actor/parts/metaMagic.html", + template: "systems/abfalter/templates/actor/parts/metaMagic.hbs", width: 1300, height: 950 }); diff --git a/module/item/abfalterItem.js b/module/item/abfalterItem.js index 1b3855f..53b13b8 100644 --- a/module/item/abfalterItem.js +++ b/module/item/abfalterItem.js @@ -100,9 +100,9 @@ export default class abfalterItem extends Item { } if (this.parent != null) { - this.system.finalAtk = Math.floor(this.parent.system.atkfinal + ~~this.system.attack + ~~this.system.quality); - this.system.finalBlk = Math.floor(this.parent.system.blkfinal + ~~this.system.block + ~~this.system.shieldBonus + ~~this.system.quality); - this.system.finalDod = Math.floor(this.parent.system.dodfinal + ~~this.system.dodge + ~~this.system.shieldBonus2); + this.system.finalAtk = Math.floor(this.parent.system.combatValues.attack.final + ~~this.system.attack + ~~this.system.quality); + this.system.finalBlk = Math.floor(this.parent.system.combatValues.block.final + ~~this.system.block + ~~this.system.shieldBonus + ~~this.system.quality); + this.system.finalDod = Math.floor(this.parent.system.combatValues.dodge.final + ~~this.system.dodge + ~~this.system.shieldBonus2); if (this.parent.system.kiAbility.kiAuraEx.status == true) { this.system.kiBonus = 5; @@ -229,7 +229,7 @@ export default class abfalterItem extends Item { if (this.parent != null) { if (this.parent) { - this.system.newPotential = Math.floor(~~this.parent.system.finalPotential + ~~this.system.bonus); + this.system.newPotential = Math.floor(~~this.parent.system.ppotential.final + ~~this.system.bonus); } } } @@ -298,7 +298,7 @@ export default class abfalterItem extends Item { prepareSecondary() { if (this.parent != null) { - this.system.aam = this.parent.system.aamFinal; + this.system.aam = this.parent.system.aamField.final; this.system.collapse = this.parent.system.toggles.customSecondary; switch (this.system.atr) { diff --git a/module/item/abfalterItemSheet.js b/module/item/abfalterItemSheet.js index ca4546b..2ecc5e3 100644 --- a/module/item/abfalterItemSheet.js +++ b/module/item/abfalterItemSheet.js @@ -25,7 +25,7 @@ export default class abfalterItemSheet extends ItemSheet { get template() { const path = "systems/abfalter/templates/item"; - return `${path}/${this.item.type}.html`; + return `${path}/${this.item.type}.hbs`; } getData() { diff --git a/module/utilities/abfalterSettings.js b/module/utilities/abfalterSettings.js index d131ffe..0dc012c 100644 --- a/module/utilities/abfalterSettings.js +++ b/module/utilities/abfalterSettings.js @@ -13,6 +13,14 @@ export const abfalterSettings = () => { default: "", type: String }); + game.settings.register('abfalter', "systemChangeLog", { + name: "Don't show me the system changelog", + hint: "when toggled on, the system changelog will not show for the current version again, when toggled off it will show everytime on bootup.", + scope: 'world', + config: true, + default: false, + type: Boolean + }); game.settings.register('abfalter', abfalterSettingsKeys.Spirit_Damage, { name: game.i18n.localize('abfalter.globalSettings.spiritDmg'), hint: game.i18n.localize('abfalter.globalSettings.spiritDetail'), diff --git a/module/utilities/changelog.js b/module/utilities/changelog.js new file mode 100644 index 0000000..53876b0 --- /dev/null +++ b/module/utilities/changelog.js @@ -0,0 +1,40 @@ +class ChangelogForm extends FormApplication { + static get defaultOptions() { + return foundry.utils.mergeObject(super.defaultOptions, { + title: "Changelog", + template: "systems/abfalter/templates/dialogues/changelog.hbs", + width: 800, + height: "auto", + closeOnSubmit: false, + resizable: true + }); + } + + getData() { + return {}; + } + + activateListeners(html) { + super.activateListeners(html); + html.find('button[name="close"]').click(this._onClose.bind(this)); + html.find('button[name="dontShowAgain"]').click(this._onDontShowAgain.bind(this)); + } + + _onClose(event) { + event.preventDefault(); + this.close(); + } + + _onDontShowAgain(event) { + event.preventDefault(); + game.settings.set("abfalter", "systemChangeLog", true); + this.close(); + } +} + +export async function handleChangelog() { + if (!game.user.isGM) { + return; + } + new ChangelogForm().render(true); +} \ No newline at end of file diff --git a/module/utilities/migration.js b/module/utilities/migration.js index 1e56513..302d0b2 100644 --- a/module/utilities/migration.js +++ b/module/utilities/migration.js @@ -1,93 +1,36 @@ -async function migrateActorData(actor) { - /* - let updateData = {}; - if (actor.metaMagic) { - updateData["system.metaMagic.cost"] = 0; - updateData["system.metaMagic.extraCost"] = 0; - for (let [key, meta] of Object.entries(actor.metaMagic)) { - if (key !== "info" && key !== "cost" && key !== "extraCost") { - let path = "system.metaMagic." + key + ".bought"; - let path2 = "system.metaMagic." + key + ".free"; - updateData[path] = false; - updateData[path2] = false; - } - } +export async function handleMigrations() { + if (!game.user.isGM) { + return } + //migrateWorld_1_4_2(); //force update on reload (testing purposes) - if (actor.mproj) { - updateData["system.mproj.spec2"] = 0; - updateData["system.mproj.temp2"] = 0; - + const currentVersion = game.settings.get("abfalter", "systemMigrationVersion"); +; + if (!currentVersion) { + // If no version is saved, no need to migrate + return game.settings.set('demonlord', 'systemMigrationVersion', game.system.version) } - */ - const updates = []; - for (const item of actor.items) if (item.type === "monsterPower") { - let newType = ""; - switch (item.system.type) { - case "": - case "other": - newType = "other"; - break; - case "1": - case "essential": - newType = "essential"; - break; - case "2": - case "disadv": - newType = "disadv"; - break; - case "3": - case "combat": - newType = "combat"; - break; - case "4": - case "defense": - newType = "defense"; - break; - case "5": - case "misc": - newType = "misc"; - break; - case "6": - case "divine": - newType = "divine"; - break; - default: - newType = "other"; - break; - } - item.system.type = newType; - - // Collect the updates - updates.push({ _id: item.id, 'system.type': newType }); + // Compatibility warning + const COMPATIBLE_MIGRATION_VERSION = '1.3'; + if (currentVersion && foundry.utils.isNewerVersion(COMPATIBLE_MIGRATION_VERSION, currentVersion)) { + const warning = + 'Your ABF Alter system data is too old and cannot be reliably migrated to the latest version. The process will be attempted, but errors may occur.'; + ui.notifications.error(warning, { permanent: true }); } - return updates; -} + //1.4.2 migration & reorganization of all data into data models + if (foundry.utils.isNewerVersion('1.4.2', currentVersion)) await migrateWorld_1_4_2(); -function migrateSceneData(scene) { - const tokens = scene.tokens.map(token => { - const t = token.toJSON(); - - if (!t.actorLink) { - const actor = foundry.utils.duplicate(t.delta); - actor.type = t.actor?.type; - const update = migrateActorData(actor); - foundry.utils.mergeObject(t.delta, update); - } - return t; - }); - - return { tokens }; + return game.settings.set('abfalter', 'systemMigrationVersion', game.system.version); } -export async function migrateWorld() { +export async function migrateWorld_1_4_2() { for (let actor of game.actors.contents) { const updateData = await migrateActorData(actor); if (!foundry.utils.isEmpty(updateData)) { - console.log(`Migrating Actor entity ${actor.system.name}`); - //await actor.update(updateData); - await actor.updateEmbeddedDocuments("Item", updateData); + console.log(`Migrating Actor entity ${actor.name}`); + await actor.update(updateData); + //await actor.updateEmbeddedDocuments("Item", updateData); } } @@ -132,3 +75,560 @@ export async function migrateWorld() { console.log("Migration Complete"); game.settings.set('abfalter', 'systemMigrationVersion', game.system.version); } + +function migrateSceneData(scene) { + const tokens = scene.tokens.map(token => { + const t = token.toJSON(); + + if (!t.actorLink) { + const actor = foundry.utils.duplicate(t.delta); + actor.type = t.actor?.type; + const update = migrateActorData(actor); + foundry.utils.mergeObject(t.delta, update); + } + return t; + }); + + return { tokens }; +} + +async function migrateActorData(actor) { + + let updateData = {}; + + //Save all old values to new paths + if (actor.system.combatstats) { + updateData["system.combatValues.attack.base"] = actor.system.combatstats.atkbase; + updateData["system.combatValues.attack.special"] = actor.system.combatstats.atkspecial; + updateData["system.combatValues.attack.temp"] = actor.system.combatstats.atktemp; + updateData["system.combatValues.attack.status"] = actor.system.combatstats.atkStatus; + + updateData["system.combatValues.block.base"] = actor.system.combatstats.blkbase; + updateData["system.combatValues.block.special"] = actor.system.combatstats.blkspecial; + updateData["system.combatValues.block.temp"] = actor.system.combatstats.blktemp; + updateData["system.combatValues.block.status"] = actor.system.combatstats.blkStatus; + + updateData["system.combatValues.dodge.base"] = actor.system.combatstats.dodbase; + updateData["system.combatValues.dodge.special"] = actor.system.combatstats.dodspecial; + updateData["system.combatValues.dodge.temp"] = actor.system.combatstats.dodtemp; + updateData["system.combatValues.dodge.status"] = actor.system.combatstats.dodStatus; + + } + if (actor.system.wearArmor) { + updateData["system.armor.wearArmor.base"] = actor.system.wearArmor.base; + updateData["system.armor.wearArmor.spec"] = actor.system.wearArmor.spec; + updateData["system.armor.wearArmor.temp"] = actor.system.wearArmor.temp; + } + + if (actor.system.secondary) { + updateData["system.secondaryFields.athletics.acrobatics.base"] = actor.system.secondary.acrobatics.base; + updateData["system.secondaryFields.athletics.acrobatics.spec"] = actor.system.secondary.acrobatics.spec; + updateData["system.secondaryFields.athletics.acrobatics.temp"] = actor.system.secondary.acrobatics.temp; + updateData["system.secondaryFields.athletics.acrobatics.nat"] = actor.system.secondary.acrobatics.nat; + updateData["system.secondaryFields.athletics.acrobatics.natural"] = actor.system.secondary.acrobatics.natural; + updateData["system.secondaryFields.athletics.acrobatics.fav"] = actor.system.secondary.acrobatics.fav; + updateData["system.secondaryFields.athletics.acrobatics.status"] = actor.system.secondary.acrobatics.status; + + updateData["system.secondaryFields.athletics.athleticism.base"] = actor.system.secondary.athleticism.base; + updateData["system.secondaryFields.athletics.athleticism.spec"] = actor.system.secondary.athleticism.spec; + updateData["system.secondaryFields.athletics.athleticism.temp"] = actor.system.secondary.athleticism.temp; + updateData["system.secondaryFields.athletics.athleticism.nat"] = actor.system.secondary.athleticism.nat; + updateData["system.secondaryFields.athletics.athleticism.natural"] = actor.system.secondary.athleticism.natural; + updateData["system.secondaryFields.athletics.athleticism.fav"] = actor.system.secondary.athleticism.fav; + updateData["system.secondaryFields.athletics.athleticism.status"] = actor.system.secondary.athleticism.status; + + updateData["system.secondaryFields.athletics.climb.base"] = actor.system.secondary.climb.base; + updateData["system.secondaryFields.athletics.climb.spec"] = actor.system.secondary.climb.spec; + updateData["system.secondaryFields.athletics.climb.temp"] = actor.system.secondary.climb.temp; + updateData["system.secondaryFields.athletics.climb.nat"] = actor.system.secondary.climb.nat; + updateData["system.secondaryFields.athletics.climb.natural"] = actor.system.secondary.climb.natural; + updateData["system.secondaryFields.athletics.climb.fav"] = actor.system.secondary.climb.fav; + updateData["system.secondaryFields.athletics.climb.status"] = actor.system.secondary.climb.status; + + updateData["system.secondaryFields.athletics.jump.base"] = actor.system.secondary.jump.base; + updateData["system.secondaryFields.athletics.jump.spec"] = actor.system.secondary.jump.spec; + updateData["system.secondaryFields.athletics.jump.temp"] = actor.system.secondary.jump.temp; + updateData["system.secondaryFields.athletics.jump.nat"] = actor.system.secondary.jump.nat; + updateData["system.secondaryFields.athletics.jump.natural"] = actor.system.secondary.jump.natural; + updateData["system.secondaryFields.athletics.jump.fav"] = actor.system.secondary.jump.fav; + updateData["system.secondaryFields.athletics.jump.status"] = actor.system.secondary.jump.status; + + updateData["system.secondaryFields.athletics.piloting.base"] = actor.system.secondary.piloting.base; + updateData["system.secondaryFields.athletics.piloting.spec"] = actor.system.secondary.piloting.spec; + updateData["system.secondaryFields.athletics.piloting.temp"] = actor.system.secondary.piloting.temp; + updateData["system.secondaryFields.athletics.piloting.nat"] = actor.system.secondary.piloting.nat; + updateData["system.secondaryFields.athletics.piloting.natural"] = actor.system.secondary.piloting.natural; + updateData["system.secondaryFields.athletics.piloting.fav"] = actor.system.secondary.piloting.fav; + updateData["system.secondaryFields.athletics.piloting.status"] = actor.system.secondary.piloting.status; + + updateData["system.secondaryFields.athletics.ride.base"] = actor.system.secondary.ride.base; + updateData["system.secondaryFields.athletics.ride.spec"] = actor.system.secondary.ride.spec; + updateData["system.secondaryFields.athletics.ride.temp"] = actor.system.secondary.ride.temp; + updateData["system.secondaryFields.athletics.ride.nat"] = actor.system.secondary.ride.nat; + updateData["system.secondaryFields.athletics.ride.natural"] = actor.system.secondary.ride.natural; + updateData["system.secondaryFields.athletics.ride.fav"] = actor.system.secondary.ride.fav; + updateData["system.secondaryFields.athletics.ride.status"] = actor.system.secondary.ride.status; + + updateData["system.secondaryFields.athletics.swim.base"] = actor.system.secondary.swim.base; + updateData["system.secondaryFields.athletics.swim.spec"] = actor.system.secondary.swim.spec; + updateData["system.secondaryFields.athletics.swim.temp"] = actor.system.secondary.swim.temp; + updateData["system.secondaryFields.athletics.swim.nat"] = actor.system.secondary.swim.nat; + updateData["system.secondaryFields.athletics.swim.natural"] = actor.system.secondary.swim.natural; + updateData["system.secondaryFields.athletics.swim.fav"] = actor.system.secondary.swim.fav; + updateData["system.secondaryFields.athletics.swim.status"] = actor.system.secondary.swim.status; + + updateData["system.secondaryFields.social.etiquette.base"] = actor.system.secondary.etiquette.base; + updateData["system.secondaryFields.social.etiquette.spec"] = actor.system.secondary.etiquette.spec; + updateData["system.secondaryFields.social.etiquette.temp"] = actor.system.secondary.etiquette.temp; + updateData["system.secondaryFields.social.etiquette.nat"] = actor.system.secondary.etiquette.nat; + updateData["system.secondaryFields.social.etiquette.natural"] = actor.system.secondary.etiquette.natural; + updateData["system.secondaryFields.social.etiquette.fav"] = actor.system.secondary.etiquette.fav; + updateData["system.secondaryFields.social.etiquette.status"] = actor.system.secondary.etiquette.status; + + updateData["system.secondaryFields.social.intimidate.base"] = actor.system.secondary.intimidate.base; + updateData["system.secondaryFields.social.intimidate.spec"] = actor.system.secondary.intimidate.spec; + updateData["system.secondaryFields.social.intimidate.temp"] = actor.system.secondary.intimidate.temp; + updateData["system.secondaryFields.social.intimidate.nat"] = actor.system.secondary.intimidate.nat; + updateData["system.secondaryFields.social.intimidate.natural"] = actor.system.secondary.intimidate.natural; + updateData["system.secondaryFields.social.intimidate.fav"] = actor.system.secondary.intimidate.fav; + updateData["system.secondaryFields.social.intimidate.status"] = actor.system.secondary.intimidate.status; + + updateData["system.secondaryFields.social.leadership.base"] = actor.system.secondary.leadership.base; + updateData["system.secondaryFields.social.leadership.spec"] = actor.system.secondary.leadership.spec; + updateData["system.secondaryFields.social.leadership.temp"] = actor.system.secondary.leadership.temp; + updateData["system.secondaryFields.social.leadership.nat"] = actor.system.secondary.leadership.nat; + updateData["system.secondaryFields.social.leadership.natural"] = actor.system.secondary.leadership.natural; + updateData["system.secondaryFields.social.leadership.fav"] = actor.system.secondary.leadership.fav; + updateData["system.secondaryFields.social.leadership.status"] = actor.system.secondary.leadership.status; + + updateData["system.secondaryFields.social.persuasion.base"] = actor.system.secondary.persuasion.base; + updateData["system.secondaryFields.social.persuasion.spec"] = actor.system.secondary.persuasion.spec; + updateData["system.secondaryFields.social.persuasion.temp"] = actor.system.secondary.persuasion.temp; + updateData["system.secondaryFields.social.persuasion.nat"] = actor.system.secondary.persuasion.nat; + updateData["system.secondaryFields.social.persuasion.natural"] = actor.system.secondary.persuasion.natural; + updateData["system.secondaryFields.social.persuasion.fav"] = actor.system.secondary.persuasion.fav; + updateData["system.secondaryFields.social.persuasion.status"] = actor.system.secondary.persuasion.status; + + updateData["system.secondaryFields.social.streetwise.base"] = actor.system.secondary.streetwise.base; + updateData["system.secondaryFields.social.streetwise.spec"] = actor.system.secondary.streetwise.spec; + updateData["system.secondaryFields.social.streetwise.temp"] = actor.system.secondary.streetwise.temp; + updateData["system.secondaryFields.social.streetwise.nat"] = actor.system.secondary.streetwise.nat; + updateData["system.secondaryFields.social.streetwise.natural"] = actor.system.secondary.streetwise.natural; + updateData["system.secondaryFields.social.streetwise.fav"] = actor.system.secondary.streetwise.fav; + updateData["system.secondaryFields.social.streetwise.status"] = actor.system.secondary.streetwise.status; + + updateData["system.secondaryFields.social.style.base"] = actor.system.secondary.style.base; + updateData["system.secondaryFields.social.style.spec"] = actor.system.secondary.style.spec; + updateData["system.secondaryFields.social.style.temp"] = actor.system.secondary.style.temp; + updateData["system.secondaryFields.social.style.nat"] = actor.system.secondary.style.nat; + updateData["system.secondaryFields.social.style.natural"] = actor.system.secondary.style.natural; + updateData["system.secondaryFields.social.style.fav"] = actor.system.secondary.style.fav; + updateData["system.secondaryFields.social.style.status"] = actor.system.secondary.style.status; + + updateData["system.secondaryFields.social.trading.base"] = actor.system.secondary.trading.base; + updateData["system.secondaryFields.social.trading.spec"] = actor.system.secondary.trading.spec; + updateData["system.secondaryFields.social.trading.temp"] = actor.system.secondary.trading.temp; + updateData["system.secondaryFields.social.trading.nat"] = actor.system.secondary.trading.nat; + updateData["system.secondaryFields.social.trading.natural"] = actor.system.secondary.trading.natural; + updateData["system.secondaryFields.social.trading.fav"] = actor.system.secondary.trading.fav; + updateData["system.secondaryFields.social.trading.status"] = actor.system.secondary.trading.status; + + updateData["system.secondaryFields.perceptive.notice.base"] = actor.system.secondary.notice.base; + updateData["system.secondaryFields.perceptive.notice.spec"] = actor.system.secondary.notice.spec; + updateData["system.secondaryFields.perceptive.notice.temp"] = actor.system.secondary.notice.temp; + updateData["system.secondaryFields.perceptive.notice.nat"] = actor.system.secondary.notice.nat; + updateData["system.secondaryFields.perceptive.notice.natural"] = actor.system.secondary.notice.natural; + updateData["system.secondaryFields.perceptive.notice.fav"] = actor.system.secondary.notice.fav; + updateData["system.secondaryFields.perceptive.notice.status"] = actor.system.secondary.notice.status; + + updateData["system.secondaryFields.perceptive.search.base"] = actor.system.secondary.search.base; + updateData["system.secondaryFields.perceptive.search.spec"] = actor.system.secondary.search.spec; + updateData["system.secondaryFields.perceptive.search.temp"] = actor.system.secondary.search.temp; + updateData["system.secondaryFields.perceptive.search.nat"] = actor.system.secondary.search.nat; + updateData["system.secondaryFields.perceptive.search.natural"] = actor.system.secondary.search.natural; + updateData["system.secondaryFields.perceptive.search.fav"] = actor.system.secondary.search.fav; + updateData["system.secondaryFields.perceptive.search.status"] = actor.system.secondary.search.status; + + updateData["system.secondaryFields.perceptive.track.base"] = actor.system.secondary.track.base; + updateData["system.secondaryFields.perceptive.track.spec"] = actor.system.secondary.track.spec; + updateData["system.secondaryFields.perceptive.track.temp"] = actor.system.secondary.track.temp; + updateData["system.secondaryFields.perceptive.track.nat"] = actor.system.secondary.track.nat; + updateData["system.secondaryFields.perceptive.track.natural"] = actor.system.secondary.track.natural; + updateData["system.secondaryFields.perceptive.track.fav"] = actor.system.secondary.track.fav; + updateData["system.secondaryFields.perceptive.track.status"] = actor.system.secondary.track.status; + + updateData["system.secondaryFields.intellectual.animals.base"] = actor.system.secondary.animals.base; + updateData["system.secondaryFields.intellectual.animals.spec"] = actor.system.secondary.animals.spec; + updateData["system.secondaryFields.intellectual.animals.temp"] = actor.system.secondary.animals.temp; + updateData["system.secondaryFields.intellectual.animals.nat"] = actor.system.secondary.animals.nat; + updateData["system.secondaryFields.intellectual.animals.natural"] = actor.system.secondary.animals.natural; + updateData["system.secondaryFields.intellectual.animals.fav"] = actor.system.secondary.animals.fav; + updateData["system.secondaryFields.intellectual.animals.status"] = actor.system.secondary.animals.status; + + updateData["system.secondaryFields.intellectual.appraisal.base"] = actor.system.secondary.appraisal.base; + updateData["system.secondaryFields.intellectual.appraisal.spec"] = actor.system.secondary.appraisal.spec; + updateData["system.secondaryFields.intellectual.appraisal.temp"] = actor.system.secondary.appraisal.temp; + updateData["system.secondaryFields.intellectual.appraisal.nat"] = actor.system.secondary.appraisal.nat; + updateData["system.secondaryFields.intellectual.appraisal.natural"] = actor.system.secondary.appraisal.natural; + updateData["system.secondaryFields.intellectual.appraisal.fav"] = actor.system.secondary.appraisal.fav; + updateData["system.secondaryFields.intellectual.appraisal.status"] = actor.system.secondary.appraisal.status; + + updateData["system.secondaryFields.intellectual.architecture.base"] = actor.system.secondary.architecture.base; + updateData["system.secondaryFields.intellectual.architecture.spec"] = actor.system.secondary.architecture.spec; + updateData["system.secondaryFields.intellectual.architecture.temp"] = actor.system.secondary.architecture.temp; + updateData["system.secondaryFields.intellectual.architecture.nat"] = actor.system.secondary.architecture.nat; + updateData["system.secondaryFields.intellectual.architecture.natural"] = actor.system.secondary.architecture.natural; + updateData["system.secondaryFields.intellectual.architecture.fav"] = actor.system.secondary.architecture.fav; + updateData["system.secondaryFields.intellectual.architecture.status"] = actor.system.secondary.architecture.status; + + updateData["system.secondaryFields.intellectual.herballore.base"] = actor.system.secondary.herballore.base; + updateData["system.secondaryFields.intellectual.herballore.spec"] = actor.system.secondary.herballore.spec; + updateData["system.secondaryFields.intellectual.herballore.temp"] = actor.system.secondary.herballore.temp; + updateData["system.secondaryFields.intellectual.herballore.nat"] = actor.system.secondary.herballore.nat; + updateData["system.secondaryFields.intellectual.herballore.natural"] = actor.system.secondary.herballore.natural; + updateData["system.secondaryFields.intellectual.herballore.fav"] = actor.system.secondary.herballore.fav; + updateData["system.secondaryFields.intellectual.herballore.status"] = actor.system.secondary.herballore.status; + + updateData["system.secondaryFields.intellectual.history.base"] = actor.system.secondary.history.base; + updateData["system.secondaryFields.intellectual.history.spec"] = actor.system.secondary.history.spec; + updateData["system.secondaryFields.intellectual.history.temp"] = actor.system.secondary.history.temp; + updateData["system.secondaryFields.intellectual.history.nat"] = actor.system.secondary.history.nat; + updateData["system.secondaryFields.intellectual.history.natural"] = actor.system.secondary.history.natural; + updateData["system.secondaryFields.intellectual.history.fav"] = actor.system.secondary.history.fav; + updateData["system.secondaryFields.intellectual.history.status"] = actor.system.secondary.history.status; + + updateData["system.secondaryFields.intellectual.law.base"] = actor.system.secondary.law.base; + updateData["system.secondaryFields.intellectual.law.spec"] = actor.system.secondary.law.spec; + updateData["system.secondaryFields.intellectual.law.temp"] = actor.system.secondary.law.temp; + updateData["system.secondaryFields.intellectual.law.nat"] = actor.system.secondary.law.nat; + updateData["system.secondaryFields.intellectual.law.natural"] = actor.system.secondary.law.natural; + updateData["system.secondaryFields.intellectual.law.fav"] = actor.system.secondary.law.fav; + updateData["system.secondaryFields.intellectual.law.status"] = actor.system.secondary.law.status; + + updateData["system.secondaryFields.intellectual.magicappr.base"] = actor.system.secondary.magicappr.base; + updateData["system.secondaryFields.intellectual.magicappr.spec"] = actor.system.secondary.magicappr.spec; + updateData["system.secondaryFields.intellectual.magicappr.temp"] = actor.system.secondary.magicappr.temp; + updateData["system.secondaryFields.intellectual.magicappr.nat"] = actor.system.secondary.magicappr.nat; + updateData["system.secondaryFields.intellectual.magicappr.natural"] = actor.system.secondary.magicappr.natural; + updateData["system.secondaryFields.intellectual.magicappr.fav"] = actor.system.secondary.magicappr.fav; + updateData["system.secondaryFields.intellectual.magicappr.status"] = actor.system.secondary.magicappr.status; + + updateData["system.secondaryFields.intellectual.medicine.base"] = actor.system.secondary.medicine.base; + updateData["system.secondaryFields.intellectual.medicine.spec"] = actor.system.secondary.medicine.spec; + updateData["system.secondaryFields.intellectual.medicine.temp"] = actor.system.secondary.medicine.temp; + updateData["system.secondaryFields.intellectual.medicine.nat"] = actor.system.secondary.medicine.nat; + updateData["system.secondaryFields.intellectual.medicine.natural"] = actor.system.secondary.medicine.natural; + updateData["system.secondaryFields.intellectual.medicine.fav"] = actor.system.secondary.medicine.fav; + updateData["system.secondaryFields.intellectual.medicine.status"] = actor.system.secondary.medicine.status; + + updateData["system.secondaryFields.intellectual.memorize.base"] = actor.system.secondary.memorize.base; + updateData["system.secondaryFields.intellectual.memorize.spec"] = actor.system.secondary.memorize.spec; + updateData["system.secondaryFields.intellectual.memorize.temp"] = actor.system.secondary.memorize.temp; + updateData["system.secondaryFields.intellectual.memorize.nat"] = actor.system.secondary.memorize.nat; + updateData["system.secondaryFields.intellectual.memorize.natural"] = actor.system.secondary.memorize.natural; + updateData["system.secondaryFields.intellectual.memorize.fav"] = actor.system.secondary.memorize.fav; + updateData["system.secondaryFields.intellectual.memorize.status"] = actor.system.secondary.memorize.status; + + updateData["system.secondaryFields.intellectual.navigation.base"] = actor.system.secondary.navigation.base; + updateData["system.secondaryFields.intellectual.navigation.spec"] = actor.system.secondary.navigation.spec; + updateData["system.secondaryFields.intellectual.navigation.temp"] = actor.system.secondary.navigation.temp; + updateData["system.secondaryFields.intellectual.navigation.nat"] = actor.system.secondary.navigation.nat; + updateData["system.secondaryFields.intellectual.navigation.natural"] = actor.system.secondary.navigation.natural; + updateData["system.secondaryFields.intellectual.navigation.fav"] = actor.system.secondary.navigation.fav; + updateData["system.secondaryFields.intellectual.navigation.status"] = actor.system.secondary.navigation.status; + + updateData["system.secondaryFields.intellectual.occult.base"] = actor.system.secondary.occult.base; + updateData["system.secondaryFields.intellectual.occult.spec"] = actor.system.secondary.occult.spec; + updateData["system.secondaryFields.intellectual.occult.temp"] = actor.system.secondary.occult.temp; + updateData["system.secondaryFields.intellectual.occult.nat"] = actor.system.secondary.occult.nat; + updateData["system.secondaryFields.intellectual.occult.natural"] = actor.system.secondary.occult.natural; + updateData["system.secondaryFields.intellectual.occult.fav"] = actor.system.secondary.occult.fav; + updateData["system.secondaryFields.intellectual.occult.status"] = actor.system.secondary.occult.status; + + updateData["system.secondaryFields.intellectual.science.base"] = actor.system.secondary.science.base; + updateData["system.secondaryFields.intellectual.science.spec"] = actor.system.secondary.science.spec; + updateData["system.secondaryFields.intellectual.science.temp"] = actor.system.secondary.science.temp; + updateData["system.secondaryFields.intellectual.science.nat"] = actor.system.secondary.science.nat; + updateData["system.secondaryFields.intellectual.science.natural"] = actor.system.secondary.science.natural; + updateData["system.secondaryFields.intellectual.science.fav"] = actor.system.secondary.science.fav; + updateData["system.secondaryFields.intellectual.science.status"] = actor.system.secondary.science.status; + + updateData["system.secondaryFields.intellectual.tactics.base"] = actor.system.secondary.tactics.base; + updateData["system.secondaryFields.intellectual.tactics.spec"] = actor.system.secondary.tactics.spec; + updateData["system.secondaryFields.intellectual.tactics.temp"] = actor.system.secondary.tactics.temp; + updateData["system.secondaryFields.intellectual.tactics.nat"] = actor.system.secondary.tactics.nat; + updateData["system.secondaryFields.intellectual.tactics.natural"] = actor.system.secondary.tactics.natural; + updateData["system.secondaryFields.intellectual.tactics.fav"] = actor.system.secondary.tactics.fav; + updateData["system.secondaryFields.intellectual.tactics.status"] = actor.system.secondary.tactics.status; + + updateData["system.secondaryFields.intellectual.technomagic.base"] = actor.system.secondary.technomagic.base; + updateData["system.secondaryFields.intellectual.technomagic.spec"] = actor.system.secondary.technomagic.spec; + updateData["system.secondaryFields.intellectual.technomagic.temp"] = actor.system.secondary.technomagic.temp; + updateData["system.secondaryFields.intellectual.technomagic.nat"] = actor.system.secondary.technomagic.nat; + updateData["system.secondaryFields.intellectual.technomagic.natural"] = actor.system.secondary.technomagic.natural; + updateData["system.secondaryFields.intellectual.technomagic.fav"] = actor.system.secondary.technomagic.fav; + updateData["system.secondaryFields.intellectual.technomagic.status"] = actor.system.secondary.technomagic.status; + + updateData["system.secondaryFields.vigor.composure.base"] = actor.system.secondary.composure.base; + updateData["system.secondaryFields.vigor.composure.spec"] = actor.system.secondary.composure.spec; + updateData["system.secondaryFields.vigor.composure.temp"] = actor.system.secondary.composure.temp; + updateData["system.secondaryFields.vigor.composure.nat"] = actor.system.secondary.composure.nat; + updateData["system.secondaryFields.vigor.composure.natural"] = actor.system.secondary.composure.natural; + updateData["system.secondaryFields.vigor.composure.fav"] = actor.system.secondary.composure.fav; + updateData["system.secondaryFields.vigor.composure.status"] = actor.system.secondary.composure.status; + + updateData["system.secondaryFields.vigor.technomagic.base"] = actor.system.secondary.technomagic.base; + updateData["system.secondaryFields.vigor.technomagic.spec"] = actor.system.secondary.technomagic.spec; + updateData["system.secondaryFields.vigor.technomagic.temp"] = actor.system.secondary.technomagic.temp; + updateData["system.secondaryFields.vigor.technomagic.nat"] = actor.system.secondary.technomagic.nat; + updateData["system.secondaryFields.vigor.technomagic.natural"] = actor.system.secondary.technomagic.natural; + updateData["system.secondaryFields.vigor.technomagic.fav"] = actor.system.secondary.technomagic.fav; + updateData["system.secondaryFields.vigor.technomagic.status"] = actor.system.secondary.technomagic.status; + + updateData["system.secondaryFields.vigor.withstpain.base"] = actor.system.secondary.withstpain.base; + updateData["system.secondaryFields.vigor.withstpain.spec"] = actor.system.secondary.withstpain.spec; + updateData["system.secondaryFields.vigor.withstpain.temp"] = actor.system.secondary.withstpain.temp; + updateData["system.secondaryFields.vigor.withstpain.nat"] = actor.system.secondary.withstpain.nat; + updateData["system.secondaryFields.vigor.withstpain.natural"] = actor.system.secondary.withstpain.natural; + updateData["system.secondaryFields.vigor.withstpain.fav"] = actor.system.secondary.withstpain.fav; + updateData["system.secondaryFields.vigor.withstpain.status"] = actor.system.secondary.withstpain.status; + + updateData["system.secondaryFields.subterfuge.disguise.base"] = actor.system.secondary.disguise.base; + updateData["system.secondaryFields.subterfuge.disguise.spec"] = actor.system.secondary.disguise.spec; + updateData["system.secondaryFields.subterfuge.disguise.temp"] = actor.system.secondary.disguise.temp; + updateData["system.secondaryFields.subterfuge.disguise.nat"] = actor.system.secondary.disguise.nat; + updateData["system.secondaryFields.subterfuge.disguise.natural"] = actor.system.secondary.disguise.natural; + updateData["system.secondaryFields.subterfuge.disguise.fav"] = actor.system.secondary.disguise.fav; + updateData["system.secondaryFields.subterfuge.disguise.status"] = actor.system.secondary.disguise.status; + + updateData["system.secondaryFields.subterfuge.hide.base"] = actor.system.secondary.hide.base; + updateData["system.secondaryFields.subterfuge.hide.spec"] = actor.system.secondary.hide.spec; + updateData["system.secondaryFields.subterfuge.hide.temp"] = actor.system.secondary.hide.temp; + updateData["system.secondaryFields.subterfuge.hide.nat"] = actor.system.secondary.hide.nat; + updateData["system.secondaryFields.subterfuge.hide.natural"] = actor.system.secondary.hide.natural; + updateData["system.secondaryFields.subterfuge.hide.fav"] = actor.system.secondary.hide.fav; + updateData["system.secondaryFields.subterfuge.hide.status"] = actor.system.secondary.hide.status; + + updateData["system.secondaryFields.subterfuge.lockpicking.base"] = actor.system.secondary.lockpicking.base; + updateData["system.secondaryFields.subterfuge.lockpicking.spec"] = actor.system.secondary.lockpicking.spec; + updateData["system.secondaryFields.subterfuge.lockpicking.temp"] = actor.system.secondary.lockpicking.temp; + updateData["system.secondaryFields.subterfuge.lockpicking.nat"] = actor.system.secondary.lockpicking.nat; + updateData["system.secondaryFields.subterfuge.lockpicking.natural"] = actor.system.secondary.lockpicking.natural; + updateData["system.secondaryFields.subterfuge.lockpicking.fav"] = actor.system.secondary.lockpicking.fav; + updateData["system.secondaryFields.subterfuge.lockpicking.status"] = actor.system.secondary.lockpicking.status; + + updateData["system.secondaryFields.subterfuge.poisons.base"] = actor.system.secondary.poisons.base; + updateData["system.secondaryFields.subterfuge.poisons.spec"] = actor.system.secondary.poisons.spec; + updateData["system.secondaryFields.subterfuge.poisons.temp"] = actor.system.secondary.poisons.temp; + updateData["system.secondaryFields.subterfuge.poisons.nat"] = actor.system.secondary.poisons.nat; + updateData["system.secondaryFields.subterfuge.poisons.natural"] = actor.system.secondary.poisons.natural; + updateData["system.secondaryFields.subterfuge.poisons.fav"] = actor.system.secondary.poisons.fav; + updateData["system.secondaryFields.subterfuge.poisons.status"] = actor.system.secondary.poisons.status; + + updateData["system.secondaryFields.subterfuge.stealth.base"] = actor.system.secondary.stealth.base; + updateData["system.secondaryFields.subterfuge.stealth.spec"] = actor.system.secondary.stealth.spec; + updateData["system.secondaryFields.subterfuge.stealth.temp"] = actor.system.secondary.stealth.temp; + updateData["system.secondaryFields.subterfuge.stealth.nat"] = actor.system.secondary.stealth.nat; + updateData["system.secondaryFields.subterfuge.stealth.natural"] = actor.system.secondary.stealth.natural; + updateData["system.secondaryFields.subterfuge.stealth.fav"] = actor.system.secondary.stealth.fav; + updateData["system.secondaryFields.subterfuge.stealth.status"] = actor.system.secondary.stealth.status; + + updateData["system.secondaryFields.subterfuge.theft.base"] = actor.system.secondary.theft.base; + updateData["system.secondaryFields.subterfuge.theft.spec"] = actor.system.secondary.theft.spec; + updateData["system.secondaryFields.subterfuge.theft.temp"] = actor.system.secondary.theft.temp; + updateData["system.secondaryFields.subterfuge.theft.nat"] = actor.system.secondary.theft.nat; + updateData["system.secondaryFields.subterfuge.theft.natural"] = actor.system.secondary.theft.natural; + updateData["system.secondaryFields.subterfuge.theft.fav"] = actor.system.secondary.theft.fav; + updateData["system.secondaryFields.subterfuge.theft.status"] = actor.system.secondary.theft.status; + + updateData["system.secondaryFields.subterfuge.traplore.base"] = actor.system.secondary.traplore.base; + updateData["system.secondaryFields.subterfuge.traplore.spec"] = actor.system.secondary.traplore.spec; + updateData["system.secondaryFields.subterfuge.traplore.temp"] = actor.system.secondary.traplore.temp; + updateData["system.secondaryFields.subterfuge.traplore.nat"] = actor.system.secondary.traplore.nat; + updateData["system.secondaryFields.subterfuge.traplore.natural"] = actor.system.secondary.traplore.natural; + updateData["system.secondaryFields.subterfuge.traplore.fav"] = actor.system.secondary.traplore.fav; + updateData["system.secondaryFields.subterfuge.traplore.status"] = actor.system.secondary.traplore.status; + + updateData["system.secondaryFields.creative.alchemy.base"] = actor.system.secondary.alchemy.base; + updateData["system.secondaryFields.creative.alchemy.spec"] = actor.system.secondary.alchemy.spec; + updateData["system.secondaryFields.creative.alchemy.temp"] = actor.system.secondary.alchemy.temp; + updateData["system.secondaryFields.creative.alchemy.nat"] = actor.system.secondary.alchemy.nat; + updateData["system.secondaryFields.creative.alchemy.natural"] = actor.system.secondary.alchemy.natural; + updateData["system.secondaryFields.creative.alchemy.fav"] = actor.system.secondary.alchemy.fav; + updateData["system.secondaryFields.creative.alchemy.status"] = actor.system.secondary.alchemy.status; + + updateData["system.secondaryFields.creative.animism.base"] = actor.system.secondary.animism.base; + updateData["system.secondaryFields.creative.animism.spec"] = actor.system.secondary.animism.spec; + updateData["system.secondaryFields.creative.animism.temp"] = actor.system.secondary.animism.temp; + updateData["system.secondaryFields.creative.animism.nat"] = actor.system.secondary.animism.nat; + updateData["system.secondaryFields.creative.animism.natural"] = actor.system.secondary.animism.natural; + updateData["system.secondaryFields.creative.animism.fav"] = actor.system.secondary.animism.fav; + updateData["system.secondaryFields.creative.animism.status"] = actor.system.secondary.animism.status; + + updateData["system.secondaryFields.creative.art.base"] = actor.system.secondary.art.base; + updateData["system.secondaryFields.creative.art.spec"] = actor.system.secondary.art.spec; + updateData["system.secondaryFields.creative.art.temp"] = actor.system.secondary.art.temp; + updateData["system.secondaryFields.creative.art.nat"] = actor.system.secondary.art.nat; + updateData["system.secondaryFields.creative.art.natural"] = actor.system.secondary.art.natural; + updateData["system.secondaryFields.creative.art.fav"] = actor.system.secondary.art.fav; + updateData["system.secondaryFields.creative.art.status"] = actor.system.secondary.art.status; + + updateData["system.secondaryFields.creative.cooking.base"] = actor.system.secondary.cooking.base; + updateData["system.secondaryFields.creative.cooking.spec"] = actor.system.secondary.cooking.spec; + updateData["system.secondaryFields.creative.cooking.temp"] = actor.system.secondary.cooking.temp; + updateData["system.secondaryFields.creative.cooking.nat"] = actor.system.secondary.cooking.nat; + updateData["system.secondaryFields.creative.cooking.natural"] = actor.system.secondary.cooking.natural; + updateData["system.secondaryFields.creative.cooking.fav"] = actor.system.secondary.cooking.fav; + updateData["system.secondaryFields.creative.cooking.status"] = actor.system.secondary.cooking.status; + + updateData["system.secondaryFields.creative.dance.base"] = actor.system.secondary.dance.base; + updateData["system.secondaryFields.creative.dance.spec"] = actor.system.secondary.dance.spec; + updateData["system.secondaryFields.creative.dance.temp"] = actor.system.secondary.dance.temp; + updateData["system.secondaryFields.creative.dance.nat"] = actor.system.secondary.dance.nat; + updateData["system.secondaryFields.creative.dance.natural"] = actor.system.secondary.dance.natural; + updateData["system.secondaryFields.creative.dance.fav"] = actor.system.secondary.dance.fav; + updateData["system.secondaryFields.creative.dance.status"] = actor.system.secondary.dance.status; + + updateData["system.secondaryFields.creative.forging.base"] = actor.system.secondary.forging.base; + updateData["system.secondaryFields.creative.forging.spec"] = actor.system.secondary.forging.spec; + updateData["system.secondaryFields.creative.forging.temp"] = actor.system.secondary.forging.temp; + updateData["system.secondaryFields.creative.forging.nat"] = actor.system.secondary.forging.nat; + updateData["system.secondaryFields.creative.forging.natural"] = actor.system.secondary.forging.natural; + updateData["system.secondaryFields.creative.forging.fav"] = actor.system.secondary.forging.fav; + updateData["system.secondaryFields.creative.forging.status"] = actor.system.secondary.forging.status; + + updateData["system.secondaryFields.creative.jewelry.base"] = actor.system.secondary.jewelry.base; + updateData["system.secondaryFields.creative.jewelry.spec"] = actor.system.secondary.jewelry.spec; + updateData["system.secondaryFields.creative.jewelry.temp"] = actor.system.secondary.jewelry.temp; + updateData["system.secondaryFields.creative.jewelry.nat"] = actor.system.secondary.jewelry.nat; + updateData["system.secondaryFields.creative.jewelry.natural"] = actor.system.secondary.jewelry.natural; + updateData["system.secondaryFields.creative.jewelry.fav"] = actor.system.secondary.jewelry.fav; + updateData["system.secondaryFields.creative.jewelry.status"] = actor.system.secondary.jewelry.status; + + updateData["system.secondaryFields.creative.toymaking.base"] = actor.system.secondary.toymaking.base; + updateData["system.secondaryFields.creative.toymaking.spec"] = actor.system.secondary.toymaking.spec; + updateData["system.secondaryFields.creative.toymaking.temp"] = actor.system.secondary.toymaking.temp; + updateData["system.secondaryFields.creative.toymaking.nat"] = actor.system.secondary.toymaking.nat; + updateData["system.secondaryFields.creative.toymaking.natural"] = actor.system.secondary.toymaking.natural; + updateData["system.secondaryFields.creative.toymaking.fav"] = actor.system.secondary.toymaking.fav; + updateData["system.secondaryFields.creative.toymaking.status"] = actor.system.secondary.toymaking.status; + + updateData["system.secondaryFields.creative.music.base"] = actor.system.secondary.music.base; + updateData["system.secondaryFields.creative.music.spec"] = actor.system.secondary.music.spec; + updateData["system.secondaryFields.creative.music.temp"] = actor.system.secondary.music.temp; + updateData["system.secondaryFields.creative.music.nat"] = actor.system.secondary.music.nat; + updateData["system.secondaryFields.creative.music.natural"] = actor.system.secondary.music.natural; + updateData["system.secondaryFields.creative.music.fav"] = actor.system.secondary.music.fav; + updateData["system.secondaryFields.creative.music.status"] = actor.system.secondary.music.status; + + updateData["system.secondaryFields.creative.runes.base"] = actor.system.secondary.runes.base; + updateData["system.secondaryFields.creative.runes.spec"] = actor.system.secondary.runes.spec; + updateData["system.secondaryFields.creative.runes.temp"] = actor.system.secondary.runes.temp; + updateData["system.secondaryFields.creative.runes.nat"] = actor.system.secondary.runes.nat; + updateData["system.secondaryFields.creative.runes.natural"] = actor.system.secondary.runes.natural; + updateData["system.secondaryFields.creative.runes.fav"] = actor.system.secondary.runes.fav; + updateData["system.secondaryFields.creative.runes.status"] = actor.system.secondary.runes.status; + + updateData["system.secondaryFields.creative.ritualcalig.base"] = actor.system.secondary.ritualcalig.base; + updateData["system.secondaryFields.creative.ritualcalig.spec"] = actor.system.secondary.ritualcalig.spec; + updateData["system.secondaryFields.creative.ritualcalig.temp"] = actor.system.secondary.ritualcalig.temp; + updateData["system.secondaryFields.creative.ritualcalig.nat"] = actor.system.secondary.ritualcalig.nat; + updateData["system.secondaryFields.creative.ritualcalig.natural"] = actor.system.secondary.ritualcalig.natural; + updateData["system.secondaryFields.creative.ritualcalig.fav"] = actor.system.secondary.ritualcalig.fav; + updateData["system.secondaryFields.creative.ritualcalig.status"] = actor.system.secondary.ritualcalig.status; + + updateData["system.secondaryFields.creative.slofhand.base"] = actor.system.secondary.slofhand.base; + updateData["system.secondaryFields.creative.slofhand.spec"] = actor.system.secondary.slofhand.spec; + updateData["system.secondaryFields.creative.slofhand.temp"] = actor.system.secondary.slofhand.temp; + updateData["system.secondaryFields.creative.slofhand.nat"] = actor.system.secondary.slofhand.nat; + updateData["system.secondaryFields.creative.slofhand.natural"] = actor.system.secondary.slofhand.natural; + updateData["system.secondaryFields.creative.slofhand.fav"] = actor.system.secondary.slofhand.fav; + updateData["system.secondaryFields.creative.slofhand.status"] = actor.system.secondary.slofhand.status; + + updateData["system.secondaryFields.creative.tailoring.base"] = actor.system.secondary.tailoring.base; + updateData["system.secondaryFields.creative.tailoring.spec"] = actor.system.secondary.tailoring.spec; + updateData["system.secondaryFields.creative.tailoring.temp"] = actor.system.secondary.tailoring.temp; + updateData["system.secondaryFields.creative.tailoring.nat"] = actor.system.secondary.tailoring.nat; + updateData["system.secondaryFields.creative.tailoring.natural"] = actor.system.secondary.tailoring.natural; + updateData["system.secondaryFields.creative.tailoring.fav"] = actor.system.secondary.tailoring.fav; + updateData["system.secondaryFields.creative.tailoring.status"] = actor.system.secondary.tailoring.status; + + updateData["system.secondaryFields.category.athletics"] = actor.system.secondary.main.athletics; + updateData["system.secondaryFields.category.social"] = actor.system.secondary.main.social; + updateData["system.secondaryFields.category.perceptive"] = actor.system.secondary.main.perceptive; + updateData["system.secondaryFields.category.intellectual"] = actor.system.secondary.main.intellectual; + updateData["system.secondaryFields.category.vigor"] = actor.system.secondary.main.vigor; + updateData["system.secondaryFields.category.subterfuge"] = actor.system.secondary.main.subterfuge; + updateData["system.secondaryFields.category.creative"] = actor.system.secondary.main.creative; + } + updateData["system.info.race"] = actor.system.race; + updateData["system.info.class"] = actor.system.class; + updateData["system.info.gender"] = actor.system.gender; + updateData["system.info.height"] = actor.system.height; + updateData["system.info.weight"] = actor.system.weight; + updateData["system.info.age"] = actor.system.age; + updateData["system.info.size"] = actor.system.size; + updateData["system.info.appearance"] = actor.system.appearance; + updateData["system.info.notesOne"] = actor.system.notesOne; + updateData["system.info.notesTwo"] = actor.system.notesTwo; + updateData["system.info.destiny"] = actor.system.destiny; + updateData["system.info.gnosis"] = actor.system.gnosis; + if (actor.system.system) { + updateData["system.info.bio"] = actor.system.system.bio; + } + updateData["system.levelinfo.experience"] = actor.system.experience; + + updateData["system.aamField.base"] = actor.system.aam; + updateData["system.aamField.boon"] = actor.system.aamBoon; + updateData["system.aamField.crit"] = actor.system.aamCrit; + + return updateData; + /* + const updates = []; + for (const item of actor.items) if (item.type === "monsterPower") { + let newType = ""; + switch (item.system.type) { + case "": + case "other": + newType = "other"; + break; + case "1": + case "essential": + newType = "essential"; + break; + case "2": + case "disadv": + newType = "disadv"; + break; + case "3": + case "combat": + newType = "combat"; + break; + case "4": + case "defense": + newType = "defense"; + break; + case "5": + case "misc": + newType = "misc"; + break; + case "6": + case "divine": + newType = "divine"; + break; + default: + newType = "other"; + break; + } + item.system.type = newType; + + // Collect the updates + updates.push({ _id: item.id, 'system.type': newType }); + } + return updates; + */ + +} + + + diff --git a/module/utilities/preloadTemplates.js b/module/utilities/preloadTemplates.js index 588c720..1a95b3e 100644 --- a/module/utilities/preloadTemplates.js +++ b/module/utilities/preloadTemplates.js @@ -9,19 +9,20 @@ export const preloadHandlebarsTemplates = () => { templates.dialog.combat.combatAttackDialog.parts.combat, templates.dialog.combat.combatAttackDialog.parts.mystic, //actor tabs - "systems/abfalter/templates/actor/parts/bio.html", - "systems/abfalter/templates/actor/parts/general.html", - "systems/abfalter/templates/actor/parts/background.html", - "systems/abfalter/templates/actor/parts/magic.html", - "systems/abfalter/templates/actor/parts/psychic.html", - "systems/abfalter/templates/actor/parts/ki.html", - "systems/abfalter/templates/actor/parts/armory.html", - "systems/abfalter/templates/actor/parts/settings.html", - "systems/abfalter/templates/actor/parts/monster.html", - "systems/abfalter/templates/actor/parts/effect.html", + "systems/abfalter/templates/actor/parts/bio.hbs", + "systems/abfalter/templates/actor/parts/general.hbs", + "systems/abfalter/templates/actor/parts/background.hbs", + "systems/abfalter/templates/actor/parts/magic.hbs", + "systems/abfalter/templates/actor/parts/psychic.hbs", + "systems/abfalter/templates/actor/parts/ki.hbs", + "systems/abfalter/templates/actor/parts/armory.hbs", + "systems/abfalter/templates/actor/parts/settings.hbs", + "systems/abfalter/templates/actor/parts/monster.hbs", + "systems/abfalter/templates/actor/parts/effect.hbs", //partials - "systems/abfalter/templates/actor/parts/metaMagic.html", - "systems/abfalter/templates/actor/parts/active-effects.html" + "systems/abfalter/templates/actor/parts/metaMagic.hbs", + "systems/abfalter/templates/actor/parts/active-effects.hbs", + "systems/abfalter/templates/dialogues/changelog.hbs" ]; return loadTemplates(templatePaths); }; \ No newline at end of file diff --git a/packs/compendiums/000266.log b/packs/compendiums/000429.log similarity index 100% rename from packs/compendiums/000266.log rename to packs/compendiums/000429.log diff --git a/packs/compendiums/CURRENT b/packs/compendiums/CURRENT index f10934b..23f6579 100644 --- a/packs/compendiums/CURRENT +++ b/packs/compendiums/CURRENT @@ -1 +1 @@ -MANIFEST-000265 +MANIFEST-000427 diff --git a/packs/compendiums/LOG b/packs/compendiums/LOG index 988f204..354dfdc 100644 --- a/packs/compendiums/LOG +++ b/packs/compendiums/LOG @@ -1,3 +1,8 @@ -2024/06/15-09:55:04.666 4908 Recovering log #263 -2024/06/15-09:55:04.675 4908 Delete type=0 #263 -2024/06/15-09:55:04.675 4908 Delete type=3 #261 +2024/07/31-16:30:44.824 c98 Recovering log #425 +2024/07/31-16:30:44.832 c98 Delete type=0 #425 +2024/07/31-16:30:44.832 c98 Delete type=3 #423 +2024/07/31-16:31:15.199 2318 Level-0 table #430: started +2024/07/31-16:31:15.199 2318 Level-0 table #430: 0 bytes OK +2024/07/31-16:31:15.202 2318 Delete type=0 #428 +2024/07/31-16:31:15.206 2318 Manual compaction at level-0 from '!journal!wCO5xTIw9mb5vNS8' @ 72057594037927935 : 1 .. '!journal.pages!wCO5xTIw9mb5vNS8.i2dwb1oXdQ1EpuvI' @ 0 : 0; will stop at (end) +2024/07/31-16:31:15.215 2318 Manual compaction at level-1 from '!journal!wCO5xTIw9mb5vNS8' @ 72057594037927935 : 1 .. '!journal.pages!wCO5xTIw9mb5vNS8.i2dwb1oXdQ1EpuvI' @ 0 : 0; will stop at (end) diff --git a/packs/compendiums/LOG.old b/packs/compendiums/LOG.old index 909222b..ee0d71b 100644 --- a/packs/compendiums/LOG.old +++ b/packs/compendiums/LOG.old @@ -1,8 +1,8 @@ -2024/06/15-09:07:00.118 4490 Recovering log #260 -2024/06/15-09:07:00.126 4490 Delete type=0 #260 -2024/06/15-09:07:00.127 4490 Delete type=3 #259 -2024/06/15-09:55:01.417 5ef0 Level-0 table #264: started -2024/06/15-09:55:01.417 5ef0 Level-0 table #264: 0 bytes OK -2024/06/15-09:55:01.421 5ef0 Delete type=0 #262 -2024/06/15-09:55:01.444 5ef0 Manual compaction at level-0 from '!journal!wCO5xTIw9mb5vNS8' @ 72057594037927935 : 1 .. '!journal.pages!wCO5xTIw9mb5vNS8.i2dwb1oXdQ1EpuvI' @ 0 : 0; will stop at (end) -2024/06/15-09:55:01.444 5ef0 Manual compaction at level-1 from '!journal!wCO5xTIw9mb5vNS8' @ 72057594037927935 : 1 .. '!journal.pages!wCO5xTIw9mb5vNS8.i2dwb1oXdQ1EpuvI' @ 0 : 0; will stop at (end) +2024/07/31-15:07:22.517 6fb8 Recovering log #422 +2024/07/31-15:07:22.525 6fb8 Delete type=0 #422 +2024/07/31-15:07:22.525 6fb8 Delete type=3 #421 +2024/07/31-16:30:38.062 2318 Level-0 table #426: started +2024/07/31-16:30:38.062 2318 Level-0 table #426: 0 bytes OK +2024/07/31-16:30:38.066 2318 Delete type=0 #424 +2024/07/31-16:30:38.066 2318 Manual compaction at level-0 from '!journal!wCO5xTIw9mb5vNS8' @ 72057594037927935 : 1 .. '!journal.pages!wCO5xTIw9mb5vNS8.i2dwb1oXdQ1EpuvI' @ 0 : 0; will stop at (end) +2024/07/31-16:30:38.066 2318 Manual compaction at level-1 from '!journal!wCO5xTIw9mb5vNS8' @ 72057594037927935 : 1 .. '!journal.pages!wCO5xTIw9mb5vNS8.i2dwb1oXdQ1EpuvI' @ 0 : 0; will stop at (end) diff --git a/packs/compendiums/MANIFEST-000265 b/packs/compendiums/MANIFEST-000427 similarity index 67% rename from packs/compendiums/MANIFEST-000265 rename to packs/compendiums/MANIFEST-000427 index d6c4a0a..be6700b 100644 Binary files a/packs/compendiums/MANIFEST-000265 and b/packs/compendiums/MANIFEST-000427 differ diff --git a/system.json b/system.json index 9db51f3..7a83b08 100644 --- a/system.json +++ b/system.json @@ -2,10 +2,10 @@ "id": "abfalter", "title": "Anima Beyond Fantasy Altered", "description": "Engligh Version of 'Fantasy Flight Games' Anima Beyond Fantasy System altered by some house rules.", - "version": "1.4.1", + "version": "1.4.2", "compatibility": { "minimum": 12, - "verified": "12.327" + "verified": "12.330" }, "authors": [ { @@ -63,5 +63,5 @@ "license": "LICENSE.txt", "url": "https://github.com/Lumenita/abfalter", "manifest": "https://raw.githubusercontent.com/Lumenita/abfalter/main/system.json", - "download": "https://github.com/Lumenita/abfalter/releases/download/v1.4.1/abfalter.zip" + "download": "https://github.com/Lumenita/abfalter/releases/download/v1.4.2/abfalter.zip" } diff --git a/templates/actor/actor-sheet.html b/templates/actor/actor-sheet.hbs similarity index 77% rename from templates/actor/actor-sheet.html rename to templates/actor/actor-sheet.hbs index 483dbaf..fe4bb4b 100644 --- a/templates/actor/actor-sheet.html +++ b/templates/actor/actor-sheet.hbs @@ -23,30 +23,30 @@