From c507217edbde53e5d8fc137ffe2b77b89b5d030c Mon Sep 17 00:00:00 2001 From: Kaister300 <109926616+Kaister300@users.noreply.github.com> Date: Wed, 7 Feb 2024 21:33:15 +1100 Subject: [PATCH 1/2] Implemented Global Paragon Selector - Added paragonselector.js which is a Lit widget that sits at the top of the page. - Allows user to select paragon and the difficulty - This data is sent to paragon calc and damage widgets instead of having their own selectors. - Added paragon/ folder which contains name, cost and attacks of paragons --- project/webpage/index.html | 2 + .../paragondetails/support/engineer.json | 2 +- project/webpage/paragons/magic/ninja.json | 88 +++++++++ project/webpage/paragons/magic/wizard.json | 87 +++++++++ project/webpage/paragons/military/ace.json | 88 +++++++++ .../webpage/paragons/military/buccaneer.json | 71 +++++++ project/webpage/paragons/military/sub.json | 30 +++ .../webpage/paragons/primary/boomerangm.json | 83 +++++++++ project/webpage/paragons/primary/dart.json | 47 +++++ .../webpage/paragons/support/engineer.json | 170 +++++++++++++++++ project/webpage/paragons/template.json | 30 +++ project/webpage/scripts/paragoncalc.js | 101 +++++----- project/webpage/scripts/paragondamage.js | 51 ++--- project/webpage/scripts/paragonselector.js | 175 ++++++++++++++++++ project/webpage/scripts/scripts.js | 1 + 15 files changed, 929 insertions(+), 97 deletions(-) create mode 100644 project/webpage/paragons/magic/ninja.json create mode 100644 project/webpage/paragons/magic/wizard.json create mode 100644 project/webpage/paragons/military/ace.json create mode 100644 project/webpage/paragons/military/buccaneer.json create mode 100644 project/webpage/paragons/military/sub.json create mode 100644 project/webpage/paragons/primary/boomerangm.json create mode 100644 project/webpage/paragons/primary/dart.json create mode 100644 project/webpage/paragons/support/engineer.json create mode 100644 project/webpage/paragons/template.json create mode 100644 project/webpage/scripts/paragonselector.js diff --git a/project/webpage/index.html b/project/webpage/index.html index c8157f1..620f545 100644 --- a/project/webpage/index.html +++ b/project/webpage/index.html @@ -15,6 +15,8 @@

BTD6 Paragon Tools

