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.
 
 
 

131 lines
4.6 KiB

  1. rules = {};
  2. rules["eat"] = [];
  3. rules["stomp"] = [];
  4. rules["kick"] = [];
  5. rules["anal-vore"] = [];
  6. rules["ass-crush"] = [];
  7. rules["breast-crush"] = [];
  8. rules["unbirth"] = [];
  9. rules["cock-vore"] = [];
  10. rules["cockslap"] = [];
  11. rules["ball-smother"] = [];
  12. rules["male-orgasm"] = [];
  13. rules["female-orgasm"] = [];
  14. function hasNothing(container, thing, amount) {
  15. for (var key in container.contents) {
  16. if (container.contents.hasOwnProperty(key))
  17. return false;
  18. }
  19. return true;
  20. }
  21. function hasLessThan(container, thing, amount) {
  22. if (container.contents.hasOwnProperty(thing))
  23. if (container.contents[thing].count < amount && container.contents[thing].count > 0)
  24. return true;
  25. return false;
  26. }
  27. function hasExactly(container, thing, amount) {
  28. if (!container.contents.hasOwnProperty(thing) && amount == 0)
  29. return true;
  30. if (container.contents.hasOwnProperty(thing) && container.contents[thing].count == amount)
  31. return true;
  32. return false;
  33. }
  34. function hasOnly(container, things) {
  35. for (var key in container.contents) {
  36. if (container.contents.hasOwnProperty(key))
  37. if (!things.includes(key))
  38. return false;
  39. }
  40. for (var i=0; i<things.length; i++) {
  41. if (!container.contents.hasOwnProperty(things[i]))
  42. return false;
  43. }
  44. return true;
  45. }
  46. function describe(action, container, macro, verbose=true) {
  47. options = [];
  48. for (var i = 0; i < rules[action].length; i++) {
  49. if(rules[action][i].test(container,macro)) {
  50. options.push(rules[action][i].desc);
  51. }
  52. }
  53. if (options.length > 0)
  54. return options[0](container, macro);
  55. else {
  56. return describeDefault(action, container, macro, verbose);
  57. }
  58. }
  59. function describeDefault(action, container, macro, verbose=true) {
  60. switch(action) {
  61. case "eat": return "You scoop up " + container.describe(verbose) + " and swallow " + (container.count > 1 ? "them" : "it") + " whole.";
  62. case "stomp": return "You crush " + container.describe(verbose) + " underfoot.";
  63. case "kick": return "You punt " + container.describe(verbose) + ", destroying " + (container.count > 1 ? "them" : "it") + ".";
  64. case "anal-vore": return "You sit yourself down on " + container.describe(verbose) + ". " + (container.count > 1 ? "They slide" : "It slides") + " inside with ease.";
  65. case "ass-crush": return "Your heavy ass obliterates " + container.describe(verbose) + ". ";
  66. case "breast-crush": return "Your heavy breasts obliterate " + container.describe(verbose) + ". ";
  67. case "unbirth": return "You gasp as you slide " + container.describe(verbose) + " up your slit. ";
  68. case "cock-vore": return "You stuff " + container.describe(verbose) + " into your throbbing shaft, forcing them down to your heavy balls.";
  69. case "cockslap": return "Your swaying shaft crushes " + container.describe(verbose) + ". ";
  70. case "ball-smother": return "Your weighty balls spread over " + container.describe(verbose) + ", smothering them in musk.";
  71. case "male-orgasm": return "You're cumming! Your thick cock spurts out $VOLUME of seed, splooging " + container.describe(verbose) + ".";
  72. case "female-orgasm": return "You're cumming! Your moist slit sprays $VOLUME of slick femcum, splooging " + container.describe(verbose) + ".";
  73. }
  74. }
  75. // EATING
  76. rules["eat"].push({
  77. "test": function(container, macro) {
  78. return hasNothing(container);
  79. },
  80. "desc": function(container, macro) {
  81. return "You scoop up...nothing. Oh well.";
  82. }
  83. });
  84. rules["eat"].push({
  85. "test": function(container, macro) {
  86. return hasOnly(container, ["Person"])
  87. && hasLessThan(container, "Person", 6)
  88. && macro.height >= 10;
  89. },
  90. "desc": function(container, macro) {
  91. return "You pluck up the " + container.describe() + " and stuff them into your mouth, swallowing lightly to drag them down to your bubbling guts.";
  92. }
  93. });
  94. rules["eat"].push({
  95. "test": function(container, macro) {
  96. return hasOnly(container, ["Person"])
  97. && hasExactly(container, "Person", 1)
  98. && macro.height < 10;
  99. },
  100. "desc": function(container, macro) {
  101. return "You grasp " + container.describe() + " and greedily wolf them down, swallowing forcefully to cram them into your bulging stomach. A crass belch escapes your lips as they curl up in your slimy gut.";
  102. }
  103. })
  104. rules["eat"].push({
  105. "test": function(container, macro) {
  106. return hasOnly(container, ["Person","Car"])
  107. && hasExactly(container, "Car", 1)
  108. && hasLessThan(container, "Person", 5);
  109. },
  110. "desc": function(container, macro) {
  111. return "You crush the " + container.contents["Car"].describe() + " with your tight throat, washing it down with " + container.contents["Person"].describe();
  112. }
  113. })