From 861b0d2b922e05336408e897b475cef7f315b4a2 Mon Sep 17 00:00:00 2001 From: nerd-of-now Date: Fri, 2 Aug 2024 09:55:30 -0400 Subject: [PATCH] Minor fixes Fixed the following issues: -HP bar wouldn't properly update when changing the % total of HP -Triple Kick and Triple Axel had a smaller range of values than what was possible -Reflect and Light Screen reduced damage depending on move category instead of whether or not the move deals physical damage -First Impression would always explicitly show its BP -Aegislash-Blade was visible from the Pokemon selection despite being an alternate form -Aegislash and Mega Charizard/Mewtwo X/Y wouldn't properly save their sets -Updated Gen 9 Calyrex-Shadow Rider sets --- script_res/ap_calc.js | 7 +++-- script_res/damage_MASTER.js | 6 ++--- script_res/damage_gsc.js | 4 +-- script_res/move_data.js | 2 +- script_res/pokedex.js | 1 + script_res/setdex_custom.js | 7 ++++- script_res/setdex_ncp-g9.js | 51 +++++++++++++++++++++++++++---------- 7 files changed, 53 insertions(+), 25 deletions(-) diff --git a/script_res/ap_calc.js b/script_res/ap_calc.js index b5b6c7c..290dc9d 100644 --- a/script_res/ap_calc.js +++ b/script_res/ap_calc.js @@ -288,8 +288,10 @@ function calcEvTotal(poke) { function calcCurrentHP(poke, max, percent) { var current = Math.ceil(percent * max / 100); + var hpBar = poke.find(".hp-bar"); poke.find(".current-hp").val(current); - poke.find(".hp-bar").val(current); + hpBar.val(current); + changeHPBarColor(hpBar, max, current); } function calcPercentHP(poke, max, current) { var percent = Math.floor(100 * current / max); @@ -676,9 +678,6 @@ $(".move-selector").change(function() { if (move.hitRange && move.hitRange.length == 2) { showHits(move.hitRange, moveGroupObj); - //if (moveName == 'Dragon Darts' && $('#douswitch').is(":checked")) { - // moveGroupObj.children(".move-hits").hide(); - //} } else { moveGroupObj.children(".move-hits").hide(); diff --git a/script_res/damage_MASTER.js b/script_res/damage_MASTER.js index 752079a..ee64a61 100644 --- a/script_res/damage_MASTER.js +++ b/script_res/damage_MASTER.js @@ -2047,7 +2047,7 @@ function calcGeneralMods(baseDamage, move, attacker, defender, defAbility, field for (j = 0; j < 16; j++) { if (typeof (move.tripleHit3) !== 'undefined' && move.tripleHit3 === false) { for (k = 0; k < 16; k++) { - tripleDamage[(16 * i) + (16 * j) + k] = damage[i] + childDamage[j] + child2Damage[k]; + tripleDamage[(256 * i) + (16 * j) + k] = damage[i] + childDamage[j] + child2Damage[k]; } } else { @@ -2097,10 +2097,10 @@ function calcFinalMods(move, attacker, defender, field, description, isCritical, finalMods.push(field.format !== "Singles" ? 0xAAC : 0x800); description.isAuroraVeil = true; } - else if (field.isReflect && move.category === "Physical" && !isCritical && !move.ignoresScreens) { + else if (field.isReflect && hitsPhysical && !isCritical && !move.ignoresScreens) { finalMods.push(field.format !== "Singles" ? 0xAAC : 0x800); description.isReflect = true; - } else if (field.isLightScreen && move.category === "Special" && !isCritical) { + } else if (field.isLightScreen && !hitsPhysical && !isCritical) { finalMods.push(field.format !== "Singles" ? 0xAAC : 0x800); description.isLightScreen = true; } diff --git a/script_res/damage_gsc.js b/script_res/damage_gsc.js index e2157b0..b6f855c 100644 --- a/script_res/damage_gsc.js +++ b/script_res/damage_gsc.js @@ -78,7 +78,7 @@ function CALCULATE_DAMAGE_GSC(attacker, defender, move, field) { } } - if (move.name === "Explosion" || move.name === "Selfdestruct") { + if (move.name === "Explosion" || move.name === "Self-Destruct") { df = Math.floor(df / 2); } @@ -108,7 +108,7 @@ function CALCULATE_DAMAGE_GSC(attacker, defender, move, field) { description.defenderItem = defender.item; } - var baseDamage = Math.floor(Math.floor(Math.floor(2 * lv / 5 + 2) * Math.max(1, at) * move.bp / Math.max(1, df)) / 50); + var baseDamage = Math.floor(Math.floor((Math.floor((2 * lv) / 5 + 2) * Math.max(1, at) * move.bp) / Math.max(1, df)) / 50); if (move.isCrit) { baseDamage *= 2; diff --git a/script_res/move_data.js b/script_res/move_data.js index daffcd6..bc96860 100644 --- a/script_res/move_data.js +++ b/script_res/move_data.js @@ -3982,7 +3982,7 @@ var MOVES_SM = $.extend(true, {}, MOVES_XY, { category: 'Physical', type: 'Bug', makesContact: true, - bp: '90', + bp: 90, isPriority: true, }, 'Sparkling Aria': { diff --git a/script_res/pokedex.js b/script_res/pokedex.js index 7f8715f..e8f6d2b 100644 --- a/script_res/pokedex.js +++ b/script_res/pokedex.js @@ -9554,6 +9554,7 @@ var POKEDEX_XY = $.extend(true, {}, POKEDEX_BW, { }, "w": 53.0, "ab": "Stance Change", + "isAlternateForme": true }, "Aegislash-Shield": { "t1": "Steel", diff --git a/script_res/setdex_custom.js b/script_res/setdex_custom.js index b287d80..00d0624 100644 --- a/script_res/setdex_custom.js +++ b/script_res/setdex_custom.js @@ -63,6 +63,7 @@ var calcToShowdownFormes = [ var saveToCalcFormes = [ ["Darmanitan-Zen", "Darmanitan"], ["Darmanitan-Galar-Zen", "Darmanitan-Galar"], + ["Aegislash-Shield", "Aegislash"], ["Zygarde-Complete", "Zygarde"], ["Zacian-Crowned", "Zacian"], ["Zamazenta-Crowned", "Zamazenta"], @@ -350,8 +351,12 @@ var savecalc = function (set, spreadName, accessIVs) { } else if (checkGmax != -1) species = species.substring(0, checkGmax); - else if (checkMega != -1) + else if (checkMega != -1) { species = species.substring(5); + checkMegaXY = species.indexOf(" "); + if (checkMegaXY != -1) + species = species.substring(0, checkMegaXY); + } else species = species.substring(6); diff --git a/script_res/setdex_ncp-g9.js b/script_res/setdex_ncp-g9.js index 50f50b0..7b591a2 100644 --- a/script_res/setdex_ncp-g9.js +++ b/script_res/setdex_ncp-g9.js @@ -13512,30 +13512,53 @@ var SETDEX_VGC2023 = { }, }, "Calyrex-Shadow Rider": { - "Focus Sash Tera Ghost": { + "ck49's Top 4 Regs CM Cloak": { "level": 50, "evs": { - "hp": 0, + "hp": 180, "at": 0, - "df": 4, - "sa": 252, - "sd": 0, + "df": 84, + "sa": 84, + "sd": 4, + "sp": 156 + }, + "ivs": { + "at": 0, + }, + "nature": "Modest", + "tera_type": "Fairy", + "item": "Covert Cloak", + "moves": [ + "Astral Barrage", + "Draining Kiss", + "Nasty Plot", + "Protect" + ] + }, + "Tera Normal Sitrus": { + "level": 50, + "evs": { + "hp": 84, + "at": 0, + "df": 12, + "sa": 156, + "sd": 4, "sp": 252 }, "ivs": { "at": 0, }, "nature": "Timid", - "tera_type": "Ghost", - "item": "Focus Sash", + "tera_type": "Normal", + "item": "Sitrus Berry", "moves": [ "Astral Barrage", - "Expanding Force", "Psyshock", - "Shadow Ball" + "Psychic", + "Expanding Force" ] }, - "Tera Fairy Life Orb": { + "Choice Specs Tera Ghost": { "level": 50, "evs": { "hp": 0, @@ -13549,13 +13572,13 @@ var SETDEX_VGC2023 = { "at": 0, }, "nature": "Timid", - "tera_type": "Fairy", - "item": "Life Orb", + "tera_type": "Ghost", + "item": "Choice Specs", "moves": [ "Astral Barrage", "Expanding Force", - "Tera Blast", - "Draining Kiss" + "Pollen Puff", + "Shadow Ball" ] }, },