示例#1
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;
            }
            }
        }
示例#2
0
        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
        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
        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
        public TokunoGalleon()
            : base(0x30)
        {
            m_CannonCenter = new SingleCannonPlace(this, 0x91CC, new Point3D(0, -9, 0));
            m_CannonSupSx = new SingleCannonPlace(this, 0x91AA, new Point3D(-2, -3, 0));
            m_CannonSupDx = new SingleCannonPlace(this, 0x91A6, new Point3D(2, -3, 0));
            m_CannonInfSx = new SingleCannonPlace(this, 0x9187, new Point3D(-2, 2, 0));
            m_CannonInfDx = new SingleCannonPlace(this, 0x9183, new Point3D(2, 2, 0));
            m_Helm = new SingleHelm(this, 0x9316, new Point3D(0, 7, 1));
            m_Hold = new GalleonHold(this, 0x9177, new Point3D(0, 4, 0),
                new List<Tuple<int, Point3D>>() 
                {
                    new Tuple<int, Point3D>(0x9170, new Point3D(0, 1, 0)),
                    new Tuple<int, Point3D>(0x9178, new Point3D(-1, 0, 0)),
                    new Tuple<int, Point3D>(0x9171, new Point3D(-1, 1, 0)),
                    new Tuple<int, Point3D>(0x9176, new Point3D(1, 0, 0)),
                    new Tuple<int, Point3D>(0x916F, new Point3D(1, 1, 0)),                    
                }, 16000);
            m_SRope = new BoatRope2(this, 0x14F8, new Point3D(-2, -2, 6), BoatRopeSide.Starboard, 0); 
			Ropes.Add(m_SRope);
            m_PRope = new BoatRope2(this, 0x14F8, new Point3D(2, -2, 6), BoatRopeSide.Port, 0); 
			Ropes.Add(m_PRope);
            m_SRope = new BoatRope2(this, 0x14F8, new Point3D(-2, 3, 6), BoatRopeSide.Starboard, 0); 
			Ropes.Add(m_SRope);
            m_PRope = new BoatRope2(this, 0x14F8, new Point3D(2, 3, 6), BoatRopeSide.Port, 0);
			Ropes.Add(m_PRope);
			m_TillerMan = new TillerManHS(this, 0, new Point3D(0, -2, 6) );
			Name = "a Tokuno Galleon";
			
            // make them siegable by default
            // XmlSiege( hitsmax, resistfire, resistphysical, wood, iron, stone)

            // undo the temporary hue indicator that is set when the xmlsiege attachment is added
            this.Hue = 0;			
			
        }
示例#7
0
        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;
        }
示例#8
0
        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;	
        }
