Esempio n. 1
0
        public static Comet ResumeEncounter(GameDatabase gamedb)
        {
            if (gamedb.AssetDatabase.GetFaction("grandmenaces") == null)
            {
                return((Comet)null);
            }
            Comet      comet      = new Comet();
            PlayerInfo playerInfo = gamedb.GetPlayerInfos().ToList <PlayerInfo>().FirstOrDefault <PlayerInfo>((Func <PlayerInfo, bool>)(x =>
            {
                if (!x.isStandardPlayer)
                {
                    return(x.Name.Contains(nameof(Comet)));
                }
                return(false);
            }));

            comet.PlayerId = playerInfo == null?gamedb.InsertPlayer(nameof(Comet), "grandmenaces", new int?(), new Vector3(0.0f), new Vector3(0.0f), "", "\\base\\factions\\grandmenaces\\avatars\\Comet_Avatar.tga", 0.0, 0, false, false, false, 0, AIDifficulty.Normal) : playerInfo.ID;

            DesignInfo designInfo = gamedb.GetDesignInfosForPlayer(comet.PlayerId).ToList <DesignInfo>().FirstOrDefault <DesignInfo>((Func <DesignInfo, bool>)(x => x.DesignSections[0].FilePath.EndsWith("Comet.section")));

            if (designInfo == null)
            {
                DesignInfo design = new DesignInfo(comet.PlayerId, nameof(Comet), new string[1]
                {
                    string.Format("factions\\{0}\\sections\\{1}", (object)"grandmenaces", (object)"Comet.section")
                });
                comet._cometDesignId = gamedb.InsertDesignByDesignInfo(design);
            }
            else
            {
                comet._cometDesignId = designInfo.ID;
            }
            return(comet);
        }
Esempio n. 2
0
 public static Matrix GetBaseEnemyFleetTrans(
     App app,
     Kerberos.Sots.GameStates.StarSystem starSystem,
     OrbitalObjectInfo[] orbitalObjects)
 {
     return(Comet.GetSpawnTransform(app, starSystem, orbitalObjects));
 }
Esempio n. 3
0
        public static Comet InitializeEncounter(GameDatabase gamedb, AssetDatabase assetdb)
        {
            if (assetdb.GetFaction("grandmenaces") == null)
            {
                return((Comet)null);
            }
            Comet comet = new Comet();

            comet.PlayerId = gamedb.InsertPlayer(nameof(Comet), "grandmenaces", new int?(), assetdb.RandomEncounterPrimaryColor, new Vector3(0.0f), "", "\\base\\factions\\grandmenaces\\avatars\\Comet_Avatar.tga", 0.0, 0, false, false, false, 0, AIDifficulty.Normal);
            DesignInfo design = new DesignInfo(comet.PlayerId, nameof(Comet), new string[1]
            {
                string.Format("factions\\{0}\\sections\\{1}", (object)"grandmenaces", (object)"Comet.section")
            });

            comet._cometDesignId = gamedb.InsertDesignByDesignInfo(design);
            return(comet);
        }