Skip to content

Commit

Permalink
Merge pull request #73 from harry0000/feature-1_2_12
Browse files Browse the repository at this point in the history
Update version to 1.2.12: Update unit skill effects & Add rank up
  • Loading branch information
harry0000 authored Jul 8, 2023
2 parents 6aad409 + 85cd5f3 commit f3f6d5d
Show file tree
Hide file tree
Showing 24 changed files with 1,793 additions and 971 deletions.
1,472 changes: 790 additions & 682 deletions package-lock.json

Large diffs are not rendered by default.

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.11",
"version": "1.2.12",
"private": true,
"license": "UNLICENSED",
"author": "harry0000 <https://github.com/harry0000>",
Expand Down
6 changes: 6 additions & 0 deletions src/component/skill/AreaOfEffectCellType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,12 @@ export const AreaOfEffectCells = {
[SkillAreaType.FixedBackLine]: {
area: ['effective', 'none', 'none', 'effective', 'none', 'none', 'effective', 'none', 'none']
},
[SkillAreaType.FixedFrontAndMidLine]: {
area: ['none', 'effective', 'effective', 'none', 'effective', 'effective', 'none', 'effective', 'effective']
},
[SkillAreaType.FixedFrontAndBackLine]: {
area: ['effective', 'none', 'effective', 'effective', 'none', 'effective', 'effective', 'none', 'effective']
},
[SkillAreaType.FixedMidAndBackLine]: {
area: ['effective', 'effective', 'none', 'effective', 'effective', 'none', 'effective', 'effective', 'none']
},
Expand Down
95 changes: 71 additions & 24 deletions src/component/skill/SkillEffectConditionView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,17 @@ import {
ActivationSelfState,
ActivationSquadState,
ActivationTargetState,
ArmoredBulgasari,
DefenderAndArmoredBulgasari,
NumOfUnitsInSquadState,
SelfSkillEffectActivationCondition,
SelfSkillEffectActivationState,
SkillEffectActivationCondition,
SkillEffectActivationState,
TargetSkillEffectActivationCondition,
UnitAliasAndRole
UnitAliasAndRole,
isDefenderAndArmoredBulgasari,
isUnitsInSquadCondition
} from '../../domain/skill/SkillEffectActivationCondition';
import { Effect } from '../../domain/Effect';
import { EffectActivationState } from '../../domain/EffectActivationState';
Expand Down Expand Up @@ -62,8 +66,12 @@ function stateValuesView(
return (<span>{t(`effect:condition.state.${entry[0]}`, entry[1])}</span>);
case EffectActivationState.RankGreaterOrEqual:
return (<span>{t(`effect:condition.state.${entry[0]}`, { rank: entry[1] })}</span>);
case EffectActivationState.Affected:
return (<span>{t(`effect:condition.state.${entry[0]}`, { effect: entry[1] })}</span>);
case EffectActivationState.Affected: {
const effect = entry[1];
return isReadonlyArray(effect) ?
(<span>{t('effect:condition.state.affected_both', { effect: { 0: effect[0], 1: effect[1] } })}</span>) :
(<span>{t(`effect:condition.state.${entry[0]}`, { effect })}</span>);
}
case EffectActivationState.NotAffected: {
const effects = entry[1]
.map(e => t(`effect:effect.name.${e}`))
Expand Down Expand Up @@ -158,6 +166,7 @@ function unitStateView(
UnitNumber |
ReadonlyArray<UnitNumber> |
UnitAliasAndRole<typeof UnitAlias['SteelLine' | 'AACannonier'], typeof UnitRole.Supporter> |
UnitAliasAndRole<typeof UnitAlias['MongooseTeam'], typeof UnitRole.Defender> |
UnitAliasAndRole<typeof UnitAlias.Strikers, typeof UnitRole.Attacker> |
typeof UnitAlias[
'ElectricActive' |
Expand All @@ -174,9 +183,12 @@ function unitStateView(
typeof SkillAreaType.CrossAdjacent |
UnitType |
UnitRole |
ArmoredBulgasari |
DefenderAndArmoredBulgasari |
'golden_factory' |
{ equipment: 'hot_pack', effect: typeof Effect.MinimumIceResistUp } |
{ [EffectActivationState.Tagged]: 'younger_sister' | 'reinforced_exoskeleton' } |
{ equipment: 'hot_pack', effect: typeof Effect.MinimumIceResistUp },
{ [EffectActivationState.AffectedBy]: { unit: 83, effect: typeof Effect.TargetProtect } },
selfUnitNumber: UnitNumber,
t: TFunction
): Exclude<ReactNode, undefined> {
Expand All @@ -189,10 +201,17 @@ function unitStateView(
<span>{t(`effect:condition.state.${key}`, { unit: unitName(state) })}</span>
);
} else if (isReadonlyArray(state)) {
const units = state.map(u => unitName(u)).join(t('effect:unit_separator'));
return (
<span>{t(`effect:condition.state.${key}`, { unit: units })}</span>
);
let unit;
if (isDefenderAndArmoredBulgasari(state)) {
unit = `${t(`effect:unit.${state[0]}`)}${t('effect:unit_separator')}${t(`effect:unit.${state[1]}`)}`;
} else {
const separator =
key === EffectActivationState.NotInSquad ?
t('effect:and_separator') :
t('effect:unit_separator');
unit = state.map(u => unitName(u)).join(separator);
}
return (<span>{t(`effect:condition.state.${key}`, { unit })}</span>);
} else if (typeof state === 'string') {
// TODO: Move excepting logic from view.
const isSquadCond = key === EffectActivationState.InSquad || key === EffectActivationState.NotInSquad;
Expand Down Expand Up @@ -228,13 +247,26 @@ function unitStateView(
{t(`effect:condition.state.${key}`, { unit: '' })}
</React.Fragment>
);
} else if ('equipment' in state) {
return (<span>{t('effect:condition.state.affected_equipment_effect_by', state)}</span>);
} else {
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>);
// only in_squad conditions.
// TODO: Move this logic from view.
if (EffectActivationState.Tagged in state) {
return (
<span>
{t('effect:condition.state.tagged', { tag: state.tagged })}
{t('effect:condition.state.in_squad', { unit: t('effect:unit.ally') })}
</span>
);
} else {
return (
<span>
{t('effect:condition.state.affected_effect_by', state.affected_by)}
{t('effect:condition.state.in_squad', { unit: t('effect:unit.ally') })}
</span>
);
}
}
}

Expand Down Expand Up @@ -276,12 +308,22 @@ const SelfAndTargetStateView: React.FC<{
);
};

type NumOfCrossAdjacent = NumOfUnitsInSquadState['num_of_units'] & { unit: typeof SkillAreaType.CrossAdjacent }
type NumOfCrossAdjacent = Extract<NumOfUnitsInSquadState['num_of_units'], { unit: typeof SkillAreaType.CrossAdjacent }>

function isNumOfCrossAdjacent(arg: NumOfUnitsInSquadState['num_of_units']): arg is NumOfCrossAdjacent {
function isNumOfCrossAdjacent(
arg: NumOfUnitsInSquadState['num_of_units']
): arg is NumOfCrossAdjacent {
return arg.unit === SkillAreaType.CrossAdjacent;
}

type NumOfDefenderAndArmoredBulgasari = Extract<NumOfUnitsInSquadState['num_of_units'], { unit: DefenderAndArmoredBulgasari }>

function isNumOfDefenderAndArmoredBulgasari(
arg: NumOfUnitsInSquadState['num_of_units']
): arg is NumOfDefenderAndArmoredBulgasari {
return isDefenderAndArmoredBulgasari(arg.unit);
}

const SquadStateView: React.FC<{
state: ValueOf<SkillEffectActivationState, 'squad'>,
unitNumber: UnitNumber
Expand All @@ -295,19 +337,22 @@ const SquadStateView: React.FC<{
t('effect:condition.state.cross_adjacent', state) :
t('effect:condition.state.cross_adjacent_ge', state);
};
const numOfDefenderAndArmoredBulgasari = (state: NumOfDefenderAndArmoredBulgasari): string => {
return t('effect:condition.state.num_of_defender_armored_bulgasari', state);
};

if (isReadonlyArray(state)) {
return (
<React.Fragment>
{t('effect:condition.target.squad')}
{
state.length === 2 ?
isUnitsInSquadCondition(state) ?
unitStateView(EffectActivationState.InSquad, state.map(s => s.in_squad), unitNumber, t) :
(<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>)
}
</React.Fragment>
);
Expand Down Expand Up @@ -344,11 +389,13 @@ const SquadStateView: React.FC<{
{
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)
isNumOfDefenderAndArmoredBulgasari(squadState) ?
numOfDefenderAndArmoredBulgasari(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>
Expand Down
6 changes: 5 additions & 1 deletion src/component/skill/SkillEffectTargetView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,11 @@ const SkillEffectTargetView: React.FC<{
<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')}
{'type' in cond ?
t(`effect:unit.${cond.type}`) :
'role' in cond ?
t(`effect:unit.${cond.role}`) :
t('effect:unit.unit')}
{separator}
</React.Fragment>
);
Expand Down
50 changes: 50 additions & 0 deletions src/data/unitRankUpBonusData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,47 @@ export const unitRankUpBonusData = {
spd_up: { microValue: 20000 }
}
},
67: {
ss: {
hp_up: { value: 200 },
atk_up: { milliValue: 100000 },
def_up: { milliValue: 30000 },
cri_up: { milliPercentage: 5000 },
acc_up: { milliPercentage: 10000 }
}
},
69: {
s: {
hp_up: { value: 100 },
atk_up: { milliValue: 50000 },
def_up: { milliValue: 20000 },
acc_up: { milliPercentage: 7000 }
},
ss: {
hp_up: { value: 100 },
atk_up: { milliValue: 50000 },
def_up: { milliValue: 30000 },
acc_up: { milliPercentage: 8000 }
}
},
70: {
s: {
hp_up: { value: 90 },
atk_up: { milliValue: 10000 },
def_up: { milliValue: 5000 },
acc_up: { milliPercentage: 7000 },
eva_up: { milliPercentage: 2000 },
spd_up: { microValue: 30000 }
},
ss: {
hp_up: { value: 90 },
atk_up: { milliValue: 10000 },
def_up: { milliValue: 5000 },
acc_up: { milliPercentage: 8000 },
eva_up: { milliPercentage: 3000 },
spd_up: { microValue: 20000 }
}
},
73: {
ss: {
hp_up: { value: 204 },
Expand Down Expand Up @@ -521,6 +562,15 @@ export const unitRankUpBonusData = {
acc_up: { milliPercentage: 3000 },
eva_up: { milliPercentage: 2500 },
spd_up: { microValue: 30000 }
},
ss: {
hp_up: { value: 160 },
atk_up: { milliValue: 45000 },
def_up: { milliValue: 30000 },
cri_up: { milliPercentage: 4900 },
acc_up: { milliPercentage: 4000 },
eva_up: { milliPercentage: 2500 },
spd_up: { microValue: 20000 }
}
},
82: {
Expand Down
Loading

0 comments on commit f3f6d5d

Please sign in to comment.