| @@ -1,4 +1,5 @@ | |||
| { | |||
| "indent": 1, | |||
| "esversion": 6, | |||
| "node": true, | |||
| "sub": true, | |||
| @@ -413,7 +413,7 @@ let macro = | |||
| "fillBreasts": function(self) { | |||
| if (self.milkStorage.amount > self.milkStorage.limit) { | |||
| milk_breasts(null, self.milkStorage.amount - self.milkStorage.limit); | |||
| breast_milk(null, self.milkStorage.amount - self.milkStorage.limit); | |||
| } | |||
| self.milkStorage.amount += self.lactationScale * self.milkStorage.limit / 1200; | |||
| @@ -1354,7 +1354,7 @@ function breast_crush() | |||
| if (macro.lactationEnabled && macro.milkStorage.amount / macro.milkStorage.limit > 0.5) { | |||
| let amount = Math.min(macro.lactationVolume, (macro.milkStorage.amount / macro.milkStorage.limit - 0.5) * macro.milkStorage.limit); | |||
| milk_breasts(null, amount); | |||
| breast_milk(null, amount); | |||
| } | |||
| } | |||
| @@ -1396,11 +1396,11 @@ function breast_vore() | |||
| if (macro.lactationEnabled && macro.milkStorage.amount / macro.milkStorage.limit > 0.5) { | |||
| let amount = Math.min(macro.lactationVolume, (macro.milkStorage.amount / macro.milkStorage.limit - 0.5) * macro.milkStorage.limit); | |||
| milk_breasts(null, amount); | |||
| breast_milk(null, amount); | |||
| } | |||
| } | |||
| function milk_breasts(e,vol) | |||
| function breast_milk(e,vol) | |||
| { | |||
| if (vol == undefined) { | |||
| vol = Math.min(macro.lactationVolume, macro.milkStorage.amount); | |||
| @@ -2453,6 +2453,16 @@ function actionTab(e) { | |||
| document.getElementById(target).style.display = "flex"; | |||
| } | |||
| function registerActions() { | |||
| let buttons = document.querySelectorAll("[id^='button-action']"); | |||
| buttons.forEach( function(button) { | |||
| let name = button.id; | |||
| name = name.replace(/button-action-/,""); | |||
| button.addEventListener("click", window[name]); | |||
| }); | |||
| } | |||
| window.addEventListener('load', function(event) { | |||
| (function() { | |||
| @@ -2491,30 +2501,9 @@ window.addEventListener('load', function(event) { | |||
| element.addEventListener("click",actionTab); | |||
| }); | |||
| document.getElementById("button-look").addEventListener("click",look); | |||
| document.getElementById("button-feed").addEventListener("click",feed); | |||
| document.getElementById("button-chew").addEventListener("click",chew); | |||
| document.getElementById("button-stomp").addEventListener("click",stomp); | |||
| document.getElementById("button-sit").addEventListener("click",sit); | |||
| document.getElementById("button-tail_slap").addEventListener("click",tail_slap); | |||
| document.getElementById("button-tail_vore").addEventListener("click",tail_vore); | |||
| document.getElementById("button-cleavage_stuff").addEventListener("click",cleavage_stuff); | |||
| document.getElementById("button-cleavage_crush").addEventListener("click",cleavage_crush); | |||
| document.getElementById("button-cleavage_drop").addEventListener("click",cleavage_drop); | |||
| document.getElementById("button-cleavage_absorb").addEventListener("click",cleavage_absorb); | |||
| document.getElementById("button-breast_crush").addEventListener("click",breast_crush); | |||
| document.getElementById("button-breast_vore").addEventListener("click",breast_vore); | |||
| document.getElementById("button-breast_milk").addEventListener("click",milk_breasts); | |||
| document.getElementById("button-unbirth").addEventListener("click",unbirth); | |||
| document.getElementById("button-sheath_stuff").addEventListener("click",sheath_stuff); | |||
| document.getElementById("button-sheath_squeeze").addEventListener("click",sheath_squeeze); | |||
| document.getElementById("button-sheath_absorb").addEventListener("click",sheath_absorb); | |||
| document.getElementById("button-cockslap").addEventListener("click",cockslap); | |||
| document.getElementById("button-cock_vore").addEventListener("click",cock_vore); | |||
| document.getElementById("button-ball_smother").addEventListener("click",ball_smother); | |||
| document.getElementById("button-grind").addEventListener("click",grind); | |||
| document.getElementById("button-pouch_stuff").addEventListener("click",pouch_stuff); | |||
| document.getElementById("button-pouch_eat").addEventListener("click",pouch_eat); | |||
| registerActions(); | |||
| document.getElementById("button-stroll").addEventListener("look",look); | |||
| document.getElementById("button-stroll").addEventListener("click",toggle_auto); | |||
| document.getElementById("button-location").addEventListener("click",change_location); | |||
| document.getElementById("button-numbers").addEventListener("click",toggle_numbers); | |||
| @@ -1,8 +1,22 @@ | |||
| 'use strict'; | |||
| /*jshint browser: true*/ | |||
| var rules = {}; | |||
| var defaults= {}; | |||
| function getDefault(name) { | |||
| let tokens = name.split("-"); | |||
| for (let i=0; i<tokens.length; i++) { | |||
| tokens[i] = tokens[i].charAt(0).toUpperCase() + tokens[i].slice(1); | |||
| } | |||
| let funcName = "default" + tokens.join(""); | |||
| return window[funcName]; | |||
| } | |||
| var actions = ["eat","chew","stomp","kick","anal-vore","tail-slap","tail-vore","ass-crush", | |||
| var actions = ["eat","chew","stomp","kick","anal-vore","ass-crush","tail-slap","tail-vore", | |||
| "cleavage-stuff","cleavage-crush","cleavage-drop","cleavage-absorb","breast-crush", | |||
| "breast-vore","breast-milk","unbirth","sheath-stuff","sheath-squeeze","sheath-crush", | |||
| "sheath-absorb","cock-vore","cockslap","ball-smother","male-spurt","male-orgasm","female-spurt", | |||
| @@ -93,46 +107,7 @@ function describe(action, container, macro, verbose=true) { | |||
| return options[choice](container, macro, verbose); | |||
| } | |||
| else { | |||
| return describeDefault(action, container, macro, verbose); | |||
| } | |||
| } | |||
| function describeDefault(action, container, macro, verbose=true) { | |||
| switch(action) { | |||
| case "eat": return defaultEat(container, macro, verbose); | |||
| case "chew": return defaultChew(container, macro, verbose); | |||
| case "stomp": return defaultStomp(container, macro, verbose); | |||
| case "kick": return defaultKick(container, macro, verbose); | |||
| case "anal-vore": return defaultAnalVore(container, macro, verbose); | |||
| case "ass-crush": return defaultAssCrush(container, macro, verbose); | |||
| case "tail-slap": return defaultTailSlap(container, macro, verbose); | |||
| case "tail-vore": return defaultTailVore(container, macro, verbose); | |||
| case "cleavage-stuff": return defaultCleavageStuff(container, macro, verbose); | |||
| case "cleavage-crush": return defaultCleavageCrush(container, macro, verbose); | |||
| case "cleavage-drop": return defaultCleavageDrop(container, macro, verbose); | |||
| case "cleavage-absorb": return defaultCleavageAbsorb(container, macro, verbose); | |||
| case "breast-crush": return defaultBreastCrush(container, macro, verbose); | |||
| case "breast-vore": return defaultBreastVore(container, macro, verbose); | |||
| case "breast-milk": return defaultBreastMilk(container, macro, verbose); | |||
| case "unbirth": return defaultUnbirth(container, macro, verbose); | |||
| case "sheath-stuff": return defaultSheathStuff(container, macro, verbose); | |||
| case "sheath-squeeze": return defaultSheathSqueeze(container, macro, verbose); | |||
| case "sheath-crush": return defaultSheathCrush(container, macro, verbose); | |||
| case "sheath-absorb": return defaultSheathAbsorb(container, macro, verbose); | |||
| case "cock-vore": return defaultCockVore(container, macro, verbose); | |||
| case "cockslap": return defaultCockslap(container, macro, verbose); | |||
| case "ball-smother": return defaultBallSmother(container, macro, verbose); | |||
| case "male-spurt": return defaultMaleSpurt(container, macro, verbose); | |||
| case "male-orgasm": return defaultMaleOrgasm(container, macro, verbose); | |||
| case "female-spurt": return defaultFemaleSpurt(container, macro, verbose); | |||
| case "female-orgasm": return defaultFemaleOrgasm(container, macro, verbose); | |||
| case "grind": return defaultGrind(container, macro, verbose); | |||
| case "pouch-stuff": return defaultPouchStuff(container, macro, verbose); | |||
| case "pouch-eat": return defaultPouchEat(container, macro, verbose); | |||
| case "bowels": return defaultBowels(container, macro, verbose); | |||
| case "womb": return defaultWomb(container, macro, verbose); | |||
| case "balls": return defaultBalls(container, macro, verbose); | |||
| case "breasts": return defaultBreasts(container, macro, verbose); | |||
| return getDefault(action)(container, macro, verbose); | |||
| } | |||
| } | |||
| @@ -203,13 +178,6 @@ function defaultCleavageCrush(container, macro, verbose) { | |||
| return "You grasp your breasts and squish them together, smooshing " + container.describe(false) + "."; | |||
| } | |||
| function defaultCleavageAbsorb(container, macro, verbose) { | |||
| if (container.count == 0) | |||
| return defaultCleavageCrush(container, macro, verbose); | |||
| else | |||
| return "Your squeeze your breasts together, swiftly absorbing " + container.describe(false) + " into your chest."; | |||
| } | |||
| function defaultCleavageDrop(container, macro, verbose) { | |||
| if (container.count == 0) | |||
| return "You pull your breasts apart and give them a shake."; | |||
| @@ -219,6 +187,13 @@ function defaultCleavageDrop(container, macro, verbose) { | |||
| return "You pull your breasts apart far enough for the " + container.describe(false) + " trapped within to fall out."; | |||
| } | |||
| function defaultCleavageAbsorb(container, macro, verbose) { | |||
| if (container.count == 0) | |||
| return defaultCleavageCrush(container, macro, verbose); | |||
| else | |||
| return "Your squeeze your breasts together, swiftly absorbing " + container.describe(false) + " into your chest."; | |||
| } | |||
| function defaultBreastCrush(container, macro, verbose) { | |||
| if (isFatal(macro)) | |||
| return "Your heavy breasts obliterate " + container.describe(verbose) + ". "; | |||
| @@ -91,39 +91,39 @@ | |||
| </div> | |||
| <div class="action-tab" id="actions-body"> | |||
| <button class="action-button" id="button-feed">Eat</button> | |||
| <button class="action-button" id="button-chew">Chew</button> | |||
| <button class="action-button" id="button-stomp">Stomp</button> | |||
| <button class="action-button" id="button-sit">Sit</button> | |||
| <button class="action-button" id="button-grind">Grind</button> | |||
| <button class="action-button" id="button-action-feed">Eat</button> | |||
| <button class="action-button" id="button-action-chew">Chew</button> | |||
| <button class="action-button" id="button-action-stomp">Stomp</button> | |||
| <button class="action-button" id="button-action-sit">Sit</button> | |||
| <button class="action-button" id="button-action-grind">Grind</button> | |||
| </div> | |||
| <div class="action-tab" id="actions-tails"> | |||
| <button class="action-button" id="button-tail_slap">Tail Slap</button> | |||
| <button class="action-button" id="button-tail_vore">Tail Vore</button> | |||
| <button class="action-button" id="button-action-tail_slap">Tail Slap</button> | |||
| <button class="action-button" id="button-action-tail_vore">Tail Vore</button> | |||
| </div> | |||
| <div class="action-tab" id="actions-breasts"> | |||
| <button class="action-button" id="button-cleavage_stuff">Stuff Cleavage</button> | |||
| <button class="action-button" id="button-cleavage_crush">Crush Cleavage</button> | |||
| <button class="action-button" id="button-cleavage_drop">Drop Cleavage</button> | |||
| <button class="action-button" id="button-cleavage_absorb">Absorb Cleavage</button> | |||
| <button class="action-button" id="button-breast_crush">Breast Crush</button> | |||
| <button class="action-button" id="button-breast_vore">Breast Vore</button> | |||
| <button class="action-button" id="button-breast_milk">Milk Breasts</button> | |||
| <button class="action-button" id="button-action-cleavage_stuff">Stuff Cleavage</button> | |||
| <button class="action-button" id="button-action-cleavage_crush">Crush Cleavage</button> | |||
| <button class="action-button" id="button-action-cleavage_drop">Drop Cleavage</button> | |||
| <button class="action-button" id="button-action-cleavage_absorb">Absorb Cleavage</button> | |||
| <button class="action-button" id="button-action-breast_crush">Breast Crush</button> | |||
| <button class="action-button" id="button-action-breast_vore">Breast Vore</button> | |||
| <button class="action-button" id="button-action-breast_milk">Milk Breasts</button> | |||
| </div> | |||
| <div class="action-tab" id="actions-vagina"> | |||
| <button class="action-button" id="button-unbirth">Unbirth</button> | |||
| <button class="action-button" id="button-action-unbirth">Unbirth</button> | |||
| </div> | |||
| <div class="action-tab" id="actions-dick"> | |||
| <button class="action-button" id="button-sheath_stuff">Stuff Sheath</button> | |||
| <button class="action-button" id="button-sheath_squeeze">Squeeze Sheath</button> | |||
| <button class="action-button" id="button-sheath_absorb">Absorb Sheath</button> | |||
| <button class="action-button" id="button-cockslap">Cockslap</button> | |||
| <button class="action-button" id="button-cock_vore">Cock Vore</button> | |||
| <button class="action-button" id="button-ball_smother">Ball Smother</button> | |||
| <button class="action-button" id="button-action-sheath_stuff">Stuff Sheath</button> | |||
| <button class="action-button" id="button-action-sheath_squeeze">Squeeze Sheath</button> | |||
| <button class="action-button" id="button-action-sheath_absorb">Absorb Sheath</button> | |||
| <button class="action-button" id="button-action-cockslap">Cockslap</button> | |||
| <button class="action-button" id="button-action-cock_vore">Cock Vore</button> | |||
| <button class="action-button" id="button-action-ball_smother">Ball Smother</button> | |||
| </div> | |||
| <div class="action-tab" id="actions-misc"> | |||
| <button class="action-button" id="button-pouch_stuff">Stuff Pouch</button> | |||
| <button class="action-button" id="button-pouch_eat">Eat From Pouch</button> | |||
| <button class="action-button" id="button-action-pouch_stuff">Stuff Pouch</button> | |||
| <button class="action-button" id="button-action-pouch_eat">Eat From Pouch</button> | |||
| </div> | |||
| </div> | |||