Skip to content

Commit

Permalink
Merge branch 'main' into beta
Browse files Browse the repository at this point in the history
  • Loading branch information
fribbels committed Jan 24, 2025
2 parents 07f4ba3 + b66e9a6 commit 728637c
Show file tree
Hide file tree
Showing 12 changed files with 164 additions and 143 deletions.
108 changes: 27 additions & 81 deletions src/lib/conditionals/character/1400/Mydei.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,16 @@ export default (e: Eidolon, withContent: boolean): CharacterConditionalsControll
const basicScaling = basic(e, 0.50, 0.55)

const skillScaling = skill(e, 0.90, 0.99)
const skillEnhancedScaling = skill(e, 1.00, 1.10)
const skillEnhancedLostHpScaling = skill(e, 1.00, 1.10)
const skillEnhanced1Scaling = skill(e, 1.10, 1.21)
const skillEnhanced2Scaling = skill(e, 2.80, 3.08)

const ultScaling = ult(e, 1.60, 1.728)

const defaults = {
skillEnhances: 2,
vendettaState: true,
hpToCrConversion: true,
hpLossTally: 1.80,
e1DefPen: true,
e4CdBuff: true,
e6Buffs: true,
}

const teammateDefaults = {}
Expand All @@ -54,36 +51,13 @@ export default (e: Eidolon, withContent: boolean): CharacterConditionalsControll
text: 'HP to CR conversion',
content: i18next.t('BetaMessage', { ns: 'conditionals', Version: CURRENT_DATA_VERSION }),
},
hpLossTally: {
id: 'hpLossTally',
formItem: 'slider',
text: 'HP loss tally',
content: i18next.t('BetaMessage', { ns: 'conditionals', Version: CURRENT_DATA_VERSION }),
percent: true,
min: 0,
max: 1.80,
},
e1DefPen: {
id: 'e1DefPen',
formItem: 'switch',
text: 'E1 DEF PEN',
content: i18next.t('BetaMessage', { ns: 'conditionals', Version: CURRENT_DATA_VERSION }),
disabled: e < 1,
},
e4CdBuff: {
id: 'e4CdBuff',
formItem: 'switch',
text: 'E4 CD buff',
content: i18next.t('BetaMessage', { ns: 'conditionals', Version: CURRENT_DATA_VERSION }),
disabled: e < 4,
},
e6Buffs: {
id: 'e6Buffs',
formItem: 'switch',
text: 'E6 buffs',
content: i18next.t('BetaMessage', { ns: 'conditionals', Version: CURRENT_DATA_VERSION }),
disabled: e < 6,
},
}

const teammateContent: ContentDefinition<typeof teammateDefaults> = {}
Expand All @@ -98,17 +72,33 @@ export default (e: Eidolon, withContent: boolean): CharacterConditionalsControll

x.BASIC_SCALING.buff(basicScaling, Source.NONE)

x.SKILL_SCALING.buff((r.skillEnhances > 0) ? skillEnhancedScaling : skillScaling, Source.NONE)
x.ULT_SCALING.buff(ultScaling, Source.NONE)
x.SKILL_SCALING.buff((r.skillEnhances == 0) ? skillScaling : 0, Source.NONE)
x.SKILL_SCALING.buff((r.skillEnhances == 1) ? skillEnhanced1Scaling : 0, Source.NONE)
x.SKILL_SCALING.buff((r.skillEnhances == 2) ? skillEnhanced2Scaling : 0, Source.NONE)

x.DEF_PEN.buff((e >= 1 && r.e1DefPen && r.vendettaState) ? 0.12 : 0, Source.NONE)
x.ULT_SCALING.buff(ultScaling, Source.NONE)

x.CD.buff((e >= 4 && r.e4CdBuff) ? 0.30 : 0, Source.NONE)
x.DEF_PEN.buff((e >= 1 && r.e1DefPen && r.vendettaState) ? 0.15 : 0, Source.NONE)

