Esempio n. 1
0
        public override bool RunImpact(RoomScene room, GameObject actor, short gridX, short gridY, DirCardinal dir)
        {
            if (!ToggleBlock.TogCollides(room, this.toggleBR, this.isOn))
            {
                return(false);
            }

            // Actor must cross the DOWN threshold for this ledge; otherwise, it shouldn't compute any collision.
            if (!actor.physics.CrossedThresholdDown(gridY * (byte)TilemapEnum.TileHeight))
            {
                return(false);
            }

            if (actor is Projectile)
            {
                if (!CollideTileFacing.RunImpactTest(dir, DirCardinal.Up))
                {
                    return(false);
                }
                return(TileProjectileImpact.RunImpact((Projectile)actor, gridX, gridY, dir));
            }

            bool collided = CollideTileFacing.RunImpact(actor, gridX, gridY, dir, DirCardinal.Up);

            // Additional Character Collisions (such as Wall Jumps)
            if (collided && actor is Character)
            {
                TileCharBasicImpact.RunWallImpact((Character)actor, dir);
            }

            return(collided);
        }
Esempio n. 2
0
        public override bool RunImpact(RoomScene room, GameObject actor, short gridX, short gridY, DirCardinal dir)
        {
            if (!ToggleBlock.TogCollides(room, this.toggleBR, this.isOn))
            {
                return(false);
            }

            // Actor must cross the UP threshold for this ledge; otherwise, it shouldn't compute any collision.
            if (!actor.physics.CrossedThresholdUp(gridY * (byte)TilemapEnum.TileHeight + (byte)TilemapEnum.TileHeight))
            {
                return(false);
            }

            if (actor is Projectile)
            {
                if (!CollideTileFacing.RunImpactTest(dir, DirCardinal.Down))
                {
                    return(false);
                }
                return(TileProjectileImpact.RunImpact((Projectile)actor, gridX, gridY, dir));
            }

            // Allow Dropdown Mechanic
            if (actor is Character)
            {
                Character character = (Character)actor;
                character.physics.touch.onMover = true;
                if (character.status.action is DropdownAction)
                {
                    return(false);
                }
            }

            return(CollideTileFacing.RunImpact(actor, gridX, gridY, dir, DirCardinal.Down));
        }
Esempio n. 3
0
        public override bool RunImpact(RoomScene room, GameObject actor, short gridX, short gridY, DirCardinal dir)
        {
            // Actor must cross the LEFT threshold for this ledge; otherwise, it shouldn't compute any collision.
            //if(!actor.physics.CrossedThresholdLeft(gridX * (byte)TilemapEnum.TileWidth + (byte)TilemapEnum.TileWidth)) { return false; }

            if (actor is Projectile)
            {
                if (!CollideTileFacing.RunImpactTest(dir, DirCardinal.Right))
                {
                    return(false);
                }
                return(TileProjectileImpact.RunImpact((Projectile)actor, gridX, gridY, dir));
            }

            bool collided = CollideTileFacing.RunImpact(actor, gridX, gridY, dir, DirCardinal.Right);

            // Additional Character Collisions (such as Wall Jumps)
            if (collided && actor is Character)
            {
                TileCharBasicImpact.RunWallImpact((Character)actor, dir);
            }

            return(collided);
        }