Exemple #1
0
        public override void Initialize(AbilitySetupEntry setup, IPlayer user)
        {
            if (Initialized)
            {
                return;
            }

            base.Initialize(setup, user);

            Release = Get <Release>();

            Execute         = Get <Execute>();
            Execute.Detain  = this;
            Execute.HasUses = HasUses;
            Execute.Uses    = Uses;
        }
Exemple #2
0
        // TODO: Victory condition
        // TODO: Avoid self confirming roles (Mayor, Marshall, Crier...)
        public override void Initialize(AbilitySetupEntry setup, IPlayer user)
        {
            if (Initialized)
            {
                return;
            }

            base.Initialize(setup, user);

            var candidates = Match.LivingPlayers.AsEnumerable();

            if (Setup.TargetAlwaysTown)
            {
                candidates = candidates.OrderByDescending(candidate => candidate.Role.Team.Id == "Town");
            }

            Target = candidates.Random(Match.Random);
        }