Sunday, August 11, 2013

HigherPower - Damage Counter

In addition to doing some mundane tweaks to Noir generation, I added a new item to HigherPower.  This item is the Damage Counter, a card that keeps track of how much damage the holding player receives and deals.  It works by catching Forge's LivingHurtEvent, checking to see if the holder (or holder's attacker) is a player, looking for a Damage Counter in the player's inventory, and adding the base damage.  The DC does not take into account armor, potions, or other mods' interference in the damage process.  The DC is crafted with some redstone, an iron ingot, some Fleexium, and a tiny bit of Eethur.  Originally, I was using reflection to access the protected entityDamageSource field, but then I discovered the public getter getSourceOfDamage.

No comments:

Post a Comment