{"action":"created","comment":{"url":"https://api.github.com/repos/Tuxemon/Tuxemon/pulls/comments/76727996","id":76727996,"diff_hunk":"@@ -154,24 +150,24 @@ class with the name of the effect you define in item.db.\n         \"\"\"\n \n         # Loop through all the effects of this technique and execute the effect's function.\n+        result = True\n+        last_effect_name = \"no name\"\n         for effect in self.effect:\n             last_effect_name = str(effect)\n             result = getattr(self, last_effect_name)(user, target)\n \n+        # TODO: document how to handle items with multiple effects\n+\n         # If this is a consumable item, remove it from the player's inventory.\n-        if result:\n-            if self.type == \"Consumable\":\n-                if user.inventory[self.slug]['quantity'] <= 1:\n-                    del user.inventory[self.slug]\n-                else:\n-                    user.inventory[self.slug]['quantity'] -= 1\n-\n-        if type(result) == bool:\n-            result = {\"name\": last_effect_name, \"success\": result, \"should_tackle\": False}\n-        else:\n-            result[1][\"success\"] = result[0]\n-            result = result[1]\n-            result[\"name\"] = last_effect_name\n+        if result[\"success\"] and self.type == \"Consumable\":","path":"tuxemon/core/components/item.py","position":66,"original_position":66,"commit_id":"cdfe32df42af9d38be7b524784ab23e7e5418a3a","original_commit_id":"cdfe32df42af9d38be7b524784ab23e7e5418a3a","user":{"login":"bitcraft","id":556711,"avatar_url":"https://avatars.githubusercontent.com/u/556711?v=3","gravatar_id":"","url":"https://api.github.com/users/bitcraft","html_url":"https://github.com/bitcraft","followers_url":"https://api.github.com/users/bitcraft/followers","following_url":"https://api.github.com/users/bitcraft/following{/other_user}","gists_url":"https://api.github.com/users/bitcraft/gists{/gist_id}","starred_url":"https://api.github.com/users/bitcraft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bitcraft/subscriptions","organizations_url":"https://api.github.com/users/bitcraft/orgs","repos_url":"https://api.github.com/users/bitcraft/repos","events_url":"https://api.github.com/users/bitcraft/events{/privacy}","received_events_url":"https://api.github.com/users/bitcraft/received_events","type":"User","site_admin":false},"body":"standardize the return values around a dictionary, for now.","created_at":"2016-08-30T04:12:06Z","updated_at":"2016-08-30T04:12:06Z","html_url":"https://github.com/Tuxemon/Tuxemon/pull/250#discussion_r76727996","pull_request_url":"https://api.github.com/repos/Tuxemon/Tuxemon/pulls/250","_links":{"self":{"href":"https://api.github.com/repos/Tuxemon/Tuxemon/pulls/comments/76727996"},"html":{"href":"https://github.com/Tuxemon/Tuxemon/pull/250#discussion_r76727996"},"pull_request":{"href":"https://api.github.com/repos/Tuxemon/Tuxemon/pulls/250"}}},"pull_request":{"url":"https://api.github.com/repos/Tuxemon/Tuxemon/pulls/250","id":83205640,"html_url":"https://github.com/Tuxemon/Tuxemon/pull/250","diff_url":"https://github.com/Tuxemon/Tuxemon/pull/250.diff","patch_url":"https://github.com/Tuxemon/Tuxemon/pull/250.patch","issue_url":"https://api.github.com/repos/Tuxemon/Tuxemon/issues/250","number":250,"state":"open","locked":false,"title":"targeting works as expected","user":{"login":"bitcraft","id":556711,"avatar_url":"https://avatars.githubusercontent.com/u/556711?v=3","gravatar_id":"","url":"https://api.github.com/users/bitcraft","html_url":"https://github.com/bitcraft","followers_url":"https://api.github.com/users/bitcraft/followers","following_url":"https://api.github.com/users/bitcraft/following{/other_user}","gists_url":"https://api.github.com/users/bitcraft/gists{/gist_id}","starred_url":"https://api.github.com/users/bitcraft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bitcraft/subscriptions","organizations_url":"https://api.github.com/users/bitcraft/orgs","repos_url":"https://api.github.com/users/bitcraft/repos","events_url":"https://api.github.com/users/bitcraft/events{/privacy}","received_events_url":"https://api.github.com/users/bitcraft/received_events","type":"User","site_admin":false},"body":"seems like a lot, but mostly reorganization.  targeting now works correctly.  attacks will default to the other party, and healing items will default to the players monster.\r\n\r\n- moved the \"read json file targets\" code to a function in db.py\r\n- modify items.py and techniques.py to use the new function to read targeting data\r\n- finalize and fix the \"return a dictionary of results from technique or item\"\r\n- fixed issue of items not working after combat (#235).  related to the line above\r\n- fixed a crash when menus only contain one item (not reported)\r\n- when using items during combat, the game will show the battle scene when choosing target of item\r\n- simplified the item screen\r\n- modified a few items where the targeting was incorrect\r\n- linting and documentation\r\n","created_at":"2016-08-30T04:11:16Z","updated_at":"2016-08-30T04:12:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4daa9e4116356d9e50a638f8cb37662f5e1e7dab","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Tuxemon/Tuxemon/pulls/250/commits","review_comments_url":"https://api.github.com/repos/Tuxemon/Tuxemon/pulls/250/comments","review_comment_url":"https://api.github.com/repos/Tuxemon/Tuxemon/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Tuxemon/Tuxemon/issues/250/comments","statuses_url":"https://api.github.com/repos/Tuxemon/Tuxemon/statuses/cdfe32df42af9d38be7b524784ab23e7e5418a3a","head":{"label":"bitcraft:development","ref":"development","sha":"cdfe32df42af9d38be7b524784ab23e7e5418a3a","user":{"login":"bitcraft","id":556711,"avatar_url":"https://avatars.githubusercontent.com/u/556711?v=3","gravatar_id":"","url":"https://api.github.com/users/bitcraft","html_url":"https://github.com/bitcraft","followers_url":"https://api.github.com/users/bitcraft/followers","following_url":"https://api.github.com/users/bitcraft/following{/other_user}","gists_url":"https://api.github.com/users/bitcraft/gists{/gist_id}","starred_url":"https://api.github.com/users/bitcraft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bitcraft/subscriptions","organizations_url":"https://api.github.com/users/bitcraft/orgs","repos_url":"https://api.github.com/users/bitcraft/repos","events_url":"https://api.github.com/users/bitcraft/events{/privacy}","received_events_url":"https://api.github.com/users/bitcraft/received_events","type":"User","site_admin":false},"repo":{"id":46816621,"name":"Tuxemon","full_name":"bitcraft/Tuxemon","owner":{"login":"bitcraft","id":556711,"avatar_url":"https://avatars.githubusercontent.com/u/556711?v=3","gravatar_id":"","url":"https://api.github.com/users/bitcraft","html_url":"https://github.com/bitcraft","followers_url":"https://api.github.com/users/bitcraft/followers","following_url":"https://api.github.com/users/bitcraft/following{/other_user}","gists_url":"https://api.github.com/users/bitcraft/gists{/gist_id}","starred_url":"https://api.github.com/users/bitcraft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bitcraft/subscriptions","organizations_url":"https://api.github.com/users/bitcraft/orgs","repos_url":"https://api.github.com/users/bitcraft/repos","events_url":"https://api.github.com/users/bitcraft/events{/privacy}","received_events_url":"https://api.github.com/users/bitcraft/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bitcraft/Tuxemon","description":"Open source monster-fighting RPG.","fork":true,"url":"https://api.github.com/repos/bitcraft/Tuxemon","forks_url":"https://api.github.com/repos/bitcraft/Tuxemon/forks","keys_url":"https://api.github.com/repos/bitcraft/Tuxemon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bitcraft/Tuxemon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bitcraft/Tuxemon/teams","hooks_url":"https://api.github.com/repos/bitcraft/Tuxemon/hooks","issue_events_url":"https://api.github.com/repos/bitcraft/Tuxemon/issues/events{/number}","events_url":"https://api.github.com/repos/bitcraft/Tuxemon/events","assignees_url":"https://api.github.com/repos/bitcraft/Tuxemon/assignees{/user}","branches_url":"https://api.github.com/repos/bitcraft/Tuxemon/branches{/branch}","tags_url":"https://api.github.com/repos/bitcraft/Tuxemon/tags","blobs_url":"https://api.github.com/repos/bitcraft/Tuxemon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bitcraft/Tuxemon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bitcraft/Tuxemon/git/refs{/sha}","trees_url":"https://api.github.com/repos/bitcraft/Tuxemon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bitcraft/Tuxemon/statuses/{sha}","languages_url":"https://api.github.com/repos/bitcraft/Tuxemon/languages","stargazers_url":"https://api.github.com/repos/bitcraft/Tuxemon/stargazers","contributors_url":"https://api.github.com/repos/bitcraft/Tuxemon/contributors","subscribers_url":"https://api.github.com/repos/bitcraft/Tuxemon/subscribers","subscription_url":"https://api.github.com/repos/bitcraft/Tuxemon/subscription","commits_url":"https://api.github.com/repos/bitcraft/Tuxemon/commits{/sha}","git_commits_url":"https://api.github.com/repos/bitcraft/Tuxemon/git/commits{/sha}","comments_url":"https://api.github.com/repos/bitcraft/Tuxemon/comments{/number}","issue_comment_url":"https://api.github.com/repos/bitcraft/Tuxemon/issues/comments{/number}","contents_url":"https://api.github.com/repos/bitcraft/Tuxemon/contents/{+path}","compare_url":"https://api.github.com/repos/bitcraft/Tuxemon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bitcraft/Tuxemon/merges","archive_url":"https://api.github.com/repos/bitcraft/Tuxemon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bitcraft/Tuxemon/downloads","issues_url":"https://api.github.com/repos/bitcraft/Tuxemon/issues{/number}","pulls_url":"https://api.github.com/repos/bitcraft/Tuxemon/pulls{/number}","milestones_url":"https://api.github.com/repos/bitcraft/Tuxemon/milestones{/number}","notifications_url":"https://api.github.com/repos/bitcraft/Tuxemon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bitcraft/Tuxemon/labels{/name}","releases_url":"https://api.github.com/repos/bitcraft/Tuxemon/releases{/id}","deployments_url":"https://api.github.com/repos/bitcraft/Tuxemon/deployments","created_at":"2015-11-24T20:25:56Z","updated_at":"2016-02-15T04:29:25Z","pushed_at":"2016-08-30T04:02:09Z","git_url":"git://github.com/bitcraft/Tuxemon.git","ssh_url":"git@github.com:bitcraft/Tuxemon.git","clone_url":"https://github.com/bitcraft/Tuxemon.git","svn_url":"https://github.com/bitcraft/Tuxemon","homepage":null,"size":40759,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Tuxemon:development","ref":"development","sha":"714631bb8f1919a46931bba109af4948f6ac672b","user":{"login":"Tuxemon","id":10238599,"avatar_url":"https://avatars.githubusercontent.com/u/10238599?v=3","gravatar_id":"","url":"https://api.github.com/users/Tuxemon","html_url":"https://github.com/Tuxemon","followers_url":"https://api.github.com/users/Tuxemon/followers","following_url":"https://api.github.com/users/Tuxemon/following{/other_user}","gists_url":"https://api.github.com/users/Tuxemon/gists{/gist_id}","starred_url":"https://api.github.com/users/Tuxemon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tuxemon/subscriptions","organizations_url":"https://api.github.com/users/Tuxemon/orgs","repos_url":"https://api.github.com/users/Tuxemon/repos","events_url":"https://api.github.com/users/Tuxemon/events{/privacy}","received_events_url":"https://api.github.com/users/Tuxemon/received_events","type":"Organization","site_admin":false},"repo":{"id":28209384,"name":"Tuxemon","full_name":"Tuxemon/Tuxemon","owner":{"login":"Tuxemon","id":10238599,"avatar_url":"https://avatars.githubusercontent.com/u/10238599?v=3","gravatar_id":"","url":"https://api.github.com/users/Tuxemon","html_url":"https://github.com/Tuxemon","followers_url":"https://api.github.com/users/Tuxemon/followers","following_url":"https://api.github.com/users/Tuxemon/following{/other_user}","gists_url":"https://api.github.com/users/Tuxemon/gists{/gist_id}","starred_url":"https://api.github.com/users/Tuxemon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tuxemon/subscriptions","organizations_url":"https://api.github.com/users/Tuxemon/orgs","repos_url":"https://api.github.com/users/Tuxemon/repos","events_url":"https://api.github.com/users/Tuxemon/events{/privacy}","received_events_url":"https://api.github.com/users/Tuxemon/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Tuxemon/Tuxemon","description":"Open source monster-fighting RPG.","fork":false,"url":"https://api.github.com/repos/Tuxemon/Tuxemon","forks_url":"https://api.github.com/repos/Tuxemon/Tuxemon/forks","keys_url":"https://api.github.com/repos/Tuxemon/Tuxemon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Tuxemon/Tuxemon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Tuxemon/Tuxemon/teams","hooks_url":"https://api.github.com/repos/Tuxemon/Tuxemon/hooks","issue_events_url":"https://api.github.com/repos/Tuxemon/Tuxemon/issues/events{/number}","events_url":"https://api.github.com/repos/Tuxemon/Tuxemon/events","assignees_url":"https://api.github.com/repos/Tuxemon/Tuxemon/assignees{/user}","branches_url":"https://api.github.com/repos/Tuxemon/Tuxemon/branches{/branch}","tags_url":"https://api.github.com/repos/Tuxemon/Tuxemon/tags","blobs_url":"https://api.github.com/repos/Tuxemon/Tuxemon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Tuxemon/Tuxemon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Tuxemon/Tuxemon/git/refs{/sha}","trees_url":"https://api.github.com/repos/Tuxemon/Tuxemon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Tuxemon/Tuxemon/statuses/{sha}","languages_url":"https://api.github.com/repos/Tuxemon/Tuxemon/languages","stargazers_url":"https://api.github.com/repos/Tuxemon/Tuxemon/stargazers","contributors_url":"https://api.github.com/repos/Tuxemon/Tuxemon/contributors","subscribers_url":"https://api.github.com/repos/Tuxemon/Tuxemon/subscribers","subscription_url":"https://api.github.com/repos/Tuxemon/Tuxemon/subscription","commits_url":"https://api.github.com/repos/Tuxemon/Tuxemon/commits{/sha}","git_commits_url":"https://api.github.com/repos/Tuxemon/Tuxemon/git/commits{/sha}","comments_url":"https://api.github.com/repos/Tuxemon/Tuxemon/comments{/number}","issue_comment_url":"https://api.github.com/repos/Tuxemon/Tuxemon/issues/comments{/number}","contents_url":"https://api.github.com/repos/Tuxemon/Tuxemon/contents/{+path}","compare_url":"https://api.github.com/repos/Tuxemon/Tuxemon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Tuxemon/Tuxemon/merges","archive_url":"https://api.github.com/repos/Tuxemon/Tuxemon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Tuxemon/Tuxemon/downloads","issues_url":"https://api.github.com/repos/Tuxemon/Tuxemon/issues{/number}","pulls_url":"https://api.github.com/repos/Tuxemon/Tuxemon/pulls{/number}","milestones_url":"https://api.github.com/repos/Tuxemon/Tuxemon/milestones{/number}","notifications_url":"https://api.github.com/repos/Tuxemon/Tuxemon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Tuxemon/Tuxemon/labels{/name}","releases_url":"https://api.github.com/repos/Tuxemon/Tuxemon/releases{/id}","deployments_url":"https://api.github.com/repos/Tuxemon/Tuxemon/deployments","created_at":"2014-12-19T01:37:27Z","updated_at":"2016-08-24T23:30:41Z","pushed_at":"2016-08-30T04:11:16Z","git_url":"git://github.com/Tuxemon/Tuxemon.git","ssh_url":"git@github.com:Tuxemon/Tuxemon.git","clone_url":"https://github.com/Tuxemon/Tuxemon.git","svn_url":"https://github.com/Tuxemon/Tuxemon","homepage":null,"size":252509,"stargazers_count":123,"watchers_count":123,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":53,"mirror_url":null,"open_issues_count":68,"forks":53,"open_issues":68,"watchers":123,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Tuxemon/Tuxemon/pulls/250"},"html":{"href":"https://github.com/Tuxemon/Tuxemon/pull/250"},"issue":{"href":"https://api.github.com/repos/Tuxemon/Tuxemon/issues/250"},"comments":{"href":"https://api.github.com/repos/Tuxemon/Tuxemon/issues/250/comments"},"review_comments":{"href":"https://api.github.com/repos/Tuxemon/Tuxemon/pulls/250/comments"},"review_comment":{"href":"https://api.github.com/repos/Tuxemon/Tuxemon/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Tuxemon/Tuxemon/pulls/250/commits"},"statuses":{"href":"https://api.github.com/repos/Tuxemon/Tuxemon/statuses/cdfe32df42af9d38be7b524784ab23e7e5418a3a"}}}}
{"actor":{"display_login":"bitcraft"}}