Exemple #1
0
    public void GenerateTerrain(int x, int y, int z, int value, int face, BlockTerrain.Chunk chunk, ref CellFace data)
    {
        int?color = GetColor(BlockTerrain.GetData(value));

        data.TextureSlot = color.HasValue ? BlocksData.paintedTextures[TextureSlot] : TextureSlot;
        data.Color       = BlocksData.ColorFromInt(color);
    }
 public DoorElectricElement(SubsystemElectricity subsystemElectricity, CellFace cellFace)
     : base(subsystemElectricity, cellFace)
 {
     m_lastChangeCircuitStep = base.SubsystemElectricity.CircuitStep;
     m_needsReset            = true;
 }
 public SolarGeneratorElement(SubsystemElectricity subsystemElectricity, CellFace cellFace) : base(subsystemElectricity, cellFace)
 {
 }
Exemple #4
0
    public void GenerateTerrain(int x, int y, int z, int value, int face, BlockTerrain.Chunk chunk, ref CellFace data)
    {
        switch (face)
        {
        case CellFace.TOP:
            data.TextureSlot = 0;
            data.Color       = map.Lookup(chunk.GetShiftValue(x, z));
            break;

        case CellFace.BOTTOM:
            data.TextureSlot = 2;
            data.Color       = Color.white;
            break;

        default:
            data.TextureSlot = 3;
            data.Color       = Color.white;
            break;
        }
    }
Exemple #5
0
 public void GenerateTerrain(int x, int y, int z, int value, int face, BlockTerrain.Chunk chunk, ref CellFace data)
 {
     data.TextureSlot = TextureSlot;
     data.Color       = Color.white;
 }
Exemple #6
0
 public ChristmasTreeElectricElement(SubsystemElectricity subsystemElectricity, CellFace cellFace, int value)
     : base(subsystemElectricity, cellFace)
 {
     m_lastChangeCircuitStep = base.SubsystemElectricity.CircuitStep;
     m_voltage = (ChristmasTreeBlock.GetLightState(Terrain.ExtractData(value)) ? 1 : 0);
 }
 public DelayGateElectricElement(SubsystemElectricity subsystemElectricity, CellFace cellFace)
     : base(subsystemElectricity, cellFace)
 {
 }
Exemple #8
0
 public override void OnNeighborBlockChanged(CellFace cellFace, int neighborX, int neighborY, int neighborZ)
 {
     cptBase.connections = subsystemItemElectric.getConlist(SubsystemElectricity.SubsystemTerrain.Terrain, cellFace.Point);
 }
 public DetonatorElectricElement(SubsystemElectricity subsystemElectricity, CellFace cellFace)
     : base(subsystemElectricity, cellFace)
 {
 }
 public override void OnHitByProjectile(CellFace cellFace, WorldItem worldItem)
 {
     Detonate();
 }
Exemple #11
0
        public AdjustableDelayGateElectricElement(SubsystemElectricity subsystemElectricity, CellFace cellFace)
            : base(subsystemElectricity, cellFace)
        {
            int data = Terrain.ExtractData(subsystemElectricity.SubsystemTerrain.Terrain.GetCellValue(cellFace.X, cellFace.Y, cellFace.Z));

            m_delaySteps = AdjustableDelayGateBlock.GetDelay(data);
        }
Exemple #12
0
 public void GenerateTerrain(int x, int y, int z, int value, int face, BlockTerrain.Chunk chunk, ref CellFace data)
 {
     data.TextureSlot = (face == CellFace.TOP || face == CellFace.BOTTOM) ? 21 : TextureSlot;
     data.Color       = Color.white;
 }