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

feat: ability air lock #391

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

feat: ability air lock #391

wants to merge 1 commit into from

Conversation

adapap
Copy link
Contributor

@adapap adapap commented Sep 2, 2021

No description provided.

@codecov
Copy link

codecov bot commented Sep 2, 2021

Codecov Report

Merging #391 (ea9f411) into main (e52df5f) will increase coverage by 0.0156%.
The diff coverage is 100.0000%.

❗ Current head ea9f411 differs from pull request most recent head 95367d0. Consider uploading reports for the commit 95367d0 to get more accurate results
Impacted file tree graph

@@               Coverage Diff                @@
##               main       #391        +/-   ##
================================================
+ Coverage   95.4101%   95.4257%   +0.0156%     
================================================
  Files            16         16                
  Lines          2048       2055         +7     
================================================
+ Hits           1954       1961         +7     
  Misses           72         72                
  Partials         22         22                
Impacted Files Coverage Δ
battle.go 97.3799% <ø> (ø)
battle_round.go 94.5355% <100.0000%> (+0.1221%) ⬆️
transactions.go 96.0600% <100.0000%> (+0.0223%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e52df5f...95367d0. Read the comment docs.

Comment on lines +20 to +22
if pkmn.Ability == AbilityAirLock {
b.metadata[MetaWeatherDisabled] = true
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be another transaction so it's possible to announce it? Something like AbilityEffectTransaction.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be hard to make a transaction generic enough to be able to handle these types of cases. Right now the metadata fields are the only interface{} types. I also considered this being a potential battle rule (to disable weather), which doesn't make sense for it being a transaction.

This seems like the easiest way to ensure that we always have this check in the beginning of a round.

var _ = Describe("Ability: Air Lock", func() {
a := Agent(new(dumbAgent))

It("should negate the effects of weather", func() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we have a test to see if the effect gets removed when the pokemon is removed from the battlefield?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants