diff --git a/src/js/DefaultRules.tw b/src/js/DefaultRules.tw index f6e2ae301ad043d94e06020135c2a18e067075a8..b05d065c3c3e350d39f1023992d9dec838d31ad9 100644 --- a/src/js/DefaultRules.tw +++ b/src/js/DefaultRules.tw @@ -7,10 +7,10 @@ window.DefaultRules = (function() { let r; function DefaultRules(slave) { - console.log("default ruling for", slave); V = State.variables; r = ""; let rule = MergeRules(slave); + console.log("default ruling for", slave.slaveName, rule); if (Object.keys(rule).length === 0) return r; // no rules apply @@ -1391,9 +1391,9 @@ window.DefaultRules = (function() { } function ProcessCuratives(slave, rule) { - if ((rule.curatives !== undefined) && (rule.curatives != "no default setting")) { - if (slave.curatives != rule.curatives) { - if (rule.curatives == 2) { + if ((rule.curatives !== undefined) && (rule.curatives !== "no default setting")) { + if (slave.curatives !== rule.curatives) { + if (rule.curatives === 2) { if (slave.health > 100) { if ((slave.curatives != 1)) { r += `<br>${slave.slaveName} has been put on preventatives, since curatives cannot improve her health further.`; diff --git a/src/js/rulesAssistantOptions.tw b/src/js/rulesAssistantOptions.tw index 60b1537ad431d3909329cbfee150c0d270ebfd01..e033be8c081f406e01b46c1729adf90da57c2331 100644 --- a/src/js/rulesAssistantOptions.tw +++ b/src/js/rulesAssistantOptions.tw @@ -182,6 +182,7 @@ window.rulesAssistantOptions = (function() { value.classList.add("rajs-value"); // // call the variable binding when the input field is no longer being edited, and when the enter key is pressed value.onfocusout = () => { this.inputEdited(); }; + value.onblur = () => {this.inputEdited(); } value.onkeypress = (e) => { if (returnP(e)) this.inputEdited(); }; } else { value = document.createElement("strong"); @@ -1390,9 +1391,9 @@ window.rulesAssistantOptions = (function() { constructor() { const pairs = [ ["No default setting", "no default setting"], - ["None", "none", 0], - ["Preventatives", "preventatives", 1], - ["Curatives", "curatives", 2] + ["None", 0], + ["Preventatives", 1], + ["Curatives", 2], ]; super("Health drugs", pairs); this.setValue(current_rule.set.curatives); @@ -1404,10 +1405,10 @@ window.rulesAssistantOptions = (function() { constructor() { const pairs = [ ["No default setting", "no default setting"], - ["None", "none", 0], - ["Standard", "standard", 1], - ["Extreme", "extreme", 2], - ["Anaphrodisiacs", "anaphrodisiacs", -1] + ["None", 0], + ["Standard", 1], + ["Extreme", 2], + ["Anaphrodisiacs", -1] ]; super("Aphrodisiacs", pairs); this.setValue(current_rule.set.aphrodisiacs); @@ -1419,14 +1420,14 @@ window.rulesAssistantOptions = (function() { constructor() { const drugs = [ ["No default setting", "no default setting"], - ["Contraceptives", "contraceptives", -1], - ["Fertile", "fertile", 0], - ["Very fertile", "very fertile", 1], - ["Extremely fertile", "extremely fertile", 2], + ["Contraceptives", -1], + ["Fertile", 0], + ["Very fertile", 1], + ["Extremely fertile", 2], ]; if (V.seeHyperPreg === 1 && V.superFertilityDrugs === 1) { - drugs.push(["Hyper fertile", "hyper fertile", 3]); - drugs.push(["Maximize fertility", "maximize fertility", 4]); + drugs.push(["Hyper fertile", 3]); + drugs.push(["Maximize fertility", 4]); } super("Contraceptives for fertile slaves", drugs); this.setValue(current_rule.set.preg); @@ -1437,12 +1438,12 @@ window.rulesAssistantOptions = (function() { class PregDrugsList extends List { constructor() { const pairs = [ - ["No changes", "no changes", "no default setting"], + ["No changes", "no default setting"], ["None", "none"], - ["Fast gestation", "fast gestation", "fast"], - ["Slow gestation", "slow gestation", "slow"], - ["Birth supressors", "birth supressors", "suppress"], - ["Birth stimulators", "birth stimulators", "stimulate"] + ["Fast gestation", "fast"], + ["Slow gestation", "slow"], + ["Birth supressors", "suppress"], + ["Birth stimulators", "stimulate"] ]; super("Pregnancy control agents for pregnant slaves", pairs); this.setValue(current_rule.set.pregSpeed); @@ -1454,11 +1455,11 @@ window.rulesAssistantOptions = (function() { constructor() { const pairs = [ ["No default setting", "no default setting"], - ["Intensive Female", "intensive female", 2], - ["Female", "female", 1], - ["None", "none", 0], - ["Male", "male", -1], - ["Intensive Male", "intensive male", -2] + ["Intensive Female", 2], + ["Female", 1], + ["None", 0], + ["Male", -1], + ["Intensive Male", -2] ]; super("Hormones for female slaves", pairs); this.setValue(current_rule.set.XX); @@ -1470,11 +1471,11 @@ window.rulesAssistantOptions = (function() { constructor() { const pairs = [ ["No default setting", "no default setting"], - ["Intensive Female", "intensive female", 2], - ["Female", "female", 1], - ["None", "none", 0], - ["Male", "male", -1], - ["Intensive Male", "intensive male", -2] + ["Intensive Female", 2], + ["Female", 1], + ["None", 0], + ["Male", -1], + ["Intensive Male", -2] ]; super("Hormones for geldings", pairs); this.setValue(current_rule.set.gelding); @@ -1486,10 +1487,10 @@ window.rulesAssistantOptions = (function() { constructor() { const pairs = [ ["No default setting", "no default setting"], - ["Intensive Female", "intensive female", 2], - ["Female", "female", 1], - ["None", "none", 0], - ["Male", "male", -1], + ["Intensive Female", 2], + ["Female", 1], + ["None", 0], + ["Male", -1], ["Intensive Male", "intensive male", -2] ]; super("Hormones for shemales", pairs); @@ -1525,25 +1526,25 @@ window.rulesAssistantOptions = (function() { constructor() { const diets = [ ["no default setting", "no default setting"], - ["Fix fat and skinny slaves", "fix fat and skinny slaves", "attractive"], - ["Curvy", "curvy", 30], - ["Average", "average", 0], - ["Thin", "thin", -30] + ["Fix fat and skinny slaves", "attractive"], + ["Curvy", 30], + ["Average", 0], + ["Thin", -30] ]; if (V.feeder === 1) { diets.push( - ["Feminine", "feminine", "XX"], - ["Masculine", "masculine", "XY"] + ["Feminine", "XX"], + ["Masculine", "XY"] ); if (V.dietXXY === 1) - diets.push(["Futanari", "futanari", "XXY"]); + diets.push(["Futanari", "XXY"]); } if (V.dietCleanse === 1) - diets.push(["Cleansing", "promote health", "cleansing"]); + diets.push(["Cleansing", "cleansing"]); if (V.dietFertility === 1) - diets.push(["Feritlity", "promote fertility", "fertility"]); + diets.push(["Feritlity", "fertility"]); if (V.cumProDiet === 1) - diets.push(["Cum production", "promote cum production", "cum production"]); + diets.push(["Cum production", "cum production"]); super("Slave diets", diets); this.setValue(current_rule.set.diet); @@ -1901,11 +1902,11 @@ window.rulesAssistantOptions = (function() { super("Makeup"); [ ["no default setting"], - ["makeup-free", "makeup-free", 0], - ["nice", "nice", 1], - ["gorgeous", "gorgeous", 2], - ["color-coordinate with hair", "color-coordinate with hair", 3], - ["slutty", "slutty", 4] + ["makeup-free", 0], + ["nice", 1], + ["gorgeous", 2], + ["color-coordinate with hair", 3], + ["slutty", 4] ].forEach(pair => this.appendChild(new ListItem(...pair))); this.setValue(current_rule.set.makeup); this.onchange = (value) => current_rule.set.makeup = value; @@ -1917,12 +1918,12 @@ window.rulesAssistantOptions = (function() { super("Nails"); [ ["no default setting"], - ["clipped", "clipped", 0], - ["extended", "extended", 1], - ["color-coordinate with hair", "color-coordinate with hair", 2], - ["sharp and claw-like", "sharp and claw-like", 3], - ["bright and glittery", "bright and glittery", 4], - ["hooker nails", "hooker nails", 5] + ["clipped", 0], + ["extended", 1], + ["color-coordinate with hair", 2], + ["sharp and claw-like", 3], + ["bright and glittery", 4], + ["hooker nails", 5] ].forEach(pair => this.appendChild(new ListItem(...pair))); this.setValue(current_rule.set.nails); this.onchange = (value) => current_rule.set.nails = value; @@ -1933,12 +1934,12 @@ window.rulesAssistantOptions = (function() { constructor() { const pairs = [ ["no default setting"], - ["very short", "very short", 5], - ["short", "short", 10], - ["shoulder length", "shoulder length", 30], - ["long", "long", 60], - ["very long", "very long", 100], - ["floor length", "floor length", 150] + ["very short", 5], + ["short", 10], + ["shoulder length", 30], + ["long", 60], + ["very long", 100], + ["floor length", 150] ]; super("Hair length", pairs); this.setValue(current_rule.set.hLength); diff --git a/src/js/wombJS.tw b/src/js/wombJS.tw index 16babecae2ff06f10cc6841e4c8913f8c2106a67..0043c87cd4b5873a0dc43a58cde171a61685f9dd 100644 --- a/src/js/wombJS.tw +++ b/src/js/wombJS.tw @@ -142,16 +142,13 @@ window.WombBirthReady = function(actor, readyAge) { }; window.WombGetVolume = function(actor) { //most code from pregJS.tw with minor adaptation. - var i, ft; var gestastionWeek; var phi = 1.618; var targetLen; var wombSize = 0; try { - actor.womb.forEach(i => { - ft = actor.womb[i]; + actor.womb.forEach(ft => { gestastionWeek = ft.age; - if (gestastionWeek <= 32) { targetLen = (0.00006396 * Math.pow(gestastionWeek, 4)) - (0.005501 * Math.pow(gestastionWeek, 3)) +