-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFPFP_SelfImpreg_Script.psc
175 lines (116 loc) · 5.22 KB
/
FPFP_SelfImpreg_Script.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
Scriptname FPFP_SelfImpreg_Script Extends Quest
;four_play:Main FourPlayAPI
AAF:AAF_API AAF_Events
Group MainProperties
FPFP_Player_Script Property FPE Auto Const Mandatory
Actor Property PlayerREF Auto Const Mandatory
GlobalVariable Property FPFP_Global_SelfImpreg Auto Const Mandatory
MagicEffect property FPFP_ME_Pill auto const Mandatory
MagicEffect property FPFP_ME_Fertile auto const Mandatory
Armor property FPFP_Condom auto const Mandatory
Message property FPFP_Msg_SelfImpreg auto const mandatory
Faction Property FPFP_Preggo Auto Const Mandatory
EndGroup
Group PregnancyConditionProperties
GlobalVariable property FPFP_Global_MPreg Auto Const Mandatory
GlobalVariable property FPFP_Global_FemaleToFemaleCum Auto Const Mandatory
;Notifications
GlobalVariable property FPFP_Global_CCNotif Auto Const Mandatory
GlobalVariable property FPFP_Global_CNotif Auto Const Mandatory
EndGroup
Group PregnancyCalcProperties
GlobalVariable property FPFP_Global_Chance_Player_F Auto Const Mandatory
GlobalVariable property FPFP_Global_Contra auto Const Mandatory
GlobalVariable property FPFP_Global_FertileEffects Auto Const Mandatory
EndGroup
GlobalVariable property FPFP_Global_PlayerClone Auto Const Mandatory
Actorbase Property PlayerClone_F Auto Const Mandatory
Actorbase Property PlayerClone_M Auto Const Mandatory
; Initialization
Event OnQuestInit()
LoadFP()
EndEvent
Function LoadFP()
;Quest Main = Game.GetFormFromFile(0x02679, "four_play.esp") as quest
Quest Main = Game.GetFormFromFile(0x01000F99, "AAF.esm") as quest
If Main
;FourPlayAPI = Main as four_play:Main
;RegisterForCustomEvent(FourPlayAPI, "animation_over")
AAF_Events = Main as AAF:AAF_API
RegisterForCustomEvent(AAF_Events, "OnAnimationStop")
Else
;debug.Trace("Family Planning Self Impreg can't find Four-Play.")
;debug.Trace("Family Planning Self Impreg can't find AAF.")
utility.wait(0.1)
Endif
EndFunction
; Meat of functionality
;Event four_play:Main.animation_over(four_play:Main akSender, Var[] akArgs)
Event AAF:AAF_API.OnAnimationStop(AAF:AAF_API akSender, Var[] akArgs)
If FPFP_Global_SelfImpreg.GetValue() == 0.0
Return
EndIf
if (akArgs[0] as int) != 0
debug.Trace("FPE AAF_error - " +(akArgs[1] as string))
return
return
endif
Var[] acs = Utility.VarToVarArray(akArgs[1])
;If (akArgs[0] as Actor) == PlayerREF && !(akArgs[1] as Actor) ; If it's player masturbation
If (acs[0] as Actor) == PlayerREF && (acs.Length > 1 && !(acs[1] as Actor) || acs.Length < 2) ; If it's player masturbation
If DetermineIfViable()
PropmtForSelfImpreg()
EndIf
EndIf
EndEvent
Bool Function DetermineIfViable()
If PlayerREF.IsEquipped(FPFP_Condom) || PlayerREF.IsInPowerArmor(); if the player has a condom on (or if they're in power armor)
If (PlayerREF.GetLeveledActorBase().GetSex() == 0 && FPFP_Global_MPreg.GetValue() == 1.0) || \
(PlayerREF.GetLeveledActorBase().GetSex() == 1 && FPFP_Global_FemaleToFemaleCum.GetValue() == 1.0) ;If we are a viable herm
If !FPE.FPFP_BabyGeneral.IsRunning(); if we aren't pregnant
Return True
EndIf
EndIf
EndIf
Return False
EndFunction
Function PropmtForSelfImpreg()
If FPFP_Msg_SelfImpreg.Show() == 0
Debug.MessageBox("You put your seed inside of you, hoping for conception")
TryForSelfImpreg()
EndIf
EndFunction
Function TryForSelfImpreg() ; meat of the determination. Uses most of TryforSperm function to keep in the spirit of things. Will need updating if there's ever any changes to the system tho
FPFP_PlayerPregData PlayerInfo = FPE.GetPlayerPregnancyInfo()
float chance = FPFP_Global_Chance_Player_F.getValue()
bool impregnated = false
If PlayerREF.HasMagicEffect(FPFP_ME_Fertile) ; Is the player fertile?
chance *= FPFP_Global_FertileEffects.getValue()
Endif
If PlayerREF.HasMagicEffect(FPFP_ME_Pill) ; Is the player on the pill?
chance *= ((100 - FPFP_Global_Contra.getValue()) * 0.01)
Endif
If Utility.RandomFloat(0,100) <= chance && !PlayerREF.IsInFaction(FPFP_Preggo)
impregnated = true
Endif
If impregnated && FPFP_Global_PlayerClone.GetValue() == 0
PlayerInfo.Impregnate(PlayerREF)
elseif impregnated && FPFP_Global_PlayerClone.GetValue() == 1 && PlayerREF.GetLeveledActorBase().GetSex() == 1
Actor tempActor = PlayerREF.PlaceAtMe(PlayerClone_F, abInitiallyDisabled = true) as Actor
Utility.Wait(1)
PlayerInfo.Impregnate(tempActor)
elseif impregnated && FPFP_Global_PlayerClone.GetValue() == 1 && PlayerREF.GetLeveledActorBase().GetSex() == 0
Actor tempActor = PlayerREF.PlaceAtMe(PlayerClone_M, abInitiallyDisabled = true) as Actor
Utility.Wait(1)
PlayerInfo.Impregnate(tempActor)
EndIf
SelfConceptionNotifications(chance,impregnated,PlayerInfo.NumChildren)
EndFunction
Function SelfConceptionNotifications(float afChance, bool wasImpregnated, int numChildren)
If FPFP_Global_CCNotif.getValue() == 1.0
debug.notification("I reckon the chance of me getting pregnant is "+ afChance as Int +"%")
EndIf
If FPFP_Global_CNotif.GetValue() == 1.0 && wasImpregnated
debug.notification("I've got a feeling that it worked.")
EndIf
EndFunction