コード例 #1
0
        public void Execute(PartyVO party)
        {
            CharacterModel characters = AmbitionApp.GetModel <CharacterModel>();

            // TODO: Assignable Character Configs for Notables
            if (string.IsNullOrEmpty(party.Host))
            {
                party.Host = Util.RNG.TakeRandom(characters.Notables).Name;
            }

            party.Description = (party.ID != null)
                ? AmbitionApp.GetString("party.description." + party.ID)
                : GetRandomText("party_reason." + party.Faction);

            party.Name = (party.ID != null)
                ? AmbitionApp.GetString("party.name." + party.ID)
                : AmbitionApp.GetString("party.name.default",
                                        new Dictionary <string, string>()
            {
                { "$HOST", party.Host },
                { "$IMPORTANCE", AmbitionApp.GetString("party_importance." + ((int)party.Importance).ToString()) },
                { "$REASON", party.Description }
            });

            string str = AmbitionApp.GetString("party_fluff", new Dictionary <string, string>()
            {
                { "$INTRO", GetRandomText("party_fluff_intro") },
                { "$ADJECTIVE", GetRandomText("party_fluff_adjective") },
                { "$NOUN", GetRandomText("party_fluff_noun") }
            });

            party.Invitiation = AmbitionApp.GetString("party.invitation." + party.ID, new Dictionary <string, string>()
            {
                { "$PLAYER", AmbitionApp.GetModel <GameModel>().PlayerName },
                //{"$PRONOUN", AmbitionApp.GetString(party.Host.Gender == Gender.Female ? "her" : "his")},
                { "$PRONOUN", AmbitionApp.GetString("their") }, // TODO
                { "$PARTY", party.Description },
                { "$DATE", AmbitionApp.GetModel <CalendarModel>().GetDateString(party.Date) },
                { "$SIZE", AmbitionApp.GetString("party_importance." + ((int)party.Importance).ToString()) },
                { "$FLUFF", str }
            });


            // Random Faction
            if (party.Faction == null)
            {
                party.Faction = Util.RNG.TakeRandom(new List <string>(AmbitionApp.GetModel <FactionModel>().Factions.Keys).ToArray());
            }

            if (party.Importance == PartySize.None)
            {
                party.Importance = (PartySize)Util.RNG.Generate(1, 4);
            }
            if (party.Turns == 0)
            {
                party.Turns = ((int)party.Importance * 5) + 1;
            }

            AmbitionApp.GetModel <CalendarModel>().Schedule(party);
        }
コード例 #2
0
ファイル: RSVPDialog.cs プロジェクト: rasmus-z/DeWinter
        public void Initialize(PartyVO party)
        {
            ServantModel smod = AmbitionApp.GetModel <ServantModel>();
            Dictionary <string, string> dialogsubs = new Dictionary <string, string>()
            {
                { "$PARTYSIZE", AmbitionApp.GetString("party_importance." + ((int)party.Importance).ToString()) }
            };

            _party        = party;
            TitleTxt.text = party.Host;

            if (smod.Servants.ContainsKey(ServantConsts.SPYMASTER))
            {
                if (_party.Enemies != null && _party.Enemies.Length > 0)
                {
                    string enemyList = "";
                    Dictionary <string, string> subs = new Dictionary <string, string>();
                    foreach (EnemyVO enemy in _party.Enemies)
                    {
                        enemyList += "\n" + enemy.Name;
                    }
                    subs.Add("$ENEMYLIST", enemyList);
                    dialogsubs.Add("$PROMPT", AmbitionApp.GetString("party_enemies", subs));
                }
                else
                {
                    dialogsubs.Add("$PROMPT", AmbitionApp.GetString("party_no_enemies"));
                }
            }
            else
            {
                dialogsubs.Add("$PROMPT", AmbitionApp.GetString("party_prompt"));
            }

            ObjectiveText.text = AmbitionApp.GetString("party_objectives");
            HostText.text      = AmbitionApp.GetString("rsvp");
            Seal.sprite        = InvitationConfig.GetSprite("seal." + party.Faction);
            Stamp.sprite       = InvitationConfig.GetSprite(party.Faction.ToLower());
            BodyTxt.text       = party.Invitiation;
        }
コード例 #3
0
        public void Initialize(PartyVO p)
        {
            LocalizationModel localization = AmbitionApp.GetModel <LocalizationModel>();

            TitleText.text = localization.GetString("rsvp_cancel_dialog.title");

            _party = p;

            Dictionary <string, string> subs = new Dictionary <string, string>()
            {
                { "$PARTYSIZE", AmbitionApp.GetString("party_importance." + ((int)p.Importance).ToString()) },
                { "$HOSTNAME", p.Host },
                { "$FACTION", AmbitionApp.GetString(p.Faction) }
            };

            if (p.Date == AmbitionApp.GetModel <CalendarModel>().Today)
            {
                BodyText.text = localization.GetString("rsvp_cancel_dayof_dialog.title", subs);
            }
            else
            {
                BodyText.text = localization.GetString("rsvp_cancel_dialog.body", subs);
            }
        }
コード例 #4
0
 public void SetPhrase(string phrase)
 {
     TitleText.text = AmbitionApp.GetString(phrase + ".title");
     SubText.text   = AmbitionApp.GetString(phrase + ".body");
 }