Exemple #1
0
        public override void Collect(RoomScene room, Character character, short gridX, short gridY)
        {
            byte subType = room.tilemap.GetMainSubType(gridX, gridY);

            Hat.AssignToCharacter(character, subType, true);

            room.PlaySound(Systems.sounds.collectBweep, 1f, gridX * (byte)TilemapEnum.TileWidth, gridY * (byte)TilemapEnum.TileHeight);
            base.Collect(room, character, gridX, gridY);
        }
Exemple #2
0
        public static void CheatCodeHat()
        {
            string currentIns = ConsoleTrack.GetArgAsString();

            // Update the tab lookup.
            ConsoleTrack.PrepareTabLookup(hatCodes, currentIns, "Add a hat to the character. Can designate which hat, if desired.");

            // Activate the Instruction
            if (ConsoleTrack.activate)
            {
                UIHandler.AddNotification(UIAlertType.Success, "Hat", "Added Hat to Character.", 180);

                // Apply the Hat
                if (hatCodes.ContainsKey(currentIns))
                {
                    byte subType = byte.Parse(hatCodes[currentIns].ToString());
                    Hat.AssignToCharacter(ConsoleTrack.character, (byte)subType, true);
                    return;
                }

                // "hat" was the final valid instruction. Give a random hat to the character.
                Hat.AssignToCharacter(ConsoleTrack.character, (byte)HatSubType.RandomPowerHat, true);
            }
        }
Exemple #3
0
        public LevelScene(bool grantCampaignEquipment) : base()
        {
            // Defaults
            this.isSinglePlayer = true;

            // UI State
            UIHandler.SetUIOptions(false, false);
            UIHandler.SetMenu(null, false);

            // Create UI
            this.levelUI = new LevelUI();

            // Generate Each Room Class
            this.rooms = new RoomScene[8];

            for (byte roomID = 0; roomID < Systems.handler.levelContent.data.rooms.Count; roomID++)
            {
                this.rooms[roomID] = new RoomScene(this, roomID);
            }

            // If we're on single player,
            Systems.localServer.ResetPlayers();

            // Restart the level, generate all rooms.
            this.RestartLevel(true);

            // Update Character with World Map abilities (if applicable)
            if (grantCampaignEquipment)
            {
                Character     character = Systems.localServer.MyCharacter;
                CampaignState campaign  = Systems.handler.campaignState;

                // Update Character Equipment
                if (campaign is CampaignState)
                {
                    if (character.suit is Suit == false || !character.suit.IsPowerSuit)
                    {
                        Suit.AssignToCharacter(character, campaign.suit, true);
                    }
                    if ((character.hat is Hat == false || !character.hat.IsPowerHat) && (character.hat == null || !character.hat.IsCosmeticHat || campaign.hat != 0))
                    {
                        Hat.AssignToCharacter(character, campaign.hat, true);
                    }
                    if (character.shoes is Shoes == false)
                    {
                        Shoes.AssignShoe(character, campaign.shoes);
                    }
                    if (character.attackPower is PowerAttack == false)
                    {
                        PowerAttack.AssignPower(character, campaign.powerAtt);
                    }
                    if (character.mobilityPower is PowerMobility == false)
                    {
                        PowerMobility.AssignPower(character, campaign.powerMob);
                    }
                    if (character.wounds.Health < campaign.health)
                    {
                        character.wounds.SetHealth(campaign.health);
                    }
                    if (character.wounds.Armor < campaign.armor)
                    {
                        character.wounds.SetArmor(campaign.armor);
                    }
                }
            }

            // Play or Stop Music
            Systems.music.Play((byte)Systems.handler.levelContent.data.music);
        }
