big steppy
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

1908 lines
51 KiB

  1. var strolling = false;
  2. var maxStomachDigest = 10;
  3. var maxBowelsDigest = 10;
  4. var unit = "metric";
  5. var numbers = "full";
  6. var verbose = true;
  7. var biome = "suburb";
  8. var newline = " ";
  9. victims = {};
  10. var humanMode = true;
  11. var macro =
  12. {
  13. "scaling": function(value, scale, factor) { return value * Math.pow(scale,factor); },
  14. "name": "",
  15. "species": "crux",
  16. "color" : "blue",
  17. "baseHeight": 2.26,
  18. get height() { return this.scaling(this.baseHeight, this.scale, 1); },
  19. "baseMass": 135,
  20. get mass () { return this.scaling(this.baseMass, this.scale, 3); },
  21. "basePawArea": 0.1,
  22. get pawArea() { return this.scaling(this.basePawArea, this.scale, 2); },
  23. "baseAnalVoreArea": 0.1,
  24. get analVoreArea() { return this.scaling(this.baseAnalVoreArea, this.scale, 2); },
  25. "baseAssArea": 0.4,
  26. get assArea() { return this.scaling(this.baseAssArea * this.assScale, this.scale, 2); },
  27. "baseHandArea": 0.1,
  28. get handArea() { return this.scaling(this.baseHandArea, this.scale, 2); },
  29. "assScale": 1,
  30. "hasTail": true,
  31. "tailType": "slinky",
  32. "tailCount": 1,
  33. "baseTailLength": 1,
  34. "baseTailDiameter": 0.1,
  35. "tailDensity": 250,
  36. "tailScale": 1,
  37. "tailMaw": false,
  38. get tailLength() {
  39. return this.scaling(this.baseTailLength * this.tailScale, this.scale, 1);
  40. },
  41. get tailDiameter() {
  42. return this.scaling(this.baseTailDiameter * this.tailScale, this.scale, 1);
  43. },
  44. get tailGirth() {
  45. return Math.pow(this.tailDiameter/2,2) * Math.PI;
  46. },
  47. get tailArea() {
  48. return this.tailLength * this.tailDiameter;
  49. },
  50. get tailVolume() {
  51. return this.tailGirth * this.tailLength;
  52. },
  53. get tailMass() {
  54. return this.tailVolume * this.tailDensity;
  55. },
  56. "dickType": "canine",
  57. "baseDickLength": 0.3,
  58. "baseDickDiameter": 0.08,
  59. "dickDensity": 1000,
  60. "dickScale": 1,
  61. get dickLength() {
  62. factor = 1;
  63. if (!this.arousalEnabled || this.arousal < 25) {
  64. factor = 0.5;
  65. } else if (this.arousal < 75) {
  66. factor = 0.5 + (this.arousal - 25) / 100;
  67. }
  68. return this.scaling(this.baseDickLength * this.dickScale * factor, this.scale, 1);
  69. },
  70. get dickDiameter() {
  71. factor = 1;
  72. if (!this.arousalEnabled || this.arousal < 25) {
  73. factor = 0.5;
  74. } else if (this.arousal < 75) {
  75. factor = 0.5 + (this.arousal - 25) / 100;
  76. }
  77. return this.scaling(this.baseDickDiameter * this.dickScale * factor, this.scale, 1);
  78. },
  79. get dickGirth() {
  80. return Math.pow((this.dickDiameter/ 2),2) * Math.PI;
  81. },
  82. get dickArea() {
  83. return this.dickLength* this.dickDiameter* Math.PI / 2;
  84. },
  85. get dickVolume() {
  86. return this.dickLength* Math.pow(this.dickDiameter2,2) * Math.PI;
  87. },
  88. get dickMass() {
  89. return this.dickVolume* this.dickDensity;
  90. },
  91. "baseBallDiameter": 0.05,
  92. "ballDensity": 1000,
  93. "ballScale": 1,
  94. get ballDiameter() { return this.scaling(this.baseBallDiameter * this.ballScale, this.scale, 1); },
  95. get ballArea() { return 2 * Math.PI * Math.pow(this.ballDiameter/2, 2) },
  96. get ballVolume() {
  97. var radius = this.ballDiameter / 2;
  98. return 4/3 * Math.PI * Math.pow(radius,3);
  99. },
  100. get ballMass() {
  101. var volume = this.ballVolume;
  102. return volume * this.ballDensity;
  103. },
  104. "baseCumRatio": 1,
  105. "cumScale": 1,
  106. get cumVolume() {
  107. return this.dickGirth * this.baseCumRatio * this.cumScale * (1 + this.edge) + Math.max(0,this.cumStorage.amount - this.cumStorage.limit);
  108. },
  109. "baseVaginaLength": 0.1,
  110. "baseVaginaWidth": 0.05,
  111. "vaginaScale": 1,
  112. get vaginaLength() { return this.scaling(this.baseVaginaLength * this.vaginaScale, this.scale, 1); },
  113. get vaginaWidth() { return this.scaling(this.baseVaginaWidth * this.vaginaScale, this.scale, 1); },
  114. get vaginaArea() { return this.vaginaLength * this.vaginaWidth },
  115. get vaginaVolume() { return this.vaginaArea * this.vaginaWidth },
  116. "baseFemcumRatio": 1,
  117. "femcumScale": 1,
  118. get femcumVolume() {
  119. return this.vaginaArea * this.baseFemcumRatio * this.femcumScale * (1 + this.edge) + Math.max(0,this.femcumStorage.amount - this.femcumStorage.limit);
  120. },
  121. hasBreasts: true,
  122. lactationEnabled: true,
  123. lactationScale: 1,
  124. lactationFactor: 0.25,
  125. get lactationVolume() {
  126. return this.milkStorage.limit * this.lactationFactor;
  127. },
  128. "baseBreastDiameter": 0.1,
  129. "breastScale": 1,
  130. "breastDensity": 1000,
  131. get breastDiameter() { return this.scaling(this.baseBreastDiameter * this.breastScale, this.scale, 1); },
  132. get breastArea() {
  133. return 2 * Math.PI * Math.pow(this.breastDiameter/2,2);
  134. },
  135. get breastVolume() {
  136. var radius = this.breastDiameter / 2;
  137. return 4/3 * Math.PI * Math.pow(radius,3);
  138. },
  139. get breastMass() {
  140. var volume = this.breastVolume;
  141. return volume * this.breastDensity;
  142. },
  143. "digest": function(owner,organ) {
  144. var count = Math.min(organ.contents.length, organ.maxDigest);
  145. var container = new Container();
  146. while (count > 0) {
  147. var victim = organ.contents.shift();
  148. if (victim.name != "Container")
  149. victim = new Container([victim]);
  150. container = container.merge(victim);
  151. --count;
  152. }
  153. var digested = container.sum();
  154. for (var key in victims[organ.name]) {
  155. if (victims[organ.name].hasOwnProperty(key) && digested.hasOwnProperty(key) ) {
  156. victims["digested"][key] += digested[key];
  157. victims[organ.name][key] -= digested[key];
  158. }
  159. }
  160. var line = organ.describeDigestion(container);
  161. organ.fill(this,container);
  162. var summary = summarize(container.sum());
  163. if (organ.contents.length > 0) {
  164. setTimeout(function() { owner.digest(owner,organ) }, 15000);
  165. }
  166. update([line,summary,newline]);
  167. },
  168. "stomach": {
  169. "name": "stomach",
  170. "feed": function(prey) {
  171. this.feedFunc(prey,this,this.owner);
  172. },
  173. "feedFunc": function(prey,self,owner) {
  174. if (self.contents.length == 0)
  175. setTimeout(function() { owner.digest(owner,self) }, 15000);
  176. this.contents.push(prey);
  177. },
  178. "describeDigestion": function(container) {
  179. return describe("stomach",container,this.owner,verbose);
  180. },
  181. "fill": function(owner,container) {
  182. //no-op
  183. },
  184. "contents": [],
  185. "maxDigest": 5
  186. },
  187. "bowels": {
  188. "name" : "bowels",
  189. "feed": function(prey) {
  190. this.feedFunc(prey,this,this.owner);
  191. },
  192. "feedFunc": function(prey,self,owner) {
  193. if (self.contents.length == 0)
  194. setTimeout(function() { owner.digest(owner,self) }, 15000);
  195. this.contents.push(prey);
  196. },
  197. "describeDigestion" : function(container) {
  198. return describe("bowels",container,this.owner,verbose);
  199. },
  200. "fill": function(owner,container) {
  201. //no-op
  202. },
  203. "contents" : [],
  204. "maxDigest" : 3
  205. },
  206. "womb": {
  207. "name" : "womb",
  208. "feed": function(prey) {
  209. this.feedFunc(prey,this,this.owner);
  210. },
  211. "feedFunc": function(prey,self,owner) {
  212. if (self.contents.length == 0)
  213. setTimeout(function() { owner.digest(owner,self) }, 15000);
  214. this.contents.push(prey);
  215. },
  216. "describeDigestion" : function(container) {
  217. return describe("womb",container,this.owner,verbose);
  218. },
  219. "fill": function(owner,container) {
  220. owner.femcumStorage.amount += container.sum_property("mass") / 1e3;
  221. },
  222. "contents" : [],
  223. "maxDigest" : 1
  224. },
  225. "balls": {
  226. "name" : "balls",
  227. "feed": function(prey) {
  228. this.feedFunc(prey,this,this.owner);
  229. },
  230. "feedFunc": function(prey,self,owner) {
  231. if (self.contents.length == 0)
  232. setTimeout(function() { owner.digest(owner,self) }, 15000);
  233. this.contents.push(prey);
  234. },
  235. "describeDigestion": function(container) {
  236. return describe("balls",container,this.owner,verbose);
  237. },
  238. "fill": function(owner,container) {
  239. owner.cumStorage.amount += container.sum_property("mass") / 1e3;
  240. },
  241. "contents" : [],
  242. "maxDigest" : 1
  243. },
  244. "init": function() {
  245. this.stomach.owner = this;
  246. this.bowels.owner = this;
  247. this.womb.owner = this;
  248. this.balls.owner = this;
  249. this.cumStorage.owner = this;
  250. this.femcumStorage.owner = this;
  251. this.milkStorage.owner = this;
  252. if (this.maleParts)
  253. this.fillCum(this);
  254. if (this.femaleParts)
  255. this.fillFemcum(this);
  256. if (this.lactationEnabled)
  257. this.fillBreasts(this);
  258. if (this.arousalEnabled) {
  259. this.quenchExcess(this);
  260. }
  261. },
  262. "maleParts": true,
  263. "femaleParts": true,
  264. "fillCum": function(self) {
  265. self.cumStorage.amount += self.cumScale * self.ballVolume / 1200;
  266. if (self.cumStorage.amount > self.cumStorage.limit)
  267. self.arouse(1 * (self.cumStorage.amount / self.cumStorage.limit - 1));
  268. setTimeout(function () { self.fillCum(self) }, 100);
  269. update();
  270. },
  271. "fillFemcum": function(self) {
  272. self.femcumStorage.amount += self.femcumScale * self.vaginaVolume / 1200;
  273. if (self.femcumStorage.amount > self.femcumStorage.limit)
  274. self.arouse(1 * (self.femcumStorage.amount / self.femcumStorage.limit - 1));
  275. setTimeout(function () { self.fillFemcum(self) }, 100);
  276. update();
  277. },
  278. "fillBreasts": function(self) {
  279. self.milkStorage.amount += self.lactationScale * self.milkStorage.limit / 1200;
  280. if (self.milkStorage.amount > self.milkStorage.limit)
  281. self.milkStorage.amount = self.milkStorage.limit;
  282. setTimeout(function () { self.fillBreasts(self) }, 100);
  283. update();
  284. },
  285. "cumStorage": {
  286. "amount": 0,
  287. get limit() {
  288. return this.owner.ballVolume;
  289. }
  290. },
  291. "femcumStorage": {
  292. "amount": 0,
  293. get limit() {
  294. return this.owner.vaginaVolume;
  295. }
  296. },
  297. "milkStorage": {
  298. "amount": 0,
  299. get limit() {
  300. return this.owner.breastVolume * 2;
  301. }
  302. },
  303. "orgasm": false,
  304. "afterglow": false,
  305. "arousalEnabled": true,
  306. "arousalFactor": 1,
  307. "arousal": 0,
  308. "edge": 0,
  309. "maleSpurt": 0,
  310. "femaleSpurt": 0,
  311. "arouse": function(amount) {
  312. if (!this.arousalEnabled)
  313. return;
  314. if (this.afterglow)
  315. return;
  316. this.arousal += amount * this.arousalFactor;
  317. if (this.arousal >= 200) {
  318. this.arousal = 200;
  319. if (!this.orgasm) {
  320. this.orgasm = true;
  321. update(["You shudder as ecstasy races up your spine",newline]);
  322. if (this.maleParts) {
  323. this.maleOrgasm(this);
  324. }
  325. if (this.femaleParts) {
  326. this.femaleOrgasm(this);
  327. }
  328. }
  329. }
  330. },
  331. "quench": function(amount) {
  332. if (!this.arousalEnabled)
  333. return;
  334. this.arousal -= amount;
  335. if (this.arousal <= 100) {
  336. if (this.orgasm) {
  337. this.orgasm = false;
  338. this.afterglow = true;
  339. }
  340. }
  341. if (this.arousal < 0) {
  342. this.arousal = 0;
  343. this.afterglow = false;
  344. }
  345. update();
  346. },
  347. "quenchExcess": function(self) {
  348. if (self.arousalEnabled) {
  349. if (self.arousal > 100 && !self.orgasm) {
  350. self.arousal = Math.max(100,self.arousal-1);
  351. self.edge += Math.sqrt((self.arousal - 100)) / 500;
  352. self.edge = Math.min(1,self.edge);
  353. self.edge = Math.max(0,self.edge - 0.002);
  354. if (self.maleParts)
  355. self.maleSpurt += ((self.arousal-100)/100 + Math.random()) / 25 * (self.edge);
  356. if (self.femaleParts)
  357. self.femaleSpurt += ((self.arousal-100)/100 + Math.random()) / 25 * (self.edge);
  358. if (self.maleSpurt > 1) {
  359. male_spurt(macro.cumVolume * (0.1 + Math.random() / 10));
  360. self.maleSpurt = 0;
  361. }
  362. if (self.femaleSpurt > 1) {
  363. female_spurt(macro.femcumVolume * (0.1 + Math.random() / 10));
  364. self.femaleSpurt = 0;
  365. }
  366. update();
  367. } else if (self.afterglow) {
  368. self.quench(0.5);
  369. self.edge = Math.max(0,self.edge - 0.01);
  370. }
  371. }
  372. setTimeout(function() { self.quenchExcess(self); }, 200);
  373. },
  374. "maleOrgasm": function(self) {
  375. if (!this.arousalEnabled)
  376. return;
  377. if (self.orgasm) {
  378. self.quench(10);
  379. var amount = Math.min(this.cumVolume, this.cumStorage.amount);
  380. this.cumStorage.amount -= amount;
  381. male_orgasm(amount);
  382. setTimeout(function() { self.maleOrgasm(self) }, 2000);
  383. }
  384. },
  385. "femaleOrgasm": function(self) {
  386. if (!this.arousalEnabled)
  387. return;
  388. if (this.orgasm) {
  389. this.quench(10);
  390. var amount = Math.min(this.femcumVolume, this.femcumStorage.amount);
  391. this.femcumStorage.amount -= amount;
  392. female_orgasm(amount);
  393. setTimeout(function() { self.femaleOrgasm(self) }, 2000);
  394. }
  395. },
  396. get description() {
  397. result = [];
  398. line = "You are " + (macro.name == "" ? "" : macro.name + ", ") + "a " + length(macro.height, unit, true) + " tall " + macro.species + ". You weigh " + mass(macro.mass, unit) + ".";
  399. result.push(line);
  400. if (this.hasTail) {
  401. line = "Your " + macro.describeTail + (macro.tailCount > 1 ? " tails sway as you walk," : "sways as you walk.");
  402. if (this.tailMaw) {
  403. line += (macro.tailCount > 1 ? "Their maws are drooling" : "Its maw is drooling");
  404. }
  405. result.push(line);
  406. }
  407. if (this.arousalEnabled) {
  408. if (this.afterglow) {
  409. result.push("You're basking in the afterglow of a powerful orgasm.");
  410. }
  411. else if (this.orgasm) {
  412. result.push("You're cumming!");
  413. } else if (this.arousal < 25) {
  414. } else if (this.arousal < 75) {
  415. result.push("You're feeling a little aroused.");
  416. } else if (this.arousal < 150) {
  417. result.push("You're feeling aroused.");
  418. } else if (this.arousal < 200) {
  419. result.push("You're on the edge of an orgasm!");
  420. }
  421. }
  422. if (this.maleParts) {
  423. line = "Your " + this.describeDick + " cock hangs from your hips, with two " + mass(macro.ballMass, unit, true) + ", " + length(macro.ballDiameter, unit, true) + "-wide balls hanging beneath.";
  424. result.push(line);
  425. }
  426. if (this.femaleParts) {
  427. line = "Your glistening " + this.describeVagina + " slit peeks out from between your legs."
  428. result.push(line);
  429. }
  430. if (this.hasBreasts) {
  431. line = "You have two " + length(macro.breastDiameter, unit, true) + "-wide breasts that weigh " + mass(macro.breastMass, unit) + " apiece.";
  432. result.push(line);
  433. }
  434. return result;
  435. },
  436. get describeTail() {
  437. return (this.tailCount > 1 ? this.tailCount + " " : "") + length(this.tailLength, unit, true) + "-long " + this.tailType;
  438. },
  439. get describeDick() {
  440. state = "";
  441. if (!this.arousalEnabled) {
  442. state = "limp";
  443. } else if (this.orgasm) {
  444. state = "spurting";
  445. } else {
  446. if (this.arousal < 25) {
  447. state = "limp";
  448. } else if (this.arousal < 75) {
  449. state = "swelling";
  450. } else if (this.arousal < 100) {
  451. state = "erect";
  452. } else if (this.arousal < 150) {
  453. state = "erect, throbbing";
  454. } else if (this.arousal < 200) {
  455. state = "erect, throbbing, pre-soaked";
  456. }
  457. }
  458. return length(this.dickLength, unit, true) + " long " + state + " " + this.dickType;
  459. },
  460. get describeVagina() {
  461. state = "";
  462. if (!this.arousalEnabled) {
  463. state = "unassuming";
  464. } else if (this.orgasm) {
  465. state = "gushing, quivering";
  466. } else {
  467. if (this.arousal < 25) {
  468. state = "unassuming";
  469. } else if (this.arousal < 75) {
  470. state = "moist";
  471. } else if (this.arousal < 100) {
  472. state = "glistening";
  473. } else if (this.arousal < 150) {
  474. state = "dripping";
  475. } else if (this.arousal < 200) {
  476. state = "dripping, quivering";
  477. }
  478. }
  479. return length(this.vaginaLength, unit, true) + " long " + state
  480. },
  481. "growthPoints": 0,
  482. "addGrowthPoints": function(mass) {
  483. this.growthPoints += Math.round(50 * mass / (this.scale*this.scale));
  484. },
  485. // 0 = entirely non-fatal
  486. // 1 = fatal, but not specific
  487. // 2 = gory
  488. "brutality": 1,
  489. "scale": 1,
  490. }
  491. function look()
  492. {
  493. var desc = macro.description;
  494. var line2 = ""
  495. if (macro.height > 1e12)
  496. line2 = "You're pretty much everywhere at once.";
  497. else if (macro.height > 1e6)
  498. line2 = "You're standing...on pretty much everything at once.";
  499. else
  500. switch(biome) {
  501. case "rural": line2 = "You're standing amongst rural farmhouses and expansive ranches. Cattle are milling about at your feet."; break;
  502. case "suburb": line2 = "You're striding through the winding roads of a suburb."; break;
  503. case "city": line2 = "You're terrorizing the streets of a city. Heavy traffic, worsened by your rampage, is everywhere."; break;
  504. case "downtown": line2 = "You're lurking amongst the skyscrapers of downtown. The streets are packed, and the buildings are practically begging you to knock them over.";
  505. }
  506. desc = desc.concat([newline,line2,newline]);
  507. update(desc);
  508. }
  509. function get_living_prey(sum) {
  510. var total = 0;
  511. for (var key in sum) {
  512. if (sum.hasOwnProperty(key)) {
  513. if (key == "Person" || key == "Cow")
  514. total += sum[key];
  515. }
  516. }
  517. return total;
  518. }
  519. function toggle_auto()
  520. {
  521. strolling = !strolling;
  522. document.getElementById("button-stroll").innerHTML = "Status: " + (strolling ? "Strolling" : "Standing");
  523. if (strolling)
  524. update(["You start walking.",newline]);
  525. else
  526. update(["You stop walking.",newline]);
  527. }
  528. function change_location()
  529. {
  530. switch(biome) {
  531. case "suburb": biome = "city"; break;
  532. case "city": biome = "downtown"; break;
  533. case "downtown": biome = "rural"; break;
  534. case "rural": biome = "suburb"; break;
  535. }
  536. document.getElementById("button-location").innerHTML = "Location: " + biome.charAt(0).toUpperCase() + biome.slice(1);
  537. }
  538. function toggle_units()
  539. {
  540. switch(unit) {
  541. case "metric": unit = "customary"; break;
  542. case "customary": unit = "approx"; break;
  543. case "approx": unit = "metric"; break;
  544. }
  545. document.getElementById("button-units").innerHTML = "Units: " + unit.charAt(0).toUpperCase() + unit.slice(1);
  546. update();
  547. }
  548. function toggle_numbers() {
  549. switch(numbers) {
  550. case "full": numbers="prefix"; break;
  551. case "prefix": numbers="words"; break;
  552. case "words": numbers = "scientific"; break;
  553. case "scientific": numbers = "full"; break;
  554. }
  555. document.getElementById("button-numbers").innerHTML = "Numbers: " + numbers.charAt(0).toUpperCase() + numbers.slice(1);
  556. update();
  557. }
  558. function toggle_verbose()
  559. {
  560. verbose = !verbose;
  561. document.getElementById("button-verbose").innerHTML = (verbose ? "Verbose" : "Simple");
  562. }
  563. function toggle_arousal()
  564. {
  565. macro.arousalEnabled = !macro.arousalEnabled;
  566. document.getElementById("button-arousal").innerHTML = (macro.arousalEnabled ? "Arousal On" : "Arousal Off");
  567. if (macro.arousalEnabled) {
  568. document.getElementById("arousal").style.display = "block";
  569. document.getElementById("edge").style.display = "block";
  570. } else {
  571. document.getElementById("arousal").style.display = "none";
  572. document.getElementById("edge").style.display = "none";
  573. }
  574. macro.orgasm = false;
  575. macro.afterglow = false;
  576. }
  577. function initVictims()
  578. {
  579. return {
  580. "Person": 0,
  581. "Cow": 0,
  582. "Car": 0,
  583. "Bus": 0,
  584. "Tram": 0,
  585. "Motorcycle": 0,
  586. "House": 0,
  587. "Barn": 0,
  588. "Small Skyscraper": 0,
  589. "Large Skyscraper": 0,
  590. "Train": 0,
  591. "Train Car": 0,
  592. "Parking Garage": 0,
  593. "Overpass": 0,
  594. "Town": 0,
  595. "City": 0,
  596. "Continent": 0,
  597. "Planet": 0,
  598. "Star": 0,
  599. "Solar System": 0,
  600. "Galaxy": 0
  601. };
  602. };
  603. // lists out total people
  604. function summarize(sum, fatal = true)
  605. {
  606. var word;
  607. var count = get_living_prey(sum);
  608. if (fatal && macro.brutality > 0)
  609. word = count > 1 ? "kills" : "kill";
  610. else if (!fatal && macro.brutality > 0)
  611. word = "prey";
  612. else
  613. word = count > 1 ? "victims" : "victim";
  614. return "<b>(" + count + " " + word + ")</b>";
  615. }
  616. function getOnePrey(biome,area)
  617. {
  618. var potential = ["Person"];
  619. if (macro.height > 1e12)
  620. potential = ["Planet","Star","Solar System","Galaxy"];
  621. else if (macro.height > 1e6)
  622. potential = ["Town","City","Continent","Planet"];
  623. else
  624. switch(biome) {
  625. case "suburb": potential = ["Person", "Car", "Bus", "Train", "House"]; break;
  626. case "city": potential = ["Person", "Car", "Bus", "Train", "Tram", "House", "Parking Garage"]; break;
  627. case "downtown": potential = ["Person", "Car", "Bus", "Tram", "Small Skyscraper", "Large Skyscraper", "Parking Garage"]; break;
  628. case "rural": potential = ["Person", "Barn", "House", "Cow"]; break;
  629. }
  630. var potAreas = []
  631. potential.forEach(function (x) {
  632. potAreas.push([x,areas[x]]);
  633. });
  634. potAreas = potAreas.sort(function (x,y) {
  635. return y[1] - x[1];
  636. });
  637. for (var i=0; i<potAreas.length; i++) {
  638. x = potAreas[i];
  639. if (x[1] < area) {
  640. return new Container([new things[x[0]](1)]);
  641. }
  642. };
  643. return new Container([new Person(1)]);
  644. }
  645. function getPrey(region, area)
  646. {
  647. var weights = {"Person": 1};
  648. if (macro.height > 1e12) {
  649. weights = {
  650. "Planet": 1.47e-10,
  651. "Star": 1.7713746e-12,
  652. "Solar System": 4e-10,
  653. "Galaxy": 0.1,
  654. }
  655. }
  656. else if (macro.height > 1e6) {
  657. weights = {
  658. "Town": 0.1,
  659. "City": 0.05,
  660. "Continent": 0.005,
  661. "Planet": 0.0001
  662. }
  663. }
  664. else {
  665. switch(region)
  666. {
  667. case "rural": weights = {
  668. "Person": 0.05,
  669. "House": 0.01,
  670. "Barn": 0.01,
  671. "Cow": 0.2
  672. }; break;
  673. case "suburb": weights = {
  674. "Person": 0.5,
  675. "House": 0.5,
  676. "Car": 0.2,
  677. "Train": 0.1,
  678. "Bus": 0.1
  679. }; break;
  680. case "city": weights = {
  681. "Person": 0.5,
  682. "House": 0.2,
  683. "Car": 0.2,
  684. "Train": 0.1,
  685. "Bus": 0.1,
  686. "Tram": 0.1,
  687. "Parking Garage": 0.02
  688. }; break;
  689. case "downtown": weights = {
  690. "Person": 0.5,
  691. "Car": 0.3,
  692. "Bus": 0.15,
  693. "Tram": 0.1,
  694. "Parking Garage": 0.02,
  695. "Small Skyscraper": 0.4,
  696. "Large Skyscraper": 0.1
  697. }; break;
  698. }
  699. }
  700. return fill_area(area,weights);
  701. }
  702. function updateVictims(type,prey)
  703. {
  704. var sums = prey.sum();
  705. for (var key in sums) {
  706. if (sums.hasOwnProperty(key)) {
  707. victims[type][key] += sums[key];
  708. }
  709. }
  710. }
  711. function feed()
  712. {
  713. var area = macro.handArea;
  714. var prey = getPrey(biome, area);
  715. var line = describe("eat", prey, macro, verbose)
  716. var linesummary = summarize(prey.sum(), false);
  717. var people = get_living_prey(prey.sum());
  718. var sound = "";
  719. if (people == 0) {
  720. sound = "";
  721. } else if (people < 3) {
  722. sound = "Ulp.";
  723. } else if (people < 10) {
  724. sound = "Gulp.";
  725. } else if (people < 50) {
  726. sound = "Glrrp.";
  727. } else if (people < 500) {
  728. sound = "Glrrrpkh!";
  729. } else if (people < 5000) {
  730. sound = "GLRRKPKH!";
  731. } else {
  732. sound = "Oh the humanity!";
  733. }
  734. var preyMass = prey.sum_property("mass");
  735. macro.addGrowthPoints(preyMass);
  736. macro.stomach.feed(prey);
  737. macro.arouse(5);
  738. updateVictims("stomach",prey);
  739. update([sound,line,linesummary,newline]);
  740. }
  741. function stomp()
  742. {
  743. var area = macro.pawArea;
  744. var prey = getPrey(biome, area);
  745. var line = describe("stomp", prey, macro, verbose)
  746. var linesummary = summarize(prey.sum(), true);
  747. var people = get_living_prey(prey.sum());
  748. var sound = "Thump";
  749. if (people < 3) {
  750. sound = "Thump!";
  751. } else if (people < 10) {
  752. sound = "Squish!";
  753. } else if (people < 50) {
  754. sound = "Crunch!";
  755. } else if (people < 500) {
  756. sound = "CRUNCH!";
  757. } else if (people < 5000) {
  758. sound = "CRRUUUNCH!!";
  759. } else {
  760. sound = "Oh the humanity!";
  761. }
  762. var preyMass = prey.sum_property("mass");
  763. macro.addGrowthPoints(preyMass);
  764. macro.arouse(5);
  765. updateVictims("stomped",prey);
  766. update([sound,line,linesummary,newline]);
  767. }
  768. function grind()
  769. {
  770. var area = macro.assArea / 2;
  771. if (macro.maleParts)
  772. area += macro.dickArea
  773. if (macro.femalePartS)
  774. area += macro.vaginaArea;
  775. var prey = getPrey(biome,area);
  776. var line = describe("grind", prey, macro, verbose);
  777. var linesummary = summarize(prey.sum(), true);
  778. var people = get_living_prey(prey.sum());
  779. var sound = "";
  780. if (people < 3) {
  781. sound = "Thump.";
  782. } else if (people < 10) {
  783. sound = "Crunch.";
  784. } else if (people < 50) {
  785. sound = "Crrrrunch.";
  786. } else if (people < 500) {
  787. sound = "SMASH!";
  788. } else if (people < 5000) {
  789. sound = "CCCRASH!!";
  790. } else {
  791. sound = "Oh the humanity!";
  792. }
  793. var preyMass = prey.sum_property("mass");
  794. macro.addGrowthPoints(preyMass);
  795. macro.arouse(20);
  796. updateVictims("ground",prey);
  797. update([sound,line,linesummary,newline]);
  798. }
  799. function anal_vore()
  800. {
  801. var area = macro.analVoreArea;
  802. var prey = getOnePrey(biome,area);
  803. area = macro.assArea;
  804. var crushed = getPrey(biome,area);
  805. var line1 = describe("anal-vore", prey, macro, verbose);
  806. var line1summary = summarize(prey.sum(), false);
  807. var line2 = describe("ass-crush", crushed, macro, verbose);
  808. var line2summary = summarize(crushed.sum(), true);
  809. var people = get_living_prey(prey.sum());
  810. var sound = "Shlp";
  811. if (people < 3) {
  812. sound = "Shlp.";
  813. } else if (people < 10) {
  814. sound = "Squelch.";
  815. } else if (people < 50) {
  816. sound = "Shlurrp.";
  817. } else if (people < 500) {
  818. sound = "SHLRP!";
  819. } else if (people < 5000) {
  820. sound = "SQLCH!!";
  821. } else {
  822. sound = "Oh the humanity!";
  823. }
  824. var people = get_living_prey(crushed.sum());
  825. var sound2 = "Thump";
  826. if (people < 3) {
  827. sound2 = "Thump!";
  828. } else if (people < 10) {
  829. sound2 = "Squish!";
  830. } else if (people < 50) {
  831. sound2 = "Crunch!";
  832. } else if (people < 500) {
  833. sound2 = "CRUNCH!";
  834. } else if (people < 5000) {
  835. sound2 = "CRRUUUNCH!!";
  836. } else {
  837. sound2 = "Oh the humanity!";
  838. }
  839. var preyMass = prey.sum_property("mass");
  840. var crushedMass = prey.sum_property("mass");
  841. macro.addGrowthPoints(preyMass);
  842. macro.addGrowthPoints(crushedMass);
  843. macro.bowels.feed(prey);
  844. macro.arouse(10);
  845. updateVictims("bowels",prey);
  846. updateVictims("stomped",crushed);
  847. update([sound,line1,line1summary,newline,sound2,line2,line2summary,newline]);
  848. }
  849. function breast_crush()
  850. {
  851. var area = macro.breastArea;
  852. var prey = getPrey(biome, area);
  853. var line = describe("breast-crush", prey, macro, verbose);
  854. var linesummary = summarize(prey.sum(), true);
  855. var people = get_living_prey(prey.sum());
  856. var sound = "Thump";
  857. if (people < 3) {
  858. sound = "Thump!";
  859. } else if (people < 10) {
  860. sound = "Squish!";
  861. } else if (people < 50) {
  862. sound = "Crunch!";
  863. } else if (people < 500) {
  864. sound = "CRUNCH!";
  865. } else if (people < 5000) {
  866. sound = "CRRUUUNCH!!";
  867. } else {
  868. sound = "Oh the humanity!";
  869. }
  870. var preyMass = prey.sum_property("mass");
  871. macro.addGrowthPoints(preyMass);
  872. macro.arouse(10);
  873. updateVictims("breasts",prey);
  874. update([sound,line,linesummary,newline]);
  875. if (macro.lactationEnabled && macro.milkStorage.amount / macro.milkStorage.limit > 0.5) {
  876. var amount = Math.min(macro.lactationVolume, (macro.milkStorage.amount / macro.milkStorage.limit - 0.5) * macro.milkStorage.limit);
  877. milk_breasts(null, amount);
  878. }
  879. }
  880. function milk_breasts(e,vol)
  881. {
  882. if (vol == undefined) {
  883. var vol = Math.min(macro.lactationVolume, macro.milkStorage.amount);
  884. }
  885. macro.milkStorage.amount -= vol;
  886. var area = Math.pow(vol, 2/3);
  887. var prey = getPrey(biome, area);
  888. var line = describe("breast-milk", prey, macro, verbose).replace("$VOLUME",volume(vol,unit,false))
  889. var linesummary = summarize(prey.sum(), true);
  890. var people = get_living_prey(prey.sum());
  891. var sound = "Dribble.";
  892. if (people < 3) {
  893. sound = "Dribble.";
  894. } else if (people < 10) {
  895. sound = "Splash.";
  896. } else if (people < 50) {
  897. sound = "Splash!";
  898. } else if (people < 500) {
  899. sound = "SPLOOSH!";
  900. } else if (people < 5000) {
  901. sound = "SPLOOOOOOOOOOSH!!";
  902. } else {
  903. sound = "Oh the humanity!";
  904. }
  905. var preyMass = prey.sum_property("mass");
  906. macro.addGrowthPoints(preyMass);
  907. updateVictims("flooded",prey);
  908. update([sound,line,linesummary,newline]);
  909. }
  910. function unbirth()
  911. {
  912. var area = macro.vaginaArea;
  913. var prey = getPrey(biome, area);
  914. var line = describe("unbirth", prey, macro, verbose)
  915. var linesummary = summarize(prey.sum(), false);
  916. var people = get_living_prey(prey.sum());
  917. var sound = "";
  918. if (people < 3) {
  919. sound = "Shlp.";
  920. } else if (people < 10) {
  921. sound = "Squelch.";
  922. } else if (people < 50) {
  923. sound = "Shlurrp.";
  924. } else if (people < 500) {
  925. sound = "SHLRP!";
  926. } else if (people < 5000) {
  927. sound = "SQLCH!!";
  928. } else {
  929. sound = "Oh the humanity!";
  930. }
  931. var preyMass = prey.sum_property("mass");
  932. macro.addGrowthPoints(preyMass);
  933. macro.womb.feed(prey);
  934. macro.arouse(20);
  935. updateVictims("womb",prey);
  936. update([sound,line,linesummary,newline]);
  937. }
  938. function cockslap()
  939. {
  940. var area = macro.dickArea;
  941. var prey = getPrey(biome, area);
  942. var line = describe("cockslap", prey, macro, verbose)
  943. var linesummary = summarize(prey.sum(), true);
  944. var people = get_living_prey(prey.sum());
  945. var sound = "Thump";
  946. if (people < 3) {
  947. sound = "Thump!";
  948. } else if (people < 10) {
  949. sound = "Squish!";
  950. } else if (people < 50) {
  951. sound = "Crunch!";
  952. } else if (people < 500) {
  953. sound = "CRUNCH!";
  954. } else if (people < 5000) {
  955. sound = "CRRUUUNCH!!";
  956. } else {
  957. sound = "Oh the humanity!";
  958. }
  959. var preyMass = prey.sum_property("mass");
  960. macro.addGrowthPoints(preyMass);
  961. macro.arouse(15);
  962. updateVictims("cock",prey);
  963. update([sound,line,linesummary,newline]);
  964. }
  965. function cock_vore()
  966. {
  967. var area = macro.dickGirth;
  968. var prey = getPrey(biome, area);
  969. var line = describe("cock-vore", prey, macro, verbose)
  970. var linesummary = summarize(prey.sum(), false);
  971. var people = get_living_prey(prey.sum());
  972. var sound = "lp";
  973. if (people < 3) {
  974. sound = "Shlp.";
  975. } else if (people < 10) {
  976. sound = "Squelch.";
  977. } else if (people < 50) {
  978. sound = "Shlurrp.";
  979. } else if (people < 500) {
  980. sound = "SHLRP!";
  981. } else if (people < 5000) {
  982. sound = "SQLCH!!";
  983. } else {
  984. sound = "Oh the humanity!";
  985. }
  986. var preyMass = prey.sum_property("mass");
  987. macro.addGrowthPoints(preyMass);
  988. macro.balls.feed(prey);
  989. macro.arouse(20);
  990. updateVictims("balls",prey);
  991. update([sound,line,linesummary,newline]);
  992. }
  993. function ball_smother()
  994. {
  995. var area = macro.ballArea * 2;
  996. var prey = getPrey(biome, area);
  997. var line = describe("ball-smother", prey, macro, verbose)
  998. var linesummary = summarize(prey.sum(), true);
  999. var people = get_living_prey(prey.sum());
  1000. var sound = "Thump";
  1001. if (people < 3) {
  1002. sound = "Thump!";
  1003. } else if (people < 10) {
  1004. sound = "Squish!";
  1005. } else if (people < 50) {
  1006. sound = "Smoosh!";
  1007. } else if (people < 500) {
  1008. sound = "SMOOSH!";
  1009. } else if (people < 5000) {
  1010. sound = "SMOOOOOSH!!";
  1011. } else {
  1012. sound = "Oh the humanity!";
  1013. }
  1014. var preyMass = prey.sum_property("mass");
  1015. macro.addGrowthPoints(preyMass);
  1016. macro.arouse(10);
  1017. updateVictims("balls",prey);
  1018. update([sound,line,linesummary,newline]);
  1019. }
  1020. function male_spurt(vol)
  1021. {
  1022. var area = Math.pow(vol, 2/3);
  1023. var prey = getPrey(biome, area);
  1024. var line = describe("male-spurt", prey, macro, verbose).replace("$VOLUME",volume(vol,unit,false))
  1025. var linesummary = summarize(prey.sum(), true);
  1026. var people = get_living_prey(prey.sum());
  1027. var sound = "Spurt!";
  1028. if (people < 3) {
  1029. sound = "Spurt!";
  1030. } else if (people < 10) {
  1031. sound = "Sploosh!";
  1032. } else if (people < 50) {
  1033. sound = "Sploooooosh!";
  1034. } else if (people < 500) {
  1035. sound = "SPLOOSH!";
  1036. } else if (people < 5000) {
  1037. sound = "SPLOOOOOOOOOOSH!!";
  1038. } else {
  1039. sound = "Oh the humanity!";
  1040. }
  1041. var preyMass = prey.sum_property("mass");
  1042. macro.addGrowthPoints(preyMass);
  1043. updateVictims("splooged",prey);
  1044. update([sound,line,linesummary,newline]);
  1045. }
  1046. function male_orgasm(vol)
  1047. {
  1048. var area = Math.pow(vol, 2/3);
  1049. var prey = getPrey(biome, area);
  1050. var line = describe("male-orgasm", prey, macro, verbose).replace("$VOLUME",volume(vol,unit,false))
  1051. var linesummary = summarize(prey.sum(), true);
  1052. var people = get_living_prey(prey.sum());
  1053. var sound = "Spurt!";
  1054. if (people < 3) {
  1055. sound = "Spurt!";
  1056. } else if (people < 10) {
  1057. sound = "Sploosh!";
  1058. } else if (people < 50) {
  1059. sound = "Sploooooosh!";
  1060. } else if (people < 500) {
  1061. sound = "SPLOOSH!";
  1062. } else if (people < 5000) {
  1063. sound = "SPLOOOOOOOOOOSH!!";
  1064. } else {
  1065. sound = "Oh the humanity!";
  1066. }
  1067. var preyMass = prey.sum_property("mass");
  1068. macro.addGrowthPoints(preyMass);
  1069. updateVictims("splooged",prey);
  1070. update([sound,line,linesummary,newline]);
  1071. }
  1072. function female_spurt(vol)
  1073. {
  1074. var area = Math.pow(vol, 2/3);
  1075. var prey = getPrey(biome, area);
  1076. var line = describe("female-spurt", prey, macro, verbose).replace("$VOLUME",volume(vol,unit,false))
  1077. var linesummary = summarize(prey.sum(), true);
  1078. var people = get_living_prey(prey.sum());
  1079. var sound = "Spurt!";
  1080. if (people < 3) {
  1081. sound = "Spurt!";
  1082. } else if (people < 10) {
  1083. sound = "Sploosh!";
  1084. } else if (people < 50) {
  1085. sound = "Sploooooosh!";
  1086. } else if (people < 500) {
  1087. sound = "SPLOOSH!";
  1088. } else if (people < 5000) {
  1089. sound = "SPLOOOOOOOOOOSH!!";
  1090. } else {
  1091. sound = "Oh the humanity!";
  1092. }
  1093. var preyMass = prey.sum_property("mass");
  1094. macro.addGrowthPoints(preyMass);
  1095. updateVictims("splooged",prey);
  1096. update([sound,line,linesummary,newline]);
  1097. }
  1098. function female_orgasm(vol)
  1099. {
  1100. var area = Math.pow(vol, 2/3);
  1101. var prey = getPrey(biome, area);
  1102. var line = describe("female-orgasm", prey, macro, verbose).replace("$VOLUME",volume(vol,unit,false));
  1103. var linesummary = summarize(prey.sum(), true);
  1104. var people = get_living_prey(prey.sum());
  1105. var sound = "Spurt!";
  1106. if (people < 3) {
  1107. sound = "Spurt!";
  1108. } else if (people < 10) {
  1109. sound = "Sploosh!";
  1110. } else if (people < 50) {
  1111. sound = "Sploooooosh!";
  1112. } else if (people < 500) {
  1113. sound = "SPLOOSH!";
  1114. } else if (people < 5000) {
  1115. sound = "SPLOOOOOOOOOOSH!!";
  1116. } else {
  1117. sound = "Oh the humanity!";
  1118. }
  1119. var preyMass = prey.sum_property("mass");
  1120. macro.addGrowthPoints(preyMass);
  1121. updateVictims("splooged",prey);
  1122. update([sound,line,linesummary,newline]);
  1123. }
  1124. function tail_slap()
  1125. {
  1126. var area = macro.tailArea * macro.tailCount;
  1127. var prey = getPrey(biome, area);
  1128. var line = describe("tail-slap", prey, macro, verbose)
  1129. var linesummary = summarize(prey.sum(), true);
  1130. var people = get_living_prey(prey.sum());
  1131. var sound = "Thump";
  1132. if (people < 3) {
  1133. sound = "Thump!";
  1134. } else if (people < 10) {
  1135. sound = "Squish!";
  1136. } else if (people < 50) {
  1137. sound = "Crunch!";
  1138. } else if (people < 500) {
  1139. sound = "CRUNCH!";
  1140. } else if (people < 5000) {
  1141. sound = "CRRUUUNCH!!";
  1142. } else {
  1143. sound = "Oh the humanity!";
  1144. }
  1145. var preyMass = prey.sum_property("mass");
  1146. macro.addGrowthPoints(preyMass);
  1147. macro.arouse(5);
  1148. updateVictims("tailslapped",prey);
  1149. update([sound,line,linesummary,newline]);
  1150. }
  1151. function tail_vore()
  1152. {
  1153. var area = macro.tailGirth * macro.tailCount;
  1154. var prey = getPrey(biome, area);
  1155. var line = describe("tail-vore", prey, macro, verbose)
  1156. var linesummary = summarize(prey.sum(), false);
  1157. var people = get_living_prey(prey.sum());
  1158. var sound = "";
  1159. if (people == 0) {
  1160. sound = "";
  1161. } else if (people < 3) {
  1162. sound = "Ulp.";
  1163. } else if (people < 10) {
  1164. sound = "Gulp.";
  1165. } else if (people < 50) {
  1166. sound = "Glrrp.";
  1167. } else if (people < 500) {
  1168. sound = "Glrrrpkh!";
  1169. } else if (people < 5000) {
  1170. sound = "GLRRKPKH!";
  1171. } else {
  1172. sound = "Oh the humanity!";
  1173. }
  1174. var preyMass = prey.sum_property("mass");
  1175. macro.addGrowthPoints(preyMass);
  1176. macro.arouse(5);
  1177. macro.stomach.feed(prey);
  1178. updateVictims("tailmaw'd",prey);
  1179. update([sound,line,linesummary,newline]);
  1180. }
  1181. function transformNumbers(line)
  1182. {
  1183. return line.toString().replace(/[0-9]+(\.[0-9]+)?(e\+[0-9]+)?/g, function(text) { return number(text, numbers); });
  1184. }
  1185. function update(lines = [])
  1186. {
  1187. var log = document.getElementById("log");
  1188. lines.forEach(function (x) {
  1189. var line = document.createElement('div');
  1190. line.innerHTML = transformNumbers(x);
  1191. log.appendChild(line);
  1192. });
  1193. if (lines.length > 0)
  1194. log.scrollTop = log.scrollHeight;
  1195. document.getElementById("height").innerHTML = "Height: " + transformNumbers(length(macro.height, unit));
  1196. document.getElementById("mass").innerHTML = "Mass: " + transformNumbers(mass(macro.mass, unit));
  1197. document.getElementById("growth-points").innerHTML = "Growth Points:" + macro.growthPoints;
  1198. document.getElementById("arousal").innerHTML = "Arousal: " + round(macro.arousal,0) + "%";
  1199. document.getElementById("edge").innerHTML = "Edge: " + round(macro.edge * 100,0) + "%";
  1200. document.getElementById("cum").innerHTML = "Cum: " + transformNumbers(volume(macro.cumStorage.amount,unit,false))
  1201. document.getElementById("cumPercent").innerHTML = Math.round(macro.cumStorage.amount / macro.cumStorage.limit * 100) + "%";
  1202. document.getElementById("femcum").innerHTML = "Femcum: " + transformNumbers(volume(macro.femcumStorage.amount,unit,false));
  1203. document.getElementById("femcumPercent").innerHTML = Math.round(macro.femcumStorage.amount / macro.femcumStorage.limit * 100) + "%";
  1204. document.getElementById("milk").innerHTML = "Milk: " + transformNumbers(volume(macro.milkStorage.amount,unit,false));
  1205. document.getElementById("milkPercent").innerHTML = Math.round(macro.milkStorage.amount / macro.milkStorage.limit * 100) + "%";
  1206. for (var type in victims) {
  1207. if (victims.hasOwnProperty(type)) {
  1208. for (var key in victims[type]){
  1209. if (victims[type].hasOwnProperty(key) && victims[type][key] > 0) {
  1210. document.getElementById("stat-" + key).style.display = "table-row";
  1211. document.getElementById("stat-" + type + "-" + key).innerHTML = number(victims[type][key],numbers);
  1212. }
  1213. }
  1214. }
  1215. }
  1216. }
  1217. function pick_move()
  1218. {
  1219. if (!strolling) {
  1220. setTimeout(pick_move, 1500 * Math.sqrt(macro.scale));
  1221. return;
  1222. }
  1223. var choice = Math.random();
  1224. if (choice < 0.2) {
  1225. anal_vore();
  1226. } else if (choice < 0.6) {
  1227. stomp();
  1228. } else {
  1229. feed();
  1230. }
  1231. setTimeout(pick_move, 1500 * Math.sqrt(macro.scale));
  1232. }
  1233. function grow_pick(times) {
  1234. if (document.getElementById("part-body").checked == true) {
  1235. grow(times);
  1236. }
  1237. else if (document.getElementById("part-ass").checked == true) {
  1238. grow_ass(times);
  1239. }
  1240. else if (document.getElementById("part-dick").checked == true) {
  1241. grow_dick(times);
  1242. }
  1243. else if (document.getElementById("part-balls").checked == true) {
  1244. grow_balls(times);
  1245. }
  1246. else if (document.getElementById("part-breasts").checked == true) {
  1247. grow_breasts(times);
  1248. }
  1249. else if (document.getElementById("part-vagina").checked == true) {
  1250. grow_vagina(times);
  1251. }
  1252. }
  1253. function grow(times=1)
  1254. {
  1255. if (macro.growthPoints < 100 * times) {
  1256. update(["You don't feel like growing right now."]);
  1257. return;
  1258. }
  1259. macro.growthPoints -= 100 * times;
  1260. var oldHeight = macro.height;
  1261. var oldMass = macro.mass;
  1262. macro.scale *= Math.pow(1.02,times);
  1263. var newHeight = macro.height;
  1264. var newMass = macro.mass;
  1265. var heightDelta = newHeight - oldHeight;
  1266. var massDelta = newMass - oldMass;
  1267. var heightStr = length(heightDelta, unit);
  1268. var massStr = mass(massDelta, unit);
  1269. update(["Power surges through you as you grow " + heightStr + " taller and gain " + massStr + " of mass",newline]);
  1270. }
  1271. function grow_dick(times=1)
  1272. {
  1273. if (macro.growthPoints < 10 * times) {
  1274. update(["You don't feel like growing right now."]);
  1275. return;
  1276. }
  1277. macro.growthPoints -= 10 * times;
  1278. var oldLength = macro.dickLength;
  1279. var oldMass = macro.dickMass;
  1280. macro.dickScale = Math.pow(macro.dickScale * macro.dickScale + 1.02*times, 1/2) ;
  1281. var lengthDelta = macro.dickLength - oldLength;
  1282. var massDelta = macro.dickMass - oldMass;
  1283. update(["Power surges through you as your " + macro.dickType + " cock grows " + length(lengthDelta, unit, false) + " longer and gains " + mass(massDelta, unit, false) + " of mass",newline]);
  1284. }
  1285. function grow_balls(times=1)
  1286. {
  1287. if (macro.growthPoints < 10 * times) {
  1288. update(["You don't feel like growing right now."]);
  1289. return;
  1290. }
  1291. macro.growthPoints -= 10 * times;
  1292. var oldDiameter = macro.ballDiameter;
  1293. var oldMass = macro.ballMass;
  1294. macro.ballScale = Math.pow(macro.ballScale * macro.ballScale + 1.02*times, 1/2) ;
  1295. var diameterDelta = macro.ballDiameter - oldDiameter;
  1296. var massDelta = macro.ballMass - oldMass;
  1297. update(["Power surges through you as your balls swell by " + length(diameterDelta, unit, false) + ", gaining " + mass(massDelta, unit, false) + " of mass apiece",newline]);
  1298. }
  1299. function grow_breasts(times=1)
  1300. {
  1301. if (macro.growthPoints < 10 * times) {
  1302. update(["You don't feel like growing right now."]);
  1303. return;
  1304. }
  1305. macro.growthPoints -= 10 * times;
  1306. var oldDiameter = macro.breastDiameter;
  1307. var oldMass = macro.breastMass;
  1308. macro.breastScale = Math.pow(macro.breastScale * macro.breastScale + 1.02*times, 1/2) ;
  1309. var diameterDelta = macro.breastDiameter - oldDiameter;
  1310. var massDelta = macro.breastMass - oldMass;
  1311. update(["Power surges through you as your breasts swell by " + length(diameterDelta, unit, false) + ", gaining " + mass(massDelta, unit, false) + " of mass apiece",newline]);
  1312. }
  1313. function grow_vagina(times=1)
  1314. {
  1315. if (macro.growthPoints < 10 * times) {
  1316. update(["You don't feel like growing right now."]);
  1317. return;
  1318. }
  1319. macro.growthPoints -= 10 * times;
  1320. var oldLength = macro.vaginaLength;
  1321. macro.vaginaScale = Math.pow(macro.vaginaScale * macro.vaginaScale + 1.02*times, 1/2) ;
  1322. var lengthDelta = macro.vaginaLength - oldLength;
  1323. update(["Power surges through you as your moist slit expands by by " + length(lengthDelta, unit, false),newline]);
  1324. }
  1325. function grow_ass(times=1)
  1326. {
  1327. if (macro.growthPoints < 10 * times) {
  1328. update(["You don't feel like growing right now."]);
  1329. return;
  1330. }
  1331. macro.growthPoints -= 10 * times;
  1332. var oldDiameter = Math.pow(macro.assArea,1/2);
  1333. macro.assScale = Math.pow(macro.assScale * macro.assScale + 1.02*times, 1/2) ;
  1334. var diameterDelta = Math.pow(macro.assArea,1/2) - oldDiameter;
  1335. update(["Power surges through you as your ass swells by " + length(diameterDelta, unit, false),newline]);
  1336. }
  1337. function grow_lots()
  1338. {
  1339. var oldHeight = macro.height;
  1340. var oldMass = macro.mass;
  1341. macro.scale *= 100;
  1342. var newHeight = macro.height;
  1343. var newMass = macro.mass;
  1344. var heightDelta = newHeight - oldHeight;
  1345. var massDelta = newMass - oldMass;
  1346. var heightStr = length(heightDelta, unit);
  1347. var massStr = mass(massDelta, unit);
  1348. update(["Power surges through you as you grow " + heightStr + " taller and gain " + massStr + " of mass",newline]);
  1349. }
  1350. function preset(name) {
  1351. switch(name){
  1352. case "Fen":
  1353. macro.species = "crux";
  1354. macro.baseHeight = 2.2606;
  1355. macro.baseMass = 124.738;
  1356. break;
  1357. case "Renard":
  1358. macro.species = "fox";
  1359. macro.baseHeight = 1.549;
  1360. macro.baseMass = 83.9;
  1361. case "Vulpes":
  1362. macro.species = "fox";
  1363. macro.baseHeight = 20000;
  1364. macro.baseMass = 180591661866272;
  1365. }
  1366. }
  1367. function saveSettings() {
  1368. storage = window.localStorage;
  1369. settings = {};
  1370. form = document.forms.namedItem("custom-species-form");
  1371. for (var i=0; i<form.length; i++) {
  1372. if (form[i].value != "") {
  1373. if (form[i].type == "text")
  1374. settings[form[i].name] = form[i].value;
  1375. else if (form[i].type == "number")
  1376. settings[form[i].name] = parseFloat(form[i].value);
  1377. else if (form[i].type == "checkbox") {
  1378. settings[form[i].name] = form[i].checked;
  1379. } else if (form[i].type == "radio") {
  1380. let name = form[i].name.match(/(?:[a-zA-Z]+-)*[a-zA-Z]+/)[0];
  1381. if (form[i].checked)
  1382. settings[name] = form[i].id
  1383. }
  1384. }
  1385. }
  1386. storage.setItem('settings',JSON.stringify(settings));
  1387. }
  1388. function loadSettings() {
  1389. if (window.localStorage.getItem('settings') == null)
  1390. return;
  1391. storage = window.localStorage;
  1392. settings = JSON.parse(storage.getItem('settings'));
  1393. form = document.forms.namedItem("custom-species-form");
  1394. for (var i=0; i<form.length; i++) {
  1395. if (settings[form[i].name] != undefined) {
  1396. if (form[i].type == "text")
  1397. form[i].value = settings[form[i].name];
  1398. else if (form[i].type == "number")
  1399. form[i].value = settings[form[i].name];
  1400. else if (form[i].type == "checkbox") {
  1401. form[i].checked = settings[form[i].name];
  1402. } else if (form[i].type == "radio") {
  1403. let name = form[i].name.match(/(?:[a-zA-Z]+-)*[a-zA-Z]+/)[0];
  1404. form[i].checked = (settings[name] == form[i].id);
  1405. }
  1406. }
  1407. }
  1408. }
  1409. function startGame(e) {
  1410. form = document.forms.namedItem("custom-species-form");
  1411. for (var i=0; i<form.length; i++) {
  1412. if (form[i].value != "") {
  1413. if (form[i].type == "text")
  1414. macro[form[i].name] = form[i].value;
  1415. else if (form[i].type == "number")
  1416. macro[form[i].name] = parseFloat(form[i].value);
  1417. else if (form[i].type == "checkbox") {
  1418. if (form[i].name == "humanMode")
  1419. humanMode = form[i].checked;
  1420. else
  1421. macro[form[i].name] = form[i].checked;
  1422. } else if (form[i].type == "radio") {
  1423. if (form[i].checked) {
  1424. switch(form[i].id) {
  1425. case "brutality-0": macro.brutality = 0; break;
  1426. case "brutality-1": macro.brutality = 1; break;
  1427. case "brutality-2": macro.brutality = 2; break;
  1428. }
  1429. }
  1430. }
  1431. }
  1432. }
  1433. if (!macro.hasTail) {
  1434. macro.tailCount = 0;
  1435. }
  1436. document.getElementById("log-area").style.display = 'inline';
  1437. document.getElementById("option-panel").style.display = 'none';
  1438. document.getElementById("action-panel").style.display = 'flex';
  1439. victimTypes = ["stomped","digested","stomach","bowels","ground"];
  1440. if (macro.tailCount > 0) {
  1441. victimTypes = victimTypes.concat(["tailslapped"]);
  1442. if (macro.tailMaw) {
  1443. victimTypes = victimTypes.concat(["tailmaw'd"]);
  1444. } else {
  1445. document.getElementById("button-tail_vore").style.display = 'none';
  1446. }
  1447. } else {
  1448. document.getElementById("button-tail_slap").style.display = 'none';
  1449. document.getElementById("button-tail_vore").style.display = 'none';
  1450. }
  1451. if (macro.maleParts) {
  1452. victimTypes = victimTypes.concat(["cock","balls"]);
  1453. } else {
  1454. document.getElementById("button-cockslap").style.display = 'none';
  1455. document.getElementById("button-cock_vore").style.display = 'none';
  1456. document.getElementById("button-ball_smother").style.display = 'none';
  1457. document.getElementById("cum").style.display = 'none';
  1458. document.getElementById("cumPercent").style.display = 'none';
  1459. document.querySelector("#part-balls+label").style.display = 'none';
  1460. document.querySelector("#part-dick+label").style.display = 'none';
  1461. }
  1462. if (macro.femaleParts) {
  1463. victimTypes = victimTypes.concat(["womb"]);
  1464. } else {
  1465. document.getElementById("button-unbirth").style.display = 'none';
  1466. document.getElementById("femcum").style.display = 'none';
  1467. document.getElementById("femcumPercent").style.display = 'none';
  1468. document.querySelector("#part-vagina+label").style.display = 'none';
  1469. }
  1470. if (macro.hasBreasts) {
  1471. victimTypes = victimTypes.concat(["breasts"]);
  1472. if (macro.lactationEnabled) {
  1473. victimTypes = victimTypes.concat(["flooded"]);
  1474. } else {
  1475. document.getElementById("button-breast_milk").style.display = 'none';
  1476. document.getElementById("milk").style.display = 'none';
  1477. document.getElementById("milkPercent").style.display = 'none';
  1478. }
  1479. } else {
  1480. document.getElementById("button-breast_milk").style.display = 'none';
  1481. document.getElementById("milk").style.display = 'none';
  1482. document.getElementById("milkPercent").style.display = 'none';
  1483. document.getElementById("button-breast_crush").style.display = 'none';
  1484. document.querySelector("#part-breasts+label").style.display = 'none';
  1485. }
  1486. if (macro.maleParts || macro.femaleParts) {
  1487. victimTypes.push("splooged");
  1488. }
  1489. var table = document.getElementById("victim-table");
  1490. var tr = document.createElement('tr');
  1491. var th = document.createElement('th');
  1492. th.innerHTML = "Method";
  1493. tr.appendChild(th);
  1494. for (var i = 0; i < victimTypes.length; i++) {
  1495. var th = document.createElement('th');
  1496. th.classList.add("victim-table-cell");
  1497. th.innerHTML = victimTypes[i].charAt(0).toUpperCase() + victimTypes[i].slice(1);
  1498. tr.appendChild(th);
  1499. }
  1500. table.appendChild(tr);
  1501. for (var key in things) {
  1502. if (things.hasOwnProperty(key) && key != "Container") {
  1503. var tr = document.createElement('tr');
  1504. tr.id = "stat-" + key;
  1505. tr.style.display = "none";
  1506. var th = document.createElement('th');
  1507. th.innerHTML = key;
  1508. tr.appendChild(th);
  1509. for (var i = 0; i < victimTypes.length; i++) {
  1510. var th = document.createElement('th');
  1511. th.innerHTML = 0;
  1512. th.id = "stat-" + victimTypes[i] + "-" + key;
  1513. tr.appendChild(th);
  1514. }
  1515. table.appendChild(tr);
  1516. }
  1517. }
  1518. document.getElementById("button-arousal").innerHTML = (macro.arousalEnabled ? "Arousal On" : "Arousal Off");
  1519. if (!macro.arousalEnabled) {
  1520. document.getElementById("arousal").style.display = "none";
  1521. document.getElementById("edge").style.display = "none";
  1522. }
  1523. //var species = document.getElementById("option-species").value;
  1524. //var re = /^[a-zA-Z\- ]+$/;
  1525. // tricksy tricksy players
  1526. //if (re.test(species)) {
  1527. // macro.species = species;
  1528. //}
  1529. macro.init();
  1530. update();
  1531. document.getElementById("stat-container").style.display = 'flex';
  1532. }
  1533. window.addEventListener('load', function(event) {
  1534. victims["stomped"] = initVictims();
  1535. victims["tailslapped"] = initVictims();
  1536. victims["tailmaw'd"] = initVictims();
  1537. victims["bowels"] = initVictims();
  1538. victims["digested"] = initVictims();
  1539. victims["stomach"] = initVictims();
  1540. victims["breasts"] = initVictims();
  1541. victims["flooded"] = initVictims();
  1542. victims["womb"] = initVictims();
  1543. victims["cock"] = initVictims();
  1544. victims["balls"] = initVictims();
  1545. victims["smothered"] = initVictims();
  1546. victims["splooged"] = initVictims();
  1547. victims["ground"] = initVictims();
  1548. document.getElementById("button-look").addEventListener("click",look);
  1549. document.getElementById("button-feed").addEventListener("click",feed);
  1550. document.getElementById("button-stomp").addEventListener("click",stomp);
  1551. document.getElementById("button-anal_vore").addEventListener("click",anal_vore);
  1552. document.getElementById("button-tail_slap").addEventListener("click",tail_slap);
  1553. document.getElementById("button-tail_vore").addEventListener("click",tail_vore);
  1554. document.getElementById("button-breast_crush").addEventListener("click",breast_crush);
  1555. document.getElementById("button-breast_milk").addEventListener("click",milk_breasts);
  1556. document.getElementById("button-unbirth").addEventListener("click",unbirth);
  1557. document.getElementById("button-cockslap").addEventListener("click",cockslap);
  1558. document.getElementById("button-cock_vore").addEventListener("click",cock_vore);
  1559. document.getElementById("button-ball_smother").addEventListener("click",ball_smother);
  1560. document.getElementById("button-grind").addEventListener("click",grind);
  1561. document.getElementById("button-stroll").addEventListener("click",toggle_auto);
  1562. document.getElementById("button-location").addEventListener("click",change_location);
  1563. document.getElementById("button-numbers").addEventListener("click",toggle_numbers);
  1564. document.getElementById("button-units").addEventListener("click",toggle_units);
  1565. document.getElementById("button-verbose").addEventListener("click",toggle_verbose);
  1566. document.getElementById("button-arousal").addEventListener("click",toggle_arousal);
  1567. document.getElementById("button-grow-lots").addEventListener("click",grow_lots);
  1568. document.getElementById("button-amount-1").addEventListener("click",function() { grow_pick(1); });
  1569. document.getElementById("button-amount-5").addEventListener("click",function() { grow_pick(5); });
  1570. document.getElementById("button-amount-10").addEventListener("click",function() { grow_pick(10); });
  1571. document.getElementById("button-amount-20").addEventListener("click",function() { grow_pick(20); });
  1572. document.getElementById("button-amount-50").addEventListener("click",function() { grow_pick(50); });
  1573. document.getElementById("button-amount-100").addEventListener("click",function() { grow_pick(100); });
  1574. document.getElementById("button-load-custom").addEventListener("click",loadSettings);
  1575. document.getElementById("button-save-custom").addEventListener("click",saveSettings);
  1576. document.getElementById("button-start").addEventListener("click",startGame);
  1577. setTimeout(pick_move, 2000);
  1578. });