unite-lib 1.0.3 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -703,6 +703,31 @@ var pokemons = [
703
703
  ],
704
704
  "difficulty": 1
705
705
  },
706
+ {
707
+ "name": "Moltres",
708
+ "dex": 146,
709
+ "images": {
710
+ "main": "pokemons/roster-moltres.png",
711
+ "big": "pokemons/roster-moltres-2x.png",
712
+ "complete": "pokemons/stat-moltres.png",
713
+ "move_s11": "moves/moltres_s11.png",
714
+ "move_s21": "moves/moltres_s21.png"
715
+ },
716
+ "active": true,
717
+ "battleType": BattleType.ALLROUNDER,
718
+ "stats": {
719
+ "offense": 4,
720
+ "endurance": 2.5,
721
+ "mobility": 2,
722
+ "scoring": 2,
723
+ "support": 2
724
+ },
725
+ "tags": [
726
+ Tag.ALLROUNDER,
727
+ Tag.MELEE
728
+ ],
729
+ "difficulty": 2
730
+ },
706
731
  {
707
732
  "name": "Dragonite",
708
733
  "dex": 149,
@@ -731,7 +756,7 @@ var pokemons = [
731
756
  "difficulty": 1
732
757
  },
733
758
  {
734
- "name": "Mewtwo X",
759
+ "name": "Mega Mewtwo X",
735
760
  "dex": 150,
736
761
  "images": {
737
762
  "main": "pokemons/roster-mewtwox.png",
@@ -758,7 +783,7 @@ var pokemons = [
758
783
  "difficulty": 1
759
784
  },
760
785
  {
761
- "name": "Mewtwo Y",
786
+ "name": "Mega Mewtwo Y",
762
787
  "dex": 150,
763
788
  "images": {
764
789
  "main": "pokemons/roster-mewtwoy.png",
@@ -2368,22 +2393,37 @@ var moves_default = moves;
2368
2393
  // src/maps.ts
2369
2394
  var maps = [
2370
2395
  {
2371
- id: "remoat-stadium",
2372
- name: "Remoat Stadium",
2373
- image: "maps/remoat-stadium.png",
2374
- description: "Standard 5v5 map."
2396
+ id: "map-groudon",
2397
+ name: "Theia Sky Ruins",
2398
+ image: "maps/map-groudon/map-groudon@4x.png",
2399
+ images: {
2400
+ "1": "maps/map-groudon/map-groudon@1x.png",
2401
+ "2": "maps/map-groudon/map-groudon@2x.png",
2402
+ "4": "maps/map-groudon/map-groudon@4x.png"
2403
+ },
2404
+ description: "Map with Groudon."
2375
2405
  },
2376
2406
  {
2377
- id: "theia-sky-ruins",
2407
+ id: "map-kyogre",
2378
2408
  name: "Theia Sky Ruins",
2379
- image: "maps/theia-sky-ruins.png",
2380
- description: "5v5 map with Rayquaza."
2409
+ image: "maps/map-kyogre/map-kyogre@4x.png",
2410
+ images: {
2411
+ "1": "maps/map-kyogre/map-kyogre@1x.png",
2412
+ "2": "maps/map-kyogre/map-kyogre@2x.png",
2413
+ "4": "maps/map-kyogre/map-kyogre@4x.png"
2414
+ },
2415
+ description: "Map with Kyogre."
2381
2416
  },
2382
2417
  {
2383
- id: "mer-stadium",
2384
- name: "Mer Stadium",
2385
- image: "maps/mer-stadium.png",
2386
- description: "Quick battle map."
2418
+ id: "map-rayquaza",
2419
+ name: "Theia Sky Ruins",
2420
+ image: "maps/map-rayquaza/map-rayquaza@4x.png",
2421
+ images: {
2422
+ "1": "maps/map-rayquaza/map-rayquaza@1x.png",
2423
+ "2": "maps/map-rayquaza/map-rayquaza@2x.png",
2424
+ "4": "maps/map-rayquaza/map-rayquaza@4x.png"
2425
+ },
2426
+ description: "Map with Rayquaza."
2387
2427
  }
2388
2428
  ];
2389
2429
  var maps_default = maps;
@@ -2395,6 +2435,12 @@ function getImageUrl(pokemon, imageKey, options) {
2395
2435
  const base = options?.baseUrl?.replace(/\/$/, "");
2396
2436
  return base ? `${base}/${path}` : path;
2397
2437
  }
2438
+ function getMapImageUrl(map, resolution, options) {
2439
+ const path = resolution && map.images?.[resolution] != null ? map.images[resolution] : map.image;
2440
+ if (path == null || path === "") return "";
2441
+ const base = options?.baseUrl?.replace(/\/$/, "");
2442
+ return base ? `${base}/${path}` : path;
2443
+ }
2398
2444
  function getPokemonByName(name) {
2399
2445
  return pokemons_default.find((p) => p.name === name);
2400
2446
  }
@@ -2425,10 +2471,23 @@ var names = {};
2425
2471
  for (const p of pokemons_default) {
2426
2472
  names[slugFromMain(p.images.main)] = p.name;
2427
2473
  }
2474
+ for (const m of maps_default) {
2475
+ names[m.id] = m.name;
2476
+ if (m.description) names[`${m.id}.description`] = m.description;
2477
+ }
2428
2478
  var en_default = names;
2429
2479
 
2430
2480
  // src/i18n/pt-BR.ts
2431
- var ptBR = { ...en_default, zapdos: "Zapdos" };
2481
+ var ptBR = {
2482
+ ...en_default,
2483
+ // Maps — names and descriptions
2484
+ "map-groudon": "Ru\xEDnas Celestes de Theia",
2485
+ "map-groudon.description": "Mapa 5v5 com Groudon.",
2486
+ "map-kyogre": "Ru\xEDnas Celestes de Theia",
2487
+ "map-kyogre.description": "Mapa 5v5 com Kyogre.",
2488
+ "map-rayquaza": "Ru\xEDnas Celestes de Theia",
2489
+ "map-rayquaza.description": "Mapa 5v5 com Rayquaza."
2490
+ };
2432
2491
  var pt_BR_default = ptBR;
2433
2492
 
2434
2493
  // src/i18n/ja-JP.ts
@@ -2519,7 +2578,14 @@ var jaJP = {
2519
2578
  armarouge: "\u30B0\u30EC\u30F3\u30A2\u30EB\u30DE",
2520
2579
  ceruledge: "\u30BD\u30A6\u30D6\u30EC\u30A4\u30BA",
2521
2580
  tinkaton: "\u30C7\u30AB\u30CC\u30C1\u30E3\u30F3",
2522
- miraidon: "\u30DF\u30E9\u30A4\u30C9\u30F3"
2581
+ miraidon: "\u30DF\u30E9\u30A4\u30C9\u30F3",
2582
+ // Maps — names and descriptions
2583
+ "map-groudon": "\u30C6\u30A4\u30A2\u306E\u5929\u7A7A\u907A\u8DE1",
2584
+ "map-groudon.description": "\u30B0\u30E9\u30FC\u30C9\u30F3\u304C\u767B\u5834\u3059\u308B5v5\u30DE\u30C3\u30D7\u3002",
2585
+ "map-kyogre": "\u30C6\u30A4\u30A2\u306E\u5929\u7A7A\u907A\u8DE1",
2586
+ "map-kyogre.description": "\u30AB\u30A4\u30AA\u30FC\u30AC\u304C\u767B\u5834\u3059\u308B5v5\u30DE\u30C3\u30D7\u3002",
2587
+ "map-rayquaza": "\u30C6\u30A4\u30A2\u306E\u5929\u7A7A\u907A\u8DE1",
2588
+ "map-rayquaza.description": "\u30EC\u30C3\u30AF\u30A6\u30B6\u304C\u767B\u5834\u3059\u308B5v5\u30DE\u30C3\u30D7\u3002"
2523
2589
  };
2524
2590
  var ja_JP_default = jaJP;
2525
2591
 
@@ -2611,7 +2677,14 @@ var fr = {
2611
2677
  armarouge: "Carmadura",
2612
2678
  ceruledge: "Malvalame",
2613
2679
  tinkaton: "Forgerette",
2614
- miraidon: "Miraidon"
2680
+ miraidon: "Miraidon",
2681
+ // Maps — names and descriptions
2682
+ "map-groudon": "Ruines C\xE9lestes de Theia",
2683
+ "map-groudon.description": "Carte 5v5 avec Groudon.",
2684
+ "map-kyogre": "Ruines C\xE9lestes de Theia",
2685
+ "map-kyogre.description": "Carte 5v5 avec Kyogre.",
2686
+ "map-rayquaza": "Ruines C\xE9lestes de Theia",
2687
+ "map-rayquaza.description": "Carte 5v5 avec Rayquaza."
2615
2688
  };
2616
2689
  var fr_default = fr;
2617
2690
 
@@ -2703,7 +2776,14 @@ var es = {
2703
2776
  armarouge: "Armarouge",
2704
2777
  ceruledge: "Ceruledge",
2705
2778
  tinkaton: "Tinkaton",
2706
- miraidon: "Miraidon"
2779
+ miraidon: "Miraidon",
2780
+ // Maps — names and descriptions
2781
+ "map-groudon": "Ruinas Celestiales de Theia",
2782
+ "map-groudon.description": "Mapa 5v5 con Groudon.",
2783
+ "map-kyogre": "Ruinas Celestiales de Theia",
2784
+ "map-kyogre.description": "Mapa 5v5 con Kyogre.",
2785
+ "map-rayquaza": "Ruinas Celestiales de Theia",
2786
+ "map-rayquaza.description": "Mapa 5v5 con Rayquaza."
2707
2787
  };
2708
2788
  var es_default = es;
2709
2789
 
@@ -2719,11 +2799,23 @@ function getPokemonName(id, locale = "en") {
2719
2799
  const map = locales[locale] ?? en_default;
2720
2800
  return map[id] ?? en_default[id] ?? id;
2721
2801
  }
2802
+ function getMapName(mapId, locale = "en") {
2803
+ const map = locales[locale] ?? en_default;
2804
+ return map[mapId] ?? en_default[mapId] ?? mapId;
2805
+ }
2806
+ function getMapDescription(mapId, locale = "en") {
2807
+ const key = `${mapId}.description`;
2808
+ const map = locales[locale] ?? en_default;
2809
+ return map[key] ?? en_default[key] ?? "";
2810
+ }
2722
2811
  export {
2723
2812
  BattleType,
2724
2813
  Tag,
2725
2814
  getActivePokemons,
2726
2815
  getImageUrl,
2816
+ getMapDescription,
2817
+ getMapImageUrl,
2818
+ getMapName,
2727
2819
  getPokemonByDex,
2728
2820
  getPokemonByName,
2729
2821
  getPokemonBySlug,