mirror of
https://gitgud.io/c0ffeeeeeeee/rimworld-animations.git
synced 2024-08-15 00:43:45 +00:00
Added trait-based pawn test
This commit is contained in:
parent
2a6a9366d3
commit
6eaaa539e9
2 changed files with 28 additions and 0 deletions
27
1.5/Source/Animations/PawnTests/PawnTest_Trait.cs
Normal file
27
1.5/Source/Animations/PawnTests/PawnTest_Trait.cs
Normal 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -93,6 +93,7 @@
|
||||||
<Compile Include="1.5\Source\Animations\PawnTests\PawnTest_Race.cs" />
|
<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_RJWCanBeFucked.cs" />
|
||||||
<Compile Include="1.5\Source\Animations\PawnTests\PawnTest_RJWCanFuck.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\CompExtendedAnimator.cs" />
|
||||||
<Compile Include="1.5\Source\Comps\CompProperties_ExtendedAnimator.cs" />
|
<Compile Include="1.5\Source\Comps\CompProperties_ExtendedAnimator.cs" />
|
||||||
<Compile Include="1.5\Source\Comps\CompProperties_ThingAnimator.cs" />
|
<Compile Include="1.5\Source\Comps\CompProperties_ThingAnimator.cs" />
|
||||||
|
|
Loading…
Reference in a new issue