Esempio n. 1
0
 public MemberController(
     IMember memberService,
     IClub clubService,
     IIdol idolService,
     IPayment paymentService,
     ApplicationDbContext context,
     UserManager <ApplicationUser> userManager)
 {
     _clubService    = clubService;
     _idolService    = idolService;
     _paymentService = paymentService;
     _context        = context;
     _memberService  = memberService;
     _userManager    = userManager;
 }
Esempio n. 2
0
        private double GetSkillTriggerProbability(OwnedIdol idol, IIdol center, IIdol guestCenter, Song song)
        {
            if (idol == null || idol.Skill == null)
            {
                return(0);
            }
            var rate = idol.Skill.EstimateProbability(idol.SkillLevel);

            if (center != null && center.CenterEffect is CenterEffect.SkillTriggerProbabilityUp)
            {
                var e = center.CenterEffect as CenterEffect.SkillTriggerProbabilityUp;
                rate *= 1 + (e.Targets.HasFlag(idol.Category) ? e.Rate : 0);
            }
            if (guestCenter != null && guestCenter.CenterEffect is CenterEffect.SkillTriggerProbabilityUp)
            {
                var e = guestCenter.CenterEffect as CenterEffect.SkillTriggerProbabilityUp;
                rate *= 1 + (e.Targets.HasFlag(idol.Category) ? e.Rate : 0);
            }
            if (song != null && song.Type.HasFlag(idol.Category))
            {
                rate *= 1.3;
            }
            return(Math.Min(rate, 1.0));
        }
Esempio n. 3
0
 public IdolController(IIdol idolService)
 {
     _idolService = idolService;
 }
Esempio n. 4
0
 private Idol CreateGuestWithPotential(IIdol guest)
 {
     return(guest == null ? null : new Idol(guest.Label, guest.Name, guest.Rarity, guest.Category, guest.GetLifeWithPotential(GuestPotential), guest.GetDanceWithPotential(GuestPotential),
                                            guest.GetVocalWithPotential(GuestPotential), guest.GetVisualWithPotential(GuestPotential), guest.ImplementationDate, guest.CenterEffect, guest.Skill));
 }
Esempio n. 5
0
 private int CalculateAppeal(IIdol idol, bool isSupportMember = false, bool encore = false)
 {
     return(CalculateAppeal(AppealType.Vocal, idol, isSupportMember, encore) +
            CalculateAppeal(AppealType.Dance, idol, isSupportMember, encore) +
            CalculateAppeal(AppealType.Visual, idol, isSupportMember, encore));
 }
Esempio n. 6
0
        private double GetAppealUpRate(IIdol idol, IIdol center, AppealType targetAppeal)
        {
            var effect = center?.CenterEffect;

            if (effect != null && Unit != null)
            {
                if (effect is CenterEffect.AppealUp)
                {
                    var e = effect as CenterEffect.AppealUp;
                    if (e.Targets.HasFlag(idol.Category) == true && e.TargetAppeal.HasFlag(targetAppeal) == true)
                    {
                        return e.Rate;
                    }
                }
                else if (effect is CenterEffect.ConditionalAppealUp)
                {
                    var e = effect as CenterEffect.ConditionalAppealUp;
                    var conditionFulfilled = false;
                    switch (e.Condition)
                    {
                        case AppealUpCondition.UnitContainsAllTypes:
                            conditionFulfilled = Unit.Slots.Any(x => x.Category == IdolCategory.Cool) &&
                                Unit.Slots.Any(x => x.Category == IdolCategory.Cute) &&
                                Unit.Slots.Any(x => x.Category == IdolCategory.Passion);
                            break;
                        default:
                            break;
                    }

                    if (conditionFulfilled && e.Targets.HasFlag(idol.Category) == true && e.TargetAppeal.HasFlag(targetAppeal) == true)
                    {
                        return e.Rate;
                    }
                }
            }

            return 0;
        }
