本文整理汇总了C#中Pawn类的典型用法代码示例。如果您正苦于以下问题:C# Pawn类的具体用法?C# Pawn怎么用?C# Pawn使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Pawn类属于命名空间,在下文中一共展示了Pawn类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CurrentStateInternal
protected override ThoughtState CurrentStateInternal( Pawn p )
{
return(
( p.IsPrisonerOfColony )&&
( !p.IsSlaveOfColony() )
);
}
示例2: PawnDestroyed
public static void PawnDestroyed(Pawn pawn)
{
if( OnPawnDestroyed != null )
{
OnPawnDestroyed(pawn);
}
}
示例3: JobOnThing
public override Job JobOnThing( Pawn pawn, Thing t )
{
if( !pawn.CanReserveAndReach( ( TargetInfo )t.Position, PathEndMode.Touch, DangerUtility.NormalMaxDanger( pawn ), 1 ) )
{
return (Job) null;
}
var hopperSgp = t as ISlotGroupParent;
if( hopperSgp == null )
{
return (Job) null;
}
var resource = HopperGetCurrentResource( t.Position, hopperSgp );
if(
( resource == null )||
( resource.stackCount <= ( resource.def.stackLimit / 2 ) )
)
{
return WorkGiver_FillHopper.HopperFillJob( pawn, hopperSgp, resource );
}
JobFailReason.Is( "AlreadyFilledLower".Translate() );
return (Job) null;
}
示例4: AttackStateEnd
public static void AttackStateEnd(Pawn pawn)
{
if( OnAttackStateEnd != null )
{
OnAttackStateEnd(pawn);
}
}
示例5: CurrentEnemyUnset
public static void CurrentEnemyUnset(Pawn pawn)
{
if( OnCurrentEnemyUnset != null )
{
OnCurrentEnemyUnset(pawn);
}
}
示例6: FindCryptosleepCasketFor
// logic for accepting pawn by bodysize
// RimWorld.Building_CryptosleepCasket
public static new Building_CryptosleepCasket FindCryptosleepCasketFor(Pawn p, Pawn traveler)
{
try {
IEnumerable<ThingDef> enumerable = from def in DefDatabase<ThingDef>.AllDefs
where typeof(Fluffy.Building_CryptosleepCasket).IsAssignableFrom(def.thingClass)
select def;
foreach (ThingDef current in enumerable)
{
Predicate<Thing> validator = (Thing x) => ((Building_CryptosleepCasket)x).GetContainer().Count == 0 && ((Building_CryptosleepCasket)x).TryGetComp<CompAnimalCrypto>().props.maxSizeAllowance >= traveler.BodySize;
Building_CryptosleepCasket building_CryptosleepCasket = (Building_CryptosleepCasket)GenClosest.ClosestThingReachable(p.Position, ThingRequest.ForDef(current), PathEndMode.InteractionCell, TraverseParms.For(traveler, Danger.Deadly, TraverseMode.ByPawn, false), 9999f, validator, null, -1, false);
if (building_CryptosleepCasket != null)
{
return building_CryptosleepCasket;
}
}
return null;
}
finally
{
#if DEBUG
Log.Message("Something odd happened.");
#endif
}
}
示例7: ModifycaravanGroup
// disable initial readyness for trade and remove all but one muffalo, transferring all goods there
public void ModifycaravanGroup(ref List<Pawn> pawns)
{
var muffaloChosen = false;
var firstMuffalo = new Pawn();
var removeList = new List<Pawn>();
foreach (var pawn in pawns)
{
// disable initial readyness to trade
pawn.mindState.wantsToTradeWithColony = false;
// transfer all items from other muffaloes to the main one
if (pawn.kindDef == PawnKindDef.Named("PackMuffalo"))
{
if (!muffaloChosen)
{
firstMuffalo = pawn;
muffaloChosen = true;
}
else
{
for (var i = 0; i < pawn.inventory.container.Count; i++)
{
firstMuffalo.inventory.container.TryAdd(pawn.inventory.container[i]);
}
pawn.Destroy();
removeList.Add(pawn);
}
}
}
pawns = new List<Pawn>(pawns.Except(removeList));
}
示例8: ActualUse
public override bool ActualUse(Pawn target)
{
foreach (AmmoBoxPicker abp in ammoList) {
target.GetComponent<InventoryManager> ().AddAmmo (abp.ammo, abp.amount);
}
return base.ActualUse(target);
}
示例9: FindMADFor
public static Building_MAD FindMADFor(Pawn sleeper, Pawn traveler, bool sleeperWillBePrisoner, bool checkSocialProperness, bool forceCheckMedBed = false)
{
Predicate<Thing> MADValidator = delegate(Thing t)
{
if (!traveler.CanReserveAndReach(t, PathEndMode.OnCell, Danger.Some, 1))
{
return false;
}
Building_MAD Building_MAD3 = (Building_MAD)t;
if (Building_MAD3.HasAnyContents)
{
return false;
}
else
{
if (Building_MAD3.Faction != traveler.Faction)
{
return false;
}
}
return (!Building_MAD3.IsForbidden(traveler) && !Building_MAD3.IsBurning());
};
Predicate<Thing> validator = (Thing b) => MADValidator(b);
Building_MAD building_MAD = (Building_MAD)GenClosest.ClosestThingReachable(sleeper.Position, ThingRequest.ForDef(DefDatabase<ThingDef>.GetNamed("MindAlteringDevice")), PathEndMode.OnCell, TraverseParms.For(traveler, Danger.Deadly, TraverseMode.ByPawn, false), 9999f, validator, null, -1, false);
if (building_MAD != null)
{
return building_MAD;
}
return null;
}
示例10: BlocksPawn
public override bool BlocksPawn( Pawn p )
{
if( isOpen )
return false;
else
return !WillOpenFor(p);
}
示例11: JobOnThing
public override Job JobOnThing(Pawn pawn, Thing t)
{
Building_RepairStation rps = ListerDroids.ClosestRepairStationFor(pawn,t);
Job job = new Job(ReactivateDroidJobDef, t, rps);
job.maxNumToCarry = 1;
return job;
}
示例12: AvailableTargets
// search things throught designations is faster than searching designations through all things
public static List<TargetInfo> AvailableTargets(Pawn pawn)
{
return Find.ListerThings.AllThings.FindAll(thing => thing is Frame)
.Where(thing => thing.Faction == pawn.Faction && GenConstruct.CanConstruct(thing, pawn) &&
(thing as Frame).MaterialsNeeded().Count == 0 &&
pawn.CanReserveAndReach(thing, PathEndMode.Touch, pawn.NormalMaxDanger())).Select(thing => new TargetInfo(thing)).ToList();
}
示例13: HasJobOnThing
public override bool HasJobOnThing(Pawn pawn, Thing t)
{
if ((t is Building_AquacultureBasin) == false)
{
return false;
}
Building_AquacultureBasin aquacultureBasin = t as Building_AquacultureBasin;
if (pawn.Dead
|| pawn.Downed
|| pawn.IsBurning())
{
return false;
}
if (pawn.CanReserveAndReach(aquacultureBasin, this.PathEndMode, Danger.Some) == false)
{
return false;
}
if (aquacultureBasin.breedingIsFinished)
{
return true;
}
return false;
}
示例14: NonScanJob
public override Job NonScanJob(Pawn pawn)
{
if (ToolsForHaulUtility.TryGetBackpack(pawn) != null)
return ToolsForHaulUtility.HaulWithTools(pawn);
JobFailReason.Is(NoBackpack);
return (Job)null;
}
示例15: OnInteract
/**
* Event: Interact
*/
public void OnInteract(Pawn pawn = null)
{
if(this.conversation.Value != null)
{
ConversationManager.StartConversation(this.conversation.Value);
}
}