Beispiel #1
0
        public override void ModifyDrawing(TerraGuardian tg, GuardianSpecialAttackData d)
        {
            CaptainStenchBase.CaptainStenchData data =
                (CaptainStenchBase.CaptainStenchData)tg.Data;
            switch (data.SwordID)
            {
            case CaptainStenchBase.RubyFalchion:
            {
                if (d.Step >= 4)
                {
                    int       WhipFrame = d.Step - 4;
                    Texture2D texture   = tg.GetExtraTexture(CaptainStenchBase.RubyGPTextureID);
                    if (WhipFrame >= 0 && WhipFrame < 6)
                    {
                        Vector2 WhipPos = tg.CenterPosition - Main.screenPosition;
                        WhipPos.X += 40 * tg.Direction;
                        GuardianDrawData gdd = new GuardianDrawData(GuardianDrawData.TextureType.TGExtra, texture, WhipPos,
                                                                    new Rectangle(160 * WhipFrame, 0, 160, 160), Color.White, 0f, new Vector2(80, 80), tg.Scale,
                                                                    (tg.LookingLeft ? SpriteEffects.FlipHorizontally : SpriteEffects.None));
                        TerraGuardian.DrawFront.Add(gdd);
                    }
                    if (tg.HasBuff(Terraria.ModLoader.ModContent.BuffType <Buffs.DrainingHealth>()))
                    {
                        int SiphonFrame = d.Step - 5;
                        if (SiphonFrame >= 0 && SiphonFrame < 7)
                        {
                            GuardianDrawData gdd = new GuardianDrawData(GuardianDrawData.TextureType.TGExtra, texture, tg.Position - Main.screenPosition,
                                                                        new Rectangle(160 * SiphonFrame, 160, 160, 160), Color.White, 0f, new Vector2(80, 160), tg.Scale,
                                                                        (tg.LookingLeft ? SpriteEffects.FlipHorizontally : SpriteEffects.None));
                            TerraGuardian.DrawFront.Add(gdd);
                        }
                    }
                }
            }
            break;

            case CaptainStenchBase.DiamondFalchion:
            {
                int FlashFrame = (int)(((d.Step - 4) * AnimationTime + d.Time) * (1f / AnimationTime) * 0.5f);
                if (FlashFrame >= 0 && FlashFrame < 8)
                {
                    Texture2D        texture = tg.GetExtraTexture(CaptainStenchBase.DiamondGPTextureID);
                    GuardianDrawData gdd     = new GuardianDrawData(GuardianDrawData.TextureType.TGExtra, texture, tg.CenterPosition - Main.screenPosition,
                                                                    new Rectangle(200 * FlashFrame, 0, 200, 200), Color.White, 0f, new Vector2(100, 100), tg.Scale,
                                                                    (tg.LookingLeft ? SpriteEffects.FlipHorizontally : SpriteEffects.None));
                    TerraGuardian.DrawFront.Add(gdd);
                    FlashFrame++;
                    gdd = new GuardianDrawData(GuardianDrawData.TextureType.TGExtra, texture, tg.CenterPosition - Main.screenPosition,
                                               new Rectangle(200 * FlashFrame, 200, 200, 200), Color.White, 0f, new Vector2(100, 100), tg.Scale,
                                               (tg.LookingLeft ? SpriteEffects.FlipHorizontally : SpriteEffects.None));
                    TerraGuardian.DrawFront.Add(gdd);
                }
            }
            break;
            }
        }