public static List <ChessContainer> GetSkillScope(ILocation_Scope skill, ChessContainer now_cc, eDirection direction_limit) { List <ChessContainer> list = new List <ChessContainer>(); ChessContainer cc; switch (skill.iLS_Locater) { case eSkill_Scope_Locator.Board_Location: //cc = Main.Instance cc = Main.Inst.chess_grids[getChessContainer(skill.iLS_Point.x, skill.iLS_Point.y)]; break; case eSkill_Scope_Locator.Chess_Location: cc = now_cc; break; case eSkill_Scope_Locator.Related_Location: //Debug.Log("谁让你填相对坐标的,没人告诉你功能没做好吗! 技能ID" + skill.id); cc = LocateChessGrid(now_cc, skill.iLS_Point); // for (int x = 0; x < Mathf.Abs(skill.iLS_Point.x); x++) { // if (skill.iLS_Point.x > 0) { // cc = Main.Instance.getRightLowerChessContainer(cc); // } else { // cc = Main.Instance.getLeftUpperChessContainer(cc); // } // } // for (int y = 0; y < Mathf.Abs(skill.iLS_Point.y); y++) { // if (skill.iLS_Point.y > 0) { // cc = Main.Instance.getLowerChessContainer(cc); // } else { // cc = Main.Instance.getUpperChessContainer(cc); // } // } // for (int z = 0; z < Mathf.Abs(skill.iLS_Point.z); z++) { // if (skill.iLS_Point.z > 0) { // cc = Main.Instance.getLeftLowerChessContainer(cc); // } else { // cc = Main.Instance.getRightUpperChessContainer(cc); // } // } break; default: Debug.Log("神特么default。技能起点信息错误!"); return(null); } list.Add(cc); foreach (eSkill_Scope _scope in skill.iLS_Scope) { switch (_scope) { case eSkill_Scope.Circle: // 一圈 //cc.search_around(ref list, 0, skill.iLS_Depth); list = getAroundGrid(skill.iLS_Depth, list); break; case eSkill_Scope.Up: // 上 case eSkill_Scope.Down: // 下 case eSkill_Scope.RightUp: // 右上 case eSkill_Scope.LeftDown: // 左下 case eSkill_Scope.LeftUp: // 左上 case eSkill_Scope.RightDown: // 右下 int index = (int)_scope - 1; ChessContainer _cc = cc; for (int i = 0; i < skill.iLS_Depth; i++) { // 限制攻击范围 if (direction_limit != eDirection.All && i != (int)direction_limit) { continue; } _cc = Main.Inst.dGetChessContainer[index](_cc); if (_cc != null) { list.Add(_cc); } else { break; } } break; default: Debug.Log("技能范围,形状参数错误。"); break; } } return(list); }
public static List <ChessContainer> GetSkillScope(ILocation_Scope skill, ChessContainer now_cc) { return(GetSkillScope(skill, now_cc, eDirection.All)); }