public bool CheckEnableMove(Unit self, Grid grid, bool bSurinuke, bool ignoreObject = false) { if (self == null || grid == null) { return(false); } int moveCount = self.GetMoveCount(false); for (int index1 = 0; index1 < self.SizeX; ++index1) { for (int index2 = 0; index2 < self.SizeY; ++index2) { Grid grid1 = this[grid.x + index1, grid.y + index2]; if (grid1 == null) { return(false); } GeoParam geo = grid1.geo; if (geo != null && ((bool)geo.DisableStopped || (int)geo.cost > moveCount)) { return(false); } Unit gimmickAtGrid = this.mBattle.FindGimmickAtGrid(grid1, false, self); if (gimmickAtGrid != null && !gimmickAtGrid.IsIntoUnit) { return(false); } if (!ignoreObject) { Unit unitAtGrid = this.mBattle.FindUnitAtGrid(grid1); if (unitAtGrid != null && self != unitAtGrid) { if (bSurinuke) { if (self.Side != unitAtGrid.Side) { return(false); } } else if (!unitAtGrid.IsIntoUnit) { return(false); } } } } } return(true); }
public bool CheckEnableMoveTeleport(Unit self, Grid grid, SkillData skill) { if (self == null || grid == null) { return(false); } bool isTargetTeleport = skill.IsTargetTeleport; for (int index1 = 0; index1 < self.SizeX; ++index1) { for (int index2 = 0; index2 < self.SizeY; ++index2) { Grid grid1 = this[grid.x + index1, grid.y + index2]; if (grid1 == null) { return(false); } GeoParam geo = grid1.geo; if (geo != null && (bool)geo.DisableStopped) { return(false); } Unit gimmickAtGrid = this.mBattle.FindGimmickAtGrid(grid1, false, (Unit)null); if (gimmickAtGrid != null && !gimmickAtGrid.IsIntoUnit) { return(false); } if (!isTargetTeleport) { Unit unitAtGrid = this.mBattle.FindUnitAtGrid(grid1); if (unitAtGrid != null && self != unitAtGrid && !unitAtGrid.IsIntoUnit) { return(false); } } } } return(true); }