• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

Counting natural attacks

TheIronGolem

Well-known member
So I'm dealing with a bunch of different class custom specials that add a claw, gore, or other natural attack to the hero, and I'd like to implement some nice clean prereqs that make sure the hero has the correct number of limbs to "hold" those attacks.

I thought at first I could simply count the hero's HasNatAtt.? tags and compare that to the corresponding hero field for arms/legs/heads. But it turns out that tag is only added to the hero once per attack type, no matter how many of that attack they have.

Has anyone come up with a way to count the number of a given natural attack a hero has, without resorting to something expensive like foreach-ing through weapons?

Oh, and side note to LWD: HUGE thanks for the new tNumLegs and tNumHeads fields, they are going to be super helpful. Any chance of getting similar fields for counting tails and wings in the future?
 
Could you explain what you mean by the correct number limbs? You only need a minimum of one limb to do a claw attack
 
I got that. I am not sure what he is looking for. Is he wanting to check the character has at least one arm to do a claw attack? Or is he assuming that they should have at least two arms for claw?

Or maybe he is asking if there is a way that you can select claw attack once and then it calculates how many claw attacks it has by the number of arms or legs it has?
 
Last edited:
I got that. I am not sure what you are looking for. Are you wanting to check the character has at least one arm to do a claw attack? Or are you assuming that they should have at least two arms for claw?

Or maybe you are asking if there is a way that you can select claw attack once and then it calculates how many claw attacks it has by the number of arms or legs it has?

First one is the closest. I'm trying to make sure the hero has enough "free" limbs to add the attack that the class special grants. So if the hero has one head and already has a gore attack, he can't add another gore attack unless/until he gains a second head.

I'm currently doing this by looping through the hero's existing natural attacks and counting the ones that match the attack I'm validating. But loops are pretty expensive (I've earned more than one rap on the knuckles from ShadowChemosh for using them in the community packages), so I'm checking to see if anyone knows a more efficient way.
 
There is a procedure NatNum that counts the total number of natural attacks a hero has which may be useful.

I do not think there is a tag that connects specific natural attacks to specific body parts at this time. It would be useful though if there was. For example, Bite could have Helper.NatHead or something like that.
 
There is a procedure NatNum that counts the total number of natural attacks a hero has which may be useful.

That looks pretty much like what I was doing, although in a more thorough way. Thanks, I'll go ahead and just use that.

I do not think there is a tag that connects specific natural attacks to specific body parts at this time. It would be useful though if there was. For example, Bite could have Helper.NatHead or something like that.

That would be useful, though perhaps not for this particular purpose because sometimes different natural attacks can occupy the same limb (bite and gore on a head, for example).

Personally, I think it would be ideal if the hero could get one HasNatAtt tag for each instance of a natural attack they have. That way we could simply count those tags and compare it to the corresponding herofield. Admittedly, there may be other logic elsewhere that expects only one copy of that tag to exist, so maybe it's less of a good idea than I think.
 
There is a procedure NatNum that counts the total number of natural attacks a hero has which may be useful.

I do not think there is a tag that connects specific natural attacks to specific body parts at this time. It would be useful though if there was. For example, Bite could have Helper.NatHead or something like that.

Helper.RaceHands sets the number of attacks for a natural weapon to the number of hands the hero has, and reduces that as hands are filled with other weapons.

Helper.RaceHeads and Helper.RaceLegs do the first part (setting the number of attacks to the hero field) but do not do the latter (since you don't lose "free heads/legs" when you equip things).
 
Helper.RaceHands sets the number of attacks for a natural weapon to the number of hands the hero has, and reduces that as hands are filled with other weapons.

Helper.RaceHeads and Helper.RaceLegs do the first part (setting the number of attacks to the hero field) but do not do the latter (since you don't lose "free heads/legs" when you equip things).

Well, unless you get your hands on the Head of Vecna. :D
 
Have you looked at the Eidolon that a Summoner summons? You can build the eidolon up with points and so it does these sorts of checks.
 
Back
Top