diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2019-06-22 14:24:08 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2019-06-22 14:24:08 +0100 |
commit | 1d87fa9db8b0ed0dcea4498ba430ba0cdb0edb23 (patch) | |
tree | 5e49083647e525484193b19748f04361490a7343 /scripts | |
parent | Fix getDay (diff) | |
download | toy-1d87fa9db8b0ed0dcea4498ba430ba0cdb0edb23.zip |
Hack around wait and metaClass
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/toy.groovy | 4 | ||||
-rw-r--r-- | scripts/toy/social.groovy | 6 |
2 files changed, 7 insertions, 3 deletions
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(); |