{"action":"created","comment":{"url":"https://api.github.com/repos/OpenRA/OpenRA/pulls/comments/29042290","id":29042290,"diff_hunk":"@@ -22,11 +24,27 @@ public class TakeCoverInfo : TurretedInfo\n \t\t[Desc(\"Prone movement speed as a percentage of the normal speed.\")]\n \t\tpublic readonly int SpeedModifier = 50;\n \n+\t\t[Desc(\"Damage types that trigger prone state. Defined on the warheads.\")]\n+\t\tpublic readonly string[] ProneTriggers = new string[0];\n+\n+\t\t[FieldLoader.LoadUsing(\"LoadModifiers\")]\n+\t\t[Desc(\"Damage modifiers for each damage type (defined on the warheads) that makes the unit go prone.\")]\n+\t\tpublic readonly Dictionary<string, int> DamageModifiers = new Dictionary<string, int>();\n+\n \t\tpublic readonly WVec ProneOffset = new WVec(85, 0, -171);\n \n \t\tpublic readonly string ProneSequencePrefix = \"prone-\";\n \n \t\tpublic override object Create(ActorInitializer init) { return new TakeCover(init, this); }\n+\n+\t\tpublic static object LoadModifiers(MiniYaml yaml)\n+\t\t{\n+\t\t\tvar md = yaml.ToDictionary();\n+\n+\t\t\treturn md.ContainsKey(\"DamageModifiers\")\n+\t\t\t\t? md[\"DamageModifiers\"].ToDictionary(my => FieldLoader.GetValue<int>(\"(value)\", my.Value))\n+\t\t\t\t: new Dictionary<string, int>();","path":"OpenRA.Mods.Common/Traits/Infantry/TakeCover.cs","position":32,"original_position":32,"commit_id":"f95617458a98cc596ba829743d2834b666b09f11","original_commit_id":"f95617458a98cc596ba829743d2834b666b09f11","user":{"login":"pchote","id":167819,"avatar_url":"https://avatars.githubusercontent.com/u/167819?v=3","gravatar_id":"","url":"https://api.github.com/users/pchote","html_url":"https://github.com/pchote","followers_url":"https://api.github.com/users/pchote/followers","following_url":"https://api.github.com/users/pchote/following{/other_user}","gists_url":"https://api.github.com/users/pchote/gists{/gist_id}","starred_url":"https://api.github.com/users/pchote/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pchote/subscriptions","organizations_url":"https://api.github.com/users/pchote/orgs","repos_url":"https://api.github.com/users/pchote/repos","events_url":"https://api.github.com/users/pchote/events{/privacy}","received_events_url":"https://api.github.com/users/pchote/received_events","type":"User","site_admin":false},"body":"It would be better to default `Prone50Percent => 50` here and `TriggerProne` above so that mods that don't otherwise care don't need to explicitly specify them.  You could then drop the unnecessary upgrade rule.","created_at":"2015-04-24T11:48:07Z","updated_at":"2015-04-24T11:48:07Z","html_url":"https://github.com/OpenRA/OpenRA/pull/8011#discussion_r29042290","pull_request_url":"https://api.github.com/repos/OpenRA/OpenRA/pulls/8011","_links":{"self":{"href":"https://api.github.com/repos/OpenRA/OpenRA/pulls/comments/29042290"},"html":{"href":"https://github.com/OpenRA/OpenRA/pull/8011#discussion_r29042290"},"pull_request":{"href":"https://api.github.com/repos/OpenRA/OpenRA/pulls/8011"}}},"pull_request":{"url":"https://api.github.com/repos/OpenRA/OpenRA/pulls/8011","id":34040306,"html_url":"https://github.com/OpenRA/OpenRA/pull/8011","diff_url":"https://github.com/OpenRA/OpenRA/pull/8011.diff","patch_url":"https://github.com/OpenRA/OpenRA/pull/8011.patch","issue_url":"https://api.github.com/repos/OpenRA/OpenRA/issues/8011","number":8011,"state":"open","locked":false,"title":"Move prone-related logic from DamageWarhead to TakeCover","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":"This is some random logic cleanup. The \"prone\" state in infantry-specific logic, which is handled by the `TakeCover` trait. Warheads should know nothing of it. Especially while they are in the engine.\r\nThe `DamageTypes` property of `DamageWarhead` can be used for interaction with other traits in the future. First thing that comes to mind are shields.\r\n\r\nThis is hopefully the first step to cleaning up the warhead code a bit.\r\nSorry for the big PR, but it's 90% YAML, so it's not as scary as it looks ;)","created_at":"2015-04-24T11:31:31Z","updated_at":"2015-04-24T11:48:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4548b4f2d532e68e6647651b4f5a46809625891d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/OpenRA/OpenRA/pulls/8011/commits","review_comments_url":"https://api.github.com/repos/OpenRA/OpenRA/pulls/8011/comments","review_comment_url":"https://api.github.com/repos/OpenRA/OpenRA/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OpenRA/OpenRA/issues/8011/comments","statuses_url":"https://api.github.com/repos/OpenRA/OpenRA/statuses/f95617458a98cc596ba829743d2834b666b09f11","head":{"label":"penev92:bleed_fixTakeCover","ref":"bleed_fixTakeCover","sha":"f95617458a98cc596ba829743d2834b666b09f11","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},"repo":{"id":24796059,"name":"OpenRA","full_name":"penev92/OpenRA","owner":{"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},"private":false,"html_url":"https://github.com/penev92/OpenRA","description":"An open-source implementation of the Command & Conquer: Red Alert engine using .NET/Mono and OpenGL. Runs on Windows, Linux and Mac OS X.","fork":true,"url":"https://api.github.com/repos/penev92/OpenRA","forks_url":"https://api.github.com/repos/penev92/OpenRA/forks","keys_url":"https://api.github.com/repos/penev92/OpenRA/keys{/key_id}","collaborators_url":"https://api.github.com/repos/penev92/OpenRA/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/penev92/OpenRA/teams","hooks_url":"https://api.github.com/repos/penev92/OpenRA/hooks","issue_events_url":"https://api.github.com/repos/penev92/OpenRA/issues/events{/number}","events_url":"https://api.github.com/repos/penev92/OpenRA/events","assignees_url":"https://api.github.com/repos/penev92/OpenRA/assignees{/user}","branches_url":"https://api.github.com/repos/penev92/OpenRA/branches{/branch}","tags_url":"https://api.github.com/repos/penev92/OpenRA/tags","blobs_url":"https://api.github.com/repos/penev92/OpenRA/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/penev92/OpenRA/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/penev92/OpenRA/git/refs{/sha}","trees_url":"https://api.github.com/repos/penev92/OpenRA/git/trees{/sha}","statuses_url":"https://api.github.com/repos/penev92/OpenRA/statuses/{sha}","languages_url":"https://api.github.com/repos/penev92/OpenRA/languages","stargazers_url":"https://api.github.com/repos/penev92/OpenRA/stargazers","contributors_url":"https://api.github.com/repos/penev92/OpenRA/contributors","subscribers_url":"https://api.github.com/repos/penev92/OpenRA/subscribers","subscription_url":"https://api.github.com/repos/penev92/OpenRA/subscription","commits_url":"https://api.github.com/repos/penev92/OpenRA/commits{/sha}","git_commits_url":"https://api.github.com/repos/penev92/OpenRA/git/commits{/sha}","comments_url":"https://api.github.com/repos/penev92/OpenRA/comments{/number}","issue_comment_url":"https://api.github.com/repos/penev92/OpenRA/issues/comments{/number}","contents_url":"https://api.github.com/repos/penev92/OpenRA/contents/{+path}","compare_url":"https://api.github.com/repos/penev92/OpenRA/compare/{base}...{head}","merges_url":"https://api.github.com/repos/penev92/OpenRA/merges","archive_url":"https://api.github.com/repos/penev92/OpenRA/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/penev92/OpenRA/downloads","issues_url":"https://api.github.com/repos/penev92/OpenRA/issues{/number}","pulls_url":"https://api.github.com/repos/penev92/OpenRA/pulls{/number}","milestones_url":"https://api.github.com/repos/penev92/OpenRA/milestones{/number}","notifications_url":"https://api.github.com/repos/penev92/OpenRA/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/penev92/OpenRA/labels{/name}","releases_url":"https://api.github.com/repos/penev92/OpenRA/releases{/id}","created_at":"2014-10-04T17:27:45Z","updated_at":"2014-10-05T20:15:38Z","pushed_at":"2015-04-24T11:24:52Z","git_url":"git://github.com/penev92/OpenRA.git","ssh_url":"git@github.com:penev92/OpenRA.git","clone_url":"https://github.com/penev92/OpenRA.git","svn_url":"https://github.com/penev92/OpenRA","homepage":"http://www.openra.net","size":88349,"stargazers_count":0,"watchers_count":0,"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":0,"default_branch":"bleed"}},"base":{"label":"OpenRA:bleed","ref":"bleed","sha":"f6051b1e2b251a829a323447a5f0ecbe185237d6","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":"An open-source implementation of the Command & Conquer: Red Alert engine using .NET/Mono 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-04-24T06:35:42Z","pushed_at":"2015-04-24T11:31:32Z","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":169850,"stargazers_count":1867,"watchers_count":1867,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":677,"mirror_url":null,"open_issues_count":810,"forks":677,"open_issues":810,"watchers":1867,"default_branch":"bleed"}},"_links":{"self":{"href":"https://api.github.com/repos/OpenRA/OpenRA/pulls/8011"},"html":{"href":"https://github.com/OpenRA/OpenRA/pull/8011"},"issue":{"href":"https://api.github.com/repos/OpenRA/OpenRA/issues/8011"},"comments":{"href":"https://api.github.com/repos/OpenRA/OpenRA/issues/8011/comments"},"review_comments":{"href":"https://api.github.com/repos/OpenRA/OpenRA/pulls/8011/comments"},"review_comment":{"href":"https://api.github.com/repos/OpenRA/OpenRA/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OpenRA/OpenRA/pulls/8011/commits"},"statuses":{"href":"https://api.github.com/repos/OpenRA/OpenRA/statuses/f95617458a98cc596ba829743d2834b666b09f11"}}}}