예제 #1
0
        protected override bool Run(SimDescription me, SimPersonality personality)
        {
            if (!AcceptCancelDialog.Show(Common.Localize("RemoveLeader:Prompt", personality.IsFemaleLocalization(), me.IsFemale, new object[] { personality.GetLocalizedName(), me })))
            {
                return(false);
            }

            personality.SetLeader(null, true);
            return(true);
        }
예제 #2
0
        protected override bool Run(SimDescription me, SimPersonality personality)
        {
            if (!ApplyAll)
            {
                if (!AcceptCancelDialog.Show(Common.Localize("RemoveMember:Prompt", personality.IsFemaleLocalization(), me.IsFemale, new object[] { personality.GetLocalizedName(), me })))
                {
                    return(false);
                }
            }

            personality.RemoveFromClan(me);
            return(true);
        }
예제 #3
0
        protected override bool Run(SimDescription me, SimPersonality personality)
        {
            if (personality.Me != null)
            {
                if (!AcceptCancelDialog.Show(Common.Localize("AddMember:Prompt", personality.IsFemaleLocalization(), personality.Me.IsFemale, new object[] { personality.GetLocalizedName(), personality.Me })))
                {
                    return(false);
                }
            }

            personality.AddToClan(personality, me, true);
            return(true);
        }
예제 #4
0
        protected string GetDetails()
        {
            List <Item> choices = new List <Item>();

            IEnumerable <SimPersonality> personalities = SP::NRaas.StoryProgression.Main.Personalities.AllPersonalities;

            foreach (SimPersonality personality in personalities)
            {
                if (personality.IsLeaderless)
                {
                    continue;
                }

                choices.Add(new Item(personality));
            }

            CommonSelection <Item> .Results results = new CommonSelection <Item>(Name, choices).SelectMultiple();

            string msg = null;

            foreach (Item choice in results)
            {
                SimPersonality personality = choice.Value;

                msg += Common.NewLine + personality.GetLocalizedName();

                if (personality.Me != null)
                {
                    msg += Common.Localize(GetTitlePrefix() + ":Leader", personality.Me.IsFemale, personality.IsFemaleLocalization(), new object[] { personality.Me });
                }
                else
                {
                    msg += Common.Localize(GetTitlePrefix() + ":NoLeader", personality.IsFemaleLocalization());
                }

                int memberCount = personality.GetClanMembers(false).Count;
                if (memberCount > 0)
                {
                    msg += Common.Localize(GetTitlePrefix() + ":Members", personality.IsFemaleLocalization(), new object[] { memberCount });
                }

                Dictionary <SimDescription, bool> opponents = new Dictionary <SimDescription, bool>();

                foreach (SimPersonality opponent in personalities)
                {
                    if (opponent.IsOpposing(personality))
                    {
                        foreach (SimDescription sim in opponent.GetClanMembers(true))
                        {
                            if (opponents.ContainsKey(sim))
                            {
                                continue;
                            }

                            opponents.Add(sim, true);
                        }
                    }
                }

                if (opponents.Count > 0)
                {
                    msg += Common.Localize(GetTitlePrefix() + ":Opposing", personality.IsFemaleLocalization(), new object[] { opponents.Count });
                }

                msg += Common.NewLine;
            }

            return(msg);
        }