{"action":"created","comment":{"url":"https://api.github.com/repos/vincentzhang96/VahrhedralBot/pulls/comments/77935630","id":77935630,"diff_hunk":"@@ -0,0 +1,125 @@\n+package co.phoenixlab.discord.commands.dn;\r\n+\r\n+import org.slf4j.Logger;\r\n+import org.slf4j.LoggerFactory;\r\n+\r\n+import co.phoenixlab.common.lang.number.ParseInt;\r\n+import co.phoenixlab.common.localization.Localizer;\r\n+import co.phoenixlab.discord.Command;\r\n+import co.phoenixlab.discord.MessageContext;\r\n+import co.phoenixlab.discord.api.DiscordApiClient;\r\n+import co.phoenixlab.discord.util.StringUtilities;\r\n+\r\n+public class CalculateCriticalDamage implements Command{\r\n+\r\n+\tpublic static final double CRITDMG_MAX_PERCENT = 1D;\r\n+\t\r\n+    public static final double[] critDmgCaps = {\r\n+            2650.0, 3074.0, 3498.0, 3922.0, 4346.0, 4770.0, 5194.0, 5618.0,\r\n+            6042.0, 6466.0, 6890.0, 7314.0, 7738.0, 8162.0, 10070.0, 10600.0,\r\n+            11130.0, 11660.0, 12190.0, 12720.0, 13250.0, 13780.0, 14310.0,\r\n+            14840.0, 15635.0, 16430.0, 17225.0, 18020.0, 18815.0, 19610.0,\r\n+            20405.0, 21200.0, 22260.0, 23320.0, 24380.0, 25440.0, 26500.0,\r\n+            27560.0, 28620.0, 29680.0, 31641.0, 33575.0, 35510.0, 37206.0,\r\n+            39326.0, 41419.0, 43513.0, 45553.0, 47832.0, 50350.0, 55650.0,\r\n+            59757.0, 64580.0, 69589.0, 74756.0, 80109.0, 86310.0, 93121.0,\r\n+            99375.0, 103350.0, 107987.0, 113950.0, 121237.0, 129850.0, 139787.0,\r\n+            151050.0, 163637.0, 177894.0, 193794.0, 211337.0, 228555.0, 245520.0,\r\n+            262220.0, 278587.0, 296902.0, 320100.0, 343263.0, 374976.0, 407979.0,\r\n+            431970.0, 453390.0, 474810.0, 496230.0, 517650.0, 542640.0, 567630.0,\r\n+            592620.0, 617610.0, 642600.0, 671160.0, 769692.0, 801108.0, 832524.0,\r\n+            863940.0, 899283.0, 934626.0, 969969.0, 1005312.0, 1040655.0, 1075998.0\r\n+    };\r\n+\tpublic static final int DEFAULT_LEVEL = 80;\r\n+    \r\n+    private static final Logger logger = LoggerFactory.getLogger(CalculateCriticalDamage.class);\r\n+    private Localizer commandLocalizer;\r\n+    \r\n+    public CalculateCriticalDamage(){\r\n+    \tcommandLocalizer = StringUtilities.getLocalizer();\r\n+    }\r\n+    \r\n+    @Override\r\n+    public void handleCommand(MessageContext context, String args){\r\n+    \tDiscordApiClient apiClient = context.getApiClient();\r\n+    \t\r\n+    \tString msgName = \"commands.dn.critdmg.response.invalid\";\r\n+    \tString cmdPrefix = context.getBot().getMainCommandDispatcher().getCommandPrefix();\r\n+    \tString msg = commandLocalizer.localize(msgName, cmdPrefix);\r\n+    \t\r\n+\t\targs = args.replace(\",\", \"\"); //stip commas\r\n+\t\tString[] split = args.split(\" \"); //split the arguments\r\n+\t\t\r\n+\t\ttry{\r\n+\t\t\tint level = DEFAULT_LEVEL;\r\n+\t\t\tswitch(split.length){\r\n+\t\t\t\tcase 2:\r\n+\t\t\t\t\tlevel = ParseInt.parseOrDefault(split[1], level);\r\n+\t\t\t\tcase 1:\r\n+\t\t\t\t\tString value = split[0];\r\n+\t\t\t\t\tif(value.endsWith(\"%\")){\r\n+\t\t\t\t\t\t//Parse the critical damage percentage\r\n+\t\t\t\t\t\tdouble percent = Double.parseDouble(value.substring(0, value.length() -1));\r","path":"src/main/java/co/phoenixlab/discord/commands/dn/CalculateCriticalDamage.java","position":62,"original_position":62,"commit_id":"4b33f066ef946a7940aa76eeeff252b7d90cb7ee","original_commit_id":"4b33f066ef946a7940aa76eeeff252b7d90cb7ee","user":{"login":"vincentzhang96","id":6023772,"avatar_url":"https://avatars.githubusercontent.com/u/6023772?v=3","gravatar_id":"","url":"https://api.github.com/users/vincentzhang96","html_url":"https://github.com/vincentzhang96","followers_url":"https://api.github.com/users/vincentzhang96/followers","following_url":"https://api.github.com/users/vincentzhang96/following{/other_user}","gists_url":"https://api.github.com/users/vincentzhang96/gists{/gist_id}","starred_url":"https://api.github.com/users/vincentzhang96/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vincentzhang96/subscriptions","organizations_url":"https://api.github.com/users/vincentzhang96/orgs","repos_url":"https://api.github.com/users/vincentzhang96/repos","events_url":"https://api.github.com/users/vincentzhang96/events{/privacy}","received_events_url":"https://api.github.com/users/vincentzhang96/received_events","type":"User","site_admin":false},"body":"Space b/w - and 1","created_at":"2016-09-08T01:58:53Z","updated_at":"2016-09-08T01:58:53Z","html_url":"https://github.com/vincentzhang96/VahrhedralBot/pull/17#discussion_r77935630","pull_request_url":"https://api.github.com/repos/vincentzhang96/VahrhedralBot/pulls/17","_links":{"self":{"href":"https://api.github.com/repos/vincentzhang96/VahrhedralBot/pulls/comments/77935630"},"html":{"href":"https://github.com/vincentzhang96/VahrhedralBot/pull/17#discussion_r77935630"},"pull_request":{"href":"https://api.github.com/repos/vincentzhang96/VahrhedralBot/pulls/17"}}},"pull_request":{"url":"https://api.github.com/repos/vincentzhang96/VahrhedralBot/pulls/17","id":84362357,"html_url":"https://github.com/vincentzhang96/VahrhedralBot/pull/17","diff_url":"https://github.com/vincentzhang96/VahrhedralBot/pull/17.diff","patch_url":"https://github.com/vincentzhang96/VahrhedralBot/pull/17.patch","issue_url":"https://api.github.com/repos/vincentzhang96/VahrhedralBot/issues/17","number":17,"state":"open","locked":false,"title":"critical chance calculator","user":{"login":"Aelphaeis","id":3504374,"avatar_url":"https://avatars.githubusercontent.com/u/3504374?v=3","gravatar_id":"","url":"https://api.github.com/users/Aelphaeis","html_url":"https://github.com/Aelphaeis","followers_url":"https://api.github.com/users/Aelphaeis/followers","following_url":"https://api.github.com/users/Aelphaeis/following{/other_user}","gists_url":"https://api.github.com/users/Aelphaeis/gists{/gist_id}","starred_url":"https://api.github.com/users/Aelphaeis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Aelphaeis/subscriptions","organizations_url":"https://api.github.com/users/Aelphaeis/orgs","repos_url":"https://api.github.com/users/Aelphaeis/repos","events_url":"https://api.github.com/users/Aelphaeis/events{/privacy}","received_events_url":"https://api.github.com/users/Aelphaeis/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-09-07T19:53:25Z","updated_at":"2016-09-08T01:58:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4799501d41f697ac4d6c6238c02ca9ae7251be16","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/vincentzhang96/VahrhedralBot/pulls/17/commits","review_comments_url":"https://api.github.com/repos/vincentzhang96/VahrhedralBot/pulls/17/comments","review_comment_url":"https://api.github.com/repos/vincentzhang96/VahrhedralBot/pulls/comments{/number}","comments_url":"https://api.github.com/repos/vincentzhang96/VahrhedralBot/issues/17/comments","statuses_url":"https://api.github.com/repos/vincentzhang96/VahrhedralBot/statuses/4b33f066ef946a7940aa76eeeff252b7d90cb7ee","head":{"label":"Aelphaeis:1.0.0","ref":"1.0.0","sha":"4b33f066ef946a7940aa76eeeff252b7d90cb7ee","user":{"login":"Aelphaeis","id":3504374,"avatar_url":"https://avatars.githubusercontent.com/u/3504374?v=3","gravatar_id":"","url":"https://api.github.com/users/Aelphaeis","html_url":"https://github.com/Aelphaeis","followers_url":"https://api.github.com/users/Aelphaeis/followers","following_url":"https://api.github.com/users/Aelphaeis/following{/other_user}","gists_url":"https://api.github.com/users/Aelphaeis/gists{/gist_id}","starred_url":"https://api.github.com/users/Aelphaeis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Aelphaeis/subscriptions","organizations_url":"https://api.github.com/users/Aelphaeis/orgs","repos_url":"https://api.github.com/users/Aelphaeis/repos","events_url":"https://api.github.com/users/Aelphaeis/events{/privacy}","received_events_url":"https://api.github.com/users/Aelphaeis/received_events","type":"User","site_admin":false},"repo":{"id":67623160,"name":"VahrhedralBot","full_name":"Aelphaeis/VahrhedralBot","owner":{"login":"Aelphaeis","id":3504374,"avatar_url":"https://avatars.githubusercontent.com/u/3504374?v=3","gravatar_id":"","url":"https://api.github.com/users/Aelphaeis","html_url":"https://github.com/Aelphaeis","followers_url":"https://api.github.com/users/Aelphaeis/followers","following_url":"https://api.github.com/users/Aelphaeis/following{/other_user}","gists_url":"https://api.github.com/users/Aelphaeis/gists{/gist_id}","starred_url":"https://api.github.com/users/Aelphaeis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Aelphaeis/subscriptions","organizations_url":"https://api.github.com/users/Aelphaeis/orgs","repos_url":"https://api.github.com/users/Aelphaeis/repos","events_url":"https://api.github.com/users/Aelphaeis/events{/privacy}","received_events_url":"https://api.github.com/users/Aelphaeis/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Aelphaeis/VahrhedralBot","description":"Vahrheit's Discord bot","fork":true,"url":"https://api.github.com/repos/Aelphaeis/VahrhedralBot","forks_url":"https://api.github.com/repos/Aelphaeis/VahrhedralBot/forks","keys_url":"https://api.github.com/repos/Aelphaeis/VahrhedralBot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Aelphaeis/VahrhedralBot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Aelphaeis/VahrhedralBot/teams","hooks_url":"https://api.github.com/repos/Aelphaeis/VahrhedralBot/hooks","issue_events_url":"https://api.github.com/repos/Aelphaeis/VahrhedralBot/issues/events{/number}","events_url":"https://api.github.com/repos/Aelphaeis/VahrhedralBot/events","assignees_url":"https://api.github.com/repos/Aelphaeis/VahrhedralBot/assignees{/user}","branches_url":"https://api.github.com/repos/Aelphaeis/VahrhedralBot/branches{/branch}","tags_url":"https://api.github.com/repos/Aelphaeis/VahrhedralBot/tags","blobs_url":"https://api.github.com/repos/Aelphaeis/VahrhedralBot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Aelphaeis/VahrhedralBot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Aelphaeis/VahrhedralBot/git/refs{/sha}","trees_url":"https://api.github.com/repos/Aelphaeis/VahrhedralBot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Aelphaeis/VahrhedralBot/statuses/{sha}","languages_url":"https://api.github.com/repos/Aelphaeis/VahrhedralBot/languages","stargazers_url":"https://api.github.com/repos/Aelphaeis/VahrhedralBot/stargazers","contributors_url":"https://api.github.com/repos/Aelphaeis/VahrhedralBot/contributors","subscribers_url":"https://api.github.com/repos/Aelphaeis/VahrhedralBot/subscribers","subscription_url":"https://api.github.com/repos/Aelphaeis/VahrhedralBot/subscription","commits_url":"https://api.github.com/repos/Aelphaeis/VahrhedralBot/commits{/sha}","git_commits_url":"https://api.github.com/repos/Aelphaeis/VahrhedralBot/git/commits{/sha}","comments_url":"https://api.github.com/repos/Aelphaeis/VahrhedralBot/comments{/number}","issue_comment_url":"https://api.github.com/repos/Aelphaeis/VahrhedralBot/issues/comments{/number}","contents_url":"https://api.github.com/repos/Aelphaeis/VahrhedralBot/contents/{+path}","compare_url":"https://api.github.com/repos/Aelphaeis/VahrhedralBot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Aelphaeis/VahrhedralBot/merges","archive_url":"https://api.github.com/repos/Aelphaeis/VahrhedralBot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Aelphaeis/VahrhedralBot/downloads","issues_url":"https://api.github.com/repos/Aelphaeis/VahrhedralBot/issues{/number}","pulls_url":"https://api.github.com/repos/Aelphaeis/VahrhedralBot/pulls{/number}","milestones_url":"https://api.github.com/repos/Aelphaeis/VahrhedralBot/milestones{/number}","notifications_url":"https://api.github.com/repos/Aelphaeis/VahrhedralBot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Aelphaeis/VahrhedralBot/labels{/name}","releases_url":"https://api.github.com/repos/Aelphaeis/VahrhedralBot/releases{/id}","deployments_url":"https://api.github.com/repos/Aelphaeis/VahrhedralBot/deployments","created_at":"2016-09-07T16:09:53Z","updated_at":"2016-09-07T16:09:54Z","pushed_at":"2016-09-07T19:58:03Z","git_url":"git://github.com/Aelphaeis/VahrhedralBot.git","ssh_url":"git@github.com:Aelphaeis/VahrhedralBot.git","clone_url":"https://github.com/Aelphaeis/VahrhedralBot.git","svn_url":"https://github.com/Aelphaeis/VahrhedralBot","homepage":"","size":736,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"vincentzhang96:master","ref":"master","sha":"decd63b10f1c03f24437b7caf03157bc54ebc9b5","user":{"login":"vincentzhang96","id":6023772,"avatar_url":"https://avatars.githubusercontent.com/u/6023772?v=3","gravatar_id":"","url":"https://api.github.com/users/vincentzhang96","html_url":"https://github.com/vincentzhang96","followers_url":"https://api.github.com/users/vincentzhang96/followers","following_url":"https://api.github.com/users/vincentzhang96/following{/other_user}","gists_url":"https://api.github.com/users/vincentzhang96/gists{/gist_id}","starred_url":"https://api.github.com/users/vincentzhang96/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vincentzhang96/subscriptions","organizations_url":"https://api.github.com/users/vincentzhang96/orgs","repos_url":"https://api.github.com/users/vincentzhang96/repos","events_url":"https://api.github.com/users/vincentzhang96/events{/privacy}","received_events_url":"https://api.github.com/users/vincentzhang96/received_events","type":"User","site_admin":false},"repo":{"id":44711440,"name":"VahrhedralBot","full_name":"vincentzhang96/VahrhedralBot","owner":{"login":"vincentzhang96","id":6023772,"avatar_url":"https://avatars.githubusercontent.com/u/6023772?v=3","gravatar_id":"","url":"https://api.github.com/users/vincentzhang96","html_url":"https://github.com/vincentzhang96","followers_url":"https://api.github.com/users/vincentzhang96/followers","following_url":"https://api.github.com/users/vincentzhang96/following{/other_user}","gists_url":"https://api.github.com/users/vincentzhang96/gists{/gist_id}","starred_url":"https://api.github.com/users/vincentzhang96/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vincentzhang96/subscriptions","organizations_url":"https://api.github.com/users/vincentzhang96/orgs","repos_url":"https://api.github.com/users/vincentzhang96/repos","events_url":"https://api.github.com/users/vincentzhang96/events{/privacy}","received_events_url":"https://api.github.com/users/vincentzhang96/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vincentzhang96/VahrhedralBot","description":"Vahrheit's Discord bot","fork":false,"url":"https://api.github.com/repos/vincentzhang96/VahrhedralBot","forks_url":"https://api.github.com/repos/vincentzhang96/VahrhedralBot/forks","keys_url":"https://api.github.com/repos/vincentzhang96/VahrhedralBot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vincentzhang96/VahrhedralBot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vincentzhang96/VahrhedralBot/teams","hooks_url":"https://api.github.com/repos/vincentzhang96/VahrhedralBot/hooks","issue_events_url":"https://api.github.com/repos/vincentzhang96/VahrhedralBot/issues/events{/number}","events_url":"https://api.github.com/repos/vincentzhang96/VahrhedralBot/events","assignees_url":"https://api.github.com/repos/vincentzhang96/VahrhedralBot/assignees{/user}","branches_url":"https://api.github.com/repos/vincentzhang96/VahrhedralBot/branches{/branch}","tags_url":"https://api.github.com/repos/vincentzhang96/VahrhedralBot/tags","blobs_url":"https://api.github.com/repos/vincentzhang96/VahrhedralBot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vincentzhang96/VahrhedralBot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vincentzhang96/VahrhedralBot/git/refs{/sha}","trees_url":"https://api.github.com/repos/vincentzhang96/VahrhedralBot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vincentzhang96/VahrhedralBot/statuses/{sha}","languages_url":"https://api.github.com/repos/vincentzhang96/VahrhedralBot/languages","stargazers_url":"https://api.github.com/repos/vincentzhang96/VahrhedralBot/stargazers","contributors_url":"https://api.github.com/repos/vincentzhang96/VahrhedralBot/contributors","subscribers_url":"https://api.github.com/repos/vincentzhang96/VahrhedralBot/subscribers","subscription_url":"https://api.github.com/repos/vincentzhang96/VahrhedralBot/subscription","commits_url":"https://api.github.com/repos/vincentzhang96/VahrhedralBot/commits{/sha}","git_commits_url":"https://api.github.com/repos/vincentzhang96/VahrhedralBot/git/commits{/sha}","comments_url":"https://api.github.com/repos/vincentzhang96/VahrhedralBot/comments{/number}","issue_comment_url":"https://api.github.com/repos/vincentzhang96/VahrhedralBot/issues/comments{/number}","contents_url":"https://api.github.com/repos/vincentzhang96/VahrhedralBot/contents/{+path}","compare_url":"https://api.github.com/repos/vincentzhang96/VahrhedralBot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vincentzhang96/VahrhedralBot/merges","archive_url":"https://api.github.com/repos/vincentzhang96/VahrhedralBot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vincentzhang96/VahrhedralBot/downloads","issues_url":"https://api.github.com/repos/vincentzhang96/VahrhedralBot/issues{/number}","pulls_url":"https://api.github.com/repos/vincentzhang96/VahrhedralBot/pulls{/number}","milestones_url":"https://api.github.com/repos/vincentzhang96/VahrhedralBot/milestones{/number}","notifications_url":"https://api.github.com/repos/vincentzhang96/VahrhedralBot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vincentzhang96/VahrhedralBot/labels{/name}","releases_url":"https://api.github.com/repos/vincentzhang96/VahrhedralBot/releases{/id}","deployments_url":"https://api.github.com/repos/vincentzhang96/VahrhedralBot/deployments","created_at":"2015-10-22T00:04:00Z","updated_at":"2016-01-11T19:34:55Z","pushed_at":"2016-09-08T01:54:09Z","git_url":"git://github.com/vincentzhang96/VahrhedralBot.git","ssh_url":"git@github.com:vincentzhang96/VahrhedralBot.git","clone_url":"https://github.com/vincentzhang96/VahrhedralBot.git","svn_url":"https://github.com/vincentzhang96/VahrhedralBot","homepage":"","size":745,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":6,"forks":1,"open_issues":6,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/vincentzhang96/VahrhedralBot/pulls/17"},"html":{"href":"https://github.com/vincentzhang96/VahrhedralBot/pull/17"},"issue":{"href":"https://api.github.com/repos/vincentzhang96/VahrhedralBot/issues/17"},"comments":{"href":"https://api.github.com/repos/vincentzhang96/VahrhedralBot/issues/17/comments"},"review_comments":{"href":"https://api.github.com/repos/vincentzhang96/VahrhedralBot/pulls/17/comments"},"review_comment":{"href":"https://api.github.com/repos/vincentzhang96/VahrhedralBot/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/vincentzhang96/VahrhedralBot/pulls/17/commits"},"statuses":{"href":"https://api.github.com/repos/vincentzhang96/VahrhedralBot/statuses/4b33f066ef946a7940aa76eeeff252b7d90cb7ee"}}}}
{"actor":{"display_login":"vincentzhang96"}}