public bool IsInputValid(RhythmTracker.BeatCommandId id) { foreach (BeatCommand beatCommand in beatCommands) { if (beatCommand.isAcceptingInput && (RhythmTracker.BeatCommandId)beatCommand.id == id) { int damage; HitPool.instance.StartHit(beatCommand.transform.position); if (beatCommand.IsPerfect()) { MessageSpawner.instance.SpawnPerfectResult(); damage = beatCommand.damage * 2; Enemy.instance.TakeDamage(beatCommand.damage * 2); } else { MessageSpawner.instance.SpawnGoodResult(); damage = beatCommand.damage; } //Do a little extra damage in the first half of the fight to compensate for less notes. if (!Enemy.instance.IsHalfwayDone()) { damage += PlayerStuff.instance.firstHalfDamageBuff; } Enemy.instance.TakeDamage(damage); beatCommand.Reset(); return(true); } } return(false); }
public void StartBeatCommand(int delay, int damage, RhythmTracker.BeatCommandId id, Transform parent) { if (id != RhythmTracker.BeatCommandId.None) { GetAvailableBeatCommand().Activate(delay, damage, (int)id, parent); } }