• 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

Minimum of 1

blzbob

Well-known member
I have a few feats that set the minimum values at 1. Here they are:

All good aligned creatures within 30 feet gain a sacred bonus to the next attack roll they make within 1 round, and all evil creatures suffer a penalty to their next attack roll in that time. The bonus is equal to +1 per 2 channeling dice (minimum +1), and the penalty -1 per 2 channeling dice (minimum -1).


All evil-aligned creatures within 30 feet gain a profane bonus to the next damage roll they make within 1 round, and all good creatures suffer a penalty to their next damage roll in that time. The bonus is equal to +1 per 2 channeling dice (minimum +1), and the penalty -1 per 2 channeling dice (minimum -1).

You expend two uses of your channel energy ability to delay the transformation of a single corpse touched into any form of undead. The body has many of its injuries repaired, and remains untouched by decay for 1 day/2 channel dice (minimum of 1 day). If the creature was slain in a manner that would cause it to rise as an undead, that transformation is delayed by the same amount of time. Likewise, any spells that would animate the creature as an undead automatically fail if cast before this effect expires. Delay corruption does not interfere with reincarnation, raise dead, or similar effects that return the creature to life.

You are able to use channel energy to cause natural stone and earth to shudder within a 30-foot-radius of you. All creatures in this area of effect (except yourself) must make a Reflex save (DC 10 + channel dice + Cha modifier) each round or fall prone. These quakes persist for 1 round/2 channel dice (minimum 1 round). Any creature that enters this area of effect while it persists must also make the Reflex save. If you move from the spot where you used this ability, the quakes immediately end.

You are able to affect the minds of those within the normal burst radius of your channel ability. Instead of normal damage, your channeling inflicts a penalty on affected creatures’ Will saves and to any Wisdom-based skill checks and the save DCs of their Wisdom-based spells and abilities. This penalty is equal to -1 per 2 dice of channeling (minimum -1). Creatures may attempt a Will save (DC 10 + channel dice + Cha modifier) to negate this effect. The penalty lasts for 1 round per channel die.

I have everything working on the feats except setting the floor at 1. How do I do that? I tried looking at a few feats (Amateur Gunslinger and Born Alone are just two of them) but I couldn't see where they set a minimum of 1.
 
I have everything working on the feats except setting the floor at 1. How do I do that? I tried looking at a few feats (Amateur Gunslinger and Born Alone are just two of them) but I couldn't see where they set a minimum of 1.
This one often gets people as you want to use the Maximum function.

In Example:
The bonus is equal to +1 per 2 channeling dice (minimum +1)
Code:
field[abValue].value += [COLOR="DeepSkyBlue"]maximum([/COLOR] [COLOR="Green"]round([/COLOR] [COLOR="Red"]#value2[xChannel]/2[/COLOR][COLOR="Green"] ,0,-1)[/COLOR] [COLOR="DeepSkyBlue"],1 )[/COLOR]

Then we can break down the above code. For functions wrapped in functions you always work from the inside out. So the above is done in this order:
1) "#value2[xChannel]/2" abValue2 from xChannel divided by 2.
2) "round( step1 ,0,-1)" take the result and round it. The ,0 tells us to round to whole numbers and the ,-1 tells us to round down. So that .5 will become 0 and 1.5 would become 1.
3) "maximum( step2 ,1 )" take the value from the result in step 2 or the value of one ,1.

Example 1:
So lets say we have 1 channel dice in xChannel abValue2:
1) 1/2 = .5
2) round .5 down into a whole number so we get 0
3) is 0 or 1 the "bigger" number? Of course its 1 so we get a result of 1.
Final answer placed into field[abValue].value is 1.

Example 2:
So lets say we have 4 channel dice in xChannel abValue2:
1) 4/2 = 2
2) round 2 down into a whole number so we get 2
3) is 2 or 1 the "bigger" number? Of course its 2 so we get a result of 2.
Final answer placed into field[abValue].value is 2.

hope that helps.
 
Last edited:
Here's what I'm doing:

doneif (hero.tagis[Hero.Channel] = 0)

field[abValue].value += minimum(round(hero.child[xChannel].field[abValue2].value/2,0,-1),1)

field[livename].text = field[name].text &" -/" & signed(field[abValue].value)

It's capping the value at 1 rather than setting the minimum.
 
I thought he was giving me an example of how a function works and I was supposed to use "minimum." Thanks.
 
Using the exact script Shadow gave is setting the value at 1 no matter what.
Um I actually tested the script and it was working fine. Do you have anything else in your script? You do know you will have to be level 7 Cleric before you will see a 2 right? Level 7 gives a 4d6 so half will finally give 2. Otherwise from level 1 to 6 the value should correctly be 1.
 
Now I feel like an idiot. Everything is fine. It's me that's not so fine. I don't know what I was thinking.
 
Back
Top