SalieriC / SWIM

A collection of macros for the SWADE system on Foundry with a focus on immersion (i.e. by using sound effects)
GNU General Public License v3.0
10 stars 12 forks source link

[BUG] The BR2 codes have a glitch I think, or can be simplified. #106

Closed grendel111111 closed 1 year ago

grendel111111 commented 1 year ago

Describe the bug The Deflection BR2 code has a problem due to the rewrite for the way deflection works now.

To Reproduce Steps to reproduce the behavior: If you have someone cast both deflection ranged and deflection melee (or deflection raise with either of them) on the same character none of them will work.

Expected behavior If you cast deflection and get success, so choose ranged. Then you do it again and choose melee or raise then they will all stop working.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Additional context In the deflection code you have


                        {
                            "or_selector": [
                                {
                                    "selector_type": "target_has_effect",
                                    "selector_value": "Deflection (range)"
                                },
                                {
                                    "selector_type": "target_has_effect",
                                    "selector_value": "Deflection (melee)"
                                },
                                {
                                    "selector_type": "target_has_effect",
                                    "selector_value": "Maintaining Deflection"
                                }
                            ]
                        }
                    ]```
 With the not selector teh deflection will not work if any of those other effects are present on the character. So if it has Deflection (ranged) and deflection (melee) then neither will work Also if there is an effect Maintain Deflection on the target then deflection won't work (and if there isn't an effect Maintain Deflection then there is no need for the block).

 My suggestion would be to use these 2 BR2 codes instead of the 3 you are using now.
```{"id":"Target has Deflection (melee)",
"name":"targethasDeflectionM",
"button_name":"has Deflection",
"skillMod":"-2",
"and_selector":[
{"selector_type":"item_type",
"selector_value":"weapon"},
{"selector_type":"skill",
"selector_value":"Fighting"},
{"or_selector":[
{"selector_type":"target_has_effect",
"selector_value":"Deflection (melee)"},
{"selector_type":"target_has_effect",
"selector_value":"Deflection (raise)"}]}],
"defaultChecked":"on",
"group":"The target"}```

```{"id":"Target has Deflection (Ranged}",
"name":"targethasDeflectionR",
"button_name":"has Deflection (Ranged)",
"skillMod":"-2",
"and_selector":[
{"selector_type":"item_type",
"selector_value":"weapon"},
{"or_selector":[
{"selector_type":"skill",
"selector_value":"Shooting"},
{"selector_type":"skill",
"selector_value":"Athletics"}]},
{"or_selector":[
{"selector_type":"target_has_effect",
"selector_value":"Deflection (range)"},
{"selector_type":"target_has_effect",
"selector_value":"Deflection (raise)"}]}],
"defaultChecked":"on",
"group":"The target"}   ```
It will run the deflection without conflicts and it has tighter code. (You can adjust to your formatting)
SalieriC commented 1 year ago

Thanks. I see the problem now. Done in the current dev version.