camp.js 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. // At Camp
  2. /*jshint multistr:true*/
  3. // Return to Camp after a battle or foraging etc
  4. // To allow for special events etc
  5. var sexLastRound;
  6. var activeCamp="main";
  7. function Camp()
  8. {
  9. triggerStoryHook("round");
  10. advanceRound();
  11. // Were you gender changed by the battle?
  12. if(showCamp){
  13. if(sexLastRound===undefined){
  14. sexLastRound = player.isFemale();
  15. }
  16. if (player.isFemale() !== sexLastRound) {
  17. Message(NextWindow, "<h1>You Changed!</h1><p>You now changed, you now " + (player.isFemale() ? "woman" : "man") + "!</p>");
  18. return;
  19. }
  20. sexLastRound = player.isFemale();
  21. }
  22. var blockShow=false;
  23. /*$.each(player.women, function( index, value ) {
  24. var rival = player.women[index];//moving to activity
  25. /*
  26. if (index > 0 && !rival.isFemale() && rival.items.collar === 0 && getRandomInt(1, 100) < (100 - rival.submissiveness)) {
  27. //blockShow=true;
  28. //return false;
  29. }else{*/
  30. // They runaway!
  31. /*Message("ShowCamp()", "<h1>" + rival.name + " Run Away!</h1><p>" + player.women[0].name + " tell you how " + rival.name + " had talked about leaving to form his own clan! He gone now, run from you and your clan. Maybe you find him again and recapture!</p>");
  32. runaways.push(rival);
  33. player.women.splice(index, 1);
  34. $.each(AVATAR_TRAITS, function(idx, trait){
  35. rival[trait] = rival[trait] - 20;
  36. });
  37. return;*/
  38. //}
  39. // });
  40. // Actually enter camp and show the form
  41. //if(showCamp){//global value, reset each round. can be set by blocking activities. is there a cleaner way than global?
  42. //ShowCamp();
  43. //}
  44. NextWindow();
  45. }
  46. //will override showCamp and then run the function
  47. function ForceShowCamp(){
  48. showCamp=true;
  49. ShowCamp();
  50. }
  51. // Show the camp form
  52. function ShowCamp()
  53. {
  54. $("#rcwomen").hide();
  55. $("#rcchangra").hide();
  56. $(".stats").show();
  57. $("#otherstats").show();
  58. $("#goods").show();
  59. $("#player_goods").html(Math.floor(player.goods));
  60. if (player.Mods.craftnipplerings === 0) {
  61. $("#metal_label").hide();
  62. } else {
  63. $("#metal_label").show();
  64. $("#player_metal").html(player.metal);
  65. }
  66. fBeforeBattle = player.isFemale();
  67. var chb = 0;
  68. var chg = 0;
  69. $.each(player.women, function( index, value ) {
  70. chb += player.women[index].childrenboy;
  71. chg += player.women[index].childrengirl;
  72. });
  73. if (player.Mods.craftleftbracelet > 0) {
  74. if (player.isFemale() || player.isFutanari()) $("#player_kids").html(player.childrenboy + "&#9794;," + player.childrengirl + "&#9792;/" + chb + "&#9794;," + chg + "&#9792;");
  75. else $("#player_kids").html(chb + "&#9794;," + chg + "&#9792;");
  76. } else {
  77. if (player.isFemale() || player.isFutanari()) $("#player_kids").html((player.childrenboy + player.childrengirl) + "/" + (chb + chg));
  78. else $("#player_kids").html(chb + chg);
  79. }
  80. resetRival();
  81. $("#output").html("<h1>Camp - Week " + player.round + "</h1>");
  82. var ps = false;
  83. if(challengeResult!=""){//someone tried to usurp npc leader.
  84. $('#output').append(`<p align='left'>${challengeResult}</p>`);
  85. }
  86. if (player.activity !== "") {
  87. $("#output").append("<p align='left'>" + player.activity+"</p>");
  88. //ps = true;
  89. }/* This is taken care of elsewhere for now. I think
  90. $.each(player.women, function( index, value ) {
  91. if (player.women[index].activity.indexOf("birth") != -1) {
  92. if (ps === false) {
  93. ps = true;
  94. $("#output").append("<p align='left'>");
  95. }
  96. $("#output").append(player.women[index].activity.split("She").join(player.women[index].name));
  97. }
  98. if (ps) $("#output").append("</p>");
  99. });*/
  100. if(player.doneTo){
  101. $("#output").append(`<p>${player.doneTo}</p>`);
  102. }
  103. if(player!==leader){
  104. var msg = "";
  105. if(player.dysphoria<8){
  106. msg=`You rub belly softly and think about carrying ${leader.name} baby inside. Maybe is good to be woman.`;
  107. }else if(player.dysphoria<20){
  108. msg=`Everything so different now that you not clan Father any more. You barely remember what it feel like to be man.`;
  109. }else if(player.dysphoria<60){
  110. msg=`You go around camp doing woman work, just like other women you take. Each day it becomes more natural to act like woman, think like woman. If you not careful, maybe you become one for real.`;
  111. }else{
  112. msg=`You stuck in woman body, maybe, but you not true woman yet. All you want do is fight hard, become man again and take ${leader.name} like the woman she is.`;
  113. }
  114. if(player.pierceMessage){
  115. $("#output").append(`<p>${player.pierceMessage}</p>`);
  116. }
  117. $("#output").append(`<p>${msg}</p>`);
  118. }
  119. //editPlayer();
  120. $("#output").append(
  121. "<button id='women_button' class='btn' title='Examine the women'>Women</button>\
  122. <button id='forage_button' class='btn' title='Forage!'>Forage</button>");
  123. if(leader===player){
  124. $("#output").append(" <button id='hunt_button' class='btn' title='Hunt!'>Hunt</button>");
  125. }else{
  126. $("#output").append(" <button id='tend_button' class='btn' title='Tend Camp'>Tend Camp</button>\
  127. <button id='meditate_button' class='btn' title='Meditate'>Meditate</button>\
  128. <button id='leader_button' class='btn' title='"+leader.name+"'>"+leader.name+"</button>");
  129. }
  130. if (player.experience > 0) {
  131. $("#output").append(" <button id='exp_button' class='btn' title='Train yourself'>Train</button>");
  132. }
  133. if (player.Mods.craftnipplerings > 0 && player===leader) {
  134. $("#output").append(" <button id='craft_button' class='btn' title='Craft'>Craft</button>");
  135. }
  136. $("#output").append(
  137. " <button id='load_button' class='btn' title='Load the Saved game'>Load</button>\
  138. <button id='save_button' class='btn' title='Save the game'>Save</button>");
  139. $("#output").append("<div id='camp_feed'></div>");
  140. $("#meditate_button").click(function(){
  141. for(var i in AVATAR_TRAITS){
  142. eatStatNut(player,AVATAR_TRAITS[i],getRandomInt(-1*(1+player.Mods.ironwill),0));
  143. }
  144. player.dysphoria+=2;
  145. EndRound(Message(NextWindow,"<p>You think deep, breath slow, try to kindle tiny changra into roaring flame.</p>"));
  146. });
  147. $("#women_button").click(displayWomen);
  148. $("#forage_button").click(Forage);
  149. $("#hunt_button").click(Hunt);
  150. $("#tend_button").click(function(){
  151. eatStatNut(player,"submissiveness",3,false);
  152. eatStatNut(player,"domesticity",5,false);
  153. player.dysphoria-=3;
  154. EndRound(Message(NextWindow,`You dutifully tend camp for ${leader.name}.`));
  155. });
  156. $("#leader_button").click(displayLeader);
  157. $("#load_button").click(function(){
  158. if (loadGame("ShowCamp()") === 0) alert("No saved games");
  159. });
  160. $("#save_button").click(function() {
  161. saveGame("ShowCamp()");
  162. });
  163. $("#exp_button").click(Train);
  164. $("#craft_button").click(Craft);
  165. if(player!==leader){//loss condition for submissive playstyle.
  166. console.log(player.dysphoria);
  167. if(player.dysphoria<=0){
  168. rival=leader;
  169. redraw();
  170. Message("location.reload()","<p>As you go sleep at night, you realize you not think all day about becoming man again. All you think about is tend camp, cook food, want babies.</p><p>You think about man. He big, powerful. You soft not like him at all, just soft, small woman. Why want fight him when you can be good clanmother for him instead.</p><p>By time you wake up next morning, you forget all silly dreams of becoming man. You woman now. That all you need to be happy.</p>",false,leader);
  171. }
  172. }
  173. }