コード例 #1
0
ファイル: ShipCannons.cs プロジェクト: zerodowned/UO-Forever
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
            case 1:
            {
                m_SingleCannon = reader.ReadBool();

                if (m_SingleCannon)
                {
                    m_LinkedSingleCannonPlace = reader.ReadItem() as SingleCannonPlace;
                }
                else
                {
                    m_LinkedMultiCannonPlace = reader.ReadItem() as MultiCannonPlace;
                }

                break;
            }
            }
        }
コード例 #2
0
ファイル: ShipCannons.cs プロジェクト: alucardxlx/uo-crystal
        public HeavyShipCannon(int facing, BaseGalleon galleon, int northItemID, Point3D initOffset, SingleCannonPlace targetedSingleCannonPlace, MultiCannonPlace targetedMultiCannonPlace)
            : base(galleon, northItemID, initOffset)
        {
            if (targetedSingleCannonPlace != null)
            {
                _linkedSingleCannonPlace = targetedSingleCannonPlace;
                targetedSingleCannonPlace.LinkedHeavyCannon = this;
                _singleCannon           = true;
                _linkedMultiCannonPlace = null;
            }
            else if (targetedMultiCannonPlace != null)
            {
                _linkedSingleCannonPlace = null;
                targetedMultiCannonPlace.LinkedHeavyCannon = this;
                _singleCannon           = false;
                _linkedMultiCannonPlace = targetedMultiCannonPlace;
            }

            // add the components

            /*for (int i = 0; i < CannonNorth.Length; i++)
             *{
             *    AddComponent(new ShipComponent(0, Name), 0, 0, 0);
             *}
             */

            // assign the facing
            if (facing < 0)
            {
                facing = 3;
            }
            if (facing > 3)
            {
                facing = 0;
            }
            Facing = facing;

            // set the default props
            Name   = "Heavy Ship Cannon";
            Weight = 50;

            // make them siegable by default
            // XmlSiege( hitsmax, resistfire, resistphysical, wood, iron, stone)
            XmlAttach.AttachTo(this, new XmlBoatFight(100, 10, 10, 20, 30, 0));

            // and draggable
            //XmlAttach.AttachTo(this, new XmlDrag());

            // undo the temporary hue indicator that is set when the xmlsiege attachment is added
            Hue = 0;
        }
コード例 #3
0
ファイル: ShipCannons.cs プロジェクト: zerodowned/UO-Forever
        public LightShipCannon(int facing, BaseGalleon galleon, int northItemID, Point3D initOffset, SingleCannonPlace targetedSingleCannonPlace, MultiCannonPlace targetedMultiCannonPlace)
            : base(galleon, northItemID, initOffset)
        {
            if (targetedSingleCannonPlace != null)
            {
                m_LinkedSingleCannonPlace = targetedSingleCannonPlace;
                targetedSingleCannonPlace.LinkedCannon = this;
                m_SingleCannon           = true;
                m_LinkedMultiCannonPlace = null;
            }
            else if (targetedMultiCannonPlace != null)
            {
                m_LinkedSingleCannonPlace             = null;
                targetedMultiCannonPlace.LinkedCannon = this;
                m_SingleCannon           = false;
                m_LinkedMultiCannonPlace = targetedMultiCannonPlace;
            }

            // add the components

            /*for (int i = 0; i < CannonNorth.Length; i++)
             *{
             *    this.AddComponent(new ShipComponent(0, this.Name), 0, 0, 0);
             *}
             */

            // assign the facing
            if (facing < 0)
            {
                facing = 3;
            }
            if (facing > 3)
            {
                facing = 0;
            }
            this.Facing = facing;

            // set the default props
            this.Name   = "Light Ship Cannon";
            this.Weight = 50;


            // and draggable
            //XmlAttach.AttachTo(this, new XmlDrag());

            // undo the temporary hue indicator that is set when the xmlsiege attachment is added
            this.Hue = 0;
        }
