static void GetEventADVPrefix(Info __instance, int _command, PassingInfo ____passingInfo) { _currentCrestType = ____passingInfo?.heroine?.GetCurrentCrest() ?? CrestType.None; _currentPassingInfo = ____passingInfo; Console.WriteLine("GetEventADVPrefix " + _currentCrestType); _isHEvent = _command == 3; }
public CrestInfo(string id, string name, string description, AssetBundle bundle) { Id = (CrestType)Enum.Parse(typeof(CrestType), id); Implemented = LewdCrestXPlugin.ImplementedCrestTypes.Contains(Id); Name = name; Description = description; _bundle = bundle; }
public void RemoveCrests(CrestType crestType, int crestLevel, int crestAmount) { foreach (var crest in crests) { if (crest.IsCrest(crestType, crestLevel)) { crest.Amount -= crestAmount; } } }
internal void SkillReset(int skillId, CrestType type) { if (type != CrestType.Reset) { return; } var meterUser = NetworkController.Instance.EntityTracker.MeterUser; var bossIds = _lastBosses.Where(x => x.Value > 0).Select(x => x.Key).ToList(); if (meterUser == null || !bossIds.Any()) { return; } var teraActive = TeraWindow.IsTeraActive(); var bossList = bossIds.Select(x => (NpcEntity)NetworkController.Instance.EntityTracker.GetOrNull(x)).ToList(); foreach (var e in BasicTeraData.Instance.EventsData.Cooldown) { if (NetworkController.Instance.FlashMessage != null && NetworkController.Instance.FlashMessage.Priority >= e.Key.Priority) { continue; } if (e.Key.InGame != teraActive) { continue; } var cooldownEvent = (CooldownEvent)e.Key; if (cooldownEvent.SkillId != skillId) { continue; } foreach (var a in e.Value) { if (a.GetType() != typeof(NotifyAction)) { continue; } var notifyAction = ((NotifyAction)a).Clone(); var skill = BasicTeraData.Instance.SkillDatabase.GetOrNull(meterUser, skillId); if (notifyAction.Balloon != null) { notifyAction.Balloon.BodyText = notifyAction.Balloon.BodyText.Replace("{skill_name}", skill?.Name ?? skillId.ToString()); notifyAction.Balloon.TitleText = notifyAction.Balloon.TitleText.Replace("{skill_name}", skill?.Name ?? skillId.ToString()); } if (notifyAction.Sound != null && notifyAction.Sound.GetType() == typeof(TextToSpeech)) { var textToSpeech = (TextToSpeech)notifyAction.Sound; textToSpeech.Text = textToSpeech.Text.Replace("{skill_name}", skill?.Name ?? skillId.ToString()); } NetworkController.Instance.FlashMessage = new NotifyFlashMessage(notifyAction.Sound, notifyAction.Balloon, e.Key.Priority); } } }
static void UpdateUIFinalizer(TalkScene __instance, Button[] ___buttonEventContents) { Console.WriteLine("UpdateUIFinalizer " + _currentCrestType); if (_currentCrestType == CrestType.libido) { // 3 is lets have h // todo avoid using index for better compat? ___buttonEventContents[3]?.gameObject.SetActiveIfDifferent(true); } _currentCrestType = CrestType.None; }
static void GetEventADVPrefix(Info __instance, int _command) { _currentCrestType = __instance.passingInfo?.heroine?.GetCurrentCrest() ?? CrestType.None; _currentPassingInfo = __instance.passingInfo; _isHEvent = #if KK _command == 3; // 3 is lets have h #elif KKS _command == 20 || _command == 21; // 20 is lets have h, 21 is come to my room #endif //Console.WriteLine($"GetEventADVPrefix crest={_currentCrestType} _command={_command} _isHEvent={_isHEvent}"); }
static void UpdateUIFinalizer(TalkScene __instance) { //Console.WriteLine($"UpdateUIFinalizer crest={_currentCrestType}"); if (_currentCrestType == CrestType.libido) { // todo avoid using index for better compat? #if KK // 3 is lets have h __instance.buttonEventContents[3]?.gameObject.SetActiveIfDifferent(true); #elif KKS // 0 is lets have h, 1 is invite to room __instance.buttonR18Contents[0]?.gameObject.SetActiveIfDifferent(true); // Need to turn on the main r18 button in case none of the sub options were active __instance.buttonInfos[4].Active = true; #else throw new NotImplementedException(); #endif } _currentCrestType = CrestType.None; }
public Crest(CrestType crestType, int crestLevel = 1) { this.crestType = crestType; this.crestLevel = crestLevel; }
public bool IsCrest(CrestType crestType, int crestLevel = 1) { return(crest.CrestType == crestType && crest.CrestLevel == crest.CrestLevel); }
static void UpdateUIPrefix(TalkScene __instance) { _currentCrestType = __instance.targetHeroine.GetCurrentCrest(); //Console.WriteLine($"UpdateUIPrefix crest={_currentCrestType}"); _isHEvent = false; }
static void GetEventADVFinalizer() { //Console.WriteLine($"GetEventADVFinalizer crest={_currentCrestType}"); _currentCrestType = CrestType.None; }
static void GetEventADVFinalizer() { Console.WriteLine("GetEventADVFinalizer " + _currentCrestType); _currentCrestType = CrestType.None; }
public CrestInfo GetInfo(CrestType type) => _interfaceCrestInfos[Mathf.Max(0, Array.IndexOf(_interfaceCrestTypes, type))];
public int GetIndex(CrestType type) => Mathf.Max(0, Array.IndexOf(_interfaceCrestTypes, type));
public RequestedCrestData(CrestType crestType, int crestLevel, int crestAmount) { CrestType = crestType; CrestLevel = crestLevel; CrestAmount = crestAmount; }