本文整理汇总了C#中Pawn.IsSlaveOfColony方法的典型用法代码示例。如果您正苦于以下问题:C# Pawn.IsSlaveOfColony方法的具体用法?C# Pawn.IsSlaveOfColony怎么用?C# Pawn.IsSlaveOfColony使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pawn
的用法示例。
在下文中一共展示了Pawn.IsSlaveOfColony方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CurrentStateInternal
protected override ThoughtState CurrentStateInternal( Pawn p )
{
return(
( p.IsPrisonerOfColony )&&
( !p.IsSlaveOfColony() )
);
}
示例2: CanArrestFor
public bool CanArrestFor( Pawn pawn )
{
if( pawn.IsSlaveOfColony() )
{
return arrestSlaves;
}
if( pawn.IsGuestOfColony() )
{
return arrestGuests;
}
if( pawn.IsColonist )
{
return arrestColonists;
}
return false;
}
示例3: DrawWorkBoxFor
private static void DrawWorkBoxFor( Vector2 topLeft, Pawn p, WorkTypeDef wType, bool incapableBecauseOfCapacities )
{
if(
( !p.IsSlaveOfColony() ) ||
( p.workSettings == null ) ||
( !p.workSettings.EverWork )
)
{
return;
}
var rect = new Rect( topLeft.x, topLeft.y, 25f, 25f );
if( incapableBecauseOfCapacities )
{
GUI.color = new Color( 1f, 0.3f, 0.3f );
DrawWorkBoxBackground( rect, p, wType );
GUI.color = Color.white;
}
else
{
DrawWorkBoxBackground( rect, p, wType );
}
if( Find.PlaySettings.useWorkPriorities )
{
var priority1 = p.workSettings.GetPriority( wType );
var label = priority1 <= 0 ? string.Empty : priority1.ToString();
Text.Anchor = TextAnchor.MiddleCenter;
GUI.color = ColorOfPriority( priority1 );
Widgets.Label( rect.ContractedBy( -3f ), label );
GUI.color = Color.white;
Text.Anchor = TextAnchor.UpperLeft;
if(
( Event.current.type != EventType.MouseDown ) ||
( !Mouse.IsOver( rect ) )
)
{
return;
}
if( Event.current.button == 0 )
{
int priority2 = p.workSettings.GetPriority( wType ) - 1;
if( priority2 < 0 )
{
priority2 = 4;
}
p.workSettings.ForcePriority( wType, priority2 );
SoundStarter.PlayOneShotOnCamera( SoundDefOf.AmountIncrement );
}
if( Event.current.button == 1 )
{
int priority2 = p.workSettings.GetPriority( wType ) + 1;
if( priority2 > 4 )
{
priority2 = 0;
}
p.workSettings.ForcePriority( wType, priority2 );
SoundStarter.PlayOneShotOnCamera( SoundDefOf.AmountDecrement );
}
Event.current.Use();
}
else
{
if( p.workSettings.GetPriority( wType ) > 0 )
{
GUI.DrawTexture( rect, (Texture) WidgetsWork.WorkBoxCheckTex );
}
if( !Widgets.ButtonInvisible( rect ) )
{
return;
}
if( p.workSettings.GetPriority( wType ) > 0 )
{
p.workSettings.ForcePriority( wType, 0 );
SoundStarter.PlayOneShotOnCamera( SoundDefOf.CheckboxTurnedOff );
}
else
{
p.workSettings.ForcePriority( wType, 3 );
SoundStarter.PlayOneShotOnCamera( SoundDefOf.CheckboxTurnedOn );
}
}
}
示例4: PawnCanOpen
public override bool PawnCanOpen( Pawn p, bool isEscaping )
{
if( cachedRooms.Count == 0 )
{
UpdateCompStatus();
}
if( isEscaping )
{ // Escaping pawns don't care about restrictions
return true;
}
if( this.parent.IsForbiddenToPass( p ) )
{ // Other factions don't care about forbidden doors
//Log.Message( string.Format( "\tCompRestrictedDoor: door {0}, pawn {1} IsForbiddenToPass", this.parent.ThingID, p.NameStringShort ) );
return false;
}
// Check animals
if(
( p.RaceProps.Animal )&&
( !AllowAnimals )
)
{
return false;
}
// Check colonists
if(
( p.IsColonist )&&
( !AllowColonists )&&
( !p.IsPrisonerOfColony )&&
( !p.Drafted )&&
( !p.workSettings.WorkIsActive( WorkTypeDefOf.Warden ) )&&
( !p.workSettings.WorkIsActive( WorkTypeDefOf.Doctor ) )
)
{ // Colonists have been told not to use this door
return false;
}
if(
(
( p.IsColonist )||
( p.Faction == Faction.OfPlayer )
)&&
( !p.IsPrisoner )
)
{ // Colonists & colony animals
//Log.Message( string.Format( "\tCompRestrictedDoor: door {0}, pawn {1} IsColonist or Faction.OfPlayer", this.parent.ThingID, p.NameStringShort ) );
return true;
}
// Check non-prisoner guests
if( p.IsGuestOfColony() )
{
if( AllowGuests )
{ // Guests can use this door
//Log.Message( string.Format( "\tCompRestrictedDoor: door {0}, pawn {1} IsAllowedGuest", this.parent.ThingID, p.NameStringShort ) );
return true;
}
// Guests can't use this door
//Log.Message( string.Format( "\tCompRestrictedDoor: door {0}, pawn {1} IsNotAllowedGuest", this.parent.ThingID, p.NameStringShort ) );
return false;
}
if( cachedRooms.NullOrEmpty() )
{
// No room cache, can't check
//Log.Message( string.Format( "\tCompRestrictedDoor: door {0}, pawn {1} cachedRooms is null", this.parent.ThingID, p.NameStringShort ) );
return false;
}
var pawnRoom = p.GetRoom();
bool checkPrisoners = p.IsPrisonerOfColony;
bool checkSlaves = p.IsSlaveOfColony();
// Slaves supercede prisoners
checkPrisoners &= !checkSlaves;
// Check on prisoners
if(
( AllowPrisoners )&&
( checkPrisoners )
)
{
foreach( var room in cachedRooms )
{
// Don't worry about room pawn is leaving
if( room == pawnRoom )
{
continue;
}
if( !room.isPrisonCell )
{ // Prisoners are only valid for prison cells
//Log.Message( string.Format( "\tCompRestrictedDoor: door {0}, pawn {1} isPrisoner, room {2} !isPrisoncell", this.parent.ThingID, p.NameStringShort, room.ID ) );
return false;
}
}
// Room is valid for prisoners
//Log.Message( string.Format( "\tCompRestrictedDoor: door {0}, pawn {1} isPrisoner, all rooms are prison cells", this.parent.ThingID, p.NameStringShort ) );
return true;
}
// Check on slaves
if(
( AllowSlaves )&&
( checkSlaves )
)
{
foreach( var room in cachedRooms )
{
//.........这里部分代码省略.........
示例5: ThinkNode_ConditionalSlave
/*
public ThinkNode_ConditionalSlave() : base()
{
}
*/
protected override bool Satisfied( Pawn pawn )
{
return pawn.IsSlaveOfColony();
}
示例6: CurrentStateInternal
protected override ThoughtState CurrentStateInternal( Pawn p )
{
return p.IsSlaveOfColony();
}