示例#9
0
        public GargoyleGalleon()
            : base(0x24)
        {
            m_CannonCenter = new SingleCannonPlace(this, 0x8516, new Point3D(0, -8, 0));
            m_CannonSupSx = new SingleCannonPlace(this, 0x84FD, new Point3D(-2, -5, 0));
            m_CannonSupDx = new SingleCannonPlace(this, 0x84FF, new Point3D(2, -5, 0));
            m_CannonMidSx = new SingleCannonPlace(this, 0x8489, new Point3D(-2, -2, 0));
            m_CannonMidDx = new SingleCannonPlace(this, 0x848E, new Point3D(2, -2, 0));
            m_CannonInfSx = new SingleCannonPlace(this, 0x84AA, new Point3D(-2, 1, 0));
            m_CannonInfDx = new SingleCannonPlace(this, 0x84AC, new Point3D(2, 1, 0));
            m_Helm = new SingleHelm(this, 0x85A0, new Point3D(0, 2, 0));
            m_Hold = new GalleonHold(this, 0x84CA, new Point3D(0, 5, 0),
                new List<Tuple<int, Point3D>>() 
                {
                    new Tuple<int, Point3D>(0x84CC, new Point3D(-2, 0, 0)), // stiva lato sx 1/4
                    new Tuple<int, Point3D>(0x84D3, new Point3D(-2, 1, 0)), // stiva lato sx 2/4
                    new Tuple<int, Point3D>(0x84DA, new Point3D(-2, 2, 0)), // stiva lato sx 3/4
                    new Tuple<int, Point3D>(0x84E1, new Point3D(-2, 3, 0)), // stiva lato sx 4/4

                    new Tuple<int, Point3D>(0x84CB, new Point3D(-1, 0, 0)), // stiva sup sx       
                    new Tuple<int, Point3D>(0x84D2, new Point3D(-1, 1, 0)), // stiva Centro sx 1/2
                    new Tuple<int, Point3D>(0x84D9, new Point3D(-1, 2, 0)), // stiva Centro sx 2/2
                    new Tuple<int, Point3D>(0x84E0, new Point3D(-1, 3, 0)), // stiva inf sx
   
                    //new Tuple<int, Point3D>(0x84CA, new Point3D(0, 0, 0)),  // stiva sup ( container )
                    new Tuple<int, Point3D>(0x84D1, new Point3D(0, 1, 0)),  // stiva Centro 1/2
                    new Tuple<int, Point3D>(0x84D8, new Point3D(0, 2, 0)),  // stiva Centro 2/2 
                    new Tuple<int, Point3D>(0x84DF, new Point3D(0, 3, 0)),  // stiva inf

                    new Tuple<int, Point3D>(0x84D0, new Point3D(1, 0, 0)), // stiva sup dx 
                    new Tuple<int, Point3D>(0x84D7, new Point3D(1, 1, 0)), // stiva Centro dx 1/2
                    new Tuple<int, Point3D>(0x84DE, new Point3D(1, 2, 0)), // stiva Centro dx 2/2
                    new Tuple<int, Point3D>(0x84E5, new Point3D(1, 3, 0)), // stiva inf dx

                    new Tuple<int, Point3D>(0x84CE, new Point3D(2, 0, 0)), // stiva lato dx 1/4
                    new Tuple<int, Point3D>(0x84D5, new Point3D(2, 1, 0)), // stiva lato dx 2/4
                    new Tuple<int, Point3D>(0x84DC, new Point3D(2, 2, 0)), // stiva lato dx 3/4
                    new Tuple<int, Point3D>(0x84E3, new Point3D(2, 3, 0)), // stiva lato dx 4/4
                }, 12000);
            m_SRope = new BoatRope2(this, 0x14F8, new Point3D(-2, -4, 14), BoatRopeSide.Starboard, 0); 
			Ropes.Add(m_SRope);
            m_PRope = new BoatRope2(this, 0x14F8, new Point3D(2, -4, 14), BoatRopeSide.Port, 0); 
			Ropes.Add(m_PRope);
            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, 2, 14), BoatRopeSide.Starboard, 0); 
			Ropes.Add(m_SRope);
            m_PRope = new BoatRope2(this, 0x14F8, new Point3D(2, 2, 14), BoatRopeSide.Port, 0);
			Ropes.Add(m_PRope);
			m_TillerMan = new TillerManHS(this, 0, new Point3D(0, -4, 12) );
			Name = "a Gargoyle Galleon";
			
            // make them siegable by default
            // XmlSiege( hitsmax, resistfire, resistphysical, wood, iron, stone)

            // undo the temporary hue indicator that is set when the xmlsiege attachment is added
            this.Hue = 0;			
			
        }
示例#10
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            m_CannonCenter = reader.ReadItem() as SingleCannonPlace;
            m_CannonSupSx = reader.ReadItem() as SingleCannonPlace;
            m_CannonSupDx = reader.ReadItem() as SingleCannonPlace;
            m_CannonMidSupSx = reader.ReadItem() as SingleCannonPlace;
            m_CannonMidSupDx = reader.ReadItem() as SingleCannonPlace;
            m_CannonMidInfSx = reader.ReadItem() as SingleCannonPlace;
            m_CannonMidInfDx = reader.ReadItem() as SingleCannonPlace;
            m_CannonInfSx = reader.ReadItem() as SingleCannonPlace;
            m_CannonInfDx = reader.ReadItem() as SingleCannonPlace;
            m_Helm = reader.ReadItem() as SingleHelm;
            m_Hold = reader.ReadItem() as GalleonHold;
            m_MainMast = reader.ReadItem() as MainMast;
            m_Hull = reader.ReadItem() as BritainHull;
        }
