It was surprisingly simple honestly. First I added a damageAbsorptionPoints property to the PlayerController script along with a method to add damage absorption points (which also clamps the amount the Player can carry to a max of 3) and modified the TakeDamage method to ignore the damage reduction and instead decrement the player's absorption points if there are any greater than zero of them.

Then I wrote what is more or less a functional implementation of an AbsorptionDrop class (which will be referred to in-game as the beetle shell) that simply adds 3 absorption points when collected. This drop expands upon the same abstract Drop class as the health drops do already.

Next time I'm off work I'll probably clean up this code a bit in any ways that future me notices that present me does not see as well as work on some art and effects related to this power up!
2 comments