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.
 
 
 

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