diff --git a/examples.md b/examples.md index b277ee1589d..f1e6eaf8d16 100644 --- a/examples.md +++ b/examples.md @@ -7,6 +7,7 @@ const genshin = require('genshin-db'); ## Table of Contents - [genshin.characters(query[, opts])](#genshincharactersquery-opts) +- [genshin.talents(query[, opts])](#genshintalentsquery-opts) - [genshin.constellations(query[, opts])](#genshinconstellationsquery-opts) - [genshin.weapons(query[, opts])](#genshinweaponsquery-opts) - [genshin.weaponmaterialtypes(query[, opts])](#genshinweaponmaterialtypesquery-opts) @@ -90,6 +91,96 @@ const genshin = require('genshin-db'); [ 'Fischl', 'Kaeya', 'Lisa', 'Venti' ] ``` +# genshin.talents(query[, opts]) + +- [genshin.talents('ninguang')](#genshintalentsninguang) +- [genshin.talents('klee').passive3](#genshintalentskleepassive3) +- [genshin.talents('mona').combatsp](#genshintalentsmonacombatsp) + +## genshin.talents('ninguang') + +```js +{ + name: 'Ningguang', + combat1: { + name: 'Normal Attack: Sparkling Scatter', + image: '', + info: '**Normal Attack**\n' + + 'Shoots gems that deal Geo DMG.\n' + + 'Upon hit, this grants Ningguang 1 Star Jade.\n' + + '\n' + + '**Charged Attack**\n' + + 'Consumes a certain amount of stamina to fire off a giant gem that deals Geo DMG.\n' + + 'If Ningguang has any Star Jades, unleashing a Charged Attack will cause the Star Jades to be fired at the enemy as well, dealing additional DMG.\n' + + '\n' + + '**Plunging Attack**\n' + + 'Gathering the might of Geo, Ningguang plunges towards the ground from mid-air, damaging all enemies in her path. Deals AoE Geo DMG upon impact with the ground.', + attributes: '' + }, + combat2: { + name: 'Jade Screen', + image: '', + info: 'Ningguang creates a Jade Screen out of gold, obsidian and her great opulence, dealing AoE Geo DMG.\n' + + '\n' + + '**Jade Screen**\n' + + '- Blocks enemy projectiles.\n' + + "- Endurance scales based on Ningguang's Max HP.\n" + + '\n' + + 'Jade Screen is considered a Geo Construct and can be used to block certain attacks, but cannot be climbed. Only one Jade Screen may exist at any one time.', + description: 'The canvas of stars is written upon this jade screen.', + attributes: '' + }, + combat3: { + name: 'Starshatter', + image: '', + info: 'Gathering a great number of gems, Ningguang scatters them all at once, sending homing projectiles at her enemies that deal massive Geo DMG. If Starshatter is cast when a Jade Screen is nearby, the Jade Screen will fire additional gem projectiles at the same time.', + description: 'Stars shatter. Silence falls.', + attributes: '' + }, + passive1: { + name: 'Backup Plan', + image: '', + info: 'When Ningguang is in possession of Star Jades, her Charged Attack does not consume Stamina.' + }, + passive2: { + name: 'Strategic Reserve', + image: '', + info: 'A character that passes through the Jade Screen will gain a 12% Geo DMG Bonus for 10s.' + }, + passive3: { + name: 'Trove of Marvelous Treasures', + image: '', + info: 'Displays the location of nearby ore veins (Iron Ore, White Iron Ore, Crystal Ore, and Magical Crystal Ore) on them mini-map.' + } +} +``` + +## genshin.talents('klee').passive3 + +```js +{ + name: 'All Of My Treasures!', + image: '', + info: 'Displays the location of nearby resources unique to Mondstadt on the mini-map.' +} +``` + +## genshin.talents('mona').combatsp + +```js +{ + name: 'Illusory Torrent', + image: '', + info: '**Alternate Sprint**\n' + + "Mona cloaks herself within the water's flow, consuming Stamina to move rapidly.\n" + + '\n' + + 'When under the effect of Illusory Torrent, Mona can move at high speed on water.\n' + + 'Applies the Wet status to nearby enemies when she reappears.', + description: "This is something that Mona can do, but her teacher cannot. Well, but it's not as if her teacher would pursue any matter concerning Hydro Visions anyways...", + attributes: '' +} +``` + # genshin.constellations(query[, opts]) - [genshin.constellations('amber')](#genshinconstellationsamber) diff --git a/package.json b/package.json index 3cbe69e5bfa..99b9b254285 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "genshin-db", - "version": "1.8.1", + "version": "1.9.0", "description": "api for detailed information on genshin impact based on version 1.0.1 from the fandom and various others.", "main": "./src/main.js", "scripts": { diff --git a/readme.md b/readme.md index 683dded2ff9..9951de5fe71 100644 --- a/readme.md +++ b/readme.md @@ -4,7 +4,7 @@ ------------------------------------ -Flexibly search and get the information of characters, weapons, weapon material, talent material, artifacts and more. +Flexibly search and get the information of characters, talents, constellations, weapons, weapon material, talent material, artifacts. ```js const genshin = require('genshin-db'); @@ -19,6 +19,7 @@ NOTES: every input string to the query parameter will be autocompleted to match - [genshin.setOptions(opts)](#genshinsetoptionsopts) - [genshin.getOptions()](#genshingetoptions) - [genshin.characters(query[, opts])](#genshincharactersquery-opts) +- [genshin.talents(query[, opts])](#genshintalentsquery-opts) - [genshin.constellations(query[, opts])](#genshinconstellationsquery-opts) - [genshin.weapons(query[, opts])](#genshinweaponsquery-opts) - [genshin.weaponmaterialtypes(query[, opts])](#genshinweaponmaterialtypesquery-opts) @@ -44,18 +45,25 @@ Possible inputs for query parameter are: - all rarities - "names" -Check out [categories.json](https://github.com/theBowja/genshin-db/blob/main/src/english/categories.json) file to see choices for each category. - +Check out [categories.json](https://github.com/theBowja/genshin-db/blob/main/src/english/categories.json) file to see choices for each category.\n Check out [examples.md](https://github.com/theBowja/genshin-db/blob/main/examples.md#genshincharactersquery-opts) to see example inputs and outputs for this function. +## genshin.talents(query[, opts]) + +Possible inputs for query parameter are: + +- all character names + +Check out [categories.json](https://github.com/theBowja/genshin-db/blob/main/src/english/categories.json) file to see choices for each category.\n +Check out [examples.md](https://github.com/theBowja/genshin-db/blob/main/examples.md#genshintalentsquery-opts) to see example inputs and outputs for this function. + ## genshin.constellations(query[, opts]) Possible inputs for query paremter are: - all character names -Check out [categories.json](https://github.com/theBowja/genshin-db/blob/main/src/english/categories.json) file to see choices for each category. - +Check out [categories.json](https://github.com/theBowja/genshin-db/blob/main/src/english/categories.json) file to see choices for each category.\n Check out [examples.md](https://github.com/theBowja/genshin-db/blob/main/examples.md#genshinconstellationsquery-opts) to see example inputs and outputs for this function. ## genshin.weapons(query[, opts]) @@ -68,8 +76,7 @@ Possible inputs for query parameter are: - all weapon ascension material types - "names" -Check out [categories.json](https://github.com/theBowja/genshin-db/blob/main/src/english/categories.json) file to see choices for each category. - +Check out [categories.json](https://github.com/theBowja/genshin-db/blob/main/src/english/categories.json) file to see choices for each category.\n Check out [examples.md](https://github.com/theBowja/genshin-db/blob/main/examples.md#genshinweaponsquery-opts) to see example inputs and outputs for this function. ## genshin.weaponmaterialtypes(query[, opts]) @@ -82,8 +89,7 @@ Possible inputs for query parameter are: - all domains of forgery - "names" -Check out [categories.json](https://github.com/theBowja/genshin-db/blob/main/src/english/categories.json) file to see choices for each category. - +Check out [categories.json](https://github.com/theBowja/genshin-db/blob/main/src/english/categories.json) file to see choices for each category.\n Check out [examples.md](https://github.com/theBowja/genshin-db/blob/main/examples.md#genshinweaponmaterialtypesquery-opts) to see example inputs and outputs for this function. ## genshin.talentmaterialtypes(query[, opts]) @@ -96,8 +102,7 @@ Possible inputs for query parameter are: - all domains of mastery - "names" -Check out [categories.json](https://github.com/theBowja/genshin-db/blob/main/src/english/categories.json) file to see choices for each category. - +Check out [categories.json](https://github.com/theBowja/genshin-db/blob/main/src/english/categories.json) file to see choices for each category.\n Check out [examples.md](https://github.com/theBowja/genshin-db/blob/main/examples.md#genshintalentmaterialtypesquery-opts) to see example inputs and outputs for this function. @@ -109,8 +114,7 @@ Possible inputs for query parameter are: - all rarities - "names" -Check out [categories.json](https://github.com/theBowja/genshin-db/blob/main/src/english/categories.json) file to see choices for each category. - +Check out [categories.json](https://github.com/theBowja/genshin-db/blob/main/src/english/categories.json) file to see choices for each category.\n Check out [examples.md](https://github.com/theBowja/genshin-db/blob/main/examples.md#genshinartifactsquery-opts) to see example inputs and outputs for this function. ## genshin.talents(query[, opts]) diff --git a/src/design.json b/src/design.json index 791d6e000ae..de1912bea6f 100644 --- a/src/design.json +++ b/src/design.json @@ -1,7 +1,8 @@ { "languages": ["english"], "folders": ["characters", "weapons", "elements", "rarity", "artifacts", - "weaponmaterialtypes", "talentmaterialtypes", "constellations"], + "weaponmaterialtypes", "talentmaterialtypes", "constellations", + "talents"], "indexByCategories": { "characters": ["element", "weapontype", "talentmaterialtype", "gender", "region", "rarity"], "weapons": ["weapontype", "rarity", "weaponmaterialtype"], @@ -11,6 +12,7 @@ }, "altnames": { "weaponmaterialtypes": ["2starname", "3starname", "4starname", "5starname"], - "constellations": ["aliases"] + "constellations": ["aliases"], + "talents": ["aliases"] } } \ No newline at end of file diff --git a/src/english/talents/tartaglia.json b/src/english/talents/tartaglia.json index 5c10c4680ca..b869b95b4db 100644 --- a/src/english/talents/tartaglia.json +++ b/src/english/talents/tartaglia.json @@ -1,5 +1,6 @@ { "name": "Tartaglia", + "aliases": ["Childe"], "combat1": { "name": "Normal Attack: Cutting Torrent", "image": "", diff --git a/src/english/talents/traveler (anemo).json b/src/english/talents/traveler (anemo).json index 025e68eb96d..170391782f4 100644 --- a/src/english/talents/traveler (anemo).json +++ b/src/english/talents/traveler (anemo).json @@ -1,5 +1,6 @@ { "name": "Traveler (Anemo)", + "aliases": ["Anemo Traveler"], "combat1": { "name": "Normal Attack: Foreign Ironwind", "image": "", diff --git a/src/english/talents/traveler (geo).json b/src/english/talents/traveler (geo).json index e6630ebf7ac..9d961f064d6 100644 --- a/src/english/talents/traveler (geo).json +++ b/src/english/talents/traveler (geo).json @@ -1,5 +1,6 @@ { "name": "Traveler (Geo)", + "aliases": ["Geo Traveler"], "combat1": { "name": "Normal Attack: Foreign Rockblade", "image": "", diff --git a/src/index/english/talents.json b/src/index/english/talents.json new file mode 100644 index 00000000000..d3bc733a1d3 --- /dev/null +++ b/src/index/english/talents.json @@ -0,0 +1,62 @@ +{ + "file": [ + "amber.json", + "barbara.json", + "beidou.json", + "bennett.json", + "chongyun.json", + "diluc.json", + "diona.json", + "fischl.json", + "jean.json", + "kaeya.json", + "keqing.json", + "klee.json", + "lisa.json", + "mona.json", + "ningguang.json", + "noelle.json", + "qiqi.json", + "razor.json", + "sucrose.json", + "tartaglia.json", + "tartaglia.json", + "traveler (anemo).json", + "traveler (anemo).json", + "traveler (geo).json", + "traveler (geo).json", + "venti.json", + "xiangling.json", + "xingqiu.json" + ], + "names": [ + "Amber", + "Barbara", + "Beidou", + "Bennett", + "Chongyun", + "Diluc", + "Diona", + "Fischl", + "Jean", + "Kaeya", + "Keqing", + "Klee", + "Lisa", + "Mona", + "Ningguang", + "Noelle", + "Qiqi", + "Razor", + "Sucrose", + "Tartaglia", + "Childe", + "Traveler (Anemo)", + "Anemo Traveler", + "Traveler (Geo)", + "Geo Traveler", + "Venti", + "Xiangling", + "Xingqiu" + ] +} \ No newline at end of file diff --git a/src/main.js b/src/main.js index c3da942c147..8691b3caed8 100644 --- a/src/main.js +++ b/src/main.js @@ -103,6 +103,10 @@ genshin.characters = function(query, opts={}) { return searchFolder(query, 'characters', opts); } +genshin.talents = function(query, opts={}) { + return searchFolder(query, 'talents', opts); +} + genshin.weapons = function(query, opts={}) { return searchFolder(query, 'weapons', opts); } diff --git a/todo.md b/todo.md index 48f09653467..ccbeccbbf2c 100644 --- a/todo.md +++ b/todo.md @@ -1,4 +1,6 @@ ## Todo +- [ ] make collapsable sections for examples.md +- [ ] add properties information of data to readme.md - [ ] add function to get lists verbose - [ ] language-specific sanitation of query inputs - [ ] birthdays for characters