From b59a2d326bff66995e22b7e5e81d222c3d1bc34c Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Wed, 19 Dec 2018 11:18:09 +0000 Subject: Sometimes don't always [fully] release toy after play --- scripts/toy.groovy | 95 +++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 87 insertions(+), 8 deletions(-) diff --git a/scripts/toy.groovy b/scripts/toy.groovy index c7b9bba..b6a9854 100644 --- a/scripts/toy.groovy +++ b/scripts/toy.groovy @@ -25,6 +25,8 @@ final PLAY = "play"; // toy.state. final CHASTE = "chaste", COLLARED = "collared", CUFFED = "cuffed", CLAMPED = "clamped", GAGGED = "gagged", NAKED = "naked"; final REDRESS = "redress"; +final TOYTOYS = [CUFFED, COLLARED, CLAMPED, GAGGED]; +final RELEASEFROM = "releaseFrom"; // toy.plan..{start|end|friend} UTC times final LUNCH = "lunch", SHOPPING = "shopping", PARTY = "party"; final START = "start", END = "end", FRIEND = "friend"; @@ -950,6 +952,31 @@ def intSqueeze = { wait(3 + getRandom(6)); }; }; +def stateToyName = { state -> + switch (state) { + case CUFFED: + return "cuffs"; + case COLLARED: + return "collar"; + case CLAMPED: + return "nipple clamps"; + case GAGGED: + return "gag"; + } + return null; +}; +def removeToy = { toy, imageSpec -> + if (!is(toy)) return; + def toyName = stateToyName(toy); + present(imageSpec, [ + ["OK,"], + ["you may remove your $toyName.", "the $toyName can come off.", "take the $toyName off."]]); + showButtonG("Thank you, mistress", "ok"); + wait(5); + set(toy, false); + removeEvent("$RELEASEFROM-$toy"); + showButtonGT("Removed, mistress", "removed", 20, 1); +}; // Session def sessionSummon = { imageSpec -> final limit = 5; @@ -1054,20 +1081,25 @@ def sessionRelease = { goodToy -> postChastity(); } wait(getRandom(10) + 5); - if (is(CUFFED) || is(COLLARED) || is(CLAMPED) || is(GAGGED)) { + def toys = TOYTOYS.findAll { t -> is(t) }; + Collections.shuffle(toys); + if (toys) { if (!goodToy) { present([DRESSED], [ ["I should leave you like that.", "I suppose you still want letting free?"], ["Maybe.", "Let me ponder on it."]]); wait(getRandom(20) + 20); } - present([DRESSED], [ - ["You may release yourself", "Free yourself"]]); - wait(getRandom(5) + 5); - set(CUFFED, false); - set(COLLARED, false); - set(CLAMPED, false); - set(GAGGED, false); + toys.each { toy -> + if (getRandom(100) > ((goodToy && (getPunish() < 100)) ? 10 : 80)) { + removeToy(toy, [DRESSED]); + } + else { + addEventIfMissing("$RELEASEFROM-$toy", getTime() + 100 + getRandom(10 * (getPunish() + 1)), + RELEASEFROM, toy); + adjustPunish(-5); + } + }; } if (is(NAKED)) { if (goodToy && getRandom(1)) { @@ -1143,6 +1175,9 @@ def bedtime = { dress([[LINGERIE,nTITS]]); if (sessionSummon([LINGERIE,nTITS])) { preStrip([LINGERIE,nTITS]); + def toys = TOYTOYS.findAll { t -> is(t) }; + Collections.shuffle(toys); + toys.each { removeToy(it, [LINGERIE,nTITS]) }; present([LINGERIE,nTITS], [ ["Very good, toy.", "OK"], ["Bedtime!", "Off to bed with you!", "Bed! Now!"]]); @@ -1151,6 +1186,11 @@ def bedtime = { // Assume toy will return dressed tomorrow removeEvent(REDRESS); set(NAKED, false); + // Assume toy will release himself + TOYTOYS.findAll { t -> is(t) }.each { + removeEvent("$RELEASEFROM-$it"); + set(it, false); + }; exit(); }; def redress = { rt -> @@ -1166,6 +1206,14 @@ def redress = { rt -> set(NAKED, false); showLounge(); }; +def releaseFrom = { rt, arg, name -> + if (!rt || !sessionSummon([DRESSED])) { + addEvent(name, getTime() + 300, RELEASEFROM, arg); + return; + } + removeToy(arg, [DRESSED]); + showLounge(); +}; def requestClothes = { adjustPunish(5); present([DRESSED], [ @@ -1181,6 +1229,30 @@ def requestClothes = { present([DRESSED], [["Good boy."]]); } showButtonG("Thank you, mistress", "ok"); + showLounge(); +}; +def requestRelease = { toy -> + adjustPunish(5); + present([DRESSED], [ + ["Really?", "Disappointing."], + ["You wish to be un-$toy?"]]); + if (getBoolean(null)) { + adjustPunish(10); + if (getRandom(100) > getPunish()) { + present([DRESSED], [["No.", "You may not."], + ["Not yet.", "Not until later."]]); + } + else { + present([DRESSED], [["Hmm, very well.", "If you must."]]); + set(toy, false); + removeEvent("$RELEASEFROM-$toy"); + } + } + else { + present([DRESSED], [["Good boy."]]); + } + showButtonG("Thank you, mistress", "ok"); + showLounge(); }; // Confession def confessChastityRelease = { @@ -1315,6 +1387,9 @@ def beginPlan = { plan -> [ "Will you be good while I'm gone?", "You will behave as I expect?" ]]); wait(10); postChastity(); + def toys = TOYTOYS.findAll { t -> is(t) }; + Collections.shuffle(toys); + toys.each { removeToy(it, [DRESSED,nTEASE]) }; present([DRESSED,TEASE], [ [ "Back later!", "See you soon, toy" ]]); wait(5); @@ -1329,6 +1404,7 @@ def beginPlan = { plan -> // Initial - basic checks and defaults namedEvents = [ play: { name, arg, schedTime, rt -> playEvent(rt, arg) }, + releaseFrom: { name, arg, schedTime, rt -> releaseFrom(rt, arg, name) }, redress: { name, arg, schedTime, rt -> redress(rt) }, permit: { name, arg, schedTime, rt -> givePermission(arg) } ]; @@ -1480,6 +1556,9 @@ while (true) { if (is(NAKED)) { opts.push([ lbl: "May I wear clothes", act: requestClothes ]); } + TOYTOYS.findAll { is(it) }.each { + opts.push([ lbl: "May I be un-$it".toString(), act: requestRelease, arg: it ]); + }; def opt = getSelectedValue("Yes, toy?", opts.collect { it.lbl }); def act = opts[opt].act; if (act) -- cgit v1.2.3