Esempio n. 1
0
 //-----------------------------------------------------------------------------
 // Constructor
 //-----------------------------------------------------------------------------
 public GameControl(GameManager gameManager)
 {
     this.gameManager		= gameManager;
     this.roomStateStack		= null;
     this.roomControl		= null;
     this.world				= null;
     this.player				= null;
     this.hud				= null;
     this.inventory			= null;
     this.rewardManager		= null;
     this.isAdvancedGame		= false;
     this.updateRoom			= true;
     this.animateRoom		= true;
     this.menuWeapons		= null;
     this.menuSecondaryItems	= null;
     this.menuEssences		= null;
 }
        //-----------------------------------------------------------------------------
        // Drop Lists Loading
        //-----------------------------------------------------------------------------
        public static void LoadDrops(DropManager dropManager, RewardManager rewardManager)
        {
            DropList dropsRupees = dropManager.CreateDropList("rupees");
            dropsRupees.AddDrop(3, rewardManager.GetReward("rupees_1"));
            dropsRupees.AddDrop(1, rewardManager.GetReward("rupees_5"));

            DropList dropsHearts = dropManager.CreateDropList("hearts");
            dropsHearts.AddDrop(4, rewardManager.GetReward("hearts_1"));
            dropsHearts.AddDrop(1, typeof(CollectibleFairy));

            DropList dropsSeeds = dropManager.CreateDropList("seeds");
            dropsSeeds.AddDrop(1, rewardManager.GetReward("ammo_ember_seeds_5"));
            dropsSeeds.AddDrop(1, rewardManager.GetReward("ammo_scent_seeds_5"));
            dropsSeeds.AddDrop(1, rewardManager.GetReward("ammo_pegasus_seeds_5"));
            dropsSeeds.AddDrop(1, rewardManager.GetReward("ammo_gale_seeds_5"));
            dropsSeeds.AddDrop(1, rewardManager.GetReward("ammo_mystery_seeds_5"));

            DropList dropsAmmo = dropManager.CreateDropList("ammo");
            dropsAmmo.AddDrop(1, rewardManager.GetReward("ammo_bombs_5"));
            dropsAmmo.AddDrop(1, rewardManager.GetReward("ammo_arrows_5"));
            dropsAmmo.AddDrop(5, dropsSeeds);

            // Drops that are created by default for tiles.
            DropList dropsDefault = dropManager.CreateDropList("default", 1, 3);
            dropsDefault.AddDrop(50, dropsAmmo);
            dropsDefault.AddDrop(46, dropsRupees);
            dropsDefault.AddDrop(25, dropsHearts);

            // Drops that are created when a ground tile is dug up.
            DropList dropsDigRupees = new DropList();
            dropsDigRupees.AddDrop(25, dropsRupees);
            dropsDigRupees.AddDrop(1, rewardManager.GetReward("rupees_100"));
            DropList dropsDigMonsters = new DropList();
            dropsDigMonsters.AddDrop(5, typeof(MonsterBeetle));
            dropsDigMonsters.AddDrop(2, typeof(MonsterRope));
            DropList dropsDig = dropManager.CreateDropList("dig", 1, 4);
            dropsDig.AddDrop(46, dropsDigRupees);
            dropsDig.AddDrop(25, dropsHearts);
            dropsDig.AddDrop(7, dropsDigMonsters);

            //DropList dropsDig = dropManager.CreateDropList("dig", 1, 1);
            //dropsDig.AddDrop(1, typeof(MonsterRope));
            //dropsDig.AddDrop(1, typeof(MonsterBeetle));
            //dropsDig.AddDrop(1, typeof(MonsterLynel));
        }
