Exemplo n.º 1
0
 public override BlockDebrisParticleSystem CreateDebrisParticleSystem(SubsystemTerrain subsystemTerrain, Vector3 position, int value, float strength)
 {
     return(GetItem(ref value).CreateDebrisParticleSystem(subsystemTerrain, position, value, strength));
 }
Exemplo n.º 2
0
 public override BoundingBox[] GetCustomCollisionBoxes(SubsystemTerrain terrain, int value)
 {
     return(m_collisionBoxes);
 }
Exemplo n.º 3
0
        public override string GetDisplayName(SubsystemTerrain subsystemTerrain, int value)
        {
            int type = GetType(value);

            return(type < 3 ? Utils.Get(Names[type]): "Soild " + ((Materials)(type - 3)).ToStr() + " Block");
        }
Exemplo n.º 4
0
 public override string GetDisplayName(SubsystemTerrain subsystemTerrain, int value) => DefaultDisplayName;
 public BurntDebrisParticleSystem(SubsystemTerrain terrain, int x, int y, int z)
     : this(terrain, new Vector3((float)x + 0.5f, (float)y + 0.5f, (float)z + 0.5f))
 {
 }
Exemplo n.º 6
0
 public ElectricConnectorType?GetConnectorType(SubsystemTerrain terrain, int value, int face, int connectorFace, int x, int y, int z)
 {
     return(ElectricConnectorType.Input);
 }
Exemplo n.º 7
0
 public override string GetDisplayName(SubsystemTerrain subsystemTerrain, int value)
 {
     return(Names[Terrain.ExtractData(value)]);
 }
Exemplo n.º 8
0
 public override BlockPlacementData GetPlacementValue(SubsystemTerrain subsystemTerrain, ComponentMiner componentMiner, int value, TerrainRaycastResult raycastResult)
 {
     return(GetPlacementValue(6, componentMiner, value, raycastResult));
 }
Exemplo n.º 9
0
 public ElectricConnectorType?GetConnectorType(SubsystemTerrain terrain, int value, int face, int connectorFace, int x, int y, int z)
 {
     return(face == 4 || face == 5 ? (ElectricConnectorType?)ElectricConnectorType.Input : null);
 }
Exemplo n.º 10
0
 public void OnBlockRemoved(SubsystemTerrain terrain, int value, int newValue)
 {
     Level = -1;
     value = 0;
     Simulate(ref value);
 }
Exemplo n.º 11
0
 public override void OnBlockAdded(SubsystemTerrain subsystemTerrain, int value, int oldValue)
 {
     base.OnBlockAdded(subsystemTerrain, value, oldValue);
     Component.Powered = false;
 }
Exemplo n.º 12
0
 public void OnBlockAdded(SubsystemTerrain terrain, int value, int oldValue)
 {
 }
Exemplo n.º 13
0
 public void OnBlockRemoved(SubsystemTerrain terrain, int value, int newValue)
 {
 }
Exemplo n.º 14
0
 public override BoundingBox[] GetCustomInteractionBoxes(SubsystemTerrain terrain, int value)
 {
     return(GetItem(ref value).GetCustomInteractionBoxes(terrain, value));
 }
Exemplo n.º 15
0
 public int Paint(SubsystemTerrain terrain, int value, int?color)
 {
     return(Terrain.MakeBlockValue(BlockIndex, 0, SetColor(Terrain.ExtractData(value), color)));
 }
Exemplo n.º 16
0
        public override BlockDebrisParticleSystem CreateDebrisParticleSystem(SubsystemTerrain subsystemTerrain, Vector3 position, int value, float strength)
        {
            Color color = BlockColorsMap.GrassColorsMap.Lookup(subsystemTerrain.Terrain, Terrain.ToCell(position.X), Terrain.ToCell(position.Y), Terrain.ToCell(position.Z));

            return(new BlockDebrisParticleSystem(subsystemTerrain, position, strength, DestructionDebrisScale, color, GetFaceTextureSlot(4, value)));
        }
