private static float GetTargetAmount(Hitsound hitsound, Target.TargetBehavior behavior) { float amount = 0.1f; switch (hitsound) { case Hitsound.ChainNode: amount = (maxBrightness / 100f) * 5f; break; case Hitsound.ChainStart: amount = (maxBrightness / 100f) * 15f; break; case Hitsound.Kick: amount = (maxBrightness / 100f) * 25f; break; case Hitsound.Snare: amount = (maxBrightness / 100f) * 40f; break; case Hitsound.Percussion: amount = (maxBrightness / 100f) * 60f; break; case Hitsound.Melee: amount = (maxBrightness / 100f) * 80f; break; default: break; } if (behavior == Target.TargetBehavior.Melee) { if (hitsound != Hitsound.Melee) { if (hitsound == Hitsound.Snare) { amount = (maxBrightness / 100f) * 60f; } else { amount = (maxBrightness / 100f) * 5f; } } } else { if (hitsound == Hitsound.Melee) { amount = 0f; } } //if (behavior == Target.TargetBehavior.Melee && hitsound == Hitsound.Snare) amount = (maxBrightness / 100f) * 80f; return(amount * Config.intensity * .5f); }
private static void Postfix(Target __instance, Target.TargetBehavior behavior, Target.TargetHandType handType) { if (!Config.Enabled) { return; } if (behavior == Target.TargetBehavior.Chain) { Target target = __instance; Color rightColor; Color leftColor; if (Config.UseHandColors) { rightColor = PlayerPreferences.I.GunColorRight.Get() / 2; leftColor = PlayerPreferences.I.GunColorLeft.Get() / 2; } else { rightColor = new Color(Config.RightB, Config.RightG, Config.RightB); leftColor = new Color(Config.LeftR, Config.LeftG, Config.LeftB); } if (handType == Target.TargetHandType.Right) { target.chainLine.startColor = rightColor; target.chainLine.endColor = rightColor; } else if (handType == Target.TargetHandType.Left) { target.chainLine.startColor = leftColor; target.chainLine.endColor = leftColor; } else { target.chainLine.startColor = KataConfig.I.eitherHandColor; target.chainLine.endColor = KataConfig.I.eitherHandColor; } } }
private static void CalculateMaxPossibleScore(bool debug = false) { int theoreticalStreak = currentStreak; int theoreticalMaxScore = 0; int theoreticalMultiplier = currentMultiplier; foreach (SongCues.Cue cue in songCues) { int score = 0; Target.TargetBehavior behavior = cue.behavior; if (sustainTickRH > 0) { if (cue.tick >= sustainTickRH) { sustainTickRH = 0; theoreticalMaxScore += (3000 * theoreticalMultiplier); } } if (sustainTickLH > 0) { if (cue.tick >= sustainTickLH) { sustainTickLH = 0; theoreticalMaxScore += (3000 * theoreticalMultiplier); } } if (behavior != Target.TargetBehavior.Chain) { theoreticalStreak += 1; if (theoreticalMultiplier < 4) { float mult = (theoreticalStreak / 10f); if ((mult % 1) == 0) { theoreticalMultiplier += 1; } } } switch (behavior) { case Target.TargetBehavior.Hold: if (cue.handType == Target.TargetHandType.Right) { sustainTickRH = cue.tick + cue.tickLength; } else { sustainTickLH = cue.tick + cue.tickLength; } break; case Target.TargetBehavior.Chain: score = 125; break; default: score = 2000; break; } score *= theoreticalMultiplier; theoreticalMaxScore += score; } if (debug) { int sc = currentScore + theoreticalMaxScore; MelonLogger.Log("Max calculated score: " + sc.ToString()); MelonLogger.Log("Real max score: " + StarThresholds.I.GetMaxRawScore(SongDataHolder.I.songData.songID, KataConfig.Difficulty.Expert).ToString()); } if (currentScore + theoreticalMaxScore < highscore) { RestartSong(); } }
public BehaviorType(Target.TargetBehavior _behavior, Target.TargetHandType _handType) { behavior = _behavior; handType = _handType; }