Esempio n. 3
0
        public void Setup(RewardManager rewardManager)
        {
            this.rewardManager = rewardManager;

            listBox1.Items.Clear();
            textBox1.AutoCompleteCustomSource.Clear();

            // Add rewards to the list.
            listBox1.Items.Add("");
            textBox1.AutoCompleteCustomSource.Add("");
            textBox1.AutoCompleteSource = AutoCompleteSource.CustomSource;
            foreach (KeyValuePair<string, Reward> entry in rewardManager.RewardDictionary) {
                listBox1.Items.Add(entry.Key);
                textBox1.AutoCompleteCustomSource.Add(entry.Key);
            }

            textBox1.Text = "";
        }
        //-----------------------------------------------------------------------------
        // Constructor
        //-----------------------------------------------------------------------------
        public RewardPropertyEditorForm(RewardManager rewardManager, string startValue)
        {
            this.rewardManager = rewardManager;

            InitializeComponent();

            buttonOkay.DialogResult		= DialogResult.OK;
            buttonCancel.DialogResult	= DialogResult.Cancel;

            // Add rewards to the list.
            listBox1.Items.Add("");
            textBox1.AutoCompleteCustomSource.Add("");
            textBox1.AutoCompleteSource = AutoCompleteSource.CustomSource;
            foreach (KeyValuePair<string, Reward> entry in rewardManager.RewardDictionary) {
                listBox1.Items.Add(entry.Key);
                textBox1.AutoCompleteCustomSource.Add(entry.Key);
            }

            textBox1.Text = startValue;
        }
Esempio n. 5
0
        // Start a new game.
        public void StartGame()
        {
            roomTicks = 0;

            // Setup the player beforehand so certain classes such as the HUD can reference it
            player = new Player();

            inventory						= new Inventory(this);
            menuWeapons						= new MenuWeapons(gameManager);
            menuSecondaryItems				= new MenuSecondaryItems(gameManager);
            menuEssences					= new MenuEssences(gameManager);
            menuWeapons.PreviousMenu		= menuEssences;
            menuWeapons.NextMenu			= menuSecondaryItems;
            menuSecondaryItems.PreviousMenu	= menuWeapons;
            menuSecondaryItems.NextMenu		= menuEssences;
            menuEssences.PreviousMenu		= menuSecondaryItems;
            menuEssences.NextMenu			= menuWeapons;

            mapDungeon = new ScreenDungeonMap(gameManager);

            GameData.LoadInventory(inventory, true);

            inventory.ObtainAmmo("ammo_ember_seeds");
            inventory.ObtainAmmo("ammo_scent_seeds");
            inventory.ObtainAmmo("ammo_pegasus_seeds");
            inventory.ObtainAmmo("ammo_gale_seeds");
            inventory.ObtainAmmo("ammo_mystery_seeds");

            hud = new HUD(this);
            hud.DynamicHealth = player.Health;

            rewardManager = new RewardManager(this);
            GameData.LoadRewards(rewardManager);
            dropManager = new DropManager(this);
            GameData.LoadDrops(dropManager, rewardManager);

            // Create the script runner.
            scriptRunner = new ScriptRunner(this);

            // Create the room control.
            roomControl = new RoomControl();
            gameManager.PushGameState(roomControl);

            // Load the world.
            //WorldFile worldFile = new WorldFile();
            //world = worldFile.Load("Content/Worlds/temp_world.zwd");

            // Begin the room state.
            if (gameManager.LaunchParameters.Length > 0) {
                LoadWorld(gameManager.LaunchParameters[0]);

                if (gameManager.LaunchParameters.Length > 1 && gameManager.LaunchParameters[1] == "-test") {
                    // Launch parameters can define player's start position.
                    int startLevel = Int32.Parse(gameManager.LaunchParameters[2]);
                    int startRoomX = Int32.Parse(gameManager.LaunchParameters[3]);
                    int startRoomY = Int32.Parse(gameManager.LaunchParameters[4]);
                    int startPlayerX = Int32.Parse(gameManager.LaunchParameters[5]);
                    int startPlayerY = Int32.Parse(gameManager.LaunchParameters[6]);

                    player.SetPositionByCenter(new Point2I(startPlayerX, startPlayerY) * GameSettings.TILE_SIZE + new Point2I(8, 8));
                    player.MarkRespawn();
                    roomControl.BeginRoom(world.Levels[startLevel].Rooms[startRoomX, startRoomY]);
                }
                else {
                    player.SetPositionByCenter(world.StartTileLocation * GameSettings.TILE_SIZE + new Point2I(8, 8));
                    player.MarkRespawn();
                    roomControl.BeginRoom(world.StartRoom);
                }
            }
            else {
                //WorldFile worldFile = new WorldFile();
                //world = worldFile.Load("temp_world.zwd");
                LoadWorld(GameDebug.CreateTestWorld());
                player.SetPositionByCenter(world.StartTileLocation * GameSettings.TILE_SIZE + new Point2I(8, 8));
                player.MarkRespawn();
                roomControl.BeginRoom(world.StartRoom);
            }
            roomStateStack = new RoomStateStack(new RoomStateNormal());
            roomStateStack.Begin(this);

            if (!roomControl.Room.IsHiddenFromMap)
                lastRoomOnMap = roomControl.Room;

            AudioSystem.MasterVolume = 0.04f; // The way David likes it.
        }
