• 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

Claws or better claws?

Redcap's Corner

Well-known member
I have a custom ability that either gives the hero a pair of claw attacks OR increases the damage of the hero's claw attacks by one step if the hero already has claws.

I have wClaw bootstrapped at First/600 with the following condition:

Code:
(fieldval:abValue2 <> 1)

And I have the following evalscript:

Code:
FIRST/599
~ If the hero already has claws, ignore the following.
doneif (hero.childlives[wClaw] <> 0)

~ Increase the existing claws' damage by one step.
perform hero.child[wClaw].assign[Helper.DamageUp]

~ Flag the hero as having claws for the conditional claw bootstrapping.
field[abValue2].value = 1

At present, it's just adding the second pair of claws and not worrying about increasing the damage of the first pair. I'm guessing this means wClaw is not a direct child of hero. What's the "address" for wClaw?
 
I'd approach it slightly differently than with a bootstrap condition. The pick which bootstraps claws always bootstraps them, but includes a custom tag as a marker, then an eval script on the pick foreaches through all claws on the hero which do NOT have that marker, and increases their damage. If it increased anyone's damage, then find the marked set of claws and hide them with Hide.Weapon.
 
Hmm... That's an interesting suggestion, and one I definitely hadn't considered. Immediately after posting this, I had a bit of a revelation that the problem might be that claws could actually be a child of a variety of different children of the hero, and thus a foreach statement was probably necessary either way. And I came up with the following (which seems to be working) to replace the code in the evalscript I posted above:

Code:
First/599
~ If the hero already has claws, instead increase their damage.
foreach pick in hero from BaseNatWep where "IsWeapon.wClaw"
  perform eachpick.assign[Helper.DamageUp]
  field[abValue2].value = 1
  nexteach

If I were to change it to work the way you suggested, though, how would I foreach for both the weapon being a claw AND it not having my custom tag? Something like this?

Code:
foreach pick in hero from BaseNatWep where "IsWeapon.wClaw" !& "Custom.GrislyHands"

I ask because I have to assume there are probably things that add claws to the hero at a later stage than First/598.
 
Last edited:
Code:
foreach pick in hero from BaseNatWep where "IsWeapon.wClaw" !& "Custom.GrislyHands"

I ask because I have to assume there are probably things that add claws to the hero at a later stage than First/598.
Doubtful anything does after First/598. Most natural attacks should be getting on by First/99.

Also the above is not a valid search string. Here it is fixed:
Code:
foreach pick in hero from BaseNatWep where "IsWeapon.wClaw & !Custom.GrislyHands"
 
Back
Top