Senior Member
Join Date: Feb 2015
Posts: 676
|
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? |
#1 |
Junior Member
Join Date: May 2016
Posts: 22
|
Could you explain what you mean by the correct number limbs? You only need a minimum of one limb to do a claw attack
|
#2 |
Senior Member
Join Date: Mar 2007
Location: Muskegon, MI
Posts: 2,975
|
There are hands and leg fields on the hero. Read the most recent update.
|
#3 |
Junior Member
Join Date: May 2016
Posts: 22
|
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 by Maquiscat; July 8th, 2016 at 08:06 PM. Reason: Grammar correction |
#4 |
Senior Member
Join Date: Feb 2015
Posts: 676
|
Quote:
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. |
|
#5 |
Senior Member
Join Date: Nov 2011
Location: South Riding, VA
Posts: 841
|
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. |
#6 |
Senior Member
Join Date: Feb 2015
Posts: 676
|
Quote:
Quote:
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. |
||
#7 |
Senior Member
Join Date: Oct 2011
Posts: 6,793
|
Quote:
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). |
|
#8 |
Senior Member
Join Date: Nov 2011
Location: South Riding, VA
Posts: 841
|
Quote:
|
|
#9 |
Senior Member
Join Date: Mar 2013
Location: Greater London, UK
Posts: 2,623
|
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.
|
#10 |
|
|