Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
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
  • Loading branch information
nerd-of-now committed Aug 2, 2024
1 parent 97ca9d8 commit 861b0d2
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 25 deletions.
7 changes: 3 additions & 4 deletions script_res/ap_calc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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();
Expand Down
6 changes: 3 additions & 3 deletions script_res/damage_MASTER.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions script_res/damage_gsc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion script_res/move_data.js
Original file line number Diff line number Diff line change
Expand Up @@ -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': {
Expand Down
1 change: 1 addition & 0 deletions script_res/pokedex.js
Original file line number Diff line number Diff line change
Expand Up @@ -9554,6 +9554,7 @@ var POKEDEX_XY = $.extend(true, {}, POKEDEX_BW, {
},
"w": 53.0,
"ab": "Stance Change",
"isAlternateForme": true
},
"Aegislash-Shield": {
"t1": "Steel",
Expand Down
7 changes: 6 additions & 1 deletion script_res/setdex_custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down Expand Up @@ -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);

Expand Down
51 changes: 37 additions & 14 deletions script_res/setdex_ncp-g9.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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"
]
},
},
Expand Down

0 comments on commit 861b0d2

Please sign in to comment.