Пример #1
0
 public override void AddProjectile(String name, ProjectileAnimation projectileAnimation)
 {
     base.AddProjectile(name, projectileAnimation);
     if (Projectile == null)
     {
         Projectile = new Projectile();
     }
     Projectile.AddProjectile(name, projectileAnimation);
     Projectile.DummyTexture = Sprite.DummyTexture;
 }
Пример #2
0
        public override void AddProjectile(String name, ProjectileAnimation projectileAnimation)
        {
            base.AddProjectile(name, projectileAnimation);
            if (name == "cstrum")
            {
                ProjectileStrum = new Projectile();
                ProjectileStrum.AddProjectile(name, projectileAnimation);
                ProjectileStrum.DummyTexture = Sprite.DummyTexture;
            }
            else if (name == "note1")
            {
                if (ProjectileA == null)
                {
                    ProjectileA = new Projectile();

                    ProjectileC = new Projectile();
                }
                ProjectileA.AddProjectile(name, projectileAnimation);
                ProjectileA.DummyTexture = Sprite.DummyTexture;
            }
            else if (name == "note2")
            {
                if (ProjectileB == null)
                {
                    ProjectileB = new Projectile();
                }
                ProjectileB.AddProjectile(name, projectileAnimation);
                ProjectileB.DummyTexture = Sprite.DummyTexture;
            }
            else if (name == "note3")
            {
                ProjectileC.AddProjectile(name, projectileAnimation);
                ProjectileC.DummyTexture = Sprite.DummyTexture;
            }
            else
            {
                if (ProjectileSpecial == null)
                {
                    ProjectileSpecial = new Projectile();
                }
                ProjectileSpecial.AddProjectile(name, projectileAnimation);
                //ProjectileSpecial.SizeRefactor = 2f;
                ProjectileSpecial.DummyTexture = Sprite.DummyTexture;;
            }
        }
Пример #3
0
        // Projectile stuff?!
        //

        public virtual void AddProjectile(String name, ProjectileAnimation projectileAnimation)
        {
        }
Пример #4
0
        protected void particleParse(ContentManager content, String character, Player player, Dictionary <String, Object> moveInfo, Dictionary <String, Texture2D> spriteTextures)
        {
            String name = (String)moveInfo["name"];

            Console.WriteLine("Parsing particle Name: " + name);
            Texture2D texture = null;

            if (!spriteTextures.TryGetValue((String)moveInfo["sprite"], out texture))
            {
                texture = content.Load <Texture2D>(character + "/" + (String)moveInfo["sprite"]);
                // spriteTextures.Add((String)moveInfo["sprite"], texture);
            }

            ProjectileAnimation newMove;

            newMove = new ProjectileAnimation(
                texture,
                int.Parse((String)moveInfo["XImageStart"]),
                int.Parse((String)moveInfo["YImageStart"]),
                int.Parse((String)moveInfo["Width"]),
                int.Parse((String)moveInfo["Height"]),
                int.Parse((String)moveInfo["FrameCount"]),
                int.Parse((String)moveInfo["Columns"]),
                float.Parse((String)moveInfo["FrameLength"]),
                CharacterState.NONE, // Kinda ghetto to set character state as null
                int.Parse((String)moveInfo["TimerLength"]),
                Direction.Right);    // As a default this is prob fine

            if (moveInfo.ContainsKey("PlayOnce"))
            {
                Boolean playOnce = Convert.ToBoolean(moveInfo["PlayOnce"]);
                newMove.PlayOnce = playOnce;
            }

            if (moveInfo.ContainsKey("FrameLengthInfo"))
            {
                String        framelengthString  = (String)moveInfo["FrameLengthInfo"];
                List <String> frameLengthList    = new List <String>(framelengthString.Split(','));
                List <int>    frameLengthIntList = frameLengthList.ConvertAll(s => Int32.Parse(s));
                int[]         frameLengthInfo    = frameLengthIntList.ToArray();

                newMove.SetFrameLengthInfo(frameLengthInfo);
            }
            if (moveInfo.ContainsKey("NextAnimation"))
            {
                newMove.NextAnimation = (String)moveInfo["NextAnimation"];
            }
            if (moveInfo.ContainsKey("Hitbox"))
            {
                List <String> hitInfo = (List <String>)moveInfo["Hitbox"];
                foreach (String hitBox in hitInfo)
                {
                    String[] hitBoxData = hitBox.Split(';');
                    // Console.WriteLine(int.Parse(hurtBoxData[0]));
                    newMove.AddHitboxInfo(int.Parse(hitBoxData[0]),
                                          new Hitbox(hitBoxData[1], hitBoxData[2], hitBoxData[3], hitBoxData[4]));
                }
            }

            Hitzone hitZone;

            //int test = (int)moveInfo["Blockstun"];

            if (moveInfo.ContainsKey("XSpeed"))
            {
                newMove.XSpeed = int.Parse((String)moveInfo["XSpeed"]);
            }

            if (moveInfo.ContainsKey("YSpeed"))
            {
                newMove.YSpeed = int.Parse((String)moveInfo["YSpeed"]);
            }

            if (moveInfo.ContainsKey("Hitzone") && moveInfo.ContainsKey("Hitstun") && moveInfo.ContainsKey("Blockstun"))
            {
                Enum.TryParse((String)moveInfo["Hitzone"], true, out hitZone);
                HitInfo hitMoveInfo = new HitInfo(int.Parse((String)moveInfo["Hitstun"]), int.Parse((String)moveInfo["Blockstun"]), hitZone);
                hitMoveInfo.Damage          = int.Parse((String)moveInfo["Damage"]);
                hitMoveInfo.IsHardKnockDown = Boolean.Parse((String)moveInfo["IsHardKnockDown"]);
                hitMoveInfo.AirUntechTime   = int.Parse((String)moveInfo["AirUntechTime"]);
                hitMoveInfo.AirYVelocity    = int.Parse((String)moveInfo["AirYVelocity"]);
                hitMoveInfo.AirXVelocity    = int.Parse((String)moveInfo["AirXVelocity"]);
                newMove.NumOfHits           = int.Parse((String)moveInfo["NumOfHits"]);
                if (moveInfo.ContainsKey("ForceAirborne"))
                {
                    hitMoveInfo.ForceAirborne = Boolean.Parse((String)moveInfo["ForceAirborne"]);
                }
                if (moveInfo.ContainsKey("Unblockable"))
                {
                    hitMoveInfo.Unblockable = Boolean.Parse((String)moveInfo["Unblockable"]);
                }
                newMove.HitInfo = hitMoveInfo;
            }
            player.AddProjectile(name, newMove);
        }
Пример #5
0
 internal void AddProjectile(String name, ProjectileAnimation projectileAnimation)
 {
     animations.Add(name, projectileAnimation);
 }