Senior Member
Join Date: Aug 2009
Posts: 127
|
Hi people, I'm sorely in need of some help on coding.
In one of the last updates Sneak attack was modified so it counts against PLcaps, which is a great thing, but caused me some problems. See, in my games Perception Range attacks and General Area attacks doesn't benefit from the Sneak Attack bonus. RIght now I'm trying to modify the code to reflect this, but I had no luck so far. Can anybody help me on this? Thanks. |
#1 |
Senior Member
Volunteer Data File Contributor
Join Date: Nov 2009
Posts: 1,502
|
Hmm... Perception can be checked via the range increment of the attack, but probably the more elegant way is to check if it is a power and then checking if it has the extra.
On a side note, the current Sneak Attack implementation does not work with tradeoffs at the moment. A player with Blast 10, Ranged attack bonus +8, and Sneak Attack 1 is said to be over his limits. |
#2 |
Senior Member
Join Date: Aug 2009
Posts: 127
|
Quote:
|
|
#3 |
Senior Member
Volunteer Data File Contributor
Join Date: Nov 2009
Posts: 1,502
|
{nods} It's the same error that happened with Deflect. Colen is trying to use a datafield that indicates the available tradeoff, but it doesn't actually modify that value until you actually are in a tradeoff situation. I'll poke at it tonight. There's probably a way to get at it by looking at effective attack bonus.
|
#4 |
Senior Member
Volunteer Data File Contributor
Join Date: Nov 2009
Posts: 1,502
|
Bumping this. I've made some attempts to fix it, but it's hampered in that the only way we have to know how the attack matches up against PL is via atkDiffAtk or atkDiffDC, both of which won't show a value if it's greater than 0, or atkPLReq, which has an integer granularity.
Also noting that Favored Environment has code which is being bypassed which would modify attack and defense when Favored Environment is on. The catch is that there's no way to turn Favored Environment on and off and it depends on ftOption when it doesn't have the text for that checkbox. Ideally, Favored Environment should allow one to toggle it on and off, and adjust how many points go to each area. I know... if wishes were fishes. I may implement it as a power for now. |
#5 |
Senior Member
Join Date: Aug 2009
Posts: 127
|
Quote:
About Sneak Attack a way to circumvent my original problem might be to add a condition that disable the feat bonus for a specific attack if such attack lack a to-hit roll (being Perception Range or a General Area effect). |
|
#6 |
Senior Member
Lone Wolf Staff
Join Date: Dec 2008
Posts: 4,690
|
The easiest way to do this is probably to customize Sneak Attack in the editor - you can either remove the PL requirement totally, or simply skip attacks that meet your criteria. For example, right now it's just checking all attacks like so:
Code:
foreach pick in hero where "Helper.IsAttack & Helper.ShowAttack & !Helper.AttackCont" Code:
foreach pick in hero where "Helper.IsAttack & Helper.ShowAttack & !Helper.AttackCont & !pwRange.Perception" |
#7 |
Senior Member
Join Date: Aug 2009
Posts: 127
|
Quote:
|
|
#8 |
Senior Member
Join Date: Aug 2009
Posts: 127
|
Ok I tweaked the line provided by Colen like this
Code:
foreach pick in hero where "Helper.IsAttack & Helper.ShowAttack & !Helper.AttackCont & !pxUPProAre & !pwRange.Perception" |
#9 |
|
|