Exemplo n.º 1
0
        private void OnEntityKill(VehicleModuleEngine module)
        {
            var engineStorage = GetEngineStorage(module);

            if (engineStorage == null)
            {
                return;
            }

            if (!IsLocked(engineStorage))
            {
                return;
            }

            // Kill the inventory to remove all items.
            engineStorage.inventory.Kill();
        }
Exemplo n.º 2
0
        private object OnVehicleModuleMove(VehicleModuleEngine module)
        {
            var engineStorage = GetEngineStorage(module);

            if (engineStorage == null)
            {
                return(null);
            }

            if (!IsLocked(engineStorage))
            {
                return(null);
            }

            // Return true to force the module to be moved even though it probably has items.
            // The items will be removed in the OnEntityKill hook.
            return(true);
        }
Exemplo n.º 3
0
        private void SetInternalDamageMultiplier(VehicleModuleEngine engineModule)
        {
            NextTick(() =>
            {
                if (engineModule == null)
                {
                    return;
                }

                var engineStorage = engineModule.GetContainer() as EngineStorage;
                if (engineStorage == null)
                {
                    return;
                }

                if (!MultiplierChangeWasBlocked(engineStorage, _pluginConfig.DurabilityLossMultiplier))
                {
                    engineStorage.internalDamageMultiplier = _pluginConfig.DurabilityLossMultiplier;
                }
            });
        }
Exemplo n.º 4
0
 private void OnEntitySpawned(VehicleModuleEngine module)
 {
     // Delaying is necessary since the storage container is created immediately after this hook is called.
     NextTick(() => MaybeUpdateEngineModule(module, dropExistingParts: false));
 }
Exemplo n.º 5
0
 private void OnEntitySpawned(VehicleModuleEngine engineModule) =>
 SetInternalDamageMultiplier(engineModule);