Exemple #1
0
            public GameContract(ContractType type, Entity.EnemyType killTarget, int goldPerKill)
            {
                this.type        = type;
                this.killTarget  = killTarget;
                this.goldPerKill = goldPerKill;

                killCount = 0;

                if (type == ContractType.NoContract)
                {
                    contractMessage = "No contracts available at this time.";
                    return;
                }

                StringBuilder builder = new StringBuilder();

                if (killTarget == Entity.EnemyType.Prisoner)
                {
                    switch (Game1.rand.Next() % 3)
                    {
                    case 0:
                        builder.Append("The ship's Warden wants to quell a prisoner uprising in the sector. ");
                        break;

                    case 1:
                        builder.Append("The guards in this sector need escaped prisoners killed and are posting a bounty. ");
                        break;

                    default:
                        builder.Append("A prisoner riot is building in this sector and the Warden wants it shut down. ");
                        break;
                    }
                }
                else if (killTarget == Entity.EnemyType.Guard)
                {
                    switch (Game1.rand.Next() % 3)
                    {
                    case 0:
                        builder.Append("Escaped prisoners are trying to take over the sector and have requested aid. ");
                        break;

                    case 1:
                        builder.Append("Prisoners want guards dead. ");
                        break;

                    default:
                        builder.Append("The prisoners are preparing a riot in one of the sectors and posted a bounty. ");
                        break;
                    }
                }

                builder.Append(Game1.rand.Next() % 2 == 0 ? "Take out " : "Terminate ");

                if (killTarget == Entity.EnemyType.Prisoner)
                {
                    builder.Append(Game1.rand.Next() % 2 == 0 ? "escaped prisoners " : "prisoners ");
                }
                else if (killTarget == Entity.EnemyType.Guard)
                {
                    builder.Append(Game1.rand.Next() % 2 == 0 ? "prison security " : "guards ");
                }

                builder.Append("for ");

                builder.Append(goldPerKill);

                builder.Append(" credits per kill. ");

                int linesOut = 0;

                contractMessage = InGameGUI.WrapText(Game1.tenbyFive14, builder.ToString(), 525, ref linesOut);
            }
        private void loadLevel()
        {
            for (int i = 0; i < GameCampaign.CampaignIntroductionValues[GameCampaign.PlayerLevelProgress].Length; i++)
            {
                GameCampaign.AvailableEntityTypes.Add(GameCampaign.CampaignIntroductionValues[GameCampaign.PlayerLevelProgress][i]);
            }

            nodeMap = generateFourDungeons();
            //nodeMap = DungeonGenerator.generateEntityZoo();
            map = new TileMap(this, nodeMap, GlobalGameConstants.TileSize);

            string tileSetName = "deathStar";

            if (GameCampaign.PlayerFloorHeight == 0)
            {
                tileSetName = "hightech";
            }
            if (GameCampaign.PlayerFloorHeight == 1)
            {
                tileSetName = "factory";
            }
            if (GameCampaign.PlayerFloorHeight == 2)
            {
                tileSetName = "prisoncell";
            }

            map.TileSkin[0] = TextureLib.getLoadedTexture(tileSetName + "/0.png");
            map.TileSkin[1] = TextureLib.getLoadedTexture(tileSetName + "/1.png");
            map.TileSkin[2] = TextureLib.getLoadedTexture(tileSetName + "/2.png");
            map.TileSkin[3] = TextureLib.getLoadedTexture(tileSetName + "/3.png");

            map.ElevatorRoomSkin = TextureLib.getLoadedTexture("elevator/0.png");

            Thread.Sleep(250);

            endFlagReached = false;

            gui       = new InGameGUI(this);
            keyModule = new LevelKeyModule();

            particleSet = new ParticleSet();

            Thread.Sleep(250);

            entityList   = new List <Entity>();
            acidSpitters = new List <MutantAcidSpitter>();

            coinPool      = new Coin[coinPoolSize];
            freeCoinIndex = 0;
            for (int i = 0; i < coinPoolSize; i++)
            {
                coinPool[i] = new Coin(this, new Vector2(-100, -100));
                entityList.Add(coinPool[i]);
            }

            Thread.Sleep(250);

            populateRooms(nodeMap, currentSeed);

            Thread.Sleep(250);

            for (int i = 0; i < entityList.Count; i++)
            {
                if (entityList[i] is Player && ((Player)entityList[i]).Index == InputDevice2.PPG_Player.Player_1)
                {
                    cameraFocus = entityList[i];
                }
            }

            fadeOutTime = 0.0f;

            elapsedLevelTime  = 0.0f;
            elapsedCoinAmount = 0;

            player1Dead     = false;
            end_flag_placed = false;

            BackGroundAudio.playSong("RPG Game", true);
            BackGroundAudio.changeVolume(1.0f);

            state = LoadingState.LevelRunning;
        }