/
Toys.js
1166 lines (896 loc) · 39.3 KB
/
Toys.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
const DEFAULT_TOY_COOLDOWN_MINUTES = 5;
{
let pathLength = getPersonalityPath().length;
let files = getScriptFilesInFolder('Toys', true);
for (let index = 0; index < files.length; index++) {
let file = files[index];
if (!file.getName().contains('Toys')) {
let path = file.getPath();
run(path.substring(path.indexOf(getPersonalityPath()) + pathLength + 1, path.length));
}
}
loadDildos();
loadButtplugs();
sendDebugMessage('Loaded ' + CHASTITY_CAGES.length + ' chastity cages');
sendDebugMessage('Loaded ' + DILDOS.length + ' dildos');
sendDebugMessage('Loaded ' + buttplugs.length + ' buttplugs');
}
//Do this after loading all toys
checkClearOutfitOn();
function interactWithButtplug(punishment) {
if ((BUTTPLUG_TOY.isPunishmentAllowed() || !punishment && BUTTPLUG_TOY.isPlayAllowed()) && getAnalLimit() === LIMIT_ASKED_YES) {
let chance;
if (isPlugged()) {
//This makes anal plug depend on anal mood more heavily
chance = Math.max(15, getVar(VARIABLE.ASS_LEVEL, 0)) + MOOD.ANAL.getChanceBooster() * 3;
sendDebugMessage('Rolling for ' + chance + " to upgrade plug size");
} else {
//This makes anal plug depend on anal mood more heavily
chance = Math.max(15, getVar(VARIABLE.ASS_LEVEL, 0)) + MOOD.ANAL.getChanceBooster() * 3;
sendDebugMessage('Rolling for ' + chance + " to insert plug");
}
if (isChance(chance)) {
let action = shouldIncreasePlugSize();
if (action === ACTION_BUTTPLUG_INCREASE_SIZE) {
increasePlugSize();
} else if (action === ACTION_BUTTPLUG_PUT_FIRST && hasButtplugToy()) {
let answers = ['Let\'s prepare your %Ass% for what is to come %Grin%', 'Let\'s plug up that %Ass%', 'Let\'s not waste anymore time by leaving that %Ass% empty'];
if (getVar(VARIABLE.ASS_LEVEL) >= 30 && isChance(30)) {
answers.push('You know that there is a very slim chance of you not being plugged and guess what - You won\'t be lucky now... %Lol%');
}
sendMessage(answers[randomInteger(0, answers.length - 1)]);
putInButtplug();
} else if (action === ACTION_BUTTPLUG_WAIT_FOR_TIME) {
}
}
}
}
//QUALITY: Track already fetched toys to not ask again and instead go like grab x
//QUALITY: Could interact with buy new toys or fetish questions and better transition between different toys (additionally why not do this... etc.)
function interactWithRandomToys() {
sendDebugMessage('Random toy interact');
const punishment = isOngoingPunishment();
let allowPain = true;
//No random pain toys if we are just doing an easy punishment
if (punishment && PUNISHMENT_CURRENT_LEVEL === PUNISHMENT_LEVEL.EASY && PUNISHMENT_OVERALL_LEVEL === PUNISHMENT_LEVEL.EASY) {
allowPain = false;
}
if (hasButtplugToy()) {
interactWithButtplug(punishment);
}
sendDebugMessage('Random toy buttplug done');
if (COLLAR_TOY.hasToy() && COLLAR_TOY.decideToyOn() && feelsLikeShowingPower()) {
putOnCollar();
} else if (RULE_ALWAYS_WEAR_COLLAR.isActive() && RULE_ALWAYS_WEAR_COLLAR.shouldCheckRule()) {
RULE_ALWAYS_WEAR_COLLAR.checkRule();
}
sendDebugMessage('Random toy collar done');
//TODO: If this puts a new pin on a body part that already has a pin the last interaction date is reset and removing the pin due to being on too long won't work anymore
if (isChance(20) && PAIN_LIMIT.isAllowed() && allowPain) {
sendDebugMessage('Looking into clamp distribution');
let toDistribute = (getTotalAttachedClamps() > 20 || isChance(35) && getTotalAttachedClamps() > 0) ? 0 : randomInteger(1, 4);
sendDebugMessage('Decided to attach ' + toDistribute + ' clamps while ' + getTotalAttachedClamps() + ' are already attached');
if (toDistribute === 0 && getTotalAttachedClamps() > 0) {
//If feels like punishing we will only redistribute the clamps and not remove any
if (feelsLikePunishingSlave()) {
sendDebugMessage('Redistributing clamps...');
redistributeRandomClamps();
} else {
let toRemove = randomInteger(1, Math.max(1, Math.floor(getTotalAttachedClamps() / 2)));
//Make sure to detach at least 2 or all of them if less than 2 are remaining
toRemove = Math.min(getTotalAttachedClamps(), Math.max(2, toRemove));
sendDebugMessage('Removing ' + toRemove + ' clamps');
removeClamps(toRemove);
}
} else {
distributeClamps(toDistribute);
}
if(NIPPLE_SUCKERS.hasToy() && !isNipplesOccupied() && feelsLikePunishingSlave()) {
if(NIPPLE_SUCKERS.fetchToy()) {
sendMessageBasedOnSender('Now put the nipple suckers on %SlaveName%');
sendMessageBasedOnSender('Tell me when you are done');
waitForDone();
NIPPLE_SUCKERS.setToyOn(true);
}
}
}
redistributeTooLongAttachedClamps();
if (NIPPLE_CLAMPS.decideToyOff()) {
let minutesSincePutOn = getMillisSinecDate(NIPPLE_CLAMPS.getLastUsage()) / (1000 * 60);
sendDebugMessage('Nipple clamps have been on for ' + minutesSincePutOn);
//20 minutes should be max
//QUALITY: Add personal limit/modifier for sub
if (isChance(minutesSincePutOn * 5)) {
removeNippleClamps();
}
}
if (NIPPLE_SUCKERS.decideToyOff()) {
let minutesSincePutOn = getMillisSinecDate(NIPPLE_SUCKERS.getLastUsage()) / (1000 * 60);
sendDebugMessage('Nipple suckers have been on for ' + minutesSincePutOn);
//20 minutes should be max
//QUALITY: Add personal limit/modifier for sub
if (isChance(minutesSincePutOn * 5)) {
removeNippleClamps();
}
}
sendDebugMessage('Random toy pain done');
//TODO: More interaction (forbid to talk etc.)
//Do this after clamps because we might remove clamp from tongue after put on for spider gag
if (wantsToRemoveGag()) {
removeGag(false);
} else {
decideGag();
}
sendDebugMessage('Random toy gag done');
if (hasBallsTied() && isChance(50)) {
untieBalls();
} else if (!hasBallsTied() && !isInChastity() && isChance(20) && allowPain && !BODY_PART_BALLS.isUsed()) {
tieBalls();
}
sendDebugMessage('Random toy balls done');
if (isKneeling() && !feelsLikeShowingPower() && decideStopKneeling()) {
stopKneeling();
} else if (!isKneeling() && feelsLikeShowingPower()) {
startKneeling();
}
}
/**
* Gets the time in minutes that should pass before we swap out a toy
* @returns {number}
*/
function getMinPlayTimeBeforeToySwap() {
return 7;
}
function removeAllToys(end = false) {
removeAllClamps();
removeGag();
removeNippleClamps();
if (isPlugged()) {
//Put in right plug afterwards again
if (end) {
restoreSmallButtplug();
} else {
removeButtplug(true);
}
}
if (COLLAR_TOY.isToyOn() && !RULE_ALWAYS_WEAR_COLLAR.isActive()) {
COLLAR_TOY.removeToyText();
}
if (hasLingerieOn()) {
sendMessage('Go ahead and undress and put your normal clothes back on %SlaveName%');
sendMessage('Tell me when you are done', 0);
waitForDone();
removeAllLingerie();
}
HOOD_TOY.setToyOn(false);
NOSE_HOOK.setToyOn(false);
HUMBLER_TOY.setToyOn(false);
ANAL_HOOK_TOY.setToyOn(false);
PARACHUTE_TOY.setToyOn(false);
BALL_CRUSHER_TOY.setToyOn(false);
//QUALITY: Specify
sendMessage('Remove anything else attached to your body %SlaveName%');
sendMessage('Tell me when you are done', 0);
waitForDone();
}
function readyInput() {
const answer = sendInput("Tell me when you are ready %SlaveName%", "Are you ready?", "Are you ready %SlaveName%?");
while (true) {
if (answer.isLike("ready", "yes")) {
sendMessage("%Good%");
break;
} else {
sendMessage("Well then, better hurry up!", "Then don't waste my time and tell me when you are ready!", 0);
answer.loop();
}
}
}
function fetchToy(toy, imagePath, amount = 0) {
//Sub wasn't able to fetch this before so no need to ask again
if (getVar('toy' + toy + 'UnableToFetch', false)) {
if (amount > 0) {
sendMessageBasedOnSender('Sadly you weren\'t able to get ' + amount + ' ' + pluralize(toy, amount) + ' before %GeneralTime% %EmoteSad%');
} else {
sendMessageBasedOnSender('Sadly you weren\'t able to get your ' + toy + ' before %GeneralTime% %EmoteSad%');
}
sendMessageBasedOnSender('So I am not gonna ask you again because I guess it does not change a thing');
return false;
}
if (amount > 0) {
sendMessageBasedOnSender('Go ahead and %Retrieve% ' + amount + ' ' + pluralize(toy, amount), 0);
} else {
sendMessageBasedOnSender('Go ahead and %Retrieve% your ' + toy, 0);
}
if (imagePath !== undefined) {
lockImages();
showImage(imagePath, 3);
} else {
sleep(3);
}
sendMessageBasedOnSender("Tell me when you are ready to continue.", 0);
const answer = createInput();
while (true) {
if (answer.isLike("done", "yes", "ready")) {
if (imagePath !== undefined) {
unlockImages();
}
sendMessageBasedOnSender("%Good%");
//Update the list of lovense toys
fetchAvailableLovenseToys();
break;
} else if (answer.isLike("no", "don't", "can't")) {
if (imagePath !== undefined) {
unlockImages();
}
sendMessageBasedOnSender("What?!");
sendMessageBasedOnSender("That is unacceptable!");
sendMessageBasedOnSender("You should always have your toys around!");
//If assistant we are gonna add punishment points otherwise change mood
if (getCurrentSender() === SENDER_ASSISTANT) {
sendMessageBasedOnSender('I am assigning you some punishment points!');
} else {
changeMeritHigh(true);
}
addPunishmentPoints(100, PUNISHMENT_REASON.POOR_BEHAVIOUR);
sendMessageBasedOnSender("Well then....");
//Store it temporarily, that sub wasn't able to fetch stuff today so we won't ask again
setTempVar('toy' + toy + 'UnableToFetch', true);
return false;
} else {
sendMessageBasedOnSender("Are you done yet?", 0);
answer.loop();
}
}
return true;
}
function askForToyUsage(toyName, domChose, variableName) {
if (variableName === undefined) {
variableName = decapitalize(toyName).replace(/ /g, "");
}
let toyVarName = 'toy' + variableName;
//Sub disabled this toy
if (getVar(toyVarName, false)) {
return;
}
if (domChose) {
setVar("toy" + variableName + "InteractionMode", TOY_BOTH_MODE);
return;
}
sendVirtualAssistantMessage("Do you want the " + toyName + " to be used for punishments, play or both?", false);
let answer = createInput();
while (true) {
if (answer.containsIgnoreCase("play")) {
setVar("toy" + variableName + "InteractionMode", TOY_PLAY_MODE);
break;
} else if (answer.containsIgnoreCase("both")) {
setVar("toy" + variableName + "InteractionMode", TOY_BOTH_MODE);
break;
} else if (answer.containsIgnoreCase("punishment")) {
setVar("toy" + variableName + "InteractionMode", TOY_PUNISHMENT_MODE);
break;
} else {
sendVirtualAssistantMessage("Play, punishment or both?", 0);
answer.loop();
}
}
}
function createToy(name) {
return {
name: name,
hasToy: function () {
return getVar(this.getVarName(), false);
},
setLastUsage: function () {
setDate(this.getVarName() + 'LastUsage');
},
getLastUsage: function () {
return getVar(this.getVarName() + 'LastUsage', setDate().addDay(-30)).clone();
},
setLastRemoval: function () {
setDate(this.getVarName() + 'LastRemoval');
},
getLastRemoval: function () {
return getVar(this.getVarName() + 'LastRemoval', setDate().addDay(-30));
},
getVarName: function () {
return 'toy' + name.replace(/ /g, "");
},
wasUsedInActiveContext: function () {
return getVar(this.getVarName() + 'Used', false);
},
setUsedInActiveContext: function (used) {
return setTempVar(this.getVarName() + 'Used', used);
},
isToyOn: function () {
return getVar(this.getVarName() + 'on', false);
},
removeToy: function () {
this.setToyOn(false);
},
removeToyText: function () {
if (!this.hasToy() || !this.isToyOn()) {
return false;
}
sendMessageBasedOnSender(this.getTakeOffCommand());
sendMessageBasedOnSender('Tell me once you are done');
waitForDone(100000);
this.setToyOn(false);
return true;
},
getTakeOffCommand: function () {
return 'Go ahead and take off/remove the ' + this.getDisplayName();
},
setToyOn: function (on) {
setVar(this.getVarName() + 'on', on);
if (on) {
this.setLastUsage();
} else {
this.setLastRemoval();
}
},
getImageName: function () {
let split = name.split(' ');
let imageName = '';
for (let x = 0; x < split.length; x++) {
if (x === 0) {
imageName += decapitalize(split[x]);
} else {
imageName += capitalize(split[x]);
}
}
return imageName;
},
getImagePath: function () {
return "Images/Spicy/Toys/" + this.getImageName() + ".jpg";
},
getImageFolder: function () {
let file = new java.io.File(this.getImagePath()).getParentFile();
if (!file.exists()) {
file.mkdirs();
}
return file;
},
setHasToy: function (hasToy) {
setVar(this.getVarName(), hasToy);
},
askForToyAndUsage: function (domChose, variableName, imageName) {
if (this.askForToy(variableName, imageName)) {
this.askForToyUsage(domChose, variableName);
}
},
decideToyOn: function (asked = false) {
if (this.isToyOn()) {
return false;
}
if (!this.getLastRemoval().addMinute(DEFAULT_TOY_COOLDOWN_MINUTES).hasPassed()) {
return false;
}
return true;
},
decideToyOff: function (asked = false) {
if (!this.isToyOn()) {
return false;
}
if (!this.getLastUsage().addMinute(DEFAULT_TOY_COOLDOWN_MINUTES).hasPassed()) {
return false;
}
return true;
},
fetchToy: function (amount = 0) {
return fetchToy(name, this.getImagePath(), amount);
},
askForToy: function (variableName, imageName) {
if (variableName === undefined) {
variableName = this.getVarName();
}
if (imageName === undefined) {
imageName = this.getImageName();
}
sendVirtualAssistantMessage(capitalize(this.getDisplayName()) + "?", false);
showPicture(this.getImagePath(), 0);
setCurrentSender(SENDER_ASSISTANT);
if (createYesOrNoQuestion()) {
setVar(variableName, true);
sendVirtualAssistantMessage("%Good%");
return true;
} else {
//Delete var if sub does not have the toy
if (isVar(variableName)) {
delVar(variableName);
}
sendVirtualAssistantMessage("%EmoteSad%");
}
setCurrentSender(SENDER_TAJ);
return false;
},
askForToyUsage: function (domChose, variableName) {
if (variableName === undefined) {
variableName = this.getVarName();
}
//Sub disabled this toy
if (!getVar(variableName, false)) {
return;
}
if (domChose) {
setVar(variableName + "InteractionMode", TOY_BOTH_MODE);
return;
}
sendVirtualAssistantMessage("Do you want the " + this.getDisplayName() + " to be used for punishments, play or both?", false);
let answer = createInput();
while (true) {
if (answer.containsIgnoreCase("play")) {
this.setInteractionMode(variableName, TOY_PLAY_MODE);
break;
} else if (answer.containsIgnoreCase("both")) {
this.setInteractionMode(variableName, TOY_BOTH_MODE);
break;
} else if (answer.containsIgnoreCase("punishment")) {
this.setInteractionMode(variableName, TOY_PUNISHMENT_MODE);
break;
} else {
sendVirtualAssistantMessage("Play, punishment or both?", 0);
answer.loop();
}
}
},
setInteractionMode: function(variableName, mode) {
setVar(variableName + "InteractionMode", mode);
},
getInteractionMode: function () {
return getVar(this.getVarName() + 'InteractionMode');
},
isPlayAllowed: function (variableName) {
if (variableName === undefined) {
variableName = this.getVarName();
}
let mode = getVar(variableName + "InteractionMode");
return mode === undefined || mode === null || mode === TOY_PLAY_MODE || mode === TOY_BOTH_MODE;
},
isPunishmentAllowed: function (variableName) {
if (variableName === undefined) {
variableName = this.getVarName();
}
let mode = getVar(variableName + "InteractionMode");
return mode === undefined || mode === null || mode === TOY_PUNISHMENT_MODE || mode === TOY_BOTH_MODE;
},
getDisplayName: function() {
return this.name;
},
toString: function () {
return serializeObject(this);
},
fromString: function (string) {
return deserializeObject(this, string);
},
};
}
function createMultipleToy(name, variableName = undefined) {
let toy = createToy(name);
return extend(toy, {
toyInstances: [],
loadToyInstances: function () {
if (!isVar(variableName)) {
setVar(variableName, new java.util.ArrayList());
} else {
//Clear array
this.toyInstances = [];
let arrayList = tryGetArrayList(variableName);
for (let x = 0; x < arrayList.size(); x++) {
let entry = arrayList.get(x);
this.toyInstances.push(this.createToyInstance().fromString(entry));
}
sendDebugMessage('Loaded ' + this.toyInstances.length + ' ' + pluralize(name))
}
},
saveToyInstances: function () {
let arrayList = new java.util.ArrayList();
for (let y = 0; y < this.toyInstances.length; y++) {
arrayList.add(this.toyInstances[y].toString());
}
setVar(variableName, arrayList);
},
addCurrentToy: function (toyInstance) {
let arrayList = new java.util.ArrayList();
if (isVar(this.getVarName() + 'CurrentOn')) {
arrayList = tryGetArrayList(this.getVarName() + 'CurrentOn');
}
//Don't use getName since this is overwritten as a display name
arrayList.add(toyInstance.name);
setVar(this.getVarName() + 'CurrentOn', arrayList);
},
removeCurrentToy: function (toyInstance) {
//Only works if we already have stored what's on
if (isVar(this.getVarName() + 'CurrentOn')) {
let arrayList = tryGetArrayList(this.getVarName() + 'CurrentOn');
//Don't use getName since this is overwritten as a display name
arrayList.add(toyInstance.name);
setVar(this.getVarName() + 'CurrentOn', arrayList);
return true;
}
return false;
},
getCurrentToys: function () {
let current = [];
if (isVar(this.getVarName() + 'CurrentOn')) {
let arrayList = tryGetArrayList(this.getVarName() + 'CurrentOn');
for (let x = 0; x < arrayList.size(); x++) {
//Turn into string for the function call
let toyInstance = this.getByName(arrayList.get(x) + "");
if (isUndefined(toyInstance)) {
sendDebugMessage('Unknown toy "' + arrayList.get(x) + '" of type ' + this.getVarName());
} else {
current.push(toyInstance);
}
}
}
return current;
},
clearCurrentToys: function () {
setVar(this.getVarName() + 'CurrentOn', new java.util.ArrayList());
},
getRandom: function () {
return random(this.toyInstances);
},
getByName: function (name) {
for (let y = 0; y < this.toyInstances.length; y++) {
//Don't use getName since this is overwritten as a display name
if (name.toUpperCase() === this.toyInstances[y].name.toUpperCase()) {
return this.toyInstances[y];
}
}
return null;
},
openListGui: function () {
let list = javafx.collections.FXCollections.observableArrayList();
for (let x = 0; x < this.toyInstances.length; x++) {
list.add(this.toyInstances[x].name);
}
let toyInstance = this;
createToyListGUI(function (listView, event) {
const selectedItem = listView.listView.getSelectionModel().getSelectedItem();
if (selectedItem != null) {
toyInstance.showEditGui(toyInstance.getByName(selectedItem));
}
}, "High Heels", list)
},
hasToy: function () {
return this.toyInstances.length > 0;
},
hasToyVar: function () {
return getVar(this.getVarName(), false);
},
getToyOfType: function (type) {
let toys = this.getToysOfType(type);
if (toys.length === 0) {
return undefined;
}
return random(toys);
},
getToysOfType: function (type) {
return this.getToysOfTypes([type]);
},
getToysOfTypes: function (types) {
let toys = [];
for (let x = 0; x < this.toyInstances.length; x++) {
if (types.indexOf(this.toyInstances[x].type) !== -1) {
toys.push(this.toyInstances[x]);
}
}
return toys;
},
getToysNotOfTypes: function (types) {
let toys = [];
for (let x = 0; x < this.toyInstances.length; x++) {
if (types.indexOf(this.toyInstances[x].type) === -1) {
toys.push(this.toyInstances[x]);
}
}
return toys;
},
getToysWithComfort: function (min, max) {
let toys = [];
for (let x = 0; x < this.toyInstances.length; x++) {
if (this.toyInstances[x].comfort >= min && this.toyInstances[x].comfort <= max) {
toys.push(this.toyInstances[x]);
}
}
return toys;
},
getToysWithSexAppeal: function (min, max) {
let toys = [];
for (let x = 0; x < this.toyInstances.length; x++) {
if (this.toyInstances[x].sexAppeal >= min && this.toyInstances[x].sexAppeal <= max) {
toys.push(this.toyInstances[x]);
}
}
return toys;
},
});
}
function askForDomChoose() {
sendVirtualAssistantMessage("The Dommes prefer to use the toys whenever they want to and for whatever reason");
sendVirtualAssistantMessage("However they can understand if you only want them to be used for playing or punishment");
sendVirtualAssistantMessage("Do you want to leave it to your %DomHonorific% or chose yourself?", false);
let answer = createInput("Her", "Me");
let domChose = false;
while (true) {
if (answer.isLike("dom", "domme", replaceVocab('%DomHonorific%'), "her", "him", 'them', 'they')) {
answer.clearOptions();
sendVirtualAssistantMessage("You're quite a willing slave %Grin%");
domChose = true;
break;
} else if (answer.isLike("me", "myself", "yourself")) {
answer.clearOptions();
sendVirtualAssistantMessage("%EmoteSad%");
break;
} else {
sendVirtualAssistantMessage("Do you want to leave it to your %DomHonorific% or chose yourself?", 0);
answer.loop();
}
}
return domChose;
}
function setupToys(settings) {
sendVirtualAssistantMessage("Let's do a quick setup of your toys");
sendVirtualAssistantMessage("I'll show you some images of different stuff");
sendVirtualAssistantMessage("You will respond with yes if you have it");
sendVirtualAssistantMessage("You can also say yes if you have something similar that will work fine");
sendVirtualAssistantMessage("Respond with no if you have nothing similar");
sendVirtualAssistantMessage("Oh and one more thing...");
let domChose = askForDomChoose();
//Ask for this in settings too
BUTTPLUG_TOY.askForToyAndUsage(domChose);
DILDO_TOY.askForToyAndUsage(domChose);
//Skip buttplug and dildos if we are in the settings
if (!settings) {
if (BUTTPLUG_TOY.hasToy()) {
if (buttplugs.length > 0 && !settings) {
sendVirtualAssistantMessage('Since you already have buttplugs setup, we are not gonna setup any additional plugs now. You can always add new plugs in the main menu.');
} else {
sendVirtualAssistantMessage('Okay %SlaveName%. Tell me, how many different buttplugs do you have?', false);
let answer = createInput();
while (true) {
if (answer.isInteger()) {
const result = answer.getInt();
if (result <= 0) {
sendVirtualAssistantMessage("You can't choose a number equal to 0 or lower", 0);
answer.loop();
} else {
sendVirtualAssistantMessage('We are gonna setup your buttplugs now, one by one.');
for (let x = 0; x < result; x++) {
setupNewButtplug();
}
sendVirtualAssistantMessage('This should do it regarding plugs');
sendVirtualAssistantMessage('You can always setup new buttplugs in the settings menu');
break;
}
} else {
sendVirtualAssistantMessage("Please only enter a number such as 1 now.", 0);
answer.loop();
}
}
}
}
sendVirtualAssistantMessage(random("Okay then...", "Next...", "Let's see...", "Moving on..."));
if (DILDO_TOY.hasToy()) {
if (DILDOS.length > 0 && !settings) {
sendVirtualAssistantMessage('Since you already have dildos setup, we are not gonna setup any additional dildos now. You can always add new dildos in the main menu.');
} else {
sendVirtualAssistantMessage('Okay %SlaveName%. Tell me, how many different dildos do you have?', false);
let answer = createInput();
while (true) {
if (answer.isInteger()) {
const result = answer.getInt();
if (result <= 0) {
sendVirtualAssistantMessage("You can't choose a number equal to 0 or lower", 0);
answer.loop();
} else {
sendVirtualAssistantMessage('We are gonna setup your dildos now, one by one.');
for (let x = 0; x < result; x++) {
setupNewDildo();
}
sendVirtualAssistantMessage('This should do it regarding dildos');
sendVirtualAssistantMessage('You can always setup new dildos in the settings menu');
break;
}
} else {
sendVirtualAssistantMessage("Please only enter a number such as 1 now.", 0);
answer.loop();
}
}
}
sendVirtualAssistantMessage(random("Okay then...", "Next...", "Let's see...", "Moving on..."));
}
}
BALL_CRUSHER_TOY.askForToyAndUsage(domChose);
sendVirtualAssistantMessage(random("Okay then...", "Next...", "Let's see...", "Moving on..."));
INFLATABLE_BUTT_PLUG.askForToyAndUsage(domChose);
//Only if the sub has the toy we should ask this
if (INFLATABLE_BUTT_PLUG.hasToy()) {
INFLATABLE_BUTT_PLUG.askForVibration();
}
COLLAR_TOY.askForToyAndUsage(domChose);
sendVirtualAssistantMessage(random("Okay then...", "Next...", "Let's see...", "Moving on..."));
//In settings this is a separate thing
if (!settings) {
setupEStimToy(domChose, settings);
}
setupGags(domChose);
sendVirtualAssistantMessage(random("Okay then...", "Next...", "Let's see...", "Moving on..."));
PANTY_TOY.askForToyAndUsage(domChose, undefined, "basicLingerie");
if (PANTY_TOY.hasToyVar() && !settings) {
askForMultipleToyCount(PANTY_TOY);
}
BRA_TOY.askForToyAndUsage(domChose, undefined, "basicLingerie");
if (BRA_TOY.hasToyVar() && !settings) {
askForMultipleToyCount(BRA_TOY);
}
GARTER_BELT_TOY.askForToyAndUsage(domChose, undefined, "advancedLingerie");
STOCKING_TOY.askForToyAndUsage(domChose, undefined, "advancedLingerie");
if (STOCKING_TOY.hasToyVar() && !settings) {
askForMultipleToyCount(STOCKING_TOY);
}
HIGH_HEEL_TOY.askForToyAndUsage(domChose, undefined);
if (HIGH_HEEL_TOY.hasToyVar() && !settings) {
askForMultipleToyCount(HIGH_HEEL_TOY);
}
HIGH_HEEL_LOCK.askForToyAndUsage(domChose);
sendVirtualAssistantMessage(random("Okay then...", "Next...", "Let's see...", "Moving on..."));
PARACHUTE_TOY.askForToyAndUsage(domChose);
sendVirtualAssistantMessage(random("Okay then...", "Next...", "Let's see...", "Moving on..."));
ANAL_BEADS_TOY.askForToyAndUsage(domChose);
sendVirtualAssistantMessage(random("Okay then...", "Next...", "Let's see...", "Moving on..."));
ANAL_HOOK_TOY.askForToyAndUsage(domChose);
sendVirtualAssistantMessage(random("Okay then...", "Next...", "Let's see...", "Moving on..."));
PROSTATE_VIBRATOR_TOY.askForToyAndUsage(domChose);
sendVirtualAssistantMessage(random("Okay then...", "Next...", "Let's see...", "Moving on..."));
BULLET_VIBRATOR_TOY.askForToyAndUsage(domChose);
sendVirtualAssistantMessage(random("Okay then...", "Next...", "Let's see...", "Moving on..."));
MAGIC_WAND_TOY.askForToyAndUsage(domChose);
sendVirtualAssistantMessage(random("Okay then...", "Next...", "Let's see...", "Moving on..."));
ICY_HOT_TOY.askForToyAndUsage(domChose);
sendVirtualAssistantMessage(random("Okay then...", "Next...", "Let's see...", "Moving on..."));
ENEMA_TOY.askForToyAndUsage(domChose);
sendVirtualAssistantMessage(random("Okay then...", "Next...", "Let's see...", "Moving on..."));
NOSE_HOOK.askForToyAndUsage(domChose);
sendVirtualAssistantMessage(random("Okay then...", "Next...", "Let's see...", "Moving on..."));
HOOD_TOY.askForToyAndUsage(domChose);
sendVirtualAssistantMessage(random("Okay then...", "Next...", "Let's see...", "Moving on..."));
SOUND_TOY.askForToyAndUsage(domChose);
sendVirtualAssistantMessage(random("Okay then...", "Next...", "Let's see...", "Moving on..."));
URETHRAL_STRETCHER_TOY.askForToyAndUsage(domChose);
sendVirtualAssistantMessage(random("Okay then...", "Next...", "Let's see...", "Moving on..."));
HUMBLER_TOY.askForToyAndUsage(domChose);
sendVirtualAssistantMessage(random("Okay then...", "Next...", "Let's see...", "Moving on..."));
BALL_STRETCHER_TOY.askForToyAndUsage(domChose);
sendVirtualAssistantMessage(random("Okay then...", "Next...", "Let's see...", "Moving on..."));
LOVENSE_TOY_TYPES.MAX.askForToyAndUsage(domChose);