Draconic Evolution

Draconic Evolution

77M Downloads

[1.12.2] Possible support for Scaling Health's Damage Source Scaling for the Energy Shield?

SonicX8000 opened this issue ยท 5 comments

commented

Minecraft: 1.12.2
Forge: 14.23.52772

Mods: 6
BrandonsCore-1.12.2-2.4.7.189-universal
CodeChickenLib-1.12.2-3.2.2.353-universal
Draconic-Evolution-1.12.2-2.3.16.319-universal
RedstoneFlux-1.12-2.1.0.6-universal
ScalingHealth-1.12.2-1.3.31-132
SilentLib-1.12.2-3.0.8-158


Is there a possible chance if there could be support for Scaling Health's Damage Source Scaling to affect the Wyvern/Draconic's Energy Shield? Scaling Health has config options to allow you to scale each damage source such as 'drowning' to 5.0, 'mob' to 3.5, 'lava' to 1000.0, etc which increases overtime as the player difficultly increases thus dealing more damage to the player.

Say... the damage for the 'cactus' damage source is scaled by 50000.0 with a difficulty of 300 & difficulty weight of 0.08. Upon touching a cactus... that will deal a very painful amount of damage to the player... however if the player has an Energy Shield by wearing Wyvern/Draconic Armor... the damage will be treated as normal with no scaling done, which would be 1.0 damage. In fact... all damage sources if scaled will just use their original damage values.

This is the debug info from Scaling Health when I touch a cactus with the settings I set for the "cactus" damage source without having the Energy Shield. For testing purposes.

Damage scaling: type=cactus, scale=50000.0, affected=24.0, change=1200000.0, original=1.0

While the number is high, sure but this was only done for testing purposes. I think 1.2 million damage would drain the energy shield to 0% with that amount but as it is currently it only deals 1 damage to the energy shield upon touching a cactus, which is it's original value.

commented

Just writing that the scaled damage now affects the Energy Shield after the mods were updated. Had a Zombie Pigman pretty much DROP my shield from 2048 to 38 while maxing out the entropy to 100% at high difficulties.

commented

If it is actually dealing that much damage it would completely drain the shield in 1 hit and probably also max out the entropy. I have a feeling DE is blocking the damage before ScalingHealth adjusts it.
Please run the following command and give me the log output it produces.
/bcore_util dump_event_listeners
If you are on a server i will need the server log.

commented

https://pastebin.com/BHeDsiB1

Is this it? I grabbed it from the 'latest.log' in the 'logs' folder after typing that command.

The scaled damage that appears in that log is when I touched a Cactus or something that deals Cactus damage without wearing the armor. Before & After that I had the armor on and the shield nulls the scaled damage.

commented

I see the problem. I use the "LivingAttackEvent" to block damage and ScalingHealth uses "LivingHurtEvent"

The issue is LivingAttacked is fired first when the entity is attacked then after a bit of damage logic when the final damage value is about to be applied LivingHurt is fired. So the shield blocks the damage before it ever gets to the hurt event.

There isnt much i can do on my end. I have already adjusted my event priority so other mods can can modify damage applied via LivingAttacked bur there isnt much i can do about this particular issue.

commented

Thanks, I overlooked your armor event handler somehow. I changed my code to catch LivingAttackEvent. Everything seems to be working perfectly now.