Exemple #4
0
        private void AssignParams(Dictionary <string, short> paramList)
        {
            if (paramList == null)
            {
                paramList = new Dictionary <string, short>();
            }

            this.FaceRight = paramList.ContainsKey("dir") && paramList["dir"] == 1 ? false : true;

            // Apply Head
            byte face = paramList.ContainsKey("face") ? (byte)paramList["face"] : (byte)0;

            if (face == 0)
            {
                HeadMap.LanaHead.ApplyHead(this, false);
            }
            if (face == 1)
            {
                HeadMap.RyuHead.ApplyHead(this, false);
            }
            else if (face == 2)
            {
                HeadMap.PooHead.ApplyHead(this, false);
            }
            else if (face == 3)
            {
                HeadMap.CarlHead.ApplyHead(this, false);
            }

            // Suit
            if (paramList.ContainsKey("suit") && paramList["suit"] > 0)
            {
                Suit.AssignToCharacter(this, ParamTrack.AssignSuitIDs[(byte)paramList["suit"]], true);
            }

            // Hat
            if (paramList.ContainsKey("hat") && paramList["hat"] > 0)
            {
                Hat.AssignToCharacter(this, ParamTrack.AssignHatIDs[(byte)paramList["hat"]], true);
            }

            // Shoes
            if (paramList.ContainsKey("shoes") && paramList["shoes"] > 0)
            {
                Shoes.AssignShoe(this, ParamTrack.AssignShoeIDs[(byte)paramList["shoes"]]);
            }

            // Mobility Power
            if (paramList.ContainsKey("mob") && paramList["mob"] > 0)
            {
                if (paramList["mob"] == 1)
                {
                    Power.RemoveMobilityPower(this);
                }
                Power.AssignPower(this, ParamTrack.AssignMobilityIDs[(byte)paramList["mob"]]);
            }

            // Attack Power
            byte attType = paramList.ContainsKey("att") ? (byte)paramList["att"] : (byte)0;

            // No Attack Power
            if (attType == 1)
            {
                Power.RemoveAttackPower(this);
            }

            // Weapon
            if (attType == 2)
            {
                byte power = paramList.ContainsKey("weapon") ? (byte)paramList["weapon"] : (byte)0;
                Power.AssignPower(this, ParamTrack.AssignWeaponIDs[power]);
            }

            // Spells
            if (attType == 3)
            {
                byte power = paramList.ContainsKey("spell") ? (byte)paramList["spell"] : (byte)0;
                Power.AssignPower(this, ParamTrack.AssignSpellsIDs[power]);
            }

            // Thrown
            if (attType == 4)
            {
                byte power = paramList.ContainsKey("thrown") ? (byte)paramList["thrown"] : (byte)0;
                Power.AssignPower(this, ParamTrack.AssignThrownIDs[power]);
            }

            // Bolts
            if (attType == 5)
            {
                byte power = paramList.ContainsKey("bolt") ? (byte)paramList["bolt"] : (byte)0;
                Power.AssignPower(this, ParamTrack.AssignBoltsIDs[power]);
            }

            this.stats.ResetCharacterStats();
        }
Exemple #5
0
        protected void ReceiveFlagUpgrades(RoomScene room, Character character, short gridX, short gridY)
        {
            Dictionary <string, short> paramList = room.tilemap.GetParamList(gridX, gridY);

            // Suit
            if (paramList.ContainsKey("suit") && paramList["suit"] > 0)
            {
                Suit.AssignToCharacter(character, ParamTrack.AssignSuitIDs[(byte)paramList["suit"]], true);
            }

            // Hat
            if (paramList.ContainsKey("hat") && paramList["hat"] > 0)
            {
                Hat.AssignToCharacter(character, ParamTrack.AssignHatIDs[(byte)paramList["hat"]], true);
            }

            // Shoes
            if (paramList.ContainsKey("shoes") && paramList["shoes"] > 0)
            {
                Shoes.AssignShoe(character, ParamTrack.AssignShoeIDs[(byte)paramList["shoes"]]);
            }

            // Mobility Power
            if (paramList.ContainsKey("mob") && paramList["mob"] > 0)
            {
                if (paramList["mob"] == 1)
                {
                    Power.RemoveMobilityPower(character);
                }
                Power.AssignPower(character, ParamTrack.AssignMobilityIDs[(byte)paramList["mob"]]);
            }

            // Attack Power
            byte attType = paramList.ContainsKey("att") ? (byte)paramList["att"] : (byte)0;

            // No Attack Power
            if (attType == 1)
            {
                Power.RemoveAttackPower(character);
            }

            // Weapon
            if (attType == 2)
            {
                byte power = paramList.ContainsKey("weapon") ? (byte)paramList["weapon"] : (byte)0;
                Power.AssignPower(character, ParamTrack.AssignWeaponIDs[power]);
            }

            // Spells
            if (attType == 3)
            {
                byte power = paramList.ContainsKey("spell") ? (byte)paramList["spell"] : (byte)0;
                Power.AssignPower(character, ParamTrack.AssignSpellsIDs[power]);
            }

            // Thrown
            if (attType == 4)
            {
                byte power = paramList.ContainsKey("thrown") ? (byte)paramList["thrown"] : (byte)0;
                Power.AssignPower(character, ParamTrack.AssignThrownIDs[power]);
            }

            // Bolts
            if (attType == 5)
            {
                byte power = paramList.ContainsKey("bolt") ? (byte)paramList["bolt"] : (byte)0;
                Power.AssignPower(character, ParamTrack.AssignBoltsIDs[power]);
            }

            character.stats.ResetCharacterStats();
        }