/
ChastityCage.js
1319 lines (1053 loc) · 51 KB
/
ChastityCage.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 SUBTRACT_PER_CHASTITY_PUNISHMENT_STAGE = 30;
const CHASTITY_TYPE_SMALL = 1;
const CHASTITY_TYPE_BIG = 0;
const CHASTITY_CAGES = [];
let currentChastityCage;
loadChastityCages();
if (isVar(VARIABLE.ACTIVE_CHASTITY_CAGE)) {
currentChastityCage = getChastityCageByName(getVar(VARIABLE.ACTIVE_CHASTITY_CAGE));
if (!isUndefined(currentChastityCage)) {
sendDebugMessage('Active chastity cage: ' + currentChastityCage.name);
}
} else {
currentChastityCage = null;
}
const BALL_TRAP_TYPE = {
FULL_BELT: 0,
BALL_TRAP: 1,
};
function getActiveChastityCage() {
if (currentChastityCage === null || currentChastityCage === undefined) {
if (CHASTITY_CAGES.length == 0) {
return null;
} else {
return CHASTITY_CAGES[0];
}
} else {
return currentChastityCage;
}
}
function isChastityUnlockBlocked() {
let result = RULE_LOCKTOBER.isEffectivelyActive();
if(result) {
sendDebugMessage('Chastity unlock blocked');
}
return result;
}
function unlockChastityCage(fakeOpening = false) {
if (!getVar(VARIABLE.HAS_CHASTITY) || !getVar(VARIABLE.CHASTITY_ON)) {
return;
}
unlockChastityKey();
sendMessage("%SlaveName%");
if (fakeOpening || feelsEvil()) {
sendMessage(random('In a moment', 'In a second', 'In a few moments', 'In a few seconds') + ' I am gonna ' + random('allow you to', '') + ' unlock %MyYour% poor little cock');
sendMessage(random('But', 'However') + random(' today I really want you to savor the moment', ' it will be a bit different today', ' today will be different',
' we are gonna take it slow today', ' I want you to savor the moment'));
sendMessage(random('You will not completely unlock %MyYour% cock unless I specifically stated it', 'You will not rush it and do as I say', 'You will not unlock it without my explicit permission',
'You will obey me and not unlock it without my explicit permission'));
sendMessage('%Now%');
sendMessage('Put the key into the lock of the cage %Grin%');
sleep(randomInteger(5, 10));
sendMessage(random('Feel %MyYour% %Cock% aching to be free', 'Feel %MyYour% %Cock% throbbing and waiting to be finally free', 'Think about how the freedom will feel'));
sleep(randomInteger(5, 10));
sendMessage('%Moan%');
sleep(randomInteger(5, 10));
let chanceToAbort = 20;
sendMessage('And...');
if (fakeOpening && isChance(chanceToAbort)) {
sendMessage('Pull the key out again %Lol%');
return;
}
chanceToAbort += 20;
sendMessage(random('Twist the key in the lock', 'Twist the key', 'Open the lock by twisting the key'));
sleep(randomInteger(5, 10));
if (sendYesOrNoQuestion(random('So close to freedom', 'So excited', 'So thrilled') + ' aren\'t you?')) {
//QUALITY: More diversity
sendMessage('Mhmmm yes you are %Grin%');
} else {
sendMessage('No? I wonder why you feel that way %Lol%');
}
sleep(randomInteger(5, 10));
sendMessage('%Now%');
if (fakeOpening && isChance(chanceToAbort)) {
sendMessage('Lock the lock right up again %Lol%');
return;
}
chanceToAbort = 100;
sendMessage('Remove the lock but keep holding the cage in place');
sendMessage(random('The cage stays on until I give you the permission to remove it completely', 'Wait for my command', 'Do not remove it completely yet', 'Keep it in place') + ' %SlaveNameSmiley%');
sleep(randomInteger(5, 10));
sendMessage(random('So close!', 'Only a few more moments till freedom', 'Just a few more moments till freedom', 'Hard to ignore that %Cock% crying out for freedom isn\'t it?') + ' %Lol%');
sleep(randomInteger(5, 10));
if (fakeOpening) {
sendMessage('Put the lock back on and lock everything back up %SlaveName% %Lol%');
return;
}
//Now the normal thing as always
}
lockImages();
showImage("Images/Spicy/Chastity/ChastityOff/*.{jpg,png,gif}");
if (randomInteger(0, 2) == 2) playSound("Audio/Spicy/Chastity/ChastityOff/*.mp3");
sendMessage(random("Remove your %ChastityCage%", "Get your %ChastityCage% off", "Remove the %ChastityCage% at once", "Hurry up and remove the %ChastityCage%", "Be quick and get your %ChastityCage% off"));
let timeout = randomInteger(50, 60);
if (getStrictnessForCharacter() == 1) {
timeout = randomInteger(40, 50);
} else if (getStrictnessForCharacter() == 2) {
timeout = randomInteger(30, 40);
}
const answer = sendInput(random("Let me know when you're done...", "Report to me when it's off", "Remember to tell me when it's off"), timeout);
let loop = 0;
while (true) {
if (answer.isTimeout()) {
loop++;
if (loop > 1) {
sendMessage(random("You've taken way too long to get that %ChastityCage% off...", "You are taking way to long to get that %ChastityCage% off", "It took you too long to get that cage off..."));
sendMessage(random("I don't like when you make me wait", "I don't like to wait", "I don't like waiting"));
sendMessage(random("I'm giving you punishment points", "I've assigned you some punishment points", "I've increased your number of punishment points"));
addPunishmentPoints(100, PUNISHMENT_REASON.TOO_SLOW);
break;
} else {
sendMessage(random("Quicker!", "Faster", "Be faster", "Hurry up!", "Be quick", "Come on!", "Be quick...", "Be faster will you?", "Be faster!"), 0);
changeMeritMedium(true);
answer.loop();
}
} else if (answer.isLike("done", "off", "uncaged", "unlocked", "out", "belt", "yes", "ready")) {
if (loop == 1) {
sendMessage(random("Finally", "About time...", "Took you long enough", "Be faster next time", "Don't waste my time again..."));
break;
} else {
sendMessage("%Good%");
break;
}
} else {
sendMessage('Don\'t bother me if you aren\'t done yet...', 0);
answer.loop();
}
}
setVar(VARIABLE.CHASTITY_ON, false);
unlockImages();
//Set the date to today then by default so in 2 days we can ask if the cage wasn't cleaned
if (!isVar(VARIABLE.LAST_CHASTITY_CLEAN)) {
setDate(VARIABLE.LAST_CHASTITY_CLEAN);
}
if (getDate(VARIABLE.LAST_CHASTITY_CLEAN, setDate()).clone().addDay(2).hasPassed() && RULE_DOMME_KEYHOLDER.isActive()) {
if (sendYesOrNoQuestion('You haven\'t cleaned your cage and %MyYour% cock in the last two days, have you?')) {
sendMessage('Oh you have?');
if (sendYesOrNoQuestion('Strange, I could\'ve sworn I didn\'t allow you to take it off did I?')) {
addPPRuleIgnored();
sendMessage('That\'s now what I wanted to hear')
} else {
sendMessage('I must have forgotten');
}
} else {
sendMessage('Sigh...');
changeMeritMedium(true);
sendMessage('Go and do it now! You got 5 minutes %SlaveName%');
sendMessage('Tell me when you are done...');
waitForDone(60 * 5);
sendMessage('Now that\'s a clean %Cock% I can work with');
}
setDate(VARIABLE.LAST_CHASTITY_CLEAN);
}
return;
}
function getMaxChastitySize() {
let mood = getMood();
let strictness = getStrictnessForCharacter();
//Smaller size if we feel like punishing
let subtract = feelsLikePunishingSlave() ? 1 : 0;
let maxWithoutRange = 9 - (Math.max(1, strictness) + Math.max(1, mood) + Math.min(1, mood) + subtract);
sendDebugMessage('Max chastity cage size: ' + maxWithoutRange);
return Math.max(1, Math.min(5, maxWithoutRange));
}
function getMinChastitySize() {
if (getStrictnessForCharacter() === 2) {
return Math.max(1, getMaxChastitySize() - 2);
} else if (getStrictnessForCharacter() === 1) {
return Math.max(1, getMaxChastitySize() - randomInteger(1, 2));
} else {
return Math.max(1, getMaxChastitySize() - 1);
}
}
function findAvailableClosestToSize(length) {
sendDebugMessage('Searching for cage with length: ' + length);
//let currentCage = null;
//Negative if size < found size and positive if size > found size
let currentSizeDifference = null;
for (let y = 0; y < CHASTITY_CAGES.length; y++) {
let foundDifference = length - CHASTITY_CAGES[y].length;
if (currentSizeDifference === null) {
//currentCage = CHASTITY_CAGES[y];
currentSizeDifference = foundDifference;
}
//Check if we found the perfect fitting size
else if (currentSizeDifference !== 0 && foundDifference === 0) {
currentSizeDifference = 0;
//Found the perfect match
break;
}
//Check if we found something that is closer
else if (Math.abs(currentSizeDifference) > Math.abs(foundDifference)) {
currentSizeDifference = foundDifference;
}
//Check if we found something that's equal in value
else if (Math.abs(currentSizeDifference) === Math.abs(foundDifference)) {
//Use the bigger one
if (getStrictnessForCharacter() === 0) {
currentSizeDifference = Math.max(currentSizeDifference, foundDifference);
}
//Use the smaller one
else {
currentSizeDifference = Math.min(currentSizeDifference, foundDifference);
}
}
//Otherwise we don't care about that cage right now
}
return length - currentSizeDifference;
}
function getRandomCageWithSize(length, punishments) {
//Return default cage
if (CHASTITY_CAGES.length === 1) {
sendDebugMessage('Only found one cage, so returning the only cage');
return CHASTITY_CAGES[0];
}
let cages = [];
sendDebugMessage('Searching cage with length ' + length + ' and ' + punishments + ' punishments');
for (let y = 0; y < CHASTITY_CAGES.length; y++) {
let currentCage = CHASTITY_CAGES[y];
let punishmentOptionsOfCage = 0;
//No !== because one seems to be a string the other a number or something, so we need cross type comparison
if (currentCage.length != length) {
continue
}
//Skip cages with accessible penis for daily use
if (currentCage.penisAccessible) {
continue
}
if (currentCage.dialator) {
punishmentOptionsOfCage++;
//If we can't remove it but want no punishments this is not the right cage to go with
if (punishments === 0 && !currentCage.dialatorDetachable) {
sendDebugMessage('Skipping ' + currentCage.name + ' because dialator is not detachable');
continue;
}
}
if (currentCage.spikes) {
punishmentOptionsOfCage++;
//If we can't remove it but want no punishments this is not the right cage to go with
if (punishments === 0 && !currentCage.spikesDetachable) {
sendDebugMessage('Skipping ' + currentCage.name + ' because spikes are not detachable');
continue;
}
}
if (currentCage.estim) {
punishmentOptionsOfCage++;
}
//Punishment of smaller cage (check if we can find a smaller cage)
if (punishments > 0 && length > 1) {
sendDebugMessage('Looking for a smaller cage to replace a punishment option of ' + punishments + ' total');
if (getRandomCageWithSize(length - 1, punishments - 1).length === length - 1) {
punishmentOptionsOfCage++;
}
}
//Fitting size and enough punishment options
//No === because one seems to be a string the other a number or something, so we need cross type comparison
if (currentCage.length == length && punishmentOptionsOfCage >= punishments) {
cages.push(currentCage);
sendDebugMessage('Pushing cage ' + currentCage.name + ' to available list');
}
}
if (cages.length === 0) {
if (punishments > 0) {
//Reduce amount of punishments by one (if we can)
return getRandomCageWithSize(length, punishments - 1);
} else if (length < 5) {
//Increase length but also increase punishments
return getRandomCageWithSize(length + 1, punishments + 1);
} else {
sendDebugMessage('Returning random cage, because no fitting cage found');
return random(CHASTITY_CAGES);
}
} else {
return cages[randomInteger(0, cages.length - 1)];
}
}
/*function getChastityCageSelection(punishmentChance) {
let size = randomInteger(getMinChastitySize(), getMaxChastitySize());
let smallChance = punishmentChance - SUBTRACT_PER_CHASTITY_PUNISHMENT_STAGE;
if(!getVar(VARIABLE.HAS_CHASTITY_SMALL_PUNISHMENT_CAGE, false)) {
return 0;
}
if(getVar(VARIABLE.CHASTITY_SMALL_HAS_DILATOR, false)) {
smallChance -= SUBTRACT_PER_CHASTITY_PUNISHMENT_STAGE;
}
if(getVar(VARIABLE.CHASTITY_SMALL_HAS_SPIKES, false)) {
smallChance -= SUBTRACT_PER_CHASTITY_PUNISHMENT_STAGE;
}
let bigChance = punishmentChance;
if(getVar(VARIABLE.CHASTITY_HAS_DILATOR, false)) {
bigChance -= SUBTRACT_PER_CHASTITY_PUNISHMENT_STAGE;
}
if(getVar(VARIABLE.CHASTITY_HAS_SPIKES, false)) {
bigChance -= SUBTRACT_PER_CHASTITY_PUNISHMENT_STAGE;
}
if(bigChance < 50 && smallChance < 50) {
//Both
return 3;
} else if(bigChance == smallChance) {
//Both
return 3;
} else if(bigChance > smallChance) {
//Small
return 1;
} else {
//Big only
return 0;
}
}*/
function selectChastityCage() {
let mood = getMood();
let punishmentChance = mood * 20 + (getStrictnessForCharacter() * 20 - (VERY_ANNOYED_MOOD - mood) * 10) - SUBTRACT_PER_CHASTITY_PUNISHMENT_STAGE * 0.5;
sendDebugMessage('Punishment Chastity Chance: ' + punishmentChance + ' for mood ' + mood + ' and strictness ' + getStrictnessForCharacter());
sendDebugMessage("Min chastity size: " + getMinChastitySize());
let length = findAvailableClosestToSize(randomInteger(getMinChastitySize(), getMaxChastitySize()));
//let chastityCageSelection = getChastityCageSelection(punishmentChance);
let amountOfPunishments = 0;
//First punishment roll
if (isChance(punishmentChance)) {
amountOfPunishments++;
punishmentChance -= SUBTRACT_PER_CHASTITY_PUNISHMENT_STAGE;
//Second punishment roll
if (isChance(punishmentChance)) {
amountOfPunishments++;
punishmentChance -= SUBTRACT_PER_CHASTITY_PUNISHMENT_STAGE;
}
}
sendDebugMessage('Searching for cage with size ' + length + ' and punishments ' + amountOfPunishments);
let cage = getRandomCageWithSize(length, amountOfPunishments);
if (cage == null) {
sendDebugMessage('Found no chastity cage in a list of ' + CHASTITY_CAGES.length + ' cages in total');
return null;
}
sendDebugMessage('Found cage ' + cage.name + " with length " + cage.length + " and " + cage.getPunishmentOptions() + " punish options ");
let punishments = new java.util.ArrayList();
//Smaller cage punishment, we need to go smaller until we find no other alternative
do {
if (cage.length > 1 && amountOfPunishments > 0) {
let smallerCage = getRandomCageWithSize(cage.length - 1, amountOfPunishments - 1);
sendDebugMessage("Looking for smaller cage as punishment and got " + smallerCage.name + " with length " + smallerCage.length);
if (smallerCage.length === cage.length - 1) {
sendDebugMessage('Found fitting smaller cage. Rolling for chance to replace one punishment');
//Either not feeling like punishing then go smaller or not enough punishment options
if (!feelsLikePunishingSlave() || cage.getPunishmentOptions() < amountOfPunishments) {
cage = smallerCage;
amountOfPunishments--;
sendDebugMessage('Selected smaller cage as punishment');
sendDebugMessage('Remaining punishments: ' + amountOfPunishments);
}
} else {
break;
}
} else {
break;
}
} while (cage.getPunishmentOptions() < amountOfPunishments);
setVar(VARIABLE.CHASTITY_DILATOR_ON, false);
setVar(VARIABLE.CHASTITY_SPIKES_ON, false);
setVar(VARIABLE.CHASTITY_ESTIM_ON, false);
if (cage.spikes) {
//If spikes are forced we need to calculate that into the remaining chance
if (!cage.spikesDetachable) {
amountOfPunishments--;
setVar(VARIABLE.CHASTITY_SPIKES_ON, true);
sendDebugMessage('Set spikes as punishment due to being forced by the cage');
} else {
//Spikes aren't forced so we should roll for it
punishments.add(0);
sendDebugMessage('Added spikes as punishment option');
}
}
if (cage.dialator) {
//If dilator is forced we need to calculate that into the remaining chance
if (!cage.dialatorDetachable) {
amountOfPunishments--;
setVar(VARIABLE.CHASTITY_DILATOR_ON, true);
sendDebugMessage('Set dilator as punishment due to being forced by the cage');
} else {
//Dilator isn't forced so we should roll for it
punishments.add(1);
sendDebugMessage('Added dilator as punishment option');
}
}
if (cage.estim) {
//Estim isn't forced so we should roll for it
punishments.add(2);
sendDebugMessage('Added estim as punishment option');
}
//Randomize punishment rolling order
while (!punishments.isEmpty() && amountOfPunishments > 0) {
let index = randomInteger(0, punishments.size() - 1);
switch (punishments.get(index)) {
case 0:
setVar(VARIABLE.CHASTITY_SPIKES_ON, true);
sendDebugMessage('Selected spikes as punishment');
break;
case 1:
setVar(VARIABLE.CHASTITY_DILATOR_ON, true);
sendDebugMessage('Selected dilator as punishment');
break;
case 2:
setVar(VARIABLE.CHASTITY_ESTIM_ON, true);
sendDebugMessage('Selected estim as punishment');
break;
}
//We will definitely apply a punishment so we can reduce this
amountOfPunishments--;
sendDebugMessage('Remaining punishments: ' + amountOfPunishments);
//No reuse of that punishment right now
punishments.remove(index);
}
return cage;
}
//TODO: Add force punishment (spikes etc.) when locked up for punishment
function lockChastityCage(chastityCage = undefined) {
if (!getVar(VARIABLE.HAS_CHASTITY, false) || getVar(VARIABLE.CHASTITY_ON)) {
return;
}
sendMessageBasedOnSender("%SlaveName%");
if (BODY_PART_PENIS_HEAD.currentClamps > 0 || BODY_PART_PENIS_SHAFT.currentClamps > 0 || BODY_PART_BALLS.currentClamps > 0) {
sendMessageBasedOnSender('Go ahead and remove all clamps from your penis and balls');
sendMessageBasedOnSender('Tell me when you are done');
waitForDone();
if(isChance(50)) {
sendArentINice();
}
//Set clamps on those parts to zero
BODY_PART_PENIS_SHAFT.currentClamps = 0;
BODY_PART_PENIS_HEAD.currentClamps = 0;
BODY_PART_BALLS.currentClamps = 0;
}
lockImages();
showImage("Images/Spicy/Chastity/ChastityOn/*.{jpg,png,gif}");
if (randomInteger(0, 2) === 2) playSound("Audio/Spicy/Chastity/ChastityOn/*.mp3");
if (chastityCage === null || chastityCage === undefined) {
chastityCage = selectChastityCage();
}
if (chastityCage === null || chastityCage === undefined) {
sendMessage('For some reason I can\'t decide on a chastity cage today (bug)');
sendMessage('I figure I\'ll just not lock you up.');
return;
}
chastityCage.fetchChastityCage();
let alreadyAttached = false;
if (getVar(VARIABLE.CHASTITY_SPIKES_ON, false)) {
sendMessageBasedOnSender('I want you to attach the spikes to it %Grin%');
alreadyAttached = true;
if (chastityCage.spikesVariable) {
let min = Math.max(1, Math.round(chastityCage.spikesVariableAmount * 0.25));
let max = Math.round(chastityCage.spikesVariableAmount * 0.25 * (getMood() + 1));
let spikes = randomInteger(min, max);
sendMessageBasedOnSender('I want you to attach a total of ' + spikes + ' spikes to it');
let percentage = random(25, 50);
if (feelsLikePunishingSlave()) {
percentage = random(50, 75, 100);
}
sendMessageBasedOnSender('Turn each screw till it\'s ' + percentage + '% in %Grin%');
}
} else if (chastityCage.spikesVariable) {
sendMessageBasedOnSender('You may remove all spikes currently attached to the cage %EmoteHappy%');
sendMessage('Tell me when you are done');
waitForDone();
}
if (getVar(VARIABLE.CHASTITY_DILATOR_ON, false)) {
if (!alreadyAttached) {
sendMessageBasedOnSender('I want you to attach the dilator to it %Grin%');
} else {
sendMessageBasedOnSender('And I want you to attach the dilator to it too %Lol%');
if (chastityCage.length < 3) {
sendMessageBasedOnSender('We are going full punishment mode %SlaveName%');
sendMessageBasedOnSender('You know you don\'t deserve anything different %GeneralTime% %Lol%');
} else {
sendMessageBasedOnSender('Be happy that I am not putting you into your small punishment cage as well %Grin%');
}
}
alreadyAttached = true;
}
if (getVar(VARIABLE.CHASTITY_ESTIM_ON, false)) {
if (alreadyAttached) {
sendMessageBasedOnSender('And...');
}
sendMessageBasedOnSender('I want you to put on a painful estim stimulation every other hour for 15 minutes as long as you are awake %Wicked%');
sendMessageBasedOnSender('Further I want you to do that for 30 minutes before going to bed as well');
sendMessageBasedOnSender('If you have to skip it it will accumulate and add to the next hour %Grin%');
if (alreadyAttached) {
sendMessageBasedOnSender('We are going full punishment mode %SlaveName%');
sendMessageBasedOnSender('You know you don\'t deserve anything different %GeneralTime% %Lol%');
}
}
if (alreadyAttached) {
sendMessageBasedOnSender('Tell me when you have everything around %SlaveName%');
waitForDone();
sendMessageBasedOnSender('%Good%');
}
sendMessageBasedOnSender('And next...');
currentChastityCage = chastityCage;
sendMessageBasedOnSender(random("Put on your %ChastityCage%", "Put on the %ChastityCage% at once", "Hurry up and get the %ChastityCage% back on", "Be quick and get your %ChastityCage% back on", "Lock %MyYour% %Cock% up"));
const chastityLevel = getVar(VARIABLE.CHASTITY_LEVEL);
let timeout = randomInteger(120 - chastityLevel, 180 - chastityLevel);
if (getStrictnessForCharacter() == 1) {
timeout = randomInteger(110 - chastityLevel, 160 - chastityLevel);
} else if (getStrictnessForCharacter() == 2) {
timeout = randomInteger(100 - chastityLevel, 140 - chastityLevel);
}
//Slower timeout for the dilator / spikes
if (getVar(VARIABLE.CHASTITY_DILATOR_ON, false) || getVar(VARIABLE.CHASTITY_SPIKES_ON, false)) {
timeout *= 5;
}
const answer = sendInput(random("Let me know when you're done...", "Report to me when it's on", "Remember to tell me when it's on"), timeout);
let loop = 0;
while (true) {
if (answer.isTimeout()) {
loop++;
if (loop > 1) {
sendMessageBasedOnSender(random("You've taken way too long to get that %ChastityCage% on...", "You are taking way to long to get that %ChastityCage% on", "It took you too long to get that cage on..."));
if (chastityLevel < 20) {
sendMessageBasedOnSender(random("But since you're in chastity training", "But due to you being in chastity training", "But because of your chastity training") + " I won't punish you...");
} else {
if (!isForcedLockedUp()) {
sendMessageBasedOnSender("So as a punishment I'm placing you in the %ChastityCage% for the next 24 hours...")
} else {
sendMessageBasedOnSender("So as a punishment I'm increasing your lock up period by 24 hours...")
}
changeMeritHigh(true);
//Punish slave even more
if (feelsLikePunishingSlave()) {
if (chastityCage.spikes && !getVar(VARIABLE.CHASTITY_SPIKES_ON, false)) {
sendMessageBasedOnSender('I want you to attach the spikes to it %Grin%');
setVar(VARIABLE.CHASTITY_SPIKES_ON, true);
alreadyAttached = true;
} else if (chastityCage.dialator && !getVar(VARIABLE.CHASTITY_DILATOR_ON, false)) {
if (!alreadyAttached) {
sendMessageBasedOnSender('I want you to attach the dilator to it %Grin%');
} else {
sendMessageBasedOnSender('And I want you to attach the dilator to it too %Lol%');
if (chastityCage.length < 3) {
sendMessageBasedOnSender('We are going full punishment mode %SlaveName%');
sendMessageBasedOnSender('You know you don\'t deserve anything different %GeneralTime% %Lol%');
} else {
sendMessageBasedOnSender('Be happy that I am not putting you into your small punishment cage as well %Grin%');
}
}
alreadyAttached = true;
}
}
addLockUpTime(24);
if (getCBTLimit() == LIMIT_ASKED_YES) {
sendMessageBasedOnSender('And to get that %Cock% into its cage quickly now...');
let options = new java.util.ArrayList();
options.add(0);
options.add(1);
options.add(2);
let punishments = 0;
while (punishments === 0) {
let option = options.get(randomInteger(0, options.size() - 1));
options.remove(option);
switch (option) {
case 0:
if (hasTigerHot() && fetchToy('icy hot')) {
sendMessageBasedOnSender('I want you to spread some icy hot on your shaft, balls and glans %Grin%');
sendMessageBasedOnSender('That cock doesn\'t deserve any different and because it won\'t obey it will need to suffer');
sendMessageBasedOnSender('When you are done wait for it to be soft');
sendMessageBasedOnSender('I don\'t care how long it takes or how much it hurts, just report back to me %Lol%');
waitForDone(100000);
sendMessageBasedOnSender('%Good%. Now lock that %Cock% up already');
punishments++;
break;
}
case 1:
sendMessageBasedOnSender('Bring me a bowl with some water in it and...');
if (askAndFetchIceCubesWithConsequences(5)) {
sendMessageBasedOnSender('Put those ice cubes into the bowl and dip your balls and cock into it until they are soft %Grin%');
sendMessageBasedOnSender('I don\'t care how long it takes or how much it hurts, just report back to me %Lol%');
waitForDone(100000);
sendMessageBasedOnSender('%Good%. Now lock that %Cock% up already');
punishments++;
break;
}
case 2:
smallCBTPunishment();
sendMessageBasedOnSender('I hope for your sake that it is soft now');
//Max 5 times
for (let x = 0; x < 5; x++) {
if (sendYesOrNoQuestion('Tell me %SlaveName%. Is it soft?')) {
break;
} else {
sendMessage(random('Which means', 'Seems like') + ' I am not done yet %Grin%');
smallCBTPunishment();
}
}
sendMessageBasedOnSender('Now lock that %Cock% up already');
punishments++;
break;
}
}
}
}
break;
} else {
sendMessageBasedOnSender(random("Quicker!", "Faster", "Be faster", "Hurry up!", "Be quick", "Come on!", "Be quick...", "Be faster will you?", "Be faster!"), 0);
changeMeritMedium(true);
answer.loop();
}
} else if (answer.isLike("done", "on", "caged", "locked", "lock", "belt", "yes", "ready")) {
if (loop == 1) {
sendMessageBasedOnSender(random("Finally", "About time...", "Took you long enough", "Be faster next time", "Don't waste my time again..."));
break;
} else {
sendMessageBasedOnSender("%Good%");
break;
}
} else {
sendMessageBasedOnSender('Don\'t bother me if you aren\'t done yet...', 0);
answer.loop();
}
}
setVar(VARIABLE.CHASTITY_ON, true);
setVar(VARIABLE.ACTIVE_CHASTITY_CAGE, chastityCage.name);
}
function loadChastityCages() {
//No var or no chastity cages anyway
if (!isVar('chastityCages') || !hasChastityCage()) {
setVar('chastityCages', new java.util.ArrayList());
} else {
let saveCages = false;
let arrayList = tryGetArrayList('chastityCages');
for (let x = 0; x < arrayList.size(); x++) {
let entry = arrayList.get(x);
let chastityCage = createChastityCage().fromString(entry);
CHASTITY_CAGES.push(chastityCage);
if (currentChastityCage === null) {
currentChastityCage = CHASTITY_CAGES[0];
}
if (isUndefinedString(chastityCage.dialator)) {
chastityCage.dialator = false;
saveCages = true;
}
if (isUndefinedString(chastityCage.dialatorDetachable)) {
chastityCage.dialatorDetachable = false;
saveCages = true;
}
if (isUndefinedString(chastityCage.spikes)) {
chastityCage.spikes = false;
saveCages = true;
}
if (isUndefinedString(chastityCage.spikesDetachable)) {
chastityCage.spikesDetachable = false;
saveCages = true;
}
if (isUndefinedString(chastityCage.spikesOverall)) {
chastityCage.spikesOverall = false;
saveCages = true;
}
if (isUndefinedString(chastityCage.spikesVariable)) {
chastityCage.spikesVariable = false;
saveCages = true;
}
if (isUndefinedString(chastityCage.spikesVariableAmount)) {
chastityCage.spikesVariableAmount = 0;
saveCages = true;
}
if (isUndefinedString(chastityCage.penisAccessible)) {
chastityCage.penisAccessible = false;
saveCages = true;
}
if (isUndefinedString(chastityCage.estim)) {
chastityCage.estim = false;
saveCages = true;
}
}
setVar(VARIABLE.HAS_CHASTITY, CHASTITY_CAGES.length > 0);
if (saveCages) {
saveChastityCages();
}
}
}
function saveChastityCages() {
let arrayList = new java.util.ArrayList();
for (let y = 0; y < CHASTITY_CAGES.length; y++) {
arrayList.add(CHASTITY_CAGES[y].toString());
}
setVar('chastityCages', arrayList);
}
function getChastityCageByName(name) {
for (let y = 0; y < CHASTITY_CAGES.length; y++) {
if (name.toUpperCase() === CHASTITY_CAGES[y].name.toUpperCase()) {
return CHASTITY_CAGES[y];
}
}
return null;
}
function getChastityCageWithBool(attribute) {
for (let y = 0; y < CHASTITY_CAGES.length; y++) {
if (CHASTITY_CAGES[y][attribute]) {
return CHASTITY_CAGES[y];
}
}
return null;
}
function setupNewCage() {
sendVirtualAssistantMessage('Please enter a name for your new chastity cage', 0);
let answer = createInput();
let name = 'undefined';
while (true) {
if (getChastityCageByName(answer.getAnswer()) !== null) {
sendVirtualAssistantMessage('A chastity cage with a similar name already exists. Please choose a different name.', 0);
answer.loop();
} else {
name = answer.getAnswer();
break;
}
}
sendVirtualAssistantMessage('Please make sure to add a picture of your cage named like your chastity cage to your Toys/Chastity Cages folder.', false);
sleep(2);
sendVirtualAssistantMessage('So in this case make sure to add a picture called "' + name + '.jpg" to the chastity cages folder', false);
sleep(2);
sendVirtualAssistantMessage('If it already exists a picture of it should show up now', false, true);
showImage(getChastityImagePath(name), 5);
sendVirtualAssistantMessage('We are gonna use a scale of 1 to 5 to measure the size of the cage');
sendVirtualAssistantMessage('1 being the smallest and something like this (35mm length)', 0);
showImage('Images/Spicy/Toys/chastityCageSmall.*', 5);
sendVirtualAssistantMessage('5 being the biggest and something like this (140mm length)', 0);
showImage('Images/Spicy/Toys/chastityCageBig.*', 5);
setCurrentSender(SENDER_ASSISTANT);
let length = createIntegerInput('So just give me a number on a scale of 1 - 5 %SlaveName%', 1, 5, 'That\'s not a number... Give me something like 2 or 4', 'That number is not on the scale. Remember on a scale of 1 - 5 %SlaveName%');
if (length >= 4) {
sendVirtualAssistantMessage('That\'s quite big');
sendVirtualAssistantMessage('I guess %DomHonorific% %DomName% will only allow this cage if you have been behaving properly %Grin%');
} else if (length == 3) {
sendVirtualAssistantMessage('A medium sized cage is always good %Grin%');
} else {
sendVirtualAssistantMessage('A tiny cage for her %Cock%?');
sendVirtualAssistantMessage('%DomHonorific% %DomName% will definitely like that %Lol%');
sendVirtualAssistantMessage('Make sure to not disappoint her too much otherwise you might spend a long time in this cage');
}
setCurrentSender(SENDER_TAJ);
let material = MATERIAL.METAL;
sendVirtualAssistantMessage('Great. Now...');
sendVirtualAssistantMessage('Is it made out of metal, plastic or silicon?', 0);
answer = createInput('metal', 'glass', 'silicon');
while (true) {
if (answer.isLike("metal")) {
material = MATERIAL.METAL;
answer.clearOptions();
break;
} else if (answer.isLike("plastic")) {
material = MATERIAL.PLASTIC;
answer.clearOptions();
break;
} else if (answer.isLike("silicon")) {
material = MATERIAL.SILICON;
answer.clearOptions();
break;
} else {
sendVirtualAssistantMessage('Is it made out of plastic, metal or silicon?', 0);
answer.loop();
}
}
sendVirtualAssistantMessage("Noted...");
let dialator = false;
let dialatorDetachable = false;
sendVirtualAssistantMessage('Does it have a dialator?', 0);
answer = createInput();
while (true) {
if (answer.isLike("yes")) {
dialator = true;
sendVirtualAssistantMessage("This will be fun...");
sendVirtualAssistantMessage('Is it detachable?', 0);
answer = createInput();
while (true) {
if (answer.isLike("yes")) {
sendVirtualAssistantMessage("This will be fun... Well for %DomHonorific% %DomName% at least");
sendVirtualAssistantMessage('Not only does it keep things clean on the toilet');
sendVirtualAssistantMessage('It\'s also quite uncomfortable %Grin%');
dialatorDetachable = true;
break;
} else if (answer.isLike("no")) {
sendVirtualAssistantMessage("I guess when %DomHonorific% %DomName% chooses it then you will always have to deal with it %Grin%");
break;
} else {
sendVirtualAssistantMessage(YES_OR_NO, 0);
answer.loop();
}
}
break;
} else if (answer.isLike("no")) {
sendVirtualAssistantMessage("Too bad...");
break;
} else {
sendVirtualAssistantMessage(YES_OR_NO, 0);
answer.loop();
}
}
let spikes = false;
let spikesDetachable = false;
let spikesOverall = false;
let spikesVariable = false;
let spikesVariableAmount = 0;
sendVirtualAssistantMessage("If you have it, we might consider using spikes as a punishment...");
sendVirtualAssistantMessage('Does it have spikes?', 0);
answer = createInput();
while (true) {
if (answer.isLike("yes")) {
spikes = true;