{"action":"created","issue":{"url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues/15621","repository_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA","labels_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues/15621/labels{/name}","comments_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues/15621/comments","events_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues/15621/events","html_url":"https://github.com/CleverRaven/Cataclysm-DDA/pull/15621","id":137359275,"number":15621,"title":"Refactor explosion shrapnel [RDY]","user":{"login":"mugling","id":12238606,"avatar_url":"https://avatars.githubusercontent.com/u/12238606?v=3","gravatar_id":"","url":"https://api.github.com/users/mugling","html_url":"https://github.com/mugling","followers_url":"https://api.github.com/users/mugling/followers","following_url":"https://api.github.com/users/mugling/following{/other_user}","gists_url":"https://api.github.com/users/mugling/gists{/gist_id}","starred_url":"https://api.github.com/users/mugling/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mugling/subscriptions","organizations_url":"https://api.github.com/users/mugling/orgs","repos_url":"https://api.github.com/users/mugling/repos","events_url":"https://api.github.com/users/mugling/events{/privacy}","received_events_url":"https://api.github.com/users/mugling/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":17,"created_at":"2016-02-29T20:14:17Z","updated_at":"2016-03-03T09:24:08Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/15621","html_url":"https://github.com/CleverRaven/Cataclysm-DDA/pull/15621","diff_url":"https://github.com/CleverRaven/Cataclysm-DDA/pull/15621.diff","patch_url":"https://github.com/CleverRaven/Cataclysm-DDA/pull/15621.patch"},"body":"Currently grenades are underpowered and little used. This PR provides a revised implementation of `game::shrapnel`. A separate PR will attempt to address the shockwave produced by explosions and using both we can then consider balance.\r\n\r\nA previous (presumably abandoned) attempt #14036 got bogged down in maths and semantics so I've intentionally kept this implementation simple (presently only 38 lines). Performance should be good as the `bresenham` algorithm is relatively efficient and the dependency on `shoot` is dropped.\r\n\r\nTerrain or furniture now provides cover reducing (or eliminating) damage. Shrapnel is now effectively contained within buildings although at a sufficiently high `mass` it may escape through windows and such causing reduced damage. Unlike previously, distance from the epicenter is a major factor in the chance of being hit, and all projectiles now have an equal chance to hit.\r\n\r\n#### Implementation details\r\n\r\n* `count` abrtirtrary measure of quantity shrapnel emitted affecting number of hits\r\n\r\n* `range` maximum distance shrapnel may travel\r\n\r\n* `power` raw kinetic energy; responsible for `damage` and reduced by effects of cover\r\n\r\n* `mass` determines how readily terrain constrains shrapnel and also caps `pierce` damage\r\n\r\nThe units are arbitrary but are in proportion to other existing in-game values which should aid future balancing. In particular `mass` corresponds relatively well to both item `weight` and terrain and furniture resistances:\r\n\r\n| `mass`  |  equivalent `item`    | can smash           | \r\n|-----------|-------------------------------|---------------|\r\n| 4          | nail         | window             |\r\n| 10        | bearing | display rack        |\r\n| 113      | scrap metal | boarded door |\r\n\r\n#### TODO\r\n\r\n- [X] Allow specifying `mass` as a property of `explosion_iuse`\r\n- [X] Support dropping representative shrapnel (nails, bearings, scrap metal etc)\r\n- [X] Update doxygen comments"},"comment":{"url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues/comments/191674015","html_url":"https://github.com/CleverRaven/Cataclysm-DDA/pull/15621#issuecomment-191674015","issue_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues/15621","id":191674015,"user":{"login":"SeanMirrsen","id":6471698,"avatar_url":"https://avatars.githubusercontent.com/u/6471698?v=3","gravatar_id":"","url":"https://api.github.com/users/SeanMirrsen","html_url":"https://github.com/SeanMirrsen","followers_url":"https://api.github.com/users/SeanMirrsen/followers","following_url":"https://api.github.com/users/SeanMirrsen/following{/other_user}","gists_url":"https://api.github.com/users/SeanMirrsen/gists{/gist_id}","starred_url":"https://api.github.com/users/SeanMirrsen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SeanMirrsen/subscriptions","organizations_url":"https://api.github.com/users/SeanMirrsen/orgs","repos_url":"https://api.github.com/users/SeanMirrsen/repos","events_url":"https://api.github.com/users/SeanMirrsen/events{/privacy}","received_events_url":"https://api.github.com/users/SeanMirrsen/received_events","type":"User","site_admin":false},"created_at":"2016-03-03T09:24:08Z","updated_at":"2016-03-03T09:24:08Z","body":"Pity. Oh well. :)"}}