Ejemplo n.º 1
0
 public static Presence CannotBeSeenExceptWithEyes(IGameRole role) => new Presence()
 {
     Role      = role,
     Invisible = true,
     Attack    = 0,
     Protect   = 0
 };
Ejemplo n.º 2
0
        public async Task <EmbedBuilder> GetMapStatus(IGuildUser user, IMessageChannel contextChannel, bool IsPrivate)
        {
            var       msg         = ":zero::one::two::three::four::five::six::seven::eight:" + Environment.NewLine;
            var       flag        = RoleContextType.Public;
            IGameRole role        = null;
            var       resultEmbed = new EmbedBuilder();

            if (IsAPlayer(user))
            {
                if (contextChannel.Id == (await user.GetOrCreateDMChannelAsync()).Id)
                {
                    flag = RoleContextType.Private;
                }
                if (IsOnClubChannel(contextChannel))
                {
                    flag = RoleContextType.Channel;
                }
            }
            for (int y = 0; y < GameMap.MaxY; y++)
            {
                for (int x = 0; x < GameMap.MaxX; x++)
                {
                }
            }
            return(resultEmbed);
        }
Ejemplo n.º 3
0
        public async Task <IEnumerable <IGameRole> > GenerateGuardianRoles(int count)
        {
            if (count < 4)
            {
                await ForceJoin(Guardian, GuardianMembers, 4 - count);
            }
            IEnumerable <IGameRole> result = new IGameRole[] { new Touka(), new Shizuru(), new Lucia(), new Imamiya() };

            if (count > 4)
            {
                for (int i = 0; i < count - 4; i++)
                {
                    result = result.Append(new GilAndPana());
                }
            }
            // randomly, the array can change and you can instead have gil and pana separate.
            return(result.OrderBy((x) => Randomizer.Next()));
        }
Ejemplo n.º 4
0
        public async Task <IEnumerable <IGameRole> > GenerateOCRoles(int count)
        {
            if (count < 4)
            {
                await ForceJoin(Occult_Club, OCMembers, 4 - count);
            }
            IEnumerable <IGameRole> result = new IGameRole[] { new Kotori(Queue), new Kotarou(), new GilAndPana(), new GilAndPana() };

            if (count > 4)
            {
                for (int i = 0; i < count - 4; i++)
                {
                    result = result.Append(new GilAndPana());
                }
            }
            // randomly, the array can change and you can instead have gil and pana separate.
            return(result.OrderBy((x) => Randomizer.Next()));
        }
Ejemplo n.º 5
0
        public async Task <IEnumerable <IGameRole> > GenerateGaiaRoles(int count)
        {
            if (count < 4)
            {
                await ForceJoin(Gaia, GaiaMembers, 4 - count);
            }
            IEnumerable <IGameRole> result = new IGameRole[] { new Akane(), new ChihayaAndSakuya(), new Kashima(), new Shimako() };

            if (count > 4)
            {
                for (int i = 0; i < count - 4; i++)
                {
                    result = result.Append(new Summoner());
                }
            }
            // randomly the array can change and you can instead have Chihaya and Sakuya separate.
            return(result.OrderBy((x) => Randomizer.Next()));
        }
Ejemplo n.º 6
0
        public async Task <IEnumerable <IGameRole> > GenerateCivilianRoles(int count)
        {
            var everyone = GaiaMembers.Concat(GuardianMembers).Concat(OCMembers).Concat(Civilians);
            var all_ids  = new ulong[] { Occult_Club.Id, Guardian.Id, Gaia.Id };

            if (count < 4)
            {
                var random_players = (await ServerHost.GetUsersAsync())
                                     .Where((x) => !x.IsBot &&
                                            !everyone.Contains(x) &&
                                            !x.RoleIds.Any((y) => all_ids.Contains(y))
                                            );
                var random_numbers    = new int[4 - count];
                var total_non_playing = random_players.Count();
                var resultMsg         = String.Empty;
                for (int i = 0; i < 4 - count; i++)
                {
                    do
                    {
                        random_numbers[i] = Randomizer.Next(total_non_playing);
                    } while (random_numbers.Take(i).Contains(random_numbers[i]));
                    var memToAdd = random_players.ElementAt(random_numbers[i]);
                    Civilians.Add(memToAdd);
                    await memToAdd.AddRoleAsync(GvG_Player);

                    resultMsg += $"Because there are too few players, {memToAdd.Mention} is forced to join the game as a Civilian" + ((i == count - 1) ? "" : Environment.NewLine);
                }
                Public_GvG.SendMessageAsync(resultMsg);
            }
            IEnumerable <IGameRole> result = new IGameRole[] { new Kagari(), new NormalCivilian(), new NormalCivilian(), new NormalCivilian() };

            if (count > 4)
            {
                for (int i = 0; i < count - 4; i++)
                {
                    result = result.Append(new NormalCivilian());
                }
            }
            return(result.OrderBy((x) => Randomizer.Next()));
        }