Esempio n. 7
0
 private double GetSkillTriggerProbability(OwnedIdol idol, IIdol center, IIdol guestCenter, Song song)
 {
     if (idol == null || idol.Skill == null)
     {
         return 0;
     }
     var rate = idol.Skill.EstimateProbability(idol.SkillLevel);
     if (center != null && center.CenterEffect is CenterEffect.SkillTriggerProbabilityUp)
     {
         var e = center.CenterEffect as CenterEffect.SkillTriggerProbabilityUp;
         rate *= 1+(e.Targets.HasFlag(idol.Category) ? e.Rate : 0);
     }
     if (guestCenter != null && guestCenter.CenterEffect is CenterEffect.SkillTriggerProbabilityUp)
     {
         var e = guestCenter.CenterEffect as CenterEffect.SkillTriggerProbabilityUp;
         rate *= 1+(e.Targets.HasFlag(idol.Category) ? e.Rate : 0);
     }
     if (song != null && song.Type.HasFlag(idol.Category))
     {
         rate *= 1.3;
     }
     return Math.Min(rate, 1.0);
 }
Esempio n. 8
0
 private int CalculateAppeal(IIdol idol, bool isSupportMember = false, bool encore = false)
 {
     return CalculateAppeal(AppealType.Vocal, idol, isSupportMember, encore) +
         CalculateAppeal(AppealType.Dance, idol, isSupportMember, encore) +
         CalculateAppeal(AppealType.Visual, idol, isSupportMember, encore);
 }
Esempio n. 9
0
        private int CalculateAppeal(AppealType targetAppeal, IIdol idol, bool isSupportMember, bool encore = false)
        {
            if (idol == null)
            {
                return 0;
            }
            var rate = 1.0;

            if (!isSupportMember)
            {
                if (EnableRoomEffect)
                {
                    rate += 0.1;
                }

                if (Unit != null && Unit.Center != null &&
                    Unit.Center.CenterEffect != null && Unit.Center.CenterEffect is CenterEffect.AppealUp)
                {
                    var e = Unit.Center.CenterEffect as CenterEffect.AppealUp;
                    if (e.Targets.HasFlag(idol.Category) && e.TargetAppeal.HasFlag(targetAppeal))
                    {
                        rate += e.Rate;
                    }
                }

                if (Guest != null && Guest.CenterEffect != null && Guest.CenterEffect is CenterEffect.AppealUp)
                {
                    var e = Guest.CenterEffect as CenterEffect.AppealUp;
                    if (e.Targets.HasFlag(idol.Category) && e.TargetAppeal.HasFlag(targetAppeal))
                    {
                        rate += e.Rate;
                    }
                }
            }

            if (GrooveBurst != null)
            {
                if (encore)
                {
                    if (Song != null && Song.Type.HasFlag(idol.Category))
                    {
                        rate += 0.3;
                    }
                }
                else if (GrooveType.HasFlag(idol.Category))
                {
                    rate += 0.3;
                }

                if (GrooveBurst.Value.HasFlag(targetAppeal))
                {
                    rate += 1.5;
                }
            }
            else if (Song != null && Song.Type.HasFlag(idol.Category))
            {
                rate += 0.3;
            }

            switch (targetAppeal)
            {
                case AppealType.Vocal:
                    return (int)Math.Ceiling(idol.Vocal * rate * (isSupportMember ? 0.5 : 1));
                case AppealType.Dance:
                    return (int)Math.Ceiling(idol.Dance * rate * (isSupportMember ? 0.5 : 1));
                case AppealType.Visual:
                    return (int)Math.Ceiling(idol.Visual * rate * (isSupportMember ? 0.5 : 1));
                default:
                    throw new Exception();
            }
        }
Esempio n. 10
0
 public static int GetLifeWithPotential(this IIdol idol, Potential potential = null)
 {
     return(idol.Life + m_potentialLifeDelta[(potential ?? GetPotential(idol.Name)).Life][idol.Rarity]);
 }
Esempio n. 11
0
 public static Potential GetPotential(this IIdol idol)
 {
     return(GetPotential(idol.Name));
 }
Esempio n. 12
0
 public static int GetVisualWithPotential(this IIdol idol, Potential potential = null)
 {
     return(idol.Visual + m_potentialAppealDelta[(potential ?? GetPotential(idol.Name)).Visual][idol.Rarity]);
 }
Esempio n. 13
0
 public static int GetDanceWithPotential(this IIdol idol, Potential potential = null)
 {
     return(idol.Dance + m_potentialAppealDelta[(potential ?? GetPotential(idol.Name)).Dance][idol.Rarity]);
 }