Exemplo n.º 17
0
        void UpdateCornerState(int value, int x, int y, int z, int step)
        {
            var resultType      = default(int?);
            var neighbors       = new bool[4];
            var raisedNeighbors = new bool[4];

            for (int i = 0; i < 4; i++)
            {
                for (int k = 0; k < 3; k++)
                {
                    var p   = m_pointsToUpdate[i, k];
                    int val = SubsystemTerrain.Terrain.GetCellValueFastChunkExists(x + p.X, y + p.Y, z + p.Z);
                    if (Terrain.ExtractContents(val) == RailBlock.Index)
                    {
                        if (k == 1)
                        {
                            raisedNeighbors[i] = RailBlock.CanConnectTo(RailBlock.GetRailType(Terrain.ExtractData(val)), i);
                        }
                        else
                        {
                            neighbors[i] = RailBlock.CanConnectTo(RailBlock.GetRailType(Terrain.ExtractData(val)), i);
                        }
                        if (step > 0)
                        {
                            UpdateCornerState(val, x + p.X, y + p.Y, z + p.Z, step - 1);
                        }
                        break;
                    }
                }
            }

            if (neighbors[0] && neighbors[3])
            {
                resultType = 1;
            }
            else if (neighbors[0] && neighbors[1])
            {
                resultType = 2;
            }
            else if (neighbors[1] && neighbors[2])
            {
                resultType = 3;
            }
            else if (neighbors[2] && neighbors[3])
            {
                resultType = 0;
            }
            else if (raisedNeighbors[2])
            {
                resultType = 6;
            }
            else if (raisedNeighbors[0])
            {
                resultType = 8;
            }
            else if (raisedNeighbors[3])
            {
                resultType = 7;
            }
            else if (raisedNeighbors[1])
            {
                resultType = 9;
            }
            else if (neighbors[0] || neighbors[2])
            {
                resultType = 4;
            }
            else if (neighbors[1] || neighbors[3])
            {
                resultType = 5;
            }

            if (resultType.HasValue)
            {
                SubsystemTerrain.ChangeCell(x, y, z, Terrain.MakeBlockValue(RailBlock.Index, 0, RailBlock.SetRailType(0, resultType.Value)));
            }
        }
Exemplo n.º 18
0
        public int Paint(SubsystemTerrain subsystemTerrain, int value, int?color)
        {
            int data = Terrain.ExtractData(value);

            return(Terrain.ReplaceData(value, SetColor(data, color)));
        }
Exemplo n.º 19
0
 public override BlockDebrisParticleSystem CreateDebrisParticleSystem(SubsystemTerrain subsystemTerrain, Vector3 position, int value, float strength)
 {
     return(new BlockDebrisParticleSystem(subsystemTerrain, position, 0.75f * strength, DestructionDebrisScale, new Color(64, 64, 64), DefaultTextureSlot));
 }
Exemplo n.º 20
0
        public override string GetDisplayName(SubsystemTerrain subsystemTerrain, int value)
        {
            int?color = GetColor(Terrain.ExtractData(value));

            return(SubsystemPalette.GetName(subsystemTerrain, color, LanguageControl.Get(fName, 1)));
        }
Exemplo n.º 21
0
        public override string GetDisplayName(SubsystemTerrain subsystemTerrain, int value)
        {
            int data = Terrain.ExtractData(value);

            return(LanguageControl.GetBlock(fName + ":" + data, "DisplayName"));
        }
Exemplo n.º 22
0
        public override bool IsFaceTransparent(SubsystemTerrain subsystemTerrain, int face, int value)
        {
            int mountingFace = GetMountingFace(Terrain.ExtractData(value));

            return(face != CellFace.OppositeFace(mountingFace));
        }
Exemplo n.º 23
0
        public override string GetDisplayName(SubsystemTerrain subsystemTerrain, int value)
        {
            int index = Terrain.ExtractData(value) >> 13 & 15;

            return(SubsystemPalette.GetName(subsystemTerrain, index == 0 ? default(int?) : index, GetType(value).ToString()));
        }
Exemplo n.º 24
0
 public override bool IsFaceTransparent(SubsystemTerrain subsystemTerrain, int face, int value)
 {
     return(false);
 }
Exemplo n.º 25
0
 public override BlockDebrisParticleSystem CreateDebrisParticleSystem(SubsystemTerrain subsystemTerrain, Vector3 position, int value, float strength)
 {
     return(new BlockDebrisParticleSystem(subsystemTerrain, position, strength, DestructionDebrisScale, Color.White, 2));
 }
Exemplo n.º 26
0
        public override BoundingBox[] GetCustomCollisionBoxes(SubsystemTerrain terrain, int value)
        {
            int data = Terrain.ExtractData(value);

            return(m_collisionBoxes[GetVariant(data)]);
        }
Exemplo n.º 27
0
 public override bool IsFaceTransparent(SubsystemTerrain subsystemTerrain, int face, int value) => true;
Exemplo n.º 28
0
        public override string GetDisplayName(SubsystemTerrain subsystemTerrain, int value)
        {
            int?color = GetColor(Terrain.ExtractData(value));

            return(SubsystemPalette.GetName(subsystemTerrain, color, base.GetDisplayName(subsystemTerrain, value)));
        }
Exemplo n.º 29
0
 public override BlockPlacementData GetPlacementValue(SubsystemTerrain subsystemTerrain, ComponentMiner componentMiner, int value, TerrainRaycastResult raycastResult)
 {
     return(new BlockPlacementData {
         Value = value, CellFace = raycastResult.CellFace
     });
 }
Exemplo n.º 30
0
 public override void GetDropValues(SubsystemTerrain subsystemTerrain, int oldValue, int newValue, int toolLevel, List <BlockDropValue> dropValues, out bool showDebris)
 {
     GetItem(ref oldValue).GetDropValues(subsystemTerrain, oldValue, newValue, toolLevel, dropValues, out showDebris);
 }