{"action":"created","comment":{"url":"https://api.github.com/repos/OpenRA/OpenRA/pulls/comments/28652849","id":28652849,"diff_hunk":"@@ -0,0 +1,61 @@\n+#region Copyright & License Information\n+/*\n+ * Copyright 2007-2015 The OpenRA Developers (see AUTHORS)\n+ * This file is part of OpenRA, which is free software. It is made\n+ * available to you under the terms of the GNU General Public License\n+ * as published by the Free Software Foundation. For more information,\n+ * see COPYING.\n+ */\n+#endregion\n+\n+using System.Drawing;\n+using System.Linq;\n+using OpenRA.Graphics;\n+using OpenRA.Traits;\n+\n+namespace OpenRA.Mods.Common.Traits\n+{\n+\t[Desc(\"Used for stormy weather effects.\")]\n+\tclass FlashPaletteEffectInfo : ITraitInfo\n+\t{\n+\t\tpublic readonly string[] ExcludePalettes = { \"cursor\", \"chrome\", \"colorpicker\", \"fog\", \"shroud\" };\n+\n+\t\tpublic readonly float LightningChance = 0.99f;\n+\n+\t\tpublic object Create(ActorInitializer init) { return new FlashPaletteEffect(this); }\n+\t}\n+\n+\tclass FlashPaletteEffect : IPaletteModifier, ITick\n+\t{\n+\t\tpublic bool Lightning = false;\n+\n+\t\treadonly FlashPaletteEffectInfo info;\n+\n+\t\tpublic FlashPaletteEffect(FlashPaletteEffectInfo info)\n+\t\t{\n+\t\t\tthis.info = info;\n+\t\t}\n+\n+\t\tpublic void Tick(Actor self)\n+\t\t{\n+\t\t\tLightning = self.World.SharedRandom.NextFloat() > info.LightningChance;\n+\t\t}\n+\n+\t\tpublic void AdjustPalette(IReadOnlyDictionary<string, MutablePalette> palettes)\n+\t\t{\n+\t\t\tforeach (var kvp in palettes)\n+\t\t\t{\n+\t\t\t\tif (info.ExcludePalettes.Contains(kvp.Key))\n+\t\t\t\t\tcontinue;\n+\n+\t\t\t\tvar palette = kvp.Value;\n+\n+\t\t\t\tfor (var x = 0; x < 256; x++)","path":"OpenRA.Mods.Common/Traits/PaletteEffects/FlashPaletteEffect.cs","position":null,"original_position":53,"commit_id":"1898c82b0512d62dc2de22efff1d752f92632c63","original_commit_id":"0fe2de21773e87e3e1eed252736b7e72f5074daf","user":{"login":"Mailaender","id":756669,"avatar_url":"https://avatars.githubusercontent.com/u/756669?v=3","gravatar_id":"","url":"https://api.github.com/users/Mailaender","html_url":"https://github.com/Mailaender","followers_url":"https://api.github.com/users/Mailaender/followers","following_url":"https://api.github.com/users/Mailaender/following{/other_user}","gists_url":"https://api.github.com/users/Mailaender/gists{/gist_id}","starred_url":"https://api.github.com/users/Mailaender/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mailaender/subscriptions","organizations_url":"https://api.github.com/users/Mailaender/orgs","repos_url":"https://api.github.com/users/Mailaender/repos","events_url":"https://api.github.com/users/Mailaender/events{/privacy}","received_events_url":"https://api.github.com/users/Mailaender/received_events","type":"User","site_admin":false},"body":"Done.","created_at":"2015-04-19T13:29:15Z","updated_at":"2015-04-19T13:29:15Z","html_url":"https://github.com/OpenRA/OpenRA/pull/7872#discussion_r28652849","pull_request_url":"https://api.github.com/repos/OpenRA/OpenRA/pulls/7872","_links":{"self":{"href":"https://api.github.com/repos/OpenRA/OpenRA/pulls/comments/28652849"},"html":{"href":"https://github.com/OpenRA/OpenRA/pull/7872#discussion_r28652849"},"pull_request":{"href":"https://api.github.com/repos/OpenRA/OpenRA/pulls/7872"}}},"pull_request":{"url":"https://api.github.com/repos/OpenRA/OpenRA/pulls/7872","id":32651892,"html_url":"https://github.com/OpenRA/OpenRA/pull/7872","diff_url":"https://github.com/OpenRA/OpenRA/pull/7872.diff","patch_url":"https://github.com/OpenRA/OpenRA/pull/7872.patch","issue_url":"https://api.github.com/repos/OpenRA/OpenRA/issues/7872","number":7872,"state":"open","locked":false,"title":"Added a flash palette and thunder sound effect trait","user":{"login":"Mailaender","id":756669,"avatar_url":"https://avatars.githubusercontent.com/u/756669?v=3","gravatar_id":"","url":"https://api.github.com/users/Mailaender","html_url":"https://github.com/Mailaender","followers_url":"https://api.github.com/users/Mailaender/followers","following_url":"https://api.github.com/users/Mailaender/following{/other_user}","gists_url":"https://api.github.com/users/Mailaender/gists{/gist_id}","starred_url":"https://api.github.com/users/Mailaender/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mailaender/subscriptions","organizations_url":"https://api.github.com/users/Mailaender/orgs","repos_url":"https://api.github.com/users/Mailaender/repos","events_url":"https://api.github.com/users/Mailaender/events{/privacy}","received_events_url":"https://api.github.com/users/Mailaender/received_events","type":"User","site_admin":false},"body":"Split from https://github.com/OpenRA/OpenRA/pull/7863.","created_at":"2015-04-05T17:51:37Z","updated_at":"2015-04-19T13:29:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2b033b0959a23fe3929a07da295084f387b413e2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/OpenRA/OpenRA/pulls/7872/commits","review_comments_url":"https://api.github.com/repos/OpenRA/OpenRA/pulls/7872/comments","review_comment_url":"https://api.github.com/repos/OpenRA/OpenRA/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OpenRA/OpenRA/issues/7872/comments","statuses_url":"https://api.github.com/repos/OpenRA/OpenRA/statuses/1898c82b0512d62dc2de22efff1d752f92632c63","head":{"label":"Mailaender:storm-effects","ref":"storm-effects","sha":"1898c82b0512d62dc2de22efff1d752f92632c63","user":{"login":"Mailaender","id":756669,"avatar_url":"https://avatars.githubusercontent.com/u/756669?v=3","gravatar_id":"","url":"https://api.github.com/users/Mailaender","html_url":"https://github.com/Mailaender","followers_url":"https://api.github.com/users/Mailaender/followers","following_url":"https://api.github.com/users/Mailaender/following{/other_user}","gists_url":"https://api.github.com/users/Mailaender/gists{/gist_id}","starred_url":"https://api.github.com/users/Mailaender/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mailaender/subscriptions","organizations_url":"https://api.github.com/users/Mailaender/orgs","repos_url":"https://api.github.com/users/Mailaender/repos","events_url":"https://api.github.com/users/Mailaender/events{/privacy}","received_events_url":"https://api.github.com/users/Mailaender/received_events","type":"User","site_admin":false},"repo":{"id":3886414,"name":"OpenRA","full_name":"Mailaender/OpenRA","owner":{"login":"Mailaender","id":756669,"avatar_url":"https://avatars.githubusercontent.com/u/756669?v=3","gravatar_id":"","url":"https://api.github.com/users/Mailaender","html_url":"https://github.com/Mailaender","followers_url":"https://api.github.com/users/Mailaender/followers","following_url":"https://api.github.com/users/Mailaender/following{/other_user}","gists_url":"https://api.github.com/users/Mailaender/gists{/gist_id}","starred_url":"https://api.github.com/users/Mailaender/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mailaender/subscriptions","organizations_url":"https://api.github.com/users/Mailaender/orgs","repos_url":"https://api.github.com/users/Mailaender/repos","events_url":"https://api.github.com/users/Mailaender/events{/privacy}","received_events_url":"https://api.github.com/users/Mailaender/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Mailaender/OpenRA","description":"An open-source implementation of the Red Alert engine using .NET/mono and OpenGL. Runs on Windows, Linux and OSX.","fork":true,"url":"https://api.github.com/repos/Mailaender/OpenRA","forks_url":"https://api.github.com/repos/Mailaender/OpenRA/forks","keys_url":"https://api.github.com/repos/Mailaender/OpenRA/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Mailaender/OpenRA/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Mailaender/OpenRA/teams","hooks_url":"https://api.github.com/repos/Mailaender/OpenRA/hooks","issue_events_url":"https://api.github.com/repos/Mailaender/OpenRA/issues/events{/number}","events_url":"https://api.github.com/repos/Mailaender/OpenRA/events","assignees_url":"https://api.github.com/repos/Mailaender/OpenRA/assignees{/user}","branches_url":"https://api.github.com/repos/Mailaender/OpenRA/branches{/branch}","tags_url":"https://api.github.com/repos/Mailaender/OpenRA/tags","blobs_url":"https://api.github.com/repos/Mailaender/OpenRA/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Mailaender/OpenRA/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Mailaender/OpenRA/git/refs{/sha}","trees_url":"https://api.github.com/repos/Mailaender/OpenRA/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Mailaender/OpenRA/statuses/{sha}","languages_url":"https://api.github.com/repos/Mailaender/OpenRA/languages","stargazers_url":"https://api.github.com/repos/Mailaender/OpenRA/stargazers","contributors_url":"https://api.github.com/repos/Mailaender/OpenRA/contributors","subscribers_url":"https://api.github.com/repos/Mailaender/OpenRA/subscribers","subscription_url":"https://api.github.com/repos/Mailaender/OpenRA/subscription","commits_url":"https://api.github.com/repos/Mailaender/OpenRA/commits{/sha}","git_commits_url":"https://api.github.com/repos/Mailaender/OpenRA/git/commits{/sha}","comments_url":"https://api.github.com/repos/Mailaender/OpenRA/comments{/number}","issue_comment_url":"https://api.github.com/repos/Mailaender/OpenRA/issues/comments{/number}","contents_url":"https://api.github.com/repos/Mailaender/OpenRA/contents/{+path}","compare_url":"https://api.github.com/repos/Mailaender/OpenRA/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Mailaender/OpenRA/merges","archive_url":"https://api.github.com/repos/Mailaender/OpenRA/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Mailaender/OpenRA/downloads","issues_url":"https://api.github.com/repos/Mailaender/OpenRA/issues{/number}","pulls_url":"https://api.github.com/repos/Mailaender/OpenRA/pulls{/number}","milestones_url":"https://api.github.com/repos/Mailaender/OpenRA/milestones{/number}","notifications_url":"https://api.github.com/repos/Mailaender/OpenRA/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Mailaender/OpenRA/labels{/name}","releases_url":"https://api.github.com/repos/Mailaender/OpenRA/releases{/id}","created_at":"2012-03-31T15:36:43Z","updated_at":"2014-12-20T08:50:16Z","pushed_at":"2015-04-19T13:26:35Z","git_url":"git://github.com/Mailaender/OpenRA.git","ssh_url":"git@github.com:Mailaender/OpenRA.git","clone_url":"https://github.com/Mailaender/OpenRA.git","svn_url":"https://github.com/Mailaender/OpenRA","homepage":"http://www.openra.net","size":122760,"stargazers_count":6,"watchers_count":6,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":0,"forks":4,"open_issues":0,"watchers":6,"default_branch":"bleed"}},"base":{"label":"OpenRA:bleed","ref":"bleed","sha":"5676c55082f3395dd56f13d6959540beac7f6626","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-19T10:40:49Z","pushed_at":"2015-04-19T13:28:33Z","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":168731,"stargazers_count":1862,"watchers_count":1862,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":674,"mirror_url":null,"open_issues_count":804,"forks":674,"open_issues":804,"watchers":1862,"default_branch":"bleed"}},"_links":{"self":{"href":"https://api.github.com/repos/OpenRA/OpenRA/pulls/7872"},"html":{"href":"https://github.com/OpenRA/OpenRA/pull/7872"},"issue":{"href":"https://api.github.com/repos/OpenRA/OpenRA/issues/7872"},"comments":{"href":"https://api.github.com/repos/OpenRA/OpenRA/issues/7872/comments"},"review_comments":{"href":"https://api.github.com/repos/OpenRA/OpenRA/pulls/7872/comments"},"review_comment":{"href":"https://api.github.com/repos/OpenRA/OpenRA/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OpenRA/OpenRA/pulls/7872/commits"},"statuses":{"href":"https://api.github.com/repos/OpenRA/OpenRA/statuses/1898c82b0512d62dc2de22efff1d752f92632c63"}}}}