smogon / pokemon-showdown

Pokémon battle simulator.
https://pokemonshowdown.com
MIT License
4.77k stars 2.79k forks source link

Bug: Unown has no levels in sent JSON #4094

Closed sooham closed 6 years ago

sooham commented 6 years ago

Hi, for battle type gen7randombattle. I noticed Unown JSON does not have details attribute sent when the request action is sent.

Example websocket data recv from server.

|request|{"active":[{"moves":[{"move":"Mirror Coat","id":"m
   ...: irrorcoat","pp":32,"maxpp":32,"target":"scripted","disabled":false},{"move":"Le
   ...: ech Life","id":"leechlife","pp":16,"maxpp":16,"target":"normal","disabled":fals
   ...: e},{"move":"Liquidation","id":"liquidation","pp":16,"maxpp":16,"target":"normal
   ...: ","disabled":false},{"move":"Toxic","id":"toxic","pp":16,"maxpp":16,"target":"n
   ...: ormal","disabled":false}]}],"side":{"name":"Sooham Rafiz","id":"p1","pokemon":[
   ...: {"ident":"p1: Araquanid","details":"Araquanid, L79, F","condition":"237/237","a
   ...: ctive":true,"stats":{"atk":156,"def":191,"spa":125,"spd":254,"spe":112},"moves"
   ...: :["mirrorcoat","leechlife","liquidation","toxic"],"baseAbility":"waterbubble","
   ...: item":"leftovers","pokeball":"pokeball","ability":"waterbubble"},{"ident":"p1:
   ...: Unown","details":"Unown","condition":"258/258","active":false,"stats":{"atk":14
   ...: 9,"def":153,"spa":201,"spd":153,"spe":153},"moves":["hiddenpowerpsychic60"],"ba
   ...: seAbility":"levitate","item":"choicespecs","pokeball":"pokeball","ability":"lev
   ...: itate"},{"ident":"p1: Aurorus","details":"Aurorus, L81, M","condition":"331/331
   ...: ","active":false,"stats":{"atk":129,"def":163,"spa":207,"spd":196,"spe":141},"m
   ...: oves":["freezedry","stealthrock","blizzard","ancientpower"],"baseAbility":"snow
   ...: warning","item":"leftovers","pokeball":"pokeball","ability":"snowwarning"},{"id
   ...: ent":"p1: Tapu Fini","details":"Tapu Fini, L75","condition":"229/229","active":
   ...: false,"stats":{"atk":117,"def":216,"spa":186,"spd":239,"spe":171},"moves":["moo
   ...: nblast","surf","calmmind","substitute"],"baseAbility":"mistysurge","item":"left
   ...: overs","pokeball":"pokeball","ability":"mistysurge"},{"ident":"p1: Garbodor","d
   ...: etails":"Garbodor, L81, F","condition":"262/262","active":false,"stats":{"atk":
   ...: 201,"def":179,"spa":144,"spd":179,"spe":168},"moves":["toxic","gunkshot","haze"
   ...: ,"toxicspikes"],"baseAbility":"aftermath","item":"blacksludge","pokeball":"poke
   ...: ball","ability":"aftermath"},{"ident":"p1: Claydol","details":"Claydol, L81","c
   ...: ondition":"230/230","active":false,"stats":{"atk":160,"def":217,"spa":160,"spd"
   ...: :241,"spe":168},"moves":["toxic","earthquake","icebeam","rapidspin"],"baseAbili
   ...: ty":"levitate","item":"leftovers","pokeball":"pokeball","ability":"levitate"}]}
   ...: ,"rqid":2}

notice the following

{u'ability': u'levitate',
 u'active': False,
 u'baseAbility': u'levitate',
 u'condition': u'258/258',
 u'details': u'Unown',
 u'ident': u'p1: Unown',
 u'item': u'choicespecs',
 u'moves': [u'hiddenpowerpsychic60'],
 u'pokeball': u'pokeball',
 u'stats': {u'atk': 149, u'def': 153, u'spa': 201, u'spd': 153, u'spe': 153}}

Usually details is of format pokemon_ident level gender_if_any i.e Araquanid, L79, F.

Zarel commented 6 years ago

level is left off of details if it's 100. Unown is level 100 in Random Battle.

details is documented in PROTOCOL.md in the |switch| major action.

https://github.com/Zarel/Pokemon-Showdown/blob/master/PROTOCOL.md#major-actions

Zarel commented 6 years ago

Relevant excerpt of PROTOCOL.md:

DETAILS is a comma-separated list of all information about a pokemon visible on the battle screen: species, shininess, gender, and level. So it starts with SPECIES, adding , shiny if it's shiny, , M if it's male, , F if it's female, , L## if it's not level 100.

So, for instance, Deoxys-Speed is a level 100 non-shiny genderless Deoxys (Speed forme). Sawsbuck, shiny, F, L50 is a level 50 shiny female Sawsbuck (Spring form).