public override void DoAction(QuestRim.Quest quest, Pawn speaker, Pawn defendant)
        {
            SkillRecord skill = speaker.skills.GetSkill(SkillDef);

            if (skill.Level < SkillLevel)
            {
                Messages.Message("QuestOption_IncreaseReward_Level".Translate(SkillDef.LabelCap, SkillLevel, skill.Level), MessageTypeDefOf.NeutralEvent, false);
                return;
            }

            quest.GenerateRewards(quest.GetQuestThingFilter(), NewValueRange, NewCountRange, null, null);

            quest.Options.Remove(this);
        }
        public void TryGenerateQuests()
        {
            int questCount = Rand.RangeInclusive(1, 2);

            for (int i = 0; i < questCount; i++)
            {
                int            questId = Rand.Range(0, questsList.Length);
                QuestRim.Quest quest   = (QuestRim.Quest)Activator.CreateInstance(questsList[questId]);
                if (quest.TryGiveQuestTo(null, null))
                {
                    Quests.Add(quest);
                }
            }
        }
        public override void TraderGone()
        {
            if (Quests != null)
            {
                for (int i = 0; i < Quests.Count; i++)
                {
                    QuestRim.Quest quest = Quests[i];
                    if (quest != null)
                    {
                        if (quest.Site != null)
                        {
                            quest.Site.EndQuest(null, EndCondition.None);
                        }
                        else
                        {
                            quest.EndQuest(null, EndCondition.None);
                        }
                    }
                }
            }
            Quests.Clear();

            base.TraderGone();
        }
Пример #4
0
 public override void DoAction(QuestRim.Quest quest, Pawn speaker, Pawn defendant)
 {
     Log.Message($"TRIGGER --> {quest.CardLabel}: {speaker.Name} : {defendant?.Name}");
 }