Heroes & Experts

Hero widgets

The Widgets that each level of a hero's exclusive weapon costs. Use it to total the Widgets for a weapon range. The same table applies to every hero that has an exclusive weapon.


Type

HeroWidgetLevel

FieldTypeDescription
idstringStable identifier, such as level-1
namestringDisplay name, such as Level 1
levelnumberExclusive weapon level from 1 to 10
widgetsnumberWidgets needed to reach this level from the previous one

Factory

import { heroWidgets } from 'whiteout-survival-data'

heroWidgets() // all 10 levels
heroWidgets(source) // wrap a pre-filtered array

Filters

MethodSignatureDescription
byLevelbyLevel(level: number)The row for exclusive weapon level level

Terminal methods

MethodReturnsDescription
.get()HeroWidgetLevel[]All results
.first()HeroWidgetLevel | undefinedFirst result
.find(id)HeroWidgetLevel | undefinedFind by id
.findByName(name)HeroWidgetLevel | undefinedCase-insensitive exact name match
.search(query)HeroWidgetLevel[]Case-insensitive partial name match
.count()numberNumber of results

Examples

import { heroWidgets } from 'whiteout-survival-data'

const levelTen = heroWidgets().byLevel(10).first()
levelTen?.widgets // 50

const totalWidgets = heroWidgets()
  .get()
  .reduce((sum, row) => sum + row.widgets, 0)
totalWidgets // 275

Notes

The table has 10 rows, one for each exclusive weapon level from 1 to 10. The cost is 5 Widgets for level 1 and rises by 5 for each level to 50 for level 10, 275 in all.

There is no Widget item in Items yet, so widgets is a plain number and not an item cost.

Only a hero with an exclusiveWeapon has weapon levels, and the weapon skills unlock at the unlockLevel values on that weapon. See Heroes.


Next steps

Previous
Heroes