Ejemplo n.º 1
0
        public int frozenFrame = 0;             // The frame that the character is frozen until (after resets, etc).

        public Character(RoomScene room, byte subType, FVector pos, Dictionary <string, short> paramList) : base(room, subType, pos, paramList)
        {
            this.Meta = Systems.mapper.ObjectMetaData[(byte)ObjectEnum.Character].meta;

            this.SetSpriteName("Stand");

            // Physics, Collisions, etc.
            this.AssignBounds(8, 12, 28, 44);
            this.physics = new Physics(this);
            this.physics.SetGravity(FInt.Create(0.7));

            // Default Stats & Statuses
            this.stats  = new CharacterStats(this);
            this.status = new CharacterStatus();
            this.wounds = new CharacterWounds(this);

            // Attachments
            this.trailKeys  = new TrailingKeys(this);
            this.heldItem   = new HeldItem(this);
            this.magiShield = new MagiShield(this);
            this.nameplate  = new Nameplate(this, "Lana", false, false);

            // Images and Animations
            this.animate = new Animate(this, "/");

            // Reset Character, Set Default Values
            this.ResetCharacter();

            // Assign SubTypes and Params
            this.AssignSubType(subType);
            this.AssignParams(paramList);
        }
Ejemplo n.º 2
0
        public void Draw()
        {
            // Coins / Gems
            this.atlas.Draw("Treasure/Gem", 10, 10);
            Systems.fonts.counter.Draw(this.levelState.coins.ToString(), 65, 10, Color.White);

            // Timer
            Systems.fonts.counter.Draw(this.levelState.TimeRemaining.ToString(), Systems.screen.viewWidth - 90, 10, Color.White);

            // Health & Armor
            if (Systems.localServer.MyPlayer.character is Character)
            {
                CharacterWounds wounds = Systems.localServer.MyCharacter.wounds;
                byte            i      = 0;

                while (i < wounds.Health)
                {
                    this.atlas.Draw("Icon/HP", 10 + 48 * i, this.bottomRow);
                    i++;
                }

                while (i < wounds.Health + wounds.Armor)
                {
                    this.atlas.Draw("Icon/Shield", 10 + 48 * i, this.bottomRow);
                    i++;
                }

                // Power Icons
                this.powerUI.Draw();
            }

            // Debug Render
            if (DebugConfig.Debug)
            {
                DebugConfig.DrawDebugNotes();
            }
        }