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; }
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)); }
public IdolController(IIdol idolService) { _idolService = idolService; }
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)); }
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)); }
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; }
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); }
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); }
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(); } }
public static int GetLifeWithPotential(this IIdol idol, Potential potential = null) { return(idol.Life + m_potentialLifeDelta[(potential ?? GetPotential(idol.Name)).Life][idol.Rarity]); }
public static Potential GetPotential(this IIdol idol) { return(GetPotential(idol.Name)); }
public static int GetVisualWithPotential(this IIdol idol, Potential potential = null) { return(idol.Visual + m_potentialAppealDelta[(potential ?? GetPotential(idol.Name)).Visual][idol.Rarity]); }
public static int GetDanceWithPotential(this IIdol idol, Potential potential = null) { return(idol.Dance + m_potentialAppealDelta[(potential ?? GetPotential(idol.Name)).Dance][idol.Rarity]); }
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); }
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)); }
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))); }
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); }