Skip to content

Commit

Permalink
feat: 3.1v3 updates
Browse files Browse the repository at this point in the history
  • Loading branch information
fribbels committed Jan 24, 2025
1 parent 0490a5c commit f93c9f4
Show file tree
Hide file tree
Showing 7 changed files with 85 additions and 59 deletions.
38 changes: 19 additions & 19 deletions src/lib/conditionals/character/1400/Tribbie.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@ export default (e: Eidolon, withContent: boolean): CharacterConditionalsControll
ultZone: true,
alliesMaxHp: 25000,
talentFuaStacks: 3,
e1AdditionalDmg: true,
e2TrueDmg: true,
e4DefPen: true,
e1TrueDmg: true,
e2DefPen: true,
e4AdditionalDmg: true,
e6FuaScaling: true,
}

const teammateDefaults = {
numinosity: true,
ultZone: true,
e2TrueDmg: true,
e4DefPen: true,
e1TrueDmg: true,
e2DefPen: true,
}

const content: ContentDefinition<typeof defaults> = {
Expand Down Expand Up @@ -68,24 +68,24 @@ export default (e: Eidolon, withContent: boolean): CharacterConditionalsControll
min: 0,
max: 3,
},
e1AdditionalDmg: {
id: 'e1AdditionalDmg',
e1TrueDmg: {
id: 'e1TrueDmg',
formItem: 'switch',
text: 'E1 Additional DMG',
text: 'E1 True DMG',
content: i18next.t('BetaMessage', { ns: 'conditionals', Version: CURRENT_DATA_VERSION }),
disabled: e < 1,
},
e2TrueDmg: {
id: 'e2TrueDmg',
e2DefPen: {
id: 'e2DefPen',
formItem: 'switch',
text: 'E2 True DMG',
text: 'E2 DEF PEN',
content: i18next.t('BetaMessage', { ns: 'conditionals', Version: CURRENT_DATA_VERSION }),
disabled: e < 2,
},
e4DefPen: {
id: 'e4DefPen',
e4AdditionalDmg: {
id: 'e4AdditionalDmg',
formItem: 'switch',
text: 'E4 DEF PEN',
text: 'E4 Additional DMG',
content: i18next.t('BetaMessage', { ns: 'conditionals', Version: CURRENT_DATA_VERSION }),
disabled: e < 4,
},
Expand All @@ -101,8 +101,8 @@ export default (e: Eidolon, withContent: boolean): CharacterConditionalsControll
const teammateContent: ContentDefinition<typeof teammateDefaults> = {
numinosity: content.numinosity,
ultZone: content.ultZone,
e2TrueDmg: content.e2TrueDmg,
e4DefPen: content.e4DefPen,
e1TrueDmg: content.e1TrueDmg,
e2DefPen: content.e2DefPen,
}

return {
Expand All @@ -118,7 +118,7 @@ export default (e: Eidolon, withContent: boolean): CharacterConditionalsControll
x.FUA_SCALING.buff(talentScaling, Source.NONE)

const additionalScaling = (r.ultZone ? ultAdditionalDmgScaling : 0)
* ((e >= 1 && r.e1AdditionalDmg) ? 1.20 * 2 : 1)
* ((e >= 4 && r.e4AdditionalDmg) ? 1.20 * 2 : 1)
x.BASIC_ADDITIONAL_DMG_SCALING.buff(additionalScaling, Source.NONE)
x.ULT_ADDITIONAL_DMG_SCALING.buff(additionalScaling, Source.NONE)
x.FUA_ADDITIONAL_DMG_SCALING.buff(additionalScaling, Source.NONE)
Expand All @@ -139,9 +139,9 @@ export default (e: Eidolon, withContent: boolean): CharacterConditionalsControll
x.RES_PEN.buffTeam((m.numinosity ? skillResPen : 0), Source.NONE)
x.VULNERABILITY.buffTeam((m.ultZone ? ultVulnerability : 0), Source.NONE)

x.TRUE_DMG_MODIFIER.buffTeam((e >= 2 && m.ultZone && m.e2TrueDmg ? 0.24 : 0), Source.NONE)
x.TRUE_DMG_MODIFIER.buffTeam((e >= 1 && m.ultZone && m.e1TrueDmg ? 0.24 : 0), Source.NONE)

x.DEF_PEN.buffTeam((e >= 4 && m.numinosity && m.e4DefPen) ? 0.18 : 0, Source.NONE)
x.DEF_PEN.buffTeam((e >= 2 && m.numinosity && m.e2DefPen) ? 0.18 : 0, Source.NONE)
},
finalizeCalculations: (x: ComputedStatsArray, action: OptimizerAction, context: OptimizerContext) => {
x.BASIC_DMG.buff(x.a[Key.BASIC_SCALING] * x.a[Key.HP], Source.NONE)
Expand Down
20 changes: 9 additions & 11 deletions src/lib/conditionals/lightcone/5star/IfTimeWereAFlower.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,28 @@ import { OptimizerAction, OptimizerContext } from 'types/optimizer'
export default (s: SuperImpositionLevel, withContent: boolean): LightConeConditionalsController => {
// const t = TsUtils.wrappedFixedT(withContent).get(null, 'conditionals', 'Lightcones.IntotheUnreachableVeil')

const sValuesCd = [0.01, 0.0125, 0.015, 0.0175, 0.02]
const sValuesCd = [0.48, 0.60, 0.72, 0.84, 0.96]

const defaults = {
presageStacks: 60,
presage: true,
}

const teammateDefaults = {
presageStacks: 60,
presage: true,
}

const content: ContentDefinition<typeof defaults> = {
presageStacks: {
presage: {
lc: true,
id: 'presageStacks',
formItem: 'slider',
text: 'Presage stacks',
id: 'presage',
formItem: 'switch',
text: 'Presage',
content: i18next.t('BetaMessage', { ns: 'conditionals', Version: CURRENT_DATA_VERSION }),
min: 0,
max: 60,
},
}

const teammateContent: ContentDefinition<typeof teammateDefaults> = {
presageStacks: content.presageStacks,
presage: content.presage,
}

return {
Expand All @@ -45,7 +43,7 @@ export default (s: SuperImpositionLevel, withContent: boolean): LightConeConditi
precomputeMutualEffects: (x: ComputedStatsArray, action: OptimizerAction, context: OptimizerContext) => {
const m = action.lightConeConditionals as Conditionals<typeof teammateContent>

x.CD.buffTeam(m.presageStacks * sValuesCd[s], Source.NONE)
x.CD.buffTeam((m.presage) ? sValuesCd[s] : 0, Source.NONE)
},
finalizeCalculations: () => {
},
Expand Down
2 changes: 1 addition & 1 deletion src/lib/constants/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import gameData from 'data/game_data.json'
export const CURRENT_OPTIMIZER_VERSION = 'v3.1.1'
// Represents the beta data content version, used for display but not for update notifications

export const CURRENT_DATA_VERSION = '3.1v1'
export const CURRENT_DATA_VERSION = '3.1v3'

export const Stats = {
ATK_P: 'ATK%',
Expand Down
57 changes: 43 additions & 14 deletions src/lib/gpu/conditionals/setConditionals.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ADDITIONAL_DMG_TYPE, BASIC_DMG_TYPE, BREAK_DMG_TYPE, FUA_DMG_TYPE, SKILL_DMG_TYPE, SUPER_BREAK_DMG_TYPE, ULT_DMG_TYPE } from 'lib/conditionals/conditionalConstants'
import { BASIC_DMG_TYPE, BREAK_DMG_TYPE, FUA_DMG_TYPE, SKILL_DMG_TYPE, SUPER_BREAK_DMG_TYPE, ULT_DMG_TYPE } from 'lib/conditionals/conditionalConstants'
import { ConditionalActivation, ConditionalType, Stats } from 'lib/constants/constants'
import { conditionalWgslWrapper, DynamicConditional } from 'lib/gpu/conditionals/dynamicConditionals'
import { buffAbilityDefPen, buffAbilityDmg } from 'lib/optimization/calculateBuffs'
Expand Down Expand Up @@ -349,27 +349,55 @@ if (
},
}

export const GiantTreeOfRaptBroodingConditional: DynamicConditional = {
id: 'GiantTreeOfRaptBroodingConditional',
export const GiantTreeOfRaptBrooding135Conditional: DynamicConditional = {
id: 'GiantTreeOfRaptBrooding135Conditional',
type: ConditionalType.SET,
activation: ConditionalActivation.SINGLE,
dependsOn: [Stats.CR],
dependsOn: [Stats.SPD],
condition: function (x: ComputedStatsArray, action: OptimizerAction, context: OptimizerContext) {
return p2(x.c.sets.GiantTreeOfRaptBrooding) && x.a[Key.CR] >= 0.70
return p2(x.c.sets.GiantTreeOfRaptBrooding) && x.a[Key.SPD] >= 135
},
effect: (x: ComputedStatsArray, action: OptimizerAction, context: OptimizerContext) => {
buffAbilityDmg(x, ADDITIONAL_DMG_TYPE, 0.30, Source.GiantTreeOfRaptBrooding)
x.OHB.buffDynamic(0.12, Source.GiantTreeOfRaptBrooding, action, context)
},
gpu: function () {
return conditionalWgslWrapper(this, `
if (
p2((*p_x).sets.GiantTreeOfRaptBrooding) >= 1 &&
(*p_state).GiantTreeOfRaptBroodingConditional == 0.0 &&
(*p_x).CR >= 0.70
(*p_state).GiantTreeOfRaptBrooding135Conditional == 0.0 &&
(*p_x).SPD >= 135
) {
(*p_state).GiantTreeOfRaptBrooding135Conditional = 1.0;
buffMemoNonDynamicOHB(0.12, p_x, p_m, p_state);
buffNonDynamicOHB(0.12, p_x, p_m, p_state);
}
`)
},
}

export const GiantTreeOfRaptBrooding180Conditional: DynamicConditional = {
id: 'GiantTreeOfRaptBrooding180Conditional',
type: ConditionalType.SET,
activation: ConditionalActivation.SINGLE,
dependsOn: [Stats.SPD],
condition: function (x: ComputedStatsArray, action: OptimizerAction, context: OptimizerContext) {
return p2(x.c.sets.GiantTreeOfRaptBrooding) && x.a[Key.SPD] >= 180
},
effect: (x: ComputedStatsArray, action: OptimizerAction, context: OptimizerContext) => {
x.OHB.buffDynamic(0.08, Source.GiantTreeOfRaptBrooding, action, context)
},
gpu: function () {
return conditionalWgslWrapper(this, `
if (
p2((*p_x).sets.GiantTreeOfRaptBrooding) >= 1 &&
(*p_state).GiantTreeOfRaptBrooding180Conditional == 0.0 &&
(*p_x).SPD >= 180
) {
(*p_state).GiantTreeOfRaptBroodingConditional = 1.0;
(*p_state).GiantTreeOfRaptBrooding180Conditional = 1.0;
buffAbilityDmg(p_x, ADDITIONAL_DMG_TYPE, 0.30, 1);
buffMemoNonDynamicOHB(0.08, p_x, p_m, p_state);
buffNonDynamicOHB(0.08, p_x, p_m, p_state);
}
`)
},
Expand All @@ -384,7 +412,7 @@ export const BoneCollectionsSereneDemesneConditional: DynamicConditional = {
return p2(x.c.sets.BoneCollectionsSereneDemesne) && x.a[Key.HP] >= 5000
},
effect: (x: ComputedStatsArray, action: OptimizerAction, context: OptimizerContext) => {
x.CD.buffDual(0.25, Source.BoneCollectionsSereneDemesne)
x.CD.buffDual(0.28, Source.BoneCollectionsSereneDemesne)
},
gpu: function () {
return conditionalWgslWrapper(this, `
Expand All @@ -395,8 +423,8 @@ if (
) {
(*p_state).BoneCollectionsSereneDemesneConditional = 1.0;
buffMemoDynamicCD(0.25, p_x, p_m, p_state);
buffDynamicCD(0.25, p_x, p_m, p_state);
buffMemoDynamicCD(0.28, p_x, p_m, p_state);
buffDynamicCD(0.28, p_x, p_m, p_state);
}
`)
},
Expand All @@ -416,6 +444,7 @@ export const ConditionalSets = [
TaliaKingdomOfBanditryConditional,
FirmamentFrontlineGlamoth135Conditional,
FirmamentFrontlineGlamoth160Conditional,
GiantTreeOfRaptBroodingConditional,
GiantTreeOfRaptBrooding135Conditional,
GiantTreeOfRaptBrooding180Conditional,
BoneCollectionsSereneDemesneConditional,
]
6 changes: 3 additions & 3 deletions src/lib/gpu/wgsl/computeShader.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,8 @@ fn main(
0.06 * p2(sets.ForgeOfTheKalpagniLantern) +
0.06 * p4(sets.MusketeerOfWildWheat) +
0.06 * p2(sets.SacerdosRelivedOrdeal) -
0.08 * p4(sets.PoetOfMourningCollapse)
0.08 * p4(sets.PoetOfMourningCollapse) +
0.06 * p2(sets.GiantTreeOfRaptBrooding)
);

c.HP += (baseHP) * (
Expand Down Expand Up @@ -290,8 +291,7 @@ fn main(
0.04 * p4(sets.PioneerDiverOfDeadWaters) +
0.04 * p2(sets.SigoniaTheUnclaimedDesolation) +
0.06 * p4(sets.TheWindSoaringValorous) +
0.08 * p2(sets.ScholarLostInErudition) +
0.08 * p2(sets.GiantTreeOfRaptBrooding)
0.08 * p2(sets.ScholarLostInErudition)
);

c.CD += (
Expand Down
13 changes: 7 additions & 6 deletions src/lib/optimization/calculateStats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import {
CelestialDifferentiatorConditional,
FirmamentFrontlineGlamoth135Conditional,
FirmamentFrontlineGlamoth160Conditional,
FleetOfTheAgelessConditional,
GiantTreeOfRaptBroodingConditional,
FleetOfTheAgelessConditional, GiantTreeOfRaptBrooding135Conditional,
GiantTreeOfRaptBrooding180Conditional,
InertSalsottoConditional,
IronCavalryAgainstTheScourge150Conditional,
IronCavalryAgainstTheScourge250Conditional,
Expand Down Expand Up @@ -120,7 +120,8 @@ export function calculateBaseStats(c: BasicStatsObject, context: OptimizerContex
+ 0.06 * p2(sets.ForgeOfTheKalpagniLantern)
+ 0.06 * p4(sets.MusketeerOfWildWheat)
+ 0.06 * p2(sets.SacerdosRelivedOrdeal)
- 0.08 * p4(sets.PoetOfMourningCollapse),
- 0.08 * p4(sets.PoetOfMourningCollapse)
+ 0.06 * p2(sets.GiantTreeOfRaptBrooding),
)

c[Stats.HP] = sumFlatStat(Stats.HP, Stats.HP_P, context.baseHP, lc, trace, c,
Expand Down Expand Up @@ -150,8 +151,7 @@ export function calculateBaseStats(c: BasicStatsObject, context: OptimizerContex
+ 0.04 * p4(sets.PioneerDiverOfDeadWaters)
+ 0.04 * p2(sets.SigoniaTheUnclaimedDesolation)
+ 0.06 * p4(sets.TheWindSoaringValorous)
+ 0.08 * p2(sets.ScholarLostInErudition)
+ 0.08 * p2(sets.GiantTreeOfRaptBrooding),
+ 0.08 * p2(sets.ScholarLostInErudition),
)

c[Stats.CD] = sumPercentStat(Stats.CD, base, lc, trace, c,
Expand Down Expand Up @@ -395,7 +395,8 @@ export function calculateComputedStats(x: ComputedStatsArray, action: OptimizerA
p2(sets.FirmamentFrontlineGlamoth) && evaluateConditional(FirmamentFrontlineGlamoth135Conditional, x, action, context)
p2(sets.FirmamentFrontlineGlamoth) && evaluateConditional(FirmamentFrontlineGlamoth160Conditional, x, action, context)
p2(sets.BoneCollectionsSereneDemesne) && evaluateConditional(BoneCollectionsSereneDemesneConditional, x, action, context)
p2(sets.GiantTreeOfRaptBrooding) && evaluateConditional(GiantTreeOfRaptBroodingConditional, x, action, context)
p2(sets.GiantTreeOfRaptBrooding) && evaluateConditional(GiantTreeOfRaptBrooding135Conditional, x, action, context)
p2(sets.GiantTreeOfRaptBrooding) && evaluateConditional(GiantTreeOfRaptBrooding180Conditional, x, action, context)

for (const conditional of context.characterConditionalController.dynamicConditionals ?? []) {
evaluateConditional(conditional, x, action, context)
Expand Down
8 changes: 3 additions & 5 deletions src/lib/state/metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7097,7 +7097,7 @@ function getScoringMetadata(): Record<string, ScoringMetadata> {
[Stats.DEF_P]: 0,
[Stats.HP]: 0.75,
[Stats.HP_P]: 0.75,
[Stats.SPD]: 1,
[Stats.SPD]: 0,
[Stats.CR]: 1,
[Stats.CD]: 1,
[Stats.EHR]: 0,
Expand Down Expand Up @@ -7166,13 +7166,11 @@ function getScoringMetadata(): Record<string, ScoringMetadata> {
comboBreak: 0,
errRopeEidolon: 0,
relicSets: [
[Sets.LongevousDisciple, Sets.LongevousDisciple],
[Sets.PoetOfMourningCollapse, Sets.PoetOfMourningCollapse],
[Sets.GeniusOfBrilliantStars, Sets.GeniusOfBrilliantStars],
...SPREAD_RELICS_2P_GENERAL_CONDITIONALS,
],
ornamentSets: [
Sets.GiantTreeOfRaptBrooding,
Sets.InertSalsotto,
Sets.BoneCollectionsSereneDemesne,
...SPREAD_ORNAMENTS_2P_FUA,
...SPREAD_ORNAMENTS_2P_GENERAL_CONDITIONALS,
Expand Down Expand Up @@ -7274,8 +7272,8 @@ function getScoringMetadata(): Record<string, ScoringMetadata> {
comboDot: 0,
comboBreak: 0,
relicSets: [
[Sets.LongevousDisciple, Sets.LongevousDisciple],
[Sets.ScholarLostInErudition, Sets.ScholarLostInErudition],
[Sets.LongevousDisciple, Sets.LongevousDisciple],
[Sets.WastelanderOfBanditryDesert, Sets.WastelanderOfBanditryDesert],
...SPREAD_RELICS_2P_GENERAL_CONDITIONALS,
],
Expand Down

0 comments on commit f93c9f4

Please sign in to comment.