-
Notifications
You must be signed in to change notification settings - Fork 244
ZO: 2.3 Character sheets #3098
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
priolette
wants to merge
6
commits into
master
Choose a base branch
from
priolette/2.3-sheets
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,465
−369
Open
ZO: 2.3 Character sheets #3098
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
0787c9a
handle hp percent stat in core stats
priolette 2032fd1
fix wengine ui sheets
priolette f98e0e2
manato sheet
priolette 1089c87
lucia sheets
priolette 99d08b2
yidhari sheet
priolette 3e8df16
add soldier 0 anby conditional dmg tags
priolette File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -232,13 +232,15 @@ export const charactersDetailedJSONData = Object.fromEntries( | |
| coreStats: Object.values(raw.ExtraLevel).map( | ||
| ({ Extra }) => | ||
| Object.fromEntries( | ||
| Object.values(Extra).map(({ Name, Value }) => [ | ||
| coreStatMap[Name], | ||
| isPercentStat(coreStatMap[Name]) | ||
| Object.values(Extra).map(({ Name, Value, Format }) => [ | ||
| `${coreStatMap[Name]}${Format.includes('%') && !isPercentStat(coreStatMap[Name]) ? '_' : ''}`, | ||
| Format.includes('%') && !isPercentStat(coreStatMap[Name]) | ||
| ? Value / PERCENT_SCALING | ||
| : coreStatMap[Name] === 'enerRegen' | ||
| ? Value / FLAT_SCALING | ||
| : Value, | ||
| : isPercentStat(coreStatMap[Name]) | ||
| ? Value / PERCENT_SCALING | ||
| : coreStatMap[Name] === 'enerRegen' | ||
| ? Value / FLAT_SCALING | ||
| : Value, | ||
| ]) | ||
|
Comment on lines
+235
to
244
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Somnia: Guard unknown core stat names; compute finalKey once. Current code may crash if Extra.Name isn’t in coreStatMap (isPercentStat(undefined)). Also duplicates percent logic. - Object.values(Extra).map(({ Name, Value, Format }) => [
- `${coreStatMap[Name]}${Format.includes('%') && !isPercentStat(coreStatMap[Name]) ? '_' : ''}`,
- Format.includes('%') && !isPercentStat(coreStatMap[Name])
- ? Value / PERCENT_SCALING
- : isPercentStat(coreStatMap[Name])
- ? Value / PERCENT_SCALING
- : coreStatMap[Name] === 'enerRegen'
- ? Value / FLAT_SCALING
- : Value,
- ])
+ Object.values(Extra)
+ .map(({ Name, Value, Format }) => {
+ const baseKey = coreStatMap[Name]
+ if (!baseKey) return null
+ const percentFmt = Format.includes('%')
+ const finalKey =
+ percentFmt && !isPercentStat(baseKey) ? (baseKey + '_') : baseKey
+ const finalVal =
+ percentFmt || isPercentStat(baseKey)
+ ? Value / PERCENT_SCALING
+ : baseKey === 'enerRegen'
+ ? Value / FLAT_SCALING
+ : Value
+ return [finalKey, finalVal]
+ })
+ .filter((e): e is [string, number] => !!e)🤖 Prompt for AI Agents |
||
| ) as Partial< | ||
| Record<(typeof coreStatMap)[keyof typeof coreStatMap], number> | ||
|
|
||
This file contains hidden or 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,25 +1,132 @@ | ||
| import type { CharacterKey } from '@genshin-optimizer/zzz/consts' | ||
| import { Lucia } from '@genshin-optimizer/zzz/formula' | ||
| import { trans } from '../../util' | ||
| import { createBaseSheet } from '../sheetUtil' | ||
| import { st, trans } from '../../util' | ||
| import { createBaseSheet, fieldForBuff } from '../sheetUtil' | ||
|
|
||
| const key: CharacterKey = 'Lucia' | ||
| // TODO: Cleanup | ||
| // eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
| //@ts-ignore | ||
| // eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
| const [, ch] = trans('char', key) | ||
| // TODO: Cleanup | ||
| // eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
| //@ts-ignore | ||
| // eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
| const cond = Lucia.conditionals | ||
| // TODO: Cleanup | ||
| // eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
| //@ts-ignore | ||
| // eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
| const buff = Lucia.buffs | ||
| const formula = Lucia.formulas | ||
|
|
||
| const sheet = createBaseSheet(key) | ||
| const sheet = createBaseSheet(key, { | ||
| perSkillAbility: { | ||
| special: { | ||
| EXSpecialAttackSymphonyOfTheReaperDaybreak: [ | ||
| { | ||
| type: 'conditional', | ||
| conditional: { | ||
| label: ch('exSpecialCond'), | ||
| metadata: cond.darkbreaker, | ||
| fields: [fieldForBuff(buff.exSpecial_sheerForce)], | ||
| }, | ||
| }, | ||
| { | ||
| type: 'fields', | ||
| fields: [ | ||
| { | ||
| title: ch('harmony.flat_dmg'), | ||
| fieldRef: buff.exSpecial_harmony_dmg_.tag, | ||
| }, | ||
| ], | ||
| }, | ||
| ], | ||
| }, | ||
| chain: { | ||
| UltimateChargeGreatArmor: [ | ||
| { | ||
| type: 'fields', | ||
| fields: [ | ||
| { | ||
| title: st('heal'), | ||
| fieldRef: formula.ult_heal.tag, | ||
| }, | ||
| ], | ||
| }, | ||
| ], | ||
| }, | ||
| }, | ||
| core: [ | ||
| { | ||
| type: 'conditional', | ||
| conditional: { | ||
| label: ch('coreCond.etherVeil'), | ||
| metadata: cond.etherVeil, | ||
| fields: [fieldForBuff(buff.core_hp_)], | ||
| }, | ||
| }, | ||
| { | ||
| type: 'conditional', | ||
| conditional: { | ||
| label: ch('coreCond.dreamersNurseryRhyme'), | ||
| metadata: cond.dreamersNurseryRhyme, | ||
| fields: [fieldForBuff(buff.core_common_dmg_)], | ||
| }, | ||
| }, | ||
| ], | ||
| ability: [ | ||
| { | ||
| type: 'conditional', | ||
| conditional: { | ||
| label: ch('exSpecialCond'), | ||
| metadata: cond.darkbreaker, | ||
| fields: [fieldForBuff(buff.ability_crit_dmg_)], | ||
| }, | ||
| }, | ||
| ], | ||
| m1: [ | ||
| { | ||
| type: 'conditional', | ||
| conditional: { | ||
| label: ch('coreCond.dreamersNurseryRhyme'), | ||
| metadata: cond.dreamersNurseryRhyme, | ||
| fields: [fieldForBuff(buff.m1_resIgn_)], | ||
| }, | ||
| }, | ||
| ], | ||
| m2: [ | ||
| { | ||
| type: 'conditional', | ||
| conditional: { | ||
| label: ch('coreCond.etherVeil'), | ||
| metadata: cond.etherVeil, | ||
| fields: [ | ||
| { | ||
| title: ch('harmony.dmg_'), | ||
| fieldRef: buff.m2_harmony_dmg_.tag, | ||
| }, | ||
| ], | ||
| }, | ||
| }, | ||
| { | ||
| type: 'conditional', | ||
| conditional: { | ||
| label: ch('exSpecialCond'), | ||
| metadata: cond.darkbreaker, | ||
| fields: [fieldForBuff(buff.m2_sheer_dmg_)], | ||
| }, | ||
| }, | ||
| ], | ||
| m6: [ | ||
| { | ||
| type: 'conditional', | ||
| conditional: { | ||
| label: ch('coreCond.etherVeil'), | ||
| metadata: cond.etherVeil, | ||
| fields: [ | ||
| fieldForBuff(buff.m6_atk_), | ||
| { | ||
| title: ch('harmony.crit_'), | ||
| fieldRef: buff.m6_harmony_crit_.tag, | ||
| }, | ||
| { | ||
| title: ch('harmony.crit_dmg_'), | ||
| fieldRef: buff.m6_harmony_crit_dmg_.tag, | ||
| }, | ||
| ], | ||
| }, | ||
| }, | ||
| ], | ||
| }) | ||
|
|
||
| export default sheet |
This file contains hidden or 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,25 +1,81 @@ | ||
| import type { CharacterKey } from '@genshin-optimizer/zzz/consts' | ||
| import { Manato } from '@genshin-optimizer/zzz/formula' | ||
| import { trans } from '../../util' | ||
| import { createBaseSheet } from '../sheetUtil' | ||
| import { st, trans } from '../../util' | ||
| import { createBaseSheet, fieldForBuff } from '../sheetUtil' | ||
|
|
||
| const key: CharacterKey = 'Manato' | ||
| // TODO: Cleanup | ||
| // eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
| //@ts-ignore | ||
| // eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
| const [, ch] = trans('char', key) | ||
| // TODO: Cleanup | ||
| // eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
| //@ts-ignore | ||
| // eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
| const cond = Manato.conditionals | ||
| // TODO: Cleanup | ||
| // eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
| //@ts-ignore | ||
| // eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
| const buff = Manato.buffs | ||
|
|
||
| const sheet = createBaseSheet(key) | ||
| const sheet = createBaseSheet(key, { | ||
| core: [ | ||
| { | ||
| type: 'fields', | ||
| fields: [fieldForBuff(buff.core_hpSheerForce)], | ||
| }, | ||
| { | ||
| type: 'conditional', | ||
| conditional: { | ||
| label: ch('coreCond.consumingHp'), | ||
| metadata: cond.consumingHp_consecutiveStrikes, | ||
| fields: [ | ||
| fieldForBuff(buff.core_basic_crit_dmg_), | ||
| fieldForBuff(buff.core_assistFollowUp_crit_dmg_), | ||
| ], | ||
| }, | ||
| }, | ||
| { | ||
| type: 'conditional', | ||
| conditional: { | ||
| label: ch('coreCond.moltenEdge'), | ||
| metadata: cond.moltenEdge, | ||
| fields: [ | ||
| fieldForBuff(buff.core_crit_), | ||
| fieldForBuff(buff.core_fire_dmg_), | ||
| ], | ||
| }, | ||
| }, | ||
| ], | ||
| m1: [ | ||
| { | ||
| type: 'conditional', | ||
| conditional: { | ||
| label: ch('m1Cond'), | ||
| metadata: cond.hpTallied, | ||
| fields: [ | ||
| fieldForBuff(buff.m1_assistFollowUp_fire_dmg_), | ||
| fieldForBuff(buff.m1_basic_fire_dmg_), | ||
| ], | ||
| }, | ||
| }, | ||
| ], | ||
| m2: [ | ||
| { | ||
| type: 'conditional', | ||
| conditional: { | ||
| label: ch('coreCond.moltenEdge'), | ||
| metadata: cond.moltenEdge, | ||
| fields: [fieldForBuff(buff.m2_fire_resIgn_)], | ||
| }, | ||
| }, | ||
| ], | ||
| m4: [ | ||
| { | ||
| type: 'fields', | ||
| fields: [fieldForBuff(buff.m4_hp_)], | ||
| }, | ||
| ], | ||
| m6: [ | ||
| { | ||
| type: 'conditional', | ||
| conditional: { | ||
| label: st('uponHit.1', { val1: '$t(skills.assistFollowUp)' }), | ||
| metadata: cond.assistFollowUpHitsEnemy, | ||
| fields: [fieldForBuff(buff.m6_fire_dmg_)], | ||
| }, | ||
| }, | ||
| ], | ||
| }) | ||
|
|
||
| export default sheet |
This file contains hidden or 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,25 +1,97 @@ | ||
| import type { CharacterKey } from '@genshin-optimizer/zzz/consts' | ||
| import { Yidhari } from '@genshin-optimizer/zzz/formula' | ||
| import { trans } from '../../util' | ||
| import { createBaseSheet } from '../sheetUtil' | ||
| import { st, trans } from '../../util' | ||
| import { createBaseSheet, fieldForBuff } from '../sheetUtil' | ||
|
|
||
| const key: CharacterKey = 'Yidhari' | ||
| // TODO: Cleanup | ||
| // eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
| //@ts-ignore | ||
| // eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
| const [, ch] = trans('char', key) | ||
| // TODO: Cleanup | ||
| // eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
| //@ts-ignore | ||
| // eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
| const cond = Yidhari.conditionals | ||
| // TODO: Cleanup | ||
| // eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
| //@ts-ignore | ||
| // eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
| const buff = Yidhari.buffs | ||
| const formula = Yidhari.formulas | ||
|
|
||
| const sheet = createBaseSheet(key) | ||
| const sheet = createBaseSheet(key, { | ||
| perSkillAbility: { | ||
| chain: { | ||
| EtherVeilWellspring: [ | ||
| { | ||
| type: 'conditional', | ||
| conditional: { | ||
| label: ch('etherVeilCond'), | ||
| metadata: cond.etherVeil, | ||
| fields: [fieldForBuff(buff.etherVeil_hp_)], | ||
| }, | ||
| }, | ||
| ], | ||
| }, | ||
| }, | ||
| core: [ | ||
| { | ||
| type: 'fields', | ||
| fields: [fieldForBuff(buff.core_hpSheerForce)], | ||
| }, | ||
| { | ||
| type: 'conditional', | ||
| conditional: { | ||
| label: ch('coreCond'), | ||
| metadata: cond.missingHp, | ||
| fields: [fieldForBuff(buff.core_common_dmg_)], | ||
| }, | ||
| }, | ||
| ], | ||
| ability: [ | ||
| { | ||
| type: 'conditional', | ||
| conditional: { | ||
| label: ch('coreCond'), | ||
| metadata: cond.missingHp, | ||
| fields: [fieldForBuff(buff.ability_crit_dmg_)], | ||
| }, | ||
| }, | ||
| ], | ||
| m1: [ | ||
| { | ||
| type: 'fields', | ||
| fields: [ | ||
| fieldForBuff(buff.m1_basic_ice_resIgn_), | ||
| fieldForBuff(buff.m1_exSpecial_ice_resIgn_), | ||
| ], | ||
| }, | ||
| ], | ||
| m2: [ | ||
| { | ||
| type: 'fields', | ||
| fields: [fieldForBuff(buff.m2_crit_dmg_)], | ||
| }, | ||
| ], | ||
| m4: [ | ||
| { | ||
| type: 'conditional', | ||
| conditional: { | ||
| label: ch('etherVeilCond'), | ||
| metadata: cond.etherVeil, | ||
| fields: [fieldForBuff(buff.m4_hp_)], | ||
| }, | ||
| }, | ||
| ], | ||
| m6: [ | ||
| { | ||
| type: 'conditional', | ||
| conditional: { | ||
| label: ch('eruditionCond'), | ||
| metadata: cond.erudition, | ||
| fields: [fieldForBuff(buff.m6_sheer_dmg_)], | ||
| }, | ||
| }, | ||
| { | ||
| type: 'fields', | ||
| fields: [ | ||
| { | ||
| title: st('heal'), | ||
| fieldRef: formula.m6_heal.tag, | ||
| }, | ||
| ], | ||
| }, | ||
| ], | ||
| }) | ||
|
|
||
| export default sheet |
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably time to expand this to a proper block of code with variable names and if statements