コード例 #4
0
        public LightShipCannon(int facing, BaseGalleon galleon, int northItemID, Point3D initOffset, SingleCannonPlace targetedSingleCannonPlace, MultiCannonPlace targetedMultiCannonPlace)
			: base(galleon, northItemID, initOffset)
        {
		
			if (targetedSingleCannonPlace != null)
			{
				m_LinkedSingleCannonPlace = targetedSingleCannonPlace;
				targetedSingleCannonPlace.LinkedCannon = this;
				m_SingleCannon = true;
				m_LinkedMultiCannonPlace = null;
			}
			else if (targetedMultiCannonPlace != null)
			{
				m_LinkedSingleCannonPlace = null;
				targetedMultiCannonPlace.LinkedCannon = this;
				m_SingleCannon = false;
				m_LinkedMultiCannonPlace = targetedMultiCannonPlace;
			}
		
            // add the components
            /*for (int i = 0; i < CannonNorth.Length; i++)
            *{
            *    this.AddComponent(new ShipComponent(0, this.Name), 0, 0, 0);
            *}
			*/

            // assign the facing
            if (facing < 0)
                facing = 3;
            if (facing > 3)
                facing = 0;
            this.Facing = facing;

            // set the default props
            this.Name = "Light Ship Cannon";
            this.Weight = 50;


            // and draggable
            //XmlAttach.AttachTo(this, new XmlDrag());

            // undo the temporary hue indicator that is set when the xmlsiege attachment is added
            this.Hue = 0;
        }
コード例 #5
0
ファイル: ShipCannons.cs プロジェクト: zerodowned/UO-Forever
        public HeavyShipCannon(int facing, BaseGalleon galleon, int northItemID, Point3D initOffset, SingleCannonPlace targetedSingleCannonPlace, MultiCannonPlace targetedMultiCannonPlace)
            : base(galleon, northItemID, initOffset)
        {
            if (targetedSingleCannonPlace != null)
            {
                m_LinkedSingleCannonPlace = targetedSingleCannonPlace;
                targetedSingleCannonPlace.LinkedHeavyCannon = this;
                m_SingleCannon           = true;
                m_LinkedMultiCannonPlace = null;
            }
            else if (targetedMultiCannonPlace != null)
            {
                m_LinkedSingleCannonPlace = null;
                targetedMultiCannonPlace.LinkedHeavyCannon = this;
                m_SingleCannon           = false;
                m_LinkedMultiCannonPlace = targetedMultiCannonPlace;
            }

            // add the components

            /*for (int i = 0; i < CannonNorth.Length; i++)
             *{
             *    this.AddComponent(new ShipComponent(0, this.Name), 0, 0, 0);
             *}
             */

            // assign the facing
            if (facing < 0)
            {
                facing = 3;
            }
            if (facing > 3)
            {
                facing = 0;
            }
            this.Facing = facing;

            // set the default props
            this.Name   = "Heavy Ship Cannon";
            this.Weight = 50;

            this.Hue = 0;
        }
コード例 #6
0
ファイル: Galleons.cs プロジェクト: greeduomacro/UO-Forever
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            m_CannonCenter = reader.ReadItem() as SingleCannonPlace;
            m_CannonSupSx = reader.ReadItem() as MultiCannonPlace;
            m_CannonSupDx = reader.ReadItem() as MultiCannonPlace;
            m_CannonMidSx = reader.ReadItem() as SingleCannonPlace;
            m_CannonMidDx = reader.ReadItem() as SingleCannonPlace;
            m_CannonInfSx = reader.ReadItem() as MultiCannonPlace;
            m_CannonInfDx = reader.ReadItem() as MultiCannonPlace;
            m_Helm = reader.ReadItem() as MultiHelm;
            m_Hold = reader.ReadItem() as GalleonHold;
        }
