From 70c0c6cfe8734fd217b927f9a4e8b9ddb68fc8e3 Mon Sep 17 00:00:00 2001 From: Florian Quirin Date: Sun, 4 Aug 2024 16:19:27 +0200 Subject: [PATCH] added examples --- examples/README.md | 16 ++++++++++++++++ examples/test_def.json | 1 + examples/test_dmg.json | 1 + 3 files changed, 18 insertions(+) create mode 100644 examples/README.md create mode 100644 examples/test_def.json create mode 100644 examples/test_dmg.json diff --git a/examples/README.md b/examples/README.md new file mode 100644 index 0000000..06dea0b --- /dev/null +++ b/examples/README.md @@ -0,0 +1,16 @@ +# D4 Tools - Example Files + +This folder contains example files for the D4 damage and defense calculators. + +### How to load examples + +The calculator apps support the following URL parameters to load remote files and examples: +- `loadFile`: Absolute or relative URL to exported calculators (JSON files), e.g.: `examples/test.json` (NOTE: please use URL encoding) +- `showFile`: (optional) Show content of file without importing data (otherwise ask user). Values: `true/false` or `1/0` +- `loadCalc`: (optional) A list of calculator names, to be loaded from the given file, e.g.: `["Damage Test"]` (NOTE: please use URL encoding) + +### Example URLs + +- [Load test file and open damage example](https://bytemind-de.github.io/apps/d4/damage.html?loadFile=examples%2Ftest_dmg.json&showFile=true&loadCalc=%5B%22Damage%20Test%22%5D) +- [Load test file and open defense example](https://bytemind-de.github.io/apps/d4/defense.html?loadFile=examples%2Ftest_def.json&showFile=true&loadCalc=%5B%22Defense%20Test%22%5D) + diff --git a/examples/test_def.json b/examples/test_def.json new file mode 100644 index 0000000..52f802f --- /dev/null +++ b/examples/test_def.json @@ -0,0 +1 @@ +{"configArray":{"defense_test__defcalc":{"name":"Defense Test","calc":"defcalc","version":"0.5.0","data":{"calculatorName":"Defense Test","charClass":"","baseLife":7959,"strength":350,"elementalResisSingle":70,"isFortified":false,"enemyLevel":100,"armorItems":[{"armor":4626,"info":"Gear Base","disabled":false,"types":[]},{"armor":2975,"info":"Gear Bonus","disabled":false,"types":[]},{"armor":400,"info":"Paragon","disabled":false,"types":[]}],"armorModifiers":[],"maxlifeItems":[{"life":1266,"info":"Armor 1","disabled":false,"types":[]},{"life":1266,"info":"Armor 2","disabled":false,"types":[]},{"life":1266,"info":"1h Weapon","disabled":false,"types":[]},{"life":1266,"info":"Off-Hand","disabled":false,"types":[]}],"maxlifeModifiers":[{"pct":53.86,"info":"Ruby 5 x 9%","disabled":false,"types":[]},{"pct":8,"info":"Paragon Node","disabled":false,"types":[]},{"pct":4,"info":"Paragon Node","disabled":false,"types":[]},{"pct":4,"info":"Paragon Node","disabled":false,"types":[]},{"pct":4,"info":"Paragon Node","disabled":false,"types":[]},{"pct":24.34,"info":"Paragon Node 11 x 2%","disabled":false,"types":[]},{"pct":40,"info":"Barrier - Skill: Some Shield","disabled":true,"types":[]}],"damageReduction":[{"pct":20,"info":"DR - Aspect: Might","disabled":false,"types":[]},{"pct":20,"info":"DR - Skill: More DR for 5s","disabled":true,"types":[]},{"pct":12,"info":"DR - Pass.: More DR","disabled":false,"types":[]},{"pct":20.8,"info":"DR from Elites","disabled":false,"types":[]},{"pct":13.3,"info":"DR from Vulnerable","disabled":false,"types":[]},{"pct":30.1,"info":"DR from Slowed","disabled":false,"types":[]}],"damagePenalty":[]}}}} \ No newline at end of file diff --git a/examples/test_dmg.json b/examples/test_dmg.json new file mode 100644 index 0000000..1265912 --- /dev/null +++ b/examples/test_dmg.json @@ -0,0 +1 @@ +{"configArray":{"damage_test__dmgcalc":{"name":"Damage Test","calc":"dmgcalc","version":"0.15.0","data":{"calculatorName":"Damage Test","charClass":"","baseDamage":3750,"attackSpeed":1.4,"skillDamage":100,"mainStat":1240,"baseLife":7959,"maxLife":30000,"isFortified":false,"vulnerableDamage":20,"vulnerableDamageAdd":120,"overpowerDamage":50,"overpowerDamageAdd":350,"overpowerOnNthAttack":33,"critDamage":50,"critDamageAdd":400,"critChance":45,"additiveModifiers":[{"pct":100,"info":"All Damage","disabled":false,"types":[]},{"pct":0,"info":"Damage vs Close","disabled":false,"types":[]}],"damageMultipliers":[{"pct":50,"info":"Item: Ring of Starless Sk.","disabled":false,"types":[]},{"pct":20,"info":"Aspect: Edgemasters","disabled":false,"types":[]},{"pct":30,"info":"Aspect: Good Vul. Damage","disabled":false,"types":["vulnerable"]},{"pct":10,"info":"Pass.: More Damage","disabled":false,"types":[]},{"pct":10,"info":"Glyph: Ok Damage","disabled":false,"types":[]},{"pct":30,"info":"Leg. Node: Better Crits","disabled":false,"types":["crit"]}],"damageReduction":[{"pct":75,"info":"Character lvl. damage reduction","disabled":false,"types":[]}]}}}} \ No newline at end of file