public float GetTerrainModifiedCost(PathingCapabilitiesDef capabilities, float terrainCost) { float gradeModifier = (this.Grade > capabilities.MinGrade) ? 1f + this.Grade * capabilities.GradeMultiplier : 1f; return(this.Distance * gradeModifier * terrainCost); }
public bool IsBlocked(PathingCapabilitiesDef capabilities) { float maxGrade = capabilities.MaxGrade * CacheNodeLink.PathBlockerGradeMultiplier; return(this.To.Steepness > capabilities.MaxSteepness || this.MaxGrade > maxGrade || this.Reciprocal.MaxGrade > maxGrade || this.To.IsImpassibleTerrain); }