public override void UpdateAllDuties()
        {
            LordToilData_DefendPoint data = base.Data;
            Pawn pawn = TraderCaravanUtility.FindTrader(lord);

            if (pawn != null)
            {
                pawn.mindState.duty = new PawnDuty(DutyDefOf.Defend, data.defendPoint, data.defendRadius);
                for (int i = 0; i < lord.ownedPawns.Count; i++)
                {
                    Pawn pawn2 = lord.ownedPawns[i];
                    switch (pawn2.GetTraderCaravanRole())
                    {
                    case TraderCaravanRole.Carrier:
                        pawn2.mindState.duty            = new PawnDuty(DutyDefOf.Follow, pawn, 5f);
                        pawn2.mindState.duty.locomotion = LocomotionUrgency.Walk;
                        break;

                    case TraderCaravanRole.Chattel:
                        pawn2.mindState.duty            = new PawnDuty(DutyDefOf.Escort, pawn, 5f);
                        pawn2.mindState.duty.locomotion = LocomotionUrgency.Walk;
                        break;

                    case TraderCaravanRole.Guard:
                        pawn2.mindState.duty = new PawnDuty(DutyDefOf.Defend, data.defendPoint, data.defendRadius);
                        break;
                    }
                }
            }
        }
        private List <Pawn> GenerateCaravanPawns(Faction faction)
        {
            PawnGroupMakerParms pawnGroupMakerParms = new PawnGroupMakerParms();

            pawnGroupMakerParms.faction = faction;
            pawnGroupMakerParms.points  = TraderCaravanUtility.GenerateGuardPoints();
            return(PawnGroupMakerUtility.GeneratePawns(PawnGroupKindDefOf.Trader, pawnGroupMakerParms, true).ToList());
        }
예제 #3
0
 private List <Pawn> GenerateCaravanPawns(Faction faction)
 {
     return(PawnGroupMakerUtility.GeneratePawns(new PawnGroupMakerParms
     {
         groupKind = PawnGroupKindDefOf.Trader,
         faction = faction,
         points = TraderCaravanUtility.GenerateGuardPoints(),
         dontUseSingleUseRocketLaunchers = true
     }, true).ToList <Pawn>());
 }
 private void UpdateTraderDuty(out Pawn trader)
 {
     trader = TraderCaravanUtility.FindTrader(lord);
     if (trader != null)
     {
         trader.mindState.duty            = new PawnDuty(DutyDefOf.ExitMapBestAndDefendSelf);
         trader.mindState.duty.radius     = 18f;
         trader.mindState.duty.locomotion = LocomotionUrgency.Jog;
     }
 }
 protected override void ResolveParmsPoints(IncidentParms parms)
 {
     parms.points = TraderCaravanUtility.GenerateGuardPoints();
 }
 protected override void ResolveParmsPoints(IncidentParms parms)
 {
     parms.points = TraderCaravanUtility.GenerateGuardPoints();
     IncidentParmsUtility.AdjustPointsForGroupArrivalParams(parms);
 }