Пример #1
0
        public void Pray(out bool acted)
        {
            acted = true;

            if (God != null)
            {
                NotifyListeners(String.Format("*kneels to pray*"));

                God.PrayResult res;
                if (God != Gods.None && (res = God.HearPray(this)) != God.PrayResult.None)
                {
                    var msg = new StringBuilder(String.Format("{0} hears you", God.Name));

                    switch (res)
                    {
                    case God.PrayResult.Bad:
                        msg.Append(", but he's very mad at you...");
                        break;

                    case God.PrayResult.Good:
                        msg.Append(" and he decided to grant you his favours");
                        break;

                    case God.PrayResult.VeryGood:
                        msg.Append(" and blesses you as his holy champion");
                        break;
                    }

                    NotifyListeners(msg.ToString());
                    //TempModifiers.AddTemporaryModifier(mod);
                    //RegisterTemporaryMod(mod);
                    God.EffectOfPray(this);
                }
                else
                {
                    NotifyListeners(String.Format("{0} is deaf to your requests", God.Name));
                }
            }
            else
            {
                NotifyListeners("*Tries to pray*");
                NotifyListeners("But no god will come to help you");
                acted = false;
            }
        }