diff --git a/chastity/belt/belt_seal_cyclical.js b/chastity/belt/belt_seal_cyclical.js new file mode 100644 index 0000000..c8d250f --- /dev/null +++ b/chastity/belt/belt_seal_cyclical.js @@ -0,0 +1,27 @@ +const { getUserVar, setUserVar } = require("../../functions/usercontext") +const { clearArousal, getArousal, addArousal } = require("../../functions/vibefunctions") + +// Seal of Cyclical Time +// This Seal resets the wearer to their initial state every 3 minutes +// No Increase to denial when worn +exports.denialCoefficient = (data) => { return 1 } + +// Events +// Randomly reduce the level of arousal by a random percentage, then reduce by a further 10% +exports.onEquip = (data) => { + // Configure base arousal value + if (!getUserVar(data.userID, "base_arousal") || getUserVar(data.userID, "base_arousal") == undefined) setUserVar(data.userID, "base_arousal", getArousal(data.userID) ?? 0); + if (!getUserVar(data.userID, "stasis_timer") || getUserVar(data.userID, "stasis_timer") == undefined) setUserVar(data.userID, "stasis_timer", Date.now()); +} + +exports.onUnequip = (data) => { + // Add All Stored Arousal at once + addArousal(data.userID, getUserVar(data.userID, "base_arousal")); + setUserVar(data.userID, "base_arousal", undefined); + setUserVar(data.userID, "stasis_timer", undefined); +} + +// Tags +exports.tags = ["seal"] +// Name +exports.name = "Seal of Cyclical Time" \ No newline at end of file diff --git a/chastity/belt/belt_seal_falsecalm.js b/chastity/belt/belt_seal_falsecalm.js new file mode 100644 index 0000000..867ff92 --- /dev/null +++ b/chastity/belt/belt_seal_falsecalm.js @@ -0,0 +1,28 @@ +const { getUserVar, setUserVar } = require("../../functions/usercontext") +const { getToys, getBaseToy } = require("../../functions/toyfunctions"); +const { getArousal, addArousal } = require("../../functions/vibefunctions") + +// Seal of False Calm +// This Seal locks arousal at 0, while tracking what the strongest vibe they are wearing is and storing an arousal value relative to that every minute that is applied on being unequipped +// No Increase to denial when worn +exports.denialCoefficient = (data) => { return 1 } +// Arousal locked to 0 +exports.maxArousal = (data) => { return 0 } + +// Events +// Randomly reduce the level of arousal by a random percentage, then reduce by a further 10% +exports.onEquip = (data) => { + // Configure base arousal value + if (!getUserVar(data.userID, "base_arousal") || getUserVar(data.userID, "base_arousal") == undefined) setUserVar(data.userID, "base_arousal", getArousal(data.userID) ?? 0); +} + +exports.onUnequip = (data) => { + // Add All Stored Arousal at once + addArousal(data.userID, getUserVar(data.userID, "base_arousal")); + setUserVar(data.userID, "base_arousal", undefined); +} + +// Tags +exports.tags = ["seal"] +// Name +exports.name = "Seal of False Calm" \ No newline at end of file diff --git a/eventfunctions/chastity/belt_seal_cyclical.js b/eventfunctions/chastity/belt_seal_cyclical.js new file mode 100644 index 0000000..167a338 --- /dev/null +++ b/eventfunctions/chastity/belt_seal_cyclical.js @@ -0,0 +1,13 @@ +const { getUserVar, setUserVar } = require("../../functions/usercontext") +const { clearArousal, getArousal, addArousal } = require("../../functions/vibefunctions") + +let functiontick = async function(userid) { + // Reset Wearer to initial state every 3 mins~ + if(Date.now() > (getUserVar(userid, "stasis_timer") + 180000)){ + setUserVar(userid, "stasis_timer", Date.now()) + clearArousal(userid); + addArousal(userid, getUserVar(userid, "base_arousal")); + } +} + +exports.functiontick = functiontick; \ No newline at end of file diff --git a/eventfunctions/chastity/belt_seal_falsecalm.js b/eventfunctions/chastity/belt_seal_falsecalm.js new file mode 100644 index 0000000..c941572 --- /dev/null +++ b/eventfunctions/chastity/belt_seal_falsecalm.js @@ -0,0 +1,23 @@ +const { getUserVar, setUserVar } = require("../../functions/usercontext") +const { getToys, getBaseToy } = require("../../functions/toyfunctions"); +const { getBotOption } = require("../../functions/configfunctions.js"); + +let functiontick = async function(userid) { + //Tickrate Modifier + tickMod = (getBotOption("bot-timetickrate") / 60000) + + if(getToys(userid).length > 0) + { + // Calc Impact of Toys and increment Base_Arousal + getToys(userid).forEach(toy => { + setUserVar(userid, "base_arousal", getUserVar(userid, "base_arousal") + (getBaseToy(toy.type).calcVibeEffect({ userID: userid, intensity: toy.intensity }) * tickMod)) + }); + } + else + { + // Slow Decrement of Arousal if no Toys + setUserVar(userid, "base_arousal", Math.max(getUserVar(userid, "base_arousal") - tickMod, 0)); + } +} + +exports.functiontick = functiontick; \ No newline at end of file