protected PBSEffectNode()
        {
            _standingController = new PBSStandingController <PBSEffectNode>(this)
            {
                AlwaysEnabled = true
            };
            _coreUseHandler = new CoreUseHandler <PBSEffectNode>(this, new EnergyStateFactory(this));

            _currentEffect = DynamicProperties.GetProperty <int>(k.currentEffect);
            _currentEffect.PropertyChanging += (property, value) =>
            {
                var effectType = (EffectType)value;

                if (effectType == EffectType.undefined)
                {
                    effectType = AvailableEffects.FirstOrDefault();
                }

                if (!AvailableEffects.Contains(effectType))
                {
                    Logger.Error("PBSEffectNode: invalid effect type! type:" + effectType);
                }

                RemoveCurrentEffect();
                return((int)effectType);
            };

            _currentEffect.PropertyChanged += property =>
            {
                OnEffectChanged();
            };
        }
        public LootContainer(ILootItemRepository lootItemRepository)
        {
            _looters        = new Looters(this);
            _itemRepository = lootItemRepository;

            _lootListPacketBuilder = new LootListPacketBuilder(this, _itemRepository);

            _pinCode = DynamicProperties.GetProperty <int>(k.pinCode);
        }
        public LootContainer(EntityDefault entityDefault, ILootItemRepository lootItemRepository, TimeSpan despawnTime) : base(entityDefault)
        {
            _looters        = new Looters(this);
            _itemRepository = lootItemRepository;

            _despawnHelper = UnitDespawnHelper.Create(this, despawnTime);
            _despawnHelper.CanApplyDespawnEffect = OnCanApplyDespawnEffect;

            _lootListPacketBuilder = new LootListPacketBuilder(this, _itemRepository);

            _pinCode = DynamicProperties.GetProperty <int>(k.pinCode);
        }
Example #4
0
        protected override void OnEnterZone(IZone zone, ZoneEnterType enterType)
        {
            base.OnEnterZone(zone, enterType); //aa

            zone.SendPacketToGang(Gang, new GangUpdatePacketBuilder(Visibility.Visible, this));

            MissionHandler = _missionHandlerFactory(zone, this);
            MissionHandler.InitMissions();

            Direction = FastRandom.NextDouble();

            var p = DynamicProperties.GetProperty <int>(k.pvpRemaining);

            if (!p.HasValue)
            {
                return;
            }

            ApplyPvPEffect(TimeSpan.FromMilliseconds(p.Value));
            p.Clear();
        }
Example #5
0
        public override void OnUpdateToDb()
        {
            try
            {
                if (!IsRepackaged)
                {
                    DynamicProperties.Update(k.armor, Armor.Ratio(ArmorMax));
                    DynamicProperties.Update(k.currentCore, Core);
                }

                var zone = Zone;
                if (zone == null || States.Dead)
                {
                    return;
                }

                var character = Character;
                character.ZoneId       = zone.Id;
                character.ZonePosition = CurrentPosition;

                var p = DynamicProperties.GetProperty <int>(k.pvpRemaining);

                var pvpEffect = EffectHandler.GetEffectsByType(EffectType.effect_pvp).FirstOrDefault();
                if (pvpEffect == null)
                {
                    p.Clear();
                    return;
                }

                var effectTimer = pvpEffect.Timer;
                if (effectTimer != null)
                {
                    p.Value = (int)effectTimer.Remaining.TotalMilliseconds;
                }
            }
            finally
            {
                base.OnUpdateToDb();
            }
        }
Example #6
0
 public TeleportColumn(ITeleportDescriptionRepository teleportDescriptionRepository)
 {
     _teleportDescriptionRepository = teleportDescriptionRepository;
     _isEnabled = DynamicProperties.GetProperty <int>(k.enabled);
 }
Example #7
0
 public MineralScanResultItem()
 {
     _info = DynamicProperties.GetProperty(k.probeInfo, () => (IDictionary <string, object>) new Dictionary <string, object>());
 }
Example #8
0
 public Gate(IStandingHandler standingHandler)
 {
     _standingHandler = standingHandler;
     _openState       = DynamicProperties.GetProperty(k.state, () => 1);
     _standingLimit   = DynamicProperties.GetProperty(k.standing, () => 0.0);
 }