Skip to content

Commit

Permalink
Disable all NSFW actions for child actors
Browse files Browse the repository at this point in the history
I had this in mantella, and it was an oversight that it did not make it to the AIFF implementation
  • Loading branch information
MinLL committed Sep 25, 2024
1 parent 158748a commit b15a27d
Show file tree
Hide file tree
Showing 13 changed files with 27 additions and 3 deletions.
4 changes: 4 additions & 0 deletions Scripts/Source/minai_Arousal.psc
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,10 @@ Event CommandDispatcher(String speakerName,String command, String parameter)
if !akTarget
akTarget = PlayerRef
EndIf
if (akTarget.IsChild())
Main.Warn(akTarget.GetDisplayName() + " is a child actor. Not processing actions.")
return
EndIf
Main.Debug("Arousal - CommandDispatcher(" + speakerName +", " + command +", " + parameter + ")")
string targetName = main.GetActorName(akTarget)
if command == "ExtCmdIncreaseArousal"
Expand Down
5 changes: 4 additions & 1 deletion Scripts/Source/minai_DeviousStuff.psc
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,10 @@ Event CommandDispatcher(String speakerName,String command, String parameter)
if !akTarget
akTarget = PlayerRef
EndIf

if (akTarget.IsChild())
Main.Warn(akTarget.GetDisplayName() + " is a child actor. Not processing actions.")
return
EndIf
string targetName = main.GetActorName(akTarget)

bool bDeviousFollowerInScene = False
Expand Down
5 changes: 4 additions & 1 deletion Scripts/Source/minai_Sex.psc
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,10 @@ Event CommandDispatcher(String speakerName,String command, String parameter)
if !akTarget
akTarget = PlayerRef
EndIf

if (akTarget.IsChild())
Main.Warn(akTarget.GetDisplayName() + " is a child actor. Not processing actions.")
return
EndIf
bool bPlayerInScene = (akTarget == PlayerRef || akSpeaker == PlayerRef)

string targetName = main.GetActorName(akTarget)
Expand Down
1 change: 1 addition & 0 deletions Scripts/Source/minai_Survival.psc
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ string Function GetFactionsForActor(actor akTarget)
string ret = ""
ret += aiff.GetFactionIfExists(akTarget, "JobInnServer", JobInnServer)
ret += aiff.GetFactionIfExists(akTarget, "JobInnKeeper", JobInnKeeper)
aiff.SetActorVariable(akTarget, "isChild", akTarget.IsChild())
return ret
EndFunction

Expand Down
4 changes: 4 additions & 0 deletions Scripts/Source/minai_VR.psc
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,10 @@ Function OnCollision(string eventName, string nodeName, float collisionDuration,
return
EndIf
Actor akActor = actorForm as Actor
if (akActor.IsChild())
Main.Warn(akActor.GetDisplayName() + " is a child actor. Not processing collision.")
return
EndIf
string actorName = akActor.GetActorBase().GetName()
string playerName = playerRef.GetActorBase().GetName()

Expand Down
Binary file modified Scripts/minai_Arousal.pex
Binary file not shown.
Binary file modified Scripts/minai_CombatManager.pex
Binary file not shown.
Binary file modified Scripts/minai_DeviousStuff.pex
Binary file not shown.
Binary file modified Scripts/minai_Sex.pex
Binary file not shown.
Binary file modified Scripts/minai_Survival.pex
Binary file not shown.
Binary file modified Scripts/minai_VR.pex
Binary file not shown.
2 changes: 1 addition & 1 deletion minai_plugin/prompts.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
require_once("util.php");
require_once("config.php");
require_once("util.php");

?>
9 changes: 9 additions & 0 deletions minai_plugin/util.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,12 @@ function CanVibrate($name) {
}
return (intval($arousal) >= intval($arousalThreshold));
}

Function IsChildActor($name) {
return str_contains(GetActorValue($name, "Race"), "child") || IsEnabled($name, "isChild");
}


if (IsChildActor($GLOBALS['HERIKA_NAME'])) {
$GLOBALS["disable_nsfw"] = true;
}

0 comments on commit b15a27d

Please sign in to comment.