Esempio n. 1
0
        public static void ConsoleAssignHead()
        {
            string currentIns = ConsoleTrack.GetArgAsString();

            // Update the tab lookup.
            ConsoleTrack.PrepareTabLookup(headCodes, currentIns, "Assign the character's head.");

            // Activate the Instruction
            if (ConsoleTrack.activate)
            {
                // If "head" is the only instruction, give a random head to the character.
                if (currentIns == string.Empty)
                {
                    Head.AssignToCharacter(ConsoleTrack.character, (byte)HeadSubType.RandomStandard, true);
                    Systems.settings.login.HeadVal = 0;
                    Systems.settings.login.SaveSettings();
                    return;
                }

                // Get the Head Type by instruction:
                if (headCodes.ContainsKey(currentIns))
                {
                    byte subType = byte.Parse(headCodes[currentIns].ToString());
                    Head.AssignToCharacter(ConsoleTrack.character, (byte)subType, true);
                    Systems.settings.login.HeadVal = subType;
                    Systems.settings.login.SaveSettings();
                }
            }
        }
Esempio n. 2
0
        public void AssignPlayer(Player player)
        {
            this.player = player;
            this.input  = player.input;

            // If this is the player's character:
            if (this.player == Systems.localServer.MyPlayer)
            {
                // Update the character's head based on their personal setting.
                if (Systems.settings.login.HeadVal > 0)
                {
                    Head.AssignToCharacter(this, (byte)Systems.settings.login.HeadVal, false);
                }
            }
        }
Esempio n. 3
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();
        }