+ + diff --git a/project/webpage/paragondetails/support/engineer.json b/project/webpage/paragondetails/support/engineer.json index 4af445c..72172dc 100644 --- a/project/webpage/paragondetails/support/engineer.json +++ b/project/webpage/paragondetails/support/engineer.json @@ -63,7 +63,7 @@ "cooldown": 0 }, { - "name": "Green Mega Sentry Missile Explosion", + "name": "Blue Mega Sentry Missile Explosion", "isdot": false, "damage": 3, "ceramic": 0, diff --git a/project/webpage/paragons/magic/ninja.json b/project/webpage/paragons/magic/ninja.json new file mode 100644 index 0000000..93bb70e --- /dev/null +++ b/project/webpage/paragons/magic/ninja.json @@ -0,0 +1,88 @@ +{ + "paragon": { + "name": "Ascended Shadow", + "prices": { + "easy": 425000, + "medium": 500000, + "hard": 540000, + "impoppable": 600000 + }, + "fullattacks": [ + { + "name": "Shurikens", + "attacks" : [ + { + "name" : "Main Shuriken", + "isdot" : false, + "damage": 32, + "ceramic": 0, + "moab": 0, + "boss": 0, + "elite": 64, + "pierce": 4, + "speed": 0.217, + "cooldown": 0 + }, + { + "name" : "Blue Shuriken", + "isdot" : false, + "damage": 80, + "ceramic": 0, + "moab": 0, + "boss": 0, + "elite": 160, + "pierce": 20, + "speed": 1.5, + "cooldown": 0 + } + ] + }, + { + "name": "Flash Bomb", + "attacks": [ + { + "name" : "Flash Bomb", + "isdot" : false, + "damage": 96, + "ceramic": 0, + "moab": 0, + "boss": 0, + "elite": 192, + "pierce": 50, + "speed": 1.5, + "cooldown": 0 + } + ] + }, + { + "name": "Sticky Bomb", + "attacks": [ + { + "name" : "Sticky Bomb Impact", + "isdot" : false, + "damage": 16000, + "ceramic": 0, + "moab": 0, + "boss": 16000, + "elite": 96000, + "pierce": 1, + "speed": 5.3, + "cooldown": 0 + }, + { + "name" : "Sticky Bomb Explosion", + "isdot" : false, + "damage": 3500, + "ceramic": 0, + "moab": 0, + "boss": 0, + "elite": 4900, + "pierce": 10, + "speed": 8.5, + "cooldown": 0 + } + ] + } + ] + } +} \ No newline at end of file diff --git a/project/webpage/paragons/magic/wizard.json b/project/webpage/paragons/magic/wizard.json new file mode 100644 index 0000000..01273a4 --- /dev/null +++ b/project/webpage/paragons/magic/wizard.json @@ -0,0 +1,87 @@ +{ + "paragon": { + "name": "Magus Perfectus", + "prices": { + "easy": 637500, + "medium": 750000, + "hard": 810000, + "impoppable": 900000 + }, + "fullattacks": [ + { + "name": "Arcane Blast", + "attacks" : [ + { + "name": "Arcane Blast", + "isdot": false, + "damage": 50, + "ceramic": 0, + "moab": 0, + "boss": 0, + "elite": 450, + "pierce": 25, + "speed": 0.275, + "cooldown": 0 + }, + { + "name": "Zombie Bloons", + "isdot": false, + "damage": 150, + "ceramic": 0, + "moab": 0, + "boss": 0, + "elite": 300, + "pierce": 50, + "speed": 0, + "cooldown": 0 + } + ] + }, + { + "name": "Drain Beam", + "attacks": [ + { + "name": "Drain Beam", + "isdot": false, + "damage": 200, + "ceramic": 0, + "moab": 0, + "boss": 0, + "elite": 200, + "pierce": 1, + "speed": 0.05, + "cooldown": 0 + } + ] + }, + { + "name": "Dark Phoenix", + "attacks": [ + { + "name": "Dark Fireballs", + "isdot": false, + "damage": 400, + "ceramic": 0, + "moab": 0, + "boss": 0, + "elite": 800, + "pierce": 100, + "speed": 2, + "cooldown": 0 + }, + { + "name": "Dark Flame", + "isdot": false, + "damage": 200, + "ceramic": 0, + "moab": 0, + "boss": 0, + "elite": 250, + "pierce": 100, + "speed": 0.2 + } + ] + } + ] + } +} \ No newline at end of file diff --git a/project/webpage/paragons/military/ace.json b/project/webpage/paragons/military/ace.json new file mode 100644 index 0000000..0e1f32d --- /dev/null +++ b/project/webpage/paragons/military/ace.json @@ -0,0 +1,88 @@ +{ + "paragon": { + "name": "Goliath Doomship", + "prices": { + "easy": 765000, + "medium": 900000, + "hard": 972000, + "impoppable": 1080000 + }, + "fullattacks": [ + { + "name": "Darts", + "attacks" : [ + { + "name": "Radial Darts", + "isdot": false, + "damage": 200, + "ceramic": 0, + "moab": 0, + "boss": 0, + "elite": 400, + "pierce": 50, + "speed": 0.66, + "cooldown": 0 + }, + { + "name": "Forward Firing Darts", + "isdot": false, + "damage": 300, + "ceramic": 0, + "moab": 0, + "boss": 0, + "elite": 600, + "pierce": 50, + "speed": 0.11, + "cooldown": 0 + } + ] + }, + { + "name": "Seeking Missiles", + "attacks": [ + { + "name": "Seeking Missiles", + "isdot": false, + "damage": 200, + "ceramic": 0, + "moab": 0, + "boss": 0, + "elite": 400, + "pierce": 1, + "speed": 0.66, + "cooldown": 0 + }, + { + "name": "Seeking Missiles Explosion", + "isdot": false, + "damage": 200, + "ceramic": 0, + "moab": 0, + "boss": 0, + "elite": 400, + "pierce": 50, + "speed": 0.66, + "cooldown": 0 + } + ] + }, + { + "name": "Carpet Bomb", + "attacks": [ + { + "name": "Carpet Bomb", + "isdot": false, + "damage": 20000, + "ceramic": 0, + "moab": 0, + "boss": 0, + "elite": 40000, + "pierce": 150, + "speed": 0, + "cooldown": 40 + } + ] + } + ] + } +} \ No newline at end of file diff --git a/project/webpage/paragons/military/buccaneer.json b/project/webpage/paragons/military/buccaneer.json new file mode 100644 index 0000000..386f9e0 --- /dev/null +++ b/project/webpage/paragons/military/buccaneer.json @@ -0,0 +1,71 @@ +{ + "paragon": { + "name": "Navarch of the Seas", + "prices": { + "easy": 467500, + "medium": 550000, + "hard": 594000, + "impoppable": 660000 + }, + "fullattacks": [ + { + "name": "Turrets", + "attacks" : [ + { + "name": "Main Turret", + "isdot": false, + "damage": 60, + "ceramic": 0, + "moab": 60, + "boss": 60, + "elite": 180, + "pierce": 28, + "speed": 0.429, + "cooldown": 0 + }, + { + "name": "Grape Shot Turret", + "isdot": false, + "damage": 25, + "ceramic": 0, + "moab": 30, + "boss": 5, + "elite": 85, + "pierce": 10, + "speed": 0.429, + "cooldown": 0 + } + ] + }, + { + "name": "Fighter Planes", + "attacks": [ + { + "name": "Dart Plane", + "isdot": false, + "damage": 44, + "ceramic": 0, + "moab": 0, + "boss": 0, + "elite": 88, + "pierce": 18, + "speed": 0.15, + "cooldown": 0 + }, + { + "name": "MOAB Missile Plane", + "isdot": false, + "damage": 200, + "ceramic": 0, + "moab": 0, + "boss": 0, + "elite": 400, + "pierce": 10, + "speed": 1.5, + "cooldown": 0 + } + ] + } + ] + } +} \ No newline at end of file diff --git a/project/webpage/paragons/military/sub.json b/project/webpage/paragons/military/sub.json new file mode 100644 index 0000000..d3fd25d --- /dev/null +++ b/project/webpage/paragons/military/sub.json @@ -0,0 +1,30 @@ +{ + "paragon": { + "name": "Nautic Siege Core", + "prices": { + "easy": 340000, + "medium": 400000, + "hard": 432000, + "impoppable": 480000 + }, + "fullattacks": [ + { + "name": "--------", + "attacks" : [ + { + "name": "Attack", + "isdot": false, + "damage": 20, + "ceramic": 30, + "moab": 0, + "boss": 60, + "elite": 200, + "pierce": 200, + "speed": 0.35, + "cooldown": 0 + } + ] + } + ] + } +} \ No newline at end of file diff --git a/project/webpage/paragons/primary/boomerangm.json b/project/webpage/paragons/primary/boomerangm.json new file mode 100644 index 0000000..30cf8f7 --- /dev/null +++ b/project/webpage/paragons/primary/boomerangm.json @@ -0,0 +1,83 @@ +{ + "paragon": { + "name": "Glaive Dominus", + "prices": { + "easy": 233750, + "medium": 275000, + "hard": 297000, + "impoppable": 330000 + }, + "fullattacks": [ + { + "name": "Glaives", + "attacks" : [ + { + "name" : "Main Glaive", + "isdot" : false, + "damage": 20, + "ceramic": 0, + "moab": 0, + "boss": 40, + "elite": 80, + "pierce": 100, + "speed": 0.04, + "cooldown": 0 + }, + { + "name" : "Orbital Glaive", + "isdot" : false, + "damage": 42, + "ceramic": 20, + "moab": 20, + "boss": 118, + "elite": 444, + "pierce": 1000, + "speed": 0.1, + "cooldown": 0 + } + ] + }, + { + "name": "Anti-MOAB Glave", + "attacks": [ + { + "name" : "Anti-MOAB Glaive", + "isdot" : false, + "damage": 1, + "ceramic": 0, + "moab": 19, + "boss": 0, + "elite": 20, + "pierce": 300, + "speed": 2.5, + "cooldown": 0 + }, + { + "name" : "Anti-MOAB Glaive Explosion", + "isdot" : false, + "damage": 2500, + "ceramic": 0, + "moab": 0, + "boss": 2500, + "elite": 7500, + "pierce": 20, + "speed": 2.5, + "cooldown": 0 + }, + { + "name" : "Explosion Burn", + "isdot" : true, + "damage": 500, + "ceramic": 0, + "moab": 0, + "boss": 0, + "elite": 500, + "pierce": 0, + "speed": 4, + "cooldown": 0 + } + ] + } + ] + } +} \ No newline at end of file diff --git a/project/webpage/paragons/primary/dart.json b/project/webpage/paragons/primary/dart.json new file mode 100644 index 0000000..7514721 --- /dev/null +++ b/project/webpage/paragons/primary/dart.json @@ -0,0 +1,47 @@ +{ + "paragon": { + "name": "Apex Plasma Master", + "prices": { + "easy": 127500, + "medium": 150000, + "hard": 162000, + "impoppable": 180000 + }, + "fullattacks" : [ + { + "name": "Main Attack", + "attacks" : [ + { + "name" : "Dart", + "isdot" : false, + "damage": 20, + "ceramic": 30, + "moab": 0, + "boss": 60, + "elite": 200, + "pierce": 200, + "speed": 0.4, + "cooldown": 0 + } + ] + }, + { + "name": "Juggernaut Balls", + "attacks": [ + { + "name" : "Single Ball", + "isdot" : false, + "damage": 20, + "ceramic": 30, + "moab": 0, + "boss": 60, + "elite": 200, + "pierce": 200, + "speed": 0.4, + "cooldown": 0 + } + ] + } + ] + } +} \ No newline at end of file diff --git a/project/webpage/paragons/support/engineer.json b/project/webpage/paragons/support/engineer.json new file mode 100644 index 0000000..01b77c2 --- /dev/null +++ b/project/webpage/paragons/support/engineer.json @@ -0,0 +1,170 @@ +{ + "paragon": { + "name": "Master Builder", + "prices": { + "easy": 552500, + "medium": 650000, + "hard": 702000, + "impoppable": 780000 + }, + "fullattacks": [ + { + "name": "Main Guns", + "attacks" : [ + { + "name": "Nail Gun", + "isdot": false, + "damage": 100, + "ceramic": 0, + "moab": 0, + "boss": 0, + "elite": 200, + "pierce": 15, + "speed": 0.3, + "cooldown": 0 + } + ] + }, + { + "name": "Green Mega Sentry", + "attacks": [ + { + "name": "Green Mega Sentry", + "isdot": false, + "damage": 100, + "ceramic": 0, + "moab": 0, + "boss": 200, + "elite": 400, + "pierce": 10, + "speed": 0.2, + "cooldown": 0 + }, + { + "name": "Green Mega Sentry Beam", + "isdot": false, + "damage": 20, + "ceramic": 0, + "moab": 0, + "boss": 10, + "elite": 100, + "pierce": 10, + "speed": 0.2, + "cooldown": 0 + }, + { + "name": "Mega Sentry Explosion", + "isdot": false, + "damage": 30000, + "ceramic": 0, + "moab": 0, + "boss": 10000, + "elite": 70000, + "pierce": 100, + "speed": 0, + "cooldown": 0 + } + ] + }, + { + "name": "Red Mega Sentry", + "attacks": [ + { + "name": "Red Mega Sentry Plasma", + "isdot": false, + "damage": 5, + "ceramic": 0, + "moab": 0, + "boss": 0, + "elite": 0, + "pierce": 10, + "speed": 0.05, + "cooldown": 0 + }, + { + "name": "Mega Sentry Explosion", + "isdot": false, + "damage": 30000, + "ceramic": 0, + "moab": 0, + "boss": 10000, + "elite": 70000, + "pierce": 100, + "speed": 0, + "cooldown": 0 + } + ] + }, + { + "name": "Blue Mega Sentry", + "attacks": [ + { + "name": "Blue Mega Sentry Missile", + "isdot": false, + "damage": 3, + "ceramic": 0, + "moab": 747, + "boss": 0, + "elite": 750, + "pierce": 20, + "speed": 0.5, + "cooldown": 0 + }, + { + "name": "Blue Mega Sentry Missile Explosion", + "isdot": false, + "damage": 3, + "ceramic": 0, + "moab": 2, + "boss": 1, + "elite": 9, + "pierce": 20, + "speed": 0.5, + "cooldown": 0 + }, + { + "name": "Mega Sentry Explosion", + "isdot": false, + "damage": 30000, + "ceramic": 0, + "moab": 0, + "boss": 10000, + "elite": 70000, + "pierce": 100, + "speed": 0, + "cooldown": 0 + } + ] + }, + { + "name": "Modified Paragon Sentry", + "attacks": [ + { + "name": "Modified Paragon Sentry", + "isdot": false, + "damage": 4, + "ceramic": 0, + "moab": 2, + "boss": 0, + "elite": 10, + "pierce": 5, + "speed": 0.06, + "cooldown": 0 + }, + { + "name": "Modified Paragon Sentry Explosion", + "isdot": false, + "damage": 100, + "ceramic": 0, + "moab": 0, + "boss": 0, + "elite": 0, + "pierce": 50, + "speed": 0, + "cooldown": 0 + } + ] + } + ] + } +} \ No newline at end of file diff --git a/project/webpage/paragons/template.json b/project/webpage/paragons/template.json new file mode 100644 index 0000000..17cffb3 --- /dev/null +++ b/project/webpage/paragons/template.json @@ -0,0 +1,30 @@ +{ + "paragon": { + "name": "Template", + "prices": { + "easy": 20, + "medium": 30, + "hard": 40, + "impoppable": 50 + }, + "fullattacks": [ + { + "name": "Main", + "attacks" : [ + { + "name": "Attack", + "isdot": false, + "damage": 20, + "ceramic": 30, + "moab": 0, + "boss": 60, + "elite": 200, + "pierce": 200, + "speed": 0.35, + "cooldown": 0 + } + ] + } + ] + } +} \ No newline at end of file diff --git a/project/webpage/scripts/paragoncalc.js b/project/webpage/scripts/paragoncalc.js index 658da49..9322ba4 100644 --- a/project/webpage/scripts/paragoncalc.js +++ b/project/webpage/scripts/paragoncalc.js @@ -7,7 +7,6 @@ class paragonCalc extends LitElement { sentDegree: {type: Number}, paragonLevels: {type: Array}, paragoncost: {type: Number}, - selector: {type: String}, power: {state: true}, _paragon: {state: true} }; @@ -43,6 +42,21 @@ class paragonCalc extends LitElement { padding: 1rem; } + #paragon_header { + padding: 0rem 0rem 1rem 0rem; + text-align: center; + } + + #paragon_header > h3 { + margin: auto; + } + + #paragon_header > h4 { + margin: auto; + font-weight: 400; + font-style: italic; + } + #cost { margin: 5px; } @@ -131,6 +145,20 @@ class paragonCalc extends LitElement { constructor() { super(); + // Adds event listener for paragon data + window.addEventListener( + "paragon_data", (e) => { + if (e.detail.paragon) { + this._paragon = e.detail.paragon; + this.difficulty = e.detail.difficulty; + this.paragoncost = this._paragon.prices[this.difficulty]; + } + else { + this._paragon = void 1 + this.difficulty = "" + } + }); + // Sets up drop down menu this.hidden = false; @@ -142,6 +170,7 @@ class paragonCalc extends LitElement { this.sentDegree = 0; this.power = 0; this.paragoncost = 0; + this.difficulty = ""; } /** @@ -223,34 +252,6 @@ class paragonCalc extends LitElement { } } - /** - * Sets up data for the Money Spent power calculations - * $(Paragon Price)/20000 spent = 1 power - * @param {event} e Form event from updating values - */ - async _paragonFormUpdate(e) { - let form = e.currentTarget; - - // Resets paragon json data - if(form.paragon.value === "") { - this._paragon = void 1; - this.paragoncost = 0; - } - else { - // Fetches paragon data - if(!this._paragon || !(this._paragon.selector === form.paragon.value)) { - let arr = form.paragon.value.split(";"); - console.log(`${window.location.href}paragoncosts/${arr[0]}/${arr[1]}.json`); - await fetch(`${window.location.href}paragoncosts/${arr[0]}/${arr[1]}.json`) - .then(response => response.json()) - .then(data => this._paragon = data.paragoncost) - .then(() => console.log(this._paragon)); - this._paragon.selector = form.paragon.value; - } - this.paragoncost = this._paragon.prices[form.difficulty.value]; - } - } - /** * Calculates current power from form values * @param {event} event Form event from updating values @@ -328,36 +329,18 @@ class paragonCalc extends LitElement {
-
- -
- - - -
+
+

+ ${this._paragon ? + this._paragon.name + : `Please select a Paragon`} +

+

+ ${this.difficulty ? + this.difficulty.charAt(0).toUpperCase() + this.difficulty.slice(1) + : `-----`} +

+
diff --git a/project/webpage/scripts/paragondamage.js b/project/webpage/scripts/paragondamage.js index c5373b6..aba1ca8 100644 --- a/project/webpage/scripts/paragondamage.js +++ b/project/webpage/scripts/paragondamage.js @@ -74,7 +74,21 @@ class paragonDamage extends LitElement { constructor() { super(); + + // Takes in paragon data from paragon selector + window.addEventListener("paragon_data",(e) => { + if (e.detail.paragon) { + this._paragon = e.detail.paragon; + } + else { + this.setDefault() + } + }); + + // Takes degree from calculator window.addEventListener("degree", (e) => this.degree = parseInt(e.detail.currDegree)); + + // Initialise All Variables this.degree = 1; this.hidden = true; this.setDefault(); @@ -91,23 +105,6 @@ class paragonDamage extends LitElement { this.fullattacks = []; } - _grabSelected(e) { - // Resets paragon data - if(e.target.value === "") { - this.setDefault(); - } - - // Fetches paragon data - else { - let arr = e.target.value.split(";"); - console.log(`${window.location.href}paragondetails/${arr[0]}/${arr[1]}.json`); - fetch(`${window.location.href}paragondetails/${arr[0]}/${arr[1]}.json`) - .then(response => response.json()) - .then(data => this._paragon = data.paragon) - .then(data => console.log(this._paragon)); - } - } - _damageComputation() { // Sets name of paragon this.name = this._paragon.name; @@ -162,26 +159,6 @@ class paragonDamage extends LitElement {