Esempio n. 6
0
        //-----------------------------------------------------------------------------
        // Constructors
        //-----------------------------------------------------------------------------
        public EditorControl()
        {
            this.propertyGridControl	= null;
            this.worldFilePath	= String.Empty;
            this.worldFileName	= "untitled";
            this.world			= null;
            this.level			= null;
            this.tileset		= null;
            this.zone			= null;
            this.rewardManager	= null;
            this.inventory		= null;
            this.timer			= null;
            this.ticks			= 0;
            this.roomSpacing	= 1;
            this.playAnimations	= false;
            this.isInitialized	= false;
            this.hasMadeChanges	= false;

            this.currentLayer				= 0;
            this.currentToolIndex			= 0;
            this.aboveTileDrawMode			= TileDrawModes.Fade;
            this.belowTileDrawMode			= TileDrawModes.Fade;
            this.showRewards				= true;
            this.showGrid					= false;
            this.showEvents					= false;
            this.highlightMouseTile			= true;
            this.selectedRoom				= -Point2I.One;
            this.selectedTile				= -Point2I.One;
            this.selectedTilesetTile		= Point2I.Zero;
            this.selectedTilesetTileData	= null;
            this.playerPlaceMode			= false;
            this.sampleFromAllLayers		= false;
        }
Esempio n. 7
0
        public void Initialize(ContentManager contentManager, GraphicsDevice graphicsDevice)
        {
            if (!isInitialized) {
                Resources.Initialize(contentManager, graphicsDevice);
                GameData.Initialize();
                EditorResources.Initialize();

                this.inventory		= new Inventory(null);
                this.rewardManager	= new RewardManager(null);
                this.timer			= Stopwatch.StartNew();
                this.ticks			= 0;
                this.roomSpacing	= 1;
                this.playAnimations = false;
                this.tileset		= GameData.TILESET_CLIFFS;
                this.zone			= GameData.ZONE_PRESENT;
                this.selectedTilesetTileData = this.tileset.TileData[0, 0];
                this.eventMode		= false;

                GameData.LoadInventory(inventory);
                GameData.LoadRewards(rewardManager);

                // Create tileset combo box.
                editorForm.ComboBoxTilesets.Items.Clear();
                foreach (KeyValuePair<string, Tileset> entry in Resources.GetResourceDictionary<Tileset>()) {
                    editorForm.ComboBoxTilesets.Items.Add(entry.Key);
                }
                editorForm.ComboBoxTilesets.SelectedIndex = 0;

                // Create zone combo box.
                editorForm.ComboBoxZones.Items.Clear();
                foreach (KeyValuePair<string, Zone> entry in Resources.GetResourceDictionary<Zone>()) {
                    if (tileset.SpriteSheet.Image.HasVariant(entry.Key))
                        editorForm.ComboBoxZones.Items.Add(entry.Key);
                }
                editorForm.ComboBoxZones.SelectedIndex = 0;

                // Create controllers.
                propertyGridControl = new PropertyGridControl(this, editorForm.PropertyGrid);

                // Create tools.
                tools = new List<EditorTool>();
                AddTool(toolPointer		= new ToolPointer());
                AddTool(toolPlace		= new ToolPlace());
                AddTool(toolSelection	= new ToolSelection());
                AddTool(toolEyedrop		= new ToolEyedrop());
                currentToolIndex = 0;
                tools[currentToolIndex].OnBegin();

                this.isInitialized = true;
            }
        }
        //-----------------------------------------------------------------------------
        // Reward Loading
        //-----------------------------------------------------------------------------
        public static void LoadRewards(RewardManager rewardManager)
        {
            // Key Items.

            rewardManager.AddReward(new RewardItem("item_flippers_1", "item_flippers", Item.Level1, RewardHoldTypes.TwoHands,
                "You got <red>Zora's Flippers<red>! You can now go for a swim! Press A to swim, B to dive!",
                GameData.SPR_ITEM_ICON_FLIPPERS_1));

            rewardManager.AddReward(new RewardItem("item_flippers_2", "item_flippers", Item.Level2, RewardHoldTypes.TwoHands,
                "You got a <red>Mermaid Suit<red>! Now you can swim in deep waters. Press DPAD to swim, B to dive and A to use items.",
                GameData.SPR_ITEM_ICON_FLIPPERS_2));

            // Weapons.

            rewardManager.AddReward(new RewardItem("item_sword_1", "item_sword", Item.Level1, RewardHoldTypes.OneHand,
                "You got a Hero's <red>Wooden Sword<red>! Hold A or B to charge it up, then release it for a spin attack!",
                GameData.SPR_ITEM_ICON_SWORD_1));

            rewardManager.AddReward(new RewardItem("item_sword_2", "item_sword", Item.Level2, RewardHoldTypes.OneHand,
                "You got the sacred <red>Noble Sword<red>!",
                GameData.SPR_ITEM_ICON_SWORD_2));

            rewardManager.AddReward(new RewardItem("item_sword_3", "item_sword", Item.Level3, RewardHoldTypes.OneHand,
                "You got the legendary <red>Master Sword<red>!",
                GameData.SPR_ITEM_ICON_SWORD_3));

            rewardManager.AddReward(new RewardItem("item_shield_1", "item_shield", Item.Level1, RewardHoldTypes.TwoHands,
                "You got a <red>Wooden Shield<red>!",
                GameData.SPR_ITEM_ICON_SHIELD_1));

            rewardManager.AddReward(new RewardItem("item_shield_2", "item_shield", Item.Level2, RewardHoldTypes.TwoHands,
                "You got an <red>Iron Shield<red>!",
                GameData.SPR_ITEM_ICON_SHIELD_2));

            rewardManager.AddReward(new RewardItem("item_shield_3", "item_shield", Item.Level3, RewardHoldTypes.TwoHands,
                "You got the <red>Mirror Shield<red>!",
                GameData.SPR_ITEM_ICON_SHIELD_3));

            rewardManager.AddReward(new RewardItem("item_biggoron_sword", "item_biggoron_sword", Item.Level1, RewardHoldTypes.TwoHands,
                "You got <red>Biggoron's Sword<red>! This two-handed sword is huge!",
                GameData.SPR_ITEM_ICON_BIGGORON_SWORD));

            rewardManager.AddReward(new RewardItem("item_seed_satchel_1", "item_seed_satchel", Item.Level1, RewardHoldTypes.TwoHands,
                "You got a <red>Seed Satchel<red>! And it has <red>20 Ember Seeds<red>!",
                GameData.SPR_ITEM_ICON_SATCHEL));

            rewardManager.AddReward(new RewardItem("item_seed_satchel_2", "item_seed_satchel", Item.Level2, RewardHoldTypes.TwoHands,
                "You can now hold more <red>Mystical Seeds<red> than before!",
                GameData.SPR_ITEM_ICON_SATCHEL));

            rewardManager.AddReward(new RewardItem("item_seed_satchel_3", "item_seed_satchel", Item.Level3, RewardHoldTypes.TwoHands,
                "You can now hold even more <red>Mystical Seeds<red> than before!",
                GameData.SPR_ITEM_ICON_SATCHEL));

            rewardManager.AddReward(new RewardItem("item_bombs_1", "item_bombs", Item.Level1, RewardHoldTypes.TwoHands,
                "You got <red>Bombs<red>! Use them to blow open false walls. Press A or B to set a Bomb. If you also press DPAD, you can throw the Bomb.",
                GameData.SPR_ITEM_ICON_BOMB));

            rewardManager.AddReward(new RewardItem("item_bombs_2", "item_bombs", Item.Level2, RewardHoldTypes.TwoHands,
                "You can now hold more <red>Bombs<red> than before!",
                GameData.SPR_ITEM_ICON_BOMB));

            rewardManager.AddReward(new RewardItem("item_bombs_3", "item_bombs", Item.Level3, RewardHoldTypes.TwoHands,
                "You can now hold even more <red>Bombs<red> than before!",
                GameData.SPR_ITEM_ICON_BOMB));

            rewardManager.AddReward(new RewardItem("item_bracelet_1", "item_bracelet", Item.Level1, RewardHoldTypes.TwoHands,
                "You got the <red>Power Bracelet<red>! Hold the button and press DPAD to lift heavy objects!",
                GameData.SPR_ITEM_ICON_BRACELET));

            rewardManager.AddReward(new RewardItem("item_bracelet_2", "item_bracelet", Item.Level2, RewardHoldTypes.TwoHands,
                "You got the <red>Power Glove<red>! You can now lift heavy objects.",
                GameData.SPR_ITEM_ICON_POWER_GLOVES));

            rewardManager.AddReward(new RewardItem("item_boomerang_1", "item_boomerang", Item.Level1, RewardHoldTypes.TwoHands,
                "You got the <red>Boomerang<red>! Use it to stop enemies in their tracks!",
                GameData.SPR_ITEM_ICON_BOOMERANG_1));

            rewardManager.AddReward(new RewardItem("item_boomerang_2", "item_boomerang", Item.Level2, RewardHoldTypes.TwoHands,
                "It's the <red>Magical Boomerang<red>! Press DPAD while holding the button to control its flight path!",
                GameData.SPR_ITEM_ICON_BOOMERANG_2));

            rewardManager.AddReward(new RewardItem("item_feather_1", "item_feather", Item.Level1, RewardHoldTypes.TwoHands,
                "You got <red>Roc's Feather<red>! You feel as light as a feather!",
                GameData.SPR_ITEM_ICON_FEATHER));

            rewardManager.AddReward(new RewardItem("item_feather_2", "item_feather", Item.Level2, RewardHoldTypes.TwoHands,
                "You got <red>Roc's Cape<red>! Press and hold the button to do a double jump!",
                GameData.SPR_ITEM_ICON_CAPE));

            rewardManager.AddReward(new RewardItem("item_shovel", "item_shovel", Item.Level1, RewardHoldTypes.TwoHands,
                "You got the <red>Shovel<red>! Now start digging!",
                GameData.SPR_ITEM_ICON_SHOVEL));

            rewardManager.AddReward(new RewardItem("item_seed_shooter", "item_seed_shooter", Item.Level1, RewardHoldTypes.TwoHands,
                "You got the <red>Seed Shooter<red>! Pick your seeds, fire, then watch them ricochet.",
                GameData.SPR_ITEM_ICON_SEED_SHOOTER));

            rewardManager.AddReward(new RewardItem("item_slingshot_1", "item_slingshot", Item.Level1, RewardHoldTypes.TwoHands,
                "You got the <red>Slingshot<red>! Choose your seeds and take aim!",
                GameData.SPR_ITEM_ICON_SLINGSHOT_1));

            rewardManager.AddReward(new RewardItem("item_slingshot_2", "item_slingshot", Item.Level2, RewardHoldTypes.TwoHands,
                "You got the <red>Hyper Slingshot<red>! It shoots three seeds at a time!",
                GameData.SPR_ITEM_ICON_SLINGSHOT_2));

            rewardManager.AddReward(new RewardItem("item_bow_1", "item_bow", Item.Level1, RewardHoldTypes.TwoHands,
                "You got <red>Bow<red>! Shoot arrows at your enemies!",
                GameData.SPR_ITEM_ICON_BOW));

            rewardManager.AddReward(new RewardItem("item_bow_2", "item_bow", Item.Level2, RewardHoldTypes.TwoHands,
                "Your <red>Bow<red> has been upgraded! You can now hold more arrows.",
                GameData.SPR_ITEM_ICON_BOW));

            rewardManager.AddReward(new RewardItem("item_bow_3", "item_bow", Item.Level3, RewardHoldTypes.TwoHands,
                "Your <red>Bow<red> has been upgraded! You can now hold even more arrows.",
                GameData.SPR_ITEM_ICON_BOW));

            // Rupees.

            rewardManager.AddReward(new RewardRupee("rupees_1", 1,
                "You got <red>1 Rupee<red>!<n>...",
                GameData.SPR_REWARD_RUPEE_SMALL_GREEN));

            rewardManager.AddReward(new RewardRupee("rupees_5", 5,
                "You got<n><red>5 Rupees<red>!",
                GameData.SPR_REWARD_RUPEE_RED));

            rewardManager.AddReward(new RewardRupee("rupees_10", 10,
                "You got<n><red>10 Rupees<red>!",
                GameData.SPR_REWARD_RUPEE_RED));

            rewardManager.AddReward(new RewardRupee("rupees_20", 20,
                "You got<n><red>20 Rupees<red>!<n>That's not bad.",
                GameData.SPR_REWARD_RUPEE_BLUE));

            rewardManager.AddReward(new RewardRupee("rupees_30", 30,
                "You got<n><red>30 Rupees<red>!<n>That's nice.",
                GameData.SPR_REWARD_RUPEE_BLUE));

            rewardManager.AddReward(new RewardRupee("rupees_50", 50,
                "You got<n><red>50 Rupees<red>!<n>How lucky!",
                GameData.SPR_REWARD_RUPEE_BLUE));

            rewardManager.AddReward(new RewardRupee("rupees_100", 100,
                "You got <red>100<n>Rupees<red>! I bet<n>you're thrilled!",
                GameData.SPR_REWARD_RUPEE_BIG_BLUE));

            rewardManager.AddReward(new RewardRupee("rupees_150", 150,
                "You got <red>150<n>Rupees<red>!<n>Way to go!!!",
                GameData.SPR_REWARD_RUPEE_BIG_RED));

            rewardManager.AddReward(new RewardRupee("rupees_200", 200,
                "You got <red>200<n>Rupees<red>! That's<n>pure bliss!",
                GameData.SPR_REWARD_RUPEE_BIG_RED));

            // Hearts.

            rewardManager.AddReward(new RewardHeartPiece());

            rewardManager.AddReward(new RewardHeartContainer());

            rewardManager.AddReward(new RewardRecoveryHeart("hearts_1", 1,
                "You recovered<n>only one <red>heart<red>!",
                GameData.SPR_REWARD_HEART));

            rewardManager.AddReward(new RewardRecoveryHeart("hearts_3", 3,
                "You got three<n><red>hearts<red>!",
                GameData.SPR_REWARD_HEARTS_3));

            // Ammo.

            rewardManager.AddReward(new RewardAmmo("ammo_ember_seeds_5", "ammo_ember_seeds", 5,
                "You got<n><red>5 Ember Seeds<red>!",
                GameData.SPR_REWARD_SEED_EMBER));

            rewardManager.AddReward(new RewardAmmo("ammo_scent_seeds_5", "ammo_scent_seeds", 5,
                "You got<n><red>5 Scent Seeds<red>!",
                GameData.SPR_REWARD_SEED_SCENT));

            rewardManager.AddReward(new RewardAmmo("ammo_pegasus_seeds_5", "ammo_pegasus_seeds", 5,
                "You got<n><red>5 Pegasus Seeds<red>!",
                GameData.SPR_REWARD_SEED_PEGASUS));

            rewardManager.AddReward(new RewardAmmo("ammo_gale_seeds_5", "ammo_gale_seeds", 5,
                "You got<n><red>5 Gale Seeds<red>!",
                GameData.SPR_REWARD_SEED_GALE));

            rewardManager.AddReward(new RewardAmmo("ammo_mystery_seeds_5", "ammo_mystery_seeds", 5,
                "You got<n><red>5 Mystery Seeds<red>!",
                GameData.SPR_REWARD_SEED_MYSTERY));

            rewardManager.AddReward(new RewardAmmo("ammo_bombs_5", "ammo_bombs", 5,
                "You got<n><red>5 Bombs<red>!",
                GameData.SPR_ITEM_AMMO_BOMB));

            rewardManager.AddReward(new RewardAmmo("ammo_arrows_5", "ammo_arrows", 5,
                "You got<n><red>5 Arrows<red>!",
                GameData.SPR_ITEM_AMMO_ARROW));

            // Dungeon.

            rewardManager.AddReward(new RewardDungeonItem("small_key", GameData.SPR_REWARD_SMALL_KEY, RewardHoldTypes.Raise,
                "You found a <red>Small Key<red>!<n>Use it to open a locked door or block in this dungeon."));
            rewardManager.AddReward(new RewardDungeonItem("boss_key", GameData.SPR_REWARD_BOSS_KEY, RewardHoldTypes.Raise,
                "You found the <red>Boss Key<red>!"));
            rewardManager.AddReward(new RewardDungeonItem("map", GameData.SPR_REWARD_MAP, RewardHoldTypes.TwoHands,
                "It<ap>s a <red>Dungeon Map<red>! Press SELECT to see it. The darkened rooms are ones you haven<ap>t been to yet."));
            rewardManager.AddReward(new RewardDungeonItem("compass", GameData.SPR_REWARD_COMPASS, RewardHoldTypes.TwoHands,
                "You found the <red>Compass<red>!<n>Use it to track your position, locate chests, and find keys."));
        }
 public RewardPropertyEditor(RewardManager rewardManager)
 {
     this.rewardManager = rewardManager;
 }
