コード例 #1
0
 public override void DoAction(Transition trans)
 {
     if (DebugSettings.instantVisitorsGift || (trans.target.lord.numPawnsLostViolently == 0 && Rand.Chance(VisitorGiftForPlayerUtility.ChanceToLeaveGift(trans.target.lord.faction, trans.Map))))
     {
         VisitorGiftForPlayerUtility.GiveGift(trans.target.lord.ownedPawns, trans.target.lord.faction);
     }
 }
コード例 #2
0
        private static void VisitorGift()
        {
            List <Pawn> list = new List <Pawn>();

            foreach (Pawn item in Find.CurrentMap.mapPawns.AllPawnsSpawned)
            {
                if (item.Faction != null && !item.Faction.IsPlayer && !item.Faction.HostileTo(Faction.OfPlayer))
                {
                    list.Add(item);
                    break;
                }
            }
            VisitorGiftForPlayerUtility.GiveGift(list, list[0].Faction);
        }