Skip to content

Commit

Permalink
Add "for all units" to status effects.
Browse files Browse the repository at this point in the history
GitOrigin-RevId: a5b7fd69cf941d5df94e909e9f9f3a9d1b777b4f
  • Loading branch information
cpojer committed Mar 10, 2025
1 parent f84f489 commit 84793a3
Showing 1 changed file with 28 additions and 3 deletions.
31 changes: 28 additions & 3 deletions hera/ui/SkillDescription.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,13 @@ export const AttackStatusEffect = ({ effect }: { effect: number }) => (
</fbt>
);

const AttackStatusEffectAllUnits = ({ effect }: { effect: number }) => (
<fbt desc="Attack status effect description">
<fbt:param name="attack">{formatEffect(effect)}</fbt:param>% attack for all
units
</fbt>
);

export const UnitAttackLeaderStatusEffect = ({
effect,
}: {
Expand All @@ -169,6 +176,13 @@ export const DefenseStatusEffect = ({ effect }: { effect: number }) => (
</fbt>
);

const DefenseStatusEffectAllUnits = ({ effect }: { effect: number }) => (
<fbt desc="Defense status effect description">
<fbt:param name="defense">{formatEffect(effect)}</fbt:param>% defense for
all units
</fbt>
);

const CostEffect = ({ effect }: { effect: number }) => (
<fbt desc="Unit cost effect description">
<fbt:param name="cost">{formatEffect(effect)}</fbt:param>% unit cost
Expand Down Expand Up @@ -1049,9 +1063,7 @@ export default memo(function SkillDescription({
const unitMovement = getSkillUnitMovement(skill, type);
const unitRange = getUnitRangeForSkill(skill, type);
const healTypes = isPower ? getHealUnitTypes(skill) : null;
const effects = [
attack ? <AttackStatusEffect effect={attack} /> : null,
defense ? <DefenseStatusEffect effect={defense} /> : null,
const additionalEffects = [
unitAttackLeader ? (
<UnitAttackLeaderStatusEffect effect={unitAttackLeader} />
) : null,
Expand Down Expand Up @@ -1094,6 +1106,19 @@ export default memo(function SkillDescription({
cost ? <CostEffect effect={cost} /> : null,
].filter(isPresent);

const effects = (
additionalEffects.length
? [
attack ? <AttackStatusEffectAllUnits effect={attack} /> : null,
defense ? <DefenseStatusEffectAllUnits effect={defense} /> : null,
...additionalEffects,
]
: [
attack ? <AttackStatusEffect effect={attack} /> : null,
defense ? <DefenseStatusEffect effect={defense} /> : null,
]
).filter(isPresent);

const list = [
!isPower && campaignOnly ? (
<div className="paragraph" style={{ color: getColor('red') }}>
Expand Down

0 comments on commit 84793a3

Please sign in to comment.