Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Effect Filter #810

Merged
merged 10 commits into from
Feb 26, 2021
Merged

Add Effect Filter #810

merged 10 commits into from
Feb 26, 2021

Conversation

alexsosnovsky
Copy link
Contributor

@alexsosnovsky alexsosnovsky commented Feb 16, 2021

The new effect filter returns ALLOW if the player has an effect of the same type as the filter. If a mapmaker wants to be more selective, there are three optional attributes: min-duration, max-duration, and amplifier.

Syntax example:

<filters>
    <effect id="filter1" min-duration="10s" amplifier="1">saturation</effect>
    <effect id="filter2">saturation</effect>
    <effect id="filter3" max-duration="30s" amplifier="2">night vision</effect>
    <effect id="filter4" amplifier="1">water breathing</effect>
    <effect id="filter5" min-duration="10s" max-duration="20s" amplifier="2">night vision</effect>
</filters>

Signed-off-by: alexsosnovsky <60436249+alexsosnovsky@users.noreply.github.com>
@Pablete1234
Copy link
Member

I do not see the point in having a filter with effects as children, i think no other filter does this, instead, it's the filter itself that has the properties.
Also, there's no use for has-*, for example team filter is simply team, even if the name itself is reused elsewhere

<filters>
    <effect id="filter1" duration="0s" amplifier="4">saturation</effect>
    <effect id="filter2" duration="30s" amplifier="1">water breathing</effect>
    <effect id="filter3" duration="0s" amplifier="2">night vision</effect>
</filters>

Regarding duration, a filter with a specific duration is of little use, it should probably be a range: duration="2s..15s" or duration="2s.."

@Pugzy
Copy link
Contributor

Pugzy commented Feb 16, 2021

Not sure if these exists in this version of PGM but it looks like ranges and comparisons were implemented like so https://pgm.dev/docs/modules/mechanics/filters/#random-filter which may be worth replicating as the syntax used in the comment above.

Signed-off-by: alexsosnovsky <60436249+alexsosnovsky@users.noreply.github.com>
@alexsosnovsky
Copy link
Contributor Author

alexsosnovsky commented Feb 16, 2021

I do not see the point in having a filter with effects as children, i think no other filter does this, instead, it's the filter itself that has the properties.
Also, there's no use for has-*, for example team filter is simply team, even if the name itself is reused elsewhere
Regarding duration, a filter with a specific duration is of little use, it should probably be a range: duration="2s..15s" or duration="2s.."

I've updated it to simply use the <effect/> tag. I also added optional min-duration and max-duration attributes so that a range can be created easily. The sample XML in the original post has been updated.

Not sure if these exists in this version of PGM but it looks like ranges and comparisons were implemented like so https://pgm.dev/docs/modules/mechanics/filters/#random-filter which may be worth replicating as the syntax used in the comment above.

This looks interesting but I felt it was simpler and more intuitive to just have min-duration and max-duration attributes which take normal duration strings as input.

Signed-off-by: alexsosnovsky <60436249+alexsosnovsky@users.noreply.github.com>
Signed-off-by: alexsosnovsky <60436249+alexsosnovsky@users.noreply.github.com>
Signed-off-by: alexsosnovsky <60436249+alexsosnovsky@users.noreply.github.com>
@Electroid Electroid merged commit 4610910 into PGMDev:dev Feb 26, 2021
@alexsosnovsky alexsosnovsky deleted the effect branch February 26, 2021 02:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants