• 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

M&M 2nd ed. Modifying Sneak Attack

Woodclaw

Well-known member
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.
 
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.
 
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.

Thanks for the info, I never noticed the problem with trade-off, since I rarely use Sneak Attack on damage shifted characters.
 
{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.
 
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.
 
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.

I've given some thoughts about the problem too. About Favored Environment I suggested a long time ago to add a check box to Feast too, but it resulted too complicated to implement.
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).
 
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"

You could change it to omit Perception-range attacks, for example:

Code:
foreach pick in hero where
 "Helper.IsAttack & Helper.ShowAttack & !Helper.AttackCont & [b]!pwRange.Perception[/b]"

Hope this helps!
 
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"

You could change it to omit Perception-range attacks, for example:

Code:
foreach pick in hero where
 "Helper.IsAttack & Helper.ShowAttack & !Helper.AttackCont & [b]!pwRange.Perception[/b]"

Hope this helps!

Almost, now I just need to figure out how to apply the same effect to a General Area attack.
 
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"

And it seem to work fine. The only problem is that it doesn't distinguish between General Area and Targeted Area.
 
Back
Top