예제 #1
0
        public bool CarrierTypeMatchesRole(ShipRole role)
        {
            switch (role)
            {
            case ShipRole.CARRIER:
                if (this.CarrierType != CarrierType.Destroyer && this.CarrierType != CarrierType.BattleCruiser)
                {
                    return(this.CarrierType == CarrierType.BattleShip);
                }
                return(true);

            case ShipRole.CARRIER_ASSAULT:
                return(this.CarrierType == CarrierType.AssaultShuttle);

            case ShipRole.CARRIER_DRONE:
                return(this.CarrierType == CarrierType.Drone);

            case ShipRole.CARRIER_BIO:
                return(this.CarrierType == CarrierType.BioMissile);

            case ShipRole.CARRIER_BOARDING:
                return(this.CarrierType == CarrierType.BoardingPod);

            default:
                return(false);
            }
        }
        private void CheckMissionRequirements()
        {
            ShipRole          shipRole       = this.CheckRequiredShips();
            List <DesignInfo> designInfoList = new List <DesignInfo>();

            foreach (int key in this.SelectedDesigns.Keys)
            {
                for (int index = 0; index < this.SelectedDesigns[key]; ++index)
                {
                    DesignInfo designInfo = this._app.GameDatabase.GetDesignInfo(key);
                    designInfoList.Add(designInfo);
                }
            }
            int num1 = 0;
            int num2 = 0;
            int num3 = 0;

            foreach (DesignInfo designInfo in designInfoList)
            {
                num2 += designInfo.CommandPointCost;
                if (this._app.GameDatabase.GetDesignCommandPointQuota(this._app.AssetDatabase, designInfo.ID) > num3)
                {
                    num3 = this._app.GameDatabase.GetDesignCommandPointQuota(this._app.AssetDatabase, designInfo.ID);
                }
                num1 += designInfo.GetPlayerProductionCost(this._app.GameDatabase, this._app.LocalPlayer.ID, false, new float?());
            }
            if (num3 >= num2)
            {
                this._app.UI.SetEnabled(this._app.UI.Path(this.ID, "okButton"), false);
                switch (shipRole)
                {
                case ShipRole.COMMAND:
                    this._app.UI.SetText(this._app.UI.Path(this.ID, "requirement"), "Fleet Requires Command Ship");
                    break;

                case ShipRole.COLONIZER:
                    this._app.UI.SetText(this._app.UI.Path(this.ID, "requirement"), "Fleet Requires Colonizer");
                    break;

                case ShipRole.CONSTRUCTOR:
                    this._app.UI.SetText(this._app.UI.Path(this.ID, "requirement"), "Fleet Requires Construction Ship");
                    break;

                default:
                    this._app.UI.SetText(this._app.UI.Path(this.ID, "requirement"), "");
                    this._app.UI.SetEnabled(this._app.UI.Path(this.ID, "okButton"), true);
                    break;
                }
            }
            else
            {
                if (num3 >= num2)
                {
                    return;
                }
                this._app.UI.SetEnabled(this._app.UI.Path(this.ID, "okButton"), false);
                this._app.UI.SetText(this._app.UI.Path(this.ID, "requirement"), "Not Enough CP to support Fleet");
            }
        }
예제 #3
0
 public void HackValidateRole()
 {
     if (this.Class != ShipClass.Station || this.Role == ShipRole.PLATFORM)
     {
         return;
     }
     this.Role = ShipRole.UNDEFINED;
 }
        public static bool IsShipRoleAllowed(ShipRole role)
        {
            switch (role)
            {
            case ShipRole.BOARDINGPOD:
            case ShipRole.BIOMISSILE:
            case ShipRole.TRAPDRONE:
            case ShipRole.ACCELERATOR_GATE:
            case ShipRole.LOA_CUBE:
                return(false);

            default:
                return(true);
            }
        }
예제 #5
0
        public GameShip(ShipTemplate template)
        {
            this.Name = template.Name;
            this.Graphic = SpriteManager.GetGraphic(template.EntityTexture);
            this.LinearAcceleration = template.LinearAcceleration;
            this.LinearVelocityMax = template.LinearVelocityMax;
            this.AngularAcceleration = template.AngularAcceleration;
            this.AngularVelocityMax = template.AngularVelocityMax;
            this.StructureMax = template.Structure;
            this.Drops = new DropDefinition(template.DropCurrencyBase, template.DropExperienceBase);
            this.SignatureRadius = new BoundingCircle(this, template.SignatureRadius);

            this.Roles = (ShipRole)template.Roles;
            this.ShieldMax = template.Shield;
            this.HeatLimit = template.HeatLimit;
            this.ShieldRecoveryRate = template.ShieldRecoveryRate;
            this.HeatDegenerationRate = template.HeatDegenerationRate;
            this.Radar = new Radar(this, template.RadarRadius);
            this.Collider = new PolygonCollider(this, template.ColliderEdges);
            //this.NormalAttack = SkillManager.GetNormal(this, template.NormalAttackId);
            //this.Skills = new GameSkill[4];
            this.Items = new GameItem[template.ItemSlotCount];
        }