Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
131 changes: 131 additions & 0 deletions Build.ps1
Original file line number Diff line number Diff line change
@@ -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
}
}
36 changes: 36 additions & 0 deletions Scripts/Source/include.txt
Original file line number Diff line number Diff line change
@@ -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
3 changes: 2 additions & 1 deletion Scripts/Source/sr_FTUDeliveryFrame.psc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Scripts/Source/sr_FTUFavorRetryScene.psc
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ 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)
inflater.log("Favor retry fill continue")
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
Expand Down
2 changes: 1 addition & 1 deletion Scripts/Source/sr_OrcPickup.psc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Scripts/Source/sr_QSTBeltScript.psc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Scripts/Source/sr_QSTCollarScript.psc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Scripts/Source/sr_inflateConfig.psc
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ Function CheckGamePad()
EndFunction

Event OnConfigInit()
parent.OnGameReload()
parent.OnConfigInit()
PageReset()
EndEvent

Expand Down
12 changes: 7 additions & 5 deletions Scripts/Source/sr_inflateQuest.psc
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down