{"action":"created","issue":{"url":"https://api.github.com/repos/Kitteh6660/Corruption-of-Champions-Mod/issues/71","labels_url":"https://api.github.com/repos/Kitteh6660/Corruption-of-Champions-Mod/issues/71/labels{/name}","comments_url":"https://api.github.com/repos/Kitteh6660/Corruption-of-Champions-Mod/issues/71/comments","events_url":"https://api.github.com/repos/Kitteh6660/Corruption-of-Champions-Mod/issues/71/events","html_url":"https://github.com/Kitteh6660/Corruption-of-Champions-Mod/issues/71","id":80678209,"number":71,"title":"[Feature] Long wait/rest","user":{"login":"openaz","id":140596,"avatar_url":"https://avatars.githubusercontent.com/u/140596?v=3","gravatar_id":"","url":"https://api.github.com/users/openaz","html_url":"https://github.com/openaz","followers_url":"https://api.github.com/users/openaz/followers","following_url":"https://api.github.com/users/openaz/following{/other_user}","gists_url":"https://api.github.com/users/openaz/gists{/gist_id}","starred_url":"https://api.github.com/users/openaz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openaz/subscriptions","organizations_url":"https://api.github.com/users/openaz/orgs","repos_url":"https://api.github.com/users/openaz/repos","events_url":"https://api.github.com/users/openaz/events{/privacy}","received_events_url":"https://api.github.com/users/openaz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-25T21:41:20Z","updated_at":"2015-05-25T21:45:19Z","closed_at":null,"body":"Somewhere I came across note, that long wait (using shift key) might be implemented. So this might be helpful.\r\n```diff\r\ndiff --git a/classes/classes/Scenes/Camp.as b/classes/classes/Scenes/Camp.as\r\nindex 3828e25..de03cfa 100644\r\n--- a/classes/classes/Scenes/Camp.as\r\n+++ b/classes/classes/Scenes/Camp.as\r\n@@ -747,8 +747,8 @@ private function doCamp():void { //Only called by playerMenu\r\n \t\taddButton(8, \"Masturbate\", kGAMECLASS.masturbation.masturbateMenu);\r\n \t\tif (((player.findPerk(PerkLib.HistoryReligious) >= 0 && player.cor <= 66) || (player.findPerk(PerkLib.Enlightened) >= 0 && player.cor < 10)) && !(player.findStatusAffect(StatusAffects.Exgartuan) >= 0 && player.statusAffectv2(StatusAffects.Exgartuan) == 0) || flags[kFLAGS.SFW_MODE] >= 1) addButton(8, \"Meditate\", kGAMECLASS.masturbation.masturbateMenu);\r\n \t}\r\n-\taddButton(9, \"Wait\", doWait, null, null, null, \"Wait for four hours.\");\r\n-\tif (player.fatigue > 40 || player.HP / player.maxHP() <= .9) addButton(9, \"Rest\", rest, null, null, null, \"Rest for four hours.\");\r\n+\taddButton(9, \"Wait\", doWait, null, null, null, \"Wait for four hours.\\n\\nShift click to wait for night.\");\r\n+\tif (player.fatigue > 40 || player.HP / player.maxHP() <= .9) addButton(9, \"Rest\", rest, null, null, null, \"Rest for four hours.\\n\\nShift click to rest until fully healed or night comes.\");\r\n \tif (model.time.hours >= 21 || model.time.hours < 6) addButton(9, \"Sleep\", doSleep, null, null, null, \"Turn yourself in for the night.\");\r\n \r\n \t//Remove buttons according to conditions.\r\n@@ -1507,18 +1507,51 @@ public function rest():void {\r\n \t}\r\n \t//Fatigue recovery\r\n \tvar fatRecovery:Number = 4;\r\n+\tvar hpRecovery:Number = 10;\r\n \tif (player.findPerk(PerkLib.SpeedyRecovery) >= 0) fatRecovery *= 1.5;\r\n \tif (player.findPerk(PerkLib.ControlledBreath) >= 0) fatRecovery *= 1.1;\r\n \tif (timeQ == 0) {\r\n+\r\n+\t\t// Rest until fully healed\r\n+\t\tif (flags[kFLAGS.SHIFT_KEY_DOWN] == 1) {\r\n+\t\t\t// Calculate fatigue over 40, which is minimum for resting\r\n+\t\t\tvar diffFatigue:Number = (player.fatigue < 40) ? 0 : player.fatigue - 40;\r\n+\t\t\t// Calculate missing hp to 90%, which is minimum for resting\r\n+\t\t\tvar diffHp:Number = (player.HP / player.maxHP() < 0.9) ? ((player.maxHP() * 0.9) - player.HP) : 0;\r\n+\r\n+\t\t\t// Marble's Milk affection reduces hp recovery by 50%\r\n+\t\t\tif (player.findStatusAffect(StatusAffects.MarbleWithdrawl) >= 0) { hpRecovery *= 0.5; }\r\n+\r\n+\t\t\t// Rest until fully healed so we need maximum length of rest\r\n+\t\t\ttimeQ = Math.round(Math.max(diffFatigue / fatRecovery / multiplier, diffHp / hpRecovery) / multiplier);\r\n+\r\n+\t\t\t// Stop resting at 9pm as it's time to go sleep instead\r\n+\t\t\tif (timeQ > 21 - model.time.hours) {\r\n+\t\t\t\ttimeQ = 21 - model.time.hours;\r\n+\t\t\t}\r\n+\t\t} // Regular rest for 4 hours\r\n+\t\telse {\r\n+\t\t\ttimeQ = 4;\r\n+\t\t}\r\n+\r\n \t\tif (flags[kFLAGS.CAMP_BUILT_CABIN] > 0 && flags[kFLAGS.CAMP_CABIN_FURNITURE_BED] > 0)\r\n \t\t{\r\n-\t\t\toutputText(\"You head into your cabin to rest. You lie down on your bed to rest for four hours.\", false);\r\n+\t\t\toutputText(\"You head into your cabin to rest. You lie down on your bed to rest \", false);\r\n+\t\t\tif (timeQ == 4) {\r\n+\t\t\t\toutputText(\"for four hours.\\n\", false);\r\n+\t\t\t} else {\r\n+\t\t\t\toutputText(\"until fully healed.\\n\", false);\r\n+\t\t\t}\r\n \t\t}\r\n \t\telse \r\n \t\t{\r\n-\t\t\toutputText(\"You lie down to rest for four hours.\\n\", false);\r\n+\t\t\toutputText(\"You lie down to rest \", false);\r\n+\t\t\tif (timeQ == 4) {\r\n+\t\t\t\toutputText(\"for four hours.\\n\", false);\r\n+\t\t\t} else {\r\n+\t\t\t\toutputText(\"until fully healed.\\n\", false);\r\n+\t\t\t}\r\n \t\t}\r\n-\t\ttimeQ = 4;\r\n \t\t//Hungry\r\n \t\tif (flags[kFLAGS.HUNGER_ENABLED] > 0)\r\n \t\t{\r\n@@ -1531,7 +1564,7 @@ public function rest():void {\r\n \t\tif(player.findStatusAffect(StatusAffects.MarbleWithdrawl) >= 0) {\r\n \t\t\toutputText(\"\\nYour rest is very troubled, and you aren't able to settle down.  You get up feeling tired and unsatisfied, always thinking of Marble's milk.\\n\", false);\r\n \r\n-\t\t\tHPChange(timeQ * 5 * multiplier, true);\r\n+\t\t\tHPChange(timeQ * hpRecovery * multiplier, true);\r\n \r\n \t\t\tdynStats(\"tou\", -.1, \"int\", -.1);\r\n \t\t\t//fatigue\r\n@@ -1548,7 +1581,7 @@ public function rest():void {\r\n \t\t}\r\n \t\t//REGULAR HP/FATIGUE RECOVERY\r\n \t\telse {\r\n-\t\t\tHPChange(timeQ * 10 * multiplier, true);\r\n+\t\t\tHPChange(timeQ * hpRecovery * multiplier, true);\r\n \t\t\t//fatigue\r\n \t\t\tfatigue(-fatRecovery * timeQ * multiplier); \r\n \t\t}\r\n@@ -1569,10 +1602,15 @@ public function doWait():void {\r\n \t//Fatigue recovery\r\n \tvar fatRecovery:Number = 2;\r\n \tif (player.findPerk(PerkLib.SpeedyRecovery) >= 0) fatRecovery *= 1.5;\r\n-\tif (player.findPerk(PerkLib.ControlledBreath) >= 0) fatRecovery *= 1.1;\r\n \tif(timeQ == 0) {\r\n-\t\toutputText(\"You wait four hours...\\n\", false);\r\n-\t\ttimeQ = 4;\r\n+\t\tif (flags[kFLAGS.SHIFT_KEY_DOWN] == 1) {\r\n+\t\t\toutputText(\"You wait whole day...\\n\", false);\r\n+\t\t\ttimeQ = 21 - model.time.hours;\r\n+\t\t} else {\r\n+\t\t\toutputText(\"You wait four hours...\\n\", false);\r\n+\t\t\ttimeQ = 4;\r\n+\t\t}\r\n+\r\n \t\t//Marble withdrawl\r\n \t\tif(player.findStatusAffect(StatusAffects.MarbleWithdrawl) >= 0) {\r\n \t\t\toutputText(\"\\nYour time spent waiting is very troubled, and you aren't able to settle down.  You get up feeling tired and unsatisfied, always thinking of Marble's milk.\\n\", false);\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/Kitteh6660/Corruption-of-Champions-Mod/issues/comments/105323924","html_url":"https://github.com/Kitteh6660/Corruption-of-Champions-Mod/issues/71#issuecomment-105323924","issue_url":"https://api.github.com/repos/Kitteh6660/Corruption-of-Champions-Mod/issues/71","id":105323924,"user":{"login":"openaz","id":140596,"avatar_url":"https://avatars.githubusercontent.com/u/140596?v=3","gravatar_id":"","url":"https://api.github.com/users/openaz","html_url":"https://github.com/openaz","followers_url":"https://api.github.com/users/openaz/followers","following_url":"https://api.github.com/users/openaz/following{/other_user}","gists_url":"https://api.github.com/users/openaz/gists{/gist_id}","starred_url":"https://api.github.com/users/openaz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openaz/subscriptions","organizations_url":"https://api.github.com/users/openaz/orgs","repos_url":"https://api.github.com/users/openaz/repos","events_url":"https://api.github.com/users/openaz/events{/privacy}","received_events_url":"https://api.github.com/users/openaz/received_events","type":"User","site_admin":false},"created_at":"2015-05-25T21:45:19Z","updated_at":"2015-05-25T21:45:19Z","body":"Possible improvements I have in my mind:\r\n1. User defined sleep time (another alarm in cabin)\r\n2. Improved text - convert number to text to provide exact info instead of general text"}}