Esempio n. 1
0
        public TargetArena(App game, string faction)
        {
            this._game          = game;
            this._objects       = new GameObjectSet(game);
            this._targetObjects = new GameObjectSet(game);
            this._faction       = faction;
            this._targetPlayer  = new Player(game, (GameSession)null, new PlayerInfo()
            {
                AvatarAssetPath = string.Empty,
                BadgeAssetPath  = string.Empty,
                PrimaryColor    = Vector3.One,
                SecondaryColor  = Vector3.One
            }, Player.ClientTypes.AI);
            this._objects.Add((IGameObject)this._targetPlayer);
            Faction          faction1          = game.AssetDatabase.Factions.FirstOrDefault <Faction>((Func <Faction, bool>)(x => x.Name == faction)) ?? game.AssetDatabase.Factions.First <Faction>();
            LogicalWeapon    weapon            = game.AssetDatabase.Weapons.FirstOrDefault <LogicalWeapon>((Func <LogicalWeapon, bool>)(x => x.WeaponName == "Mis_Missile"));
            LogicalWeapon    weapon1           = game.AssetDatabase.Weapons.FirstOrDefault <LogicalWeapon>((Func <LogicalWeapon, bool>)(x => x.WeaponName == weapon.SubWeapon));
            WeaponModelPaths weaponModelPaths1 = LogicalWeapon.GetWeaponModelPaths(weapon, faction1);
            WeaponModelPaths weaponModelPaths2 = LogicalWeapon.GetWeaponModelPaths(weapon1, faction1);

            weapon.AddGameObjectReference();
            this._launcher = game.AddObject <WeaponTestWeaponLauncher>(new List <object>()
            {
                (object)this._targetPlayer.ObjectID,
                (object)(weapon.GameObject != null ? weapon.GameObject.ObjectID : 0),
                (object)weaponModelPaths1.ModelPath,
                (object)weaponModelPaths2.ModelPath
            }.ToArray());
            this._objects.Add((IGameObject)this._launcher);
            this.ResetTargets();
        }
Esempio n. 2
0
            public void FillOutModelFilesWithWeapon(
                LogicalWeapon weapon,
                Faction faction,
                IEnumerable <LogicalWeapon> weapons)
            {
                this.WeaponModelPath = LogicalWeapon.GetWeaponModelPaths(weapon, faction);
                LogicalWeapon subWeapon1      = weapon?.GetSubWeapon(weapons);
                LogicalWeapon secondaryWeapon = weapon?.GetSecondaryWeapon(weapons);
                LogicalWeapon subWeapon2      = secondaryWeapon?.GetSubWeapon(weapons);

                this.SubWeaponModelPath          = LogicalWeapon.GetWeaponModelPaths(subWeapon1, faction);
                this.SecondaryWeaponModelPath    = LogicalWeapon.GetWeaponModelPaths(secondaryWeapon, faction);
                this.SecondarySubWeaponModelPath = LogicalWeapon.GetWeaponModelPaths(subWeapon2, faction);
            }
Esempio n. 3
0
            public void FillOutModelFilesWithWeapon(
                LogicalWeapon weapon,
                Faction faction,
                string preferredMount,
                IEnumerable <LogicalWeapon> weapons)
            {
                this.WeaponModelPath = Ship.GetWeaponModelPathsWithFixAssetNameForDLC(weapon, faction, preferredMount);
                LogicalWeapon subWeapon1      = weapon?.GetSubWeapon(weapons);
                LogicalWeapon secondaryWeapon = weapon?.GetSecondaryWeapon(weapons);
                LogicalWeapon subWeapon2      = secondaryWeapon?.GetSubWeapon(weapons);

                this.SubWeaponModelPath          = Ship.GetWeaponModelPathsWithFixAssetNameForDLC(subWeapon1, faction, preferredMount);
                this.SecondaryWeaponModelPath    = Ship.GetWeaponModelPathsWithFixAssetNameForDLC(secondaryWeapon, faction, preferredMount);
                this.SecondarySubWeaponModelPath = Ship.GetWeaponModelPathsWithFixAssetNameForDLC(subWeapon2, faction, preferredMount);
            }