コード例 #7
0
ファイル: Galleons.cs プロジェクト: greeduomacro/UO-Forever
        public OrcGalleon()
            : base(0x18)
        {
            m_CannonCenter = new SingleCannonPlace(this, 0x7924, new Point3D(0, -6, 0));
            m_CannonSupSx = new MultiCannonPlace(this, 0x793D, new Point3D(-2, -2, 0), 0x7944, 0x7936);
            m_CannonSupDx = new MultiCannonPlace(this, 0x7941, new Point3D(2, -2, 0), 0x7948, 0x793A);
            m_CannonMidSx = new SingleCannonPlace(this, 0x7959, new Point3D(-2, 2, 0));
            m_CannonMidDx = new SingleCannonPlace(this, 0x795D, new Point3D(2, 2, 0));
            m_CannonInfSx = new MultiCannonPlace(this, 0x796E, new Point3D(-2, 5, 0), 0x7975);
            m_CannonInfDx = new MultiCannonPlace(this, 0x7972, new Point3D(2, 5, 0), 0x7979);
            m_Helm = new MultiHelm(this, 0x79A5, new Point3D(0, 7, 1), 0x79A4, 0x79A6);
            m_Hold = new GalleonHold(this, 0x798D, new Point3D(0, 9, 0),
                new List<Tuple<int, Point3D>>() 
                {
                    new Tuple<int, Point3D>(0x7994, new Point3D(0, 1, 0)),
                    new Tuple<int, Point3D>(0x798B, new Point3D(-1, 0, 0)),
                    new Tuple<int, Point3D>(0x7992, new Point3D(-1, 1, 0)),
                    new Tuple<int, Point3D>(0x7990, new Point3D(1, 0, 0)),
                    new Tuple<int, Point3D>(0x7997, new Point3D(1, 1, 0)),                    
                }, 14000);
            m_SRope = new BoatRope2(this, 0x14F8, new Point3D(-2, -1, 14), BoatRopeSide.Starboard, 0); 
			Ropes.Add(m_SRope);
            m_PRope = new BoatRope2(this, 0x14F8, new Point3D(2, -1, 14), BoatRopeSide.Port, 0); 
			Ropes.Add(m_PRope);
            m_SRope = new BoatRope2(this, 0x14F8, new Point3D(-2, 3, 14), BoatRopeSide.Starboard, 0); 
			Ropes.Add(m_SRope);
            m_PRope = new BoatRope2(this, 0x14F8, new Point3D(2, 3, 14), BoatRopeSide.Port, 0);
			Ropes.Add(m_PRope);
            m_SRope = new BoatRope2(this, 0x14F8, new Point3D(-2, 7, 14), BoatRopeSide.Starboard, 0); 
			Ropes.Add(m_SRope);
            m_PRope = new BoatRope2(this, 0x14F8, new Point3D(2, 7, 14), BoatRopeSide.Port, 0);
			Ropes.Add(m_PRope);
			m_TillerMan = new TillerManHS(this, 0, new Point3D(0, 2, 10) );
			Name = "an Orc Galleon";

            // undo the temporary hue indicator that is set when the xmlsiege attachment is added
            this.Hue = 0;	
        }
