{"action":"created","comment":{"url":"https://api.github.com/repos/DFHack/dfhack/pulls/comments/66002810","id":66002810,"diff_hunk":"@@ -0,0 +1,58 @@\n+-- Increase feline population by inducing pregnancies\n+\n+-- script by Putnam, configured by PeridexisErrant\n+-- based on the plugin by Zhentar; modified by dark_rabite, peterix, belal\n+\n+--[[=begin\n+\n+catsplosion\n+===========\n+Makes cats just *multiply*, by inducing a pregnancy in every cat on the map.\n+It is not a good idea to run this more than once or twice.\n+\n+=end]]\n+\n+local function getSpecies(unit)\n+    return df.creature_raw.find(unit.race).creature_id\n+end\n+\n+local function getFemaleCasteWithSameMaxAge(unit)\n+    local curCaste=df.creature_raw.find(unit.race).caste[unit.caste]\n+    for k,caste in ipairs(df.creature_raw.find(unit.race).caste) do\n+        if caste.gender==0 and caste.misc.maxage_min==curCaste.misc.maxage_min and caste.misc.maxage_max==curCaste.misc.maxage_max then return k end\n+    end\n+end\n+\n+function impregnate(unit)\n+    local script=require('gui.script')\n+    script.start(function()\n+    unit=unit or dfhack.gui.getSelectedUnit(true)\n+    if not unit then\n+        error(\"Failed to impregnate. Unit not selected/valid\")\n+    end\n+    if unit.curse then\n+        unit.curse.add_tags2.STERILE=false\n+    end\n+    local genes = unit.appearance.genes\n+    if unit.relations.pregnancy_genes == nil then\n+        unit.relations.pregnancy_genes = unit.appearance.genes:new()\n+    end\n+    local ngenes = unit.relations.pregnancy_genes\n+    local rng=dfhack.random.new()\n+    local timer=rng:random(100)+1\n+    unit.relations.pregnancy_timer=timer\n+    unit.relations.pregnancy_caste=1\n+    if unit.sex==1 then\n+        local normal_caste=unit.enemy.normal_caste\n+        unit.enemy.normal_caste=getFemaleCasteWithSameMaxAge(unit)\n+        script.sleep(timer+1,'ticks')","path":"scripts/catsplosion.lua","position":48,"original_position":48,"commit_id":"9cd30ae72eae3313e1390102a777e51f03428b13","original_commit_id":"9cd30ae72eae3313e1390102a777e51f03428b13","user":{"login":"lethosor","id":3719547,"avatar_url":"https://avatars.githubusercontent.com/u/3719547?v=3","gravatar_id":"","url":"https://api.github.com/users/lethosor","html_url":"https://github.com/lethosor","followers_url":"https://api.github.com/users/lethosor/followers","following_url":"https://api.github.com/users/lethosor/following{/other_user}","gists_url":"https://api.github.com/users/lethosor/gists{/gist_id}","starred_url":"https://api.github.com/users/lethosor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lethosor/subscriptions","organizations_url":"https://api.github.com/users/lethosor/orgs","repos_url":"https://api.github.com/users/lethosor/repos","events_url":"https://api.github.com/users/lethosor/events{/privacy}","received_events_url":"https://api.github.com/users/lethosor/received_events","type":"User","site_admin":false},"body":"What's this for?","created_at":"2016-06-07T02:47:57Z","updated_at":"2016-06-07T02:47:57Z","html_url":"https://github.com/DFHack/dfhack/pull/938#discussion_r66002810","pull_request_url":"https://api.github.com/repos/DFHack/dfhack/pulls/938","_links":{"self":{"href":"https://api.github.com/repos/DFHack/dfhack/pulls/comments/66002810"},"html":{"href":"https://github.com/DFHack/dfhack/pull/938#discussion_r66002810"},"pull_request":{"href":"https://api.github.com/repos/DFHack/dfhack/pulls/938"}}},"pull_request":{"url":"https://api.github.com/repos/DFHack/dfhack/pulls/938","id":72806393,"html_url":"https://github.com/DFHack/dfhack/pull/938","diff_url":"https://github.com/DFHack/dfhack/pull/938.diff","patch_url":"https://github.com/DFHack/dfhack/pull/938.patch","issue_url":"https://api.github.com/repos/DFHack/dfhack/issues/938","number":938,"state":"open","locked":false,"title":"Convert catsplosion plugin to a script","user":{"login":"PeridexisErrant","id":5608912,"avatar_url":"https://avatars.githubusercontent.com/u/5608912?v=3","gravatar_id":"","url":"https://api.github.com/users/PeridexisErrant","html_url":"https://github.com/PeridexisErrant","followers_url":"https://api.github.com/users/PeridexisErrant/followers","following_url":"https://api.github.com/users/PeridexisErrant/following{/other_user}","gists_url":"https://api.github.com/users/PeridexisErrant/gists{/gist_id}","starred_url":"https://api.github.com/users/PeridexisErrant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PeridexisErrant/subscriptions","organizations_url":"https://api.github.com/users/PeridexisErrant/orgs","repos_url":"https://api.github.com/users/PeridexisErrant/repos","events_url":"https://api.github.com/users/PeridexisErrant/events{/privacy}","received_events_url":"https://api.github.com/users/PeridexisErrant/received_events","type":"User","site_admin":false},"body":"Thanks to Putnam.  Closes issue #722, at last!","created_at":"2016-06-07T02:16:48Z","updated_at":"2016-06-07T02:47:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"241c952c7f8cf6cc2da90ce70c2991260eeac329","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/DFHack/dfhack/pulls/938/commits","review_comments_url":"https://api.github.com/repos/DFHack/dfhack/pulls/938/comments","review_comment_url":"https://api.github.com/repos/DFHack/dfhack/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DFHack/dfhack/issues/938/comments","statuses_url":"https://api.github.com/repos/DFHack/dfhack/statuses/9cd30ae72eae3313e1390102a777e51f03428b13","head":{"label":"PeridexisErrant:catsplosion","ref":"catsplosion","sha":"9cd30ae72eae3313e1390102a777e51f03428b13","user":{"login":"PeridexisErrant","id":5608912,"avatar_url":"https://avatars.githubusercontent.com/u/5608912?v=3","gravatar_id":"","url":"https://api.github.com/users/PeridexisErrant","html_url":"https://github.com/PeridexisErrant","followers_url":"https://api.github.com/users/PeridexisErrant/followers","following_url":"https://api.github.com/users/PeridexisErrant/following{/other_user}","gists_url":"https://api.github.com/users/PeridexisErrant/gists{/gist_id}","starred_url":"https://api.github.com/users/PeridexisErrant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PeridexisErrant/subscriptions","organizations_url":"https://api.github.com/users/PeridexisErrant/orgs","repos_url":"https://api.github.com/users/PeridexisErrant/repos","events_url":"https://api.github.com/users/PeridexisErrant/events{/privacy}","received_events_url":"https://api.github.com/users/PeridexisErrant/received_events","type":"User","site_admin":false},"repo":{"id":19444099,"name":"dfhack","full_name":"PeridexisErrant/dfhack","owner":{"login":"PeridexisErrant","id":5608912,"avatar_url":"https://avatars.githubusercontent.com/u/5608912?v=3","gravatar_id":"","url":"https://api.github.com/users/PeridexisErrant","html_url":"https://github.com/PeridexisErrant","followers_url":"https://api.github.com/users/PeridexisErrant/followers","following_url":"https://api.github.com/users/PeridexisErrant/following{/other_user}","gists_url":"https://api.github.com/users/PeridexisErrant/gists{/gist_id}","starred_url":"https://api.github.com/users/PeridexisErrant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PeridexisErrant/subscriptions","organizations_url":"https://api.github.com/users/PeridexisErrant/orgs","repos_url":"https://api.github.com/users/PeridexisErrant/repos","events_url":"https://api.github.com/users/PeridexisErrant/events{/privacy}","received_events_url":"https://api.github.com/users/PeridexisErrant/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/PeridexisErrant/dfhack","description":"Memory hacking library for Dwarf Fortress and a set of tools that use it","fork":true,"url":"https://api.github.com/repos/PeridexisErrant/dfhack","forks_url":"https://api.github.com/repos/PeridexisErrant/dfhack/forks","keys_url":"https://api.github.com/repos/PeridexisErrant/dfhack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PeridexisErrant/dfhack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PeridexisErrant/dfhack/teams","hooks_url":"https://api.github.com/repos/PeridexisErrant/dfhack/hooks","issue_events_url":"https://api.github.com/repos/PeridexisErrant/dfhack/issues/events{/number}","events_url":"https://api.github.com/repos/PeridexisErrant/dfhack/events","assignees_url":"https://api.github.com/repos/PeridexisErrant/dfhack/assignees{/user}","branches_url":"https://api.github.com/repos/PeridexisErrant/dfhack/branches{/branch}","tags_url":"https://api.github.com/repos/PeridexisErrant/dfhack/tags","blobs_url":"https://api.github.com/repos/PeridexisErrant/dfhack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PeridexisErrant/dfhack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PeridexisErrant/dfhack/git/refs{/sha}","trees_url":"https://api.github.com/repos/PeridexisErrant/dfhack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PeridexisErrant/dfhack/statuses/{sha}","languages_url":"https://api.github.com/repos/PeridexisErrant/dfhack/languages","stargazers_url":"https://api.github.com/repos/PeridexisErrant/dfhack/stargazers","contributors_url":"https://api.github.com/repos/PeridexisErrant/dfhack/contributors","subscribers_url":"https://api.github.com/repos/PeridexisErrant/dfhack/subscribers","subscription_url":"https://api.github.com/repos/PeridexisErrant/dfhack/subscription","commits_url":"https://api.github.com/repos/PeridexisErrant/dfhack/commits{/sha}","git_commits_url":"https://api.github.com/repos/PeridexisErrant/dfhack/git/commits{/sha}","comments_url":"https://api.github.com/repos/PeridexisErrant/dfhack/comments{/number}","issue_comment_url":"https://api.github.com/repos/PeridexisErrant/dfhack/issues/comments{/number}","contents_url":"https://api.github.com/repos/PeridexisErrant/dfhack/contents/{+path}","compare_url":"https://api.github.com/repos/PeridexisErrant/dfhack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PeridexisErrant/dfhack/merges","archive_url":"https://api.github.com/repos/PeridexisErrant/dfhack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PeridexisErrant/dfhack/downloads","issues_url":"https://api.github.com/repos/PeridexisErrant/dfhack/issues{/number}","pulls_url":"https://api.github.com/repos/PeridexisErrant/dfhack/pulls{/number}","milestones_url":"https://api.github.com/repos/PeridexisErrant/dfhack/milestones{/number}","notifications_url":"https://api.github.com/repos/PeridexisErrant/dfhack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PeridexisErrant/dfhack/labels{/name}","releases_url":"https://api.github.com/repos/PeridexisErrant/dfhack/releases{/id}","deployments_url":"https://api.github.com/repos/PeridexisErrant/dfhack/deployments","created_at":"2014-05-05T04:42:25Z","updated_at":"2016-02-01T05:40:37Z","pushed_at":"2016-06-07T02:10:17Z","git_url":"git://github.com/PeridexisErrant/dfhack.git","ssh_url":"git@github.com:PeridexisErrant/dfhack.git","clone_url":"https://github.com/PeridexisErrant/dfhack.git","svn_url":"https://github.com/PeridexisErrant/dfhack","homepage":"","size":20998,"stargazers_count":2,"watchers_count":2,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":2,"default_branch":"master"}},"base":{"label":"DFHack:develop","ref":"develop","sha":"8543121ecea578df33aabcfa5b2f2e3f1bb7ad66","user":{"login":"DFHack","id":5777323,"avatar_url":"https://avatars.githubusercontent.com/u/5777323?v=3","gravatar_id":"","url":"https://api.github.com/users/DFHack","html_url":"https://github.com/DFHack","followers_url":"https://api.github.com/users/DFHack/followers","following_url":"https://api.github.com/users/DFHack/following{/other_user}","gists_url":"https://api.github.com/users/DFHack/gists{/gist_id}","starred_url":"https://api.github.com/users/DFHack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DFHack/subscriptions","organizations_url":"https://api.github.com/users/DFHack/orgs","repos_url":"https://api.github.com/users/DFHack/repos","events_url":"https://api.github.com/users/DFHack/events{/privacy}","received_events_url":"https://api.github.com/users/DFHack/received_events","type":"Organization","site_admin":false},"repo":{"id":517990,"name":"dfhack","full_name":"DFHack/dfhack","owner":{"login":"DFHack","id":5777323,"avatar_url":"https://avatars.githubusercontent.com/u/5777323?v=3","gravatar_id":"","url":"https://api.github.com/users/DFHack","html_url":"https://github.com/DFHack","followers_url":"https://api.github.com/users/DFHack/followers","following_url":"https://api.github.com/users/DFHack/following{/other_user}","gists_url":"https://api.github.com/users/DFHack/gists{/gist_id}","starred_url":"https://api.github.com/users/DFHack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DFHack/subscriptions","organizations_url":"https://api.github.com/users/DFHack/orgs","repos_url":"https://api.github.com/users/DFHack/repos","events_url":"https://api.github.com/users/DFHack/events{/privacy}","received_events_url":"https://api.github.com/users/DFHack/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DFHack/dfhack","description":"Memory hacking library for Dwarf Fortress and a set of tools that use it","fork":false,"url":"https://api.github.com/repos/DFHack/dfhack","forks_url":"https://api.github.com/repos/DFHack/dfhack/forks","keys_url":"https://api.github.com/repos/DFHack/dfhack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DFHack/dfhack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DFHack/dfhack/teams","hooks_url":"https://api.github.com/repos/DFHack/dfhack/hooks","issue_events_url":"https://api.github.com/repos/DFHack/dfhack/issues/events{/number}","events_url":"https://api.github.com/repos/DFHack/dfhack/events","assignees_url":"https://api.github.com/repos/DFHack/dfhack/assignees{/user}","branches_url":"https://api.github.com/repos/DFHack/dfhack/branches{/branch}","tags_url":"https://api.github.com/repos/DFHack/dfhack/tags","blobs_url":"https://api.github.com/repos/DFHack/dfhack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DFHack/dfhack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DFHack/dfhack/git/refs{/sha}","trees_url":"https://api.github.com/repos/DFHack/dfhack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DFHack/dfhack/statuses/{sha}","languages_url":"https://api.github.com/repos/DFHack/dfhack/languages","stargazers_url":"https://api.github.com/repos/DFHack/dfhack/stargazers","contributors_url":"https://api.github.com/repos/DFHack/dfhack/contributors","subscribers_url":"https://api.github.com/repos/DFHack/dfhack/subscribers","subscription_url":"https://api.github.com/repos/DFHack/dfhack/subscription","commits_url":"https://api.github.com/repos/DFHack/dfhack/commits{/sha}","git_commits_url":"https://api.github.com/repos/DFHack/dfhack/git/commits{/sha}","comments_url":"https://api.github.com/repos/DFHack/dfhack/comments{/number}","issue_comment_url":"https://api.github.com/repos/DFHack/dfhack/issues/comments{/number}","contents_url":"https://api.github.com/repos/DFHack/dfhack/contents/{+path}","compare_url":"https://api.github.com/repos/DFHack/dfhack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DFHack/dfhack/merges","archive_url":"https://api.github.com/repos/DFHack/dfhack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DFHack/dfhack/downloads","issues_url":"https://api.github.com/repos/DFHack/dfhack/issues{/number}","pulls_url":"https://api.github.com/repos/DFHack/dfhack/pulls{/number}","milestones_url":"https://api.github.com/repos/DFHack/dfhack/milestones{/number}","notifications_url":"https://api.github.com/repos/DFHack/dfhack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DFHack/dfhack/labels{/name}","releases_url":"https://api.github.com/repos/DFHack/dfhack/releases{/id}","deployments_url":"https://api.github.com/repos/DFHack/dfhack/deployments","created_at":"2010-02-14T21:09:49Z","updated_at":"2016-05-21T16:52:00Z","pushed_at":"2016-06-07T02:16:49Z","git_url":"git://github.com/DFHack/dfhack.git","ssh_url":"git@github.com:DFHack/dfhack.git","clone_url":"https://github.com/DFHack/dfhack.git","svn_url":"https://github.com/DFHack/dfhack","homepage":"","size":30216,"stargazers_count":521,"watchers_count":521,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":228,"mirror_url":null,"open_issues_count":128,"forks":228,"open_issues":128,"watchers":521,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/DFHack/dfhack/pulls/938"},"html":{"href":"https://github.com/DFHack/dfhack/pull/938"},"issue":{"href":"https://api.github.com/repos/DFHack/dfhack/issues/938"},"comments":{"href":"https://api.github.com/repos/DFHack/dfhack/issues/938/comments"},"review_comments":{"href":"https://api.github.com/repos/DFHack/dfhack/pulls/938/comments"},"review_comment":{"href":"https://api.github.com/repos/DFHack/dfhack/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DFHack/dfhack/pulls/938/commits"},"statuses":{"href":"https://api.github.com/repos/DFHack/dfhack/statuses/9cd30ae72eae3313e1390102a777e51f03428b13"}}}}
{"actor":{"display_login":"lethosor"}}