mirror of
https://github.com/theBowja/GenshinData-1.git
synced 2025-04-29 02:28:36 +09:00
""""
This commit is contained in:
parent
2517e621ec
commit
b0c25fef63
@ -83,12 +83,13 @@ function collateDomain(lang) {
|
|||||||
if(isSundaySpecial(getLanguage('EN')[obj.NameTextMapHash])) return accum;
|
if(isSundaySpecial(getLanguage('EN')[obj.NameTextMapHash])) return accum;
|
||||||
// console.log(obj.Id);
|
// console.log(obj.Id);
|
||||||
let data = {};
|
let data = {};
|
||||||
// data.Id = obj.Id;
|
data.Id = obj.Id;
|
||||||
data.name = language[obj.NameTextMapHash];
|
data.name = language[obj.NameTextMapHash];
|
||||||
// data.displayname = language[obj.DisplayNameTextMapHash]; // doesn't exist for artifact domains
|
// data.displayname = language[obj.DisplayNameTextMapHash]; // doesn't exist for artifact domains
|
||||||
data.domainentrance = language[getDomainEntranceTextMapHash(getLanguage('EN')[obj.NameTextMapHash])];// obj.EntryPicPath;
|
data.domainentrance = language[getDomainEntranceTextMapHash(getLanguage('EN')[obj.NameTextMapHash])];// obj.EntryPicPath;
|
||||||
data.description = language[obj.DescTextMapHash];
|
data.description = language[obj.DescTextMapHash];
|
||||||
|
|
||||||
|
if(obj.Id === 5120 || obj.Id === 5121 || obj.Id === 5122 || obj.Id === 5123) obj.CityID = 1; // Peak of Vindagnyr region fix from Liyue to Mondstadt
|
||||||
data.region = language[xcity.find(city => city.CityId === obj.CityID).CityNameTextMapHash];
|
data.region = language[xcity.find(city => city.CityId === obj.CityID).CityNameTextMapHash];
|
||||||
|
|
||||||
data.recommendedlevel = obj.ShowLevel;
|
data.recommendedlevel = obj.ShowLevel;
|
||||||
|
101
myscripts/collateEnemy.js
Normal file
101
myscripts/collateEnemy.js
Normal file
@ -0,0 +1,101 @@
|
|||||||
|
const xdungeon = getExcel('DungeonExcelConfigData');
|
||||||
|
const xpreview = getExcel('RewardPreviewExcelConfigData');
|
||||||
|
const xdungeonentry = getExcel('DungeonEntryExcelConfigData'); // adventure handbook
|
||||||
|
const xdisplay = getExcel('DisplayItemExcelConfigData');
|
||||||
|
const xdisorder = getExcel('DungeonLevelEntityConfigData'); // ley line disorder
|
||||||
|
const xcity = getExcel('CityConfigData');
|
||||||
|
|
||||||
|
const xmonster = getExcel('MonsterExcelConfigData');
|
||||||
|
const xcodex = getExcel('AnimalCodexExcelConfigData');
|
||||||
|
const xinvest = getExcel('InvestigationMonsterConfigData');
|
||||||
|
const xdescribe = getExcel('MonsterDescribeExcelConfigData');
|
||||||
|
const xspecial = getExcel('MonsterSpecialNameExcelConfigData');
|
||||||
|
|
||||||
|
//xmanualtext
|
||||||
|
/*
|
||||||
|
UI_CODEX_ANIMAL_CATEGORY_ELEMENTAL
|
||||||
|
UI_CODEX_ANIMAL_CATEGORY_HILICHURL
|
||||||
|
*/
|
||||||
|
|
||||||
|
function round(number, decimalplaces) {
|
||||||
|
let mult = Math.pow(10, decimalplaces);
|
||||||
|
let out = Math.round(number * mult) / mult;
|
||||||
|
if(out === null) console.log('enemy null resistance rounding');
|
||||||
|
return out;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function collateEnemy(lang) {
|
||||||
|
const language = getLanguage(lang);
|
||||||
|
const xmat = getExcel('MaterialExcelConfigData');
|
||||||
|
|
||||||
|
let mymonster = xcodex.reduce((accum, obj) => {
|
||||||
|
if(obj.Type !== 'CODEX_MONSTER') return accum;
|
||||||
|
if(obj.IsDeleteWatcherAfterFinish) return accum;
|
||||||
|
let mon = xmonster.find(m => m.Id === obj.Id);
|
||||||
|
let des = xdescribe.find(d => d.Id === obj.DescribeId);
|
||||||
|
let spe = xspecial.find(s => s.SpecialNameLabID === des.SpecialNameLabID);
|
||||||
|
if(!spe) console.log('no special for '+obj.Id);
|
||||||
|
|
||||||
|
let data = {};
|
||||||
|
data.Id = obj.Id;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
data.name = language[des.NameTextMapHash];
|
||||||
|
data.specialname = language[spe.SpecialNameTextMapHash];
|
||||||
|
|
||||||
|
let sub = obj.SubType || 'CODEX_SUBTYPE_ELEMENTAL';
|
||||||
|
sub = sub.slice(sub.lastIndexOf('_')+1);
|
||||||
|
sub = xmanualtext.find(m => m.TextMapId === `UI_CODEX_ANIMAL_CATEGORY_${sub}`).TextMapContentTextMapHash;
|
||||||
|
data.type = mon.SecurityLevel || 'COMMON';
|
||||||
|
data.category = language[sub];
|
||||||
|
data.imageicon = des.Icon;
|
||||||
|
data.description = sanitizeDescription(language[obj.DescTextMapHash]);
|
||||||
|
|
||||||
|
data.aggrorange = mon.VisionLevel;
|
||||||
|
data.bgm = mon.CombatBGMLevel;
|
||||||
|
data.budget = mon.EntityBudgetLevel;
|
||||||
|
|
||||||
|
let drops = [];
|
||||||
|
for(let x of mon.HpDrops) {
|
||||||
|
if(x.DropId) drops.push(x.DropId);
|
||||||
|
}
|
||||||
|
drops.push(mon.KillDropId);
|
||||||
|
data.drops = drops;
|
||||||
|
|
||||||
|
let stats = {};
|
||||||
|
stats.resistance = {};
|
||||||
|
stats.resistance.physical = round(mon.PhysicalSubHurt, 2) || 0;
|
||||||
|
stats.resistance.pyro = round(mon.FireSubHurt, 2) || 0;
|
||||||
|
stats.resistance.dendro = round(mon.GrassSubHurt, 2) || 0;
|
||||||
|
stats.resistance.hydro = round(mon.WaterSubHurt, 2) || 0;
|
||||||
|
stats.resistance.geo = round(mon.RockSubHurt, 2) || 0;
|
||||||
|
stats.resistance.anemo = round(mon.WindSubHurt, 2) || 0;
|
||||||
|
stats.resistance.cryo = round(mon.IceSubHurt, 2) || 0;
|
||||||
|
stats.resistance.electro = round(mon.ElecSubHurt, 2) || 0;
|
||||||
|
stats.base = {};
|
||||||
|
stats.base.hp = mon.HpBase;
|
||||||
|
stats.base.attack = mon.AttackBase;
|
||||||
|
stats.base.defense = mon.DefenseBase;
|
||||||
|
stats.curve = {};
|
||||||
|
try {
|
||||||
|
stats.curve.hp = mon.PropGrowCurves.find(ele => ele.Type === 'FIGHT_PROP_BASE_HP').GrowCurve;
|
||||||
|
stats.curve.attack = mon.PropGrowCurves.find(ele => ele.Type === 'FIGHT_PROP_BASE_ATTACK').GrowCurve;
|
||||||
|
stats.curve.defense = mon.PropGrowCurves.find(ele => ele.Type === 'FIGHT_PROP_BASE_DEFENSE').GrowCurve;
|
||||||
|
} catch(e) {
|
||||||
|
console.log(obj.Id + " - " + data.name + " - failed PropGrowCurves");
|
||||||
|
}
|
||||||
|
|
||||||
|
data.stats = stats;
|
||||||
|
|
||||||
|
let filename = makeFileName(getLanguage('EN')[des.NameTextMapHash]);
|
||||||
|
if(filename === '') return accum;
|
||||||
|
|
||||||
|
accum[filename] = data;
|
||||||
|
return accum;
|
||||||
|
}, {});
|
||||||
|
return mymonster;
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = collateEnemy;
|
@ -3,31 +3,45 @@ MATERIAL_AVATAR_MATERIAL is talent level-up material, etc.
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const filter = ['MATERIAL_EXCHANGE', 'MATERIAL_WOOD', 'MATERIAL_AVATAR_MATERIAL'];
|
const filter = ['MATERIAL_EXCHANGE', 'MATERIAL_WOOD', 'MATERIAL_AVATAR_MATERIAL', 'MATERIAL_EXP_FRUIT'];
|
||||||
|
|
||||||
// Adventure EXP, Mora, Primogems, Companionship EXP, Apple, Sunsettia
|
// Adventure EXP, Mora, Primogems, Companionship EXP, Apple, Sunsettia
|
||||||
const includeMatId = [102, 202, 201, 105, 100001, 100002];
|
const includeMatId = [102, 202, 201, 105, 100001, 100002];
|
||||||
// Crafted Items, Primordial Essence, Raw Meat (S), Fowl (S)
|
// Crafted Items, Primordial Essence, Raw Meat (S), Fowl (S)
|
||||||
const excludeMatId = [110000, 112001, 100086, 100087];
|
const excludeMatId = [110000, 112001, 100086, 100087];
|
||||||
|
|
||||||
|
function sortMaterials(mata, matb) {
|
||||||
|
if(mata.Rank < matb.Rank) return -1;
|
||||||
|
if(mata.Rank > matb.Rank) return 1;
|
||||||
|
if(mata.Id < matb.Id) return -1;
|
||||||
|
if(mata.Id > matb.Id) return 1;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
function collateMaterial(lang) {
|
function collateMaterial(lang) {
|
||||||
const language = getLanguage(lang);
|
const language = getLanguage(lang);
|
||||||
const xsource = getExcel('MaterialSourceDataExcelConfigData');
|
const xsource = getExcel('MaterialSourceDataExcelConfigData');
|
||||||
const xmat = getExcel('MaterialExcelConfigData');
|
const xmat = getExcel('MaterialExcelConfigData').sort(sortMaterials);
|
||||||
const xarchive = getExcel('MaterialCodexExcelConfigData');
|
const xarchive = getExcel('MaterialCodexExcelConfigData');
|
||||||
const xdungeon = getExcel('DungeonExcelConfigData');
|
const xdungeon = getExcel('DungeonExcelConfigData');
|
||||||
|
|
||||||
|
let sortOrder = 0;
|
||||||
|
|
||||||
let mymaterial = xmat.reduce((accum, obj) => {
|
let mymaterial = xmat.reduce((accum, obj) => {
|
||||||
if(!obj.MaterialType) return accum;
|
sortOrder++;
|
||||||
if(excludeMatId.includes(obj.Id)) return accum;
|
if(!includeMatId.includes(obj.Id)) {
|
||||||
if(!filter.includes(obj.MaterialType) && !includeMatId.includes(obj.Id)) return accum;
|
if(!obj.MaterialType) return accum;
|
||||||
|
if(excludeMatId.includes(obj.Id)) return accum;
|
||||||
|
if(!filter.includes(obj.MaterialType)) return accum;
|
||||||
|
}
|
||||||
|
|
||||||
let data = {};
|
let data = {};
|
||||||
|
data.Id = obj.Id;
|
||||||
data.name = language[obj.NameTextMapHash];
|
data.name = language[obj.NameTextMapHash];
|
||||||
if(data.name === '') return accum;
|
if(data.name === '') return accum;
|
||||||
// data.Id = obj.Id;
|
data.sortorder = sortOrder;
|
||||||
data.description = language[obj.DescTextMapHash];
|
data.description = language[obj.DescTextMapHash];
|
||||||
data.category = obj.MaterialType.slice(9);
|
data.category = obj.MaterialType ? obj.MaterialType.slice(9) : obj.ItemType;
|
||||||
data.materialtype = language[obj.TypeDescTextMapHash];
|
data.materialtype = language[obj.TypeDescTextMapHash];
|
||||||
if(obj.RankLevel) data.rarity = ''+obj.RankLevel;
|
if(obj.RankLevel) data.rarity = ''+obj.RankLevel;
|
||||||
|
|
||||||
|
@ -102,14 +102,14 @@ function exportData(folder, collateFunc, englishonly, skipwrite) {
|
|||||||
// exportData('characters', require('./collateCharacter.js'));
|
// exportData('characters', require('./collateCharacter.js'));
|
||||||
// exportCurve('characters', 'AvatarCurveExcelConfigData');
|
// exportCurve('characters', 'AvatarCurveExcelConfigData');
|
||||||
// exportData('constellations', require('./collateConstellation'));
|
// exportData('constellations', require('./collateConstellation'));
|
||||||
exportData('talents', require('./collateTalent.js'));
|
// exportData('talents', require('./collateTalent.js'));
|
||||||
// exportData('weapons', require('./collateWeapon.js'));
|
// exportData('weapons', require('./collateWeapon.js'));
|
||||||
// exportCurve('weapons', 'WeaponCurveExcelConfigData')
|
// exportCurve('weapons', 'WeaponCurveExcelConfigData')
|
||||||
// exportData('artifacts', require('./collateArtifact.js'));
|
// exportData('artifacts', require('./collateArtifact.js'));
|
||||||
// exportData('foods', require('./collateFood'));
|
// exportData('foods', require('./collateFood'));
|
||||||
// exportData('materials', require('./collateMaterial')); // run twice
|
exportData('materials', require('./collateMaterial')); // run twice
|
||||||
// exportData('domains', require('./collateDomain')); // run twice // remember to add back recommendedelements and disorder and entrypicpath
|
// exportData('domains', require('./collateDomain')); // run twice // remember to add back recommendedelements and disorder and entrypicpath
|
||||||
|
// exportData('enemies', require('./collateEnemy'), true);
|
||||||
|
|
||||||
//console.log(collateCharacter('EN'))
|
//console.log(collateCharacter('EN'))
|
||||||
//console.log(collateConstellation('EN').hutao)
|
//console.log(collateConstellation('EN').hutao)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user