smogon / damage-calc

Pokemon games damage calculator
https://calc.pokemonshowdown.com
MIT License
369 stars 345 forks source link

Implement OM modifiers. #598

Closed placuszek15 closed 3 months ago

placuszek15 commented 5 months ago

Add tier shift mod, scalemons mod, mix and mega mod, kris~chan said formats-data will be available so I just jammed it there. If a GH action should be made for that lmk :+1:

thejetou commented 4 months ago

Hello, I didn't look into the code too deeply, but there are some fundamental changes that need to be made so this can land.

placuszek15 commented 4 months ago

everything should be done, I have a couple more questions though:

thejetou commented 4 months ago

how do we want to make tier shift up to date

Are you referring to the data in data/tiers? You should probably do it like the way the current set imports works (a script in import/ & a GH workflow).

am i supposed to wait until this one is merged before dealing with the rest of the oms (reevo, inverse / tcg, bonus type, ff / ce etc etc)

I'd prefer this PR to be about foundational OM support + few OMs so it can land easier. In future PRs you can add in other OMs piecemeal.

how do we want to deal with /calc ts package my version relies on calc/mechanics/gen56 / 789.js to update defender / attacker item and correctly give the damage multiplier (hearthflames 1.2x, sinnoh orbs' 1.2x) which sounds extremely awkward to do inside the ts file

I'm not sure what you mean by this. Do you need @smogon/calc to return damage multipliers or something?

placuszek15 commented 4 months ago

believe it should be ready for review now, for transparency's sake the workflow for tier data will be a separate pr so this one is not too huge, additionally we decided in ps! pms that overriding performCalculations is probably the best way of dealing with the damage multiplier / updating items

thejetou commented 4 months ago

Please fix the build errors.

thejetou commented 3 months ago

Have you tested this? I don't know if my setup is just broken but running this branch, the calc result description does not seem to load at all.

placuszek15 commented 3 months ago

Removing index_controls_randoms.js from om.html was a mistake, that file is busy doing literally everything (updating the main-result div, making the .modeSelection buttons work, talking between the ts package, etc.) so duplicating nearly the entirety of it seems like a design nightmare.

thejetou commented 3 months ago

Thanks!