{"action":"created","comment":{"url":"https://api.github.com/repos/vcmi/vcmi/pulls/comments/135988209","pull_request_review_id":59464533,"id":135988209,"diff_hunk":"@@ -0,0 +1,88 @@\n+/*\r\n+ * CSkillHandler.h, part of VCMI engine\r\n+ *\r\n+ * Authors: listed in file AUTHORS in main folder\r\n+ *\r\n+ * License: GNU General Public License v2.0 or later\r\n+ * Full text of license available in license.txt file, in main folder\r\n+ *\r\n+ */\r\n+#pragma once\r\n+\r\n+#include \"../lib/HeroBonus.h\"\r\n+#include \"GameConstants.h\"\r\n+#include \"IHandlerBase.h\"\r\n+\r\n+class CSkillHandler;\r\n+class CGHeroInstance;\r\n+class CMap;\r\n+class JsonSerializeFormat;\r\n+\r\n+class DLL_LINKAGE CSkill // secondary skill\r\n+{\r\n+protected:\r\n+\tstruct LevelInfo\r\n+\t{\r\n+\t\tstd::string description; //descriptions of spell for skill level\r\n+\t\tstd::vector<std::shared_ptr<Bonus>> effects;\r\n+\r\n+\t\tLevelInfo();\r\n+\t\t~LevelInfo();\r\n+\r\n+\t\ttemplate <typename Handler> void serialize(Handler &h, const int version)\r","path":"lib/CSkillHandler.h","position":null,"original_position":32,"commit_id":"654ca96e9d3ad31f769492351cb7a8f2cb5476cd","original_commit_id":"03c18ff691b25b6adce9744c9b46fc17f734c115","user":{"login":"henningkoehlernz","id":20719746,"avatar_url":"https://avatars2.githubusercontent.com/u/20719746?v=4","gravatar_id":"","url":"https://api.github.com/users/henningkoehlernz","html_url":"https://github.com/henningkoehlernz","followers_url":"https://api.github.com/users/henningkoehlernz/followers","following_url":"https://api.github.com/users/henningkoehlernz/following{/other_user}","gists_url":"https://api.github.com/users/henningkoehlernz/gists{/gist_id}","starred_url":"https://api.github.com/users/henningkoehlernz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/henningkoehlernz/subscriptions","organizations_url":"https://api.github.com/users/henningkoehlernz/orgs","repos_url":"https://api.github.com/users/henningkoehlernz/repos","events_url":"https://api.github.com/users/henningkoehlernz/events{/privacy}","received_events_url":"https://api.github.com/users/henningkoehlernz/received_events","type":"User","site_admin":false},"body":"fixed.","created_at":"2017-08-30T07:21:35Z","updated_at":"2017-08-30T07:21:35Z","html_url":"https://github.com/vcmi/vcmi/pull/369#discussion_r135988209","pull_request_url":"https://api.github.com/repos/vcmi/vcmi/pulls/369","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/vcmi/vcmi/pulls/comments/135988209"},"html":{"href":"https://github.com/vcmi/vcmi/pull/369#discussion_r135988209"},"pull_request":{"href":"https://api.github.com/repos/vcmi/vcmi/pulls/369"}},"in_reply_to_id":135430125},"pull_request":{"url":"https://api.github.com/repos/vcmi/vcmi/pulls/369","id":137852353,"html_url":"https://github.com/vcmi/vcmi/pull/369","diff_url":"https://github.com/vcmi/vcmi/pull/369.diff","patch_url":"https://github.com/vcmi/vcmi/pull/369.patch","issue_url":"https://api.github.com/repos/vcmi/vcmi/issues/369","number":369,"state":"open","locked":false,"title":"Allow modding of secondary skills via skills.json","user":{"login":"henningkoehlernz","id":20719746,"avatar_url":"https://avatars2.githubusercontent.com/u/20719746?v=4","gravatar_id":"","url":"https://api.github.com/users/henningkoehlernz","html_url":"https://github.com/henningkoehlernz","followers_url":"https://api.github.com/users/henningkoehlernz/followers","following_url":"https://api.github.com/users/henningkoehlernz/following{/other_user}","gists_url":"https://api.github.com/users/henningkoehlernz/gists{/gist_id}","starred_url":"https://api.github.com/users/henningkoehlernz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/henningkoehlernz/subscriptions","organizations_url":"https://api.github.com/users/henningkoehlernz/orgs","repos_url":"https://api.github.com/users/henningkoehlernz/repos","events_url":"https://api.github.com/users/henningkoehlernz/events{/privacy}","received_events_url":"https://api.github.com/users/henningkoehlernz/received_events","type":"User","site_admin":false},"body":"Bonuses provided by secondary skills are no longer hard-coded to skill level, but rather depend on bonuses provided by those skills, most commonly of type SECONDARY_SKILL_PREMY (some skills used that mechanism already, but not all). These bonuses are initialized to the HMM3 defaults, but can be overwritten (along with skill descriptions) using config/skills.json. A few notes:\r\n- Bonuses provided by different levels of a secondary skill don't stack - only the highest applies (see CGHeroInstance::updateSkill). This makes specification of bonuses in skills.json more intuitive.\r\n- The file config/skills.json in repo isn't really needed (though it does fix a typo in the estates skill description) as skills bonuses are initialized in CSkillHandler::CSkillHandler(). I find it's a useful template for creating skill mods though.\r\n- Added new bonus type SECONDARY_SKILL_VAL2 for providing bonuses for secondary skills which have more than parameter to configure. Used by eagle eye (max level of spell learned) and artillery (number of extra ballista shots).\r\n- Added new bonus type MANUAL_CONTROL for controlling war machines. Val is percentage-chance to control (default 100 for appropriate skill).\r\n- The effects of IMPROVED_NECROMANCY still depend on actual skill level.\r\n- Hero specialties of type SPECIAL_SECONDARY_SKILL will work as before, meaning nothing breaks, but changes to secondary skill bonuses won't affect hero specialties.\r\n- Legacy data (i.e. skill descriptions) isn't loaded into CSkillHandler, but initialized to empty, and the decision which string to return (legacy or new) is made in CGameInfo::skillInfo. The issue here is that the CGameInfo global isn't available server-side.\r\n\r\nTODO:\r\n- Fix various formatting issues & other small things (per change requests)\r\n- Fix error for MSVS compilation","created_at":"2017-08-27T23:14:49Z","updated_at":"2017-08-30T07:21:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"df9c9ff7f7910afe604abac90708d508e18fadaf","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/vcmi/vcmi/pulls/369/commits","review_comments_url":"https://api.github.com/repos/vcmi/vcmi/pulls/369/comments","review_comment_url":"https://api.github.com/repos/vcmi/vcmi/pulls/comments{/number}","comments_url":"https://api.github.com/repos/vcmi/vcmi/issues/369/comments","statuses_url":"https://api.github.com/repos/vcmi/vcmi/statuses/654ca96e9d3ad31f769492351cb7a8f2cb5476cd","head":{"label":"henningkoehlernz:skill_mod","ref":"skill_mod","sha":"654ca96e9d3ad31f769492351cb7a8f2cb5476cd","user":{"login":"henningkoehlernz","id":20719746,"avatar_url":"https://avatars2.githubusercontent.com/u/20719746?v=4","gravatar_id":"","url":"https://api.github.com/users/henningkoehlernz","html_url":"https://github.com/henningkoehlernz","followers_url":"https://api.github.com/users/henningkoehlernz/followers","following_url":"https://api.github.com/users/henningkoehlernz/following{/other_user}","gists_url":"https://api.github.com/users/henningkoehlernz/gists{/gist_id}","starred_url":"https://api.github.com/users/henningkoehlernz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/henningkoehlernz/subscriptions","organizations_url":"https://api.github.com/users/henningkoehlernz/orgs","repos_url":"https://api.github.com/users/henningkoehlernz/repos","events_url":"https://api.github.com/users/henningkoehlernz/events{/privacy}","received_events_url":"https://api.github.com/users/henningkoehlernz/received_events","type":"User","site_admin":false},"repo":{"id":100848393,"name":"vcmi","full_name":"henningkoehlernz/vcmi","owner":{"login":"henningkoehlernz","id":20719746,"avatar_url":"https://avatars2.githubusercontent.com/u/20719746?v=4","gravatar_id":"","url":"https://api.github.com/users/henningkoehlernz","html_url":"https://github.com/henningkoehlernz","followers_url":"https://api.github.com/users/henningkoehlernz/followers","following_url":"https://api.github.com/users/henningkoehlernz/following{/other_user}","gists_url":"https://api.github.com/users/henningkoehlernz/gists{/gist_id}","starred_url":"https://api.github.com/users/henningkoehlernz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/henningkoehlernz/subscriptions","organizations_url":"https://api.github.com/users/henningkoehlernz/orgs","repos_url":"https://api.github.com/users/henningkoehlernz/repos","events_url":"https://api.github.com/users/henningkoehlernz/events{/privacy}","received_events_url":"https://api.github.com/users/henningkoehlernz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/henningkoehlernz/vcmi","description":"Open-source engine for Heroes of Might and Magic III","fork":true,"url":"https://api.github.com/repos/henningkoehlernz/vcmi","forks_url":"https://api.github.com/repos/henningkoehlernz/vcmi/forks","keys_url":"https://api.github.com/repos/henningkoehlernz/vcmi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/henningkoehlernz/vcmi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/henningkoehlernz/vcmi/teams","hooks_url":"https://api.github.com/repos/henningkoehlernz/vcmi/hooks","issue_events_url":"https://api.github.com/repos/henningkoehlernz/vcmi/issues/events{/number}","events_url":"https://api.github.com/repos/henningkoehlernz/vcmi/events","assignees_url":"https://api.github.com/repos/henningkoehlernz/vcmi/assignees{/user}","branches_url":"https://api.github.com/repos/henningkoehlernz/vcmi/branches{/branch}","tags_url":"https://api.github.com/repos/henningkoehlernz/vcmi/tags","blobs_url":"https://api.github.com/repos/henningkoehlernz/vcmi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/henningkoehlernz/vcmi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/henningkoehlernz/vcmi/git/refs{/sha}","trees_url":"https://api.github.com/repos/henningkoehlernz/vcmi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/henningkoehlernz/vcmi/statuses/{sha}","languages_url":"https://api.github.com/repos/henningkoehlernz/vcmi/languages","stargazers_url":"https://api.github.com/repos/henningkoehlernz/vcmi/stargazers","contributors_url":"https://api.github.com/repos/henningkoehlernz/vcmi/contributors","subscribers_url":"https://api.github.com/repos/henningkoehlernz/vcmi/subscribers","subscription_url":"https://api.github.com/repos/henningkoehlernz/vcmi/subscription","commits_url":"https://api.github.com/repos/henningkoehlernz/vcmi/commits{/sha}","git_commits_url":"https://api.github.com/repos/henningkoehlernz/vcmi/git/commits{/sha}","comments_url":"https://api.github.com/repos/henningkoehlernz/vcmi/comments{/number}","issue_comment_url":"https://api.github.com/repos/henningkoehlernz/vcmi/issues/comments{/number}","contents_url":"https://api.github.com/repos/henningkoehlernz/vcmi/contents/{+path}","compare_url":"https://api.github.com/repos/henningkoehlernz/vcmi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/henningkoehlernz/vcmi/merges","archive_url":"https://api.github.com/repos/henningkoehlernz/vcmi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/henningkoehlernz/vcmi/downloads","issues_url":"https://api.github.com/repos/henningkoehlernz/vcmi/issues{/number}","pulls_url":"https://api.github.com/repos/henningkoehlernz/vcmi/pulls{/number}","milestones_url":"https://api.github.com/repos/henningkoehlernz/vcmi/milestones{/number}","notifications_url":"https://api.github.com/repos/henningkoehlernz/vcmi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/henningkoehlernz/vcmi/labels{/name}","releases_url":"https://api.github.com/repos/henningkoehlernz/vcmi/releases{/id}","deployments_url":"https://api.github.com/repos/henningkoehlernz/vcmi/deployments","created_at":"2017-08-20T08:28:53Z","updated_at":"2017-08-20T08:28:57Z","pushed_at":"2017-08-30T07:20:15Z","git_url":"git://github.com/henningkoehlernz/vcmi.git","ssh_url":"git@github.com:henningkoehlernz/vcmi.git","clone_url":"https://github.com/henningkoehlernz/vcmi.git","svn_url":"https://github.com/henningkoehlernz/vcmi","homepage":"http://vcmi.eu/","size":35307,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"vcmi:develop","ref":"develop","sha":"8180e4d5c5ba9ecd6ba36d8f15af10736b2fa8a3","user":{"login":"vcmi","id":2861395,"avatar_url":"https://avatars3.githubusercontent.com/u/2861395?v=4","gravatar_id":"","url":"https://api.github.com/users/vcmi","html_url":"https://github.com/vcmi","followers_url":"https://api.github.com/users/vcmi/followers","following_url":"https://api.github.com/users/vcmi/following{/other_user}","gists_url":"https://api.github.com/users/vcmi/gists{/gist_id}","starred_url":"https://api.github.com/users/vcmi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vcmi/subscriptions","organizations_url":"https://api.github.com/users/vcmi/orgs","repos_url":"https://api.github.com/users/vcmi/repos","events_url":"https://api.github.com/users/vcmi/events{/privacy}","received_events_url":"https://api.github.com/users/vcmi/received_events","type":"Organization","site_admin":false},"repo":{"id":18490421,"name":"vcmi","full_name":"vcmi/vcmi","owner":{"login":"vcmi","id":2861395,"avatar_url":"https://avatars3.githubusercontent.com/u/2861395?v=4","gravatar_id":"","url":"https://api.github.com/users/vcmi","html_url":"https://github.com/vcmi","followers_url":"https://api.github.com/users/vcmi/followers","following_url":"https://api.github.com/users/vcmi/following{/other_user}","gists_url":"https://api.github.com/users/vcmi/gists{/gist_id}","starred_url":"https://api.github.com/users/vcmi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vcmi/subscriptions","organizations_url":"https://api.github.com/users/vcmi/orgs","repos_url":"https://api.github.com/users/vcmi/repos","events_url":"https://api.github.com/users/vcmi/events{/privacy}","received_events_url":"https://api.github.com/users/vcmi/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/vcmi/vcmi","description":"Open-source engine for Heroes of Might and Magic III","fork":false,"url":"https://api.github.com/repos/vcmi/vcmi","forks_url":"https://api.github.com/repos/vcmi/vcmi/forks","keys_url":"https://api.github.com/repos/vcmi/vcmi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vcmi/vcmi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vcmi/vcmi/teams","hooks_url":"https://api.github.com/repos/vcmi/vcmi/hooks","issue_events_url":"https://api.github.com/repos/vcmi/vcmi/issues/events{/number}","events_url":"https://api.github.com/repos/vcmi/vcmi/events","assignees_url":"https://api.github.com/repos/vcmi/vcmi/assignees{/user}","branches_url":"https://api.github.com/repos/vcmi/vcmi/branches{/branch}","tags_url":"https://api.github.com/repos/vcmi/vcmi/tags","blobs_url":"https://api.github.com/repos/vcmi/vcmi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vcmi/vcmi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vcmi/vcmi/git/refs{/sha}","trees_url":"https://api.github.com/repos/vcmi/vcmi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vcmi/vcmi/statuses/{sha}","languages_url":"https://api.github.com/repos/vcmi/vcmi/languages","stargazers_url":"https://api.github.com/repos/vcmi/vcmi/stargazers","contributors_url":"https://api.github.com/repos/vcmi/vcmi/contributors","subscribers_url":"https://api.github.com/repos/vcmi/vcmi/subscribers","subscription_url":"https://api.github.com/repos/vcmi/vcmi/subscription","commits_url":"https://api.github.com/repos/vcmi/vcmi/commits{/sha}","git_commits_url":"https://api.github.com/repos/vcmi/vcmi/git/commits{/sha}","comments_url":"https://api.github.com/repos/vcmi/vcmi/comments{/number}","issue_comment_url":"https://api.github.com/repos/vcmi/vcmi/issues/comments{/number}","contents_url":"https://api.github.com/repos/vcmi/vcmi/contents/{+path}","compare_url":"https://api.github.com/repos/vcmi/vcmi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vcmi/vcmi/merges","archive_url":"https://api.github.com/repos/vcmi/vcmi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vcmi/vcmi/downloads","issues_url":"https://api.github.com/repos/vcmi/vcmi/issues{/number}","pulls_url":"https://api.github.com/repos/vcmi/vcmi/pulls{/number}","milestones_url":"https://api.github.com/repos/vcmi/vcmi/milestones{/number}","notifications_url":"https://api.github.com/repos/vcmi/vcmi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vcmi/vcmi/labels{/name}","releases_url":"https://api.github.com/repos/vcmi/vcmi/releases{/id}","deployments_url":"https://api.github.com/repos/vcmi/vcmi/deployments","created_at":"2014-04-06T13:42:23Z","updated_at":"2017-08-28T17:30:10Z","pushed_at":"2017-08-30T07:20:17Z","git_url":"git://github.com/vcmi/vcmi.git","ssh_url":"git@github.com:vcmi/vcmi.git","clone_url":"https://github.com/vcmi/vcmi.git","svn_url":"https://github.com/vcmi/vcmi","homepage":"http://vcmi.eu/","size":34942,"stargazers_count":658,"watchers_count":658,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":119,"mirror_url":null,"open_issues_count":10,"forks":119,"open_issues":10,"watchers":658,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/vcmi/vcmi/pulls/369"},"html":{"href":"https://github.com/vcmi/vcmi/pull/369"},"issue":{"href":"https://api.github.com/repos/vcmi/vcmi/issues/369"},"comments":{"href":"https://api.github.com/repos/vcmi/vcmi/issues/369/comments"},"review_comments":{"href":"https://api.github.com/repos/vcmi/vcmi/pulls/369/comments"},"review_comment":{"href":"https://api.github.com/repos/vcmi/vcmi/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/vcmi/vcmi/pulls/369/commits"},"statuses":{"href":"https://api.github.com/repos/vcmi/vcmi/statuses/654ca96e9d3ad31f769492351cb7a8f2cb5476cd"}},"author_association":"NONE"}}
{"actor":{"display_login":"henningkoehlernz"}}