{"action":"created","comment":{"url":"https://api.github.com/repos/tgstation/tgstation/pulls/comments/219713198","pull_request_review_id":157953494,"id":219713198,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxOTcxMzE5OA==","diff_hunk":"@@ -152,15 +156,47 @@\n \t\t..()\r\n \r\n // Tool procs, in case plasma cutter is used as welder\r\n+// Can we start welding?\r\n+/obj/item/gun/energy/plasmacutter/tool_start_check(mob/living/user, amount)\r\n+\t. = tool_use_check(user, amount)\r\n+\tif(. && user)\r\n+\t\tuser.flash_act(light_intensity)\r\n+\r\n+// Can we weld? Plasma cutter does not use charge continuously.\r\n+// Amount cannot be defaulted to 1: most of the code specifies 0 in the call.\r\n /obj/item/gun/energy/plasmacutter/tool_use_check(mob/living/user, amount)\r\n-\tif(!QDELETED(cell) && (cell.charge >= amount * 100))\r\n-\t\treturn TRUE\r\n-\r\n-\tto_chat(user, \"<span class='warning'>You need more charge to complete this task!</span>\")\r\n-\treturn FALSE\r\n+\tif(QDELETED(cell))\r\n+\t\tto_chat(user, \"<span class='warning'>[src] does not have a cell, and cannot be used!</span>\")\r\n+\t\treturn FALSE\r\n+\t// Amount cannot be used if drain is made continuous, e.g. amount = 5, charge_weld = 25\r\n+\t// Then it'll drain 125 at first and 25 periodically, but fail if charge dips below 125 even though it still can finish action\r\n+\t// Alternately it'll need to drain amount*charge_weld every period, which is either obscene or makes it free for other uses\r\n+\tif(amount ? cell.charge < charge_weld * amount : cell.charge < charge_weld)\r\n+\t\tto_chat(user, \"<span class='warning'>You need more charge to complete this task!</span>\")\r\n+\t\treturn FALSE\r\n+\r\n+\treturn TRUE\r\n \r\n /obj/item/gun/energy/plasmacutter/use(amount)\r\n-\treturn cell.use(amount * 100)\r\n+\treturn (!QDELETED(cell) && cell.use(amount ? amount * charge_weld : charge_weld))\r\n+\r\n+// This only gets called by use_tool(delay > 0)\r\n+// It's also supposed to not get overridden in the first place.\r\n+/obj/item/gun/energy/plasmacutter/tool_check_callback(mob/living/user, amount, datum/callback/extra_checks)\r\n+\t. = ..() //return tool_use_check(user, amount) && (!extra_checks || extra_checks.Invoke())\r\n+\tif(. && user)\r\n+\t\tif (progress_flash_divisor == 0)\r\n+\t\t\tuser.flash_act(min(light_intensity,1))\r\n+\t\t\tprogress_flash_divisor = initial(progress_flash_divisor)\r\n+\t\telse\r\n+\t\t\tprogress_flash_divisor--\r\n+\r\n+/obj/item/gun/energy/plasmacutter/use_tool(atom/target, mob/living/user, delay, amount=1, volume=0, datum/callback/extra_checks)\r\n+\tif(amount)\r\n+\t\t. = ..()\r\n+\telse\r\n+\t\t. = ..(amount=1)\r","path":"code/modules/projectiles/guns/energy/special.dm","position":76,"original_position":76,"commit_id":"1a3b9565aa3934e7ed22103c645aa983dad40c0c","original_commit_id":"1a3b9565aa3934e7ed22103c645aa983dad40c0c","user":{"login":"ShizCalev","id":6209658,"node_id":"MDQ6VXNlcjYyMDk2NTg=","avatar_url":"https://avatars2.githubusercontent.com/u/6209658?v=4","gravatar_id":"","url":"https://api.github.com/users/ShizCalev","html_url":"https://github.com/ShizCalev","followers_url":"https://api.github.com/users/ShizCalev/followers","following_url":"https://api.github.com/users/ShizCalev/following{/other_user}","gists_url":"https://api.github.com/users/ShizCalev/gists{/gist_id}","starred_url":"https://api.github.com/users/ShizCalev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ShizCalev/subscriptions","organizations_url":"https://api.github.com/users/ShizCalev/orgs","repos_url":"https://api.github.com/users/ShizCalev/repos","events_url":"https://api.github.com/users/ShizCalev/events{/privacy}","received_events_url":"https://api.github.com/users/ShizCalev/received_events","type":"User","site_admin":false},"body":"why? you've already handled this in use()\r\n```\r\n/obj/item/gun/energy/plasmacutter/use(amount)\r\n\treturn (!QDELETED(cell) && cell.use(amount ? amount * charge_weld : charge_weld)) \r\n```\r\n\r\n> cell.use(**amount** ? amount * charge_weld : **charge_weld**)\r\n\r\nthis is equivalent to\r\n```\r\nif(amount)\r\n\tcell.use(amount*charge_weld)\r\nelse\r\n\tcell.use(charge_weld)\r\n```","created_at":"2018-09-23T22:03:11Z","updated_at":"2018-09-23T22:05:35Z","html_url":"https://github.com/tgstation/tgstation/pull/40423#discussion_r219713198","pull_request_url":"https://api.github.com/repos/tgstation/tgstation/pulls/40423","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/tgstation/tgstation/pulls/comments/219713198"},"html":{"href":"https://github.com/tgstation/tgstation/pull/40423#discussion_r219713198"},"pull_request":{"href":"https://api.github.com/repos/tgstation/tgstation/pulls/40423"}}},"pull_request":{"url":"https://api.github.com/repos/tgstation/tgstation/pulls/40423","id":217476155,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE3NDc2MTU1","html_url":"https://github.com/tgstation/tgstation/pull/40423","diff_url":"https://github.com/tgstation/tgstation/pull/40423.diff","patch_url":"https://github.com/tgstation/tgstation/pull/40423.patch","issue_url":"https://api.github.com/repos/tgstation/tgstation/issues/40423","number":40423,"state":"open","locked":false,"title":"Fixes plasma cutters not using charge when used as welder, and adds flashing","user":{"login":"Barhandar","id":2338212,"node_id":"MDQ6VXNlcjIzMzgyMTI=","avatar_url":"https://avatars1.githubusercontent.com/u/2338212?v=4","gravatar_id":"","url":"https://api.github.com/users/Barhandar","html_url":"https://github.com/Barhandar","followers_url":"https://api.github.com/users/Barhandar/followers","following_url":"https://api.github.com/users/Barhandar/following{/other_user}","gists_url":"https://api.github.com/users/Barhandar/gists{/gist_id}","starred_url":"https://api.github.com/users/Barhandar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Barhandar/subscriptions","organizations_url":"https://api.github.com/users/Barhandar/orgs","repos_url":"https://api.github.com/users/Barhandar/repos","events_url":"https://api.github.com/users/Barhandar/events{/privacy}","received_events_url":"https://api.github.com/users/Barhandar/received_events","type":"User","site_admin":false},"body":"Resolves first (and consequently fourth) issue from #40409.\r\n\r\n:cl: Barhandar\r\nbalance: Plasma cutters now flash you (same intensity as experimental welder) when used for welding.\r\nfix: Plasma cutters also use charge to weld some things (like airlock shielding). Things like vents are still free however.\r\n/:cl:\r\n\r\n\r\n","created_at":"2018-09-22T20:12:27Z","updated_at":"2018-09-23T22:05:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"402cc1b6cbcbe2ce9fe2474be1296b44d8a333e3","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":78959966,"node_id":"MDU6TGFiZWw3ODk1OTk2Ng==","url":"https://api.github.com/repos/tgstation/tgstation/labels/Balance/Rebalance","name":"Balance/Rebalance","color":"fbca04","default":false},{"id":157846355,"node_id":"MDU6TGFiZWwxNTc4NDYzNTU=","url":"https://api.github.com/repos/tgstation/tgstation/labels/Fix","name":"Fix","color":"00bbdd","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/tgstation/tgstation/pulls/40423/commits","review_comments_url":"https://api.github.com/repos/tgstation/tgstation/pulls/40423/comments","review_comment_url":"https://api.github.com/repos/tgstation/tgstation/pulls/comments{/number}","comments_url":"https://api.github.com/repos/tgstation/tgstation/issues/40423/comments","statuses_url":"https://api.github.com/repos/tgstation/tgstation/statuses/1a3b9565aa3934e7ed22103c645aa983dad40c0c","head":{"label":"Barhandar:plasmacutterfixes","ref":"plasmacutterfixes","sha":"1a3b9565aa3934e7ed22103c645aa983dad40c0c","user":{"login":"Barhandar","id":2338212,"node_id":"MDQ6VXNlcjIzMzgyMTI=","avatar_url":"https://avatars1.githubusercontent.com/u/2338212?v=4","gravatar_id":"","url":"https://api.github.com/users/Barhandar","html_url":"https://github.com/Barhandar","followers_url":"https://api.github.com/users/Barhandar/followers","following_url":"https://api.github.com/users/Barhandar/following{/other_user}","gists_url":"https://api.github.com/users/Barhandar/gists{/gist_id}","starred_url":"https://api.github.com/users/Barhandar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Barhandar/subscriptions","organizations_url":"https://api.github.com/users/Barhandar/orgs","repos_url":"https://api.github.com/users/Barhandar/repos","events_url":"https://api.github.com/users/Barhandar/events{/privacy}","received_events_url":"https://api.github.com/users/Barhandar/received_events","type":"User","site_admin":false},"repo":{"id":23025038,"node_id":"MDEwOlJlcG9zaXRvcnkyMzAyNTAzOA==","name":"-tg-station","full_name":"Barhandar/-tg-station","private":false,"owner":{"login":"Barhandar","id":2338212,"node_id":"MDQ6VXNlcjIzMzgyMTI=","avatar_url":"https://avatars1.githubusercontent.com/u/2338212?v=4","gravatar_id":"","url":"https://api.github.com/users/Barhandar","html_url":"https://github.com/Barhandar","followers_url":"https://api.github.com/users/Barhandar/followers","following_url":"https://api.github.com/users/Barhandar/following{/other_user}","gists_url":"https://api.github.com/users/Barhandar/gists{/gist_id}","starred_url":"https://api.github.com/users/Barhandar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Barhandar/subscriptions","organizations_url":"https://api.github.com/users/Barhandar/orgs","repos_url":"https://api.github.com/users/Barhandar/repos","events_url":"https://api.github.com/users/Barhandar/events{/privacy}","received_events_url":"https://api.github.com/users/Barhandar/received_events","type":"User","site_admin":false},"html_url":"https://github.com/Barhandar/-tg-station","description":"GODDAMMIT STATION GLUBINA YA NE TVOI","fork":true,"url":"https://api.github.com/repos/Barhandar/-tg-station","forks_url":"https://api.github.com/repos/Barhandar/-tg-station/forks","keys_url":"https://api.github.com/repos/Barhandar/-tg-station/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Barhandar/-tg-station/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Barhandar/-tg-station/teams","hooks_url":"https://api.github.com/repos/Barhandar/-tg-station/hooks","issue_events_url":"https://api.github.com/repos/Barhandar/-tg-station/issues/events{/number}","events_url":"https://api.github.com/repos/Barhandar/-tg-station/events","assignees_url":"https://api.github.com/repos/Barhandar/-tg-station/assignees{/user}","branches_url":"https://api.github.com/repos/Barhandar/-tg-station/branches{/branch}","tags_url":"https://api.github.com/repos/Barhandar/-tg-station/tags","blobs_url":"https://api.github.com/repos/Barhandar/-tg-station/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Barhandar/-tg-station/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Barhandar/-tg-station/git/refs{/sha}","trees_url":"https://api.github.com/repos/Barhandar/-tg-station/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Barhandar/-tg-station/statuses/{sha}","languages_url":"https://api.github.com/repos/Barhandar/-tg-station/languages","stargazers_url":"https://api.github.com/repos/Barhandar/-tg-station/stargazers","contributors_url":"https://api.github.com/repos/Barhandar/-tg-station/contributors","subscribers_url":"https://api.github.com/repos/Barhandar/-tg-station/subscribers","subscription_url":"https://api.github.com/repos/Barhandar/-tg-station/subscription","commits_url":"https://api.github.com/repos/Barhandar/-tg-station/commits{/sha}","git_commits_url":"https://api.github.com/repos/Barhandar/-tg-station/git/commits{/sha}","comments_url":"https://api.github.com/repos/Barhandar/-tg-station/comments{/number}","issue_comment_url":"https://api.github.com/repos/Barhandar/-tg-station/issues/comments{/number}","contents_url":"https://api.github.com/repos/Barhandar/-tg-station/contents/{+path}","compare_url":"https://api.github.com/repos/Barhandar/-tg-station/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Barhandar/-tg-station/merges","archive_url":"https://api.github.com/repos/Barhandar/-tg-station/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Barhandar/-tg-station/downloads","issues_url":"https://api.github.com/repos/Barhandar/-tg-station/issues{/number}","pulls_url":"https://api.github.com/repos/Barhandar/-tg-station/pulls{/number}","milestones_url":"https://api.github.com/repos/Barhandar/-tg-station/milestones{/number}","notifications_url":"https://api.github.com/repos/Barhandar/-tg-station/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Barhandar/-tg-station/labels{/name}","releases_url":"https://api.github.com/repos/Barhandar/-tg-station/releases{/id}","deployments_url":"https://api.github.com/repos/Barhandar/-tg-station/deployments","created_at":"2014-08-16T19:06:38Z","updated_at":"2018-09-23T10:07:44Z","pushed_at":"2018-09-23T21:19:03Z","git_url":"git://github.com/Barhandar/-tg-station.git","ssh_url":"git@github.com:Barhandar/-tg-station.git","clone_url":"https://github.com/Barhandar/-tg-station.git","svn_url":"https://github.com/Barhandar/-tg-station","homepage":"","size":1201069,"stargazers_count":0,"watchers_count":0,"language":"DM","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0","node_id":"MDc6TGljZW5zZTE="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"tgstation:master","ref":"master","sha":"0f96875e1e26cbda342299f6a0b6c2173f9ef3ef","user":{"login":"tgstation","id":1363778,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNjM3Nzg=","avatar_url":"https://avatars2.githubusercontent.com/u/1363778?v=4","gravatar_id":"","url":"https://api.github.com/users/tgstation","html_url":"https://github.com/tgstation","followers_url":"https://api.github.com/users/tgstation/followers","following_url":"https://api.github.com/users/tgstation/following{/other_user}","gists_url":"https://api.github.com/users/tgstation/gists{/gist_id}","starred_url":"https://api.github.com/users/tgstation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tgstation/subscriptions","organizations_url":"https://api.github.com/users/tgstation/orgs","repos_url":"https://api.github.com/users/tgstation/repos","events_url":"https://api.github.com/users/tgstation/events{/privacy}","received_events_url":"https://api.github.com/users/tgstation/received_events","type":"Organization","site_admin":false},"repo":{"id":3234987,"node_id":"MDEwOlJlcG9zaXRvcnkzMjM0OTg3","name":"tgstation","full_name":"tgstation/tgstation","private":false,"owner":{"login":"tgstation","id":1363778,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNjM3Nzg=","avatar_url":"https://avatars2.githubusercontent.com/u/1363778?v=4","gravatar_id":"","url":"https://api.github.com/users/tgstation","html_url":"https://github.com/tgstation","followers_url":"https://api.github.com/users/tgstation/followers","following_url":"https://api.github.com/users/tgstation/following{/other_user}","gists_url":"https://api.github.com/users/tgstation/gists{/gist_id}","starred_url":"https://api.github.com/users/tgstation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tgstation/subscriptions","organizations_url":"https://api.github.com/users/tgstation/orgs","repos_url":"https://api.github.com/users/tgstation/repos","events_url":"https://api.github.com/users/tgstation/events{/privacy}","received_events_url":"https://api.github.com/users/tgstation/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/tgstation/tgstation","description":"the /tg/station branch of SS13","fork":false,"url":"https://api.github.com/repos/tgstation/tgstation","forks_url":"https://api.github.com/repos/tgstation/tgstation/forks","keys_url":"https://api.github.com/repos/tgstation/tgstation/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tgstation/tgstation/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tgstation/tgstation/teams","hooks_url":"https://api.github.com/repos/tgstation/tgstation/hooks","issue_events_url":"https://api.github.com/repos/tgstation/tgstation/issues/events{/number}","events_url":"https://api.github.com/repos/tgstation/tgstation/events","assignees_url":"https://api.github.com/repos/tgstation/tgstation/assignees{/user}","branches_url":"https://api.github.com/repos/tgstation/tgstation/branches{/branch}","tags_url":"https://api.github.com/repos/tgstation/tgstation/tags","blobs_url":"https://api.github.com/repos/tgstation/tgstation/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tgstation/tgstation/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tgstation/tgstation/git/refs{/sha}","trees_url":"https://api.github.com/repos/tgstation/tgstation/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tgstation/tgstation/statuses/{sha}","languages_url":"https://api.github.com/repos/tgstation/tgstation/languages","stargazers_url":"https://api.github.com/repos/tgstation/tgstation/stargazers","contributors_url":"https://api.github.com/repos/tgstation/tgstation/contributors","subscribers_url":"https://api.github.com/repos/tgstation/tgstation/subscribers","subscription_url":"https://api.github.com/repos/tgstation/tgstation/subscription","commits_url":"https://api.github.com/repos/tgstation/tgstation/commits{/sha}","git_commits_url":"https://api.github.com/repos/tgstation/tgstation/git/commits{/sha}","comments_url":"https://api.github.com/repos/tgstation/tgstation/comments{/number}","issue_comment_url":"https://api.github.com/repos/tgstation/tgstation/issues/comments{/number}","contents_url":"https://api.github.com/repos/tgstation/tgstation/contents/{+path}","compare_url":"https://api.github.com/repos/tgstation/tgstation/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tgstation/tgstation/merges","archive_url":"https://api.github.com/repos/tgstation/tgstation/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tgstation/tgstation/downloads","issues_url":"https://api.github.com/repos/tgstation/tgstation/issues{/number}","pulls_url":"https://api.github.com/repos/tgstation/tgstation/pulls{/number}","milestones_url":"https://api.github.com/repos/tgstation/tgstation/milestones{/number}","notifications_url":"https://api.github.com/repos/tgstation/tgstation/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tgstation/tgstation/labels{/name}","releases_url":"https://api.github.com/repos/tgstation/tgstation/releases{/id}","deployments_url":"https://api.github.com/repos/tgstation/tgstation/deployments","created_at":"2012-01-21T17:32:47Z","updated_at":"2018-09-23T17:49:53Z","pushed_at":"2018-09-23T21:58:25Z","git_url":"git://github.com/tgstation/tgstation.git","ssh_url":"git@github.com:tgstation/tgstation.git","clone_url":"https://github.com/tgstation/tgstation.git","svn_url":"https://github.com/tgstation/tgstation","homepage":"https://www.tgstation13.org/","size":1201169,"stargazers_count":559,"watchers_count":559,"language":"DM","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1920,"mirror_url":null,"archived":false,"open_issues_count":1374,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0","node_id":"MDc6TGljZW5zZTE="},"forks":1920,"open_issues":1374,"watchers":559,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tgstation/tgstation/pulls/40423"},"html":{"href":"https://github.com/tgstation/tgstation/pull/40423"},"issue":{"href":"https://api.github.com/repos/tgstation/tgstation/issues/40423"},"comments":{"href":"https://api.github.com/repos/tgstation/tgstation/issues/40423/comments"},"review_comments":{"href":"https://api.github.com/repos/tgstation/tgstation/pulls/40423/comments"},"review_comment":{"href":"https://api.github.com/repos/tgstation/tgstation/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/tgstation/tgstation/pulls/40423/commits"},"statuses":{"href":"https://api.github.com/repos/tgstation/tgstation/statuses/1a3b9565aa3934e7ed22103c645aa983dad40c0c"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"ShizCalev"}}