From 401d0dc7528b260aacb2af78030e65bd93f436e6 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Thu, 20 Jun 2019 21:12:05 +0100 Subject: Extract confession into a module --- scripts/toy.groovy | 93 +----------------------------------------- scripts/toy/confession.groovy | 95 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 96 insertions(+), 92 deletions(-) create mode 100644 scripts/toy/confession.groovy diff --git a/scripts/toy.groovy b/scripts/toy.groovy index 529f5e0..0fc31ae 100644 --- a/scripts/toy.groovy +++ b/scripts/toy.groovy @@ -1549,97 +1549,6 @@ return new Object() { showButtonG("Thank you, ${dommeTitle()}", "ok"); showLounge(); }; - // Confession - def confessChastityRelease = { - adjustPunish(75); - present([DRESSED, nTEASE], [ - ["Bad toy!", "Naughty little slut."], - ["I don't keep it locked for nothing.", "It's locked for a reason."], - ["It better have been a good reason.", "I'll presume you had a valid excuse."], - ["Is it locked again now?", "Are you back in chastity now?"]]); - if (getBoolean(null)) { - present([DRESSED, nTEASE], [ - ["Good!", "There's that at least."]]); - showButtonG("Yes, ${dommeTitle()}", "ok"); - } - else { - adjustPunish(300); - present([DRESSED, nTEASE], [ - ["disobedient", "dirty", "cheeky"], - ["little"], - ["slut!", "whore!", "brat!"], - ["Get it locked back up", "Back in chastity"], - ["right now!", "this instant!"]]); - showButtonGT("Locked, ${dommeTitle()}. Here's the key.", "locked", 180, 1); - } - if (getBoolean("Did you get erect whilst out?")) { - adjustPunish(50); - if (getBoolean("Did you cum!?")) { - adjustPunish(200); - } - } - adjustPunish(getInteger("How many hours were you out?", 1) * 10); - }; - def confessStroked = { - adjustPunish(40); - present([DRESSED,nTEASE], [ - ["Awww, poor little toy.", "Naught little toy!"], - ["You know you aren't allowed.", "You get to stroke only when I say."]]); - showButtonG("Sorry, ${dommeTitle()}", "sorry"); - if (getBoolean("Did you get to the edge?")) { - adjustPunish(40); - adjustPunish(getInteger("How many times?", 1) * 5); - if (getBoolean("Did you cum!?")) { - adjustPunish(200); - } - } - }; - def confess = { - // 5 points just for feeling the need to confess - def op = getPunish(); - adjustPunish(5); - dress([[DRESSED,nTEASE], [MEAN]]); - while (true) { - present([DRESSED, nTEASE], [ - ["I'm not going to like this, am I?", "There is no way this ends well for you."], - ["Out with it.", "Let me hear it."]]); - def opts = [ ]; - if (stateIs(CHASTE)) { - opts.push([lbl: "Freed from chastity", act: confessChastityRelease]); - } - if (!stateIs(CHASTE)) { - opts.push([lbl: "Stroked", act: confessStroked]); - } - opts.push([ lbl: "Nothing listed (phew!)", act: null ]); - def opt = getSelectedValue(null, opts.collect { it.lbl }); - def act = opts[opt].act; - if (!act) { - showLounge(); - return; - } - act(); - if (!getBoolean("Anything else?")) break; - } - // If sufficient points accrued, punish immediately.. with a bonus - if (getPunish() > 150 + op) { - present([MEAN], [ - ["I'm very disappointed in you.", "You've been a very bad toy!"], - ["Immediate punishment!", "So you will suffer... right now!"]]); - adjustPunish(100); - showButtonG("Yes, ${dommeTitle()}", "ok"); - removeEvent(PLAY); - sessionPlay(); - sessionRelease(sessionAborted == null); - playSchedule(); - } - else { - present([DRESSED, nTEASE], [ - ["Good!", "There better not be!"]]); - showButtonG("Yes, ${dommeTitle()}", "ok"); - showLounge(); - } - }; - // Setup def setupEvents = { playSchedule(); @@ -1684,7 +1593,6 @@ return new Object() { } def requestables = [ faq: [ lbl: "FAQ (webpage)", act: showFaq ], - confess: [ lbl: "Confess", act: confess ], ]; final addRequestable = { String name, String label, func -> requestables[name] = [lbl: label, act: func]; @@ -1793,6 +1701,7 @@ return new Object() { /* * Resources * scripts/toy.groovy + * scripts/toy/confession.groovy * scripts/toy/imagery.groovy * scripts/toy/intro.groovy * scripts/toy/sleep.groovy diff --git a/scripts/toy/confession.groovy b/scripts/toy/confession.groovy new file mode 100644 index 0000000..774fd47 --- /dev/null +++ b/scripts/toy/confession.groovy @@ -0,0 +1,95 @@ +{ toy -> + toy.metaClass.confessChastityRelease { + adjustPunish(75); + present([DRESSED, nTEASE], [ + ["Bad toy!", "Naughty little slut."], + ["I don't keep it locked for nothing.", "It's locked for a reason."], + ["It better have been a good reason.", "I'll presume you had a valid excuse."], + ["Is it locked again now?", "Are you back in chastity now?"]]); + if (getBoolean(null)) { + present([DRESSED, nTEASE], [ + ["Good!", "There's that at least."]]); + showButtonG("Yes, ${dommeTitle()}", "ok"); + } + else { + adjustPunish(300); + present([DRESSED, nTEASE], [ + ["disobedient", "dirty", "cheeky"], + ["little"], + ["slut!", "whore!", "brat!"], + ["Get it locked back up", "Back in chastity"], + ["right now!", "this instant!"]]); + showButtonGT("Locked, ${dommeTitle()}. Here's the key.", "locked", 180, 1); + } + if (getBoolean("Did you get erect whilst out?")) { + adjustPunish(50); + if (getBoolean("Did you cum!?")) { + adjustPunish(200); + } + } + adjustPunish(getInteger("How many hours were you out?", 1) * 10); + }; + + toy.metaClass.confessStroked { + adjustPunish(40); + present([DRESSED,nTEASE], [ + ["Awww, poor little toy.", "Naught little toy!"], + ["You know you aren't allowed.", "You get to stroke only when I say."]]); + showButtonG("Sorry, ${dommeTitle()}", "sorry"); + if (getBoolean("Did you get to the edge?")) { + adjustPunish(40); + adjustPunish(getInteger("How many times?", 1) * 5); + if (getBoolean("Did you cum!?")) { + adjustPunish(200); + } + } + }; + + toy.metaClass.confess { + // 5 points just for feeling the need to confess + def op = getPunish(); + adjustPunish(5); + dress([[DRESSED,nTEASE], [MEAN]]); + while (true) { + present([DRESSED, nTEASE], [ + ["I'm not going to like this, am I?", "There is no way this ends well for you."], + ["Out with it.", "Let me hear it."]]); + def opts = [ ]; + if (stateIs(CHASTE)) { + opts.push([lbl: "Freed from chastity", act: { confessChastityRelease() }]); + } + if (!stateIs(CHASTE)) { + opts.push([lbl: "Stroked", act: { confessStroked() }]); + } + opts.push([ lbl: "Nothing listed (phew!)", act: null ]); + def opt = getSelectedValue(null, opts.collect { it.lbl }); + def act = opts[opt].act; + if (!act) { + showLounge(); + return; + } + act(); + if (!getBoolean("Anything else?")) break; + } + // If sufficient points accrued, punish immediately.. with a bonus + if (getPunish() > 150 + op) { + present([MEAN], [ + ["I'm very disappointed in you.", "You've been a very bad toy!"], + ["Immediate punishment!", "So you will suffer... right now!"]]); + adjustPunish(100); + showButtonG("Yes, ${dommeTitle()}", "ok"); + removeEvent(PLAY); + sessionPlay(); + sessionRelease(sessionAborted == null); + playSchedule(); + } + else { + present([DRESSED, nTEASE], [ + ["Good!", "There better not be!"]]); + showButtonG("Yes, ${dommeTitle()}", "ok"); + showLounge(); + } + }; + + toy.addRequestable("confess", "Confess", { toy.confess() }); +} -- cgit v1.2.3