public virtual bool CastSkill(int skillID, Location castLoc) { if (!EntityBuffManager.Castable) { return(false); } BaseSkill tSkill = SkillHashes[skillID].GetBaseSkill(); if (ActionPoints < tSkill.actionPointsCost) { return(false); } ImpactActionPoints(tSkill.actionPointsCost, true); tSkill.ApplyEffect(Hash, Loc, castLoc, true); tempAttribute = new EntityAttribute(); return(true); }
public void UpdateToSkillBoard(int skillHash) { entityInfo.SetActive(false); BaseSkill skill = skillHash.GetBaseSkill(); title.text = skill.skillName; Color c = colors[(int)skill.skillElement]; string element = skill.damageType == DamageType.Physical ? "Physical" : skill.skillElement.ToString(); description.text = skill.description; if (skill.labels.Contains(Label.Damage)) { var vSkill = skill as BasicAttackSkill; int adjustmentDamage = vSkill.baseValue; if (BattleManager.Instance.IsInBattle) { if (vSkill.attribute == AdditiveAttribute.Strength) { adjustmentDamage += AreaManager.Instance.character.Strength; } else if (vSkill.attribute == AdditiveAttribute.Intelligence) { adjustmentDamage += AreaManager.Instance.character.Intelligence; } else { adjustmentDamage += AreaManager.Instance.character.Agility; } } description.text += string.Format("Deal <color=#{0:X2}{1:X2}{2:X2}>{3} {4}</color> damage to target", (int)(c.r * 255), (int)(c.g * 255), (int)(c.b * 255), adjustmentDamage, element); } header.color = colors[(int)skill.skillElement]; for (int i = 0; i < apcostImgs.Length; i++) { apcostImgs[i].gameObject.SetActive(i < skill.actionPointsCost); } m_rectT.sizeDelta = baseRect + new Vector2(0, (description.text.Length / charLengthPerRow + 1) * hightPerRow); }
private bool SkillCheck(int entityHash, int skillID, Label label) { BaseSkill skill = entityHash.GetEntity().SkillHashes[skillID].GetBaseSkill(); return(skill.labels.Contains(label) && entityHash.GetEntity().ActionPoints >= skill.actionPointsCost); }
public InstanceSkill(BaseSkill skill) { TSkill = skill; Cooldown = 0; }
public static int CompareByName(BaseSkill s1, BaseSkill s2) { return(s1.skillName.CompareTo(s2.name)); }