コード例 #1
0
        public void Notify_CaravanArrived(Caravan caravan)
        {
            Pawn bestDiplomat = BestCaravanPawnUtility.FindBestDiplomat(caravan);

            if (bestDiplomat == null)
            {
                Messages.Message("MessagePeaceTalksNoDiplomat".Translate(), caravan, MessageTypeDefOf.NegativeEvent, false);
            }
            else
            {
                float outcomeWeightFactor = WorldObject_Dispute.GetBadOutcomeWeightFactor(bestDiplomat);
                float num = 1f / outcomeWeightFactor;
                tmpPossibleOutcomes.Clear();
                tmpPossibleOutcomes.Add(new Pair <Action, float>(() => Outcome_Disaster(caravan), 0.05f * outcomeWeightFactor));
                tmpPossibleOutcomes.Add(new Pair <Action, float>(() => Outcome_Backfire(caravan), 0.15f * outcomeWeightFactor));
                tmpPossibleOutcomes.Add(new Pair <Action, float>(() => Outcome_Fail(caravan), 0.35f));
                tmpPossibleOutcomes.Add(new Pair <Action, float>(() => Outcome_MildSuccess(caravan), 0.35f * num));
                tmpPossibleOutcomes.Add(new Pair <Action, float>(() => Outcome_Success(caravan), 0.15f * num));
                tmpPossibleOutcomes.Add(new Pair <Action, float>(() => Outcome_Triumph(caravan), 0.05f * num));
                tmpPossibleOutcomes.RandomElementByWeight(x => x.Second).First();
                bestDiplomat.skills.Learn(SkillDefOf.Social, 6000f, true);
            }
        }
コード例 #2
0
 public CaravanArrivalAction_VisitDispute(WorldObject_Dispute dispute) => this.dispute = dispute;