Esempio n. 14
0
 private Idol CreateGuestWithPotential(IIdol guest)
 {
     return guest == null ? null : new Idol(guest.Label, guest.Name, guest.Rarity, guest.Category, guest.GetLifeWithPotential(GuestPotential), guest.GetDanceWithPotential(GuestPotential),
         guest.GetVocalWithPotential(GuestPotential), guest.GetVisualWithPotential(GuestPotential), guest.ImplementationDate, guest.CenterEffect, guest.Skill);
 }
Esempio n. 15
0
        private int CalculateAppeal(AppealType targetAppeal, IIdol idol, bool isSupportMember, bool encore = false)
        {
            if (idol == null)
            {
                return 0;
            }
            var rate = 1.0;

            if (!isSupportMember)
            {
                if (EnableRoomEffect)
                {
                    rate += 0.1;
                }

                rate += GetAppealUpRate(idol, Unit?.Center, targetAppeal);
                rate += GetAppealUpRate(idol, Guest, targetAppeal);
            }

            if (GrooveBurst != null)
            {
                if (encore)
                {
                    if (Song != null && Song.Type.HasFlag(idol.Category))
                    {
                        rate += 0.3;
                    }
                }
                else if (GrooveType.HasFlag(idol.Category))
                {
                    rate += 0.3;
                }

                if (GrooveBurst.Value.HasFlag(targetAppeal))
                {
                    rate += 1.5;
                }
            }
            else if (Song != null && Song.Type.HasFlag(idol.Category))
            {
                rate += 0.3;
            }

            return (int)Math.Ceiling(Math.Round((int)idol.GetType().GetProperty(targetAppeal.ToString()).GetValue(idol) * rate * (isSupportMember ? 0.5 : 1), 3));
        }
Esempio n. 16
-1
        private int CalculateAppeal(AppealType targetAppeal, IIdol idol, bool isSupportMember, bool encore = false)
        {
            if (idol == null)
            {
                return(0);
            }
            var rate = 1.0;

            if (!isSupportMember)
            {
                if (EnableRoomEffect)
                {
                    rate += 0.1;
                }

                rate += GetAppealUpRate(idol, Unit?.Center, Guest, targetAppeal);
                rate += GetAppealUpRate(idol, Guest, Guest, targetAppeal);
            }

            if (GrooveBurst != null)
            {
                if (encore)
                {
                    if (Song != null && Song.Type.HasFlag(idol.Category))
                    {
                        rate += 0.3;
                    }
                }
                else if (GrooveType.HasFlag(idol.Category))
                {
                    rate += 0.3;
                }

                if (GrooveBurst.Value.HasFlag(targetAppeal))
                {
                    rate += 1.5;
                }
            }
            else if (Song != null && Song.Type.HasFlag(idol.Category))
            {
                rate += 0.3;
            }

            return((int)Math.Ceiling(Math.Round((int)idol.GetType().GetProperty(targetAppeal.ToString()).GetValue(idol) * rate * (isSupportMember ? 0.5 : 1), 3)));
        }
Esempio n. 17
-1
        private double GetAppealUpRate(IIdol idol, IIdol center, Idol guest, AppealType targetAppeal)
        {
            var effect = center?.CenterEffect;

            if (effect != null && Unit != null)
            {
                if (effect is CenterEffect.AppealUp)
                {
                    var e = effect as CenterEffect.AppealUp;
                    if (e.Targets.HasFlag(idol.Category) == true && e.TargetAppeal.HasFlag(targetAppeal) == true)
                    {
                        return(e.Rate);
                    }
                }
                else if (effect is CenterEffect.ConditionalAppealUp)
                {
                    var e = effect as CenterEffect.ConditionalAppealUp;
                    var conditionFulfilled = false;
                    switch (e.Condition)
                    {
                    case AppealUpCondition.UnitContainsAllTypes:
                        conditionFulfilled = (Unit.Slots.Any(x => x.Category == IdolCategory.Cool) || (Guest?.Category == IdolCategory.Cool)) &&
                                             (Unit.Slots.Any(x => x.Category == IdolCategory.Cute) || (Guest?.Category == IdolCategory.Cute)) &&
                                             (Unit.Slots.Any(x => x.Category == IdolCategory.Passion) || (Guest?.Category == IdolCategory.Passion));
                        break;

                    default:
                        break;
                    }

                    if (conditionFulfilled && e.Targets.HasFlag(idol.Category) == true && e.TargetAppeal.HasFlag(targetAppeal) == true)
                    {
                        return(e.Rate);
                    }
                }
            }

            return(0);
        }