Skip to content

Commit bdffb4e

Browse files
committed
Skills with unit unlocks make it more likely to spawn with that type of unit.
GitOrigin-RevId: 582aaa648b95fd28f1f0937fe0fbc7393db866ec
1 parent 9172fbb commit bdffb4e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

athena/info/Skill.tsx

+12
Original file line numberDiff line numberDiff line change
@@ -988,6 +988,18 @@ export function hasUnlockedBuilding(
988988
return false;
989989
}
990990

991+
export function getUnlockedUnitIDs(skills: ReadonlySet<Skill>) {
992+
const unlockedUnits = new Set<ID>();
993+
for (const skill of skills) {
994+
for (const [unit, skills] of unitCosts) {
995+
if (new Set(skills.keys()).has(skill)) {
996+
unlockedUnits.add(unit);
997+
}
998+
}
999+
}
1000+
return unlockedUnits;
1001+
}
1002+
9911003
export function hasUnlockedUnit(unit: UnitInfo, skills: ReadonlySet<Skill>) {
9921004
if (skills.size === 0) {
9931005
return false;

0 commit comments

Comments
 (0)