예제 #1
0
        public BoostStatManager(StatsManager parent)
        {
            _parent = parent;
            _player = parent.Owner;

            _boost   = new int[StatsManager.NumStatTypes];
            _boostSV = new SV <int> [_boost.Length];
            for (var i = 0; i < _boostSV.Length; i++)
            {
                _boostSV[i] = new SV <int>(_player, StatsManager.GetBoostStatType(i), _boost[i], i != 0 && i != 1);
            }
            _activateBoost = new ActivateBoost[_boost.Length];
            for (int i = 0; i < _activateBoost.Length; i++)
            {
                _activateBoost[i] = new ActivateBoost();
            }
            ReCalculateValues();
        }
예제 #2
0
        public InventoryItems(IContainer container, Item[] items)
        {
            _itemTypes = new SV <int> [items.Length];
            _items     = new Item[items.Length];

            for (var i = 0; i < items.Length; i++)
            {
                var sti = (int)StatsType.Inventory0 + i;
                if (i >= 12)
                {
                    sti = (int)StatsType.BackPack0 + i - 12;
                }

                _itemTypes[i] = new SV <int>(
                    container as Entity,
                    (StatsType)sti, items[i]?.ObjectType ?? -1,
                    container is Player && i > 3);
                _items[i] = items[i];
            }
        }
예제 #3
0
        protected Entity(RealmManager manager, ushort objType)
        {
            _name            = new SV <string>(this, StatsType.Name, "");
            _size            = new SV <int>(this, StatsType.Size, 100);
            _originalSize    = 100;
            _altTextureIndex = new SV <int>(this, StatsType.AltTextureIndex, -1);
            _x = new SV <float>(this, StatsType.None, 0);
            _y = new SV <float>(this, StatsType.None, 0);
            _conditionEffects1 = new SV <int>(this, StatsType.Effects, 0);
            _conditionEffects2 = new SV <int>(this, StatsType.Effects2, 0);

            ObjectType = objType;
            Manager    = manager;
            manager.Behaviors.ResolveBehavior(this);
            manager.Resources.GameData.ObjectDescs.TryGetValue(ObjectType, out _desc);
            if (_desc == null)
            {
                return;
            }

            if (_desc.Player)
            {
                _posHistory  = new Position[256];
                _projectiles = new Projectile[256];
                _effects     = new int[EffectCount];
                return;
            }

            if (_desc.Enemy && !_desc.Static)
            {
                _projectiles = new Projectile[256];
                _effects     = new int[EffectCount];
                return;
            }

            if (_desc.Character || _desc.IsPet)
            {
                _effects = new int[EffectCount];
                return;
            }
        }