예제 #1
0
        //30sec ttl
        /// <summary>
        /// Super constructor for enemies. You must call it in subclasses
        /// </summary>
        /// <param name="_location">Screen location</param>
        /// <param name="_pattern">Move pattern to use</param>
        /// <param name="_scrollValue">Scroll value trigger</param>
        /// <param name="flags">Flags to set on death</param>
        /// <param name="flip">Type of flip</param>
        /// <param name="scale">Sprite scaling (use Vector2.One if not necessary)</param>
        /// <param name="speed">Speed of the enemy</param>
        /// <param name="spriteSrc">Spritesheet rectangle selection</param>
        /// <param name="_bonusDroppedOnDeath">Bonus the enemy will drop on death</param>
        /// <param name="weapon">Enemy weapon</param>
        protected BadGuy(Vector2 _location, Vector2 _scrollValue, Bonus _bonusDroppedOnDeath, MovePattern _pattern, String[] flags, SpriteEffects flip, Rectangle spriteSrc, Vector2 speed, Vector2 scale, Weapon weapon)
            : base(_location, spriteSrc, speed, scale, 0.0f, 30000f)
        {
            this.dropOnDeath = _bonusDroppedOnDeath;
            this.movePattern = _pattern;
            this.scrollValue = _scrollValue;
            this.Flags = flags;

            if (_pattern != null)
            {
                bounce = false;
            }
            else
            {
                bounce = true;
            }

            this.onScreen = false;
            this.rotation = 0.0f;

            this.Flip = flip;
            this.Weapon = weapon;

            if (this.Weapon != null)
            {
                this.Weapon.Flip = flip;
            }

            this.Hitbox = new SquareHitbox(this);
            this.Removable = true;
            this.InfiniteMovePattern = false;
            this.Difficulty = 0;
            this.ttl = 120000;
            this.FiringLocation = Vectors.ConvertPointToVector2(DstRect.Center);
        }
예제 #2
0
        /// <summary>
        /// Super constructor for enemies. You must call it in subclasses
        /// </summary>
        /// <param name="_location">Screen location</param>
        /// <param name="_pattern">Move pattern to use</param>
        /// <param name="_scrollValue">Scroll value trigger</param>
        /// <param name="flags">Flags to set on death</param>
        /// <param name="flip">Type of flip</param>
        /// <param name="scale">Sprite scaling (use Vector2.One if not necessary)</param>
        /// <param name="speed">Speed of the enemy</param>
        /// <param name="spriteSrc">Spritesheet rectangle selection</param>
        /// <param name="_bonusDroppedOnDeath">Bonus the enemy will drop on death</param>
        /// <param name="weapon">Enemy weapon</param>
        protected BadGuy(Vector2 _location, Vector2 _scrollValue, Bonus _bonusDroppedOnDeath, MovePattern _pattern, String[] flags, SpriteEffects flip, Rectangle spriteSrc, Vector2 speed, Vector2 scale, Weapon weapon) :
            base(_location, spriteSrc, speed, scale, 0.0f, 30000f) //30sec ttl
        {
            this.dropOnDeath = _bonusDroppedOnDeath;
            this.movePattern = _pattern;
            this.scrollValue = _scrollValue;
            this.Flags = flags;

            if (_pattern != null)
            {
                bounce = false;
            }
            else
            {
                bounce = true;
            }

            this.onScreen = false;
            this.rotation = 0.0f;

            this.Flip = flip;
            this.Weapon = weapon;

            if (this.Weapon != null)
            {
                this.Weapon.Flip = flip;
            }

            this.Hitbox = new SquareHitbox(this);
            this.Removable = true;
            this.InfiniteMovePattern = false;
            this.Difficulty = 0;
            this.ttl = 120000;
            this.FiringLocation = Vectors.ConvertPointToVector2(DstRect.Center);
        }
예제 #3
0
        /// <summary>
        /// Convert nodes in a move pattern
        /// </summary>
        /// <param name="nodes"></param>
        /// <returns></returns>
        public static MovePattern ConvertToMovePattern(Node[] nodes)
        {
            MovePattern mp = new MovePattern();

            foreach (Node n in nodes)
            {
                mp.AddPoint(n.Point);
            }

            return mp;
        }
