Page 1 of 1

damageType = "pure"

Posted: Thu May 21, 2015 8:58 pm
by David Ward
What does this do exactly? I've tried placing it under "class = "RangedAttack"," but it did not appear to do anything. I was hoping it would cut through protection entirely, as there appears to be no way for "class = "RangedAttack"," to have any protection bypass like "pierce".

Is "damageType = "pure"" meant for spells only? Monster attacks? Just curious.

Re: damageType = "pure"

Posted: Thu May 21, 2015 9:59 pm
by minmay
I'm pretty sure it's similar to physical (doesn't do anything special at all). Just happens to be the only damage type that no standard monster resists (and no player resistance exists for it).

Re: damageType = "pure"

Posted: Thu May 21, 2015 10:33 pm
by David Ward
That is what it looks like. Is there anything other than "pierce" that can negate protection, then?

I tried making a RangedAttack that has damageType = "shock", but what that appears to do is come up against both resistance to shock AND protection, because RangedAttack (and I guess the other attack types also - MeleeAttack, ThrowAttack, FirearmAttack) is hard-coded as physical damage, I assume, no matter what damageType is added.

Re: damageType = "pure"

Posted: Thu May 21, 2015 11:22 pm
by minmay
Damage type has nothing to do with protection. Some damage sources, like melee, missile, and firearm attacks (for players at least), check protection. Some damage sources, like tile damagers, ignore protection. Same situation with evasion. Damage type never enters into this at all, and none of the things you mentioned are hardcoded as physical damage.
The only impacts inherent to damage type that I know of are
1. which resistance is checked
2. whether extra special effects are created (fire and shock leave lingering particles on monsters, cold can give a different death effect)
3. if the damage type is dispel, it won't damage obstacles or monsters without the "elemental" trait

Re: damageType = "pure"

Posted: Thu May 21, 2015 11:25 pm
by Azel
David Ward wrote:That is what it looks like. Is there anything other than "pierce" that can negate protection, then?

I tried making a RangedAttack that has damageType = "shock", but what that appears to do is come up against both resistance to shock AND protection, because RangedAttack (and I guess the other attack types also - MeleeAttack, ThrowAttack, FirearmAttack) is hard-coded as physical damage, I assume, no matter what damageType is added.
I wonder if it's possible to simply set the Protection of the enemy to "0" during the attack. Should have the same impact as negating protection, no?

Re: damageType = "pure"

Posted: Thu May 21, 2015 11:37 pm
by David Ward
K, thanks for the input guys.

"I wonder if it's possible to simply set the Protection of the enemy to "0" during the attack. Should have the same impact as negating protection, no?"

Is that a fairly easy thing to code in, Azel? On this end, we have found no solution so far to making the RangedAttack component bypass protection.

Re: damageType = "pure"

Posted: Fri May 22, 2015 12:00 am
by Azel
it would probably have to happen in the same way discussed in the thread about increasing player strength during an attack. Not very easy :shock:

Re: damageType = "pure"

Posted: Fri May 22, 2015 12:07 am
by minmay
You could do it with ProjectileComponent.onProjectileHit and set protection back to its original value in MonsterComponent.onProjectileHit or MonsterComponent.onDamage, provided that the former is called before the damage is determined (I'm too lazy to test it). If it's not, then no; there aren't any other appropriate hooks and you would almost certainly end up having to set the protection to 0 for long enough during a frame that another attack might hit first which would be a major bug; the only methods that would avoid this would just introduce worse bugs (wrong damage text etc).
MeleeAttack, ThrowAttack, and FirearmAttack already have pierce available so I'm not sure why you're complaining about those in the first place - you can just set the piece to math.huge to bypass any amount of protection.
In fact, you asked the same question a couple months ago. I do wonder what the hell you're doing that makes pierce on missile attacks important, I mean, they're already redundant with throwing attacks...

Re: damageType = "pure"

Posted: Fri May 22, 2015 1:42 am
by Azel
minmay wrote:In fact, you asked the same question a couple months ago. I do wonder what the hell you're doing that makes pierce on missile attacks important, I mean, they're already redundant with throwing attacks...
I assume he's making what would become the greatest Ranger Sniper in the history of Grimrock? Seems a noteworthy cause :geek:

Re: damageType = "pure"

Posted: Fri May 22, 2015 2:17 am
by David Ward
LOL Thanks Azel.

We've made a battle system where virtually every monster has protection. The reason we did this had to do with wrangling around with statistics, and especially the damage bonuses added by party character attributes. Since virtually every monster has protection, virtually every weapon, correspondingly, has pierce. But since RangedAttack cannot have pierce, there's had to be a bit of a workaround with ranged weapons. It's all good, just one of those silly little things that is the LOG2 editor (don't get me wrong, it's one of the best game editors I've ever seen).