Kitteh6660 / Corruption-of-Champions-Mod

CoC source from fenoxo, modded by Kitteh6660
232 stars 97 forks source link

Implemented createPerkIfNotHasPerk #1319

Closed Stadler76 closed 6 years ago

Stadler76 commented 6 years ago

Implemented createPerkIfNotHasPerk to shorten code, like:

if (player.findPerk(PerkLib.Dragonfire) < 0) player.createPerk(PerkLib.Dragonfire, 0, 0, 0, 0);

to:

player.createPerkIfNotHasPerk(PerkLib.Dragonfire);

The 4 perk values are optional and all default to 0.

(Mis)used custom character Etis as an example since he has a lot of perks.

In addition to the I made the 4 perk values for createPerk optional, too, because why not?

Kitteh6660 commented 6 years ago

This is quite promising, can reduce the amount of code.