Esempio n. 10
0
        //-----------------------------------------------------------------------------
        // Methods
        //-----------------------------------------------------------------------------
        // Start a new game.
        public void StartGame()
        {
            roomTicks = 0;

            roomTicks = 0;

            // Setup the player beforehand so certain classes such as the HUD can reference it
            player = new Player();

            inventory						= new Inventory(this);
            menuWeapons						= new MenuWeapons(gameManager);
            menuSecondaryItems				= new MenuSecondaryItems(gameManager);
            menuEssences					= new MenuEssences(gameManager);
            menuWeapons.PreviousMenu		= menuEssences;
            menuWeapons.NextMenu			= menuSecondaryItems;
            menuSecondaryItems.PreviousMenu	= menuWeapons;
            menuSecondaryItems.NextMenu		= menuEssences;
            menuEssences.PreviousMenu		= menuSecondaryItems;
            menuEssences.NextMenu			= menuWeapons;

            GameData.LoadInventory(inventory, true);

            inventory.ObtainAmmo("ammo_scent_seeds");
            //inventory.ObtainAmmo("ammo_pegasus_seeds");
            //inventory.ObtainAmmo("ammo_gale_seeds");
            inventory.ObtainAmmo("ammo_mystery_seeds");

            hud = new HUD(this);
            hud.DynamicHealth = player.Health;

            rewardManager = new RewardManager(this);

            GameData.LoadRewards(rewardManager);

            // Create the room control.
            roomControl = new RoomControl();
            gameManager.PushGameState(roomControl);

            // Create the test world.

            // Load the world.
            //WorldFile worldFile = new WorldFile();
            //world = worldFile.Load("Content/Worlds/temp_world.zwd");

            // Begin the room state.
            if (gameManager.LaunchParameters.Length > 0) {
                WorldFile worldFile = new WorldFile();
                world = worldFile.Load(gameManager.LaunchParameters[0]);
                if (gameManager.LaunchParameters.Length > 1 && gameManager.LaunchParameters[1] == "-test") {
                    int startLevel = Int32.Parse(gameManager.LaunchParameters[2]);
                    int startRoomX = Int32.Parse(gameManager.LaunchParameters[3]);
                    int startRoomY = Int32.Parse(gameManager.LaunchParameters[4]);
                    int startPlayerX = Int32.Parse(gameManager.LaunchParameters[5]);
                    int startPlayerY = Int32.Parse(gameManager.LaunchParameters[6]);

                    player.Position = new Point2I(startPlayerX, startPlayerY) * GameSettings.TILE_SIZE + new Point2I(8, 16);
                    roomControl.BeginRoom(world.Levels[startLevel].Rooms[startRoomX, startRoomY]);
                }
                else {
                    player.Position = world.StartTileLocation * GameSettings.TILE_SIZE + new Point2I(8, 16);
                    roomControl.BeginRoom(world.StartRoom);
                }
            }
            else {
                world = GameDebug.CreateTestWorld();
                player.Position = world.StartTileLocation * GameSettings.TILE_SIZE + new Point2I(8, 16);
                roomControl.BeginRoom(world.StartRoom);
            }
            roomStateStack = new RoomStateStack(new RoomStateNormal());
            roomStateStack.Begin(this);

            AudioSystem.MasterVolume = 0.06f;
        }
Esempio n. 11
0
 public RewardChooser(RewardManager rewardManager)
 {
     InitializeComponent();
     Setup(rewardManager);
 }
Esempio n. 12
0
 public RewardChooser()
 {
     InitializeComponent();
     rewardManager = null;
 }