{"action":"created","issue":{"url":"https://api.github.com/repos/Baystation12/Baystation12/issues/12658","repository_url":"https://api.github.com/repos/Baystation12/Baystation12","labels_url":"https://api.github.com/repos/Baystation12/Baystation12/issues/12658/labels{/name}","comments_url":"https://api.github.com/repos/Baystation12/Baystation12/issues/12658/comments","events_url":"https://api.github.com/repos/Baystation12/Baystation12/issues/12658/events","html_url":"https://github.com/Baystation12/Baystation12/pull/12658","id":148915464,"number":12658,"title":"New armour system","user":{"login":"mwerezak","id":242428,"avatar_url":"https://avatars.githubusercontent.com/u/242428?v=3","gravatar_id":"","url":"https://api.github.com/users/mwerezak","html_url":"https://github.com/mwerezak","followers_url":"https://api.github.com/users/mwerezak/followers","following_url":"https://api.github.com/users/mwerezak/following{/other_user}","gists_url":"https://api.github.com/users/mwerezak/gists{/gist_id}","starred_url":"https://api.github.com/users/mwerezak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mwerezak/subscriptions","organizations_url":"https://api.github.com/users/mwerezak/orgs","repos_url":"https://api.github.com/users/mwerezak/repos","events_url":"https://api.github.com/users/mwerezak/events{/privacy}","received_events_url":"https://api.github.com/users/mwerezak/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Baystation12/Baystation12/labels/needs%20review%20%CA%98%CA%98","name":"needs review ʘʘ","color":"9BADB7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-04-17T03:42:33Z","updated_at":"2016-04-22T16:43:46Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Baystation12/Baystation12/pulls/12658","html_url":"https://github.com/Baystation12/Baystation12/pull/12658","diff_url":"https://github.com/Baystation12/Baystation12/pull/12658.diff","patch_url":"https://github.com/Baystation12/Baystation12/pull/12658.patch"},"body":"Implements a new armor system that makes armor more consistent in its effect. `run_armor_check()` now returns a blocked amount between 0-100 that represents the degree of success. The `blocked_mult()` macro can be used to convert this into a damage multiplier.\r\n\r\nArmor has the same chance of fullblock as before (so that `blocked < 2` can be replaced with `blocked < 100` without any effect on gameplay). This chance is = `100*(armor/100)^2`\r\n\r\nIf an attack is not full-blocked, `run_armor_check()` will return a blocked value that increases with armor in such a way that having X armor will ensure that X% of the damage is prevented, after factoring in the fullblock chance.\r\n\r\nHere is a graph illustrating how the effect of armour changes with armour value.\r\n\r\n![armor](https://cloud.githubusercontent.com/assets/242428/14584913/b9030ab2-042c-11e6-89d1-a4ad61222c74.jpg)\r\nThe solid line is the amount of damage that will be prevented overall. \r\nThe dotted line shows the percent chance that the armour will deflect/absorb the attack fully.\r\nThe dashed line shows the amount of damage that will be prevented if the attack is not absorbed.\r\n\r\nIf the attack is not absorbed, the % damage prevented is not subjected to any randomness at all, but is always the same for the same level of armour.\r\n\r\nIt is entirely possible to adjust the balance between the two, decreasing the chance of absorption and increasing the % damage prevented in order to control the randomness of the system, if people desire. As you reduce the amount of randomness the dashed line will become closer and closer to the solid line.\r\n\r\nArmour penetration is handled by subtracting the penetration amount from the armour before doing the armour check. If `penetration > armor` then there will be 0 chance of full deflection/absorption.\r\n\r\nWent through all of the following procs (both definitions and usages) that either took a blocked value as arg or returned one to make sure that they were updated to work with the new 0-100 convention.\r\n\r\n- living/run_armor_check()\r\n- living/standard_weapon_hit_effects()\r\n- human/attack_joint()\r\n- living/hit_with_weapon()\r\n- item/apply_hit_effect()\r\n- bullet_act() - too many definitions to go through, checked all the usages tho\r\n- projectile/on_hit()\r\n- living/apply_damage()\r\n- living/apply_effect()\r\n- living/apply_effects()\r\n- unarmed_attack/apply_effects()\r\n\r\nAlso cleans up radiation handling, as the change in the way blocked is handled allows me to do that.\r\n\r\n:cl:\r\ntweak: Armor now has a chance to either block an attack or absorb a fixed portion of damage, instead of randomly blocking either nothing, half, or full damage.\r\n/:cl:"},"comment":{"url":"https://api.github.com/repos/Baystation12/Baystation12/issues/comments/213503951","html_url":"https://github.com/Baystation12/Baystation12/pull/12658#issuecomment-213503951","issue_url":"https://api.github.com/repos/Baystation12/Baystation12/issues/12658","id":213503951,"user":{"login":"mwerezak","id":242428,"avatar_url":"https://avatars.githubusercontent.com/u/242428?v=3","gravatar_id":"","url":"https://api.github.com/users/mwerezak","html_url":"https://github.com/mwerezak","followers_url":"https://api.github.com/users/mwerezak/followers","following_url":"https://api.github.com/users/mwerezak/following{/other_user}","gists_url":"https://api.github.com/users/mwerezak/gists{/gist_id}","starred_url":"https://api.github.com/users/mwerezak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mwerezak/subscriptions","organizations_url":"https://api.github.com/users/mwerezak/orgs","repos_url":"https://api.github.com/users/mwerezak/repos","events_url":"https://api.github.com/users/mwerezak/events{/privacy}","received_events_url":"https://api.github.com/users/mwerezak/received_events","type":"User","site_admin":false},"created_at":"2016-04-22T16:43:46Z","updated_at":"2016-04-22T16:43:46Z","body":"...It's been five hours. Is something wrong with Travis?"}}