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
130 changes: 130 additions & 0 deletions Build.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
$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
4 changes: 2 additions & 2 deletions Scripts/Source/sr_QSTBeltScript.psc
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ Function DeviceMenuRemoveWithoutKey()
libs.PlayerRef.DamageAV("Magicka", 50)
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()
elseif deviceRemoveOption == 2 ; Cut Device
EscapeAttemptCut()
elseif deviceRemoveOption == 3
DeviceMenuCarryOn()
endif
Expand Down
4 changes: 2 additions & 2 deletions Scripts/Source/sr_QSTCollarScript.psc
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ Function DeviceMenuRemoveWithoutKey()
libs.PlayerRef.DamageAV("Magicka", 50)
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()
elseif deviceRemoveOption == 2 ; Cut Device
EscapeAttemptCut()
elseif deviceRemoveOption == 3
DeviceMenuCarryOn()
endif
Expand Down
47 changes: 28 additions & 19 deletions Scripts/Source/sr_infDeflateAbility.psc
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Utility.Wait(0.4)
If keydown && !spermout
spermout = true;To prevent trigger from continual press
If p.GetActorValuePercentage("Stamina") >= 0.3
SendModEvent("dhlp-Suspend")
SendModEvent("dhlp-Suspend") ; do not forgot about `dhlp-Resume` before exit this `If` and function
int type = inflater.GetMostRecentInflationType(p);Important
int err = 0
int plugged = inflater.isPlugged(p)
Expand Down Expand Up @@ -98,9 +98,17 @@ If keydown && !spermout
elseif type == 3
int gagged = inflater.isGagged(p)
if gagged == 0;Not Gagged
err = 0
elseif gagged == 1;Gagged but permitoral
;No mouthcontrol
err = 0
else;Gagged
;WIP: When it crosses the capacity limit, you vomit. If not, you feel like vomiting but vomit nothing.
err = 7
type = inflater.GetMoreInflationType(p, type)

if type > 0
err = 0
If plugged < 3
If type == plugged ; one plug and it's blocking
If type == 1 ; determine which message to show
Expand All @@ -119,38 +127,34 @@ If keydown && !spermout
err = 0
log("Anal plug, switching to vaginal deflation")
EndIf
else
err = 7
endif
else
return; no cum
endif
elseif gagged == 1;Gagged but permitoral
;No mouthcontrol
err = 0
else;Gagged
err = 7

endif

else
err = 10; no cum
EndIf

int spermtype = 0

p.DamageActorValue("Stamina", ((p.GetActorValue("Stamina") / p.GetActorValuePercentage("Stamina")) * 0.4))
If p.HasSpell(inflater.sr_inflateBurstSpell)
err = 5
log("Bursting, can't deflate")
If err != 10 ; If has cum
p.DamageActorValue("Stamina", ((p.GetActorValue("Stamina") / p.GetActorValuePercentage("Stamina")) * 0.4))
If p.HasSpell(inflater.sr_inflateBurstSpell)
err = 5
log("Bursting, can't deflate")
EndIf
spermtype = inflater.GetSpermLastActor(p, type)
EndIf
int spermtype = inflater.GetSpermLastActor(p, type)

If (Utility.RandomInt(0, 99) < sr_ExpelFaliure.getvalue() as int) && err == 0

If err == 0 && (Utility.RandomInt(0, 99) < sr_ExpelFaliure.getvalue() as int)
If type > 0 && type < 3
err = 4
elseif type == 3
err = 6
endif
; log("RandomErrorNotEnoughRandom")
EndIf



If err == 0
; log("Pushing: " + type)
Expand Down Expand Up @@ -182,6 +186,11 @@ If keydown && !spermout
ElseIf err == 9;expel fail vaginal wip - scanner
inflater.notify("$FHU_DEF_REFUSE")
inflater.DeflateFailMotion(p, 5, false, 0)
ElseIf err == 10 ; no cum
; maybe not need
inflater.DeflateFailMotion(p, 4, false)
Else ; other
;
EndIf
SendModEvent("dhlp-Resume")
Else
Expand Down
7 changes: 6 additions & 1 deletion Scripts/Source/sr_inflateQuest.psc
Original file line number Diff line number Diff line change
Expand Up @@ -468,20 +468,24 @@ Event OrgasmSeparate(Form ActorRef, Int Thread)

Actor[] actors = sexlab.HookActors(thread)
sslBaseAnimation anim = sexlab.HookAnimation(thread)

log(akActor + " OrgasmSeparate")
If anim.hasTag("Vaginal") || anim.hasTag("Oral") || anim.hasTag("Anal")
If ( !sexlab.config.allowFFCum && sexlab.MaleCount(actors) < 1 && sexlab.CreatureCount(actors) < 1)
log(akActor + " OrgasmSeparate not allowed by config")
return
EndIf

int currentPool = 0
If anim.hasTag("Vaginal")
log(akActor + " OrgasmSeparate Vaginal")
currentPool = Math.LogicalOr(currentPool, VAGINAL)
EndIf
If anim.hasTag("Anal")
log(akActor + " OrgasmSeparate Anal")
currentPool = Math.LogicalOr(currentPool, ANAL)
EndIf
If anim.hasTag("Oral")
log(akActor + " OrgasmSeparate Oral")
currentPool = Math.LogicalOr(currentPool, ORAL)
;Debug.notification("Oral " + currentPool as int)
EndIf
Expand All @@ -497,6 +501,7 @@ Event OrgasmSeparate(Form ActorRef, Int Thread)
int actorGender = sexlab.GetGender(actors[i])
; log(anim.name + " - cumSpot for position " + i + ": " + cumSpot)
If akActor != actors[i]
log(akActor + " OrgasmSeparate to " + actors[i])
If ((actorGender == 1 && config.femaleEnabled) || (actorGender == 0 && config.maleEnabled)) && cumSpot != -1; && cumSpot != 2
; only inflate if the actor is female (or male pretending to be female!) and the animation position has cum effect set for something else than oral only
If actors[i] == player && sr_CumEffectsEnabled.GetValueInt() > 0
Expand Down