{"action":"created","comment":{"url":"https://api.github.com/repos/rpherbig/dr-scripts/pulls/comments/78280085","id":78280085,"diff_hunk":"@@ -295,73 +295,74 @@ class LootProcess\n     end\n   end\n \n-  def dispose_body(game_state)\n-    return unless @loot_bodies\n-    if DRRoom.dead_npcs.empty?\n-      @last_ritual = nil\n-      return\n-    end\n-    return if Time.now - @loot_timer < @loot_delay\n+  def check_rituals(game_state)\n+    return unless DRStats.necromancer?\n \n-    game_state.mob_died = true\n-    healing = game_state.casting_consume || game_state.prepare_consume\n-    if @necro && @last_ritual.nil?\n+    if @last_ritual.nil?\n       if @heal\n         game_state.wounds = check_health\n         echo \"Severity to Wounds: #{game_state.wounds}\" if $debug_mode_ct\n         unless game_state.wounds.empty?\n-          game_state.prepare_consume = healing = check_thanatology(DRRoom.dead_npcs.first, 'preserve', game_state) && check_thanatology(DRRoom.dead_npcs.first, 'consume', game_state)\n+          do_ritual(DRRoom.dead_npcs.first, 'preserve', game_state)\n+          do_ritual(DRRoom.dead_npcs.first, 'consume', game_state)\n         end\n       end\n-      if @ritual_type == 'harvest'\n-        check_thanatology(DRRoom.dead_npcs.first, 'preserve', game_state)\n-      end\n-      check_thanatology(DRRoom.dead_npcs.first, @ritual_type, game_state) unless healing\n-      if ['preserve'].include?(@ritual_type) && !healing\n-        arrange_mob(DRRoom.dead_npcs.first, game_state)\n-        check_skinning(DRRoom.dead_npcs.first, game_state)\n-      end\n-    elsif @skin && !%w(consume harvest dissect).include?(@last_ritual)\n-      arrange_mob(DRRoom.dead_npcs.first, game_state)\n-      check_skinning(DRRoom.dead_npcs.first, game_state)\n-    end\n-    unless healing\n-      while 'and get ready to search it' == bput('loot', 'You search', 'I could not find what you were referring to', 'and get ready to search it')\n-        pause\n-        waitrt?\n+\n+      if @ritual_type == 'harvest' && ! game_state.prepare_consume\n+        do_ritual(DRRoom.dead_npcs.first, 'preserve', game_state)\n+        do_ritual(DRRoom.dead_npcs.first, @ritual_type, game_state)\n+      elsif @ritual_type && ! game_state.prepare_consume\n+        do_ritual(DRRoom.dead_npcs.first, @ritual_type, game_state)\n       end\n-      @last_ritual = nil\n     end\n-    @loot_timer = Time.now\n   end\n \n-  def check_thanatology(mob_noun, ritual, game_state)\n-    return false if game_state.construct?(mob_noun)\n+  def do_ritual(mob_noun, ritual, game_state)\n+    return unless DRStats.necromancer?\n+    return if game_state.construct?(mob_noun)\n \n     perform_message = \"perform #{ritual} on #{mob_noun}\"\n-    case bput(perform_message, 'Rituals do not work upon constructs', 'Rituals do not work upon the undead', 'This ritual may only be performed on a corpse', 'precise motions with your ritual knife', 'corpse to make one long', 'carefully position the corpse', 'corpse and make a few quick precise cuts', 'roundtime')\n-    when 'corpse to make one long', 'carefully position the corpse', 'corpse and make a few quick precise cuts', 'Your cuts follow the vital lines of the corpse'\n+    case bput(perform_message, 'Rituals do not work upon constructs', 'Rituals do not work upon the undead', 'This ritual may only be performed on a corpse', 'precise motions with your ritual knife', 'corpse to make one long', 'carefully position the corpse', 'roundtime', 'Your cuts follow the vital lines of the corpse')","path":"combat-trainer.lic","position":73,"original_position":73,"commit_id":"072bd6a7131507afa06bcb68d319175aca191846","original_commit_id":"072bd6a7131507afa06bcb68d319175aca191846","user":{"login":"jandersson","id":606225,"avatar_url":"https://avatars.githubusercontent.com/u/606225?v=3","gravatar_id":"","url":"https://api.github.com/users/jandersson","html_url":"https://github.com/jandersson","followers_url":"https://api.github.com/users/jandersson/followers","following_url":"https://api.github.com/users/jandersson/following{/other_user}","gists_url":"https://api.github.com/users/jandersson/gists{/gist_id}","starred_url":"https://api.github.com/users/jandersson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jandersson/subscriptions","organizations_url":"https://api.github.com/users/jandersson/orgs","repos_url":"https://api.github.com/users/jandersson/repos","events_url":"https://api.github.com/users/jandersson/events{/privacy}","received_events_url":"https://api.github.com/users/jandersson/received_events","type":"User","site_admin":false},"body":"I was also thinking it might be useful to build a hash map of rituals to messages because it is not exactly clear what rituals are being checked here.","created_at":"2016-09-10T16:49:28Z","updated_at":"2016-09-10T16:49:28Z","html_url":"https://github.com/rpherbig/dr-scripts/pull/767#discussion_r78280085","pull_request_url":"https://api.github.com/repos/rpherbig/dr-scripts/pulls/767","_links":{"self":{"href":"https://api.github.com/repos/rpherbig/dr-scripts/pulls/comments/78280085"},"html":{"href":"https://github.com/rpherbig/dr-scripts/pull/767#discussion_r78280085"},"pull_request":{"href":"https://api.github.com/repos/rpherbig/dr-scripts/pulls/767"}}},"pull_request":{"url":"https://api.github.com/repos/rpherbig/dr-scripts/pulls/767","id":84752571,"html_url":"https://github.com/rpherbig/dr-scripts/pull/767","diff_url":"https://github.com/rpherbig/dr-scripts/pull/767.diff","patch_url":"https://github.com/rpherbig/dr-scripts/pull/767.patch","issue_url":"https://api.github.com/repos/rpherbig/dr-scripts/issues/767","number":767,"state":"open","locked":false,"title":"Refactor ritual performance in combat trainer","user":{"login":"jandersson","id":606225,"avatar_url":"https://avatars.githubusercontent.com/u/606225?v=3","gravatar_id":"","url":"https://api.github.com/users/jandersson","html_url":"https://github.com/jandersson","followers_url":"https://api.github.com/users/jandersson/followers","following_url":"https://api.github.com/users/jandersson/following{/other_user}","gists_url":"https://api.github.com/users/jandersson/gists{/gist_id}","starred_url":"https://api.github.com/users/jandersson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jandersson/subscriptions","organizations_url":"https://api.github.com/users/jandersson/orgs","repos_url":"https://api.github.com/users/jandersson/repos","events_url":"https://api.github.com/users/jandersson/events{/privacy}","received_events_url":"https://api.github.com/users/jandersson/received_events","type":"User","site_admin":false},"body":"Addressing #667 ","created_at":"2016-09-10T11:08:23Z","updated_at":"2016-09-10T16:49:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"382d8ff11f4e81720a90f493ce5c9a3e6bad327b","assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/rpherbig/dr-scripts/milestones/6","html_url":"https://github.com/rpherbig/dr-scripts/milestones/v7","labels_url":"https://api.github.com/repos/rpherbig/dr-scripts/milestones/6/labels","id":1794395,"number":6,"title":"v7","description":"","creator":{"login":"rpherbig","id":1181607,"avatar_url":"https://avatars.githubusercontent.com/u/1181607?v=3","gravatar_id":"","url":"https://api.github.com/users/rpherbig","html_url":"https://github.com/rpherbig","followers_url":"https://api.github.com/users/rpherbig/followers","following_url":"https://api.github.com/users/rpherbig/following{/other_user}","gists_url":"https://api.github.com/users/rpherbig/gists{/gist_id}","starred_url":"https://api.github.com/users/rpherbig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rpherbig/subscriptions","organizations_url":"https://api.github.com/users/rpherbig/orgs","repos_url":"https://api.github.com/users/rpherbig/repos","events_url":"https://api.github.com/users/rpherbig/events{/privacy}","received_events_url":"https://api.github.com/users/rpherbig/received_events","type":"User","site_admin":false},"open_issues":78,"closed_issues":152,"state":"open","created_at":"2016-05-29T11:36:30Z","updated_at":"2016-09-10T16:32:01Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/rpherbig/dr-scripts/pulls/767/commits","review_comments_url":"https://api.github.com/repos/rpherbig/dr-scripts/pulls/767/comments","review_comment_url":"https://api.github.com/repos/rpherbig/dr-scripts/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rpherbig/dr-scripts/issues/767/comments","statuses_url":"https://api.github.com/repos/rpherbig/dr-scripts/statuses/072bd6a7131507afa06bcb68d319175aca191846","head":{"label":"jandersson:ritual_refactor","ref":"ritual_refactor","sha":"072bd6a7131507afa06bcb68d319175aca191846","user":{"login":"jandersson","id":606225,"avatar_url":"https://avatars.githubusercontent.com/u/606225?v=3","gravatar_id":"","url":"https://api.github.com/users/jandersson","html_url":"https://github.com/jandersson","followers_url":"https://api.github.com/users/jandersson/followers","following_url":"https://api.github.com/users/jandersson/following{/other_user}","gists_url":"https://api.github.com/users/jandersson/gists{/gist_id}","starred_url":"https://api.github.com/users/jandersson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jandersson/subscriptions","organizations_url":"https://api.github.com/users/jandersson/orgs","repos_url":"https://api.github.com/users/jandersson/repos","events_url":"https://api.github.com/users/jandersson/events{/privacy}","received_events_url":"https://api.github.com/users/jandersson/received_events","type":"User","site_admin":false},"repo":{"id":61384122,"name":"dr-scripts","full_name":"jandersson/dr-scripts","owner":{"login":"jandersson","id":606225,"avatar_url":"https://avatars.githubusercontent.com/u/606225?v=3","gravatar_id":"","url":"https://api.github.com/users/jandersson","html_url":"https://github.com/jandersson","followers_url":"https://api.github.com/users/jandersson/followers","following_url":"https://api.github.com/users/jandersson/following{/other_user}","gists_url":"https://api.github.com/users/jandersson/gists{/gist_id}","starred_url":"https://api.github.com/users/jandersson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jandersson/subscriptions","organizations_url":"https://api.github.com/users/jandersson/orgs","repos_url":"https://api.github.com/users/jandersson/repos","events_url":"https://api.github.com/users/jandersson/events{/privacy}","received_events_url":"https://api.github.com/users/jandersson/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jandersson/dr-scripts","description":"A series of Lich (https://lichproject.org/) scripts for use in DragonRealms (http://www.play.net/dr/).","fork":true,"url":"https://api.github.com/repos/jandersson/dr-scripts","forks_url":"https://api.github.com/repos/jandersson/dr-scripts/forks","keys_url":"https://api.github.com/repos/jandersson/dr-scripts/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jandersson/dr-scripts/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jandersson/dr-scripts/teams","hooks_url":"https://api.github.com/repos/jandersson/dr-scripts/hooks","issue_events_url":"https://api.github.com/repos/jandersson/dr-scripts/issues/events{/number}","events_url":"https://api.github.com/repos/jandersson/dr-scripts/events","assignees_url":"https://api.github.com/repos/jandersson/dr-scripts/assignees{/user}","branches_url":"https://api.github.com/repos/jandersson/dr-scripts/branches{/branch}","tags_url":"https://api.github.com/repos/jandersson/dr-scripts/tags","blobs_url":"https://api.github.com/repos/jandersson/dr-scripts/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jandersson/dr-scripts/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jandersson/dr-scripts/git/refs{/sha}","trees_url":"https://api.github.com/repos/jandersson/dr-scripts/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jandersson/dr-scripts/statuses/{sha}","languages_url":"https://api.github.com/repos/jandersson/dr-scripts/languages","stargazers_url":"https://api.github.com/repos/jandersson/dr-scripts/stargazers","contributors_url":"https://api.github.com/repos/jandersson/dr-scripts/contributors","subscribers_url":"https://api.github.com/repos/jandersson/dr-scripts/subscribers","subscription_url":"https://api.github.com/repos/jandersson/dr-scripts/subscription","commits_url":"https://api.github.com/repos/jandersson/dr-scripts/commits{/sha}","git_commits_url":"https://api.github.com/repos/jandersson/dr-scripts/git/commits{/sha}","comments_url":"https://api.github.com/repos/jandersson/dr-scripts/comments{/number}","issue_comment_url":"https://api.github.com/repos/jandersson/dr-scripts/issues/comments{/number}","contents_url":"https://api.github.com/repos/jandersson/dr-scripts/contents/{+path}","compare_url":"https://api.github.com/repos/jandersson/dr-scripts/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jandersson/dr-scripts/merges","archive_url":"https://api.github.com/repos/jandersson/dr-scripts/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jandersson/dr-scripts/downloads","issues_url":"https://api.github.com/repos/jandersson/dr-scripts/issues{/number}","pulls_url":"https://api.github.com/repos/jandersson/dr-scripts/pulls{/number}","milestones_url":"https://api.github.com/repos/jandersson/dr-scripts/milestones{/number}","notifications_url":"https://api.github.com/repos/jandersson/dr-scripts/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jandersson/dr-scripts/labels{/name}","releases_url":"https://api.github.com/repos/jandersson/dr-scripts/releases{/id}","deployments_url":"https://api.github.com/repos/jandersson/dr-scripts/deployments","created_at":"2016-06-17T15:35:12Z","updated_at":"2016-06-17T15:35:13Z","pushed_at":"2016-09-10T16:30:47Z","git_url":"git://github.com/jandersson/dr-scripts.git","ssh_url":"git@github.com:jandersson/dr-scripts.git","clone_url":"https://github.com/jandersson/dr-scripts.git","svn_url":"https://github.com/jandersson/dr-scripts","homepage":"","size":3693,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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":"master"}},"base":{"label":"rpherbig:master","ref":"master","sha":"81b33e30463aeaa4ecf9fed2908161e1c5f14382","user":{"login":"rpherbig","id":1181607,"avatar_url":"https://avatars.githubusercontent.com/u/1181607?v=3","gravatar_id":"","url":"https://api.github.com/users/rpherbig","html_url":"https://github.com/rpherbig","followers_url":"https://api.github.com/users/rpherbig/followers","following_url":"https://api.github.com/users/rpherbig/following{/other_user}","gists_url":"https://api.github.com/users/rpherbig/gists{/gist_id}","starred_url":"https://api.github.com/users/rpherbig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rpherbig/subscriptions","organizations_url":"https://api.github.com/users/rpherbig/orgs","repos_url":"https://api.github.com/users/rpherbig/repos","events_url":"https://api.github.com/users/rpherbig/events{/privacy}","received_events_url":"https://api.github.com/users/rpherbig/received_events","type":"User","site_admin":false},"repo":{"id":44390324,"name":"dr-scripts","full_name":"rpherbig/dr-scripts","owner":{"login":"rpherbig","id":1181607,"avatar_url":"https://avatars.githubusercontent.com/u/1181607?v=3","gravatar_id":"","url":"https://api.github.com/users/rpherbig","html_url":"https://github.com/rpherbig","followers_url":"https://api.github.com/users/rpherbig/followers","following_url":"https://api.github.com/users/rpherbig/following{/other_user}","gists_url":"https://api.github.com/users/rpherbig/gists{/gist_id}","starred_url":"https://api.github.com/users/rpherbig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rpherbig/subscriptions","organizations_url":"https://api.github.com/users/rpherbig/orgs","repos_url":"https://api.github.com/users/rpherbig/repos","events_url":"https://api.github.com/users/rpherbig/events{/privacy}","received_events_url":"https://api.github.com/users/rpherbig/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rpherbig/dr-scripts","description":"A series of Lich (https://lichproject.org/) scripts for use in DragonRealms (http://www.play.net/dr/). Donations are welcome (http://www.paypal.me/rcuhljr)!","fork":false,"url":"https://api.github.com/repos/rpherbig/dr-scripts","forks_url":"https://api.github.com/repos/rpherbig/dr-scripts/forks","keys_url":"https://api.github.com/repos/rpherbig/dr-scripts/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rpherbig/dr-scripts/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rpherbig/dr-scripts/teams","hooks_url":"https://api.github.com/repos/rpherbig/dr-scripts/hooks","issue_events_url":"https://api.github.com/repos/rpherbig/dr-scripts/issues/events{/number}","events_url":"https://api.github.com/repos/rpherbig/dr-scripts/events","assignees_url":"https://api.github.com/repos/rpherbig/dr-scripts/assignees{/user}","branches_url":"https://api.github.com/repos/rpherbig/dr-scripts/branches{/branch}","tags_url":"https://api.github.com/repos/rpherbig/dr-scripts/tags","blobs_url":"https://api.github.com/repos/rpherbig/dr-scripts/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rpherbig/dr-scripts/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rpherbig/dr-scripts/git/refs{/sha}","trees_url":"https://api.github.com/repos/rpherbig/dr-scripts/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rpherbig/dr-scripts/statuses/{sha}","languages_url":"https://api.github.com/repos/rpherbig/dr-scripts/languages","stargazers_url":"https://api.github.com/repos/rpherbig/dr-scripts/stargazers","contributors_url":"https://api.github.com/repos/rpherbig/dr-scripts/contributors","subscribers_url":"https://api.github.com/repos/rpherbig/dr-scripts/subscribers","subscription_url":"https://api.github.com/repos/rpherbig/dr-scripts/subscription","commits_url":"https://api.github.com/repos/rpherbig/dr-scripts/commits{/sha}","git_commits_url":"https://api.github.com/repos/rpherbig/dr-scripts/git/commits{/sha}","comments_url":"https://api.github.com/repos/rpherbig/dr-scripts/comments{/number}","issue_comment_url":"https://api.github.com/repos/rpherbig/dr-scripts/issues/comments{/number}","contents_url":"https://api.github.com/repos/rpherbig/dr-scripts/contents/{+path}","compare_url":"https://api.github.com/repos/rpherbig/dr-scripts/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rpherbig/dr-scripts/merges","archive_url":"https://api.github.com/repos/rpherbig/dr-scripts/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rpherbig/dr-scripts/downloads","issues_url":"https://api.github.com/repos/rpherbig/dr-scripts/issues{/number}","pulls_url":"https://api.github.com/repos/rpherbig/dr-scripts/pulls{/number}","milestones_url":"https://api.github.com/repos/rpherbig/dr-scripts/milestones{/number}","notifications_url":"https://api.github.com/repos/rpherbig/dr-scripts/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rpherbig/dr-scripts/labels{/name}","releases_url":"https://api.github.com/repos/rpherbig/dr-scripts/releases{/id}","deployments_url":"https://api.github.com/repos/rpherbig/dr-scripts/deployments","created_at":"2015-10-16T14:28:28Z","updated_at":"2016-08-24T01:06:33Z","pushed_at":"2016-09-10T16:30:47Z","git_url":"git://github.com/rpherbig/dr-scripts.git","ssh_url":"git@github.com:rpherbig/dr-scripts.git","clone_url":"https://github.com/rpherbig/dr-scripts.git","svn_url":"https://github.com/rpherbig/dr-scripts","homepage":"","size":3956,"stargazers_count":10,"watchers_count":10,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":15,"mirror_url":null,"open_issues_count":160,"forks":15,"open_issues":160,"watchers":10,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rpherbig/dr-scripts/pulls/767"},"html":{"href":"https://github.com/rpherbig/dr-scripts/pull/767"},"issue":{"href":"https://api.github.com/repos/rpherbig/dr-scripts/issues/767"},"comments":{"href":"https://api.github.com/repos/rpherbig/dr-scripts/issues/767/comments"},"review_comments":{"href":"https://api.github.com/repos/rpherbig/dr-scripts/pulls/767/comments"},"review_comment":{"href":"https://api.github.com/repos/rpherbig/dr-scripts/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rpherbig/dr-scripts/pulls/767/commits"},"statuses":{"href":"https://api.github.com/repos/rpherbig/dr-scripts/statuses/072bd6a7131507afa06bcb68d319175aca191846"}}}}
{"actor":{"display_login":"jandersson"}}