OrianaVenture / VentureValheim

Mods for Valheim
MIT License
4 stars 4 forks source link

progression: add support for multiple guardian powers #34

Closed nbusseneau closed 3 months ago

nbusseneau commented 3 months ago

Internally, we rely on the player's m_guardianPower (resp. a boss trophy's m_guardianPower.name) for the LockGuardianPower functionality to block or allow using (resp. grabbing) a guardian power.

In most cases, this will be a single power, e.g. GP_Eikthyr, however some mods (such as Passive Powers) allow for multiple powers to be used / grabbed by setting this to a comma-separated string list, e.g. GP_Eikthyr,GP_TheElder.

We add support for this use case by checking against all of the keys associated with all powers in the guardian power string, and only allow if all are unlocked.

Since this is a bit more complex that the previous system, we additionally add tests ensuring it behaves as intended, which required adding some more configurability to KeyManager and TestKeyManager.