-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFPFP_BabyHandlerScript.psc
1028 lines (795 loc) · 31.6 KB
/
FPFP_BabyHandlerScript.psc
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
Scriptname FPFP_BabyHandlerScript extends Quest
Group SharedProperties
Actor property PlayerREF auto const
ImpactDataSet Property BloodSprayImpactSetRed Auto Const
Keyword property KeySettle auto const
Keyword property FPFP_KW_IsPlayersChild auto const
Sound Property FXExplosionLimb Auto Const
Sound property VOCShaun Auto Const Mandatory
ActorValue Property FPFP_AV_BirthDate Auto Const
ActorValue Property FPFP_AV_GrowthTimeMult Auto Const
WorkshopParentScript Property WorkshopParent Auto const
EndGroup
Form[] property BabyTypes_F auto ; Default baby types
Form[] property BabyTypes_M auto ; Default baby types
Form[] property RadBabyTypes_F auto ; Default radiation baby types
Form[] property RadBabyTypes_M auto ; Default radiation baby types
Form[] Property BabyTypeItem_dead Auto Const
Actor property Piper auto const
Quest property FPFP_Crib auto const
FPFP_Player_Script property FPE auto const
ReferenceAlias property Crib auto const
Message Property FPFP_Msg_BabyInfo Auto Const
Message Property FPFP_Msg_ChildInfo Auto Const
FPFP_BabyTypeAddon[] AddonBabyTypes
FPFP_BabyScript[] Babies ; now deprecated
CustomEvent FPEBabyTypeReregister
CustomEvent FPEBabyUpdateGameTimer
GlobalVariable property FPFP_Global_Gender_Select Auto Const Mandatory
Race Property HumanRace Auto
Race Property GhoulRace Auto
GlobalVariable property FPFP_Global_Rename_Human Auto Const Mandatory
string BabyName
int BabyName_Which = 0
FPE_BabyNames Property FPFP_BabyNames Auto Const Mandatory
GlobalVariable property FPFP_Global_Viable Auto Const Mandatory
GlobalVariable property FPFP_Global_Viable_Renaming Auto Const Mandatory
Perk Property WLD_Perk_Breeder Auto
GlobalVariable property FPFP_Global_Breeder_modifier Auto Const Mandatory
GlobalVariable property FPFP_Global_Viable_Ghoul Auto Const Mandatory
Event OnInit()
AddonBabyTypes = new FPFP_BabyTypeAddon[0]
EndEvent
Function OnUpdate(int aiVersion)
If aiVersion < 2100
Babies = new FPFP_BabyScript[0] ; clear up this, we don't need it
EndIf
EndFunction
;Baby creation and uncreation
Function AddBaby(Actor akMother, Race akDadRace, int aiNumChildren, float afRadiation = -1.0)
Var babyType = GetBabyType(akDadRace, afRadiation, akMother)
If babyType
BHTrace("AddBaby has found a baby type")
If babyType as FPFP_BabyTypeAddon
BHTrace("AddBaby has found a baby type that was FPFP_BabyTypeAddon. Setting appropriate variables")
aiNumChildren += (babyType as FPFP_BabyTypeAddon).AdditionalBabies()
EndIf
int iteration = 1
While iteration <= aiNumChildren
BHTrace("AddBaby started on iteration "+iteration+" of "+aiNumChildren+" total children")
Form babyTypeToSpawn = babyType as Form
If babyType as FPFP_BabyTypeAddon && akMother.HasPerk(WLD_Perk_Breeder)
babyTypeToSpawn = (babyType as FPFP_BabyTypeAddon).GetBabyType(true, FPFP_Global_Breeder_modifier.GetValue()) as Form ; causes the baby item or actor to be different each while loop iteration, so that there are varied babies.
elseIf babyType as FPFP_BabyTypeAddon
babyTypeToSpawn = (babyType as FPFP_BabyTypeAddon).GetBabyType(false, 1) as Form ; causes the baby item or actor to be different each while loop iteration, so that there are varied babies.
EndIf
if babyTypeToSpawn == ismybabydead(akDadRace)
If akMother == PlayerREF && FPFP_Global_Viable_Renaming.GetValue() == 1
BabyName_Which = Utility.RandomInt(1, 2)
elseif FPFP_Global_Viable_Renaming.GetValue() == 2
BabyName_Which = Utility.RandomInt(1, 2)
else
BabyName = ""
BabyName_Which = 5
endif
endif
ObjectReference theBaby = akMother.PlaceAtMe(babyTypeToSpawn, aiCount = 1, abForcePersist = False, abInitiallyDisabled = false, abDeleteWhenAble = false)
If akMother == PlayerREF
theBaby.AddKeyword(FPFP_KW_IsPlayersChild)
EndIf
; for SKK50's Fallout 4-76
If (Game.IsPluginInstalled("SKK476OpenWorld.esp") == TRUE)
theBaby.AddKeyword(Game.GetFormFromFile(0x00019bcb, "SKK476OpenWorld.esp") as Keyword)
EndIf
; the following will rename the baby and then pick a new name for the next baby if there is one
if BabyName_Which != 5 && (akDadRace != HumanRace && akDadRace != None && WhatsmyName_Auto(akDadRace) == 1) || (akDadRace == HumanRace && FPFP_Global_Rename_Human.GetValue() == 1)
if BabyName_Which == 1
BabyName = FPFP_BabyNames.BabyNames_Female(akDadRace)
elseif BabyName_Which == 2
BabyName = FPFP_BabyNames.BabyNames_Male(akDadRace)
elseif BabyName_Which == 3
BabyName = FPFP_BabyNames.BabyNames(akDadRace)
endif
RenameAnything.SetRefName(theBaby, BabyName)
endif
If (Game.IsPluginInstalled("Lootman.esp") == TRUE)
FormList Blacklist = Game.GetFormFromFile(0x001EF3, "Lootman.esp") as FormList
Blacklist.AddForm(theBaby)
EndIf
If theBaby as FPFP_BabyScript ; if we're a baby object rather than anything else
BHTrace("AddBaby found that the baby spawned was a misc object with FPFP_BabyScript applied onto it. Registering it into the array to keep it persistent")
;int index = RegisterBaby(theBaby as FPFP_BabyScript) 2.1 deprecated
If akMother.Is3DLoaded()
(theBaby as FPFP_BabyScript).GetBabyBirthSound().Play(akMother)
EndIf
akMother.AddItem(theBaby, 1)
;/If index > -1 ; If baby was properly added
BHTrace("AddBaby found that the baby registered successfully")
akMother.AddItem(theBaby, 1) ; put the baby in the mother's inventory
Else ; For some reason, we couldn't add the baby, abort
BHTrace("AddBaby found that the baby registered unsuccessfully")
UnregisterBaby(theBaby as FPFP_BabyScript)
EndIf; 2.1 deprecated: should always be persistent now, no need to record/;
ElseIf theBaby as Actor
BHTrace("AddBaby found that the baby spawned was an actor. Setting its bday")
theBaby.SetValue(FPFP_AV_BirthDate,Utility.GetCurrentGameTime())
If theBaby as FPFP_GrowingChildScript
If akMother.Is3DLoaded()
(theBaby as FPFP_GrowingChildScript).GetBabyBirthSound().Play(akMother)
EndIf
(theBaby as FPFP_GrowingChildScript).Initialize()
EndIf
EndIf
BHTrace("AddBaby ended iteration "+iteration+" of "+aiNumChildren+" total children")
iteration += 1
EndWhile
BHTrace("AddBaby has finished adding children")
EndIf
BHTrace("AddBaby has finished")
EndFunction
Var Function GetBabyType(Race akDadRace, float afRadiation, Actor akMother)
; function to get the baby type. Can return none, the addon quest, or the default misc objects
If FPE.FPFP_Global_GhoulifyChildren.GetValue() == 1.0 && (afRadiation >= 400 || akDadRace == GhoulRace)
; if mom has accumulated enough rads OR the dad was a ghoul
int random_LList = Utility.RandomInt(1, 100)
int random_Viable = Utility.RandomInt(1, 100)
if random_Viable >= FPFP_Global_Viable_Ghoul.GetValue() && !akMother.HasPerk(WLD_Perk_Breeder)
If akMother == PlayerREF && FPFP_Global_Viable_Renaming.GetValue() == 1
BabyName_Which = Utility.RandomInt(1, 2)
elseif FPFP_Global_Viable_Renaming.GetValue() == 2
BabyName_Which = Utility.RandomInt(1, 2)
else
BabyName = ""
BabyName_Which = 5
endif
Return BabyTypeItem_dead[Utility.RandomInt(0,BabyTypeItem_dead.Length-1)]
else
if (random_LList <= FPFP_Global_Gender_Select.GetValue())
BabyName = FPFP_BabyNames.BabyNames_Female(akDadRace)
BabyName_Which = 1
Return RadBabyTypes_F[Utility.RandomInt(0,RadBabyTypes_F.Length-1)] ; give Female Default babies, as to save computational power
else
BabyName = FPFP_BabyNames.BabyNames_Male(akDadRace)
BabyName_Which = 2
Return RadBabyTypes_M[Utility.RandomInt(0,RadBabyTypes_M.Length-1)] ; give Male default babies, as to save computational power
EndIf
EndIf
EndIf
If akDadRace == HumanRace ; If the father is a human
int random_LList = Utility.RandomInt(1, 100)
int random_Viable = Utility.RandomInt(1, 100)
if random_Viable >= FPFP_Global_Viable.GetValue() && !akMother.HasPerk(WLD_Perk_Breeder)
If akMother == PlayerREF && FPFP_Global_Viable_Renaming.GetValue() == 1
BabyName_Which = Utility.RandomInt(1, 2)
elseif FPFP_Global_Viable_Renaming.GetValue() == 2
BabyName_Which = Utility.RandomInt(1, 2)
else
BabyName = ""
BabyName_Which = 5
endif
Return BabyTypeItem_dead[Utility.RandomInt(0,BabyTypeItem_dead.Length-1)]
else
if (random_LList <= FPFP_Global_Gender_Select.GetValue())
BabyName = FPFP_BabyNames.BabyNames_Female(akDadRace)
BabyName_Which = 1
Return BabyTypes_F[Utility.RandomInt(0,BabyTypes_F.Length-1)] ; give Female Default babies, as to save computational power
else
BabyName = FPFP_BabyNames.BabyNames_Male(akDadRace)
BabyName_Which = 2
Return BabyTypes_M[Utility.RandomInt(0,BabyTypes_M.Length-1)] ; give Male default babies, as to save computational power
EndIf
EndIf
EndIf
If akDadRace != HumanRace
Var theReturn
FPFP_BabyTypeAddon[] validTypes = new FPFP_BabyTypeAddon[0]
int i = 0
While i < AddonBabyTypes.Length
If AddonBabyTypes[i].IsRaceMatch(akDadRace)
validTypes.Add(AddonBabyTypes[i])
EndIf
i += 1
EndWhile
If validTypes.Length > 0 ; if there were valid race types added to the array
; the following does the initial Baby name to be read at a later time
int random_LList = Utility.RandomInt(1, 100)
if (random_LList <= FPFP_Global_Gender_Select.GetValue())
BabyName = FPFP_BabyNames.BabyNames_Female(akDadRace)
BabyName_Which = 1
else
BabyName = FPFP_BabyNames.BabyNames_Male(akDadRace)
BabyName_Which = 2
EndIf
if FPFP_BabyNames.BabyNames(akDadRace)
BabyName = FPFP_BabyNames.BabyNames(akDadRace)
BabyName_Which = 3
endif
theReturn = validTypes[Utility.RandomInt(0,validTypes.Length-1)] ; set our return to one of the valid babytypeaddons
else ; if there were no valid types
int random_LList = Utility.RandomInt(1, 100)
if (random_LList <= FPFP_Global_Gender_Select.GetValue())
BabyName = FPFP_BabyNames.BabyNames_Female(akDadRace)
BabyName_Which = 1
Return BabyTypes_F[Utility.RandomInt(0,BabyTypes_F.Length-1)] ; give Female Default babies, as to save computational power
else
BabyName = FPFP_BabyNames.BabyNames_Male(akDadRace)
BabyName_Which = 2
Return BabyTypes_M[Utility.RandomInt(0,BabyTypes_M.Length-1)] ; give Male default babies, as to save computational power
EndIf
EndIf
return theReturn
EndIf
EndFunction
;the Following read the already existing AddonBabyTypes Quests to receive data from each race
bool Function FoundtheFather(Race akDadRace) ;bool to see if there is a father to be found
int i = 0
While i < AddonBabyTypes.Length
If AddonBabyTypes[i].IsRaceMatch(akDadRace)
return true
EndIf
i += 1
EndWhile
EndFunction
bool Function AdultAllowed(Race akDadRace) ;bool to see if the creature would be harvested as an adult
int i = 0
While i < AddonBabyTypes.Length
If AddonBabyTypes[i].IsRaceMatch(akDadRace)
return AddonBabyTypes[i].Adult_Allowed
EndIf
i += 1
EndWhile
EndFunction
Float Function Howlongismypregnancy(Race akDadRace) ;Float to see how long the pregnancy will be, Default is 9
int i = 0
While i < AddonBabyTypes.Length
If AddonBabyTypes[i].IsRaceMatch(akDadRace)
return AddonBabyTypes[i].INVB_Global_Creature_Length.GetValue()
;return AddonBabyTypes[i].Creature_Cycle
EndIf
i += 1
EndWhile
EndFunction
Spell Function WhatColourisMyCum(Race akDadRace) ;Spell to choose colour of semen is used by the creature
int i = 0
While i < AddonBabyTypes.Length
If AddonBabyTypes[i].IsRaceMatch(akDadRace)
return AddonBabyTypes[i].SP_Cumshot_Extra
EndIf
i += 1
EndWhile
EndFunction
int Function HowMuch(Race akDadRace) ;Int to see how much product(Caps or other) the birth is if it is a surrogate birth
int i = 0
While i < AddonBabyTypes.Length
If AddonBabyTypes[i].IsRaceMatch(akDadRace)
return AddonBabyTypes[i].int_Surrogate_Worth
EndIf
i += 1
EndWhile
EndFunction
bool Function WhatTwins(Race akDadRace) ;bool to see if this is a multilevel birth (for example this is mostly used for small creatures that cannot justify the length of time used for pregnancy for a single egg or womb)
int i = 0
While i < AddonBabyTypes.Length
If AddonBabyTypes[i].IsRaceMatch(akDadRace)
return AddonBabyTypes[i].Creature_Cycle_Multi
EndIf
i += 1
EndWhile
EndFunction
Float Function HowBig(Race akDadRace) ;Float to see how big the pregnancy will be on the mother
int i = 0
While i < AddonBabyTypes.Length
If AddonBabyTypes[i].IsRaceMatch(akDadRace)
return AddonBabyTypes[i].INVB_Global_Creature_Morph.GetValue()
;return AddonBabyTypes[i].Creature_Morph
EndIf
i += 1
EndWhile
EndFunction
Perk Function WhatsmyPerk(Race akDadRace) ;which perk will be picked if pregnant by this race
int i = 0
While i < AddonBabyTypes.Length
If AddonBabyTypes[i].IsRaceMatch(akDadRace)
return AddonBabyTypes[i].Creature_Perk
EndIf
i += 1
EndWhile
EndFunction
Potion Function WhatsmyDNA(Race akDadRace) ;which DNA will be collected when having sex with a condom
int i = 0
While i < AddonBabyTypes.Length
If AddonBabyTypes[i].IsRaceMatch(akDadRace)
return AddonBabyTypes[i].Creature_Cum
EndIf
i += 1
EndWhile
EndFunction
bool Function WhendoIStart(Race akDadRace) ;Used for WastelandBreeding or Impregnation, basically if the pregnancy starts halfway through the pregnancy
int i = 0
While i < AddonBabyTypes.Length
If AddonBabyTypes[i].IsRaceMatch(akDadRace)
return AddonBabyTypes[i].Creature_Start
EndIf
i += 1
EndWhile
EndFunction
String Function WhatsmyLine(Race akDadRace) ;the string for Sex Messages
int i = 0
While i < AddonBabyTypes.Length
If AddonBabyTypes[i].IsRaceMatch(akDadRace)
return AddonBabyTypes[i].Creature_String
EndIf
i += 1
EndWhile
EndFunction
String Function WhatsmyLine_Impreg(Race akDadRace) ;the string for Impregnation Messages
int i = 0
While i < AddonBabyTypes.Length
If AddonBabyTypes[i].IsRaceMatch(akDadRace)
return AddonBabyTypes[i].Creature_String_Impreg
EndIf
i += 1
EndWhile
EndFunction
String Function WhatsmyLine_Birth(Race akDadRace) ;the string for Birth Messages
int i = 0
While i < AddonBabyTypes.Length
If AddonBabyTypes[i].IsRaceMatch(akDadRace)
return AddonBabyTypes[i].Creature_String_Birth
EndIf
i += 1
EndWhile
EndFunction
Perk Function WhatsmyDisease(Race akDadRace) ;The Perk(STD) will be picked if infected by this race
int i = 0
While i < AddonBabyTypes.Length
If AddonBabyTypes[i].IsRaceMatch(akDadRace)
return AddonBabyTypes[i].Creature_STD
EndIf
i += 1
EndWhile
EndFunction
int Function HowMuch_Exile(Race akDadRace) ;Int to see how much product(Caps or other) if the Child or Adult is Exiled
int i = 0
While i < AddonBabyTypes.Length
If AddonBabyTypes[i].IsRaceMatch(akDadRace)
return AddonBabyTypes[i].int_howmuch_Exile
EndIf
i += 1
EndWhile
EndFunction
int Function HowMuch_Slave(Race akDadRace) ;Int to see how much product(Caps or other) if the Child or Adult is Sold
int i = 0
While i < AddonBabyTypes.Length
If AddonBabyTypes[i].IsRaceMatch(akDadRace)
return AddonBabyTypes[i].int_howmuch_Slave
EndIf
i += 1
EndWhile
EndFunction
int Function HowMuch_Butcher(Race akDadRace) ;Int to see how much product(Meat or other) if the Child or Adult is Butchered
int i = 0
While i < AddonBabyTypes.Length
If AddonBabyTypes[i].IsRaceMatch(akDadRace)
return AddonBabyTypes[i].int_howmuch_Meat
EndIf
i += 1
EndWhile
EndFunction
String Function WhatsmyLine_Exile(Race akDadRace) ;the string for Exiled Messages
int i = 0
While i < AddonBabyTypes.Length
If AddonBabyTypes[i].IsRaceMatch(akDadRace)
return AddonBabyTypes[i].fpfp_leavingHome
EndIf
i += 1
EndWhile
EndFunction
String Function WhatsmyLine_Slave(Race akDadRace) ;the string for Sold Messages
int i = 0
While i < AddonBabyTypes.Length
If AddonBabyTypes[i].IsRaceMatch(akDadRace)
return AddonBabyTypes[i].fpfp_Slavery
EndIf
i += 1
EndWhile
EndFunction
String Function WhatsmyLine_Butcher(Race akDadRace) ;the string for Butchered Messages
int i = 0
While i < AddonBabyTypes.Length
If AddonBabyTypes[i].IsRaceMatch(akDadRace)
return AddonBabyTypes[i].fpfp_Butchered
EndIf
i += 1
EndWhile
EndFunction
String Function WhatsmyLine_Caged(Race akDadRace) ;the string for Caged Messages
int i = 0
While i < AddonBabyTypes.Length
If AddonBabyTypes[i].IsRaceMatch(akDadRace)
return AddonBabyTypes[i].fpfp_Caged
EndIf
i += 1
EndWhile
EndFunction
form Function WhatsmyStuff_Exile(Race akDadRace) ;what product(Caps or other) if the Child or Adult is Exiled
int i = 0
While i < AddonBabyTypes.Length
If AddonBabyTypes[i].IsRaceMatch(akDadRace)
return AddonBabyTypes[i].Caps_Object
EndIf
i += 1
EndWhile
EndFunction
form Function WhatsmyStuff_Butcher(Race akDadRace) ;what product(Meat or other) if the Child or Adult is Butchered
int i = 0
While i < AddonBabyTypes.Length
If AddonBabyTypes[i].IsRaceMatch(akDadRace)
return AddonBabyTypes[i].Meat_Object
EndIf
i += 1
EndWhile
EndFunction
form Function WhatsmyStuff_Caged(Race akDadRace) ;what product(Cage or other) if the Child or Adult is Caged
int i = 0
While i < AddonBabyTypes.Length
If AddonBabyTypes[i].IsRaceMatch(akDadRace)
return AddonBabyTypes[i].Caged_Object
EndIf
i += 1
EndWhile
EndFunction
String Function WhatsmyName(Race akDadRace) ;Unisex name for Baby
int i = 0
While i < AddonBabyTypes.Length
If AddonBabyTypes[i].IsRaceMatch(akDadRace)
int random_Name = Utility.RandomInt(0, AddonBabyTypes[i].Creature_Names.Length-1)
return AddonBabyTypes[i].Creature_Names[random_Name]
EndIf
i += 1
EndWhile
EndFunction
String Function WhatsmyName_Male(Race akDadRace) ;Male name for Baby
int i = 0
While i < AddonBabyTypes.Length
If AddonBabyTypes[i].IsRaceMatch(akDadRace)
int random_Name = Utility.RandomInt(0, AddonBabyTypes[i].Creature_Names_M.Length-1)
return AddonBabyTypes[i].Creature_Names_M[random_Name]
EndIf
i += 1
EndWhile
EndFunction
String Function WhatsmyName_Female(Race akDadRace) ;Female name for Baby
int i = 0
While i < AddonBabyTypes.Length
If AddonBabyTypes[i].IsRaceMatch(akDadRace)
int random_Name = Utility.RandomInt(0, AddonBabyTypes[i].Creature_Names_F.Length-1)
return AddonBabyTypes[i].Creature_Names_F[random_Name]
EndIf
i += 1
EndWhile
EndFunction
float Function WhatsmyName_Auto(Race akDadRace) ;bool to see if the baby does get named automatically
int i = 0
While i < AddonBabyTypes.Length
If AddonBabyTypes[i].IsRaceMatch(akDadRace)
return AddonBabyTypes[i].FPFP_Global_Rename_Auto.GetValue()
EndIf
i += 1
EndWhile
EndFunction
Potion Function Wheresmy_Eggs(Race akDadRace) ;what product(Egg or other) if the Child or Adult is laying
int i = 0
While i < AddonBabyTypes.Length
If AddonBabyTypes[i].IsRaceMatch(akDadRace)
return AddonBabyTypes[i].Egg_Object
EndIf
i += 1
EndWhile
EndFunction
Potion Function Wheresmy_Milk(Race akDadRace) ;what product(Milk or other) if the Child or Adult is Milked
int i = 0
While i < AddonBabyTypes.Length
If AddonBabyTypes[i].IsRaceMatch(akDadRace)
return AddonBabyTypes[i].Milk_Object
EndIf
i += 1
EndWhile
EndFunction
Perk Function WhatBallsdoIHave(Actor akMan) ;The Perk(Balls) will be picked if injected with bah
int i = 0
While i < AddonBabyTypes.Length
If AddonBabyTypes[i].IsPerkMatch(akMan)
return AddonBabyTypes[i].Creature_Balls
EndIf
i += 1
EndWhile
EndFunction
Faction Function WhatFaction(Race akDadRace) ;The Faction(Creature Faction) will be picked if injected with bah
int i = 0
While i < AddonBabyTypes.Length
If AddonBabyTypes[i].IsRaceMatch(akDadRace)
return AddonBabyTypes[i].Creature_Faction
EndIf
i += 1
EndWhile
EndFunction
Faction Function WhatFaction_Friendly(Race akDadRace) ;The Faction(Creature Faction) will be picked if injected with bah
int i = 0
While i < AddonBabyTypes.Length
If AddonBabyTypes[i].IsRaceMatch(akDadRace)
return AddonBabyTypes[i].Creature_Faction_Friendly
EndIf
i += 1
EndWhile
EndFunction
Actorbase Function NewFather(Actor akMan) ;The Actor will be spawned to impregnate the other person
int i = 0
While i < AddonBabyTypes.Length
If AddonBabyTypes[i].IsPerkMatch(akMan)
return AddonBabyTypes[i].NewFather
EndIf
i += 1
EndWhile
EndFunction
form Function ismybabydead(Race akDadRace) ;what product(Cage or other) if the Child or Adult is Caged
int i = 0
While i < AddonBabyTypes.Length
If AddonBabyTypes[i].IsRaceMatch(akDadRace)
return AddonBabyTypes[i].BabyTypeItem_dead[0]
EndIf
i += 1
EndWhile
EndFunction
float Function WhatsmyChances(Race akDadRace) ;bool to see if the baby does get named automatically
int i = 0
While i < AddonBabyTypes.Length
If AddonBabyTypes[i].IsRaceMatch(akDadRace)
return AddonBabyTypes[i].INVB_Global_Creature_Chance.GetValue()
EndIf
i += 1
EndWhile
EndFunction
;/Int Function RegisterBaby(FPFP_BabyScript akBabyRef)
If !Babies
Babies = new FPFP_BabyScript[100]
Endif
int element = Babies.Find(NONE)
If element >= 0 ; If we have a NONE slot
Babies[element] = akBabyRef
Return element
Else
If LL_FourPlay.GetLLFPScriptVersion() ; Make sure we have the LL_FourPlay script
element = Babies.Length
Babies = LL_FourPlay.ResizeFormArray(Babies as Form[], Babies.Length + 1, akBabyRef as Form) as FPFP_BabyScript[]
return element ; Return the position
Else
Debug.MessageBox("WARNING: LL_FourPlay isn't installed. We couldn't add the babby person. Please re-install Four Play Community Patch.")
Return -1
EndIf
EndIf
EndFunction
Function UnregisterBaby(FPFP_BabyScript akBabyRef) ; deletes the baby, then any other pertinent information in our registered babys ( i.e. the pointer itself )
int Element = Babies.Find(akBabyRef)
Babies[Element].StartDelete()
If Element > -1
Babies[Element] = None
Endif
EndFunction/;
;Baby helper functions
Bool I_GetCrib_Lock = False
ObjectReference Function GetCrib()
int i = 0
ObjectReference theReturn
If I_GetCrib_Lock && i < 15
Utility.Wait(0.1)
i += 1
EndIf
I_GetCrib_Lock = true
FPFP_Crib.Stop()
FPFP_Crib.Start()
If FPFP_Crib.IsRunning()
theReturn = Crib.getReference()
Endif
FPFP_Crib.Stop()
I_GetCrib_Lock = false
Return theReturn
EndFunction
Function SetCribOwner(ObjectReference akCrib, bool abNotNONE = True)
If akCrib
If abNotNONE
akCrib.setActorRefOwner(Piper)
Else
akCrib.setActorRefOwner(NONE)
EndIf
EndIf
EndFunction
Function ShowBabyInfo(FPFP_BabyScript akBabyRef)
float ageInMonths = (Utility.GetCurrentGameTime() - akBabyRef.BirthDate ) / FPE.FPFP_Global_Day.GetValue()
float monthsUntilChild = (FPE.FPFP_Global_BabyToChild.GetValue() * akBabyRef.GetGrowthMultiplier()) - ageInMonths
float monthsUntilAdult = (FPE.FPFP_Global_ChildToAdult.GetValue() * akBabyRef.GetGrowthMultiplier()) + monthsUntilChild
FPFP_Msg_BabyInfo.Show(ageInMonths, monthsUntilChild, monthsUntilAdult, FPE.FPFP_Global_Day.GetValue())
EndFunction
Function ShowChildInfo(FPFP_GrowingChildScript akChildRef)
float ageInMonths = (Utility.GetCurrentGameTime() - akChildRef.GetValue(FPFP_AV_BirthDate) ) / FPE.FPFP_Global_Day.GetValue()
float monthsUntilAdult = ((FPE.FPFP_Global_ChildToAdult.GetValue() + FPE.FPFP_Global_BabyToChild.GetValue()) * akChildRef.GetGrowthMultiplier()) - ageInMonths
FPFP_Msg_ChildInfo.Show(ageInMonths,monthsUntilAdult, FPE.FPFP_Global_Day.GetValue())
EndFunction
Function HandleMCMUpdate(string asFunc)
If asFunc == "BabyToChild" || "Day" || "ChildToAdult"
SendCustomEvent("FPEBabyUpdateGameTimer")
EndIf
EndFunction
;Handle quest shutdown
Function StartReset()
;RemoveAndResetBabies()
AddonBabyTypes = new FPFP_BabyTypeAddon[0]
EndFunction
;/Function RemoveAndResetBabies()
int i = 0
While i < Babies.Length
Babies[i].StartDelete()
Babies[i] = None
i += 1
Endwhile
EndFunction; 2.1 now deprecated, will be handled by general OnReset and caught by all/;
; Register custom addons
Function RegisterBabyType(FPFP_BabyTypeAddon akBabyType) ; puts babytype into our addon list, and announces it
AddonBabyTypes.Add(akBabyType)
Debug.Trace("FPE Baby Handler: Baby Type " + akBabyType.BabyTypeAddonName +" has been added to FPE")
EndFunction
Function ReregisterBabyTypeAddons() ; Sends event to all baby type quests to tell them to reregister with the main mod
AddonBabyTypes = new FPFP_BabyTypeAddon[0]
Utility.Wait(5.0)
SendCustomEvent("FPEBabyTypeReregister")
Utility.Wait(5.0)
Debug.MessageBox("Please Save and Reload Game.")
EndFunction
Function ShowRegisteredAddons()
If AddonBabyTypes.Length < 1
Debug.MessageBox("There are no registered addons currently.")
Return
else
Utility.Wait(5.0)
Debug.MessageBox("Please press Escape to Exit MCM (if you are still in MCM)")
Debug.MessageBox("Please press Enter or click Ok to proceed")
Debug.MessageBox("You will be pressing those buttons for a while if you are using my mod")
int i = 0
While i < AddonBabyTypes.length
Debug.MessageBox(BuildAddonDisplayInfo(AddonBabyTypes[i], i))
i+=1
Endwhile
EndIf
EndFunction
Function ShowRegisteredAddons_Details()
If AddonBabyTypes.Length < 1
Debug.MessageBox("There are no registered addons currently.")
Return
else
Utility.Wait(5.0)
Debug.MessageBox("Please press Escape to Exit MCM (if you are still in MCM)")
Debug.MessageBox("Please press Enter or click Ok to proceed")
Debug.MessageBox("You will be pressing those buttons for a while if you are using my mod")
int i = 0
While i < AddonBabyTypes.length
Debug.MessageBox(BuildAddonDisplayInfo_Details(AddonBabyTypes[i], i))
i+=1
Endwhile
EndIf
EndFunction
Function ShowRegisteredAddons_Adult()
If AddonBabyTypes.Length < 1
Debug.MessageBox("There are no registered addons currently.")
Return
else
Utility.Wait(5.0)
Debug.MessageBox("Please press Escape to Exit MCM (if you are still in MCM)")
Debug.MessageBox("Please press Enter or click Ok to proceed")
Debug.MessageBox("You will be pressing those buttons for a while if you are using my mod")
int i = 0
While i < AddonBabyTypes.length
Debug.MessageBox(BuildAddonDisplayInfo_Adult(AddonBabyTypes[i], i))
i+=1
Endwhile
EndIf
EndFunction
String Function BuildAddonDisplayInfo(FPFP_BabyTypeAddon akBabyType, int aiIndex)
String text = "Baby Addon "+aiIndex+" : "+akBabyType.BabyTypeAddonName+"\n"
if GetArrayPropertyAsStringName(akBabyType.BabyTypeItem_M as Form[], 3) != ""
text += "Male Baby Item : " + GetArrayPropertyAsStringName(akBabyType.BabyTypeItem_M as Form[], 3)+"\n"
text += "Female Baby Item : " + GetArrayPropertyAsStringName(akBabyType.BabyTypeItem_F as Form[], 3)+"\n"
else
text += "Baby Item : " + GetArrayPropertyAsStringName(akBabyType.BabyTypeItem as Form[], 3)+"\n"
endif
text += "Father Race : " + GetArrayPropertyAsStringName(akBabyType.FatherRace as Form[], 3) +"\n"
if GetArrayPropertyAsStringName(akBabyType.OptionalChildActors_M as Form[], 3) != ""
text += "Male Child Actors : " + GetArrayPropertyAsStringName(akBabyType.OptionalChildActors_M as Form[], 3) +"\n"
text += "Female Child Actors : " + GetArrayPropertyAsStringName(akBabyType.OptionalChildActors_F as Form[], 3) +"\n"
elseif GetArrayPropertyAsStringName(akBabyType.OptionalChildActors as Form[], 3) != ""
text += "Child Actors : " + GetArrayPropertyAsStringName(akBabyType.OptionalChildActors as Form[], 3) +"\n"
endif
if akBabyType.ExtraBabiesToAdd != 0
text += "Extra Babies : " + akBabyType.ExtraBabiesToAdd
endif
Return text
EndFunction
String Function BuildAddonDisplayInfo_Details(FPFP_BabyTypeAddon akBabyType, int aiIndex)
String text = "Baby Addon(More Details) "+aiIndex+" : "+akBabyType.BabyTypeAddonName+"\n"
text += "Race : " + GetArrayPropertyAsStringName(akBabyType.FatherRace as Form[], 3) +"\n"
if akBabyType.Creature_Cycle != 0
text += "How Long is pregnancy : " + akBabyType.Creature_Cycle as int + " FPE Months Long" +"\n"
endif
if akBabyType.Creature_Morph != 0
text += "How big is the pregnancy : %" + (akBabyType.Creature_Morph * 100) as int +"\n"
endif
if akBabyType.int_Surrogate_Worth != 0
text += "How much if sold at birth: " + akBabyType.int_Surrogate_Worth +" Caps \n"
endif
if akBabyType.Creature_Perk != None
text += "What impregnation perk : " + akBabyType.Creature_Perk.getname() +"\n"
endif
if akBabyType.Creature_Cum != None
text += "What creature cum is given : " + akBabyType.Creature_Cum.getname() +"\n"
endif
if akBabyType.Egg_Object != None
text += "What egg is given : " + akBabyType.Egg_Object.getname() +"\n"
endif
if akBabyType.Milk_Object != None
text += "What drink is given : " + akBabyType.Milk_Object.getname() +"\n"
endif
if akBabyType.Creature_STD != None
text += "What STD is given : " + akBabyType.Creature_STD.getname() +"\n"
endif
if akBabyType.Creature_Balls != None
text += "What perk is required for human impregnation : " + akBabyType.Creature_Balls.getname() +"\n"
endif
text += "Does the pregnancy have multiple births : " + akBabyType.Creature_Cycle_Multi +"\n"
text += "Does this race have an advanced start : " + akBabyType.Creature_Start +"\n"
Return text
EndFunction
String Function BuildAddonDisplayInfo_Adult(FPFP_BabyTypeAddon akBabyType, int aiIndex)
if akBabyType.Caps_Object != None && akBabyType.Meat_Object != None && akBabyType.Caged_Object != None
String text = "Baby Addon(Adult Resources) "+aiIndex+" : "+akBabyType.BabyTypeAddonName+"\n"
text += "Race : " + GetArrayPropertyAsStringName(akBabyType.FatherRace as Form[], 3) +"\n"
if akBabyType.Caps_Object != None
text += "What payment or product : " + akBabyType.Caps_Object.getname() +"\n"
text += "How much : " + akBabyType.int_howmuch_Exile +"\n"
endif
if akBabyType.Meat_Object != None
text += "What kind of meat : " + akBabyType.Meat_Object.getname() +"\n"
text += "How much meat : " + akBabyType.int_howmuch_Meat +"\n"
endif
if akBabyType.Caged_Object != None
text += "What kind of cage : " + akBabyType.Caged_Object.getname() +"\n"
endif
Return text
else
String text = "Baby Addon(Adult Resources) "+aiIndex+" : "+akBabyType.BabyTypeAddonName+"\n"
text += "Race : " + GetArrayPropertyAsStringName(akBabyType.FatherRace as Form[], 3) +"\n"
text += "Doesn't contain any Adult Resource Data \n"
text += "Because this race may be designed for Impregnation Only \n"
text += "\n"
text += "Please press OK to continue \n"
Return text
endif
EndFunction
String Function GetArrayPropertyAsStringName(Form[] akArray, int aiLimit)