コード例 #8
0
ファイル: ShipCannons.cs プロジェクト: zerodowned/UO-Forever
        public void SetFacing(Direction oldFacing, Direction newFacing)
        {
            bool singleCannon = false;
            bool multiCannon  = false;

            if (m_LinkedSingleCannonPlace != null)
            {
                singleCannon = true;
            }
            else if (m_LinkedMultiCannonPlace != null)
            {
                multiCannon = true;
            }

            if ((singleCannon == false) && (multiCannon == false))
            {
                return;
            }

            if (singleCannon)
            {
                object            objValue     = m_LinkedSingleCannonPlace.Galleon.GetPropertyValue("CannonCenter");
                SingleCannonPlace CannonCenter = objValue as SingleCannonPlace;

                objValue = m_LinkedSingleCannonPlace.Galleon.GetPropertyValue("CannonSupSx");
                SingleCannonPlace CannonSupSx = objValue as SingleCannonPlace;

                objValue = m_LinkedSingleCannonPlace.Galleon.GetPropertyValue("CannonSupDx");
                SingleCannonPlace CannonSupDx = objValue as SingleCannonPlace;

                objValue = m_LinkedSingleCannonPlace.Galleon.GetPropertyValue("CannonMidSx");
                SingleCannonPlace CannonMidSx = objValue as SingleCannonPlace;

                objValue = m_LinkedSingleCannonPlace.Galleon.GetPropertyValue("CannonMidDx");
                SingleCannonPlace CannonMidDx = objValue as SingleCannonPlace;

                objValue = m_LinkedSingleCannonPlace.Galleon.GetPropertyValue("CannonInfSx");
                SingleCannonPlace CannonInfSx = objValue as SingleCannonPlace;

                objValue = m_LinkedSingleCannonPlace.Galleon.GetPropertyValue("CannonInfDx");
                SingleCannonPlace CannonInfDx = objValue as SingleCannonPlace;

                if (newFacing == Direction.North)
                {
                    if (m_LinkedSingleCannonPlace == CannonSupSx)
                    {
                        Facing = 0;
                    }
                    if (m_LinkedSingleCannonPlace == CannonSupDx)
                    {
                        Facing = 2;
                    }
                    if (m_LinkedSingleCannonPlace == CannonInfSx)
                    {
                        Facing = 0;
                    }
                    if (m_LinkedSingleCannonPlace == CannonInfDx)
                    {
                        Facing = 2;
                    }
                    if (m_LinkedSingleCannonPlace == CannonCenter)
                    {
                        Facing = 1;
                    }
                }
                else if (newFacing == Direction.East)
                {
                    if (m_LinkedSingleCannonPlace == CannonSupSx)
                    {
                        Facing = 1;
                    }
                    if (m_LinkedSingleCannonPlace == CannonSupDx)
                    {
                        Facing = 3;
                    }
                    if (m_LinkedSingleCannonPlace == CannonInfSx)
                    {
                        Facing = 1;
                    }
                    if (m_LinkedSingleCannonPlace == CannonInfDx)
                    {
                        Facing = 3;
                    }
                    if (m_LinkedSingleCannonPlace == CannonCenter)
                    {
                        Facing = 2;
                    }
                }
                else if (newFacing == Direction.South)
                {
                    if (m_LinkedSingleCannonPlace == CannonSupSx)
                    {
                        Facing = 2;
                    }
                    if (m_LinkedSingleCannonPlace == CannonSupDx)
                    {
                        Facing = 0;
                    }
                    if (m_LinkedSingleCannonPlace == CannonInfSx)
                    {
                        Facing = 2;
                    }
                    if (m_LinkedSingleCannonPlace == CannonInfDx)
                    {
                        Facing = 0;
                    }
                    if (m_LinkedSingleCannonPlace == CannonCenter)
                    {
                        Facing = 3;
                    }
                }
                else if (newFacing == Direction.West)
                {
                    if (m_LinkedSingleCannonPlace == CannonSupSx)
                    {
                        Facing = 3;
                    }
                    if (m_LinkedSingleCannonPlace == CannonSupDx)
                    {
                        Facing = 1;
                    }
                    if (m_LinkedSingleCannonPlace == CannonInfSx)
                    {
                        Facing = 3;
                    }
                    if (m_LinkedSingleCannonPlace == CannonInfDx)
                    {
                        Facing = 1;
                    }
                    if (m_LinkedSingleCannonPlace == CannonCenter)
                    {
                        Facing = 0;
                    }
                }
            }
            else if (multiCannon)
            {
                object           objValue    = m_LinkedMultiCannonPlace.Galleon.GetPropertyValue("CannonSupSx");
                MultiCannonPlace CannonSupSx = objValue as MultiCannonPlace;

                objValue = m_LinkedMultiCannonPlace.Galleon.GetPropertyValue("CannonSupDx");
                MultiCannonPlace CannonSupDx = objValue as MultiCannonPlace;

                objValue = m_LinkedMultiCannonPlace.Galleon.GetPropertyValue("CannonInfSx");
                MultiCannonPlace CannonInfSx = objValue as MultiCannonPlace;

                objValue = m_LinkedMultiCannonPlace.Galleon.GetPropertyValue("CannonInfDx");
                MultiCannonPlace CannonInfDx = objValue as MultiCannonPlace;


                if (newFacing == Direction.North)
                {
                    if (m_LinkedMultiCannonPlace == CannonSupSx)
                    {
                        Facing = 0;
                    }
                    if (m_LinkedMultiCannonPlace == CannonSupDx)
                    {
                        Facing = 2;
                    }
                    if (m_LinkedMultiCannonPlace == CannonInfSx)
                    {
                        Facing = 0;
                    }
                    if (m_LinkedMultiCannonPlace == CannonInfDx)
                    {
                        Facing = 2;
                    }
                }
                else if (newFacing == Direction.East)
                {
                    if (m_LinkedMultiCannonPlace == CannonSupSx)
                    {
                        Facing = 1;
                    }
                    if (m_LinkedMultiCannonPlace == CannonSupDx)
                    {
                        Facing = 3;
                    }
                    if (m_LinkedMultiCannonPlace == CannonInfSx)
                    {
                        Facing = 1;
                    }
                    if (m_LinkedMultiCannonPlace == CannonInfDx)
                    {
                        Facing = 3;
                    }
                }
                else if (newFacing == Direction.South)
                {
                    if (m_LinkedMultiCannonPlace == CannonSupSx)
                    {
                        Facing = 2;
                    }
                    if (m_LinkedMultiCannonPlace == CannonSupDx)
                    {
                        Facing = 0;
                    }
                    if (m_LinkedMultiCannonPlace == CannonInfSx)
                    {
                        Facing = 2;
                    }
                    if (m_LinkedMultiCannonPlace == CannonInfDx)
                    {
                        Facing = 0;
                    }
                }
                else if (newFacing == Direction.West)
                {
                    if (m_LinkedMultiCannonPlace == CannonSupSx)
                    {
                        Facing = 3;
                    }
                    if (m_LinkedMultiCannonPlace == CannonSupDx)
                    {
                        Facing = 1;
                    }
                    if (m_LinkedMultiCannonPlace == CannonInfSx)
                    {
                        Facing = 3;
                    }
                    if (m_LinkedMultiCannonPlace == CannonInfDx)
                    {
                        Facing = 1;
                    }
                }
            }
        }
