private void SetCombatDisabled() { for (int i = 0; i < SkillSlots.Count; i++) { if (!SkillSlots[i].IsEmpty) { SkillSlots[i].SetDisabledState(); } } MoveSlot.SetDisabledState(); passSlot.SetDisabledState(); }
private void SetUsableCombatSkills() { BattleFormation allies = RaidSceneManager.RaidPanel.SelectedUnit.Team == Team.Heroes ? RaidSceneManager.BattleGround.HeroFormation : RaidSceneManager.BattleGround.MonsterFormation; BattleFormation enemies = RaidSceneManager.RaidPanel.SelectedUnit.Team == Team.Heroes ? RaidSceneManager.BattleGround.MonsterFormation : RaidSceneManager.BattleGround.HeroFormation; for (int i = 0; i < SkillSlots.Count; i++) { if (SkillSlots[i].IsEmpty) { continue; } if (SkillSlots[i].Skill.LimitPerBattle.HasValue) { if (RaidSceneManager.RaidPanel.SelectedUnit.CombatInfo.SkillsUsedInBattle. FindAll(skillId => skillId == SkillSlots[i].Skill.Id).Count >= SkillSlots[i].Skill.LimitPerBattle.Value) { SkillSlots[i].SetDisabledState(); continue; } } if (SkillSlots[i].Skill.LimitPerTurn.HasValue) { if (RaidSceneManager.RaidPanel.SelectedUnit.CombatInfo.SkillsUsedThisTurn. FindAll(skillId => skillId == SkillSlots[i].Skill.Id).Count >= SkillSlots[i].Skill.LimitPerTurn.Value) { SkillSlots[i].SetDisabledState(); continue; } } if (SkillSlots[i].Skill.LaunchRanks.IsLaunchableFrom(RaidSceneManager.RaidPanel.SelectedUnit.Rank, RaidSceneManager.RaidPanel.SelectedUnit.Size)) { if (BattleSolver.IsPerformerSkillTargetable(SkillSlots[i].Skill, allies, enemies, RaidSceneManager.RaidPanel.SelectedUnit)) { SkillSlots[i].SetCombatState(); if (RaidSceneManager.RaidPanel.SelectedUnit.CombatInfo.LastCombatSkillUsed == SkillSlots[i].Skill.Id) { SkillSlots[i].Select(); } continue; } } SkillSlots[i].SetDisabledState(); } if (RaidSceneManager.RaidPanel.SelectedUnit.CombatInfo.IsImmobilized) { MoveSlot.SetDisabledState(); } else { MoveSlot.SetCombatState(); } passSlot.SetCombatState(); }