Ejemplo n.º 1
0
 public EntityMob(TypedEntity e)
     : base(e)
 {
     EntityMob e2 = e as EntityMob;
     if (e2 != null) {
         _attackTime = e2._attackTime;
         _deathTime = e2._deathTime;
         _health = e2._health;
         _hurtTime = e2._hurtTime;
         _activeEffects = e2._activeEffects;
     }
 }
Ejemplo n.º 2
0
        public override TypedEntity LoadTree(TagNode tree)
        {
            TagNodeCompound ctree = tree as TagNodeCompound;
            if (ctree == null || base.LoadTree(tree) == null) {
                return null;
            }

            _attackTime = ctree["AttackTime"].ToTagShort();
            _deathTime = ctree["DeathTime"].ToTagShort();
            _health = ctree["Health"].ToTagShort();
            _hurtTime = ctree["HurtTime"].ToTagShort();

            if (ctree.ContainsKey("ActiveEffects")) {
                TagNodeCompound ae = ctree["ActiveEffects"].ToTagCompound();

                _activeEffects = new ActiveEffects();
                _activeEffects.Id = ae["Id"].ToTagByte();
                _activeEffects.Amplifier = ae["Amplifier"].ToTagByte();
                _activeEffects.Duration = ae["Duration"].ToTagInt();
            }

            return this;
        }