jojobear13 / shinpokered

Mostly-vanilla hack of Pokémon Red/Blue focused on bugfixes and trainer ai
209 stars 42 forks source link

Bug: Ditto Burglar scaling cheese #269

Closed Mord5 closed 12 months ago

Mord5 commented 1 year ago

What emulator and/or hardware are you are using? bgb 1.5.9.w64

What version of this project are you using? built from source master_dev commit https://github.com/jojobear13/shinpokered/commit/aea99273343b16066522fcddb31a095078521047

What is the problem you encountered? GetRandRosterLoop refers to the level of the player's first party mon when setting levels for trainer mons generated with GetRandRoster and GetRandRoster3. This makes it trivial to get unlimited supplies of M.GENEs and MASTER BALLs.

Expected behavior Trainer parties generated with GetRandRoster and GetRandRoster3 should always have level scaling forced on.

Is it possible to reproduce the problem?

  1. Be in postgame
  2. Turn off level scaling with Oak's Aide
  3. Put a Lv5 mon in the 1st slot of your party and a Lv100 mon in the 2nd
  4. Challenge the Ditto Burglar in Underground Path W-E
  5. Note that the levels of the Ditto Burglar's mons will match the Lv5 mon, not the Lv100 mon.
  6. Profit

Suggested Fix In func_enc_gen.asm: https://github.com/jojobear13/shinpokered/blob/fab1914065c4a95164806334706263dc494008f9/custom_functions/func_enc_gen.asm#L119

- call ScaleTrainer
+ call ScaleTrainerSkipCheck

https://github.com/jojobear13/shinpokered/blob/master/custom_functions/func_enc_gen.asm#L146-L149

ScaleTrainer:
    CheckEvent EVENT_90C
    ret z
+ ScaleTrainerSkipCheck:
    push bc
jojobear13 commented 1 year ago

Adjustments made in ec22e28db46496b31319ddad2fef564430756451.

This is an old debugging trick that I forgot about. Time to remove it. I made the fix a bit more complicated because I want level scaling to be part of its own "difficulty class" so to speak. The commit makes it so that highest level less 3 plus [0 to 3] is used when scaling is turned off, making the random trainers trend a few levels lower than your strongest party mon (similar to vanilla trainers in caves and stuff).

Mord5 commented 1 year ago

Ran into something silly with the Ditto Guy after the https://github.com/jojobear13/shinpokered/commit/ec22e28db46496b31319ddad2fef564430756451 patch: a Lv 99 Caterpie.

Possibly acceptable under rule of funny, but if not, maybe random teams ought to always evolve even with scaling turned off.

jojobear13 commented 1 year ago

Acceptable under rule of funny. Let evolution be player-selectable via scaling, and let the random trainer truly be a random pick from all 151 pokemon.