예제 #4
0
 /// <summary>
 /// Return instance of the given enemy type
 /// </summary>
 /// <param name="type"></param>
 /// <returns></returns>
 public static BadGuy String2BadGuy(String type, Vector2 location, Bonus bonus, MovePattern pattern, SpriteEffects flip, String[] flags)
 {
     if (type.Equals(typeof(Poulpi).Name.ToString()))
     {
         return new Poulpi(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(PoulpiMexico).Name.ToString()))
     {
         return new PoulpiMexico(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(PoulpiZombie).Name.ToString()))
     {
         return new PoulpiZombie(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(PoulpiMarin).Name.ToString()))
     {
         return new PoulpiMarin(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(PoulpiSnow).Name.ToString()))
     {
         return new PoulpiSnow(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(PoulpiFrozen).Name.ToString()))
     {
         return new PoulpiFrozen(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(PoulpiKnight).Name.ToString()))
     {
         return new PoulpiKnight(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(PoulpElite).Name.ToString()))
     {
         return new PoulpElite(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(Pepito).Name.ToString()))
     {
         return new Pepito(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(Bird).Name.ToString()))
     {
         return new Bird(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(Caca).Name.ToString()))
     {
         return new Caca(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(Moustik).Name.ToString()))
     {
         return new Moustik(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(Pirate).Name.ToString()))
     {
         return new Pirate(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(AirFighter).Name.ToString()))
     {
         return new AirFighter(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(Rock).Name.ToString()))
     {
         return new Rock(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(RockDoor).Name.ToString()))
     {
         return new RockDoor(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(BouleEpine).Name.ToString()))
     {
         return new BouleEpine(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(CactusMan).Name.ToString()))
     {
         return new CactusMan(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(Canon).Name.ToString()))
     {
         return new Canon(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(RockDoor).Name.ToString()))
     {
         return new RockDoor(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(BouleEpine).Name.ToString()))
     {
         return new BouleEpine(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(CactusMan).Name.ToString()))
     {
         return new CactusMan(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(Pumpkin).Name.ToString()))
     {
         return new Pumpkin(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(McBernickZombie).Name.ToString()))
     {
         return new McBernickZombie(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(McBernick).Name.ToString()))
     {
         return new McBernick(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(Avalanche).Name.ToString()))
     {
         return new Avalanche(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(Trainee).Name.ToString()))
     {
         return new Trainee(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(Witch).Name.ToString()))
     {
         return new Witch(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(Flipper).Name.ToString()))
     {
         return new Flipper(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(FlipperZombie).Name.ToString()))
     {
         return new FlipperZombie(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(EtoileMer).Name.ToString()))
     {
         return new EtoileMer(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(CowLauncher).Name.ToString()))
     {
         return new CowLauncher(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(LittleUndergroundCreature).Name.ToString()))
     {
         return new LittleUndergroundCreature(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(Cow).Name.ToString()))
     {
         return new Cow(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(RandomCow).Name.ToString()))
     {
         return new RandomCow(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(FireSkull).Name.ToString()))
     {
         return new FireSkull(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(Pingouin).Name.ToString()))
     {
         return new Pingouin(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(PingouinLauncher).Name.ToString()))
     {
         return new PingouinLauncher(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(Yeti).Name.ToString()))
     {
         return new Yeti(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(SapinLauncher).Name.ToString()))
     {
         return new SapinLauncher(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(RockLauncher).Name.ToString()))
     {
         return new RockLauncher(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(BN).Name.ToString()))
     {
         return new BN(Vector2.Zero, flags);
     }
     else if (type.Equals(typeof(ElFeroCactae).Name.ToString()))
     {
         return new ElFeroCactae(Vector2.Zero, flags);
     }
     else if (type.Equals(typeof(Ariel).Name.ToString()))
     {
         return new Ariel(Vector2.Zero, flags);
     }
     else if (type.Equals(typeof(KingPoulpi).Name.ToString()))
     {
         return new KingPoulpi(Vector2.Zero, flags);
     }
     else if (type.Equals(typeof(MaskedEsquimo).Name.ToString()))
     {
         return new MaskedEsquimo(Vector2.Zero, flags);
     }
     else if (type.Equals(typeof(Esquimo).Name.ToString()))
     {
         return new Esquimo(Vector2.Zero, flags);
     }
     else if (type.Equals(typeof(Derrick).Name.ToString()))
     {
         return new Derrick(Vector2.Zero, flags);
     }
     else if (type.Equals(typeof(CrazyDoc).Name.ToString()))
     {
         return new CrazyDoc(Vector2.Zero, flags);
     }
     else
     {
         throw new Exception("Invalid TGPA map : Enemy " + type + " not found");
     }
 }
예제 #5
0
 /// <summary>
 /// Return instance of the given enemy type
 /// </summary>
 /// <param name="type"></param>
 /// <returns></returns>
 public static BadGuy Type2BadGuy(Type type, Vector2 location, Bonus bonus, MovePattern pattern, SpriteEffects flip, String[] flags)
 {
     return String2BadGuy(type.ToString(), location, bonus, pattern, flip, flags);
 }
예제 #6
0
 /// <summary>
 /// Return instance of the given enemy type
 /// </summary>
 /// <param name="type"></param>
 /// <returns></returns>
 public static BadGuy Type2BadGuy(Type type, Vector2 location, Bonus bonus, MovePattern pattern, SpriteEffects flip, String[] flags)
 {
     return String2BadGuy(type.ToString(), location, bonus, pattern, flip, flags);
 }
