{"action":"opened","issue":{"url":"https://api.github.com/repos/joelalejandro/xethya/issues/12","repository_url":"https://api.github.com/repos/joelalejandro/xethya","labels_url":"https://api.github.com/repos/joelalejandro/xethya/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/joelalejandro/xethya/issues/12/comments","events_url":"https://api.github.com/repos/joelalejandro/xethya/issues/12/events","html_url":"https://github.com/joelalejandro/xethya/issues/12","id":156807003,"number":12,"title":"Define a contest function","user":{"login":"joelalejandro","id":118913,"avatar_url":"https://avatars.githubusercontent.com/u/118913?v=3","gravatar_id":"","url":"https://api.github.com/users/joelalejandro","html_url":"https://github.com/joelalejandro","followers_url":"https://api.github.com/users/joelalejandro/followers","following_url":"https://api.github.com/users/joelalejandro/following{/other_user}","gists_url":"https://api.github.com/users/joelalejandro/gists{/gist_id}","starred_url":"https://api.github.com/users/joelalejandro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joelalejandro/subscriptions","organizations_url":"https://api.github.com/users/joelalejandro/orgs","repos_url":"https://api.github.com/users/joelalejandro/repos","events_url":"https://api.github.com/users/joelalejandro/events{/privacy}","received_events_url":"https://api.github.com/users/joelalejandro/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-05-25T17:30:29Z","updated_at":"2016-05-25T17:30:29Z","closed_at":null,"body":"Based on #11, and according to the SRD:\r\n\r\n> Sometimes one character's or monster's efforts are directly opposed to another's. This can occur when both of them are trying to do the same thing and only one can succeed. (...) the outcome is determined by a special form of ability check, called a contest.\r\n> Both participants in a contest make ability checks appropiate to their efforts. (...) instead of comparing the total to a DC [difficulty class], they compare the totals of their two checks. The participan with the higher check total wins the contest. (...)\r\n> If the contest results in a tie, the situation remains the same as it was before the contest.\r\n\r\nSo, given a `C` function:\r\n\r\n![C(Pa, Pb) = { AC(Pa), AC(Pb) }](https://cloud.githubusercontent.com/assets/118913/15549819/d28e020e-2284-11e6-8102-e7058a009625.png)\r\n\r\nIt is possible to determine the outcome of a contest with a `CW` (contest winner) function:\r\n\r\n![CW(c, Pa, Pb) = { c.Pa > c.Pb => Win(Pa); c.Pa < c.Pb = Win(Pb); c.Pa = c.Pb = NULL }](https://cloud.githubusercontent.com/assets/118913/15549879/194a5814-2285-11e6-9081-84e75bbebd50.png)\r\n\r\n\r\n"}}
{"actor":{"display_login":"joelalejandro"}}