Example #1
0
        protected override void PrepareProtoStatusEffect()
        {
            base.PrepareProtoStatusEffect();

            if (Api.IsClient)
            {
                return;
            }

            // cache the server zone prototype
            this.serverZone = this.ServerZoneProto;

            // cache the tile offsets
            // but select only every third tile (will help to reduce the load without damaging accuracy too much)
            this.serverTileOffsetsCircle = ShapeTileOffsetsHelper
                                           .GenerateOffsetsCircle(EnvironmentalRadiationLookupAreaDiameter)
                                           .ToArray();

            this.serverTileOffsetsCircle = ShapeTileOffsetsHelper.SelectOffsetsWithRate(
                this.serverTileOffsetsCircle,
                rate: 3);

            // setup timer (tick every frame)
            TriggerEveryFrame.ServerRegister(
                callback: this.ServerGlobalUpdate,
                name: "System." + this.ShortId);
        }
Example #2
0
        protected override void PrepareProtoStatusEffect()
        {
            base.PrepareProtoStatusEffect();

            // cache the tile offsets
            // but select only every third tile (will help to reduce the load without damaging accuracy too much)
            this.serverTileOffsetsCircle = ShapeTileOffsetsHelper
                                           .GenerateOffsetsCircle(EnvironmentalTileHeatLookupAreaDiameter)
                                           .ToArray();

            this.serverTileOffsetsCircle = ShapeTileOffsetsHelper.SelectOffsetsWithRate(
                this.serverTileOffsetsCircle,
                rate: 3);

            this.serverProtoTileLava    = Api.GetProtoEntity <TileLava>();
            this.serverProtoTileVolcano = Api.GetProtoEntity <TileVolcanic>();
        }