{"action":"created","issue":{"url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/issues/1157","repository_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown","labels_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/issues/1157/labels{/name}","comments_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/issues/1157/comments","events_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/issues/1157/events","html_url":"https://github.com/Zarel/Pokemon-Showdown/issues/1157","id":40873006,"number":1157,"title":"Turn Order needs to be handled how it is in-game","user":{"login":"DanUgore","id":3052691,"avatar_url":"https://avatars.githubusercontent.com/u/3052691?v=3","gravatar_id":"","url":"https://api.github.com/users/DanUgore","html_url":"https://github.com/DanUgore","followers_url":"https://api.github.com/users/DanUgore/followers","following_url":"https://api.github.com/users/DanUgore/following{/other_user}","gists_url":"https://api.github.com/users/DanUgore/gists{/gist_id}","starred_url":"https://api.github.com/users/DanUgore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanUgore/subscriptions","organizations_url":"https://api.github.com/users/DanUgore/orgs","repos_url":"https://api.github.com/users/DanUgore/repos","events_url":"https://api.github.com/users/DanUgore/events{/privacy}","received_events_url":"https://api.github.com/users/DanUgore/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/labels/bug","name":"bug","color":"e11d21"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":15,"created_at":"2014-08-22T02:55:50Z","updated_at":"2016-04-26T21:47:13Z","closed_at":null,"body":"Mostly relevant to VGC and Triples. At the moment it is done using a sorting function which compares two pokemon at a time while ordering based on speed.\r\nProperly handling this issue will involve:\r\n - determining turn order before any moves are played out\r\n - sorting the pokemon based on the in-game sort function. this includes using ``speed & 8191`` over ``speed`` for comparisons.\r\n\r\n- using the battle's rng -- ``this.random()`` -- to determine speed-ties\r\n\r\nThis will also allow us to not require ``getStatCallback()`` for the \"Trick Room Glitch\""},"comment":{"url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/issues/comments/214898014","html_url":"https://github.com/Zarel/Pokemon-Showdown/issues/1157#issuecomment-214898014","issue_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/issues/1157","id":214898014,"user":{"login":"Zarel","id":551184,"avatar_url":"https://avatars.githubusercontent.com/u/551184?v=3","gravatar_id":"","url":"https://api.github.com/users/Zarel","html_url":"https://github.com/Zarel","followers_url":"https://api.github.com/users/Zarel/followers","following_url":"https://api.github.com/users/Zarel/following{/other_user}","gists_url":"https://api.github.com/users/Zarel/gists{/gist_id}","starred_url":"https://api.github.com/users/Zarel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zarel/subscriptions","organizations_url":"https://api.github.com/users/Zarel/orgs","repos_url":"https://api.github.com/users/Zarel/repos","events_url":"https://api.github.com/users/Zarel/events{/privacy}","received_events_url":"https://api.github.com/users/Zarel/received_events","type":"User","site_admin":false},"created_at":"2016-04-26T21:47:13Z","updated_at":"2016-04-26T21:47:13Z","body":"Depending on how Game Freak implements multiple speed ties, this could work completely differently in that case."}}