Added trait-based pawn test

This commit is contained in:
c0ffee 2024-05-08 09:25:17 -07:00
parent 2a6a9366d3
commit 6eaaa539e9
2 changed files with 28 additions and 0 deletions

View File

@ -0,0 +1,27 @@
using RimWorld;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Verse;
namespace Rimworld_Animations
{
public class PawnTest_Trait : BasePawnTest
{
TraitDef traitDef;
int? degree;
public override bool PawnTest(Pawn pawn)
{
if (degree != null)
{
return pawn.story.traits.HasTrait(traitDef, (int)degree);
}
return pawn.story.traits.HasTrait(traitDef);
}
}
}

View File

@ -93,6 +93,7 @@
<Compile Include="1.5\Source\Animations\PawnTests\PawnTest_Race.cs" />
<Compile Include="1.5\Source\Animations\PawnTests\PawnTest_RJWCanBeFucked.cs" />
<Compile Include="1.5\Source\Animations\PawnTests\PawnTest_RJWCanFuck.cs" />
<Compile Include="1.5\Source\Animations\PawnTests\PawnTest_Trait.cs" />
<Compile Include="1.5\Source\Comps\CompExtendedAnimator.cs" />
<Compile Include="1.5\Source\Comps\CompProperties_ExtendedAnimator.cs" />
<Compile Include="1.5\Source\Comps\CompProperties_ThingAnimator.cs" />