//-----------------------------------------------------------------------------
        // Constructor
        //-----------------------------------------------------------------------------
        public ItemBracelet(int level = 0)
        {
            this.id				= "item_bracelet";
            this.name			= new string[] { "Power Bracelet", "Power Gloves" };
            this.description	= new string[] { "A strength booster.", "Used to lift large objects." };
            this.level			= level;
            this.maxLevel		= 1;
            this.flags			= ItemFlags.None;

            sprite = new Sprite[] {
                new Sprite(GameData.SHEET_ITEMS_SMALL, 0, 1),
                new Sprite(GameData.SHEET_ITEMS_SMALL, 1, 1)
            };

            grabState = new PlayerGrabState();
        }
Exemple #2
0
        //-----------------------------------------------------------------------------
        // Constructors
        //-----------------------------------------------------------------------------
        public Player()
        {
            movement = new PlayerMoveComponent(this);

            // Unit properties.
            centerOffset			= new Point2I(0, -5);
            Health					= 4 * 3;
            MaxHealth				= 4 * 3;
            swimmingSkills			= PlayerSwimmingSkills.CantSwim;
            tunic					= PlayerTunics.GreenTunic;
            moveAnimation			= GameData.ANIM_PLAYER_DEFAULT;
            knockbackSpeed			= GameSettings.PLAYER_KNOCKBACK_SPEED;
            hurtKnockbackDuration	= GameSettings.PLAYER_HURT_KNOCKBACK_DURATION;
            bumpKnockbackDuration	= GameSettings.PLAYER_BUMP_KNOCKBACK_DURATION;

            // Physics.
            Physics.CollisionBox			= new Rectangle2F(-4, -10 + 3, 8, 9);
            Physics.SoftCollisionBox		= new Rectangle2F(-6, -14 + 3, 12, 13);
            Physics.CollideWithWorld		= true;
            Physics.CollideWithEntities		= true;
            Physics.CollideWithRoomEdge		= true;
            Physics.CheckRadialCollisions	= true;
            Physics.RoomEdgeCollisionBoxType = CollisionBoxType.Soft;
            Physics.HasGravity				= true;
            Physics.AutoDodges				= true;
            Physics.MovesWithConveyors		= true;
            Physics.MovesWithPlatforms		= true;
            Physics.AllowEdgeClipping		= true;
            Physics.IsCrushable				= true;
            Physics.EdgeClipAmount			= 1;
            Physics.CrushMaxGapSize			= 4;
            Physics.CustomTileCollisionCondition = delegate(Tile tile) {
                if (movement.IsOnColorBarrier && (tile is TileColorBarrier)) {
                    return false;
                }
                return true;
            };

            // Graphics.
            Graphics.DepthLayer			= DepthLayer.PlayerAndNPCs;
            Graphics.DepthLayerInAir	= DepthLayer.InAirPlayer;
            Graphics.DrawOffset			= new Point2I(-8, -13);

            // Init tools.
            toolShield	= new PlayerToolShield();
            toolSword	= new PlayerToolSword();
            toolVisual	= new PlayerToolVisual();

            // Create the basic player states.
            stateNormal			= new PlayerNormalState();
            stateBusy			= new PlayerBusyState();
            stateSwim			= new PlayerSwimState();
            stateLadder			= new PlayerLadderState();
            stateLedgeJump		= new PlayerLedgeJumpState();
            stateSwingSword		= new PlayerSwingSwordState();
            stateSwingBigSword	= new PlayerSwingBigSwordState();
            stateSwingMagicRod	= new PlayerSwingMagicRodState();
            stateSwingCane		= new PlayerSwingCaneState();
            stateHoldSword		= new PlayerHoldSwordState();
            stateSwordStab		= new PlayerSwordStabState();
            stateSpinSword		= new PlayerSpinSwordState();
            stateSeedShooter	= new PlayerSeedShooterState();
            stateSwitchHook		= new PlayerSwitchHookState();
            stateMagicBoomerang	= new PlayerMagicBoomerangState();
            stateGrab			= new PlayerGrabState();
            stateCarry			= new PlayerCarryState();
            statePullHandle		= new PlayerPullHandleState();
            stateRespawnDeath	= new PlayerRespawnDeathState();
            stateMinecart		= new PlayerMinecartState();
            stateJumpTo			= new PlayerJumpToState();
        }