Sagenlicht / ToEE_Mods

Modifications for the game Temple of Elemental Evil. Requires Temple+ to work!
MIT License
1 stars 1 forks source link

Wraithstrike (suggestion) #3

Open dolio opened 3 years ago

dolio commented 3 years ago

Hello,

I was looking at Wraithstrike, and noticed you're manually implementing touch attacks, because setting the touch attack flag didn't work.

The reason it didn't work is that you're setting it in the attacker-based AC hook, and that won't necessarily run before all the other AC hooks. It seems the way that touch attacks work is that armor hooks avoid adding bonuses if the flag is set.

However, I happen to know a way to make it work. The AttackPacket from the ToHit hooks gets reused for the AC hooks, and those run before AC. So if you set the touch attack flag in the ToHit hooks, it will cause it to act as a touch attack in the AC hooks.

However, I also wonder if touch AC should work your way (via explicit caps) in general. I noticed that the amulet of natural armor gets erroneously added to touch AC. So it might be better for armor caps to be set by the general callback if the touch attack flag is set.

Sagenlicht commented 3 years ago

Thanks dolio for pointing this out to me, I did update the spell.

I assume the amulet uses a wrong bonus type integer? I can't answer your last question about how the game should handle touch attacks in general.

dolio commented 3 years ago

Oh, that's a possibility. I didn't actually check if Wraithstrike blocks the amulet bonus.