{"action":"created","comment":{"url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/pulls/comments/23138114","id":23138114,"diff_hunk":"@@ -55,128 +27,59 @@ window.addEventListener('load', function () {\n         return char;\n     };\n \n-    var simulador2 = function (name1, name2) {\n-        var chars, totalDamage, i = 0, char1, char2;\n-\n-        char1 = generateChar(name1);\n-        char2 = generateChar(name2);\n-\n-        chars = [char1, char2];\n-\n-        while (chars[0].life > 0 && chars[1].life > 0) {\n-\n-            if (i % 2 === 0) {\n-                totalDamage = (char1.strength * Math.ceil(Math.random() * 6)) - (char2.armor * Math.ceil(Math.random() * 6));\n-                if (totalDamage > 0) {\n-                    chars[1].life = chars[1].life - totalDamage;\n-                }\n-            } else {\n-                totalDamage = (char2.strength * Math.ceil(Math.random() * 6)) - (char1.armor * Math.ceil(Math.random() * 6));\n-                if (totalDamage > 0) {\n-                    chars[0].life = chars[0].life - totalDamage;\n-                }\n-            }\n-\n-            i += 1;\n-        }\n-\n-        if (chars[1].life <= 0) {\n-            chars[0].status = 'Winner';\n-        } else {\n-            chars[1].status = 'Winner';\n-        }\n-\n-        return chars[0].status === 'Winner' ? chars[0] : chars[1];\n-    };\n-\n-\n     var atacar = function() {\n-        var totalDamage;\n-        var avatars = document.querySelectorAll('.avatar');\n-        avatars.item(0).classList.add('normal');\n-        avatars.item(1).classList.add('normal');\n-        if (char1.life > 0 && char2.life > 0) {\n-            totalDamage = (char1.strength * Math.ceil(Math.random() * 6)) - (char2.armor * Math.ceil(Math.random() * 6));\n-            if (totalDamage > 0) {\n-                interval = setInterval(function(){\n-                    if (avatars.item(0).classList.contains('normal')) {\n-                        avatars.item(0).classList.add('atk-1');\n-                        avatars.item(0).classList.remove('normal');\n-                        avatars[0].src = 'img/characters/arch-mage-attack-staff-1.png';\n-                    } else if (avatars.item(0).classList.contains('atk-1')) {\n-                        avatars.item(0).classList.remove('atk-1');\n-                        avatars.item(0).classList.add('atk-2');\n-                        avatars[0].src = 'img/characters/arch-mage-attack-staff-2.png';\n-                    } else {\n-                        avatars[0].src = 'img/characters/arch-mage.png';\n-                        interval = null;\n-                    }}, 150);\n-                char2.life = char2.life - totalDamage;\n-            }\n-            if(char2.life > 0) {\n-                totalDamage = (char2.strength * Math.ceil(Math.random() * 6)) - (char1.armor * Math.ceil(Math.random() * 6));\n-                if (totalDamage > 0) {\n-                    interval = setInterval(function(){\n-                    if (avatars.item(1).classList.contains('normal')) {\n-                        avatars.item(1).classList.add('atk-1');\n-                        avatars.item(1).classList.remove('normal');\n-                        avatars[1].src = 'img/characters/arch-mage-attack-staff-1.png';\n-                    } else if (avatars.item(1).classList.contains('atk-1')) {\n-                        avatars.item(1).classList.remove('atk-1');\n-                        avatars.item(1).classList.add('atk-2');\n-                        avatars[1].src = 'img/characters/arch-mage-attack-staff-2.png';\n-                    } else {\n-                        avatars[1].src = 'img/characters/arch-mage.png';\n-                        interval = null;\n-                    }}, 150);\n-                    char1.life = char1.life - totalDamage;\n-                }\n+        if (player.life > 0 && enemy.life > 0) {\n+            player.attack(enemy);\n+            (new CharacterComponent('player', player)).show();","path":"js/javascript.js","position":119,"original_position":119,"commit_id":"ee052d6aaee11606d51d5c06f285498fb42d109f","original_commit_id":"ee052d6aaee11606d51d5c06f285498fb42d109f","user":{"login":"marcoafilho","id":168136,"avatar_url":"https://avatars.githubusercontent.com/u/168136?v=3","gravatar_id":"","url":"https://api.github.com/users/marcoafilho","html_url":"https://github.com/marcoafilho","followers_url":"https://api.github.com/users/marcoafilho/followers","following_url":"https://api.github.com/users/marcoafilho/following{/other_user}","gists_url":"https://api.github.com/users/marcoafilho/gists{/gist_id}","starred_url":"https://api.github.com/users/marcoafilho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcoafilho/subscriptions","organizations_url":"https://api.github.com/users/marcoafilho/orgs","repos_url":"https://api.github.com/users/marcoafilho/repos","events_url":"https://api.github.com/users/marcoafilho/events{/privacy}","received_events_url":"https://api.github.com/users/marcoafilho/received_events","type":"User","site_admin":false},"body":"Eu vi depois.","created_at":"2015-01-18T23:08:07Z","updated_at":"2015-01-18T23:08:07Z","html_url":"https://github.com/jeffersonrnb/you-shall-not-pass/pull/11#discussion_r23138114","pull_request_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/pulls/11","_links":{"self":{"href":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/pulls/comments/23138114"},"html":{"href":"https://github.com/jeffersonrnb/you-shall-not-pass/pull/11#discussion_r23138114"},"pull_request":{"href":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/pulls/11"}}},"pull_request":{"url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/pulls/11","id":27358651,"html_url":"https://github.com/jeffersonrnb/you-shall-not-pass/pull/11","diff_url":"https://github.com/jeffersonrnb/you-shall-not-pass/pull/11.diff","patch_url":"https://github.com/jeffersonrnb/you-shall-not-pass/pull/11.patch","issue_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/issues/11","number":11,"state":"closed","locked":false,"title":"Adiciona animação de personagem","user":{"login":"jeffersonrnb","id":7280753,"avatar_url":"https://avatars.githubusercontent.com/u/7280753?v=3","gravatar_id":"","url":"https://api.github.com/users/jeffersonrnb","html_url":"https://github.com/jeffersonrnb","followers_url":"https://api.github.com/users/jeffersonrnb/followers","following_url":"https://api.github.com/users/jeffersonrnb/following{/other_user}","gists_url":"https://api.github.com/users/jeffersonrnb/gists{/gist_id}","starred_url":"https://api.github.com/users/jeffersonrnb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeffersonrnb/subscriptions","organizations_url":"https://api.github.com/users/jeffersonrnb/orgs","repos_url":"https://api.github.com/users/jeffersonrnb/repos","events_url":"https://api.github.com/users/jeffersonrnb/events{/privacy}","received_events_url":"https://api.github.com/users/jeffersonrnb/received_events","type":"User","site_admin":false},"body":"Adiciona components(character e character_attributes)\r\n\r\nCorrige bug de atributos fora do range permitido de pontos\r\n\r\nAdiciona sprite 'arch-mage-attack-3.png'\r\n\r\nRefs #6","created_at":"2015-01-14T15:44:22Z","updated_at":"2015-01-18T23:08:08Z","closed_at":"2015-01-15T18:26:24Z","merged_at":"2015-01-15T18:26:24Z","merge_commit_sha":"1db7dcd971fcfbf80fc8f008b49c8817a42401d8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/pulls/11/commits","review_comments_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/pulls/11/comments","review_comment_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/pulls/comments/{number}","comments_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/issues/11/comments","statuses_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/statuses/ee052d6aaee11606d51d5c06f285498fb42d109f","head":{"label":"jeffersonrnb:6-animacao-personagens","ref":"6-animacao-personagens","sha":"ee052d6aaee11606d51d5c06f285498fb42d109f","user":{"login":"jeffersonrnb","id":7280753,"avatar_url":"https://avatars.githubusercontent.com/u/7280753?v=3","gravatar_id":"","url":"https://api.github.com/users/jeffersonrnb","html_url":"https://github.com/jeffersonrnb","followers_url":"https://api.github.com/users/jeffersonrnb/followers","following_url":"https://api.github.com/users/jeffersonrnb/following{/other_user}","gists_url":"https://api.github.com/users/jeffersonrnb/gists{/gist_id}","starred_url":"https://api.github.com/users/jeffersonrnb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeffersonrnb/subscriptions","organizations_url":"https://api.github.com/users/jeffersonrnb/orgs","repos_url":"https://api.github.com/users/jeffersonrnb/repos","events_url":"https://api.github.com/users/jeffersonrnb/events{/privacy}","received_events_url":"https://api.github.com/users/jeffersonrnb/received_events","type":"User","site_admin":false},"repo":{"id":29098280,"name":"you-shall-not-pass","full_name":"jeffersonrnb/you-shall-not-pass","owner":{"login":"jeffersonrnb","id":7280753,"avatar_url":"https://avatars.githubusercontent.com/u/7280753?v=3","gravatar_id":"","url":"https://api.github.com/users/jeffersonrnb","html_url":"https://github.com/jeffersonrnb","followers_url":"https://api.github.com/users/jeffersonrnb/followers","following_url":"https://api.github.com/users/jeffersonrnb/following{/other_user}","gists_url":"https://api.github.com/users/jeffersonrnb/gists{/gist_id}","starred_url":"https://api.github.com/users/jeffersonrnb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeffersonrnb/subscriptions","organizations_url":"https://api.github.com/users/jeffersonrnb/orgs","repos_url":"https://api.github.com/users/jeffersonrnb/repos","events_url":"https://api.github.com/users/jeffersonrnb/events{/privacy}","received_events_url":"https://api.github.com/users/jeffersonrnb/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jeffersonrnb/you-shall-not-pass","description":"GH Pages","fork":false,"url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass","forks_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/forks","keys_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/teams","hooks_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/hooks","issue_events_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/issues/events{/number}","events_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/events","assignees_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/assignees{/user}","branches_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/branches{/branch}","tags_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/tags","blobs_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/git/refs{/sha}","trees_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/statuses/{sha}","languages_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/languages","stargazers_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/stargazers","contributors_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/contributors","subscribers_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/subscribers","subscription_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/subscription","commits_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/commits{/sha}","git_commits_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/git/commits{/sha}","comments_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/comments{/number}","issue_comment_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/issues/comments/{number}","contents_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/contents/{+path}","compare_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/merges","archive_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/downloads","issues_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/issues{/number}","pulls_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/pulls{/number}","milestones_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/milestones{/number}","notifications_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/labels{/name}","releases_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/releases{/id}","created_at":"2015-01-11T16:44:02Z","updated_at":"2015-01-16T02:59:14Z","pushed_at":"2015-01-16T02:58:07Z","git_url":"git://github.com/jeffersonrnb/you-shall-not-pass.git","ssh_url":"git@github.com:jeffersonrnb/you-shall-not-pass.git","clone_url":"https://github.com/jeffersonrnb/you-shall-not-pass.git","svn_url":"https://github.com/jeffersonrnb/you-shall-not-pass","homepage":"http://jeffersonrnb.github.io/you-shall-not-pass/","size":17648,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":8,"forks":0,"open_issues":8,"watchers":0,"default_branch":"master"}},"base":{"label":"jeffersonrnb:master","ref":"master","sha":"40729c1f7f5ce903a754445202418006d9f2f98d","user":{"login":"jeffersonrnb","id":7280753,"avatar_url":"https://avatars.githubusercontent.com/u/7280753?v=3","gravatar_id":"","url":"https://api.github.com/users/jeffersonrnb","html_url":"https://github.com/jeffersonrnb","followers_url":"https://api.github.com/users/jeffersonrnb/followers","following_url":"https://api.github.com/users/jeffersonrnb/following{/other_user}","gists_url":"https://api.github.com/users/jeffersonrnb/gists{/gist_id}","starred_url":"https://api.github.com/users/jeffersonrnb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeffersonrnb/subscriptions","organizations_url":"https://api.github.com/users/jeffersonrnb/orgs","repos_url":"https://api.github.com/users/jeffersonrnb/repos","events_url":"https://api.github.com/users/jeffersonrnb/events{/privacy}","received_events_url":"https://api.github.com/users/jeffersonrnb/received_events","type":"User","site_admin":false},"repo":{"id":29098280,"name":"you-shall-not-pass","full_name":"jeffersonrnb/you-shall-not-pass","owner":{"login":"jeffersonrnb","id":7280753,"avatar_url":"https://avatars.githubusercontent.com/u/7280753?v=3","gravatar_id":"","url":"https://api.github.com/users/jeffersonrnb","html_url":"https://github.com/jeffersonrnb","followers_url":"https://api.github.com/users/jeffersonrnb/followers","following_url":"https://api.github.com/users/jeffersonrnb/following{/other_user}","gists_url":"https://api.github.com/users/jeffersonrnb/gists{/gist_id}","starred_url":"https://api.github.com/users/jeffersonrnb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeffersonrnb/subscriptions","organizations_url":"https://api.github.com/users/jeffersonrnb/orgs","repos_url":"https://api.github.com/users/jeffersonrnb/repos","events_url":"https://api.github.com/users/jeffersonrnb/events{/privacy}","received_events_url":"https://api.github.com/users/jeffersonrnb/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jeffersonrnb/you-shall-not-pass","description":"GH Pages","fork":false,"url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass","forks_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/forks","keys_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/teams","hooks_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/hooks","issue_events_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/issues/events{/number}","events_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/events","assignees_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/assignees{/user}","branches_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/branches{/branch}","tags_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/tags","blobs_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/git/refs{/sha}","trees_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/statuses/{sha}","languages_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/languages","stargazers_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/stargazers","contributors_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/contributors","subscribers_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/subscribers","subscription_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/subscription","commits_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/commits{/sha}","git_commits_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/git/commits{/sha}","comments_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/comments{/number}","issue_comment_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/issues/comments/{number}","contents_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/contents/{+path}","compare_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/merges","archive_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/downloads","issues_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/issues{/number}","pulls_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/pulls{/number}","milestones_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/milestones{/number}","notifications_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/labels{/name}","releases_url":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/releases{/id}","created_at":"2015-01-11T16:44:02Z","updated_at":"2015-01-16T02:59:14Z","pushed_at":"2015-01-16T02:58:07Z","git_url":"git://github.com/jeffersonrnb/you-shall-not-pass.git","ssh_url":"git@github.com:jeffersonrnb/you-shall-not-pass.git","clone_url":"https://github.com/jeffersonrnb/you-shall-not-pass.git","svn_url":"https://github.com/jeffersonrnb/you-shall-not-pass","homepage":"http://jeffersonrnb.github.io/you-shall-not-pass/","size":17648,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":8,"forks":0,"open_issues":8,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/pulls/11"},"html":{"href":"https://github.com/jeffersonrnb/you-shall-not-pass/pull/11"},"issue":{"href":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/issues/11"},"comments":{"href":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/issues/11/comments"},"review_comments":{"href":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/pulls/11/comments"},"review_comment":{"href":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/pulls/11/commits"},"statuses":{"href":"https://api.github.com/repos/jeffersonrnb/you-shall-not-pass/statuses/ee052d6aaee11606d51d5c06f285498fb42d109f"}}}}