Example #1
0
        public void New(
            Player player,
            IEnumerable <ShipSectionAsset> sections,
            IEnumerable <LogicalTurretHousing> turretHousings,
            IEnumerable <LogicalWeapon> weapons,
            IEnumerable <LogicalWeapon> preferredWeapons,
            IEnumerable <WeaponAssignment> assignedWeapons,
            IEnumerable <LogicalModule> modules,
            IEnumerable <LogicalModule> preferredModules,
            IEnumerable <ModuleAssignment> assignedModules,
            IEnumerable <LogicalPsionic> psionics,
            DesignSectionInfo[] techs,
            Faction faction,
            string shipName,
            string priorityWeapon)
        {
            this.Clear();
            this._sections = sections.ToArray <ShipSectionAsset>();
            CreateShipParams createShipParams = new CreateShipParams();

            createShipParams.player              = player;
            createShipParams.sections            = sections;
            createShipParams.turretHousings      = turretHousings;
            createShipParams.weapons             = weapons;
            createShipParams.preferredWeapons    = preferredWeapons;
            createShipParams.assignedWeapons     = assignedWeapons;
            createShipParams.modules             = modules;
            createShipParams.preferredModules    = preferredModules;
            createShipParams.addPsionics         = false;
            createShipParams.defenceBoatIsActive = true;
            createShipParams.priorityWeapon      = priorityWeapon;
            createShipParams.assignedModules     = assignedModules;
            createShipParams.psionics            = psionics;
            createShipParams.faction             = faction;
            createShipParams.shipName            = shipName;
            foreach (DesignSectionInfo tech1 in techs)
            {
                DesignSectionInfo dsi = tech1;
                ShipSectionAsset  shipSectionAsset = dsi.ShipSectionAsset ?? this._game.AssetDatabase.ShipSections.First <ShipSectionAsset>((Func <ShipSectionAsset, bool>)(x => x.FileName == dsi.FilePath));
                foreach (int tech2 in dsi.Techs)
                {
                    createShipParams.assignedTechs[(int)shipSectionAsset.Type].Techs.Add(tech2);
                }
            }
            createShipParams.isKillable = false;
            createShipParams.enableAI   = false;
            this._ship[this._loadShip]  = Ship.CreateShip(this._game, createShipParams);
            this.PostNewShip(player);
            this._ready   = false;
            this._loading = true;
        }
Example #2
0
        protected override void OnPrepare(GameState prev, object[] parms)
        {
            this.App.NewGame();
            this._crits  = new GameObjectSet(this.App);
            this._sky    = new Sky(this.App, SkyUsage.InSystem, 0);
            this._camera = this._crits.Add <OrbitCameraController>();
            this._camera.TargetPosition = new Vector3(0.0f, 0.0f, 0.0f);
            this._combatInput           = this._crits.Add <CombatInput>();
            this._combatGrid            = this._crits.Add <CombatGrid>();
            CreateShipParams createShipParams = new CreateShipParams();

            createShipParams.player   = this.App.LocalPlayer;
            createShipParams.sections = this.App.AssetDatabase.ShipSections.Where <ShipSectionAsset>((Func <ShipSectionAsset, bool>)(x =>
            {
                if (!(x.Faction == "morrigi") || x.Class != ShipClass.Cruiser)
                {
                    return(false);
                }
                if (!x.FileName.Contains("cr_cmd.section") && !x.FileName.Contains("cr_eng_fusion.section"))
                {
                    return(x.FileName.Contains("cr_mis_armor.section"));
                }
                return(true);
            }));
            createShipParams.turretHousings   = this.App.AssetDatabase.TurretHousings;
            createShipParams.weapons          = this.App.AssetDatabase.Weapons;
            createShipParams.preferredWeapons = this.App.AssetDatabase.Weapons;
            createShipParams.modules          = this.App.AssetDatabase.Modules;
            createShipParams.preferredModules = this.App.AssetDatabase.Modules;
            createShipParams.psionics         = this.App.AssetDatabase.Psionics;
            createShipParams.faction          = this.App.AssetDatabase.GetFaction("morrigi");
            createShipParams.shipName         = "BOOGER";
            createShipParams.inputID          = this._combatInput.ObjectID;
            this._ship = Ship.CreateShip(this.App, createShipParams);
            this._crits.Add((IGameObject)this._ship);
            this._ship2          = Ship.CreateShip(this.App, createShipParams);
            this._ship2.Position = new Vector3(1000f, 0.0f, 0.0f);
            this._crits.Add((IGameObject)this._ship2);
        }
Example #3
0
 public BattleRiderShip(App game, CreateShipParams createShipParams)
     : base(game, createShipParams)
 {
 }
Example #4
0
 public WraithAbductorShip(App game, CreateShipParams createShipParams)
     : base(game, createShipParams)
 {
 }