RJW-Sexperience/RJWSexperience/IdeologyAddon/Ideology/Rituals/RitualRoles.cs

112 lines
3.5 KiB
C#
Raw Normal View History

2021-08-07 20:52:24 +00:00
using System;
2021-07-30 17:25:46 +00:00
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using RimWorld;
using Verse;
using rjw;
2021-08-21 16:29:59 +00:00
namespace RJWSexperience.Ideology
2021-07-30 17:25:46 +00:00
{
public class RitualRole_RapeVictim : RitualRole
{
public override bool AppliesToRole(Precept_Role role, out string reason, Precept_Ritual ritual = null, Pawn pawn = null, bool skipReason = false)
{
reason = null;
return false;
}
2021-08-21 16:29:59 +00:00
2021-07-30 17:25:46 +00:00
public override bool AppliesToPawn(Pawn p, out string reason, LordJob_Ritual ritual = null, RitualRoleAssignments assignments = null, Precept_Ritual precept = null, bool skipReason = false)
{
reason = null;
if (CanBeVictim(p)) return true;
if (!skipReason)
{
2021-08-06 17:19:42 +00:00
reason = Keyed.RSVictimCondition;
2021-07-30 17:25:46 +00:00
}
return false;
}
public static bool CanBeVictim(Pawn pawn)
{
if (pawn.IsPrisonerOfColony || pawn.IsSlaveOfColony) return true;
2021-08-21 16:29:59 +00:00
if (pawn.IsSubmissive()) return true;
2021-08-13 15:23:12 +00:00
if (pawn.IsDesignatedComfort() || (pawn.guilt != null && pawn.guilt.IsGuilty) || (pawn.apparel != null && pawn.apparel.PsychologicallyNude)) return true;
2021-07-30 17:25:46 +00:00
return false;
}
}
public class RitualRole_HumanBreedee : RitualRole
{
public override bool AppliesToRole(Precept_Role role, out string reason, Precept_Ritual ritual = null, Pawn pawn = null, bool skipReason = false)
{
reason = null;
return false;
}
public override bool AppliesToPawn(Pawn p, out string reason, LordJob_Ritual ritual = null, RitualRoleAssignments assignments = null, Precept_Ritual precept = null, bool skipReason = false)
{
2021-08-21 16:29:59 +00:00
2021-07-30 17:25:46 +00:00
reason = null;
if (!xxx.is_human(p))
{
2021-08-06 17:19:42 +00:00
reason = Keyed.RSNotHuman;
2021-07-30 17:25:46 +00:00
return false;
}
if (CanBeBreedee(p)) return true;
if (!skipReason)
{
2021-08-06 17:19:42 +00:00
reason = Keyed.RSShouldCanFuck;
2021-07-30 17:25:46 +00:00
}
return false;
}
public static bool CanBeBreedee(Pawn pawn)
{
if (xxx.can_be_fucked(pawn)) return true;
return false;
}
}
public class RitualRole_AnimalBreeder : RitualRole
{
public override bool Animal => true;
public override bool AppliesToRole(Precept_Role role, out string reason, Precept_Ritual ritual = null, Pawn pawn = null, bool skipReason = false)
{
reason = null;
return false;
}
public override bool AppliesToPawn(Pawn p, out string reason, LordJob_Ritual ritual = null, RitualRoleAssignments assignments = null, Precept_Ritual precept = null, bool skipReason = false)
{
reason = null;
if (!p.IsAnimal())
{
2021-08-06 17:19:42 +00:00
reason = Keyed.RSNotAnimal;
2021-07-30 17:25:46 +00:00
return false;
}
if (CanBeBreeder(p, assignments?.Ritual)) return true;
if (!skipReason)
{
2021-08-06 17:19:42 +00:00
reason = Keyed.RSBreederCondition;
2021-07-30 17:25:46 +00:00
}
return false;
}
public static bool CanBeBreeder(Pawn animal, Precept_Ritual precept)
{
2022-03-24 17:31:07 +00:00
if (precept != null && precept.ideo.HasPrecept(VariousDefOf.Bestiality_OnlyVenerated) && !precept.ideo.IsVeneratedAnimal(animal))
{
return false;
}
if (!xxx.can_rape(animal)) return false;
2021-07-30 17:25:46 +00:00
return true;
}
}
}