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

            Suit.AssignToCharacter(character, subType, true);

            room.PlaySound(Systems.sounds.collectBweep, 1f, gridX * (byte)TilemapEnum.TileWidth, gridY * (byte)TilemapEnum.TileHeight);
            base.Collect(room, character, gridX, gridY);
        }
Ejemplo n.º 2
0
        public void ResetCharacter()
        {
            // Status Reset (NOT "STATS")
            this.status.ResetCharacterStatus();

            // Multiplayer needs the item to be dropped. Single player will reset level, so it won't matter.
            if (this.heldItem.IsHeld)
            {
                this.heldItem.DropItem();
            }

            // Equipment
            if (this.hat is Hat)
            {
                this.hat.DestroyHat(this, false);
            }
            ;

            // Default Suit, Default Head
            if (this.head == null)
            {
                Head.AssignToCharacter(this, (byte)Systems.settings.login.HeadVal, false);
            }

            Suit.AssignToCharacter(this, (byte)SuitSubType.RedBasic, false);

            // Reset Stats (NOT "STATUS")
            this.stats.ResetCharacterStats();

            // Reset Wounds + Survival
            this.wounds.WoundsDeathReset();
            this.deathFrame = 0;

            // Attachments
            this.trailKeys.ResetTrailingKeys();
            this.heldItem.ResetHeldItem();
            this.magiShield.DestroyShield(0);

            // Reset Physics to ensure it doesn't maintain knowledge from previous state.
            this.physics.touch.ResetTouch();
        }
Ejemplo n.º 3
0
        public static void CheatCodeSuit()
        {
            string currentIns = ConsoleTrack.GetArgAsString();

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

            // Invoke the Relevant Next Function
            if (suitCodes.ContainsKey(currentIns))
            {
                suitCodes[currentIns].Invoke();
                return;
            }

            // Activate the Instruction
            if (ConsoleTrack.activate)
            {
                // "suit" was the final valid instruction. Give a random suit to the character.
                Suit.AssignToCharacter(ConsoleTrack.character, (byte)SuitSubType.RandomSuit, true);
            }
        }
Ejemplo n.º 4
0
        public static void CheatCodeSuitBasic()
        {
            string currentIns = ConsoleTrack.GetArgAsString();

            // Update the tab lookup.
            ConsoleTrack.PrepareTabLookup(suitBasicCodes, currentIns, "Add a basic, unpowered suit to the character.");

            // Activate the Instruction
            if (ConsoleTrack.activate)
            {
                // Apply the Suit
                if (suitBasicCodes.ContainsKey(currentIns))
                {
                    byte subType = byte.Parse(suitBasicCodes[currentIns].ToString());
                    Suit.AssignToCharacter(ConsoleTrack.character, (byte)subType, true);
                    return;
                }

                // "suit basic" was the final valid instruction. Give a random suit to the character.
                Suit.AssignToCharacter(ConsoleTrack.character, (byte)SuitSubType.RandomBasic, true);
            }
        }
Ejemplo n.º 5
0
        public static void CheatCodeSuitWizard()
        {
            string currentIns = ConsoleTrack.GetArgAsString();

            // Update the tab lookup.
            ConsoleTrack.PrepareTabLookup(suitWizardCodes, currentIns, "Add a wizard suit to the character.");

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

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

                // "suit wizard" was the final valid instruction. Give a random suit to the character.
                Suit.AssignToCharacter(ConsoleTrack.character, (byte)SuitSubType.RandomWizard, true);
            }
        }
Ejemplo n.º 6
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);
        }
Ejemplo n.º 7
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();
        }
Ejemplo n.º 8
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();
        }