mm201 / pkmn-classic-framework

Pokémon application logic for Generation IV and V, including servers
http://pkmnclassic.net/
Other
219 stars 43 forks source link

Simple validation for held items during GTS trading #94

Closed sosnek closed 3 years ago

sosnek commented 3 years ago

Item Id's compared with : https://bulbapedia.bulbagarden.net/wiki/List_of_items_by_index_number_(Generation_IV)

mm201 commented 3 years ago

You put this in the base class, so it will wrongly reject Pokémon in GenV holding newly introduced items, e.g. Air Balloon.

Also, the way I envision this working is you would have if (!thePokemon.HeldItem.IsHoldable(Generations.Generation4)) return false; here and item holdability would be added to the database.

Of course, at this point, I'll take a quick and dirty patch if you can fix GenV.

sosnek commented 3 years ago

Oops, I guess I thought this was for gen 4 only. If we could determine item category and add it to the item base it would be much easier to filter out illegal items. I updated the temporary fix. :)

mm201 commented 3 years ago

I know the code enough to put this in the right place. I'll just do that and throw you in the credits. 😊

(And Platinum, etc. items should be blocked to avoid trading them to a D/P game.)

sosnek commented 3 years ago

I know the code enough to put this in the right place. I'll just do that and throw you in the credits. 😊

(And Platinum, etc. items should be blocked to avoid trading them to a D/P game.)

haha okay! Lots of details with items between games that I wasn't previously aware of. Thanks for the learning experience! Hope I was able to help! 😊

mm201 commented 3 years ago

I added more things to the blocklist like key items, apricorns, wonder launcher items, and the Griseous Orb in GenIV.

And I hope I didn't scare you away! I can be pretty particular about things.

sosnek commented 3 years ago

I added more things to the blocklist like key items, apricorns, wonder launcher items, and the Griseous Orb in GenIV.

And I hope I didn't scare you away! I can be pretty particular about things.

Awesome! And not at all! After all, that's how we learn right? 😁 (I understand the framework a lot more now!)