예제 #7
0
 /// <summary>
 /// Return instance of the given enemy type
 /// </summary>
 /// <param name="type"></param>
 /// <returns></returns>
 public static BadGuy String2BadGuy(String type, Vector2 location, Bonus bonus, MovePattern pattern, SpriteEffects flip, String[] flags)
 {
     if (type.Equals(typeof(Poulpi).Name.ToString()))
     {
         return new Poulpi(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(PoulpiMexico).Name.ToString()))
     {
         return new PoulpiMexico(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(PoulpiZombie).Name.ToString()))
     {
         return new PoulpiZombie(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(PoulpiMarin).Name.ToString()))
     {
         return new PoulpiMarin(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(PoulpiSnow).Name.ToString()))
     {
         return new PoulpiSnow(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(PoulpiFrozen).Name.ToString()))
     {
         return new PoulpiFrozen(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(PoulpiKnight).Name.ToString()))
     {
         return new PoulpiKnight(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(PoulpElite).Name.ToString()))
     {
         return new PoulpElite(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(Pepito).Name.ToString()))
     {
         return new Pepito(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(Bird).Name.ToString()))
     {
         return new Bird(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(Caca).Name.ToString()))
     {
         return new Caca(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(Moustik).Name.ToString()))
     {
         return new Moustik(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(Pirate).Name.ToString()))
     {
         return new Pirate(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(AirFighter).Name.ToString()))
     {
         return new AirFighter(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(Rock).Name.ToString()))
     {
         return new Rock(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(RockDoor).Name.ToString()))
     {
         return new RockDoor(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(BouleEpine).Name.ToString()))
     {
         return new BouleEpine(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(CactusMan).Name.ToString()))
     {
         return new CactusMan(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(Canon).Name.ToString()))
     {
         return new Canon(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(RockDoor).Name.ToString()))
     {
         return new RockDoor(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(BouleEpine).Name.ToString()))
     {
         return new BouleEpine(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(CactusMan).Name.ToString()))
     {
         return new CactusMan(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(Pumpkin).Name.ToString()))
     {
         return new Pumpkin(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(McBernickZombie).Name.ToString()))
     {
         return new McBernickZombie(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(McBernick).Name.ToString()))
     {
         return new McBernick(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(Avalanche).Name.ToString()))
     {
         return new Avalanche(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(Trainee).Name.ToString()))
     {
         return new Trainee(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(Witch).Name.ToString()))
     {
         return new Witch(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(Flipper).Name.ToString()))
     {
         return new Flipper(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(FlipperZombie).Name.ToString()))
     {
         return new FlipperZombie(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(EtoileMer).Name.ToString()))
     {
         return new EtoileMer(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(CowLauncher).Name.ToString()))
     {
         return new CowLauncher(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(LittleUndergroundCreature).Name.ToString()))
     {
         return new LittleUndergroundCreature(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(Cow).Name.ToString()))
     {
         return new Cow(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(RandomCow).Name.ToString()))
     {
         return new RandomCow(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(FireSkull).Name.ToString()))
     {
         return new FireSkull(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(Pingouin).Name.ToString()))
     {
         return new Pingouin(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(PingouinLauncher).Name.ToString()))
     {
         return new PingouinLauncher(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(Yeti).Name.ToString()))
     {
         return new Yeti(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(SapinLauncher).Name.ToString()))
     {
         return new SapinLauncher(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(RockLauncher).Name.ToString()))
     {
         return new RockLauncher(location, Vector2.Zero, bonus, pattern, flip, flags);
     }
     else if (type.Equals(typeof(BN).Name.ToString()))
     {
         return new BN(Vector2.Zero, flags);
     }
     else if (type.Equals(typeof(ElFeroCactae).Name.ToString()))
     {
         return new ElFeroCactae(Vector2.Zero, flags);
     }
     else if (type.Equals(typeof(Ariel).Name.ToString()))
     {
         return new Ariel(Vector2.Zero, flags);
     }
     else if (type.Equals(typeof(KingPoulpi).Name.ToString()))
     {
         return new KingPoulpi(Vector2.Zero, flags);
     }
     else if (type.Equals(typeof(MaskedEsquimo).Name.ToString()))
     {
         return new MaskedEsquimo(Vector2.Zero, flags);
     }
     else if (type.Equals(typeof(Esquimo).Name.ToString()))
     {
         return new Esquimo(Vector2.Zero, flags);
     }
     else if (type.Equals(typeof(Derrick).Name.ToString()))
     {
         return new Derrick(Vector2.Zero, flags);
     }
     else if (type.Equals(typeof(CrazyDoc).Name.ToString()))
     {
         return new CrazyDoc(Vector2.Zero, flags);
     }
     else
     {
         throw new Exception("Invalid TGPA map : Enemy " + type + " not found");
     }
 }
예제 #8
0
        /// <summary>
        /// Convert a move pattern in a list of nodes
        /// </summary>
        /// <param name="mp"></param>
        /// <returns></returns>
        public static List<Node> ConvertToNodeList(MovePattern mp)
        {
            List<Node> list = new List<Node>();

            foreach (Point point in mp.Points)
            {
                list.Add(new Node(point));
            }

            return list;
        }