x.BASIC_TOUGHNESS_DMG.buff(30, Source.NONE)
x.SKILL_TOUGHNESS_DMG.buff((r.skillEnhances > 1) ? 90 : 60, Source.NONE)
x.ULT_TOUGHNESS_DMG.buff(60, Source.NONE)
},
calculateBasicEffects: (x: ComputedStatsArray, action: OptimizerAction, context: OptimizerContext) => {
const r = action.characterConditionals as Conditionals<typeof content>

x.CR.buff((r.hpToCrConversion) ? Math.min(0.48, 0.016 * Math.floor((x.c[Stats.HP] - 5000) / 100)) : 0, Source.NONE)
},
gpuCalculateBasicEffects: (action: OptimizerAction, context: OptimizerContext) => {
const r = action.characterConditionals as Conditionals<typeof content>

return `
if (${wgslTrue(r.hpToCrConversion)}) {
let buffValue: f32 = min(0.48, 0.016 * floor((c.HP - 5000) / 100));
x.CR += buffValue;
}
`
},
finalizeCalculations: (x: ComputedStatsArray, action: OptimizerAction, context: OptimizerContext) => {
const r = action.characterConditionals as Conditionals<typeof content>

Expand All @@ -118,7 +108,6 @@ export default (e: Eidolon, withContent: boolean): CharacterConditionalsControll

x.BASIC_DMG.buff(x.a[Key.BASIC_SCALING] * x.a[Key.HP], Source.NONE)
x.SKILL_DMG.buff(x.a[Key.SKILL_SCALING] * x.a[Key.HP], Source.NONE)
x.SKILL_DMG.buff((r.skillEnhances == 2) ? r.hpLossTally * x.a[Key.HP] * skillEnhancedLostHpScaling : 0, Source.NONE)
x.ULT_DMG.buff(x.a[Key.ULT_SCALING] * x.a[Key.HP], Source.NONE)
},
gpuFinalizeCalculations: (action: OptimizerAction, context: OptimizerContext) => {
Expand All @@ -128,9 +117,7 @@ export default (e: Eidolon, withContent: boolean): CharacterConditionalsControll
if (${wgslTrue(r.vendettaState)}) {
x.DEF = 0;
}
if (${wgslTrue(r.skillEnhances == 2)}) {
x.SKILL_DMG += ${r.hpLossTally * skillEnhancedLostHpScaling} * x.HP;
}
x.BASIC_DMG += x.BASIC_SCALING * x.HP;
x.SKILL_DMG += x.SKILL_SCALING * x.HP;
x.ULT_DMG += x.ULT_SCALING * x.HP;
Expand All @@ -152,13 +139,11 @@ x.ULT_DMG += x.ULT_SCALING * x.HP;
return
}

const maxHpConversion = 0.50 + ((e >= 6 && r.e6Buffs) ? 1.00 : 0)

const stateValue = action.conditionalState[this.id] || 0
const convertibleHpValue = x.a[Key.HP] - x.a[Key.RATIO_BASED_HP_BUFF]

const buffHP = maxHpConversion * convertibleHpValue
const stateBuffHP = maxHpConversion * stateValue
const buffHP = 0.50 * convertibleHpValue
const stateBuffHP = 0.50 * stateValue

action.conditionalState[this.id] = x.a[Key.HP]

Expand All @@ -170,8 +155,6 @@ x.ULT_DMG += x.ULT_SCALING * x.HP;
gpu: function (action: OptimizerAction, context: OptimizerContext) {
const r = action.characterConditionals as Conditionals<typeof content>

const maxHpConversion = 0.50 + ((e >= 6 && r.e6Buffs) ? 1.00 : 0)

return conditionalWgslWrapper(this, `
if (${wgslFalse(r.vendettaState)}) {
return;
Expand All @@ -180,52 +163,15 @@ if (${wgslFalse(r.vendettaState)}) {
let stateValue: f32 = (*p_state).MydeiHpConditional;
let convertibleHpValue: f32 = (*p_x).HP - (*p_x).RATIO_BASED_HP_BUFF;
var buffHP: f32 = ${maxHpConversion} * convertibleHpValue;
var stateBuffHP: f32 = ${maxHpConversion} * stateValue;
var buffHP: f32 = ${0.50} * convertibleHpValue;
var stateBuffHP: f32 = ${0.50} * stateValue;
(*p_state).MydeiHpConditional = (*p_x).HP;
let finalBuffHp = buffHP - select(0, stateBuffHP, stateValue > 0);
(*p_x).RATIO_BASED_HP_BUFF += finalBuffHp;
buffNonRatioDynamicHP(finalBuffHp, p_x, p_m, p_state);
`)
},
},
{
id: 'MydeiConversionConditional',
type: ConditionalType.ABILITY,
activation: ConditionalActivation.CONTINUOUS,
dependsOn: [Stats.HP],
condition: function (x: ComputedStatsArray, action: OptimizerAction, context: OptimizerContext) {
const r = action.characterConditionals as Conditionals<typeof content>
return r.hpToCrConversion && x.a[Key.HP] > 5000
},
effect: function (x: ComputedStatsArray, action: OptimizerAction, context: OptimizerContext) {
const stateValue = action.conditionalState[this.id] || 0
const buffValue = Math.min(0.48, 0.016 * Math.floor((x.a[Key.HP] - 5000) / 100))

action.conditionalState[this.id] = buffValue
x.CR.buffDynamic(buffValue - stateValue, Source.NONE, action, context)

return buffValue
},
gpu: function (action: OptimizerAction, context: OptimizerContext) {
const r = action.characterConditionals as Conditionals<typeof content>

return conditionalWgslWrapper(this, `
if (${wgslFalse(r.hpToCrConversion)}) {
return;
}
let hp = (*p_x).HP;
let stateValue: f32 = (*p_state).MydeiConversionConditional;
if (hp > 5000) {
let buffValue: f32 = min(0.48, 0.016 * floor((hp - 5000) / 100));
(*p_state).MydeiConversionConditional = buffValue;
buffDynamicCR(buffValue - stateValue, p_x, p_m, p_state);
}
`)
},
},
Expand Down
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 active',
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
Loading

0 comments on commit 728637c

Please sign in to comment.