big steppy
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 

561 строка
15 KiB

  1. var strolling = false;
  2. var maxStomachDigest = 10;
  3. var maxBowelsDigest = 10;
  4. var unit = "metric";
  5. var verbose = true;
  6. var biome = "suburb";
  7. var newline = " ";
  8. victims = {};
  9. var macro =
  10. {
  11. "scaling": function(value, scale, factor) { return value * Math.pow(scale,factor); },
  12. "species": "crux",
  13. "color" : "blue",
  14. "baseHeight": 2.26,
  15. get height() { return this.scaling(this.baseHeight, this.scale, 1); },
  16. "baseMass": 135,
  17. get mass () { return this.scaling(this.baseMass, this.scale, 3); },
  18. "basePawArea": 0.1,
  19. get pawArea() { return this.scaling(this.basePawArea, this.scale, 2); },
  20. "baseAnalVoreArea": 0.1,
  21. get analVoreArea() { return this.scaling(this.baseAnalVoreArea, this.scale, 2); },
  22. "baseAssArea": 0.4,
  23. get assArea() { return this.scaling(this.baseAssArea, this.scale, 2); },
  24. "baseHandArea": 0.3,
  25. get handArea() { return this.scaling(this.baseHandArea, this.scale, 2); },
  26. "baseDickLength": 0.3048,
  27. "baseDickDiameter": 0.08,
  28. "dickDensity": 1000,
  29. "dickScale": 1,
  30. get dickLength() { return this.scaling(this.baseDickLength * this.dickScale, this.scale, 1); },
  31. get dickDiameter() { return this.scaling(this.baseDickDiameter * this.dickScale, this.scale, 1); },
  32. get dickVolume() {
  33. return this.dickLength * Math.pow(this.dickDiameter/2,2) * Math.PI;
  34. },
  35. get dickMass() {
  36. return this.dickVolume * this.dickDensity;
  37. },
  38. "baseBallDiameter": 0.05,
  39. "ballDensity": 1000,
  40. "ballScale": 1,
  41. get ballDiameter() { return this.scaling(this.baseBallDiameter * this.ballScale, this.scale, 1); },
  42. get ballVolume() {
  43. var radius = this.ballDiameter / 2;
  44. return 4/3 * Math.PI * Math.pow(radius,3);
  45. },
  46. get ballMass() {
  47. var volume = this.ballVolume;
  48. return volume * this.ballDensity;
  49. },
  50. "baseVaginaLength": 0.1,
  51. "baseVaginaWidth": 0.05,
  52. "vaginaScale": 1,
  53. get vaginaLength() { return this.scaling(this.baseVaginaLength * this.vaginaScale, this.scale, 1); },
  54. get vaginaWidth() { return this.scaling(this.baseVaginaWidth * this.vaginaScale, this.scale, 1); },
  55. "baseBreastDiameter": 0.1,
  56. "breastScale": 1,
  57. "breastDensity": 1000,
  58. get breastDiameter() { return this.scaling(this.baseDickLength * this.breastScale, this.scale, 1); },
  59. get breastVolume() {
  60. var radius = this.breastDiameter / 2;
  61. return 4/3 * Math.PI * Math.pow(radius,3);
  62. },
  63. get breastMass() {
  64. var volume = this.breastVolume;
  65. return volume * this.breastDensity;
  66. },
  67. "maleParts": true,
  68. "femaleParts": true,
  69. get description() {
  70. result = [];
  71. line = "You are a " + length(macro.height, unit, true) + " tall " + macro.species + ". You weigh " + mass(macro.mass, unit) + ".";
  72. result.push(line);
  73. if (this.maleParts) {
  74. line = "Your " + length(macro.dickLength, unit, true) + " long dick hangs from your hips, with two " + mass(macro.ballMass, unit, true) + ", " + length(macro.ballDiameter, unit, true) + "-wide balls hanging beneath.";
  75. result.push(line);
  76. }
  77. if (this.femaleParts) {
  78. line = "Your glistening " + length(macro.vaginaLength, unit, true) + " long slit is oozing between your legs."
  79. result.push(line);
  80. line = "You have two " + length(macro.breastDiameter, unit, true) + "-wide breasts that weigh " + mass(macro.breastMass, unit) + " apiece.";
  81. result.push(line);
  82. }
  83. return result;
  84. },
  85. "scale": 3,
  86. "scaleWithMass": function(mass) {
  87. var startMass = this.mass;
  88. var newMass = startMass + mass;
  89. this.scale = Math.pow(newMass / this.baseMass, 1/3);
  90. }
  91. }
  92. function look()
  93. {
  94. var desc = macro.description;
  95. var line2 = ""
  96. switch(biome) {
  97. case "rural": line2 = "You're standing amongst rural farmhouses and expansive ranches. Cattle are milling about at your feet."; break;
  98. case "suburb": line2 = "You're striding through the winding roads of a suburb."; break;
  99. case "city": line2 = "You're terrorizing the streets of a city. Heavy traffic, worsened by your rampage, is everywhere."; break;
  100. 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.";
  101. }
  102. desc = desc.concat([newline,line2,newline]);
  103. update(desc);
  104. }
  105. function get_living_prey(sum) {
  106. var total = 0;
  107. for (var key in sum) {
  108. if (sum.hasOwnProperty(key)) {
  109. if (key == "Person" || key == "Cow")
  110. total += sum[key];
  111. }
  112. }
  113. return total;
  114. }
  115. function toggle_auto()
  116. {
  117. strolling = !strolling;
  118. document.getElementById("button-stroll").innerHTML = "Status: " + (strolling ? "Strolling" : "Standing");
  119. if (strolling)
  120. update(["You start walking.",newline]);
  121. else
  122. update(["You stop walking.",newline]);
  123. }
  124. function change_location()
  125. {
  126. switch(biome) {
  127. case "suburb": biome = "city"; break;
  128. case "city": biome = "downtown"; break;
  129. case "downtown": biome = "rural"; break;
  130. case "rural": biome = "suburb"; break;
  131. }
  132. document.getElementById("button-location").innerHTML = "Location: " + biome.charAt(0).toUpperCase() + biome.slice(1);
  133. }
  134. function toggle_units()
  135. {
  136. switch(unit) {
  137. case "metric": unit = "customary"; break;
  138. case "customary": unit = "approx"; break;
  139. case "approx": unit = "metric"; break;
  140. }
  141. document.getElementById("button-units").innerHTML = "Units: " + unit.charAt(0).toUpperCase() + unit.slice(1);
  142. update();
  143. }
  144. function toggle_verbose()
  145. {
  146. verbose = !verbose;
  147. document.getElementById("button-verbose").innerHTML = "Descriptions: " + (verbose ? "Verbose" : "Simple");
  148. }
  149. function initVictims()
  150. {
  151. return {
  152. "Person": 0,
  153. "Cow": 0,
  154. "Car": 0,
  155. "Bus": 0,
  156. "Tram": 0,
  157. "Motorcycle": 0,
  158. "House": 0,
  159. "Barn": 0,
  160. "Small Skyscraper": 0,
  161. "Train": 0,
  162. "Train Car": 0,
  163. "Parking Garage": 0,
  164. "Overpass": 0,
  165. };
  166. };
  167. // lists out total people
  168. function summarize(sum, fatal = true)
  169. {
  170. var count = get_living_prey(sum);
  171. return "<b>(" + count + " " + (fatal ? (count > 1 ? "kills" : "kill") : (count > 1 ? "prey" : "prey")) + ")</b>";
  172. }
  173. var stomach = []
  174. var bowels = []
  175. function getOnePrey(biome,area)
  176. {
  177. var potential = ["Person"];
  178. switch(biome) {
  179. case "suburb": potential = ["Person", "Car", "Bus", "Train", "House"]; break;
  180. case "city": potential = ["Person", "Car", "Bus", "Train", "Tram", "House", "Parking Garage"]; break;
  181. case "downtown": potential = ["Person", "Car", "Bus", "Tram", "Small Skyscraper", "Parking Garage"]; break;
  182. case "rural": potential = ["Person", "Barn", "House", "Cow"]; break;
  183. }
  184. var potAreas = []
  185. potential.forEach(function (x) {
  186. potAreas.push([x,areas[x]]);
  187. });
  188. potAreas = potAreas.sort(function (x,y) {
  189. return y[1] - x[1];
  190. });
  191. for (var i=0; i<potAreas.length; i++) {
  192. x = potAreas[i];
  193. if (x[1] < area) {
  194. return new things[x[0]](1);
  195. }
  196. };
  197. return new Person(1);
  198. }
  199. function getPrey(region, area)
  200. {
  201. var weights = {"Person": 1};
  202. switch(region)
  203. {
  204. case "rural": weights = {
  205. "Person": 0.05,
  206. "House": 0.01,
  207. "Barn": 0.01,
  208. "Cow": 0.2
  209. }; break;
  210. case "suburb": weights = {
  211. "Person": 0.5,
  212. "House": 0.5,
  213. "Car": 0.2,
  214. "Train": 0.1,
  215. "Bus": 0.1
  216. }; break;
  217. case "city": weights = {
  218. "Person": 0.5,
  219. "House": 0.2,
  220. "Car": 0.2,
  221. "Train": 0.1,
  222. "Bus": 0.1,
  223. "Tram": 0.1,
  224. "Parking Garage": 0.02
  225. }; break;
  226. case "downtown": weights = {
  227. "Person": 0.5,
  228. "Car": 0.3,
  229. "Bus": 0.15,
  230. "Tram": 0.1,
  231. "Parking Garage": 0.02,
  232. "Small Skyscraper": 0.4
  233. }; break;
  234. }
  235. return fill_area2(area,weights);
  236. }
  237. function updateVictims(type,prey)
  238. {
  239. var sums = prey.sum();
  240. for (var key in sums) {
  241. if (sums.hasOwnProperty(key)) {
  242. victims[type][key] += sums[key];
  243. }
  244. }
  245. }
  246. function feed()
  247. {
  248. var area = macro.handArea;
  249. var prey = getPrey(biome, area);
  250. var line = prey.eat(verbose)
  251. var linesummary = summarize(prey.sum(), false);
  252. var people = get_living_prey(prey.sum());
  253. var sound = "Ulp";
  254. if (people < 3) {
  255. sound = "Ulp.";
  256. } else if (people < 10) {
  257. sound = "Gulp.";
  258. } else if (people < 50) {
  259. sound = "Glrrp.";
  260. } else if (people < 500) {
  261. sound = "Glrrrpkh!";
  262. } else if (people < 5000) {
  263. sound = "GLRRKPKH!";
  264. } else {
  265. sound = "Oh the humanity!";
  266. }
  267. var preyMass = prey.sum_property("mass");
  268. macro.scaleWithMass(preyMass);
  269. stomach.push(prey);
  270. if (stomach.length == 1)
  271. setTimeout(function() { doDigest("stomach"); }, 15000);
  272. updateVictims("stomach",prey);
  273. update([sound,line,linesummary,newline]);
  274. }
  275. function stomp()
  276. {
  277. var area = macro.pawArea;
  278. var prey = getPrey(biome, area);
  279. var line = prey.stomp(verbose)
  280. var linesummary = summarize(prey.sum(), true);
  281. var people = get_living_prey(prey.sum());
  282. var sound = "Thump";
  283. if (people < 3) {
  284. sound = "Thump!";
  285. } else if (people < 10) {
  286. sound = "Squish!";
  287. } else if (people < 50) {
  288. sound = "Crunch!";
  289. } else if (people < 500) {
  290. sound = "CRUNCH!";
  291. } else if (people < 5000) {
  292. sound = "CRRUUUNCH!!";
  293. } else {
  294. sound = "Oh the humanity!";
  295. }
  296. var preyMass = prey.sum_property("mass");
  297. macro.scaleWithMass(preyMass);
  298. updateVictims("stomped",prey);
  299. update([sound,line,linesummary,newline]);
  300. }
  301. function anal_vore()
  302. {
  303. var area = macro.analVoreArea;
  304. var prey = getOnePrey(biome,area);
  305. area = macro.assArea;
  306. var crushed = getPrey(biome,area);
  307. var line1 = prey.anal_vore(verbose, macro.height);
  308. var line1summary = summarize(prey.sum(), false);
  309. var line2 = crushed.buttcrush(verbose);
  310. var line2summary = summarize(crushed.sum(), true);
  311. var people = get_living_prey(prey.sum());
  312. var sound = "Shlp";
  313. if (people < 3) {
  314. sound = "Shlp.";
  315. } else if (people < 10) {
  316. sound = "Squelch.";
  317. } else if (people < 50) {
  318. sound = "Shlurrp.";
  319. } else if (people < 500) {
  320. sound = "SHLRP!";
  321. } else if (people < 5000) {
  322. sound = "SQLCH!!";
  323. } else {
  324. sound = "Oh the humanity!";
  325. }
  326. var people = get_living_prey(crushed.sum());
  327. var sound2 = "Thump";
  328. if (people < 3) {
  329. sound2 = "Thump!";
  330. } else if (people < 10) {
  331. sound2 = "Squish!";
  332. } else if (people < 50) {
  333. sound2 = "Crunch!";
  334. } else if (people < 500) {
  335. sound2 = "CRUNCH!";
  336. } else if (people < 5000) {
  337. sound2 = "CRRUUUNCH!!";
  338. } else {
  339. sound2 = "Oh the humanity!";
  340. }
  341. var preyMass = prey.sum_property("mass");
  342. var crushedMass = prey.sum_property("mass");
  343. macro.scaleWithMass(preyMass);
  344. macro.scaleWithMass(crushedMass);
  345. bowels.push(prey);
  346. if (bowels.length == 1)
  347. setTimeout(function() { doDigest("bowels"); }, 15000);
  348. updateVictims("bowels",prey);
  349. updateVictims("stomped",crushed);
  350. update([sound,line1,line1summary,newline,sound2,line2,line2summary,newline]);
  351. }
  352. function update(lines = [])
  353. {
  354. var log = document.getElementById("log");
  355. lines.forEach(function (x) {
  356. var line = document.createElement('div');
  357. line.innerHTML = x;
  358. log.appendChild(line);
  359. });
  360. log.scrollTop = log.scrollHeight;
  361. document.getElementById("height").innerHTML = "Height: " + length(macro.height, unit);
  362. document.getElementById("mass").innerHTML = "Mass: " + mass(macro.mass, unit);
  363. for (var type in victims) {
  364. if (victims.hasOwnProperty(type)) {
  365. for (var key in victims[type]){
  366. if (victims[type].hasOwnProperty(key)) {
  367. if (document.getElementById("stats-" + type + "-" + key) == null) {
  368. if (victims[type][key] == 0)
  369. continue;
  370. child = document.createElement('div');
  371. child.id = "stats-" + type + "-" + key;
  372. child.classList.add("stat-line");
  373. document.getElementById("stats-" + type).appendChild(child);
  374. }
  375. document.getElementById("stats-" + type + "-" + key).innerHTML = key + ": " + victims[type][key];
  376. }
  377. }
  378. }
  379. }
  380. }
  381. function pick_move()
  382. {
  383. if (!strolling) {
  384. setTimeout(pick_move, 1500 * Math.sqrt(macro.scale));
  385. return;
  386. }
  387. var choice = Math.random();
  388. if (choice < 0.2) {
  389. anal_vore();
  390. } else if (choice < 0.6) {
  391. stomp();
  392. } else {
  393. feed();
  394. }
  395. setTimeout(pick_move, 1500 * Math.sqrt(macro.scale));
  396. }
  397. function grow()
  398. {
  399. var oldHeight = macro.height;
  400. var oldMass = macro.mass;
  401. macro.scale *= 1.2;
  402. var newHeight = macro.height;
  403. var newMass = macro.mass;
  404. var heightDelta = newHeight - oldHeight;
  405. var massDelta = newMass - oldMass;
  406. var heightStr = length(heightDelta, unit);
  407. var massStr = mass(massDelta, unit);
  408. update(["Power surges through you as you grow " + heightStr + " taller and gain " + massStr + " of mass",newline]);
  409. }
  410. // pop the list and digest that object
  411. function doDigest(containerName)
  412. {
  413. var digestType = containerName == "stomach" ? stomach : bowels;
  414. var count = 0
  415. if (containerName == "stomach") {
  416. count = stomach.length;
  417. count = Math.min(count,maxStomachDigest);
  418. } else if (containerName == "bowels") {
  419. count = bowels.length;
  420. count = Math.min(count,maxBowelsDigest);
  421. }
  422. var container = new Container();
  423. while (count > 0) {
  424. --count;
  425. var toDigest = digestType.shift();
  426. if (toDigest.name != "Container")
  427. toDigest = new Container([toDigest]);
  428. container = container.merge(toDigest);
  429. }
  430. var digested = container.sum();
  431. for (var key in victims[containerName]) {
  432. if (victims[containerName].hasOwnProperty(key) && digested.hasOwnProperty(key) ) {
  433. victims["digested"][key] += digested[key];
  434. victims[containerName][key] -= digested[key];
  435. }
  436. }
  437. if (containerName == "stomach")
  438. update(["Your stomach gurgles as it digests " + container.describe(false),summarize(container.sum()),newline]);
  439. else if (containerName == "bowels")
  440. update(["Your bowels churn as they absorb " + container.describe(false),summarize(container.sum()),newline]);
  441. if (digestType.length > 0) {
  442. setTimeout(function() {
  443. doDigest(containerName);
  444. }, 15000);
  445. }
  446. }
  447. window.addEventListener('load', function(event) {
  448. victims["stomped"] = initVictims();
  449. victims["digested"] = initVictims();
  450. victims["stomach"] = initVictims();
  451. victims["bowels"] = initVictims();
  452. document.getElementById("button-look").addEventListener("click",look);
  453. document.getElementById("button-grow").addEventListener("click",grow);
  454. document.getElementById("button-feed").addEventListener("click",feed);
  455. document.getElementById("button-stomp").addEventListener("click",stomp);
  456. document.getElementById("button-anal_vore").addEventListener("click",anal_vore);
  457. document.getElementById("button-stroll").addEventListener("click",toggle_auto);
  458. document.getElementById("button-location").addEventListener("click",change_location);
  459. document.getElementById("button-units").addEventListener("click",toggle_units);
  460. document.getElementById("button-verbose").addEventListener("click",toggle_verbose);
  461. setTimeout(pick_move, 2000);
  462. update();
  463. });