예제 #1
0
        public PlayerFighter(SocketGuildUser user) : base(user.DisplayName(), user.GetAvatarUrl(),
                                                          ModifyStats(user),
                                                          AdeptClassSeriesManager.GetElStats(UserAccounts.GetAccount(user)),
                                                          AdeptClassSeriesManager.GetMoveset(UserAccounts.GetAccount(user)))
        {
            avatar    = UserAccounts.GetAccount(user);
            guildUser = user;

            var classSeries = AdeptClassSeriesManager.GetClassSeries(avatar);

            if (classSeries.Name == "Curse Mage Series" || classSeries.Name == "Medium Series")
            {
                IsImmuneToItemCurse = true;
            }
            var gear = avatar.Inv.GetGear(classSeries.Archtype);

            gear.OrderBy(i => i.ItemType).ToList().ForEach(g =>
            {
                HPrecovery  += g.HPRegen;
                PPrecovery  += g.PPRegen;
                unleashRate += g.IncreaseUnleashRate;
                if (g.IsCursed)
                {
                    AddCondition(Condition.ItemCurse);
                }

                if (g.CuresCurse)
                {
                    IsImmuneToItemCurse = true;
                }

                if (g.Category == ItemCategory.Weapon)
                {
                    Weapon = g;
                    if (Weapon.IsUnleashable)
                    {
                        Weapon.Unleash.AdditionalEffects.Clear();
                    }
                }
                else if (g.IsUnleashable)
                {
                    if (g.GrantsUnleash)
                    {
                        if ((Weapon != null) && Weapon.IsUnleashable)
                        {
                            Weapon.Unleash.AdditionalEffects.AddRange(g.Unleash.Effects);
                        }
                    }
                    else
                    {
                        EquipmentWithEffect.Add(g);
                    }
                }
            });
        }
예제 #2
0
        public PlayerFighter CreatePlayerFighter(SocketUser user)
        {
            var p      = new PlayerFighter();
            var avatar = UserAccounts.GetAccount(user);

            p.Name    = (user is SocketGuildUser) ? ((SocketGuildUser)user).DisplayName() : user.Username;
            p.avatar  = avatar;
            p.ImgUrl  = user.GetAvatarUrl();
            p.factory = this;
            if (user is SocketGuildUser)
            {
                p.guildUser = (SocketGuildUser)user;
            }
            p.Moves = AdeptClassSeriesManager.GetMoveset(avatar);

            var Class       = AdeptClassSeriesManager.GetClass(avatar);
            var classSeries = AdeptClassSeriesManager.GetClassSeries(avatar);

            p.Stats   = GetStats(avatar);
            p.ElStats = AdeptClassSeriesManager.GetElStats(avatar);
            if (classSeries.Name == "Curse Mage Series" || classSeries.Name == "Medium Series")
            {
                p.IsImmuneToItemCurse = true;
            }

            switch (InventoryOption)
            {
            case InventoryOption.Default:
                var gear = avatar.Inv.GetGear(classSeries.Archtype);
                gear.ForEach(g =>
                {
                    p.Stats += g.AddStatsOnEquip;
                });
                gear.ForEach(g =>
                {
                    p.ElStats += g.AddElStatsOnEquip;
                });
                gear.ForEach(g =>
                {
                    p.Stats *= g.MultStatsOnEquip;
                    p.Stats *= 0.01;
                });

                gear.OrderBy(i => i.ItemType).ToList().ForEach(g =>
                {
                    p.HPrecovery  += g.HPRegen;
                    p.PPrecovery  += g.PPRegen;
                    p.unleashRate += g.IncreaseUnleashRate;
                    if (g.IsCursed)
                    {
                        p.AddCondition(Condition.ItemCurse);
                    }

                    if (g.CuresCurse)
                    {
                        p.IsImmuneToItemCurse = true;
                    }

                    if (g.Category == ItemCategory.Weapon)
                    {
                        p.Weapon = g;
                        if (p.Weapon.IsUnleashable)
                        {
                            p.Weapon.Unleash.AdditionalEffects.Clear();
                        }
                    }
                    else if (g.IsUnleashable)
                    {
                        if (g.GrantsUnleash)
                        {
                            if ((p.Weapon != null) && p.Weapon.IsUnleashable)
                            {
                                p.Weapon.Unleash.AdditionalEffects.AddRange(g.Unleash.Effects);
                            }
                        }
                        else
                        {
                            p.EquipmentWithEffect.Add(g);
                        }
                    }
                });
                p.HPrecovery = (int)(p.HPrecovery * (1 + (double)avatar.LevelNumber / 33));

                break;

            case InventoryOption.NoInventory:
                break;
            }

            switch (DjinnOption)
            {
            case DjinnOption.Default:
                break;

            case DjinnOption.NoDjinn:
                break;
            }

            p.Stats *= Class.StatMultipliers;
            p.Stats *= 0.01;
            p.Stats *= StatMultiplier;
            p.Stats *= 0.01;

            return(p);
        }