Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 20 additions & 20 deletions cards.json
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@
"units": 1,
"duration": null,
"evolution": false,
"hero": false,
"hero": true,
"typeAttack": "unique",
"projectile": false,
"suicide": false,
Expand Down Expand Up @@ -445,7 +445,7 @@
}
},
"statsHero": {
"prestigeCost": null
"prestigeCost": 2
},
"hitspeed": 2.0,
"radius": null,
Expand Down Expand Up @@ -1447,7 +1447,7 @@
],
"units": 6,
"duration": null,
"evolution": false,
"evolution": true,
"hero": false,
"typeAttack": "unique",
"projectile": true,
Expand Down Expand Up @@ -1478,16 +1478,16 @@
"level16": 368
},
"statsEvo": {
"cycles": null,
"cycles": 1,
"damage": {
"level11": null,
"level15": null,
"level16": null
"level11": 108,
"level15": 156,
"level16": 172
},
"hitpoints": {
"level11": null,
"level15": null,
"level16": null
"level11": 230,
"level15": 335,
"level16": 368
}
},
"statsHero": {
Expand Down Expand Up @@ -3000,7 +3000,7 @@
"statsHero": {
"prestigeCost": null
},
"hitspeed": 0.9,
"hitspeed": 2.4,
"radius": 1.0,
"generationSpeed": null,
"generationUnits": null,
Expand Down Expand Up @@ -4113,7 +4113,7 @@
}
},
"statsHero": {
"prestigeCost": 1
"prestigeCost": 2
},
"hitspeed": 1.1,
"radius": 0.25,
Expand Down Expand Up @@ -4769,8 +4769,8 @@
"statsHero": {
"prestigeCost": null
},
"hitspeed": 1.9,
"radius": 0.8,
"hitspeed": 2.0,
"radius": 1.5,
"generationSpeed": null,
"generationUnits": null,
"speed": "fast",
Expand Down Expand Up @@ -5595,9 +5595,9 @@
"level16": null
},
"damage": {
"level11": 212,
"level15": 309,
"level16": 339
"level11": 202,
"level15": 293,
"level16": 323
},
"hitpoints": {
"level11": 824,
Expand All @@ -5607,9 +5607,9 @@
"statsEvo": {
"cycles": 2,
"damage": {
"level11": 212,
"level15": 309,
"level16": 339
"level11": 202,
"level15": 293,
"level16": 323
},
"hitpoints": {
"level11": 824,
Expand Down
9 changes: 5 additions & 4 deletions scripts/update-cards.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ const https = require('https');
// CONSTANTS
// ─────────────────────────────────────────────────────────────────────────────

const API_URL = 'https://humble.galacticapricot.dev/gamedata-v5.json';
//const API_URL = 'https://humble.galacticapricot.dev/gamedata-v5.json';
const API_URL = 'https://cache.statsroyale.com/gamedata-v5.json';
const CARDS_FILE = path.join(__dirname, '..', 'cards.json');

const MULTIPLIERS = {
Expand Down Expand Up @@ -148,14 +149,14 @@ function processCard(card, apiItem, multipliers) {

if (characters.length > 0) {
const { maxHP, primaryChar, totalDamage, hasProjectile } = aggregateCharacterStats(characters);
card.hitspeed = primaryChar.hitSpeed ? primaryChar.hitSpeed / 1000 : card.hitspeed;
card.hitspeed = primaryChar.hitSpeed ? (primaryChar.hitSpeed + (projData.pingpongVisualTime ?? 0)) / 1000 : card.hitspeed;
card.range = primaryChar.range ? primaryChar.range / 1000 : card.range;
card.speed = SPEED_MAP[primaryChar.tidSpeed] || card.speed;
card.projectile = hasProjectile || card.projectile;
baseHP = maxHP || charData.hitpoints || spawnCharData.hitpoints;
baseDamage = totalDamage || charData.damage || projData.damage || areaData.damage || buffData.damagePerSecond || spawnProjData.damage || spawnCharData.damage;
} else {
card.hitspeed = charData.hitSpeed ? charData.hitSpeed / 1000 : card.hitspeed;
card.hitspeed = charData.hitSpeed ? (charData.hitSpeed + (projData.pingpongVisualTime ?? 0)) / 1000 : card.hitspeed;
card.range = charData.range ? charData.range / 1000 : card.range;
card.speed = SPEED_MAP[charData.tidSpeed] || card.speed;
baseHP = charData.hitpoints || spawnCharData.hitpoints;
Expand All @@ -168,7 +169,7 @@ function processCard(card, apiItem, multipliers) {
card.generationUnits = charData.spawnNumber > 1 ? charData.spawnNumber : card.generationUnits;

const rawRadius = apiItem.radius ?? areaData.radius ?? charData.areaDamageRadius ?? projData.radius ?? projData.customFirstProjectileData?.radius;
if (rawRadius != null) {
if (rawRadius != null && card.units === 0 && !['Lightning', 'Void', 'Vines'].includes(card.name)) {
card.radius = rawRadius / 1000;
card.typeAttack = 'splash';
} else {
Expand Down
Loading