示例#1
0
        private bool TileIsGasTraversible(IntVec3 pos, Map map, GasCloud sourceCloud)
        {
            if (!pos.InBounds(map) || !map.pathGrid.WalkableFast(pos))
            {
                return(false);
            }
            var thingList = map.thingGrid.ThingsListAtFast(pos);

            for (var i = 0; i < thingList.Count; i++)
            {
                var thing = thingList[i];
                // check for conditionally traversable buildings
                var building = thing as Building;
                if (building != null)
                {
                    TraversibilityTest travTest;
                    TraversibleBuildings.TryGetValue(building.GetType(), out travTest);
                    if (travTest != null && !travTest(building, sourceCloud))
                    {
                        return(false);
                    }
                }
                // check for more concentrated gases of a different def
                var cloud = thing as GasCloud;
                if (cloud != null && cloud.def != sourceCloud.def && sourceCloud.concentration < cloud.concentration)
                {
                    return(false);
                }
            }
            return(true);
        }
示例#2
0
 public void BeginSpreadingTransition(GasCloud parentCloud, IntVec3 targetPosition)
 {
     interpolatedOffsetX.value = parentCloud.Position.x - targetPosition.x;
     interpolatedOffsetY.value = parentCloud.Position.z - targetPosition.z;
     interpolatedOffsetX.StartInterpolation(0, SpreadingAnimationDuration, CurveType.QuinticOut);
     interpolatedOffsetY.StartInterpolation(0, SpreadingAnimationDuration, CurveType.QuinticOut);
 }