{"action":"created","comment":{"url":"https://api.github.com/repos/privat/nit/pulls/comments/25756742","id":25756742,"diff_hunk":"@@ -400,3 +400,118 @@ class Player10KCommits\n \tredef var reward = 10000\n \tredef var threshold = 10000\n end\n+\n+#####################\n+### Issue Comments\n+#####################\n+\n+# Unlock achievement after X issue comments.\n+#\n+# Used to factorize behavior.\n+abstract class PlayerXComments\n+\tsuper AchievementReactor\n+\n+\t# Number of comments required to unlock the achievement.\n+\tvar threshold: Int is noinit\n+\n+\tredef fun react_event(game, event) do\n+\t\tif not event isa IssueCommentEvent then return\n+\t\tif not event.action == \"created\" then return\n+\t\tvar player = event.comment.user.player(game)\n+\t\tif player.stats[\"comments\"] == threshold then\n+\t\t\tvar a = new_achievement(game)\n+\t\t\tplayer.unlock_achievement(a, event)\n+\t\tend\n+\tend\n+end\n+\n+# Player author his first comment in issues.\n+class Player1Comment\n+\tsuper PlayerXComments\n+\n+\tredef var id = \"player_1_comment\"\n+\tredef var name = \"From lurker to member\"\n+\tredef var desc = \"Comment on an issue.\"\n+\tredef var reward = 10\n+\tredef var threshold = 1\n+end\n+\n+# Player author 100 issue comments.\n+class Player100Comments\n+\tsuper PlayerXComments\n+\n+\tredef var id = \"player_100_comments\"\n+\tredef var name = \"Tchatter\"\n+\tredef var desc = \"Comment 100 times on issues.\"\n+\tredef var reward = 100\n+\tredef var threshold = 100\n+end\n+\n+# Player author 1000 issue comments.\n+class Player1KComments\n+\tsuper PlayerXComments\n+\n+\tredef var id = \"player_1000__comments\"\n+\tredef var name = \"You sir, talk a lot!\"\n+\tredef var desc = \"Comment 1000 times on issues.\"\n+\tredef var reward = 1000\n+\tredef var threshold = 1000\n+end\n+\n+# Ping @privat in a comment.\n+class PlayerPingGod\n+\tsuper AchievementReactor\n+\n+\tredef var id = \"player_ping_god\"\n+\tredef var name = \"Ping god\"\n+\tredef var desc = \"Ping @privat for the first time.\"","path":"contrib/nitrpg/src/achievements.nit","position":68,"original_position":68,"commit_id":"e1e506ff4c0fc490eb85d0f2a8325cef7970363d","original_commit_id":"e1e506ff4c0fc490eb85d0f2a8325cef7970363d","user":{"login":"privat","id":135828,"avatar_url":"https://avatars.githubusercontent.com/u/135828?v=3","gravatar_id":"","url":"https://api.github.com/users/privat","html_url":"https://github.com/privat","followers_url":"https://api.github.com/users/privat/followers","following_url":"https://api.github.com/users/privat/following{/other_user}","gists_url":"https://api.github.com/users/privat/gists{/gist_id}","starred_url":"https://api.github.com/users/privat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/privat/subscriptions","organizations_url":"https://api.github.com/users/privat/orgs","repos_url":"https://api.github.com/users/privat/repos","events_url":"https://api.github.com/users/privat/events{/privacy}","received_events_url":"https://api.github.com/users/privat/received_events","type":"User","site_admin":false},"body":"J'aurais mis dans un module a part les trucs pur nit pour les distinguer des trucs qui s'appliquerait à n'importe quel projet.\r\nUne autre façon de faire serait d'utiliser le propriétaire du dépôt considéré plutôt que de coder en dur telle ou telle personne.","created_at":"2015-03-04T07:40:24Z","updated_at":"2015-03-04T07:40:24Z","html_url":"https://github.com/privat/nit/pull/1185#discussion_r25756742","pull_request_url":"https://api.github.com/repos/privat/nit/pulls/1185","_links":{"self":{"href":"https://api.github.com/repos/privat/nit/pulls/comments/25756742"},"html":{"href":"https://github.com/privat/nit/pull/1185#discussion_r25756742"},"pull_request":{"href":"https://api.github.com/repos/privat/nit/pulls/1185"}}},"pull_request":{"url":"https://api.github.com/repos/privat/nit/pulls/1185","id":30406928,"html_url":"https://github.com/privat/nit/pull/1185","diff_url":"https://github.com/privat/nit/pull/1185.diff","patch_url":"https://github.com/privat/nit/pull/1185.patch","issue_url":"https://api.github.com/repos/privat/nit/issues/1185","number":1185,"state":"open","locked":false,"title":"nitrpg: minor enhancements","user":{"login":"Morriar","id":583144,"avatar_url":"https://avatars.githubusercontent.com/u/583144?v=3","gravatar_id":"","url":"https://api.github.com/users/Morriar","html_url":"https://github.com/Morriar","followers_url":"https://api.github.com/users/Morriar/followers","following_url":"https://api.github.com/users/Morriar/following{/other_user}","gists_url":"https://api.github.com/users/Morriar/gists{/gist_id}","starred_url":"https://api.github.com/users/Morriar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Morriar/subscriptions","organizations_url":"https://api.github.com/users/Morriar/orgs","repos_url":"https://api.github.com/users/Morriar/repos","events_url":"https://api.github.com/users/Morriar/events{/privacy}","received_events_url":"https://api.github.com/users/Morriar/received_events","type":"User","site_admin":false},"body":"Mainly designed to fully close #1168 and partially close #1161.\r\n\r\n","created_at":"2015-03-03T19:58:35Z","updated_at":"2015-03-04T07:40:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7b19503825f4ea2f374192ddec3b5464ee23f7cb","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/privat/nit/pulls/1185/commits","review_comments_url":"https://api.github.com/repos/privat/nit/pulls/1185/comments","review_comment_url":"https://api.github.com/repos/privat/nit/pulls/comments{/number}","comments_url":"https://api.github.com/repos/privat/nit/issues/1185/comments","statuses_url":"https://api.github.com/repos/privat/nit/statuses/e1e506ff4c0fc490eb85d0f2a8325cef7970363d","head":{"label":"Morriar:nitrpg-next","ref":"nitrpg-next","sha":"e1e506ff4c0fc490eb85d0f2a8325cef7970363d","user":{"login":"Morriar","id":583144,"avatar_url":"https://avatars.githubusercontent.com/u/583144?v=3","gravatar_id":"","url":"https://api.github.com/users/Morriar","html_url":"https://github.com/Morriar","followers_url":"https://api.github.com/users/Morriar/followers","following_url":"https://api.github.com/users/Morriar/following{/other_user}","gists_url":"https://api.github.com/users/Morriar/gists{/gist_id}","starred_url":"https://api.github.com/users/Morriar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Morriar/subscriptions","organizations_url":"https://api.github.com/users/Morriar/orgs","repos_url":"https://api.github.com/users/Morriar/repos","events_url":"https://api.github.com/users/Morriar/events{/privacy}","received_events_url":"https://api.github.com/users/Morriar/received_events","type":"User","site_admin":false},"repo":{"id":1456691,"name":"nit","full_name":"Morriar/nit","owner":{"login":"Morriar","id":583144,"avatar_url":"https://avatars.githubusercontent.com/u/583144?v=3","gravatar_id":"","url":"https://api.github.com/users/Morriar","html_url":"https://github.com/Morriar","followers_url":"https://api.github.com/users/Morriar/followers","following_url":"https://api.github.com/users/Morriar/following{/other_user}","gists_url":"https://api.github.com/users/Morriar/gists{/gist_id}","starred_url":"https://api.github.com/users/Morriar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Morriar/subscriptions","organizations_url":"https://api.github.com/users/Morriar/orgs","repos_url":"https://api.github.com/users/Morriar/repos","events_url":"https://api.github.com/users/Morriar/events{/privacy}","received_events_url":"https://api.github.com/users/Morriar/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Morriar/nit","description":"Nit language","fork":true,"url":"https://api.github.com/repos/Morriar/nit","forks_url":"https://api.github.com/repos/Morriar/nit/forks","keys_url":"https://api.github.com/repos/Morriar/nit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Morriar/nit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Morriar/nit/teams","hooks_url":"https://api.github.com/repos/Morriar/nit/hooks","issue_events_url":"https://api.github.com/repos/Morriar/nit/issues/events{/number}","events_url":"https://api.github.com/repos/Morriar/nit/events","assignees_url":"https://api.github.com/repos/Morriar/nit/assignees{/user}","branches_url":"https://api.github.com/repos/Morriar/nit/branches{/branch}","tags_url":"https://api.github.com/repos/Morriar/nit/tags","blobs_url":"https://api.github.com/repos/Morriar/nit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Morriar/nit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Morriar/nit/git/refs{/sha}","trees_url":"https://api.github.com/repos/Morriar/nit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Morriar/nit/statuses/{sha}","languages_url":"https://api.github.com/repos/Morriar/nit/languages","stargazers_url":"https://api.github.com/repos/Morriar/nit/stargazers","contributors_url":"https://api.github.com/repos/Morriar/nit/contributors","subscribers_url":"https://api.github.com/repos/Morriar/nit/subscribers","subscription_url":"https://api.github.com/repos/Morriar/nit/subscription","commits_url":"https://api.github.com/repos/Morriar/nit/commits{/sha}","git_commits_url":"https://api.github.com/repos/Morriar/nit/git/commits{/sha}","comments_url":"https://api.github.com/repos/Morriar/nit/comments{/number}","issue_comment_url":"https://api.github.com/repos/Morriar/nit/issues/comments{/number}","contents_url":"https://api.github.com/repos/Morriar/nit/contents/{+path}","compare_url":"https://api.github.com/repos/Morriar/nit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Morriar/nit/merges","archive_url":"https://api.github.com/repos/Morriar/nit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Morriar/nit/downloads","issues_url":"https://api.github.com/repos/Morriar/nit/issues{/number}","pulls_url":"https://api.github.com/repos/Morriar/nit/pulls{/number}","milestones_url":"https://api.github.com/repos/Morriar/nit/milestones{/number}","notifications_url":"https://api.github.com/repos/Morriar/nit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Morriar/nit/labels{/name}","releases_url":"https://api.github.com/repos/Morriar/nit/releases{/id}","created_at":"2011-03-08T22:16:33Z","updated_at":"2015-02-23T16:10:05Z","pushed_at":"2015-03-03T19:56:31Z","git_url":"git://github.com/Morriar/nit.git","ssh_url":"git@github.com:Morriar/nit.git","clone_url":"https://github.com/Morriar/nit.git","svn_url":"https://github.com/Morriar/nit","homepage":"http://nitlanguage.org","size":59619,"stargazers_count":2,"watchers_count":2,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":18,"forks":2,"open_issues":18,"watchers":2,"default_branch":"master"}},"base":{"label":"privat:master","ref":"master","sha":"a6d33c1aefc24736f9726a9cac26329e06e9f840","user":{"login":"privat","id":135828,"avatar_url":"https://avatars.githubusercontent.com/u/135828?v=3","gravatar_id":"","url":"https://api.github.com/users/privat","html_url":"https://github.com/privat","followers_url":"https://api.github.com/users/privat/followers","following_url":"https://api.github.com/users/privat/following{/other_user}","gists_url":"https://api.github.com/users/privat/gists{/gist_id}","starred_url":"https://api.github.com/users/privat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/privat/subscriptions","organizations_url":"https://api.github.com/users/privat/orgs","repos_url":"https://api.github.com/users/privat/repos","events_url":"https://api.github.com/users/privat/events{/privacy}","received_events_url":"https://api.github.com/users/privat/received_events","type":"User","site_admin":false},"repo":{"id":328597,"name":"nit","full_name":"privat/nit","owner":{"login":"privat","id":135828,"avatar_url":"https://avatars.githubusercontent.com/u/135828?v=3","gravatar_id":"","url":"https://api.github.com/users/privat","html_url":"https://github.com/privat","followers_url":"https://api.github.com/users/privat/followers","following_url":"https://api.github.com/users/privat/following{/other_user}","gists_url":"https://api.github.com/users/privat/gists{/gist_id}","starred_url":"https://api.github.com/users/privat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/privat/subscriptions","organizations_url":"https://api.github.com/users/privat/orgs","repos_url":"https://api.github.com/users/privat/repos","events_url":"https://api.github.com/users/privat/events{/privacy}","received_events_url":"https://api.github.com/users/privat/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/privat/nit","description":"Nit language","fork":false,"url":"https://api.github.com/repos/privat/nit","forks_url":"https://api.github.com/repos/privat/nit/forks","keys_url":"https://api.github.com/repos/privat/nit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/privat/nit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/privat/nit/teams","hooks_url":"https://api.github.com/repos/privat/nit/hooks","issue_events_url":"https://api.github.com/repos/privat/nit/issues/events{/number}","events_url":"https://api.github.com/repos/privat/nit/events","assignees_url":"https://api.github.com/repos/privat/nit/assignees{/user}","branches_url":"https://api.github.com/repos/privat/nit/branches{/branch}","tags_url":"https://api.github.com/repos/privat/nit/tags","blobs_url":"https://api.github.com/repos/privat/nit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/privat/nit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/privat/nit/git/refs{/sha}","trees_url":"https://api.github.com/repos/privat/nit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/privat/nit/statuses/{sha}","languages_url":"https://api.github.com/repos/privat/nit/languages","stargazers_url":"https://api.github.com/repos/privat/nit/stargazers","contributors_url":"https://api.github.com/repos/privat/nit/contributors","subscribers_url":"https://api.github.com/repos/privat/nit/subscribers","subscription_url":"https://api.github.com/repos/privat/nit/subscription","commits_url":"https://api.github.com/repos/privat/nit/commits{/sha}","git_commits_url":"https://api.github.com/repos/privat/nit/git/commits{/sha}","comments_url":"https://api.github.com/repos/privat/nit/comments{/number}","issue_comment_url":"https://api.github.com/repos/privat/nit/issues/comments{/number}","contents_url":"https://api.github.com/repos/privat/nit/contents/{+path}","compare_url":"https://api.github.com/repos/privat/nit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/privat/nit/merges","archive_url":"https://api.github.com/repos/privat/nit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/privat/nit/downloads","issues_url":"https://api.github.com/repos/privat/nit/issues{/number}","pulls_url":"https://api.github.com/repos/privat/nit/pulls{/number}","milestones_url":"https://api.github.com/repos/privat/nit/milestones{/number}","notifications_url":"https://api.github.com/repos/privat/nit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/privat/nit/labels{/name}","releases_url":"https://api.github.com/repos/privat/nit/releases{/id}","created_at":"2009-10-06T15:03:00Z","updated_at":"2015-03-03T23:35:07Z","pushed_at":"2015-03-03T23:35:07Z","git_url":"git://github.com/privat/nit.git","ssh_url":"git@github.com:privat/nit.git","clone_url":"https://github.com/privat/nit.git","svn_url":"https://github.com/privat/nit","homepage":"http://nitlanguage.org","size":78510,"stargazers_count":65,"watchers_count":65,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":36,"mirror_url":null,"open_issues_count":102,"forks":36,"open_issues":102,"watchers":65,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/privat/nit/pulls/1185"},"html":{"href":"https://github.com/privat/nit/pull/1185"},"issue":{"href":"https://api.github.com/repos/privat/nit/issues/1185"},"comments":{"href":"https://api.github.com/repos/privat/nit/issues/1185/comments"},"review_comments":{"href":"https://api.github.com/repos/privat/nit/pulls/1185/comments"},"review_comment":{"href":"https://api.github.com/repos/privat/nit/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/privat/nit/pulls/1185/commits"},"statuses":{"href":"https://api.github.com/repos/privat/nit/statuses/e1e506ff4c0fc490eb85d0f2a8325cef7970363d"}}}}