コード例 #9
0
ファイル: ShipCannons.cs プロジェクト: zerodowned/UO-Forever
 public HeavyShipCannon(BaseGalleon galleon, int northItemID, Point3D initOffset, SingleCannonPlace targetedSingleCannonPlace, MultiCannonPlace targetedMultiCannonPlace)
     : this(0, galleon, northItemID, initOffset, targetedSingleCannonPlace, targetedMultiCannonPlace)
 {
 }
コード例 #10
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();
			
			switch (version)
			{
				case 1 :
				{
					m_SingleCannon = reader.ReadBool();
					
					if (m_SingleCannon)
						m_LinkedSingleCannonPlace = reader.ReadItem() as SingleCannonPlace;
					else
						m_LinkedMultiCannonPlace = reader.ReadItem() as MultiCannonPlace;
						
					break;
				}
			}
        }
コード例 #11
0
        public HeavyShipCannon(int facing, BaseGalleon galleon, int northItemID, Point3D initOffset, SingleCannonPlace targetedSingleCannonPlace, MultiCannonPlace targetedMultiCannonPlace)
			: base(galleon, northItemID, initOffset)
        {
		
			if (targetedSingleCannonPlace != null)
			{
				m_LinkedSingleCannonPlace = targetedSingleCannonPlace;
				targetedSingleCannonPlace.LinkedHeavyCannon = this;
				m_SingleCannon = true;
				m_LinkedMultiCannonPlace = null;
			}
			else if (targetedMultiCannonPlace != null)
			{
				m_LinkedSingleCannonPlace = null;
				targetedMultiCannonPlace.LinkedHeavyCannon = this;
				m_SingleCannon = false;
				m_LinkedMultiCannonPlace = targetedMultiCannonPlace;
			}
		
            // add the components
            /*for (int i = 0; i < CannonNorth.Length; i++)
            *{
            *    this.AddComponent(new ShipComponent(0, this.Name), 0, 0, 0);
            *}
			*/

            // assign the facing
            if (facing < 0)
                facing = 3;
            if (facing > 3)
                facing = 0;
            this.Facing = facing;

            // set the default props
            this.Name = "Heavy Ship Cannon";
            this.Weight = 50;

            this.Hue = 0;
        }
コード例 #12
0
 public HeavyShipCannon(BaseGalleon galleon, int northItemID, Point3D initOffset, SingleCannonPlace targetedSingleCannonPlace, MultiCannonPlace targetedMultiCannonPlace)
     : this(0, galleon, northItemID, initOffset, targetedSingleCannonPlace, targetedMultiCannonPlace)
 {
 }