public override IEnumerable <Gizmo> GetGizmos(QuestSite site)
        {
            foreach (var gizmo in base.GetGizmos(site))
            {
                yield return(gizmo);
            }

            if (site.HasMap)
            {
                yield return(new Command_Action
                {
                    defaultLabel = "Quest_Archotech_567H_GetResources_SignalLabel".Translate(),
                    defaultDesc = "Quest_Archotech_567H_GetResources_SignalDescription".Translate(),
                    icon = ContentFinder <Texture2D> .Get("Quests/send-signal"),
                    action = delegate
                    {
                        if (HostileUtility.AnyNonDownedHostileOnMap(site.Map, Faction))
                        {
                            Messages.Message(Translator.Translate("EnemyOnTheMap"), MessageTypeDefOf.NeutralEvent, false);
                            return;
                        }

                        EndQuestAndGenerateRewards();
                    }
                });
            }
        }
Пример #2
0
        public override bool CanLeaveFromSite(QuestSite site)
        {
            if (HostileUtility.AnyNonDownedHostileOnMap(site.Map, Faction.OfAncientsHostile))
            {
                Messages.Message(Translator.Translate("EnemyOnTheMap"), MessageTypeDefOf.NeutralEvent, false);
                return(false);
            }

            return(true);
        }
Пример #3
0
        public override bool CanLeaveFromSite(QuestSite site)
        {
            if (TargetPawn != null && !TargetPawn.Dead)
            {
                Messages.Message("OrderedTargetStillAlive".Translate(TargetPawn.Name.ToStringFull), MessageTypeDefOf.NeutralEvent, false);
                return(false);
            }

            if (TargetPawn != null && HostileUtility.AnyNonDownedHostileOnMap(site.Map, TargetPawn.Faction))
            {
                Messages.Message(Translator.Translate("EnemyOnTheMap"), MessageTypeDefOf.NeutralEvent, false);
                return(false);
            }

            return(true);
        }
        public override bool CanLeaveFromSite(QuestSite site)
        {
            if (!Defended)
            {
                Messages.Message(Translator.Translate("Quest_Archotech_567H_GetResources_NeedDefend"), MessageTypeDefOf.NeutralEvent, false);
                return(false);
            }

            if (HostileUtility.AnyNonDownedHostileOnMap(site.Map, Faction))
            {
                Messages.Message(Translator.Translate("EnemyOnTheMap"), MessageTypeDefOf.NeutralEvent, false);
                return(false);
            }

            Won = true;

            return(true);
        }