From 1d87fa9db8b0ed0dcea4498ba430ba0cdb0edb23 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 22 Jun 2019 14:24:08 +0100 Subject: Hack around wait and metaClass --- scripts/toy.groovy | 4 ++++ scripts/toy/social.groovy | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/toy.groovy b/scripts/toy.groovy index bd18e40..d35ced3 100644 --- a/scripts/toy.groovy +++ b/scripts/toy.groovy @@ -1603,6 +1603,10 @@ return new Object() { final removeRequestable = { String name -> requestables.remove(name); }; + // This exists because calling .wait(t) in a metaClass method + // calls it on the metaClass, not on the original object + void pause(int t) { wait(t); } + String main() { diff --git a/scripts/toy/social.groovy b/scripts/toy/social.groovy index 9617b65..d07b9f0 100644 --- a/scripts/toy/social.groovy +++ b/scripts/toy/social.groovy @@ -34,7 +34,7 @@ present([DRESSED,nTEASE], [ [ "I'm going out now, toy.", "$plan time!" ], [ "Will you be good while I'm gone?", "You will behave as I expect?" ]]); - wait(10); + pause(10); postChastity(); def toys = TOYTOYS.findAll { t -> stateIs(t) }; Collections.shuffle(toys); @@ -43,7 +43,7 @@ set(NAKED, false); present([DRESSED,TEASE], [ [ "Back later!", "See you soon, toy" ]]); - wait(5); + pause(5); } else if (has(CHASTITY) && !stateIs(CHASTE)) { leaveNote("I want you in chastity until I return!", CHASTE); @@ -59,7 +59,7 @@ setAway(null); if (rt && sessionSummon([DRESSED])) { present([DRESSED], [["Hello, toy!"], ["I'm back home now."]]); - wait(10); + pause(10); showLounge(); } readNote(); -- cgit v1.2.3