diff --git a/Build.ps1 b/Build.ps1 new file mode 100644 index 0000000..5dc6484 --- /dev/null +++ b/Build.ps1 @@ -0,0 +1,131 @@ + +$SOURCE_FILES = ".\Scripts\Source\*.psc" + +$FORCE_RECOMPILE = $false +$PAPYRUS_FOLDER = ".\PAPYRUS" + +$LOG_LEVEL = 1 + +$STATUS_COMPILED_SUCCESS = 1 +$STATUS_COMPILED_FAILED = 2 +$STATUS_COMPILED_SKIPPED = 3 + +function Log { + + param ( + [int] $Level, + [string] $msg, + [object] $object + ) + + if ($Level -ge $LOG_LEVEL) { + if($object) { + Write-Host "$msg : $object" + } else { + Write-Host $msg + } + } +} + +function GenerateDiffFile { + param ( + $file1, + $file2, + $diffFile + ) + + $process = Start-Process -Wait -NoNewWindow -PassThru -FilePath "git.exe" -ArgumentList "diff --patch --no-index --output=`"$diffFile`" `"$file1`" `"$file2`"" + + $ret = [PSCustomObject]@{ + command = "git diff" + file = $diffFile + ExitCode = $process.ExitCode + Status = if($process.ExitCode -eq 1) {$STATUS_COMPILED_SUCCESS} else {$STATUS_COMPILED_FAILED} + } + $ret +} + +function Compile { + param ( + $file + ) + Log -Level 1 -msg "Compile" -object $file + $filePath = $file | Split-Path -Parent + $sourceBaseDir = $filePath | Split-Path -Parent + $includeFile = $filePath + "\include.txt" + $flagsFile = Resolve-Path "$PAPYRUS_FOLDER\Flags.flg" + [string]$include = $filePath + if([System.IO.File]::Exists($includeFile)) { + $lines = Get-Content -Path $includeFile + foreach ( $line in $lines ) { + $path = Resolve-Path "$PAPYRUS_FOLDER\$line" + $include = [string]::Join(';', $include, $path) + Log -Level 0 -msg "Include " -object $path + } + } + + $originalFile = $sourceBaseDir + "\source_original\" + $file.BaseName + ".psc" + if([System.IO.File]::Exists($originalFile)) { + $diffFile = $sourceBaseDir + "\source\" + $file.BaseName + ".patch"; + $ret = GenerateDiffFile -file1 $originalFile -file2 $file -diffFile $diffFile + if($ret.Status -ne $STATUS_COMPILED_SUCCESS) { + return $ret + } + } + + $process = Start-Process -Wait -NoNewWindow -PassThru -FilePath "$PAPYRUS_FOLDER\PapyrusCompiler.exe" -ArgumentList "`"$file`" -o=`"$sourceBaseDir`" -i=`"$include`" -optimize -f=`"$flagsFile`"" + + $ret = [PSCustomObject]@{ + command = "PapyrusCompiler" + file = $file + ExitCode = $process.ExitCode + Status = if($process.ExitCode -eq 0) {$STATUS_COMPILED_SUCCESS} else {$STATUS_COMPILED_FAILED} + } + $ret +} + +function CompileIfNewest { + param ( + $file + ) + + $sourceBaseDir = $file | Split-Path -Parent | Split-Path -Parent + $pexFile = $sourceBaseDir + "\" + $file.BaseName + ".pex" + Log -Level 0 -msg "Pex file" -object $pexFile + if($FORCE_RECOMPILE) { + Log -Level 0 -msg "Compile by force" -object $file + Compile -file $file + } else { + if([System.IO.File]::Exists($pexFile)) { + $pexFile = Get-Item $pexFile + if ($file.LastWriteTime -gt $pexFile.LastWriteTime) { + Log -Level 0 -msg "Compile by modification date" -object $file + Compile -file $file + } else { + Log -Level 0 -msg "Skip by modification date" -object $file + [pscustomobject]@{Status = $STATUS_COMPILED_SKIPPED} + } + } else { + Log -Level 0 -msg "Compile by not compiled yet" -object $file + Compile -file $file + } + } +} + +$pscFiles = Get-ChildItem -Path $SOURCE_FILES -Force -Recurse -Exclude $PAPYRUS_FOLDER + +foreach ( $pscFile in $pscFiles ) +{ + Log -Level 0 -msg "Process" -object $pscFile + $ret = CompileIfNewest -file $pscFile + if($ret.Status -eq $STATUS_COMPILED_FAILED) { + Write-Host "---" + Write-Host "Build failed:" + Write-Host "!" $ret.file.Name + Write-Host " -" $ret.command $ret.file + Log -Level 0 -msg "Process result" -object $ret + Exit + } else { + Log -Level 0 -msg "Process result" -object $ret + } +} \ No newline at end of file diff --git a/Scripts/Source/include.txt b/Scripts/Source/include.txt new file mode 100644 index 0000000..f624c8b --- /dev/null +++ b/Scripts/Source/include.txt @@ -0,0 +1,36 @@ +SRC_DD +SRC_RM +SRC_PAPUTIL +SRC_MFG +SRC_SXL +SRC_SLA +SRC_ZAZ +SRC_ITF +SRC_DCUR +SRC_AYGAS +SRC_SLIF +SRC_HSH +SRC_PAH_SC +SRC_PAH +SRC_SLSW +SRC_SLAL +SRC_SXL +SRC_SD +SRC_DFW +SRC_SOS +SRC_ST +SRC_IWW +SRC_UIEXT +SRC_SKYUI +SRC_GCIP +SRC_OBODY +SRC_UILIB +SRC_PO3 +SRC_FNIS +SRC_XPMSE +SRC_UNK +SRC_PAPUTIL +SRC_JC +SRC_SKSE +SRC_CK +SRC \ No newline at end of file diff --git a/Scripts/Source/sr_FTUDeliveryFrame.psc b/Scripts/Source/sr_FTUDeliveryFrame.psc index 65e9109..644f7ac 100644 --- a/Scripts/Source/sr_FTUDeliveryFrame.psc +++ b/Scripts/Source/sr_FTUDeliveryFrame.psc @@ -151,7 +151,8 @@ Event PurityMonitor(int threadID, bool hasPlayer) Actor[] actors = SexLab.HookActors(threadId) actor pl = Game.GetPlayer() int pli = actors.Find(pl) - int cumSpot = anim.AccessPosition(pli, 1) + ;int cumSpot = anim.AccessPosition(pli, 1) + int cumSpot = anim.GetCum(pli) If ( ( anim.HasTag("vaginal") && ( blocked == 1 || blocked == 3 ) ) || (anim.HasTag("anal") && ( blocked == 2 || blocked == 3 ) ) ) && cumSpot != -1 && cumSpot != 2 int i = actors.length diff --git a/Scripts/Source/sr_FTUFavorRetryScene.psc b/Scripts/Source/sr_FTUFavorRetryScene.psc index 88cda55..da340bb 100644 --- a/Scripts/Source/sr_FTUFavorRetryScene.psc +++ b/Scripts/Source/sr_FTUFavorRetryScene.psc @@ -43,7 +43,7 @@ Function FillStart() EndIf ftu.StartMoanLoop(inflater.player) RegisterForModEvent("ftu-favor-retryscene", "FillCont") - inflater.InflateTo(inflater.player, 1, 30.0, targetLevel = -1.0, callback = "ftu-favor-retryscene") + inflater.InflateTo(inflater.player, 1, 30.0, callback = "ftu-favor-retryscene") EndFunction Event FillCont(Form akActor, float startVag, float startAn) @@ -51,7 +51,7 @@ Event FillCont(Form akActor, float startVag, float startAn) UnregisterForModEvent("ftu-favor-retryscene") RegisterForModEvent("ftu-favor-retryscene2", "FillFinish") - float target = (inflater.config.maxInflation - inflater.GetOriginalScale(inflater.player)) * 0.2 ; Fill anal pool 20%, not quite enough to trigger bursting which in reality is around ~126% of pool size + float target = (inflater.config.maxInflation - StorageUtil.GetFloatValue(inflater.player, inflater.ORIGINAL_SCALE, 1.0)) * 0.2 ; Fill anal pool 20%, not quite enough to trigger bursting which in reality is around ~126% of pool size inflater.InflateTo(inflater.player, 2, 10.0, target, callback = "ftu-favor-retryscene2") EndEvent diff --git a/Scripts/Source/sr_OrcPickup.psc b/Scripts/Source/sr_OrcPickup.psc index f562d2c..e682b8f 100644 --- a/Scripts/Source/sr_OrcPickup.psc +++ b/Scripts/Source/sr_OrcPickup.psc @@ -410,7 +410,7 @@ Function StartTransfer(Actor c) RegisterForModEvent(cb, cbf) inflater.QueueActor(pl, false, pool, plVag, vagTime, callback = cb, animate = -1) - inflater.QueueActor(courier, true, inflater.VAGINAL, (inflater.config.maxInflation - inflater.GetOriginalScale(courier)), (totalTime + 1)) + inflater.QueueActor(courier, true, inflater.VAGINAL, (inflater.config.maxInflation - StorageUtil.GetFloatValue(courier, inflater.ORIGINAL_SCALE, 1.0)), (totalTime + 1)) inflater.InflateQueued() EndFunction diff --git a/Scripts/Source/sr_QSTBeltScript.psc b/Scripts/Source/sr_QSTBeltScript.psc index cf9c485..2e825fb 100644 --- a/Scripts/Source/sr_QSTBeltScript.psc +++ b/Scripts/Source/sr_QSTBeltScript.psc @@ -28,7 +28,7 @@ Function DeviceMenuRemoveWithoutKey() libs.Notify("You flood the "+deviceInventory.GetName()+" with arcane energies, but everything you cast gets absorbed by the " + deviceName + ".", messageBox=true) endif elseif deviceRemoveOption == 2 ; Brute force - DeviceMenuBruteForce() + EscapeAttemptCut() elseif deviceRemoveOption == 3 DeviceMenuCarryOn() endif diff --git a/Scripts/Source/sr_QSTCollarScript.psc b/Scripts/Source/sr_QSTCollarScript.psc index 9307140..9f83616 100644 --- a/Scripts/Source/sr_QSTCollarScript.psc +++ b/Scripts/Source/sr_QSTCollarScript.psc @@ -28,7 +28,7 @@ Function DeviceMenuRemoveWithoutKey() libs.Notify("You flood the "+deviceInventory.GetName()+" with arcane energies, but everything you cast gets absorbed by the " + deviceName + ".", messageBox=true) endif elseif deviceRemoveOption == 2 ; Brute force - DeviceMenuBruteForce() + EscapeAttemptCut() elseif deviceRemoveOption == 3 DeviceMenuCarryOn() endif diff --git a/Scripts/Source/sr_inflateConfig.psc b/Scripts/Source/sr_inflateConfig.psc index a76a2bc..15cdf7f 100644 --- a/Scripts/Source/sr_inflateConfig.psc +++ b/Scripts/Source/sr_inflateConfig.psc @@ -406,7 +406,7 @@ Function CheckGamePad() EndFunction Event OnConfigInit() - parent.OnGameReload() + parent.OnConfigInit() PageReset() EndEvent diff --git a/Scripts/Source/sr_inflateQuest.psc b/Scripts/Source/sr_inflateQuest.psc index 2d8c6ed..ac5f512 100644 --- a/Scripts/Source/sr_inflateQuest.psc +++ b/Scripts/Source/sr_inflateQuest.psc @@ -1795,16 +1795,18 @@ Function StopLeakage(Actor akActor, int cumType, int spermtype) EndIf Else MfgConsoleFunc.ResetPhonemeModifier(akActor);Player expression is controlled here(OnKeyUp) - ActorUtil.RemovePackageOverride(akActor, stayStillPackage) - akActor.EvaluatePackage() - akActor.SetRestrained(False) - akActor.SetDontMove(False) If anim > 0 + ActorUtil.RemovePackageOverride(akActor, stayStillPackage) + akActor.EvaluatePackage() + akActor.SetRestrained(False) + akActor.SetDontMove(False) Debug.SendAnimationEvent(akActor as ObjectReference,"IdleForceDefaultState") EndIf EndIf - (akActor as ObjectReference).SetAnimationVariableInt("IsNPC", 1) + If anim > 0 + (akActor as ObjectReference).SetAnimationVariableInt("IsNPC", 1) + EndIf ;akActor.unequipItem(TongueA, abSilent=true) EquiprandomTongue(akactor, false)