예제 #1
0
        public virtual void LoadWeapon(Mobile from, BaseShipProjectile projectile)
        {
            if (projectile == null)
            {
                return;
            }

            if (this.m_Projectile != null && !this.m_Projectile.Deleted)
            {
                from.SendMessage("{0} unloaded", this.m_Projectile.Name);
                from.AddToBackpack(this.m_Projectile);
            }

            if (projectile.Amount > 1)
            {
                //projectile.Amount--;
                //Projectile = projectile.Dupe(1);
                this.Projectile = Mobile.LiftItemDupe(projectile, projectile.Amount - 1) as BaseShipProjectile;
            }
            else
            {
                this.Projectile = projectile;
            }

            Projectile = projectile;

            if (this.m_Projectile != null)
            {
                m_Projectile.Internalize();
                from.SendMessage("{0} loaded.", this.m_Projectile.Name);
            }
        }
예제 #2
0
        /*
         * public override Item Dupe(int amount)
         * {
         * BaseSiegeProjectile s = new BaseSiegeProjectile(amount);
         *
         * return this.Dupe(s, amount);
         * }
         */
        public override void OnAfterDuped(Item newItem)
        {
            base.OnAfterDuped(newItem);

            BaseShipProjectile s = newItem as BaseShipProjectile;

            // dupe the siege projectile props
            if (s != null)
            {
                s.FiringSpeed    = FiringSpeed;
                s.AccuracyBonus  = AccuracyBonus;
                s.Area           = Area;
                s.Range          = Range;
                s.FireDamage     = FireDamage;
                s.PhysicalDamage = PhysicalDamage;
            }
        }
예제 #3
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
            case 1:
                this.m_FixedFacing = reader.ReadBool();
                this.m_Draggable   = reader.ReadBool();
                this.m_Packable    = reader.ReadBool();
                goto case 0;

            case 0:
                this.m_Facing         = reader.ReadInt();
                this.m_Projectile     = reader.ReadItem <BaseShipProjectile>();
                this.m_NextFiringTime = reader.ReadDateTime();
                break;
            }
        }
예제 #4
0
 public ShipWeaponTarget(BaseShipProjectile projectile)
     : base(2, true, TargetFlags.None)
 {
     m_projectile = projectile;
 }
예제 #5
0
 public ShipWeaponTarget(BaseShipProjectile projectile)
     : base(2, true, TargetFlags.None)
 {
     this.m_projectile = projectile;
 }
예제 #6
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
                case 1:
                    this.m_FixedFacing = reader.ReadBool();
                    this.m_Draggable = reader.ReadBool();
                    this.m_Packable = reader.ReadBool();
                    goto case 0;
                case 0:
                    this.m_Facing = reader.ReadInt();
                    this.m_Projectile = reader.ReadItem<BaseShipProjectile>();
                    this.m_NextFiringTime = reader.ReadDateTime();
                    break;
            }
        }
예제 #7
0
        public virtual void LoadWeapon(Mobile from, BaseShipProjectile projectile)
        {
            if (projectile == null)
                return;

            if (this.m_Projectile != null && !this.m_Projectile.Deleted)
            {
                from.SendMessage("{0} unloaded", this.m_Projectile.Name);
                from.AddToBackpack(this.m_Projectile);
            }

            if (projectile.Amount > 1)
            {
                //projectile.Amount--;
                //Projectile = projectile.Dupe(1);
                this.Projectile = Mobile.LiftItemDupe(projectile, projectile.Amount - 1) as BaseShipProjectile;
            }
            else
            {
                this.Projectile = projectile;
            }

            Projectile = projectile;

            if (this.m_Projectile != null)
            {
                m_Projectile.Internalize();
                from.SendMessage("{0} loaded.", this.m_Projectile.Name);
            }
        }