Skip to content
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

Update version to 1.2.4: Add Brunhild & Update skill effects/rank up #63

Merged
merged 14 commits into from
Mar 26, 2023
Merged
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "last-origin-unit-viewer",
"version": "1.2.3",
"version": "1.2.4",
"private": true,
"license": "UNLICENSED",
"author": "harry0000 <https://github.com/harry0000>",
Expand Down
Binary file added public/unit_icon/246.webp
Binary file not shown.
4 changes: 4 additions & 0 deletions src/component/skill/AreaOfEffectCellType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,10 @@ export const AreaOfEffectCells = {
select: 8,
area: ['none', 'effective', 'none', 'effective', 'effective', 'none', 'effective', 'effective', 'none']
},
[SkillAreaType.LeftSpreadForward]: {
select: 1,
area: ['none', 'none', 'effective', 'none', 'effective', 'effective', 'effective', 'effective', 'effective']
},
[SkillAreaType.LeftSpreadBackward]: {
select: 3,
area: ['effective', 'none', 'none', 'effective', 'effective', 'none', 'effective', 'effective', 'effective']
Expand Down
70 changes: 48 additions & 22 deletions src/component/skill/SkillEffectConditionView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,17 +77,7 @@ function stateValuesView(
case EffectActivationState.NotTagged:
return (<span>{t(`effect:condition.state.${entry[0]}`, { tag: entry[1] })}</span>);
case EffectActivationState.TaggedAffected:
return (
<span>
{t(
`effect:condition.state.${entry[0]}`,
{
tag: entry[1].tag,
effect: entry[1].effects.map(e => t(`effect:effect.name.${e}`)).join(t('effect:and_symbolic_separator'))
}
)}
</span>
);
return (<span>{t(`effect:condition.state.${entry[0]}`, entry[1])}</span>);
case EffectActivationState.Stack:
if ('effect' in entry[1]) {
return t('effect:condition.state.tag_effect_stack_ge', entry[1]);
Expand Down Expand Up @@ -302,17 +292,53 @@ const SquadStateView: React.FC<{
{unitStateView(EffectActivationState.InSquad, state[1].in_squad, unitNumber, t)}
</React.Fragment>) :
unitStateView(EffectActivationState.InSquad, state.map(s => s.in_squad), unitNumber, t) :
'num_of_units' in state ?
isNumOfCrossAdjacent(state.num_of_units) ?
numOfCrossAdjacent(state.num_of_units) :
'equal' in state.num_of_units ?
t('effect:condition.state.num_of_units_eq', state.num_of_units) :
'greater_or_equal' in state.num_of_units ?
t('effect:condition.state.num_of_units_ge', state.num_of_units as StringMap) :
t('effect:condition.state.num_of_units_le', state.num_of_units) :
'not_in_squad' in state ?
unitStateView(EffectActivationState.NotInSquad, state.not_in_squad, unitNumber, t) :
unitStateView(EffectActivationState.InSquad, state.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;
}
}
})
}
</React.Fragment>)
}
</React.Fragment>
);
Expand Down
13 changes: 11 additions & 2 deletions src/component/skill/SkillEffectTargetView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const SkillEffectTargetView: React.FC<{
const except = 'except' in cond ? cond.except : undefined;

return (
<React.Fragment key={cond.alias}>
<React.Fragment key={JSON.stringify(cond)}>
{ifNonNullable(
except,
v => (
Expand All @@ -70,13 +70,22 @@ const SkillEffectTargetView: React.FC<{
);
} else if ('not_alias' in cond) {
return (
<React.Fragment key={cond.not_alias}>
<React.Fragment key={JSON.stringify(cond)}>
<UnitAliasView unitAlias={cond.not_alias} />
{t('effect:negative_form')}
{'type' in cond ? t(`effect:unit.${cond.type}`) : t('effect:unit.unit')}
{separator}
</React.Fragment>
);
} else if ('except' in cond) {
return (
<React.Fragment key={JSON.stringify(cond)}>
{t('effect:with_quotes', { value: t('unit:display', { number: cond.except }) })}
{t('effect:except_preposition')}
{t('effect:unit.unit')}
{separator}
</React.Fragment>
);
} else {
return t(`effect:unit.${cond.type}`) + t(`effect:unit.${cond.role}`) + separator;
}
Expand Down
4 changes: 2 additions & 2 deletions src/component/status/corelink/CoreLinkPlaceholder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { useTranslation } from 'react-i18next';
import { Image } from 'react-bootstrap';
import { CoreLinkSlot } from '../../../state/corelink/UnitCoreLinkState';

const EquipmentPlaceholder: React.FC<{ slot: CoreLinkSlot }> = React.memo(({ slot }) => {
const CoreLinkPlaceholder: React.FC<{ slot: CoreLinkSlot }> = React.memo(({ slot }) => {
const { t } = useTranslation();

return (
Expand All @@ -33,4 +33,4 @@ const EquipmentPlaceholder: React.FC<{ slot: CoreLinkSlot }> = React.memo(({ slo
);
});

export default EquipmentPlaceholder;
export default CoreLinkPlaceholder;
2 changes: 2 additions & 0 deletions src/component/status/corelink/FullLinkBonusDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ const FullLinkBonusLabel: React.FC<{ bonus: FullLinkBonus | undefined }> = ({ bo
label = t('form.full_link_bonus.buff_debuff_lv_up', { value: bonus.buff_debuff_lv_up.value });
} else if ('hp_up' in bonus) {
label = t('form.full_link_bonus.hp_up', { value: calcMilliPercentageValue(bonus.hp_up) });
} else if ('atk_up' in bonus) {
label = t('form.full_link_bonus.atk_up', { value: calcMilliPercentageValue(bonus.atk_up) });
} else if ('def_up' in bonus) {
label = t('form.full_link_bonus.def_up', { value: calcMilliPercentageValue(bonus.def_up) });
} else if ('acc_up' in bonus) {
Expand Down
Loading