{"action":"created","comment":{"url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/pulls/comments/53890354","id":53890354,"diff_hunk":"@@ -1,25 +1,165 @@\n using UnityEngine;\n using System.Collections;\n using System.Collections.Generic;\n+using UnityEngine.UI;\n \n public class SpellBuilder : MonoBehaviour {\n \n+\tprivate int curSpellIndex = 0;\n+\tprivate List<Spell> spellList = new List<Spell> ();\n+\tprivate Spell curSpell = null;\n+\n+\tprivate bool isStarted = false;\n+\n \tpublic AudioDictionary audioDict; //set in the UI\n \n \t// Use this for initialization\n \tvoid Start () {\n-\t\t//StartSpell ();\n+\t\t//StartSpell (); //StartSpell is started on the instruction button click/keypress\n \t}\n \n \tpublic void StartSpell(){\n+\t\tif (!isStarted) {\n+\t\t\tisStarted = true;\n+\n+\t\t\tspellList.Add (CreateRainSpell (\"rain1\"));\n+\t\t\tspellList.Add (CreateRainSpell (\"rain2\"));\n+\t\t\tspellList.Add (CreateRainSpell (\"rain3\"));\n+\n+\t\t\tStartFirstSpell ();\n+\t\t} else {\n+\t\t\t// Only get the next spell if the current spell is done\n+\t\t\t// (i.e. in case this gets called when a spell is in progress, don't get the next spell yet)\n+\t\t\tif (curSpell != null && IsSpellOver (curSpell)) {\n+\t\t\t\tGetNextSpellOrEndGame ();\n+\t\t\t} else {\n+\t\t\t\t//cwkTODO figure out why this happens!\n+\t\t\t\t//for some reason button click is called multiple times after spacebara is pressed on the instructions\n+\t\t\t\tDebug.Log (\"somebody called start spell when the current spell is in progress\");\n+\t\t\t}\n+\t\t}\n+\n+\t}\n+\n+\tprivate Spell CreateRainSpell (string name = \"rain\") {\n \t\tvar elements = new List<Element> () {\n \t\t\t//new Element (ElementType.Fire, 0, 5, 5),\n \t\t\t//new Element (ElementType.Earth, 0, 5, 5),\n-\t\t\tnew Element (ElementType.Water, 25, 32, 1.0f),\n-\t\t\tnew Element (ElementType.Wind, 25, 32, 0.5f)\n+\n+\t\t\t//cwkTODO put back water and wind settings\n+\t\t\t//\t\t\tnew Element (ElementType.Water, 25, 32, 1.0f),\n+\t\t\t//\t\t\tnew Element (ElementType.Wind, 25, 32, 0.5f)\n+\n+\t\t\t//cwkTODO easier settings for testing\n+\t\t\tnew Element (ElementType.Water, 5, 10, 1.0f),\n+\t\t\tnew Element (ElementType.Wind, 5, 10, 0.5f)\n \t\t};\n \n-\t\tvar rain = new Spell (\"rain\", elements, 20, 120,\n+\t\t//cwkTODO put back spell\n+\t\t//\t\tvar rain = new Spell (\"rain\", elements, 20, 120,\n+\t\t//\t\t\taudioDict.GetSound(\"thunderclap\"), audioDict.GetSound(\"cloudfailure\"));\n+\n+\t\t//cwkTODO easier settings for testing\n+\t\tvar rain = new Spell (name, elements, 5, 20,\n \t\t\taudioDict.GetSound(\"thunderclap\"), audioDict.GetSound(\"cloudfailure\"));\n+\n+\t\treturn rain;\n+\t}\n+\n+\tprivate void StartFirstSpell () {\n+\t\tif (spellList == null || spellList.Count < 1) {\n+\t\t\treturn;\n+\t\t}\n+\n+\t\tvar firstSpell = spellList [0];\n+\t\tfirstSpell.OnStateChange += StartNextSpell;","path":"Assets/Scripts/GameEngine/SpellBuilder.cs","position":79,"original_position":79,"commit_id":"cdc18090c99685a081bd9047e53d87affcf442bd","original_commit_id":"cdc18090c99685a081bd9047e53d87affcf442bd","user":{"login":"chriskwan","id":174767,"avatar_url":"https://avatars.githubusercontent.com/u/174767?v=3","gravatar_id":"","url":"https://api.github.com/users/chriskwan","html_url":"https://github.com/chriskwan","followers_url":"https://api.github.com/users/chriskwan/followers","following_url":"https://api.github.com/users/chriskwan/following{/other_user}","gists_url":"https://api.github.com/users/chriskwan/gists{/gist_id}","starred_url":"https://api.github.com/users/chriskwan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chriskwan/subscriptions","organizations_url":"https://api.github.com/users/chriskwan/orgs","repos_url":"https://api.github.com/users/chriskwan/repos","events_url":"https://api.github.com/users/chriskwan/events{/privacy}","received_events_url":"https://api.github.com/users/chriskwan/received_events","type":"User","site_admin":false},"body":"Addressed in #42","created_at":"2016-02-24T03:45:55Z","updated_at":"2016-02-24T03:45:55Z","html_url":"https://github.com/dggriffin/Rain-Rain-Ritual/pull/27#discussion_r53890354","pull_request_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/pulls/27","_links":{"self":{"href":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/pulls/comments/53890354"},"html":{"href":"https://github.com/dggriffin/Rain-Rain-Ritual/pull/27#discussion_r53890354"},"pull_request":{"href":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/pulls/27"}}},"pull_request":{"url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/pulls/27","id":60094900,"html_url":"https://github.com/dggriffin/Rain-Rain-Ritual/pull/27","diff_url":"https://github.com/dggriffin/Rain-Rain-Ritual/pull/27.diff","patch_url":"https://github.com/dggriffin/Rain-Rain-Ritual/pull/27.patch","issue_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/issues/27","number":27,"state":"closed","locked":false,"title":"Multiple spells support","user":{"login":"chriskwan","id":174767,"avatar_url":"https://avatars.githubusercontent.com/u/174767?v=3","gravatar_id":"","url":"https://api.github.com/users/chriskwan","html_url":"https://github.com/chriskwan","followers_url":"https://api.github.com/users/chriskwan/followers","following_url":"https://api.github.com/users/chriskwan/following{/other_user}","gists_url":"https://api.github.com/users/chriskwan/gists{/gist_id}","starred_url":"https://api.github.com/users/chriskwan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chriskwan/subscriptions","organizations_url":"https://api.github.com/users/chriskwan/orgs","repos_url":"https://api.github.com/users/chriskwan/repos","events_url":"https://api.github.com/users/chriskwan/events{/privacy}","received_events_url":"https://api.github.com/users/chriskwan/received_events","type":"User","site_admin":false},"body":"This is a work in progress, but pushing it in case anyone is interested. I will update this again once it is done.\r\n\r\nFixes #20 \r\n","created_at":"2016-02-21T17:06:16Z","updated_at":"2016-02-24T03:45:55Z","closed_at":"2016-02-23T23:34:30Z","merged_at":"2016-02-23T23:34:30Z","merge_commit_sha":"be1c30f12ccc0e5f2d0a6c2a7ca11c310928528e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/pulls/27/commits","review_comments_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/pulls/27/comments","review_comment_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/issues/27/comments","statuses_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/statuses/cdc18090c99685a081bd9047e53d87affcf442bd","head":{"label":"dggriffin:feat/multiple-spells","ref":"feat/multiple-spells","sha":"cdc18090c99685a081bd9047e53d87affcf442bd","user":{"login":"dggriffin","id":774648,"avatar_url":"https://avatars.githubusercontent.com/u/774648?v=3","gravatar_id":"","url":"https://api.github.com/users/dggriffin","html_url":"https://github.com/dggriffin","followers_url":"https://api.github.com/users/dggriffin/followers","following_url":"https://api.github.com/users/dggriffin/following{/other_user}","gists_url":"https://api.github.com/users/dggriffin/gists{/gist_id}","starred_url":"https://api.github.com/users/dggriffin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dggriffin/subscriptions","organizations_url":"https://api.github.com/users/dggriffin/orgs","repos_url":"https://api.github.com/users/dggriffin/repos","events_url":"https://api.github.com/users/dggriffin/events{/privacy}","received_events_url":"https://api.github.com/users/dggriffin/received_events","type":"User","site_admin":false},"repo":{"id":50706872,"name":"Rain-Rain-Ritual","full_name":"dggriffin/Rain-Rain-Ritual","owner":{"login":"dggriffin","id":774648,"avatar_url":"https://avatars.githubusercontent.com/u/774648?v=3","gravatar_id":"","url":"https://api.github.com/users/dggriffin","html_url":"https://github.com/dggriffin","followers_url":"https://api.github.com/users/dggriffin/followers","following_url":"https://api.github.com/users/dggriffin/following{/other_user}","gists_url":"https://api.github.com/users/dggriffin/gists{/gist_id}","starred_url":"https://api.github.com/users/dggriffin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dggriffin/subscriptions","organizations_url":"https://api.github.com/users/dggriffin/orgs","repos_url":"https://api.github.com/users/dggriffin/repos","events_url":"https://api.github.com/users/dggriffin/events{/privacy}","received_events_url":"https://api.github.com/users/dggriffin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dggriffin/Rain-Rain-Ritual","description":"A rhythm-based, Shaman game in Unity 5.","fork":false,"url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual","forks_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/forks","keys_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/teams","hooks_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/hooks","issue_events_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/issues/events{/number}","events_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/events","assignees_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/assignees{/user}","branches_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/branches{/branch}","tags_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/tags","blobs_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/git/refs{/sha}","trees_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/statuses/{sha}","languages_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/languages","stargazers_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/stargazers","contributors_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/contributors","subscribers_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/subscribers","subscription_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/subscription","commits_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/commits{/sha}","git_commits_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/git/commits{/sha}","comments_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/comments{/number}","issue_comment_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/issues/comments{/number}","contents_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/contents/{+path}","compare_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/merges","archive_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/downloads","issues_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/issues{/number}","pulls_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/pulls{/number}","milestones_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/milestones{/number}","notifications_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/labels{/name}","releases_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/releases{/id}","deployments_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/deployments","created_at":"2016-01-30T03:28:59Z","updated_at":"2016-02-23T18:41:53Z","pushed_at":"2016-02-24T03:34:21Z","git_url":"git://github.com/dggriffin/Rain-Rain-Ritual.git","ssh_url":"git@github.com:dggriffin/Rain-Rain-Ritual.git","clone_url":"https://github.com/dggriffin/Rain-Rain-Ritual.git","svn_url":"https://github.com/dggriffin/Rain-Rain-Ritual","homepage":"","size":41487,"stargazers_count":2,"watchers_count":2,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":26,"forks":1,"open_issues":26,"watchers":2,"default_branch":"master"}},"base":{"label":"dggriffin:master","ref":"master","sha":"0b926176d195291387307ffdb9367cd7ab77dfc6","user":{"login":"dggriffin","id":774648,"avatar_url":"https://avatars.githubusercontent.com/u/774648?v=3","gravatar_id":"","url":"https://api.github.com/users/dggriffin","html_url":"https://github.com/dggriffin","followers_url":"https://api.github.com/users/dggriffin/followers","following_url":"https://api.github.com/users/dggriffin/following{/other_user}","gists_url":"https://api.github.com/users/dggriffin/gists{/gist_id}","starred_url":"https://api.github.com/users/dggriffin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dggriffin/subscriptions","organizations_url":"https://api.github.com/users/dggriffin/orgs","repos_url":"https://api.github.com/users/dggriffin/repos","events_url":"https://api.github.com/users/dggriffin/events{/privacy}","received_events_url":"https://api.github.com/users/dggriffin/received_events","type":"User","site_admin":false},"repo":{"id":50706872,"name":"Rain-Rain-Ritual","full_name":"dggriffin/Rain-Rain-Ritual","owner":{"login":"dggriffin","id":774648,"avatar_url":"https://avatars.githubusercontent.com/u/774648?v=3","gravatar_id":"","url":"https://api.github.com/users/dggriffin","html_url":"https://github.com/dggriffin","followers_url":"https://api.github.com/users/dggriffin/followers","following_url":"https://api.github.com/users/dggriffin/following{/other_user}","gists_url":"https://api.github.com/users/dggriffin/gists{/gist_id}","starred_url":"https://api.github.com/users/dggriffin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dggriffin/subscriptions","organizations_url":"https://api.github.com/users/dggriffin/orgs","repos_url":"https://api.github.com/users/dggriffin/repos","events_url":"https://api.github.com/users/dggriffin/events{/privacy}","received_events_url":"https://api.github.com/users/dggriffin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dggriffin/Rain-Rain-Ritual","description":"A rhythm-based, Shaman game in Unity 5.","fork":false,"url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual","forks_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/forks","keys_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/teams","hooks_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/hooks","issue_events_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/issues/events{/number}","events_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/events","assignees_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/assignees{/user}","branches_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/branches{/branch}","tags_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/tags","blobs_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/git/refs{/sha}","trees_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/statuses/{sha}","languages_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/languages","stargazers_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/stargazers","contributors_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/contributors","subscribers_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/subscribers","subscription_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/subscription","commits_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/commits{/sha}","git_commits_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/git/commits{/sha}","comments_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/comments{/number}","issue_comment_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/issues/comments{/number}","contents_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/contents/{+path}","compare_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/merges","archive_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/downloads","issues_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/issues{/number}","pulls_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/pulls{/number}","milestones_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/milestones{/number}","notifications_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/labels{/name}","releases_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/releases{/id}","deployments_url":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/deployments","created_at":"2016-01-30T03:28:59Z","updated_at":"2016-02-23T18:41:53Z","pushed_at":"2016-02-24T03:34:21Z","git_url":"git://github.com/dggriffin/Rain-Rain-Ritual.git","ssh_url":"git@github.com:dggriffin/Rain-Rain-Ritual.git","clone_url":"https://github.com/dggriffin/Rain-Rain-Ritual.git","svn_url":"https://github.com/dggriffin/Rain-Rain-Ritual","homepage":"","size":41487,"stargazers_count":2,"watchers_count":2,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":26,"forks":1,"open_issues":26,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/pulls/27"},"html":{"href":"https://github.com/dggriffin/Rain-Rain-Ritual/pull/27"},"issue":{"href":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/issues/27"},"comments":{"href":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/issues/27/comments"},"review_comments":{"href":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/pulls/27/comments"},"review_comment":{"href":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/pulls/27/commits"},"statuses":{"href":"https://api.github.com/repos/dggriffin/Rain-Rain-Ritual/statuses/cdc18090c99685a081bd9047e53d87affcf442bd"}}}}