示例#11
0
        public BritainGalleon()
            : base(0x40)
        {
            m_CannonCenter = new SingleCannonPlace(this, 0x5C06, new Point3D(0, -9, 0));
            m_CannonSupSx = new SingleCannonPlace(this, 0x5C19, new Point3D(-3, -5, 0));
            m_CannonSupDx = new SingleCannonPlace(this, 0x5C18, new Point3D(3, -5, 0));
            m_CannonMidSupSx = new SingleCannonPlace(this, 0x5C1A, new Point3D(-3, -1, 0));
            m_CannonMidSupDx = new SingleCannonPlace(this, 0x5C1C, new Point3D(3, -1, 0));
            m_CannonMidInfSx = new SingleCannonPlace(this, 0x5C21, new Point3D(-3, 3, 0));
            m_CannonMidInfDx = new SingleCannonPlace(this, 0x5C1F, new Point3D(3, 3, 0));
            m_CannonInfSx = new SingleCannonPlace(this, 0x5C25, new Point3D(-3, 7, 0));
            m_CannonInfDx = new SingleCannonPlace(this, 0x5C23, new Point3D(3, 7, 0));
            m_Helm = new SingleHelm(this, 0x5C0C, new Point3D(0, 3, 1));
            m_Hold = new GalleonHold(this, 0x5C2A, new Point3D(0, 9, 0),
                new List<Tuple<int, Point3D>>() 
                {
                    new Tuple<int, Point3D>(0x5C2C, new Point3D(-1, -1, 0)),
                    new Tuple<int, Point3D>(0x5C2F, new Point3D(-1, 0, 0)),
                    new Tuple<int, Point3D>(0x5C32, new Point3D(-1, 1, 0)),

                    new Tuple<int, Point3D>(0x5C2D, new Point3D(0, 0, 0)),
                    new Tuple<int, Point3D>(0x5C30, new Point3D(0, 1, 0)),   
                 
                    new Tuple<int, Point3D>(0x5C2B, new Point3D(1, -1, 0)),
                    new Tuple<int, Point3D>(0x5C2E, new Point3D(1, 0, 0)),
                    new Tuple<int, Point3D>(0x5C31, new Point3D(1, 1, 0)),
                }, 28000);

            m_MainMast = new MainMast(this, 0x5CE3, new Point3D(0, -3, 0));
            m_Hull = new BritainHull(this, 0x58A5);
            m_SRope = new BoatRope2(this, 0x14F8, new Point3D(-3, -4, 16), BoatRopeSide.Starboard, 0); 
			Ropes.Add(m_SRope);
            m_PRope = new BoatRope2(this, 0x14F8, new Point3D(3, -4, 16), BoatRopeSide.Port, 0); 
			Ropes.Add(m_PRope);
            m_SRope = new BoatRope2(this, 0x14F8, new Point3D(-3, 0, 16), BoatRopeSide.Starboard, 0); 
			Ropes.Add(m_SRope);
            m_PRope = new BoatRope2(this, 0x14F8, new Point3D(3, 0, 16), BoatRopeSide.Port, 0);
			Ropes.Add(m_PRope);
            m_SRope = new BoatRope2(this, 0x14F8, new Point3D(-3, 4, 16), BoatRopeSide.Starboard, 0); 
			Ropes.Add(m_SRope);
            m_PRope = new BoatRope2(this, 0x14F8, new Point3D(3, 4, 16), BoatRopeSide.Port, 0);
			Ropes.Add(m_PRope);
            m_SRope = new BoatRope2(this, 0x14F8, new Point3D(-3, 8, 16), BoatRopeSide.Starboard, 0); 
			Ropes.Add(m_SRope);
            m_PRope = new BoatRope2(this, 0x14F8, new Point3D(3, 8, 16), BoatRopeSide.Port, 0);
			Ropes.Add(m_PRope);
			m_TillerMan = new TillerManHS(this, 0, new Point3D(0, 7, 12) );
			Name = "a Britain Galleon";
			
            // make them siegable by default
            // XmlSiege( hitsmax, resistfire, resistphysical, wood, iron, stone)

            // undo the temporary hue indicator that is set when the xmlsiege attachment is added
            this.Hue = 0;				
			
        }
示例#12
0
        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;
                    }
                }
            }
        }
示例#13
0
 public HeavyShipCannon(BaseGalleon galleon, int northItemID, Point3D initOffset, SingleCannonPlace targetedSingleCannonPlace, MultiCannonPlace targetedMultiCannonPlace)
     : this(0, galleon, northItemID, initOffset, targetedSingleCannonPlace, targetedMultiCannonPlace)
 {
 }
示例#14
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;
				}
			}
        }
示例#15
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;
        }
示例#16
0
 public HeavyShipCannon(BaseGalleon galleon, int northItemID, Point3D initOffset, SingleCannonPlace targetedSingleCannonPlace, MultiCannonPlace targetedMultiCannonPlace)
     : this(0, galleon, northItemID, initOffset, targetedSingleCannonPlace, targetedMultiCannonPlace)
 {
 }