Skip to content

Commit

Permalink
Skills with unit unlocks make it more likely to spawn with that type …
Browse files Browse the repository at this point in the history
…of unit.

GitOrigin-RevId: 582aaa648b95fd28f1f0937fe0fbc7393db866ec
  • Loading branch information
cpojer committed Feb 28, 2025
1 parent 9172fbb commit bdffb4e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions athena/info/Skill.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -988,6 +988,18 @@ export function hasUnlockedBuilding(
return false;
}

export function getUnlockedUnitIDs(skills: ReadonlySet<Skill>) {
const unlockedUnits = new Set<ID>();
for (const skill of skills) {
for (const [unit, skills] of unitCosts) {
if (new Set(skills.keys()).has(skill)) {
unlockedUnits.add(unit);
}
}
}
return unlockedUnits;
}

export function hasUnlockedUnit(unit: UnitInfo, skills: ReadonlySet<Skill>) {
if (skills.size === 0) {
return false;
Expand Down

0 comments on commit bdffb4e

Please sign in to comment.