tweaks for orgy

This commit is contained in:
c0ffee12 2021-07-27 23:10:59 -07:00
parent d57843182c
commit 4c8fa63c50
6 changed files with 50 additions and 6 deletions

Binary file not shown.

View file

@ -28,7 +28,8 @@ namespace RJW_Events
if(ModLister.IdeologyInstalled)
{
var ideo = Faction.OfPlayer.ideos.PrimaryIdeo;
if (!ideo.HasPrecept(DefDatabase<PreceptDef>.GetNamed("Lovin_FreeApproved", true)))
if (!ideo.HasPrecept(DefDatabase<PreceptDef>.GetNamed("Lovin_FreeApproved", true)) &&
!ideo.HasPrecept(DefDatabase<PreceptDef>.GetNamed("Lovin_Free", true)))
{
return false;
}

View file

@ -4,6 +4,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Verse;
using Verse.AI;
namespace RJW_Events
@ -19,7 +20,7 @@ namespace RJW_Events
{
Toil t = new Toil();
t.AddFinishAction(() => {
GlobalTextureAtlasManager.TryMarkPawnFrameSetDirty(pawn);
SexUtility.DrawNude(pawn);
});

View file

@ -11,6 +11,8 @@ namespace RJW_Events
{
class LordJob_Joinable_Orgy : LordJob_Joinable_Party
{
List<Pawn> participants;
protected override ThoughtDef AttendeeThought
{
get
@ -55,7 +57,9 @@ namespace RJW_Events
if (ModLister.IdeologyInstalled)
{
var ideo = p.ideo.Ideo;
if (!ideo.HasPrecept(DefDatabase<PreceptDef>.GetNamed("Lovin_FreeApproved", true)))
if (!ideo.HasPrecept(DefDatabase<PreceptDef>.GetNamed("Lovin_FreeApproved", true)) &&
!ideo.HasPrecept(DefDatabase<PreceptDef>.GetNamed("Lovin_Free", true)))
{
return 0;
}
@ -69,5 +73,36 @@ namespace RJW_Events
{
return timeoutTrigger.TicksLeft < 300;
}
public override void Notify_PawnAdded(Pawn p)
{
if(participants == null)
{
participants = new List<Pawn>();
}
participants.Add(p);
base.Notify_PawnAdded(p);
}
public override void Cleanup()
{
foreach(Pawn participant in participants)
{
if (participant != null)
{
participant.mindState.Notify_OutfitChanged();
GlobalTextureAtlasManager.TryMarkPawnFrameSetDirty(participant);
if (xxx.is_human(participant))
participant.Drawer.renderer.graphics.ResolveAllGraphics();
}
}
participants = null;
base.Cleanup();
}
}
}

View file

@ -9,6 +9,7 @@ using Verse.AI.Group;
namespace RJW_Events
{
[HarmonyPatch(typeof(PawnGraphicSet), "ResolveApparelGraphics")]
public static class HarmonyPatch_StayNudeForOrgy
{

View file

@ -10,21 +10,27 @@ using Verse.AI;
namespace RJW_Events
{
public class ThinkNode_ConditionalNude : ThinkNode_Conditional
{
protected override bool Satisfied(Pawn pawn)
{
//if pawn is rendering apparel they shouldn't be,
if (pawn.Drawer.renderer.graphics.apparelGraphics.Any((ApparelGraphicRecord x) => {
if (pawn.Drawer.renderer.graphics.apparelGraphics.Any((x) => {
if (x.sourceApparel.def.defName.ToLower().ContainsAny(new string[]
if (
x.sourceApparel.def is bondage_gear_def ||
x.sourceApparel.def.defName.ToLower().ContainsAny(new string[]
{
"vibrator",
"piercing",
"strapon"
}) || (RJWPreferenceSettings.sex_wear == RJWPreferenceSettings.Clothing.Headgear && !x.sourceApparel.def.apparel.bodyPartGroups.Contains(BodyPartGroupDefOf.UpperHead)))
}) ||
(RJWPreferenceSettings.sex_wear == RJWPreferenceSettings.Clothing.Headgear && !x.sourceApparel.def.apparel.bodyPartGroups.Contains(BodyPartGroupDefOf.UpperHead)))
return false;
Log.Message(x.sourceApparel.def.defName + " is not nude appropriate. Fixing....");
return true;
}))