void Attack() { CreateSkill(); CloseRange(); CloseSkill(); int damage = (int)GameTools.CalculateDamage(GameManage.Instance.role, skillLevel, skill); if (skill.skillAreaType != SkillAreaType.Self) { if (damageList.Find(a => a.x == GameManage.Instance.role.x && a.y == GameManage.Instance.role.y) != null) { damageList.Remove(damageList.Find(a => a.x == GameManage.Instance.role.x && a.y == GameManage.Instance.role.y)); } } //Debug.LogError("damageList.Count " + damageList.Count); foreach (SkillPoint point in damageList) { //Debug.LogError(point.x + " " + point.y); if (GameManage.Instance.groundList[point.x][point.y].character != null) { GameTools.Damage(GameManage.Instance.groundList[point.x][point.y].character, damage, skill.skillEffectType, skillLevel); } } damageList.Clear(); rangeList.Clear(); GameManage.Instance.IsSkill = false; GameManage.Instance.role.gas -= skillLevel.gas; MainView.Instance.Change(); }
public bool Attack() { if (GameTools.GetDistance(GetPosition()) > skillConf.range) { return(false); } if (gas < skillLevel.gas) { return(false); } CreateSkill(); int damage = (int)GameTools.CalculateDamage(GameManage.Instance.role, skillLevel, skillConf); GameTools.Damage(GameManage.Instance.role, damage, skillConf.skillEffectType, skillLevel); gas -= skillLevel.gas; return(true); }