コード例 #1
0
        public override void ServerOnDestroy(IDynamicWorldObject gameObject)
        {
            base.ServerOnDestroy(gameObject);

            // try drop extra containers on the ground
            var privateState = GetPrivateState(gameObject);

            DropItemsToTheGround(privateState.EquipmentItemsContainer);
            //DropItemsToTheGround(privateState.FuelItemsContainer); // consider fuel items were destroyed during the explosion

            void DropItemsToTheGround(IItemsContainer itemsContainer)
            {
                if (itemsContainer?.OccupiedSlotsCount == 0)
                {
                    return;
                }

                var groundContainer = ObjectGroundItemsContainer.ServerTryDropOnGroundContainerContent(
                    gameObject.Tile,
                    itemsContainer);

                if (groundContainer != null)
                {
                    // set custom timeout for the dropped ground items container
                    ObjectGroundItemsContainer.ServerSetDestructionTimeout(
                        (IStaticWorldObject)groundContainer.Owner,
                        DestroyedCargoDroppedItemsDestructionTimeout.TotalSeconds);
                }
            }
        }
コード例 #2
0
        public override void ServerOnDestroy(IStaticWorldObject gameObject)
        {
            base.ServerOnDestroy(gameObject);

            LandClaimSystem.ServerOnObjectLandClaimDestroyed(gameObject);

            // try drop items from the safe storage
            var itemsContainer = GetPrivateState(gameObject).ItemsContainer;

            if (itemsContainer.OccupiedSlotsCount == 0)
            {
                // no items to drop
                return;
            }

            var groundContainer = ObjectGroundItemsContainer.ServerTryDropOnGroundContainerContent(
                gameObject.OccupiedTile,
                itemsContainer);

            if (groundContainer == null)
            {
                // no items dropped
                return;
            }

            // set custom timeout for the dropped ground items container
            ObjectGroundItemsContainer.ServerSetDestructionTimeout(
                (IStaticWorldObject)groundContainer.Owner,
                DestroyedLandClaimDroppedItemsDestructionTimeout.TotalSeconds);
        }
コード例 #3
0
        public override void ServerOnDestroy(IStaticWorldObject gameObject)
        {
            base.ServerOnDestroy(gameObject);

            ObjectGroundItemsContainer.ServerTryDropOnGroundContainerContent(
                gameObject.OccupiedTile,
                GetPrivateState(gameObject).InputItemsCointainer);
        }
コード例 #4
0
ファイル: ProtoObjectCrate.cs プロジェクト: jashking/CryoFall
        public override void ServerOnDestroy(IStaticWorldObject gameObject)
        {
            base.ServerOnDestroy(gameObject);

            ObjectGroundItemsContainer.ServerTryDropOnGroundContainerContent(
                gameObject.OccupiedTile,
                GetPrivateState(gameObject).ItemsContainer,
                destroyTimeout: DestroyedCrateDroppedItemsDestructionTimeout.TotalSeconds);
        }
コード例 #5
0
        public static void ServerOnDestroy(IStaticWorldObject tradingStation)
        {
            TradingStationsMapMarksSystem.ServerTryRemoveMark(tradingStation);

            var itemsContainer = GetPrivateState(tradingStation).StockItemsContainer;

            ObjectGroundItemsContainer.ServerTryDropOnGroundContainerContent(
                tradingStation.OccupiedTile,
                itemsContainer,
                DestroyedTradingStationDroppedItemsDestructionTimeout.TotalSeconds);
        }
コード例 #6
0
        public override void ServerOnDestroy(IStaticWorldObject gameObject)
        {
            base.ServerOnDestroy(gameObject);

            var itemsContainer = GetPrivateState(gameObject).ItemsContainer;

            if (itemsContainer.OccupiedSlotsCount > 0)
            {
                ObjectGroundItemsContainer.ServerTryDropOnGroundContainerContent(
                    gameObject.OccupiedTile,
                    itemsContainer);
            }
        }
