示例#1
0
        public void GreetSuspicion(List <SuspicionTraitorRole> traitors, IChatManager chatMgr)
        {
            chatMgr.DispatchServerMessage(Mind.Session, Loc.GetString("You're a {0}!", Name));
            chatMgr.DispatchServerMessage(Mind.Session, Loc.GetString("Objective: {0}", Objective));

            if (traitors.Count == 1)
            {
                // Only traitor.
                chatMgr.DispatchServerMessage(Mind.Session, Loc.GetString("You're on your own. Good luck!"));
                return;
            }

            var text = string.Join(", ", traitors.Where(p => p != this).Select(p => p.Mind.CharacterName));

            var pluralText = Loc.GetPluralString("Your partner in crime is: {0}",
                                                 "Your partners in crime are: {0}",
                                                 traitors.Count - 1, text);

            chatMgr.DispatchServerMessage(Mind.Session, pluralText);
        }
        public SuicideKind Suicide(IEntity victim, IChatManager chat)
        {
            int headCount = 0;

            if (victim.TryGetComponent <BodyManagerComponent>(out var bodyManagerComponent))
            {
                var heads = bodyManagerComponent.GetBodyPartsOfType(BodyPartType.Head);
                foreach (var head in heads)
                {
                    var droppedHead = bodyManagerComponent.DisconnectBodyPart(head, true);
                    _storage.Insert(droppedHead);
                    headCount++;
                }
            }
            chat.EntityMe(victim, Loc.GetPluralString("is trying to cook {0:their} head!", "is trying to cook {0:their} heads!", headCount, victim));
            _currentCookTimerTime = 10;
            ClickSound();
            _uiDirty = true;
            wzhzhzh();
            return(SuicideKind.Heat);
        }
        private void RoleButtonPressed(ButtonEventArgs obj)
        {
            if (!TryGetComponent(out var role))
            {
                return;
            }

            if (!role.Antagonist ?? false)
            {
                return;
            }

            var allies  = string.Join(", ", role.Allies.Select(tuple => tuple.name));
            var message = role.Allies.Count switch
            {
                0 => Loc.GetString("You have no allies"),
                var n => Loc.GetPluralString("Your ally is {0}", "Your allies are {0}", n, allies),
            };

            role.Owner.PopupMessage(message);
        }