Skip to content

Commit

Permalink
Merge pull request #71 from harry0000/feature-1_2_10
Browse files Browse the repository at this point in the history
Update version to 1.2.10: Add Units & Fix bugs
  • Loading branch information
harry0000 authored Jun 2, 2023
2 parents a4e8860 + e99a456 commit c868176
Show file tree
Hide file tree
Showing 23 changed files with 673 additions and 258 deletions.
233 changes: 114 additions & 119 deletions package-lock.json

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "last-origin-unit-viewer",
"version": "1.2.9",
"version": "1.2.10",
"private": true,
"license": "UNLICENSED",
"author": "harry0000 <https://github.com/harry0000>",
Expand Down Expand Up @@ -41,8 +41,8 @@
"dependencies": {
"@emotion/react": "^11.11.0",
"@types/gtag.js": "0.0.12",
"@types/node": "^18.16.13",
"@types/react": "^18.2.6",
"@types/node": "^18.16.16",
"@types/react": "^18.2.7",
"@types/react-dom": "^18.2.4",
"@types/react-router-dom": "^5.3.3",
"@types/recoil": "0.0.9",
Expand All @@ -61,17 +61,17 @@
"react-i18next": "^12.3.1",
"react-router-dom": "^5.3.3",
"react-scripts": "^5.0.1",
"react-virtuoso": "^4.3.7",
"react-virtuoso": "^4.3.8",
"recoil": "^0.7.7"
},
"devDependencies": {
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^14.0.0",
"@testing-library/user-event": "^14.4.3",
"@types/jest": "^29.5.1",
"@typescript-eslint/eslint-plugin": "^5.59.6",
"@typescript-eslint/parser": "^5.59.6",
"eslint": "^8.40.0",
"@types/jest": "^29.5.2",
"@typescript-eslint/eslint-plugin": "^5.59.8",
"@typescript-eslint/parser": "^5.59.8",
"eslint": "^8.41.0",
"eslint-plugin-react": "^7.32.2",
"eslint-plugin-react-hooks": "^4.6.0",
"typescript": "^5.0.4"
Expand Down
Binary file added public/unit_icon/169.webp
Binary file not shown.
Binary file added public/unit_icon/208.webp
Binary file not shown.
128 changes: 71 additions & 57 deletions src/component/skill/SkillEffectConditionView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ function stateValuesView(
case EffectActivationState.HpGreaterThan:
case EffectActivationState.HpLessThan:
return (<span>{t(`effect:condition.state.${entry[0]}`, { value: entry[1] })}</span>);
case EffectActivationState.HpRateGreaterOrEqualThanSelf:
return (<span>{t(`effect:condition.state.${entry[0]}`)}</span>);
case EffectActivationState.StatusGreaterThanSelf:
case EffectActivationState.StatusLessThanSelf:
return (<span>{t(`effect:condition.state.${entry[0]}`, entry[1])}</span>);
Expand Down Expand Up @@ -151,7 +153,7 @@ function unitStateView(key: typeof EffectActivationState.InSquad, state: ValueOf
function unitStateView(key: typeof EffectActivationState.NotInSquad, state: ValueOf<ActivationSquadState, typeof EffectActivationState.NotInSquad> | 41, selfUnitNumber: UnitNumber, t: TFunction): Exclude<ReactNode, undefined>
function unitStateView(key: typeof EffectActivationState.Unit, state: typeof UnitAlias.SteelLine | typeof UnitType.Flying, selfUnitNumber: UnitNumber, t: TFunction): Exclude<ReactNode, undefined>
function unitStateView(
key: typeof EffectActivationState['InSquad' | 'NotInSquad' | 'Unit'],
key: typeof EffectActivationState['InSquad' | 'NotInSquad' | 'Unit' | 'NumOfUnitsLessThanEnemies'],
state:
UnitNumber |
ReadonlyArray<UnitNumber> |
Expand All @@ -164,6 +166,7 @@ function unitStateView(
'SteelLineExcludingOfficerRanks' |
'Horizon' |
'Kunoichi' |
'DEntertainment' |
'KouheiChurch' |
'EmpressHound' |
'Mermaid'
Expand All @@ -172,6 +175,7 @@ function unitStateView(
UnitType |
UnitRole |
'golden_factory' |
{ [EffectActivationState.Tagged]: 'younger_sister' } |
{ equipment: 'hot_pack', effect: typeof Effect.MinimumIceResistUp },
selfUnitNumber: UnitNumber,
t: TFunction
Expand Down Expand Up @@ -225,7 +229,12 @@ function unitStateView(
</React.Fragment>
);
} else {
return (<span>{t('effect:condition.state.affected_equipment_effect_by', state as StringMap)}</span>);
return EffectActivationState.Tagged in state ?
(<span>
{t('effect:condition.state.tagged', { tag: state.tagged })}
{t('effect:condition.state.in_squad', { unit: t('effect:unit.ally') })}
</span>) :
(<span>{t('effect:condition.state.affected_equipment_effect_by', state)}</span>);
}
}

Expand Down Expand Up @@ -287,68 +296,73 @@ const SquadStateView: React.FC<{
t('effect:condition.state.cross_adjacent_ge', state);
};

return (
<React.Fragment>
{t('effect:condition.target.squad')}
{
isReadonlyArray(state) ?
if (isReadonlyArray(state)) {
return (
<React.Fragment>
{t('effect:condition.target.squad')}
{
state.length === 2 ?
(<React.Fragment>
{unitStateView(EffectActivationState.NotInSquad, state[0].not_in_squad, unitNumber, t)}
<span>{t('effect:or_symbolic_separator')}</span>
{unitStateView(EffectActivationState.InSquad, state[1].in_squad, unitNumber, t)}
</React.Fragment>) :
unitStateView(EffectActivationState.InSquad, state.map(s => s.in_squad), unitNumber, t) :
(<React.Fragment>
{
typedEntries(state).map((entry, i, array) => {
const Separator = () => (
<React.Fragment>{ifTruthy(needSeparator(array, i), t('effect:and_symbolic_separator'))}</React.Fragment>
);

switch (entry[0]) {
case EffectActivationState.InSquad:
return (
<React.Fragment key={entry[0]}>
{unitStateView(EffectActivationState.InSquad, entry[1], unitNumber, t)}
<Separator />
</React.Fragment>
);
case EffectActivationState.NotInSquad:
return (
<React.Fragment key={entry[0]}>
{unitStateView(EffectActivationState.NotInSquad, entry[1], unitNumber, t)}
<Separator />
</React.Fragment>
);
case EffectActivationState.NumOfUnits: {
const squadState = entry[1];
return (
<React.Fragment key={entry[0]}>
{
isNumOfCrossAdjacent(squadState) ?
numOfCrossAdjacent(squadState) :
'equal' in squadState ?
t('effect:condition.state.num_of_units_eq', squadState) :
'greater_or_equal' in squadState ?
t('effect:condition.state.num_of_units_ge', squadState as StringMap) :
t('effect:condition.state.num_of_units_le', squadState as StringMap)
}
<Separator />
</React.Fragment>
);
}
default: {
const _exhaustiveCheck: never = entry;
return _exhaustiveCheck;
}
}
})
unitStateView(EffectActivationState.InSquad, state.map(s => s.in_squad), unitNumber, t)
}
</React.Fragment>
);
} else {
return EffectActivationState.NumOfUnitsLessThanEnemies in state ?
(<span>{t(`effect:condition.state.${EffectActivationState.NumOfUnitsLessThanEnemies}`)}</span>) :
(<React.Fragment>
{t('effect:condition.target.squad')}
{
typedEntries(state).map((entry, i, array) => {
const Separator = () => (
<React.Fragment>{ifTruthy(needSeparator(array, i), t('effect:and_symbolic_separator'))}</React.Fragment>
);

switch (entry[0]) {
case EffectActivationState.InSquad:
return (
<React.Fragment key={entry[0]}>
{unitStateView(EffectActivationState.InSquad, entry[1], unitNumber, t)}
<Separator />
</React.Fragment>
);
case EffectActivationState.NotInSquad:
return (
<React.Fragment key={entry[0]}>
{unitStateView(EffectActivationState.NotInSquad, entry[1], unitNumber, t)}
<Separator />
</React.Fragment>
);
case EffectActivationState.NumOfUnits: {
const squadState = entry[1];
return (
<React.Fragment key={entry[0]}>
{
isNumOfCrossAdjacent(squadState) ?
numOfCrossAdjacent(squadState) :
'equal' in squadState ?
t('effect:condition.state.num_of_units_eq', squadState) :
'greater_or_equal' in squadState ?
t('effect:condition.state.num_of_units_ge', squadState as StringMap) :
t('effect:condition.state.num_of_units_le', squadState as StringMap)
}
<Separator />
</React.Fragment>
);
}
</React.Fragment>)
}
</React.Fragment>
);
default: {
const _exhaustiveCheck: never = entry;
return _exhaustiveCheck;
}
}
})
}
</React.Fragment>);
}
};

const EnemyStateView: React.FC<{
Expand Down
14 changes: 14 additions & 0 deletions src/data/unitBasicData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -881,6 +881,13 @@ export const unitBasicData = {
type: 'light',
role: 'supporter'
},
169: {
no: 169,
kind: 'bioroid',
rank: 'ss',
type: 'light',
role: 'attacker'
},
170: {
no: 170,
kind: 'bioroid',
Expand Down Expand Up @@ -1070,6 +1077,13 @@ export const unitBasicData = {
type: 'light',
role: 'attacker'
},
208: {
no: 208,
kind: 'bioroid',
rank: 'ss',
type: 'light',
role: 'supporter'
},
209: {
no: 209,
kind: 'bioroid',
Expand Down
20 changes: 20 additions & 0 deletions src/data/unitCoreLinkBonusData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1344,6 +1344,16 @@ export const unitCoreLinkBonusData: UnitCoreLinkBonusData = {
{ spd_up: { microValue: 100000 } }
]
},
169: {
specific_link_bonus: { cri_up: { milliPercentage: 2000 } },
full_link_bonus: [
{ sortie_cost: { milliPercentage: 25000 } },
{ damage_multiplier: { milliPercentage: 20000 } },
{ range_up: { value: 1 } },
{ cri_up: { milliPercentage: 20000 } },
{ spd_up: { microValue: 100000 } }
]
},
170: {
specific_link_bonus: { acc_up: { milliPercentage: 7000 } },
full_link_bonus: [
Expand Down Expand Up @@ -1664,6 +1674,16 @@ export const unitCoreLinkBonusData: UnitCoreLinkBonusData = {
{ spd_up: { microValue: 100000 } }
]
},
208: {
specific_link_bonus: { spd_up: { microValue: 20000 } },
full_link_bonus: [
{ sortie_cost: { milliPercentage: 25000 } },
{ atk_up: { milliPercentage: 50000 } },
{ acc_up: { milliPercentage: 75000 } },
{ buff_debuff_lv_up: { value: 2 } },
{ spd_up: { microValue: 100000 } }
]
},
209: {
specific_link_bonus: { spd_up: { microValue: 20000 } },
full_link_bonus: [
Expand Down
2 changes: 2 additions & 0 deletions src/data/unitEquipmentSlotData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ export const unitEquipmentSlotData = {
161: { chip1: 60, chip2: 80, os: 40, gear: 20 },
162: { chip1: 60, chip2: 80, os: 40, gear: 20 },
165: { chip1: 40, chip2: 60, os: 80, gear: 20 },
169: { chip1: 60, chip2: 80, os: 40, gear: 20 },
170: { chip1: 40, chip2: 80, os: 60, gear: 20 },
171: { chip1: 20, chip2: 80, os: 60, gear: 40 },
172: { chip1: 20, chip2: 40, os: 60, gear: 80 },
Expand Down Expand Up @@ -165,6 +166,7 @@ export const unitEquipmentSlotData = {
204: { chip1: 20, chip2: 40, os: 60, gear: 80 },
205: { chip1: 40, chip2: 60, os: 80, gear: 20 },
206: { chip1: 40, chip2: 60, os: 80, gear: 20 },
208: { chip1: 20, chip2: 40, os: 60, gear: 80 },
209: { chip1: 20, chip2: 40, os: 60, gear: 80 },
210: { chip1: 20, chip2: 40, os: 60, gear: 80 },
211: { chip1: 20, chip2: 40, os: 60, gear: 80 },
Expand Down
Loading

0 comments on commit c868176

Please sign in to comment.