StevensSEC / pokemonbattlelib

A portable library for accurately simulating Pokemon battles.
GNU General Public License v3.0
13 stars 2 forks source link

Refactor `DamageTransaction` to be more similar to `HealTransaction` #352

Closed dyc3 closed 3 years ago

dyc3 commented 3 years ago

Ideally, I'd like to remove Move and StatusCondition from DamageTransaction as well, but I didn't want to completely remove the ability to determine the source of the damage without providing a replacement.

Would prefer #351 to be merged first

codecov[bot] commented 3 years ago

Codecov Report

Merging #352 (9e39e34) into main (c6ff93e) will decrease coverage by 0.4890%. The diff coverage is 93.2432%.

:exclamation: Current head 9e39e34 differs from pull request most recent head b07a7ad. Consider uploading reports for the commit b07a7ad to get more accurate results Impacted file tree graph

@@               Coverage Diff                @@
##               main       #352        +/-   ##
================================================
- Coverage   96.2165%   95.7274%   -0.4891%     
================================================
  Files            14         14                
  Lines          1718       1732        +14     
================================================
+ Hits           1653       1658         +5     
- Misses           47         56         +9     
  Partials         18         18                
Impacted Files Coverage Δ
transactions_GEN.go 88.2352% <57.6923%> (-5.5148%) :arrow_down:
transactions.go 96.8017% <97.9166%> (+0.5179%) :arrow_up:
battle.go 93.5153% <100.0000%> (-1.2899%) :arrow_down:

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 c6ff93e...b07a7ad. Read the comment docs.

adapap commented 3 years ago

We should probably have something like a MoveContext object. This we could use to keep track of whether the move was a critical hit, when a move occurred relative to opponents, what (if any) modifiers affected the damage, effectiveness, etc.