コード例 #7
0
        public override void ServerOnDestroy(IDynamicWorldObject gameObject)
        {
            base.ServerOnDestroy(gameObject);

            // try drop extra containers on the ground
            var privateState = GetPrivateState(gameObject);

            ObjectGroundItemsContainer.ServerTryDropOnGroundContainerContent(
                gameObject.Tile,
                privateState.EquipmentItemsContainer,
                DestroyedCargoDroppedItemsDestructionTimeout.TotalSeconds);
            // consider fuel items were destroyed during the explosion
        }
コード例 #8
0
        public override void ServerOnDestroy(IStaticWorldObject gameObject)
        {
            base.ServerOnDestroy(gameObject);

            var stateGasoline = GetPrivateState(gameObject).ManufacturingStateGasoline;

            ObjectGroundItemsContainer.ServerTryDropOnGroundContainerContent(
                gameObject.OccupiedTile,
                stateGasoline.ContainerInput);

            ObjectGroundItemsContainer.ServerTryDropOnGroundContainerContent(
                gameObject.OccupiedTile,
                stateGasoline.ContainerOutput);
        }
コード例 #9
0
        public override void ServerOnDestroy(IStaticWorldObject gameObject)
        {
            base.ServerOnDestroy(gameObject);

            foreach (var reactorState in GetPrivateState(gameObject).ReactorStates)
            {
                if (reactorState?.ItemsContainer is null)
                {
                    continue;
                }

                ObjectGroundItemsContainer.ServerTryDropOnGroundContainerContent(
                    gameObject.OccupiedTile,
                    reactorState.ItemsContainer);
            }
        }
コード例 #10
0
        public override void ServerOnDestroy(IStaticWorldObject gameObject)
        {
            base.ServerOnDestroy(gameObject);

            var privateState = GetPrivateState(gameObject);

            ObjectGroundItemsContainer.ServerTryDropOnGroundContainerContent(
                gameObject.OccupiedTile,
                privateState.ManufacturingState?.ContainerInput);

            ObjectGroundItemsContainer.ServerTryDropOnGroundContainerContent(
                gameObject.OccupiedTile,
                privateState.ManufacturingState?.ContainerOutput);

            ObjectGroundItemsContainer.ServerTryDropOnGroundContainerContent(
                gameObject.OccupiedTile,
                privateState.FuelBurningState?.ContainerFuel);
        }
コード例 #11
0
        public override void ServerOnDestroy(IStaticWorldObject gameObject)
        {
            base.ServerOnDestroy(gameObject);

            var itemsContainer = GetPrivateState(gameObject).ItemsContainer;

            if (itemsContainer.OccupiedSlotsCount == 0)
            {
                return;
            }

            var groundContainer = ObjectGroundItemsContainer.ServerTryDropOnGroundContainerContent(
                gameObject.OccupiedTile,
                itemsContainer);

            if (groundContainer != null)
            {
                // set custom timeout for the dropped ground items container
                ObjectGroundItemsContainer.ServerSetDestructionTimeout(
                    (IStaticWorldObject)groundContainer.Owner,
                    DestroyedCrateDroppedItemsDestructionTimeout.TotalSeconds);
            }
        }
コード例 #12
0
        public static void ServerOnDestroy(IStaticWorldObject tradingStation)
        {
            TradingStationsMapMarksSystem.ServerTryRemoveMark(tradingStation);

            var itemsContainer = GetPrivateState(tradingStation).StockItemsContainer;

            if (itemsContainer.OccupiedSlotsCount == 0)
            {
                return;
            }

            var groundContainer = ObjectGroundItemsContainer.ServerTryDropOnGroundContainerContent(
                tradingStation.OccupiedTile,
                itemsContainer);

            if (groundContainer != null)
            {
                // set custom timeout for the dropped ground items container
                ObjectGroundItemsContainer.ServerSetDestructionTimeout(
                    (IStaticWorldObject)groundContainer.Owner,
                    DestroyedTradingStationDroppedItemsDestructionTimeout.TotalSeconds);
            }
        }