Exemplo n.º 1
0
        public override void Initialize()
        {
            ResetStats();
            List <StaffPart> parts = new List <StaffPart>();

            if (!ornament.front)
            {
                parts.Add(ornament);
            }
            if (!staff.front && !gem.back)
            {
                parts.Add(staff);
            }
            parts.Add(gem);
            if (staff.front || gem.back)
            {
                parts.Add(staff);
            }
            if (ornament.front)
            {
                parts.Add(ornament);
            }
            if (Main.netMode != 2)
            {
                texture = GFX.CombineTextures(new List <Texture2D>()
                {
                    { parts[0].texture },
                    { parts[1].texture },
                    { parts[2].texture }
                }, new List <Point>()
                {
                    { parts[0].GetDrawOrigin(new Point(staff.texture.Width, staff.texture.Height), new Point((int)staff.origin.X, (int)staff.origin.Y), CombinedTextureSize()) },
                    { parts[1].GetDrawOrigin(new Point(staff.texture.Width, staff.texture.Height), new Point((int)staff.origin.X, (int)staff.origin.Y), CombinedTextureSize()) },
                    { parts[2].GetDrawOrigin(new Point(staff.texture.Width, staff.texture.Height), new Point((int)staff.origin.X, (int)staff.origin.Y), CombinedTextureSize()) }
                }, CombinedTextureSize());
            }
            if (Main.netMode != 2)
            {
                item.width = texture.Width;
            }
            if (Main.netMode != 2)
            {
                item.height = texture.Height;
            }
            item.shoot      = gem.shoot;
            item.shootSpeed = staff.shootSpeed;
            item.GetGlobalItem <kItem>().ApplyStats(item, true);
        }
Exemplo n.º 2
0
 public override void Initialize()
 {
     try
     {
         ResetStats();
         if (Main.netMode != 2)
         {
             texture = GFX.CombineTextures(new List <Texture2D>()
             {
                 { blade.texture },
                 { hilt.texture },
                 { accent.texture }
             }, new List <Point>()
             {
                 { new Point(CombinedTextureSize().X - blade.texture.Width, 0) },
                 { new Point(0, CombinedTextureSize().Y - hilt.texture.Height) },
                 { new Point((int)hilt.origin.X + hilt.accentOffset.X - (int)accent.origin.X, hilt.accentOffset.Y + CombinedTextureSize().Y - hilt.texture.Height + (int)hilt.origin.Y - (int)accent.origin.Y) }
             }, CombinedTextureSize());
         }
         if (Main.netMode != 2)
         {
             item.width = texture.Width;
         }
         if (Main.netMode != 2)
         {
             item.height = texture.Height;
         }
         if (accent.type == SwordAccent.gemPurple.type)
         {
             item.melee = false;
             item.magic = true;
         }
         lighted = blade.lighted;
         spear   = hilt.spear && blade.spearable;
         if (spear)
         {
             item.noMelee      = true;
             item.noUseGraphic = true;
             item.useStyle     = 5;
         }
         item.GetGlobalItem <kItem>().ApplyStats(item, true);
     }
     catch (SystemException e)
     {
         ErrorLogger.Log(e.ToString());
         ErrorLogger.Log("Blade|Hilt|Accent" + (blade == null) + (hilt == null) + (accent == null));
     }
 }
Exemplo n.º 3
0
 public override void Initialize()
 {
     this.texture = GFX.CombineTextures(new List <Texture2D>()
     {
         { blade.texture },
         { hilt.spearTexture },
         { accent.texture }
     }, new List <Point>()
     {
         { new Point(CombinedTextureSize().X - blade.texture.Width, 0) },
         { new Point(0, CombinedTextureSize().Y - hilt.spearTexture.Height) },
         { new Point((int)hilt.spearOrigin.X - (int)accent.origin.X, CombinedTextureSize().Y - hilt.spearTexture.Height + (int)hilt.spearOrigin.Y - (int)accent.origin.Y) }
     }, CombinedTextureSize());
     projectile.width  = texture.Width;
     projectile.height = texture.Height;
 }