-
Notifications
You must be signed in to change notification settings - Fork 228
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
150 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
export * from './consts' | ||
export * from './sheets' | ||
export * from './tagFieldMap' | ||
export * from './util' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import type { TagField } from '@genshin-optimizer/pando/ui-sheet' | ||
import type { ElementalTypeKey } from '@genshin-optimizer/sr/consts' | ||
import { | ||
allElementalDmgMainStatKeys, | ||
allRelicMainSubStatKeys, | ||
} from '@genshin-optimizer/sr/consts' | ||
import type { Tag } from '@genshin-optimizer/sr/formula' | ||
import { own } from '@genshin-optimizer/sr/formula' | ||
import { RelicStatWithUnit } from '@genshin-optimizer/sr/ui' | ||
|
||
export const charBaseUiSheet: TagField[] = allRelicMainSubStatKeys.map( | ||
(statKey) => { | ||
if ( | ||
allElementalDmgMainStatKeys.includes( | ||
statKey as (typeof allElementalDmgMainStatKeys)[number] | ||
) | ||
) { | ||
const tag = { | ||
...own.final.dmg_, | ||
elementalType: statKey.slice(0, -5) as ElementalTypeKey, | ||
} as Tag | ||
return { | ||
title: <RelicStatWithUnit statKey={statKey} />, | ||
fieldRef: tag, | ||
} as TagField | ||
} | ||
console.log({ statKey }) | ||
return { | ||
fieldRef: own.final[statKey as keyof typeof own.final].tag as Tag, | ||
title: <RelicStatWithUnit statKey={statKey} />, | ||
} | ||
} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { | ||
compileTagMapValues, | ||
TagMapSubset, | ||
} from '@genshin-optimizer/pando/engine' | ||
import type { TagField } from '@genshin-optimizer/pando/ui-sheet' | ||
import { isTagField } from '@genshin-optimizer/pando/ui-sheet' | ||
import type { Tag } from '@genshin-optimizer/sr/formula' | ||
import { keys } from '@genshin-optimizer/sr/formula' | ||
import { uiSheets } from './sheets' | ||
|
||
const tagValue: Array<{ tag: Tag; value: TagField }> = [] | ||
Object.values(uiSheets).forEach((sheet) => { | ||
Object.values(sheet).forEach(({ documents }) => { | ||
documents.forEach((document) => { | ||
if (document.type === 'fields') | ||
document.fields.forEach((field) => { | ||
if (!isTagField(field)) return | ||
tagValue.push({ tag: field.fieldRef, value: field }) | ||
}) | ||
}) | ||
}) | ||
}) | ||
|
||
//TODO: This breaks? wtf? | ||
// charBaseUiSheet.forEach((field) => { | ||
// tagValue.push({ tag: field.fieldRef, value: field }) | ||
// }) | ||
export const tagFieldMap = new TagMapSubset( | ||
keys, | ||
compileTagMapValues(keys, tagValue) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import type { DamageType, Tag } from '@genshin-optimizer/sr/formula' | ||
|
||
export function getVariant(tag: Tag) { | ||
const { qt, q, elementalType } = tag | ||
if (qt === 'prep' && q === 'heal') return 'heal' | ||
else if (isDmg(tag)) { | ||
if (elementalType) return elementalType | ||
} | ||
return | ||
} | ||
export function isDmg(tag: Tag) { | ||
const { q } = tag | ||
return q === 'dmg' | ||
} | ||
|
||
export function getDmgType(tag: Tag) { | ||
const { damageType1, damageType2 } = tag | ||
const dmgType: Array<DamageType> = [] | ||
if (!isDmg(tag)) return [] | ||
if (damageType1) dmgType.push(damageType1) | ||
if (damageType2) dmgType.push(damageType2) | ||
return dmgType | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export * from './RelicEditor' | ||
export * from './RelicStatKeyDisplay' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters