public override void ServerOnDestroy(IItem gameObject)
        {
            // try to redistribute remaining energy to other energy bank devices
            var energyRemains = GetPrivateState(gameObject).EnergyCharge;

            CharacterEnergySystem.ServerAddEnergyCharge(gameObject.Container,
                                                        energyRemains);
        }
Beispiel #2
0
        private void ServerRemote_ConsumeItem(IItem item)
        {
            var character = ServerRemoteContext.Character;

            this.ServerValidateItemForRemoteCall(item, character);

            if (!this.SharedIsRechargeNeeded(character))
            {
                return;
            }

            Server.Items.SetCount(item, item.Count - 1);
            CharacterEnergySystem.ServerAddEnergyCharge(character, this.FuelAmount);
        }