Exemple #1
0
            public ShipRepairTimer(BaseBoat boat, Mobile from, ShipRepairTool shipRepairTools, DamageType damageType, TimeSpan interval) : base(interval, interval)
            {
                m_Boat            = boat;
                m_From            = from;
                m_ShipRepairTools = shipRepairTools;
                m_DamageType      = damageType;

                m_Start = DateTime.UtcNow;

                Priority = TimerPriority.TwoFiftyMS;
            }
            public ShipRepairGump(BaseShip ship, Mobile from, ShipRepairTool shipRepairTools)
                : base(50, 50)
            {
                m_ShipRepairTools = shipRepairTools;
                m_Ship            = ship;
                m_From            = from;

                this.Closable   = true;
                this.Disposable = true;
                this.Dragable   = true;
                this.Resizable  = false;

                this.AddPage(0);

                AddBackground(0, 0, 210, 210, 5054);
                AddBackground(10, 10, 190, 190, 3000);

                int hullPercent  = (int)(Math.Floor(100 * (float)m_Ship.HitPoints / (float)m_Ship.MaxHitPoints));
                int sailsPercent = (int)(Math.Floor(100 * (float)m_Ship.SailPoints / (float)m_Ship.MaxSailPoints));
                int gunsPercent  = (int)(Math.Floor(100 * (float)m_Ship.GunPoints / (float)m_Ship.MaxGunPoints));

                //Hull
                AddItem(16, 22, 7132);
                AddButton(16, 22, 82, 82, 1, GumpButtonType.Reply, 0);
                AddHtml(60, 20, 140, 20, "Repair Hull", false, false);
                AddHtml(60, 40, 140, 20, m_Ship.HitPoints.ToString() + "/" + m_Ship.MaxHitPoints.ToString() + " (" + hullPercent.ToString() + "%)", false, false);

                //Sails
                AddItem(20, 82, 5984);
                AddButton(20, 82, 82, 82, 2, GumpButtonType.Reply, 0);
                AddHtml(60, 80, 140, 20, "Repair Sails", false, false);
                AddHtml(60, 100, 140, 20, m_Ship.SailPoints.ToString() + "/" + m_Ship.MaxSailPoints.ToString() + " (" + sailsPercent.ToString() + "%)", false, false);

                //Guns
                AddItem(18, 143, 7153);
                AddButton(18, 143, 82, 82, 3, GumpButtonType.Reply, 0);
                AddHtml(60, 140, 140, 20, "Repair Guns", false, false);
                AddHtml(60, 160, 140, 20, m_Ship.GunPoints.ToString() + "/" + m_Ship.MaxGunPoints.ToString() + " (" + gunsPercent.ToString() + "%)", false, false);
            }
 public ShipRepairTarget(ShipRepairTool b)
     : base(25, true, TargetFlags.None, false)
 {
     m_ShipRepairTools = b;
 }