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)
        {
            if (this.isToggleBox || ToggleBlock.TogCollides(room, this.toggleBR, this.isOn))
            {
                if (actor is Projectile)
                {
                    if (actor is ShurikenProjectile && this.isToggleBox)
                    {
                        room.colors.ToggleColor(this.toggleBR);
                    }
                    return(TileProjectileImpact.RunImpact((Projectile)actor, gridX, gridY, dir));
                }

                TileSolidImpact.RunImpact(actor, gridX, gridY, dir);

                // If a ToggleBox was hit from below:
                if (this.isToggleBox && dir == DirCardinal.Up)
                {
                    room.colors.ToggleColor(this.toggleBR);
                }

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

                return(true);
            }

            return(false);
        }
Esempio n. 4
0
        public override bool RunImpact(RoomScene room, GameObject actor, short gridX, short gridY, DirCardinal dir)
        {
            if (actor is Projectile)
            {
                if (actor is GloveProjectile)
                {
                    this.DestroyBox(room, gridX, gridY);
                    return(false);
                }
                return(TileProjectileImpact.RunImpact((Projectile)actor, gridX, gridY, dir));
            }

            // Slam-Down Action can break boxes.
            if (actor is Character && ((Character)actor).status.action is SlamAction)
            {
                this.DestroyBox(room, gridX, gridY);
                return(true);
            }

            // Destroy Box
            if (dir == DirCardinal.Up)
            {
                BlockTile.DamageAbove(room, gridX, gridY);
                this.DestroyBox(room, gridX, gridY);
            }

            return(base.RunImpact(room, actor, gridX, gridY, dir));
        }
Esempio n. 5
0
        public override bool RunImpact(RoomScene room, GameObject actor, short gridX, short gridY, DirCardinal dir)
        {
            if (actor is Projectile)
            {
                return(TileProjectileImpact.RunImpact((Projectile)actor, gridX, gridY, dir));
            }

            if (actor is Character)
            {
                TileSolidImpact.RunImpact(actor, gridX, gridY, dir);
                return(TileCharBasicImpact.RunWallImpact((Character)actor, dir));
            }

            return(TileSolidImpact.RunImpact(actor, gridX, gridY, dir));
        }
Esempio n. 6
0
        public override bool RunImpact(RoomScene room, GameObject actor, short gridX, short gridY, DirCardinal dir)
        {
            if (actor is Projectile)
            {
                return(TileProjectileImpact.RunImpact((Projectile)actor, gridX, gridY, dir));
            }

            bool collided = base.RunImpact(room, actor, gridX, gridY, dir);

            if (actor is Character)
            {
                TileCharBasicImpact.RunWallImpact((Character)actor, dir);                 // Standard Character Tile Collisions
            }

            return(collided);
        }
Esempio n. 7
0
        public override bool RunImpact(RoomScene room, GameObject actor, short gridX, short gridY, DirCardinal dir)
        {
            if (actor is Character)
            {
                TileCharBasicImpact.RunUpwardImpact((Character)actor, dir);
                return(TileSolidImpact.RunImpact(actor, gridX, gridY, dir));
            }

            if (actor is Projectile)
            {
                TileProjectileImpact.RunImpact((Projectile)actor, gridX, gridY, dir);
                return(false);
            }

            // Objects that shouldn't interact with Spring.
            if (actor is EnemyFlight || actor is Platform)
            {
                return(false);
            }

            return(TileSolidImpact.RunImpact(actor, gridX, gridY, dir));
        }
Esempio n. 8
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);
        }