Newer
Older
/* intended to condense the clothing/toy/etc availability checks into something less asinine */
window.isItemAccessible = (function() {
/**
* Checks whether clothing is accessible
* @param {string} string Name of wearable item
* @param {string} category that item is in clothing, collar, etc
* @param {App.Entity.SlaveState} slave
* @returns {boolean|string} Returns true if item is accessible, and false if it is not. If the slave param is set, it may sometimes return a string instead of false, explaining why the item can't be used with that slave.
let niceDB = [];
let harshDB = [];
switch (category) {
case "clothing":
case "clothes":
niceDB = App.Data.misc.niceClothes;
harshDB = App.Data.misc.harshClothes;
break;
case "collar":
niceDB = App.Data.misc.niceCollars;
harshDB = App.Data.misc.harshCollars;
break;
case "bellyAccessory":
niceDB = App.Data.misc.bellyAccessories;
break;
case "buttplug":
niceDB = App.Data.misc.buttplugs;
break;
case "buttplugAttachment":
niceDB = App.Data.misc.buttplugAttachments;
break;
case "vaginalAccessory":
niceDB = App.Data.misc.vaginalAccessories;
break;
case "vaginalAttachment":
niceDB = App.Data.misc.vaginalAttachments;
break;
case "dickAccessory":
niceDB = App.Data.misc.vaginalAccessories;
break;
case "shoes":
niceDB = App.Data.misc.shoes;
break;
case "chastity":
niceDB = App.Data.misc.chastityDevices;
break;
default:
console.log(`made a category for ${category} automatically, may need to define this by hand`);
niceDB = App.Data.misc[category];
break;
if (!item && (typeof harshDB !== 'undefined')) {
console.log(`${string} is not a registered piece of clothing! Check App.Data.misc.${category}`);
return isAvailable(item, category, slave);
* Returns array of wearable clothing in format [name, value], basically player facing / game data.
* @param {string} db Name of array to look in (such as "App.Data.misc.niceClothes")
* @returns {Array}
*/
function array(db) {
const array = [];
db.forEach((i) => {
if (V.cheatMode || isAvailable(i)) {
function isAvailable(item, category, slave) {
if (slave) {
let slaveResults = isAvailableForSlave(item, category, slave);
if (slaveResults !== true) { // If they are true we pass this check but want to run the others.
return slaveResults;
}
}
if (!(item.hasOwnProperty("fs")) && !(item.hasOwnProperty("rs"))) {
if (typeof item.rs[requirement] === 'object' && item.rs[requirement] !== null) {
if (requirement === "either") { // If we find the "either" nested object, we need to see if just one of the conditions in it are true.
Object.keys(item.rs.either).forEach((nestedRequirement) => {
if (typeof item.rs.either[nestedRequirement] === 'object' && item.rs.either[nestedRequirement] !== null) { // And yes sometimes even in either we have a nested object, to check V.PC mostly, so check for it.
let insideEitherCheck = 0;
Object.keys(item.rs.either[nestedRequirement]).forEach((insideNestedRequirement) => {
if (V[nestedRequirement][insideNestedRequirement] === item.rs.either[nestedRequirement][insideNestedRequirement]) {
insideEitherCheck++;
}
});
if (insideEitherCheck > 0) {
eitherCheck++;
}
if (V[nestedRequirement] === item.rs.either[nestedRequirement]) {
eitherCheck++;
}

svornost
committed
if (item.rs.either[nestedRequirement] === V[nestedRequirement]) {
}
});
} else {
Object.keys(item.rs.either).forEach((nestedRequirement) => { // Otherwise we are probably recording a nested V variable to be checked.
if (V[requirement][nestedRequirement] === item.rs[requirement][nestedRequirement]) {
eitherCheck++;
switch (category) {
case "clothing":
case "clothes":
break;
case "collar":
break;
case "bellyAccessory": {
switch (item.value) {
if (slave.belly > 10000) {
return true;
} else {
return `Slave belly too small for this`;
}
}
case "a small empathy belly":
case "a medium empathy belly":
case "a large empathy belly":
case "a huge empathy belly": {
if (slave.belly < 1500 && slave.weight < 130) {
return true;
} else {
return `Slave belly too big for this`;
}
}
default:
return true;
}
}
case "buttplug": {
switch (item.value) {
if (slave.anus < 2) {
return `Slave's anus is too small for this right now`;
} else {
return true;
}
}
case "long plug":
case "long, large plug": {
if (!(slave.breedingMark !== 1 || V.propOutcome === 0 || V.eugenicsFullControl === 1 || V.arcologies[0].FSRestart === "unset")) {
return "Elites frown on this";
} else {
return true;
}
}
case "long, huge plug": {
if (slave.anus < 2) {
return `Slave's anus is too small for this right now`;
} else if (!(slave.breedingMark !== 1 || V.propOutcome === 0 || V.eugenicsFullControl === 1 || V.arcologies[0].FSRestart === "unset")) {
return "Elites frown on this";
} else {
return true;
}
}
default:
return true;
}
}
case "buttplugAttachment":
break;
case "vaginalAccessory": {
if (slave.vagina < 0) {
return false;
}
switch (item.value) {
if (slave.vagina < 2) {
return `Slave's vagina is too small for this right now`;
} else {
return true;
}
}
case "long dildo":
case "long, large dildo": {
if (!(slave.breedingMark !== 1 || V.propOutcome === 0 || V.eugenicsFullControl === 1 || V.arcologies[0].FSRestart === "unset")) {
return "Elites frown on this";
} else {
return true;
}
}
case "long, huge dildo": {
if (slave.vagina < 2) {
return `Slave's vagina is too small for this right now`;
} else if (!(slave.breedingMark !== 1 || V.propOutcome === 0 || V.eugenicsFullControl === 1 || V.arcologies[0].FSRestart === "unset")) {
return "Elites frown on this";
} else {
return true;
}
}
default:
return true;
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
}
}
case "vaginalAttachment": {
if (slave.vagina < 0) {
return false;
}
switch (item.value) {
case "vibrator":
if (slave.vaginalAccessory === "none") {
return "No vaginal accessory to attach it to";
} else if (slave.vaginalAccessory === "bullet vibrator" || slave.vaginalAccessory === "smart bullet vibrator") {
return "Vaginal accessory already vibrates";
} else {
return true;
}
}
break;
}
case "dickAccessory":
if (slave.dick < 1) {
return false;
}
return true;
case "shoes":
break;
case "chastity": {
switch (item.value) {
case "chastity belt":
if (slave.vagina > -1) {
return true;
} else {
return false;
}
}
case "chastity cage":
case "combined chastity cage": {
if (slave.dick > 0) {
return true;
} else {
return false;
}
}
case "genital chastity":
case "full chastity": {
if (slave.vagina > -1 && slave.dick > 0) {
return true;
} else {
return false;
}
}
case "choose own chastity": {
if (slave.choosesOwnChastity !== 1 && slave.devotion > 20 && slave.trust > 0) {
if (slave.choosesOwnClothes === 1) {
return "Slave is not choosing own clothing";
} else {
return true;
if (slave.choosesOwnChastity > 0 && slave.devotion > 20 && slave.trust > 0) {
if (slave.choosesOwnClothes === 1) {
return "Slave is not choosing own clothing";
} else {
return true;
}
}
default:
break;
}
* @param {App.Entity.SlaveState} slave
* @param {string} prosthetic
* @returns {boolean}
*/
window.isProstheticAvailable = function(slave, prosthetic) {
return slave.readyProsthetics.findIndex(function(p) { return p.id === prosthetic; }) !== -1;
};
/**
* @param {App.Entity.SlaveState} slave
* @param {string} prosthetic
*/
window.addProsthetic = function(slave, prosthetic) {
if (!isProstheticAvailable(slave, prosthetic)) {
let limb = prostheticToLimb(prosthetic);
if (limb > 0) {
let p = {
id: prosthetic,
arm: {left: new App.Entity.LimbState(), right: new App.Entity.LimbState()},
leg: {left: new App.Entity.LimbState(), right: new App.Entity.LimbState()}
};
p.arm.left.type = limb;
p.arm.right.type = limb;
p.leg.left.type = limb;
p.leg.right.type = limb;
slave.readyProsthetics.push(p);
} else {
/**
* @param {App.Entity.SlaveState} slave
* @param {string} prosthetic
* @returns {{}}
*/
window.findProsthetic = function(slave, prosthetic) {
return slave.readyProsthetics.find(p => p.id === prosthetic);
};
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
/**
* @param {string} prosthetic
* @returns {number}
*/
window.prostheticToLimb = function(prosthetic) {
switch (prosthetic) {
case "basicL":
return 2;
case "sexL":
return 3;
case "beautyL":
return 4;
case "combatL":
return 5;
case "cyberneticL":
return 6;
default:
return 0;
}
};
/**
*
* @param {number} limb
* @returns {string}
*/
window.limbToProsthetic = function(limb) {
switch (limb) {
case 2:
return "basicL";
case 3:
return "sexL";
case 4:
return "beautyL";
case 5:
return "combatL";
case 6:
return "cyberneticL";
default:
return "";
}
};