{"action":"created","comment":{"url":"https://api.github.com/repos/OpenRA/OpenRA/pulls/comments/31870186","id":31870186,"diff_hunk":"@@ -0,0 +1,128 @@\n+﻿using System;\n+using System.Collections.Generic;\n+using System.Drawing;\n+using System.Linq;\n+using System.Text;\n+using OpenRA.Activities;\n+using OpenRA.Mods.Common.Orders;\n+using OpenRA.Mods.Common.Activities;\n+using OpenRA.Traits;\n+\n+\n+namespace OpenRA.Mods.Common.Traits\n+{\n+\tpublic class DetonatesInfo : ITraitInfo, Requires<RenderUnitInfo>\n+\t{\n+\t\t[Desc(\"Measured in ticks.\")]  \n+\t\tpublic readonly int ChargeDelay = 0;\n+\t\tpublic readonly string ChargeSequence = null;\n+\t\tpublic readonly string ChargeSound = null;\n+\n+\t\t[Desc(\"Measured in ticks.\")]\n+\t\tpublic readonly int DetonationDelay = 0;\n+\t\t[WeaponReference]\n+\t\tpublic readonly string DetonationWeapon = null;\n+\n+\t\tpublic object Create(ActorInitializer init) { return new Detonates(init.Self, this); }\n+\t}\n+\n+\tpublic class Detonates : IIssueOrder, IResolveOrder, IOrderVoice\n+\t{\n+\t\treadonly Actor self;\n+\t\treadonly DetonatesInfo info;\n+\t\treadonly RenderUnit renderUnit;\n+\t\t\n+\t\tpublic bool Deployed;\n+\n+\t\tpublic Detonates(Actor self, DetonatesInfo info)\n+\t\t{\n+\t\t\tthis.self = self;\n+\t\t\tthis.info = info;\n+\t\t\trenderUnit = self.Trait<RenderUnit>();\n+\t\t}\n+\n+\t\tpublic IEnumerable<IOrderTargeter> Orders\n+\t\t{\n+\t\t\tget\n+\t\t\t{\n+\t\t\t\tyield return new TargetTypeOrderTargeter(new[] { \"DetonateAttack\" }, \"DetonateAttack\", 5, \"attack\", true, false) { ForceAttack = false };\n+\t\t\t\tyield return new DeployOrderTargeter(\"Detonate\", 5);\n+\t\t\t}\n+\t\t}\n+\n+\t\tvoid Detonate()\n+\t\t{\n+\t\t\tself.World.AddFrameEndTask(w =>\n+\t\t\t{\n+\t\t\t\tif (info.DetonationWeapon != null)\n+\t\t\t\t{\n+\t\t\t\t\tvar weapon = self.World.Map.Rules.Weapons[info.DetonationWeapon.ToLowerInvariant()];\n+\n+\t\t\t\t\t// Use .FromPos since this actor is killed. Cannot use Target.FromActor\n+\t\t\t\t\tweapon.Impact(Target.FromPos(self.CenterPosition), self, Enumerable.Empty<int>());\n+\t\t\t\t}\n+\n+\t\t\t\tself.Kill(self);","path":"OpenRA.Mods.Common/Traits/Detonates.cs","position":65,"original_position":65,"commit_id":"1c3de9c6ca75fc7504dfbd59971014e9158ed199","original_commit_id":"8444ca8dd8c3654f39ccb417418874eeff0e4b11","user":{"login":"penev92","id":7137365,"avatar_url":"https://avatars.githubusercontent.com/u/7137365?v=3","gravatar_id":"","url":"https://api.github.com/users/penev92","html_url":"https://github.com/penev92","followers_url":"https://api.github.com/users/penev92/followers","following_url":"https://api.github.com/users/penev92/following{/other_user}","gists_url":"https://api.github.com/users/penev92/gists{/gist_id}","starred_url":"https://api.github.com/users/penev92/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/penev92/subscriptions","organizations_url":"https://api.github.com/users/penev92/orgs","repos_url":"https://api.github.com/users/penev92/repos","events_url":"https://api.github.com/users/penev92/events{/privacy}","received_events_url":"https://api.github.com/users/penev92/received_events","type":"User","site_admin":false},"body":"The weapon should already be handling that.","created_at":"2015-06-06T18:10:58Z","updated_at":"2015-06-06T18:10:58Z","html_url":"https://github.com/OpenRA/OpenRA/pull/8410#discussion_r31870186","pull_request_url":"https://api.github.com/repos/OpenRA/OpenRA/pulls/8410","_links":{"self":{"href":"https://api.github.com/repos/OpenRA/OpenRA/pulls/comments/31870186"},"html":{"href":"https://github.com/OpenRA/OpenRA/pull/8410#discussion_r31870186"},"pull_request":{"href":"https://api.github.com/repos/OpenRA/OpenRA/pulls/8410"}}},"pull_request":{"url":"https://api.github.com/repos/OpenRA/OpenRA/pulls/8410","id":37093264,"html_url":"https://github.com/OpenRA/OpenRA/pull/8410","diff_url":"https://github.com/OpenRA/OpenRA/pull/8410.diff","patch_url":"https://github.com/OpenRA/OpenRA/pull/8410.patch","issue_url":"https://api.github.com/repos/OpenRA/OpenRA/issues/8410","number":8410,"state":"open","locked":false,"title":"Refactored detonate behaviour and added devastator logic.","user":{"login":"Unit158","id":706008,"avatar_url":"https://avatars.githubusercontent.com/u/706008?v=3","gravatar_id":"","url":"https://api.github.com/users/Unit158","html_url":"https://github.com/Unit158","followers_url":"https://api.github.com/users/Unit158/followers","following_url":"https://api.github.com/users/Unit158/following{/other_user}","gists_url":"https://api.github.com/users/Unit158/gists{/gist_id}","starred_url":"https://api.github.com/users/Unit158/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Unit158/subscriptions","organizations_url":"https://api.github.com/users/Unit158/orgs","repos_url":"https://api.github.com/users/Unit158/repos","events_url":"https://api.github.com/users/Unit158/events{/privacy}","received_events_url":"https://api.github.com/users/Unit158/received_events","type":"User","site_admin":false},"body":"This isn't quite ready to merge yet, as I am not sure how to do the overlay properly.","created_at":"2015-06-06T16:53:34Z","updated_at":"2015-06-06T18:10:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5496562188242e2b81fc9abf98ed1a978c6ad917","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/OpenRA/OpenRA/pulls/8410/commits","review_comments_url":"https://api.github.com/repos/OpenRA/OpenRA/pulls/8410/comments","review_comment_url":"https://api.github.com/repos/OpenRA/OpenRA/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OpenRA/OpenRA/issues/8410/comments","statuses_url":"https://api.github.com/repos/OpenRA/OpenRA/statuses/1c3de9c6ca75fc7504dfbd59971014e9158ed199","head":{"label":"Unit158:DetonateRefactor","ref":"DetonateRefactor","sha":"1c3de9c6ca75fc7504dfbd59971014e9158ed199","user":{"login":"Unit158","id":706008,"avatar_url":"https://avatars.githubusercontent.com/u/706008?v=3","gravatar_id":"","url":"https://api.github.com/users/Unit158","html_url":"https://github.com/Unit158","followers_url":"https://api.github.com/users/Unit158/followers","following_url":"https://api.github.com/users/Unit158/following{/other_user}","gists_url":"https://api.github.com/users/Unit158/gists{/gist_id}","starred_url":"https://api.github.com/users/Unit158/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Unit158/subscriptions","organizations_url":"https://api.github.com/users/Unit158/orgs","repos_url":"https://api.github.com/users/Unit158/repos","events_url":"https://api.github.com/users/Unit158/events{/privacy}","received_events_url":"https://api.github.com/users/Unit158/received_events","type":"User","site_admin":false},"repo":{"id":15848918,"name":"OpenRA","full_name":"Unit158/OpenRA","owner":{"login":"Unit158","id":706008,"avatar_url":"https://avatars.githubusercontent.com/u/706008?v=3","gravatar_id":"","url":"https://api.github.com/users/Unit158","html_url":"https://github.com/Unit158","followers_url":"https://api.github.com/users/Unit158/followers","following_url":"https://api.github.com/users/Unit158/following{/other_user}","gists_url":"https://api.github.com/users/Unit158/gists{/gist_id}","starred_url":"https://api.github.com/users/Unit158/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Unit158/subscriptions","organizations_url":"https://api.github.com/users/Unit158/orgs","repos_url":"https://api.github.com/users/Unit158/repos","events_url":"https://api.github.com/users/Unit158/events{/privacy}","received_events_url":"https://api.github.com/users/Unit158/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Unit158/OpenRA","description":"An open-source implementation of the Red Alert engine using .NET/mono and OpenGL. Runs on Windows, Linux and Mac OS X.","fork":true,"url":"https://api.github.com/repos/Unit158/OpenRA","forks_url":"https://api.github.com/repos/Unit158/OpenRA/forks","keys_url":"https://api.github.com/repos/Unit158/OpenRA/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Unit158/OpenRA/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Unit158/OpenRA/teams","hooks_url":"https://api.github.com/repos/Unit158/OpenRA/hooks","issue_events_url":"https://api.github.com/repos/Unit158/OpenRA/issues/events{/number}","events_url":"https://api.github.com/repos/Unit158/OpenRA/events","assignees_url":"https://api.github.com/repos/Unit158/OpenRA/assignees{/user}","branches_url":"https://api.github.com/repos/Unit158/OpenRA/branches{/branch}","tags_url":"https://api.github.com/repos/Unit158/OpenRA/tags","blobs_url":"https://api.github.com/repos/Unit158/OpenRA/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Unit158/OpenRA/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Unit158/OpenRA/git/refs{/sha}","trees_url":"https://api.github.com/repos/Unit158/OpenRA/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Unit158/OpenRA/statuses/{sha}","languages_url":"https://api.github.com/repos/Unit158/OpenRA/languages","stargazers_url":"https://api.github.com/repos/Unit158/OpenRA/stargazers","contributors_url":"https://api.github.com/repos/Unit158/OpenRA/contributors","subscribers_url":"https://api.github.com/repos/Unit158/OpenRA/subscribers","subscription_url":"https://api.github.com/repos/Unit158/OpenRA/subscription","commits_url":"https://api.github.com/repos/Unit158/OpenRA/commits{/sha}","git_commits_url":"https://api.github.com/repos/Unit158/OpenRA/git/commits{/sha}","comments_url":"https://api.github.com/repos/Unit158/OpenRA/comments{/number}","issue_comment_url":"https://api.github.com/repos/Unit158/OpenRA/issues/comments{/number}","contents_url":"https://api.github.com/repos/Unit158/OpenRA/contents/{+path}","compare_url":"https://api.github.com/repos/Unit158/OpenRA/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Unit158/OpenRA/merges","archive_url":"https://api.github.com/repos/Unit158/OpenRA/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Unit158/OpenRA/downloads","issues_url":"https://api.github.com/repos/Unit158/OpenRA/issues{/number}","pulls_url":"https://api.github.com/repos/Unit158/OpenRA/pulls{/number}","milestones_url":"https://api.github.com/repos/Unit158/OpenRA/milestones{/number}","notifications_url":"https://api.github.com/repos/Unit158/OpenRA/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Unit158/OpenRA/labels{/name}","releases_url":"https://api.github.com/repos/Unit158/OpenRA/releases{/id}","created_at":"2014-01-12T19:20:57Z","updated_at":"2015-04-12T20:30:21Z","pushed_at":"2015-06-06T18:08:44Z","git_url":"git://github.com/Unit158/OpenRA.git","ssh_url":"git@github.com:Unit158/OpenRA.git","clone_url":"https://github.com/Unit158/OpenRA.git","svn_url":"https://github.com/Unit158/OpenRA","homepage":"http://open-ra.org","size":89492,"stargazers_count":1,"watchers_count":1,"language":"C#","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":1,"default_branch":"bleed"}},"base":{"label":"OpenRA:bleed","ref":"bleed","sha":"52179e802e9cf182aec50a8f90c6246136e461ae","user":{"login":"OpenRA","id":409046,"avatar_url":"https://avatars.githubusercontent.com/u/409046?v=3","gravatar_id":"","url":"https://api.github.com/users/OpenRA","html_url":"https://github.com/OpenRA","followers_url":"https://api.github.com/users/OpenRA/followers","following_url":"https://api.github.com/users/OpenRA/following{/other_user}","gists_url":"https://api.github.com/users/OpenRA/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenRA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenRA/subscriptions","organizations_url":"https://api.github.com/users/OpenRA/orgs","repos_url":"https://api.github.com/users/OpenRA/repos","events_url":"https://api.github.com/users/OpenRA/events{/privacy}","received_events_url":"https://api.github.com/users/OpenRA/received_events","type":"Organization","site_admin":false},"repo":{"id":959908,"name":"OpenRA","full_name":"OpenRA/OpenRA","owner":{"login":"OpenRA","id":409046,"avatar_url":"https://avatars.githubusercontent.com/u/409046?v=3","gravatar_id":"","url":"https://api.github.com/users/OpenRA","html_url":"https://github.com/OpenRA","followers_url":"https://api.github.com/users/OpenRA/followers","following_url":"https://api.github.com/users/OpenRA/following{/other_user}","gists_url":"https://api.github.com/users/OpenRA/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenRA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenRA/subscriptions","organizations_url":"https://api.github.com/users/OpenRA/orgs","repos_url":"https://api.github.com/users/OpenRA/repos","events_url":"https://api.github.com/users/OpenRA/events{/privacy}","received_events_url":"https://api.github.com/users/OpenRA/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/OpenRA/OpenRA","description":"Open Source real-time strategy game engine for early Westwood games such as Command & Conquer: Red Alert written in C# using SDL and OpenGL. Runs on Windows, Linux and Mac OS X.","fork":false,"url":"https://api.github.com/repos/OpenRA/OpenRA","forks_url":"https://api.github.com/repos/OpenRA/OpenRA/forks","keys_url":"https://api.github.com/repos/OpenRA/OpenRA/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OpenRA/OpenRA/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OpenRA/OpenRA/teams","hooks_url":"https://api.github.com/repos/OpenRA/OpenRA/hooks","issue_events_url":"https://api.github.com/repos/OpenRA/OpenRA/issues/events{/number}","events_url":"https://api.github.com/repos/OpenRA/OpenRA/events","assignees_url":"https://api.github.com/repos/OpenRA/OpenRA/assignees{/user}","branches_url":"https://api.github.com/repos/OpenRA/OpenRA/branches{/branch}","tags_url":"https://api.github.com/repos/OpenRA/OpenRA/tags","blobs_url":"https://api.github.com/repos/OpenRA/OpenRA/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OpenRA/OpenRA/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OpenRA/OpenRA/git/refs{/sha}","trees_url":"https://api.github.com/repos/OpenRA/OpenRA/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OpenRA/OpenRA/statuses/{sha}","languages_url":"https://api.github.com/repos/OpenRA/OpenRA/languages","stargazers_url":"https://api.github.com/repos/OpenRA/OpenRA/stargazers","contributors_url":"https://api.github.com/repos/OpenRA/OpenRA/contributors","subscribers_url":"https://api.github.com/repos/OpenRA/OpenRA/subscribers","subscription_url":"https://api.github.com/repos/OpenRA/OpenRA/subscription","commits_url":"https://api.github.com/repos/OpenRA/OpenRA/commits{/sha}","git_commits_url":"https://api.github.com/repos/OpenRA/OpenRA/git/commits{/sha}","comments_url":"https://api.github.com/repos/OpenRA/OpenRA/comments{/number}","issue_comment_url":"https://api.github.com/repos/OpenRA/OpenRA/issues/comments{/number}","contents_url":"https://api.github.com/repos/OpenRA/OpenRA/contents/{+path}","compare_url":"https://api.github.com/repos/OpenRA/OpenRA/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OpenRA/OpenRA/merges","archive_url":"https://api.github.com/repos/OpenRA/OpenRA/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OpenRA/OpenRA/downloads","issues_url":"https://api.github.com/repos/OpenRA/OpenRA/issues{/number}","pulls_url":"https://api.github.com/repos/OpenRA/OpenRA/pulls{/number}","milestones_url":"https://api.github.com/repos/OpenRA/OpenRA/milestones{/number}","notifications_url":"https://api.github.com/repos/OpenRA/OpenRA/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OpenRA/OpenRA/labels{/name}","releases_url":"https://api.github.com/repos/OpenRA/OpenRA/releases{/id}","created_at":"2010-10-04T07:38:05Z","updated_at":"2015-06-06T15:47:33Z","pushed_at":"2015-06-06T18:08:46Z","git_url":"git://github.com/OpenRA/OpenRA.git","ssh_url":"git@github.com:OpenRA/OpenRA.git","clone_url":"https://github.com/OpenRA/OpenRA.git","svn_url":"https://github.com/OpenRA/OpenRA","homepage":"http://www.openra.net","size":174969,"stargazers_count":1942,"watchers_count":1942,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":698,"mirror_url":null,"open_issues_count":812,"forks":698,"open_issues":812,"watchers":1942,"default_branch":"bleed"}},"_links":{"self":{"href":"https://api.github.com/repos/OpenRA/OpenRA/pulls/8410"},"html":{"href":"https://github.com/OpenRA/OpenRA/pull/8410"},"issue":{"href":"https://api.github.com/repos/OpenRA/OpenRA/issues/8410"},"comments":{"href":"https://api.github.com/repos/OpenRA/OpenRA/issues/8410/comments"},"review_comments":{"href":"https://api.github.com/repos/OpenRA/OpenRA/pulls/8410/comments"},"review_comment":{"href":"https://api.github.com/repos/OpenRA/OpenRA/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OpenRA/OpenRA/pulls/8410/commits"},"statuses":{"href":"https://api.github.com/repos/OpenRA/OpenRA/statuses/1c3de9c6ca75fc7504dfbd59971014e9158ed199"}}}}